isis_zebra.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  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. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. */
  21. #include <zebra.h>
  22. #include "thread.h"
  23. #include "command.h"
  24. #include "memory.h"
  25. #include "log.h"
  26. #include "if.h"
  27. #include "network.h"
  28. #include "prefix.h"
  29. #include "zclient.h"
  30. #include "stream.h"
  31. #include "linklist.h"
  32. #include "vrf.h"
  33. #include "isisd/dict.h"
  34. #include "isisd/isis_constants.h"
  35. #include "isisd/isis_common.h"
  36. #include "isisd/isis_flags.h"
  37. #include "isisd/isis_misc.h"
  38. #include "isisd/isis_circuit.h"
  39. #include "isisd/isis_tlv.h"
  40. #include "isisd/isisd.h"
  41. #include "isisd/isis_circuit.h"
  42. #include "isisd/isis_csm.h"
  43. #include "isisd/isis_lsp.h"
  44. #include "isisd/isis_route.h"
  45. #include "isisd/isis_zebra.h"
  46. struct zclient *zclient = NULL;
  47. /* Router-id update message from zebra. */
  48. static int
  49. isis_router_id_update_zebra (int command, struct zclient *zclient,
  50. zebra_size_t length, vrf_id_t vrf_id)
  51. {
  52. struct isis_area *area;
  53. struct listnode *node;
  54. struct prefix router_id;
  55. zebra_router_id_update_read (zclient->ibuf, &router_id);
  56. if (isis->router_id == router_id.u.prefix4.s_addr)
  57. return 0;
  58. isis->router_id = router_id.u.prefix4.s_addr;
  59. for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
  60. if (listcount (area->area_addrs) > 0)
  61. lsp_regenerate_schedule (area, area->is_type, 0);
  62. return 0;
  63. }
  64. static int
  65. isis_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length,
  66. vrf_id_t vrf_id)
  67. {
  68. struct interface *ifp;
  69. ifp = zebra_interface_add_read (zclient->ibuf, vrf_id);
  70. if (isis->debugs & DEBUG_ZEBRA)
  71. zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d",
  72. ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric, ifp->mtu);
  73. if (if_is_operative (ifp))
  74. isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
  75. return 0;
  76. }
  77. static int
  78. isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length,
  79. vrf_id_t vrf_id)
  80. {
  81. struct interface *ifp;
  82. struct stream *s;
  83. s = zclient->ibuf;
  84. ifp = zebra_interface_state_read (s, vrf_id);
  85. if (!ifp)
  86. return 0;
  87. if (if_is_operative (ifp))
  88. zlog_warn ("Zebra: got delete of %s, but interface is still up",
  89. ifp->name);
  90. if (isis->debugs & DEBUG_ZEBRA)
  91. zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d",
  92. ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric, ifp->mtu);
  93. isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
  94. /* Cannot call if_delete because we should retain the pseudo interface
  95. in case there is configuration info attached to it. */
  96. if_delete_retain(ifp);
  97. ifp->ifindex = IFINDEX_INTERNAL;
  98. return 0;
  99. }
  100. static int
  101. isis_zebra_if_state_up (int command, struct zclient *zclient,
  102. zebra_size_t length, vrf_id_t vrf_id)
  103. {
  104. struct interface *ifp;
  105. ifp = zebra_interface_state_read (zclient->ibuf, vrf_id);
  106. if (ifp == NULL)
  107. return 0;
  108. isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
  109. return 0;
  110. }
  111. static int
  112. isis_zebra_if_state_down (int command, struct zclient *zclient,
  113. zebra_size_t length, vrf_id_t vrf_id)
  114. {
  115. struct interface *ifp;
  116. struct isis_circuit *circuit;
  117. ifp = zebra_interface_state_read (zclient->ibuf, vrf_id);
  118. if (ifp == NULL)
  119. return 0;
  120. circuit = isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp),
  121. ifp);
  122. if (circuit)
  123. SET_FLAG(circuit->flags, ISIS_CIRCUIT_FLAPPED_AFTER_SPF);
  124. return 0;
  125. }
  126. static int
  127. isis_zebra_if_address_add (int command, struct zclient *zclient,
  128. zebra_size_t length, vrf_id_t vrf_id)
  129. {
  130. struct connected *c;
  131. struct prefix *p;
  132. char buf[BUFSIZ];
  133. c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD,
  134. zclient->ibuf, vrf_id);
  135. if (c == NULL)
  136. return 0;
  137. p = c->address;
  138. prefix2str (p, buf, BUFSIZ);
  139. #ifdef EXTREME_DEBUG
  140. if (p->family == AF_INET)
  141. zlog_debug ("connected IP address %s", buf);
  142. #ifdef HAVE_IPV6
  143. if (p->family == AF_INET6)
  144. zlog_debug ("connected IPv6 address %s", buf);
  145. #endif /* HAVE_IPV6 */
  146. #endif /* EXTREME_DEBUG */
  147. if (if_is_operative (c->ifp))
  148. isis_circuit_add_addr (circuit_scan_by_ifp (c->ifp), c);
  149. return 0;
  150. }
  151. static int
  152. isis_zebra_if_address_del (int command, struct zclient *client,
  153. zebra_size_t length, vrf_id_t vrf_id)
  154. {
  155. struct connected *c;
  156. struct interface *ifp;
  157. #ifdef EXTREME_DEBUG
  158. struct prefix *p;
  159. u_char buf[BUFSIZ];
  160. #endif /* EXTREME_DEBUG */
  161. c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE,
  162. zclient->ibuf, vrf_id);
  163. if (c == NULL)
  164. return 0;
  165. ifp = c->ifp;
  166. #ifdef EXTREME_DEBUG
  167. p = c->address;
  168. prefix2str (p, buf, BUFSIZ);
  169. if (p->family == AF_INET)
  170. zlog_debug ("disconnected IP address %s", buf);
  171. #ifdef HAVE_IPV6
  172. if (p->family == AF_INET6)
  173. zlog_debug ("disconnected IPv6 address %s", buf);
  174. #endif /* HAVE_IPV6 */
  175. #endif /* EXTREME_DEBUG */
  176. if (if_is_operative (ifp))
  177. isis_circuit_del_addr (circuit_scan_by_ifp (ifp), c);
  178. connected_free (c);
  179. return 0;
  180. }
  181. static void
  182. isis_zebra_route_add_ipv4 (struct prefix *prefix,
  183. struct isis_route_info *route_info)
  184. {
  185. u_char message, flags;
  186. int psize;
  187. struct stream *stream;
  188. struct isis_nexthop *nexthop;
  189. struct listnode *node;
  190. if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED))
  191. return;
  192. if (vrf_bitmap_check (zclient->redist[ZEBRA_ROUTE_ISIS], VRF_DEFAULT))
  193. {
  194. message = 0;
  195. flags = 0;
  196. SET_FLAG (message, ZAPI_MESSAGE_NEXTHOP);
  197. SET_FLAG (message, ZAPI_MESSAGE_METRIC);
  198. #if 0
  199. SET_FLAG (message, ZAPI_MESSAGE_DISTANCE);
  200. #endif
  201. stream = zclient->obuf;
  202. stream_reset (stream);
  203. zclient_create_header (stream, ZEBRA_IPV4_ROUTE_ADD, VRF_DEFAULT);
  204. /* type */
  205. stream_putc (stream, ZEBRA_ROUTE_ISIS);
  206. /* flags */
  207. stream_putc (stream, flags);
  208. /* message */
  209. stream_putc (stream, message);
  210. /* SAFI */
  211. stream_putw (stream, SAFI_UNICAST);
  212. /* prefix information */
  213. psize = PSIZE (prefix->prefixlen);
  214. stream_putc (stream, prefix->prefixlen);
  215. stream_write (stream, (u_char *) & prefix->u.prefix4, psize);
  216. stream_putc (stream, listcount (route_info->nexthops));
  217. /* Nexthop, ifindex, distance and metric information */
  218. for (ALL_LIST_ELEMENTS_RO (route_info->nexthops, node, nexthop))
  219. {
  220. /* FIXME: can it be ? */
  221. if (nexthop->ip.s_addr != INADDR_ANY)
  222. {
  223. stream_putc (stream, ZEBRA_NEXTHOP_IPV4);
  224. stream_put_in_addr (stream, &nexthop->ip);
  225. }
  226. else
  227. {
  228. stream_putc (stream, ZEBRA_NEXTHOP_IFINDEX);
  229. stream_putl (stream, nexthop->ifindex);
  230. }
  231. }
  232. #if 0
  233. if (CHECK_FLAG (message, ZAPI_MESSAGE_DISTANCE))
  234. stream_putc (stream, route_info->depth);
  235. #endif
  236. if (CHECK_FLAG (message, ZAPI_MESSAGE_METRIC))
  237. stream_putl (stream, route_info->cost);
  238. stream_putw_at (stream, 0, stream_get_endp (stream));
  239. zclient_send_message(zclient);
  240. SET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
  241. UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_RESYNC);
  242. }
  243. }
  244. static void
  245. isis_zebra_route_del_ipv4 (struct prefix *prefix,
  246. struct isis_route_info *route_info)
  247. {
  248. struct zapi_ipv4 api;
  249. struct prefix_ipv4 prefix4;
  250. if (vrf_bitmap_check (zclient->redist[ZEBRA_ROUTE_ISIS], VRF_DEFAULT))
  251. {
  252. api.vrf_id = VRF_DEFAULT;
  253. api.type = ZEBRA_ROUTE_ISIS;
  254. api.flags = 0;
  255. api.message = 0;
  256. api.safi = SAFI_UNICAST;
  257. prefix4.family = AF_INET;
  258. prefix4.prefixlen = prefix->prefixlen;
  259. prefix4.prefix = prefix->u.prefix4;
  260. zapi_ipv4_route (ZEBRA_IPV4_ROUTE_DELETE, zclient, &prefix4, &api);
  261. }
  262. UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
  263. return;
  264. }
  265. #ifdef HAVE_IPV6
  266. static void
  267. isis_zebra_route_add_ipv6 (struct prefix *prefix,
  268. struct isis_route_info *route_info)
  269. {
  270. struct zapi_ipv6 api;
  271. struct in6_addr **nexthop_list;
  272. unsigned int *ifindex_list;
  273. struct isis_nexthop6 *nexthop6;
  274. int i, size;
  275. struct listnode *node;
  276. struct prefix_ipv6 prefix6;
  277. if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED))
  278. return;
  279. api.vrf_id = VRF_DEFAULT;
  280. api.type = ZEBRA_ROUTE_ISIS;
  281. api.flags = 0;
  282. api.message = 0;
  283. api.safi = SAFI_UNICAST;
  284. SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
  285. SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX);
  286. SET_FLAG (api.message, ZAPI_MESSAGE_METRIC);
  287. api.metric = route_info->cost;
  288. #if 0
  289. SET_FLAG (api.message, ZAPI_MESSAGE_DISTANCE);
  290. api.distance = route_info->depth;
  291. #endif
  292. api.nexthop_num = listcount (route_info->nexthops6);
  293. api.ifindex_num = listcount (route_info->nexthops6);
  294. /* allocate memory for nexthop_list */
  295. size = sizeof (struct isis_nexthop6 *) * listcount (route_info->nexthops6);
  296. nexthop_list = (struct in6_addr **) XMALLOC (MTYPE_ISIS_TMP, size);
  297. if (!nexthop_list)
  298. {
  299. zlog_err ("isis_zebra_add_route_ipv6: out of memory!");
  300. return;
  301. }
  302. /* allocate memory for ifindex_list */
  303. size = sizeof (unsigned int) * listcount (route_info->nexthops6);
  304. ifindex_list = (unsigned int *) XMALLOC (MTYPE_ISIS_TMP, size);
  305. if (!ifindex_list)
  306. {
  307. zlog_err ("isis_zebra_add_route_ipv6: out of memory!");
  308. XFREE (MTYPE_ISIS_TMP, nexthop_list);
  309. return;
  310. }
  311. /* for each nexthop */
  312. i = 0;
  313. for (ALL_LIST_ELEMENTS_RO (route_info->nexthops6, node, nexthop6))
  314. {
  315. if (!IN6_IS_ADDR_LINKLOCAL (&nexthop6->ip6) &&
  316. !IN6_IS_ADDR_UNSPECIFIED (&nexthop6->ip6))
  317. {
  318. api.nexthop_num--;
  319. api.ifindex_num--;
  320. continue;
  321. }
  322. nexthop_list[i] = &nexthop6->ip6;
  323. ifindex_list[i] = nexthop6->ifindex;
  324. i++;
  325. }
  326. api.nexthop = nexthop_list;
  327. api.ifindex = ifindex_list;
  328. if (api.nexthop_num && api.ifindex_num)
  329. {
  330. prefix6.family = AF_INET6;
  331. prefix6.prefixlen = prefix->prefixlen;
  332. memcpy (&prefix6.prefix, &prefix->u.prefix6, sizeof (struct in6_addr));
  333. zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, &prefix6, &api);
  334. SET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
  335. UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_RESYNC);
  336. }
  337. XFREE (MTYPE_ISIS_TMP, nexthop_list);
  338. XFREE (MTYPE_ISIS_TMP, ifindex_list);
  339. return;
  340. }
  341. static void
  342. isis_zebra_route_del_ipv6 (struct prefix *prefix,
  343. struct isis_route_info *route_info)
  344. {
  345. struct zapi_ipv6 api;
  346. struct in6_addr **nexthop_list;
  347. unsigned int *ifindex_list;
  348. struct isis_nexthop6 *nexthop6;
  349. int i, size;
  350. struct listnode *node;
  351. struct prefix_ipv6 prefix6;
  352. if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED))
  353. return;
  354. api.vrf_id = VRF_DEFAULT;
  355. api.type = ZEBRA_ROUTE_ISIS;
  356. api.flags = 0;
  357. api.message = 0;
  358. api.safi = SAFI_UNICAST;
  359. SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
  360. SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX);
  361. api.nexthop_num = listcount (route_info->nexthops6);
  362. api.ifindex_num = listcount (route_info->nexthops6);
  363. /* allocate memory for nexthop_list */
  364. size = sizeof (struct isis_nexthop6 *) * listcount (route_info->nexthops6);
  365. nexthop_list = (struct in6_addr **) XMALLOC (MTYPE_ISIS_TMP, size);
  366. if (!nexthop_list)
  367. {
  368. zlog_err ("isis_zebra_route_del_ipv6: out of memory!");
  369. return;
  370. }
  371. /* allocate memory for ifindex_list */
  372. size = sizeof (unsigned int) * listcount (route_info->nexthops6);
  373. ifindex_list = (unsigned int *) XMALLOC (MTYPE_ISIS_TMP, size);
  374. if (!ifindex_list)
  375. {
  376. zlog_err ("isis_zebra_route_del_ipv6: out of memory!");
  377. XFREE (MTYPE_ISIS_TMP, nexthop_list);
  378. return;
  379. }
  380. /* for each nexthop */
  381. i = 0;
  382. for (ALL_LIST_ELEMENTS_RO (route_info->nexthops6, node, nexthop6))
  383. {
  384. if (!IN6_IS_ADDR_LINKLOCAL (&nexthop6->ip6) &&
  385. !IN6_IS_ADDR_UNSPECIFIED (&nexthop6->ip6))
  386. {
  387. api.nexthop_num--;
  388. api.ifindex_num--;
  389. continue;
  390. }
  391. nexthop_list[i] = &nexthop6->ip6;
  392. ifindex_list[i] = nexthop6->ifindex;
  393. i++;
  394. }
  395. api.nexthop = nexthop_list;
  396. api.ifindex = ifindex_list;
  397. if (api.nexthop_num && api.ifindex_num)
  398. {
  399. prefix6.family = AF_INET6;
  400. prefix6.prefixlen = prefix->prefixlen;
  401. memcpy (&prefix6.prefix, &prefix->u.prefix6, sizeof (struct in6_addr));
  402. zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient, &prefix6, &api);
  403. UNSET_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
  404. }
  405. XFREE (MTYPE_ISIS_TMP, nexthop_list);
  406. XFREE (MTYPE_ISIS_TMP, ifindex_list);
  407. }
  408. #endif /* HAVE_IPV6 */
  409. void
  410. isis_zebra_route_update (struct prefix *prefix,
  411. struct isis_route_info *route_info)
  412. {
  413. if (zclient->sock < 0)
  414. return;
  415. if (!vrf_bitmap_check (zclient->redist[ZEBRA_ROUTE_ISIS], VRF_DEFAULT))
  416. return;
  417. if (CHECK_FLAG (route_info->flag, ISIS_ROUTE_FLAG_ACTIVE))
  418. {
  419. if (prefix->family == AF_INET)
  420. isis_zebra_route_add_ipv4 (prefix, route_info);
  421. #ifdef HAVE_IPV6
  422. else if (prefix->family == AF_INET6)
  423. isis_zebra_route_add_ipv6 (prefix, route_info);
  424. #endif /* HAVE_IPV6 */
  425. }
  426. else
  427. {
  428. if (prefix->family == AF_INET)
  429. isis_zebra_route_del_ipv4 (prefix, route_info);
  430. #ifdef HAVE_IPV6
  431. else if (prefix->family == AF_INET6)
  432. isis_zebra_route_del_ipv6 (prefix, route_info);
  433. #endif /* HAVE_IPV6 */
  434. }
  435. return;
  436. }
  437. static int
  438. isis_zebra_read_ipv4 (int command, struct zclient *zclient,
  439. zebra_size_t length, vrf_id_t vrf_id)
  440. {
  441. struct stream *stream;
  442. struct zapi_ipv4 api;
  443. struct prefix_ipv4 p;
  444. unsigned long ifindex __attribute__ ((unused));
  445. struct in_addr nexthop __attribute__ ((unused));
  446. stream = zclient->ibuf;
  447. memset (&p, 0, sizeof (struct prefix_ipv4));
  448. ifindex = 0;
  449. api.type = stream_getc (stream);
  450. api.flags = stream_getc (stream);
  451. api.message = stream_getc (stream);
  452. p.family = AF_INET;
  453. p.prefixlen = stream_getc (stream);
  454. stream_get (&p.prefix, stream, PSIZE (p.prefixlen));
  455. if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP))
  456. {
  457. api.nexthop_num = stream_getc (stream);
  458. nexthop.s_addr = stream_get_ipv4 (stream);
  459. }
  460. if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX))
  461. {
  462. api.ifindex_num = stream_getc (stream);
  463. ifindex = stream_getl (stream);
  464. }
  465. if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE))
  466. api.distance = stream_getc (stream);
  467. if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC))
  468. api.metric = stream_getl (stream);
  469. else
  470. api.metric = 0;
  471. if (command == ZEBRA_IPV4_ROUTE_ADD)
  472. {
  473. if (isis->debugs & DEBUG_ZEBRA)
  474. zlog_debug ("IPv4 Route add from Z");
  475. }
  476. return 0;
  477. }
  478. #ifdef HAVE_IPV6
  479. static int
  480. isis_zebra_read_ipv6 (int command, struct zclient *zclient,
  481. zebra_size_t length, vrf_id_t vrf_id)
  482. {
  483. return 0;
  484. }
  485. #endif
  486. #define ISIS_TYPE_IS_REDISTRIBUTED(T) \
  487. T == ZEBRA_ROUTE_MAX ? \
  488. vrf_bitmap_check (zclient->default_information, VRF_DEFAULT) : \
  489. vrf_bitmap_check (zclient->redist[type], VRF_DEFAULT)
  490. int
  491. isis_distribute_list_update (int routetype)
  492. {
  493. return 0;
  494. }
  495. #if 0 /* Not yet. */
  496. static int
  497. isis_redistribute_default_set (int routetype, int metric_type,
  498. int metric_value)
  499. {
  500. return 0;
  501. }
  502. #endif /* 0 */
  503. static void
  504. isis_zebra_connected (struct zclient *zclient)
  505. {
  506. zclient_send_requests (zclient, VRF_DEFAULT);
  507. }
  508. void
  509. isis_zebra_init (struct thread_master *master)
  510. {
  511. zclient = zclient_new (master);
  512. zclient_init (zclient, ZEBRA_ROUTE_ISIS);
  513. zclient->zebra_connected = isis_zebra_connected;
  514. zclient->router_id_update = isis_router_id_update_zebra;
  515. zclient->interface_add = isis_zebra_if_add;
  516. zclient->interface_delete = isis_zebra_if_del;
  517. zclient->interface_up = isis_zebra_if_state_up;
  518. zclient->interface_down = isis_zebra_if_state_down;
  519. zclient->interface_address_add = isis_zebra_if_address_add;
  520. zclient->interface_address_delete = isis_zebra_if_address_del;
  521. zclient->ipv4_route_add = isis_zebra_read_ipv4;
  522. zclient->ipv4_route_delete = isis_zebra_read_ipv4;
  523. #ifdef HAVE_IPV6
  524. zclient->ipv6_route_add = isis_zebra_read_ipv6;
  525. zclient->ipv6_route_delete = isis_zebra_read_ipv6;
  526. #endif /* HAVE_IPV6 */
  527. return;
  528. }