jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IS-IS Rout(e)ing protocol - isis_zebra.c |
| 3 | * |
| 4 | * Copyright (C) 2001,2002 Sampo Saaristo |
| 5 | * Tampere University of Technology |
| 6 | * Institute of Communications Engineering |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public Licenseas published by the Free |
| 10 | * Software Foundation; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful,but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 16 | * more details. |
| 17 | |
| 18 | * You should have received a copy of the GNU General Public License along |
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | */ |
| 22 | |
| 23 | #include <zebra.h> |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 24 | |
| 25 | #include "thread.h" |
| 26 | #include "command.h" |
| 27 | #include "memory.h" |
| 28 | #include "log.h" |
| 29 | #include "if.h" |
| 30 | #include "network.h" |
| 31 | #include "prefix.h" |
| 32 | #include "zclient.h" |
| 33 | #include "stream.h" |
| 34 | #include "linklist.h" |
| 35 | |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 36 | #include "isisd/dict.h" |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 37 | #include "isisd/isis_constants.h" |
| 38 | #include "isisd/isis_common.h" |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 39 | #include "isisd/isisd.h" |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 40 | #include "isisd/isis_circuit.h" |
| 41 | #include "isisd/isis_csm.h" |
| 42 | #include "isisd/isis_route.h" |
| 43 | #include "isisd/isis_zebra.h" |
| 44 | |
| 45 | struct zclient *zclient = NULL; |
| 46 | |
| 47 | extern struct thread_master *master; |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 48 | extern struct isis *isis; |
| 49 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 50 | struct in_addr router_id_zebra; |
| 51 | |
| 52 | /* Router-id update message from zebra. */ |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 53 | static int |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 54 | isis_router_id_update_zebra (int command, struct zclient *zclient, |
| 55 | zebra_size_t length) |
| 56 | { |
| 57 | struct prefix router_id; |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 58 | |
| 59 | zebra_router_id_update_read (zclient->ibuf,&router_id); |
| 60 | router_id_zebra = router_id.u.prefix4; |
| 61 | |
| 62 | /* FIXME: Do we react somehow? */ |
| 63 | return 0; |
| 64 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 65 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 66 | static int |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 67 | isis_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length) |
| 68 | { |
| 69 | struct interface *ifp; |
| 70 | |
| 71 | ifp = zebra_interface_add_read (zclient->ibuf); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 72 | |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 73 | if (isis->debugs & DEBUG_ZEBRA) |
| 74 | zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d", |
Paul Jakma | 41b36e9 | 2006-12-08 01:09:50 +0000 | [diff] [blame] | 75 | ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric, ifp->mtu); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 76 | |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 77 | if (if_is_operative (ifp)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 78 | isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 79 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 80 | return 0; |
| 81 | } |
| 82 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 83 | static int |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 84 | isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length) |
| 85 | { |
| 86 | struct interface *ifp; |
| 87 | struct stream *s; |
| 88 | |
| 89 | s = zclient->ibuf; |
| 90 | ifp = zebra_interface_state_read (s); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 91 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 92 | if (!ifp) |
| 93 | return 0; |
| 94 | |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 95 | if (if_is_operative (ifp)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 96 | zlog_warn ("Zebra: got delete of %s, but interface is still up", |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 97 | ifp->name); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 98 | |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 99 | if (isis->debugs & DEBUG_ZEBRA) |
| 100 | zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d", |
Paul Jakma | 41b36e9 | 2006-12-08 01:09:50 +0000 | [diff] [blame] | 101 | ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric, ifp->mtu); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 102 | |
ajs | d2fc889 | 2005-04-02 18:38:43 +0000 | [diff] [blame] | 103 | |
| 104 | /* Cannot call if_delete because we should retain the pseudo interface |
| 105 | in case there is configuration info attached to it. */ |
| 106 | if_delete_retain(ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 107 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 108 | isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp); |
| 109 | |
ajs | d2fc889 | 2005-04-02 18:38:43 +0000 | [diff] [blame] | 110 | ifp->ifindex = IFINDEX_INTERNAL; |
| 111 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 112 | return 0; |
| 113 | } |
| 114 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 115 | static struct interface * |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 116 | zebra_interface_if_lookup (struct stream *s) |
| 117 | { |
ajs | bd88bf4 | 2005-04-02 23:09:52 +0000 | [diff] [blame] | 118 | char ifname_tmp[INTERFACE_NAMSIZ]; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 119 | |
| 120 | /* Read interface name. */ |
| 121 | stream_get (ifname_tmp, s, INTERFACE_NAMSIZ); |
| 122 | |
ajs | d2fc889 | 2005-04-02 18:38:43 +0000 | [diff] [blame] | 123 | /* And look it up. */ |
ajs | bd88bf4 | 2005-04-02 23:09:52 +0000 | [diff] [blame] | 124 | return if_lookup_by_name_len(ifname_tmp, |
| 125 | strnlen(ifname_tmp, INTERFACE_NAMSIZ)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 126 | } |
| 127 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 128 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 129 | isis_zebra_if_state_up (int command, struct zclient *zclient, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 130 | zebra_size_t length) |
| 131 | { |
| 132 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 133 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 134 | ifp = zebra_interface_if_lookup (zclient->ibuf); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 135 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 136 | if (!ifp) |
| 137 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 138 | |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 139 | if (if_is_operative (ifp)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 140 | { |
| 141 | zebra_interface_if_set_value (zclient->ibuf, ifp); |
hasso | 4660687 | 2004-12-29 19:34:22 +0000 | [diff] [blame] | 142 | /* HT: This is wrong actually. We can't assume that circuit exist |
| 143 | * if we delete circuit during if_state_down event. Needs rethink. |
| 144 | * TODO */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 145 | isis_circuit_update_params (circuit_scan_by_ifp (ifp), ifp); |
| 146 | return 0; |
| 147 | } |
| 148 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 149 | zebra_interface_if_set_value (zclient->ibuf, ifp); |
| 150 | isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 151 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 152 | return 0; |
| 153 | } |
| 154 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 155 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 156 | isis_zebra_if_state_down (int command, struct zclient *zclient, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 157 | zebra_size_t length) |
| 158 | { |
| 159 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 160 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 161 | ifp = zebra_interface_if_lookup (zclient->ibuf); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 162 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 163 | if (ifp == NULL) |
| 164 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 165 | |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 166 | if (if_is_operative (ifp)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 167 | { |
| 168 | zebra_interface_if_set_value (zclient->ibuf, ifp); |
| 169 | isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp); |
| 170 | } |
| 171 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 172 | return 0; |
| 173 | } |
| 174 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 175 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 176 | isis_zebra_if_address_add (int command, struct zclient *zclient, |
| 177 | zebra_size_t length) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 178 | { |
| 179 | struct connected *c; |
| 180 | struct prefix *p; |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 181 | char buf[BUFSIZ]; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 182 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 183 | c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD, |
| 184 | zclient->ibuf); |
| 185 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 186 | if (c == NULL) |
| 187 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 188 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 189 | p = c->address; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 190 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 191 | prefix2str (p, buf, BUFSIZ); |
| 192 | #ifdef EXTREME_DEBUG |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 193 | if (p->family == AF_INET) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 194 | zlog_debug ("connected IP address %s", buf); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 195 | #ifdef HAVE_IPV6 |
| 196 | if (p->family == AF_INET6) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 197 | zlog_debug ("connected IPv6 address %s", buf); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 198 | #endif /* HAVE_IPV6 */ |
| 199 | #endif /* EXTREME_DEBUG */ |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 200 | if (if_is_operative (c->ifp)) |
| 201 | isis_circuit_add_addr (circuit_scan_by_ifp (c->ifp), c); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 202 | |
| 203 | return 0; |
| 204 | } |
| 205 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 206 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 207 | isis_zebra_if_address_del (int command, struct zclient *client, |
| 208 | zebra_size_t length) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 209 | { |
| 210 | struct connected *c; |
| 211 | struct interface *ifp; |
hasso | 1cd8084 | 2004-10-07 20:07:40 +0000 | [diff] [blame] | 212 | #ifdef EXTREME_DEBUG |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 213 | struct prefix *p; |
| 214 | u_char buf[BUFSIZ]; |
hasso | 1cd8084 | 2004-10-07 20:07:40 +0000 | [diff] [blame] | 215 | #endif /* EXTREME_DEBUG */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 216 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 217 | c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE, |
| 218 | zclient->ibuf); |
| 219 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 220 | if (c == NULL) |
| 221 | return 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 222 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 223 | ifp = c->ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 224 | |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 225 | #ifdef EXTREME_DEBUG |
| 226 | p = c->address; |
| 227 | prefix2str (p, buf, BUFSIZ); |
| 228 | |
| 229 | if (p->family == AF_INET) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 230 | zlog_debug ("disconnected IP address %s", buf); |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 231 | #ifdef HAVE_IPV6 |
| 232 | if (p->family == AF_INET6) |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 233 | zlog_debug ("disconnected IPv6 address %s", buf); |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 234 | #endif /* HAVE_IPV6 */ |
| 235 | #endif /* EXTREME_DEBUG */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 236 | |
hasso | b30c5e6 | 2004-12-29 20:06:41 +0000 | [diff] [blame] | 237 | if (if_is_operative (ifp)) |
| 238 | isis_circuit_del_addr (circuit_scan_by_ifp (ifp), c); |
hasso | f891f44 | 2004-09-14 13:54:30 +0000 | [diff] [blame] | 239 | connected_free (c); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 240 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 241 | return 0; |
| 242 | } |
| 243 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 244 | static void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 245 | isis_zebra_route_add_ipv4 (struct prefix *prefix, |
| 246 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 247 | { |
| 248 | u_char message, flags; |
| 249 | int psize; |
| 250 | struct stream *stream; |
| 251 | struct isis_nexthop *nexthop; |
| 252 | struct listnode *node; |
| 253 | |
| 254 | if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC)) |
| 255 | return; |
| 256 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 257 | if (zclient->redist[ZEBRA_ROUTE_ISIS]) |
| 258 | { |
| 259 | message = 0; |
| 260 | flags = 0; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 261 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 262 | SET_FLAG (message, ZAPI_MESSAGE_NEXTHOP); |
| 263 | SET_FLAG (message, ZAPI_MESSAGE_METRIC); |
hasso | 2097cd8 | 2003-12-23 11:51:08 +0000 | [diff] [blame] | 264 | #if 0 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 265 | SET_FLAG (message, ZAPI_MESSAGE_DISTANCE); |
hasso | 2097cd8 | 2003-12-23 11:51:08 +0000 | [diff] [blame] | 266 | #endif |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 267 | |
| 268 | stream = zclient->obuf; |
| 269 | stream_reset (stream); |
paul | d3092e7 | 2006-01-17 17:33:46 +0000 | [diff] [blame] | 270 | zclient_create_header (stream, ZEBRA_IPV4_ROUTE_ADD); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 271 | /* type */ |
| 272 | stream_putc (stream, ZEBRA_ROUTE_ISIS); |
| 273 | /* flags */ |
| 274 | stream_putc (stream, flags); |
| 275 | /* message */ |
| 276 | stream_putc (stream, message); |
Denis Ovsienko | b4e45f6 | 2011-12-05 16:35:14 +0400 | [diff] [blame] | 277 | /* SAFI */ |
| 278 | stream_putw (stream, SAFI_UNICAST); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 279 | /* prefix information */ |
| 280 | psize = PSIZE (prefix->prefixlen); |
| 281 | stream_putc (stream, prefix->prefixlen); |
| 282 | stream_write (stream, (u_char *) & prefix->u.prefix4, psize); |
| 283 | |
| 284 | stream_putc (stream, listcount (route_info->nexthops)); |
| 285 | |
| 286 | /* Nexthop, ifindex, distance and metric information */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 287 | for (ALL_LIST_ELEMENTS_RO (route_info->nexthops, node, nexthop)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 288 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 289 | /* FIXME: can it be ? */ |
| 290 | if (nexthop->ip.s_addr != INADDR_ANY) |
| 291 | { |
| 292 | stream_putc (stream, ZEBRA_NEXTHOP_IPV4); |
| 293 | stream_put_in_addr (stream, &nexthop->ip); |
| 294 | } |
| 295 | else |
| 296 | { |
| 297 | stream_putc (stream, ZEBRA_NEXTHOP_IFINDEX); |
| 298 | stream_putl (stream, nexthop->ifindex); |
| 299 | } |
| 300 | } |
| 301 | #if 0 |
| 302 | if (CHECK_FLAG (message, ZAPI_MESSAGE_DISTANCE)) |
| 303 | stream_putc (stream, route_info->depth); |
| 304 | #endif |
| 305 | if (CHECK_FLAG (message, ZAPI_MESSAGE_METRIC)) |
| 306 | stream_putl (stream, route_info->cost); |
| 307 | |
| 308 | stream_putw_at (stream, 0, stream_get_endp (stream)); |
ajs | 634f9ea | 2005-04-11 15:51:40 +0000 | [diff] [blame] | 309 | zclient_send_message(zclient); |
hasso | fac1f7c | 2005-09-26 18:26:26 +0000 | [diff] [blame] | 310 | SET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 311 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 312 | } |
| 313 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 314 | static void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 315 | isis_zebra_route_del_ipv4 (struct prefix *prefix, |
| 316 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 317 | { |
| 318 | struct zapi_ipv4 api; |
| 319 | struct prefix_ipv4 prefix4; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 320 | |
| 321 | if (zclient->redist[ZEBRA_ROUTE_ISIS]) |
| 322 | { |
| 323 | api.type = ZEBRA_ROUTE_ISIS; |
| 324 | api.flags = 0; |
| 325 | api.message = 0; |
Denis Ovsienko | b4e45f6 | 2011-12-05 16:35:14 +0400 | [diff] [blame] | 326 | api.safi = SAFI_UNICAST; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 327 | prefix4.family = AF_INET; |
| 328 | prefix4.prefixlen = prefix->prefixlen; |
| 329 | prefix4.prefix = prefix->u.prefix4; |
| 330 | zapi_ipv4_route (ZEBRA_IPV4_ROUTE_DELETE, zclient, &prefix4, &api); |
| 331 | } |
hasso | fac1f7c | 2005-09-26 18:26:26 +0000 | [diff] [blame] | 332 | UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 333 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 334 | return; |
| 335 | } |
| 336 | |
| 337 | #ifdef HAVE_IPV6 |
| 338 | void |
| 339 | isis_zebra_route_add_ipv6 (struct prefix *prefix, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 340 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 341 | { |
| 342 | struct zapi_ipv6 api; |
| 343 | struct in6_addr **nexthop_list; |
| 344 | unsigned int *ifindex_list; |
| 345 | struct isis_nexthop6 *nexthop6; |
| 346 | int i, size; |
| 347 | struct listnode *node; |
| 348 | struct prefix_ipv6 prefix6; |
| 349 | |
| 350 | if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC)) |
| 351 | return; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 352 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 353 | api.type = ZEBRA_ROUTE_ISIS; |
| 354 | api.flags = 0; |
| 355 | api.message = 0; |
Denis Ovsienko | b4e45f6 | 2011-12-05 16:35:14 +0400 | [diff] [blame] | 356 | api.safi = SAFI_UNICAST; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 357 | SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); |
| 358 | SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX); |
| 359 | SET_FLAG (api.message, ZAPI_MESSAGE_METRIC); |
| 360 | api.metric = route_info->cost; |
| 361 | #if 0 |
| 362 | SET_FLAG (api.message, ZAPI_MESSAGE_DISTANCE); |
| 363 | api.distance = route_info->depth; |
| 364 | #endif |
| 365 | api.nexthop_num = listcount (route_info->nexthops6); |
| 366 | api.ifindex_num = listcount (route_info->nexthops6); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 367 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 368 | /* allocate memory for nexthop_list */ |
| 369 | size = sizeof (struct isis_nexthop6 *) * listcount (route_info->nexthops6); |
| 370 | nexthop_list = (struct in6_addr **) XMALLOC (MTYPE_ISIS_TMP, size); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 371 | if (!nexthop_list) |
| 372 | { |
| 373 | zlog_err ("isis_zebra_add_route_ipv6: out of memory!"); |
| 374 | return; |
| 375 | } |
| 376 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 377 | /* allocate memory for ifindex_list */ |
| 378 | size = sizeof (unsigned int) * listcount (route_info->nexthops6); |
| 379 | ifindex_list = (unsigned int *) XMALLOC (MTYPE_ISIS_TMP, size); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 380 | if (!ifindex_list) |
| 381 | { |
| 382 | zlog_err ("isis_zebra_add_route_ipv6: out of memory!"); |
| 383 | XFREE (MTYPE_ISIS_TMP, nexthop_list); |
| 384 | return; |
| 385 | } |
| 386 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 387 | /* for each nexthop */ |
| 388 | i = 0; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 389 | for (ALL_LIST_ELEMENTS_RO (route_info->nexthops6, node, nexthop6)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 390 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 391 | if (!IN6_IS_ADDR_LINKLOCAL (&nexthop6->ip6) && |
| 392 | !IN6_IS_ADDR_UNSPECIFIED (&nexthop6->ip6)) |
| 393 | { |
| 394 | api.nexthop_num--; |
| 395 | api.ifindex_num--; |
| 396 | continue; |
| 397 | } |
| 398 | |
| 399 | nexthop_list[i] = &nexthop6->ip6; |
| 400 | ifindex_list[i] = nexthop6->ifindex; |
| 401 | i++; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 402 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 403 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 404 | api.nexthop = nexthop_list; |
| 405 | api.ifindex = ifindex_list; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 406 | |
| 407 | if (api.nexthop_num && api.ifindex_num) |
| 408 | { |
| 409 | prefix6.family = AF_INET6; |
| 410 | prefix6.prefixlen = prefix->prefixlen; |
| 411 | memcpy (&prefix6.prefix, &prefix->u.prefix6, sizeof (struct in6_addr)); |
| 412 | zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, &prefix6, &api); |
| 413 | SET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC); |
| 414 | } |
| 415 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 416 | XFREE (MTYPE_ISIS_TMP, nexthop_list); |
| 417 | XFREE (MTYPE_ISIS_TMP, ifindex_list); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 418 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 419 | return; |
| 420 | } |
| 421 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 422 | static void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 423 | isis_zebra_route_del_ipv6 (struct prefix *prefix, |
| 424 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 425 | { |
| 426 | struct zapi_ipv6 api; |
| 427 | struct in6_addr **nexthop_list; |
| 428 | unsigned int *ifindex_list; |
| 429 | struct isis_nexthop6 *nexthop6; |
| 430 | int i, size; |
| 431 | struct listnode *node; |
| 432 | struct prefix_ipv6 prefix6; |
| 433 | |
| 434 | if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC)) |
| 435 | return; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 436 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 437 | api.type = ZEBRA_ROUTE_ISIS; |
| 438 | api.flags = 0; |
| 439 | api.message = 0; |
Denis Ovsienko | b4e45f6 | 2011-12-05 16:35:14 +0400 | [diff] [blame] | 440 | api.safi = SAFI_UNICAST; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 441 | SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); |
| 442 | SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX); |
| 443 | api.nexthop_num = listcount (route_info->nexthops6); |
| 444 | api.ifindex_num = listcount (route_info->nexthops6); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 445 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 446 | /* allocate memory for nexthop_list */ |
| 447 | size = sizeof (struct isis_nexthop6 *) * listcount (route_info->nexthops6); |
| 448 | nexthop_list = (struct in6_addr **) XMALLOC (MTYPE_ISIS_TMP, size); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 449 | if (!nexthop_list) |
| 450 | { |
| 451 | zlog_err ("isis_zebra_route_del_ipv6: out of memory!"); |
| 452 | return; |
| 453 | } |
| 454 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 455 | /* allocate memory for ifindex_list */ |
| 456 | size = sizeof (unsigned int) * listcount (route_info->nexthops6); |
| 457 | ifindex_list = (unsigned int *) XMALLOC (MTYPE_ISIS_TMP, size); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 458 | if (!ifindex_list) |
| 459 | { |
| 460 | zlog_err ("isis_zebra_route_del_ipv6: out of memory!"); |
| 461 | XFREE (MTYPE_ISIS_TMP, nexthop_list); |
| 462 | return; |
| 463 | } |
| 464 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 465 | /* for each nexthop */ |
| 466 | i = 0; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 467 | for (ALL_LIST_ELEMENTS_RO (route_info->nexthops6, node, nexthop6)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 468 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 469 | if (!IN6_IS_ADDR_LINKLOCAL (&nexthop6->ip6) && |
| 470 | !IN6_IS_ADDR_UNSPECIFIED (&nexthop6->ip6)) |
| 471 | { |
| 472 | api.nexthop_num--; |
| 473 | api.ifindex_num--; |
| 474 | continue; |
| 475 | } |
| 476 | |
| 477 | nexthop_list[i] = &nexthop6->ip6; |
| 478 | ifindex_list[i] = nexthop6->ifindex; |
| 479 | i++; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 480 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 481 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 482 | api.nexthop = nexthop_list; |
| 483 | api.ifindex = ifindex_list; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 484 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 485 | if (api.nexthop_num && api.ifindex_num) |
| 486 | { |
| 487 | prefix6.family = AF_INET6; |
| 488 | prefix6.prefixlen = prefix->prefixlen; |
| 489 | memcpy (&prefix6.prefix, &prefix->u.prefix6, sizeof (struct in6_addr)); |
| 490 | zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient, &prefix6, &api); |
| 491 | UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNC); |
| 492 | } |
| 493 | |
| 494 | XFREE (MTYPE_ISIS_TMP, nexthop_list); |
| 495 | XFREE (MTYPE_ISIS_TMP, ifindex_list); |
| 496 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 497 | |
| 498 | #endif /* HAVE_IPV6 */ |
| 499 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 500 | void |
| 501 | isis_zebra_route_update (struct prefix *prefix, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 502 | struct isis_route_info *route_info) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 503 | { |
| 504 | if (zclient->sock < 0) |
| 505 | return; |
| 506 | |
| 507 | if (!zclient->redist[ZEBRA_ROUTE_ISIS]) |
| 508 | return; |
| 509 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 510 | if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ACTIVE)) |
| 511 | { |
| 512 | if (prefix->family == AF_INET) |
| 513 | isis_zebra_route_add_ipv4 (prefix, route_info); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 514 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 515 | else if (prefix->family == AF_INET6) |
| 516 | isis_zebra_route_add_ipv6 (prefix, route_info); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 517 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 518 | } |
| 519 | else |
| 520 | { |
| 521 | if (prefix->family == AF_INET) |
| 522 | isis_zebra_route_del_ipv4 (prefix, route_info); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 523 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 524 | else if (prefix->family == AF_INET6) |
| 525 | isis_zebra_route_del_ipv6 (prefix, route_info); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 526 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 527 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 528 | return; |
| 529 | } |
| 530 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 531 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 532 | isis_zebra_read_ipv4 (int command, struct zclient *zclient, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 533 | zebra_size_t length) |
| 534 | { |
| 535 | struct stream *stream; |
| 536 | struct zapi_ipv4 api; |
| 537 | struct prefix_ipv4 p; |
| 538 | unsigned long ifindex; |
| 539 | struct in_addr nexthop; |
| 540 | |
| 541 | stream = zclient->ibuf; |
| 542 | memset (&p, 0, sizeof (struct prefix_ipv4)); |
| 543 | ifindex = 0; |
| 544 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 545 | api.type = stream_getc (stream); |
| 546 | api.flags = stream_getc (stream); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 547 | api.message = stream_getc (stream); |
| 548 | |
| 549 | p.family = AF_INET; |
| 550 | p.prefixlen = stream_getc (stream); |
| 551 | stream_get (&p.prefix, stream, PSIZE (p.prefixlen)); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 552 | |
| 553 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP)) |
| 554 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 555 | api.nexthop_num = stream_getc (stream); |
| 556 | nexthop.s_addr = stream_get_ipv4 (stream); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 557 | } |
| 558 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX)) |
| 559 | { |
| 560 | api.ifindex_num = stream_getc (stream); |
| 561 | ifindex = stream_getl (stream); |
| 562 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 563 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE)) |
| 564 | api.distance = stream_getc (stream); |
| 565 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC)) |
| 566 | api.metric = stream_getl (stream); |
| 567 | else |
| 568 | api.metric = 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 569 | |
| 570 | if (command == ZEBRA_IPV4_ROUTE_ADD) |
| 571 | { |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 572 | if (isis->debugs & DEBUG_ZEBRA) |
| 573 | zlog_debug ("IPv4 Route add from Z"); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 574 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 575 | |
| 576 | return 0; |
| 577 | } |
| 578 | |
Paul Jakma | 41b36e9 | 2006-12-08 01:09:50 +0000 | [diff] [blame] | 579 | #ifdef HAVE_IPV6 |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 580 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 581 | isis_zebra_read_ipv6 (int command, struct zclient *zclient, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 582 | zebra_size_t length) |
| 583 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 584 | return 0; |
| 585 | } |
Paul Jakma | 41b36e9 | 2006-12-08 01:09:50 +0000 | [diff] [blame] | 586 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 587 | |
| 588 | #define ISIS_TYPE_IS_REDISTRIBUTED(T) \ |
| 589 | T == ZEBRA_ROUTE_MAX ? zclient->default_information : zclient->redist[type] |
| 590 | |
| 591 | int |
| 592 | isis_distribute_list_update (int routetype) |
| 593 | { |
| 594 | return 0; |
| 595 | } |
| 596 | |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 597 | #if 0 /* Not yet. */ |
| 598 | static int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 599 | isis_redistribute_default_set (int routetype, int metric_type, |
| 600 | int metric_value) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 601 | { |
| 602 | return 0; |
| 603 | } |
hasso | 9236588 | 2005-01-18 13:53:33 +0000 | [diff] [blame] | 604 | #endif /* 0 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 605 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 606 | void |
| 607 | isis_zebra_init () |
| 608 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 609 | zclient = zclient_new (); |
| 610 | zclient_init (zclient, ZEBRA_ROUTE_ISIS); |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 611 | zclient->router_id_update = isis_router_id_update_zebra; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 612 | zclient->interface_add = isis_zebra_if_add; |
| 613 | zclient->interface_delete = isis_zebra_if_del; |
| 614 | zclient->interface_up = isis_zebra_if_state_up; |
| 615 | zclient->interface_down = isis_zebra_if_state_down; |
| 616 | zclient->interface_address_add = isis_zebra_if_address_add; |
| 617 | zclient->interface_address_delete = isis_zebra_if_address_del; |
| 618 | zclient->ipv4_route_add = isis_zebra_read_ipv4; |
| 619 | zclient->ipv4_route_delete = isis_zebra_read_ipv4; |
| 620 | #ifdef HAVE_IPV6 |
| 621 | zclient->ipv6_route_add = isis_zebra_read_ipv6; |
| 622 | zclient->ipv6_route_delete = isis_zebra_read_ipv6; |
| 623 | #endif /* HAVE_IPV6 */ |
| 624 | |
| 625 | return; |
| 626 | } |