paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3 | * |
| 4 | * This file is part of GNU Zebra. |
| 5 | * |
| 6 | * GNU Zebra is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; either version 2, or (at your option) any |
| 9 | * later version. |
| 10 | * |
| 11 | * GNU Zebra is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with GNU Zebra; see the file COPYING. If not, write to the |
| 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | * Boston, MA 02111-1307, USA. |
| 20 | */ |
| 21 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 22 | #include <zebra.h> |
| 23 | |
| 24 | #include "log.h" |
| 25 | #include "vty.h" |
| 26 | #include "command.h" |
| 27 | #include "prefix.h" |
| 28 | #include "stream.h" |
| 29 | #include "zclient.h" |
| 30 | #include "memory.h" |
| 31 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 32 | #include "ospf6_proto.h" |
| 33 | #include "ospf6_top.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 34 | #include "ospf6_interface.h" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 35 | #include "ospf6_route.h" |
| 36 | #include "ospf6_lsa.h" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 37 | #include "ospf6_lsdb.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 38 | #include "ospf6_asbr.h" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 39 | #include "ospf6_zebra.h" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 40 | #include "ospf6d.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 41 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 42 | unsigned char conf_debug_ospf6_zebra = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 43 | |
| 44 | /* information about zebra. */ |
| 45 | struct zclient *zclient = NULL; |
| 46 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 47 | struct in_addr router_id_zebra; |
| 48 | |
| 49 | /* Router-id update message from zebra. */ |
| 50 | int |
| 51 | ospf6_router_id_update_zebra (int command, struct zclient *zclient, |
| 52 | zebra_size_t length) |
| 53 | { |
| 54 | struct prefix router_id; |
| 55 | struct ospf6 *o = ospf6; |
| 56 | |
| 57 | zebra_router_id_update_read(zclient->ibuf,&router_id); |
| 58 | router_id_zebra = router_id.u.prefix4; |
| 59 | |
| 60 | if (o->router_id == 0) |
| 61 | o->router_id = (u_int32_t) router_id_zebra.s_addr; |
| 62 | |
| 63 | return 0; |
| 64 | } |
| 65 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 66 | /* redistribute function */ |
| 67 | void |
| 68 | ospf6_zebra_redistribute (int type) |
| 69 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 70 | if (zclient->redist[type]) |
| 71 | return; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 72 | zclient->redist[type] = 1; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 73 | if (zclient->sock > 0) |
| 74 | zebra_redistribute_send (ZEBRA_REDISTRIBUTE_ADD, zclient->sock, type); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | void |
| 78 | ospf6_zebra_no_redistribute (int type) |
| 79 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 80 | if (! zclient->redist[type]) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 81 | return; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 82 | zclient->redist[type] = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 83 | if (zclient->sock > 0) |
| 84 | zebra_redistribute_send (ZEBRA_REDISTRIBUTE_DELETE, zclient->sock, type); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 85 | } |
| 86 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 87 | /* Inteface addition message from zebra. */ |
| 88 | int |
| 89 | ospf6_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length) |
| 90 | { |
| 91 | struct interface *ifp; |
| 92 | |
| 93 | ifp = zebra_interface_add_read (zclient->ibuf); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 94 | if (IS_OSPF6_DEBUG_ZEBRA (RECV)) |
| 95 | zlog_info ("Zebra Interface add: %s index %d mtu %d", |
hasso | 1203e1c | 2004-07-23 21:34:27 +0000 | [diff] [blame] | 96 | ifp->name, ifp->ifindex, ifp->mtu6); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 97 | ospf6_interface_if_add (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 98 | return 0; |
| 99 | } |
| 100 | |
| 101 | int |
| 102 | ospf6_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length) |
| 103 | { |
| 104 | #if 0 |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 105 | struct interface *ifp; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 106 | |
| 107 | ifp = zebra_interface_delete_read (zclient->ibuf); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 108 | if (IS_OSPF6_DEBUG_ZEBRA (RECV)) |
| 109 | zlog_info ("Zebra Interface delete: %s index %d mtu %d", |
hasso | 1203e1c | 2004-07-23 21:34:27 +0000 | [diff] [blame] | 110 | ifp->name, ifp->ifindex, ifp->mtu6); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 111 | |
| 112 | ospf6_interface_if_del (ifp); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 113 | #endif /*0*/ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 114 | return 0; |
| 115 | } |
| 116 | |
| 117 | int |
| 118 | ospf6_zebra_if_state_update (int command, struct zclient *zclient, |
| 119 | zebra_size_t length) |
| 120 | { |
| 121 | struct interface *ifp; |
| 122 | |
| 123 | ifp = zebra_interface_state_read (zclient->ibuf); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 124 | if (IS_OSPF6_DEBUG_ZEBRA (RECV)) |
| 125 | zlog_info ("Zebra Interface state change: " |
| 126 | "%s index %d flags %ld metric %d mtu %d", |
hasso | 1203e1c | 2004-07-23 21:34:27 +0000 | [diff] [blame] | 127 | ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu6); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 128 | |
| 129 | ospf6_interface_state_update (ifp); |
| 130 | return 0; |
| 131 | } |
| 132 | |
| 133 | int |
| 134 | ospf6_zebra_if_address_update_add (int command, struct zclient *zclient, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 135 | zebra_size_t length) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 136 | { |
| 137 | struct connected *c; |
| 138 | char buf[128]; |
| 139 | |
paul | 0a58935 | 2004-05-08 11:48:26 +0000 | [diff] [blame] | 140 | c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD, zclient->ibuf); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 141 | if (c == NULL) |
| 142 | return 0; |
| 143 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 144 | if (IS_OSPF6_DEBUG_ZEBRA (RECV)) |
| 145 | zlog_info ("Zebra Interface address add: %s %5s %s/%d", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 146 | c->ifp->name, prefix_family_str (c->address), |
| 147 | inet_ntop (c->address->family, &c->address->u.prefix, |
| 148 | buf, sizeof (buf)), c->address->prefixlen); |
| 149 | |
| 150 | if (c->address->family == AF_INET6) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 151 | ospf6_interface_connected_route_update (c->ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 152 | |
| 153 | return 0; |
| 154 | } |
| 155 | |
| 156 | int |
| 157 | ospf6_zebra_if_address_update_delete (int command, struct zclient *zclient, |
| 158 | zebra_size_t length) |
| 159 | { |
| 160 | struct connected *c; |
| 161 | char buf[128]; |
| 162 | |
paul | 0a58935 | 2004-05-08 11:48:26 +0000 | [diff] [blame] | 163 | c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE, zclient->ibuf); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 164 | if (c == NULL) |
| 165 | return 0; |
| 166 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 167 | if (IS_OSPF6_DEBUG_ZEBRA (RECV)) |
| 168 | zlog_info ("Zebra Interface address delete: %s %5s %s/%d", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 169 | c->ifp->name, prefix_family_str (c->address), |
| 170 | inet_ntop (c->address->family, &c->address->u.prefix, |
| 171 | buf, sizeof (buf)), c->address->prefixlen); |
| 172 | |
| 173 | if (c->address->family == AF_INET6) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 174 | ospf6_interface_connected_route_update (c->ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 175 | |
| 176 | return 0; |
| 177 | } |
| 178 | |
| 179 | |
| 180 | |
| 181 | const char *zebra_route_name[ZEBRA_ROUTE_MAX] = |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 182 | { "System", "Kernel", "Connect", "Static", "RIP", "RIPng", "OSPF", |
hasso | f3f27f6 | 2004-09-10 18:07:57 +0000 | [diff] [blame] | 183 | "OSPF6", "ISIS", "BGP" }; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 184 | |
| 185 | const char *zebra_route_abname[ZEBRA_ROUTE_MAX] = |
hasso | f3f27f6 | 2004-09-10 18:07:57 +0000 | [diff] [blame] | 186 | { "X", "K", "C", "S", "r", "R", "o", "O", "I", "B" }; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 187 | |
| 188 | int |
| 189 | ospf6_zebra_read_ipv6 (int command, struct zclient *zclient, |
| 190 | zebra_size_t length) |
| 191 | { |
| 192 | struct stream *s; |
| 193 | struct zapi_ipv6 api; |
| 194 | unsigned long ifindex; |
| 195 | struct prefix_ipv6 p; |
| 196 | struct in6_addr *nexthop; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 197 | |
| 198 | s = zclient->ibuf; |
| 199 | ifindex = 0; |
| 200 | nexthop = NULL; |
| 201 | memset (&api, 0, sizeof (api)); |
| 202 | |
| 203 | /* Type, flags, message. */ |
| 204 | api.type = stream_getc (s); |
| 205 | api.flags = stream_getc (s); |
| 206 | api.message = stream_getc (s); |
| 207 | |
| 208 | /* IPv6 prefix. */ |
| 209 | memset (&p, 0, sizeof (struct prefix_ipv6)); |
| 210 | p.family = AF_INET6; |
| 211 | p.prefixlen = stream_getc (s); |
| 212 | stream_get (&p.prefix, s, PSIZE (p.prefixlen)); |
| 213 | |
| 214 | /* Nexthop, ifindex, distance, metric. */ |
| 215 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP)) |
| 216 | { |
| 217 | api.nexthop_num = stream_getc (s); |
| 218 | nexthop = (struct in6_addr *) |
| 219 | malloc (api.nexthop_num * sizeof (struct in6_addr)); |
| 220 | stream_get (nexthop, s, api.nexthop_num * sizeof (struct in6_addr)); |
| 221 | } |
| 222 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX)) |
| 223 | { |
| 224 | api.ifindex_num = stream_getc (s); |
| 225 | ifindex = stream_getl (s); |
| 226 | } |
| 227 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE)) |
| 228 | api.distance = stream_getc (s); |
| 229 | else |
| 230 | api.distance = 0; |
| 231 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC)) |
| 232 | api.metric = stream_getl (s); |
| 233 | else |
| 234 | api.metric = 0; |
| 235 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 236 | if (IS_OSPF6_DEBUG_ZEBRA (RECV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 237 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 238 | char prefixstr[128], nexthopstr[128]; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 239 | prefix2str ((struct prefix *)&p, prefixstr, sizeof (prefixstr)); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 240 | if (nexthop) |
| 241 | inet_ntop (AF_INET6, nexthop, nexthopstr, sizeof (nexthopstr)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 242 | else |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 243 | snprintf (nexthopstr, sizeof (nexthopstr), "::"); |
| 244 | |
| 245 | zlog_info ("Zebra Receive route %s: %s %s nexthop %s ifindex %ld", |
| 246 | (command == ZEBRA_IPV6_ROUTE_ADD ? "add" : "delete"), |
| 247 | zebra_route_name[api.type], prefixstr, nexthopstr, ifindex); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | if (command == ZEBRA_IPV6_ROUTE_ADD) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 251 | ospf6_asbr_redistribute_add (api.type, ifindex, (struct prefix *) &p, |
| 252 | api.nexthop_num, nexthop); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 253 | else |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 254 | ospf6_asbr_redistribute_remove (api.type, ifindex, (struct prefix *) &p); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 255 | |
| 256 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP)) |
| 257 | free (nexthop); |
| 258 | |
| 259 | return 0; |
| 260 | } |
| 261 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 262 | |
| 263 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 264 | |
| 265 | DEFUN (show_zebra, |
| 266 | show_zebra_cmd, |
| 267 | "show zebra", |
| 268 | SHOW_STR |
| 269 | "Zebra information\n") |
| 270 | { |
| 271 | int i; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 272 | if (zclient == NULL) |
| 273 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 274 | vty_out (vty, "Not connected to zebra%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 275 | return CMD_SUCCESS; |
| 276 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 277 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 278 | vty_out (vty, "Zebra Infomation%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 279 | vty_out (vty, " enable: %d fail: %d%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 280 | zclient->enable, zclient->fail, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 281 | vty_out (vty, " redistribute default: %d%s", zclient->redist_default, |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 282 | VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 283 | vty_out (vty, " redistribute:"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 284 | for (i = 0; i < ZEBRA_ROUTE_MAX; i++) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 285 | { |
| 286 | if (zclient->redist[i]) |
| 287 | vty_out (vty, " %s", zebra_route_name[i]); |
| 288 | } |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 289 | vty_out (vty, "%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 290 | return CMD_SUCCESS; |
| 291 | } |
| 292 | |
| 293 | DEFUN (router_zebra, |
| 294 | router_zebra_cmd, |
| 295 | "router zebra", |
| 296 | "Enable a routing process\n" |
| 297 | "Make connection to zebra daemon\n") |
| 298 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 299 | vty->node = ZEBRA_NODE; |
| 300 | zclient->enable = 1; |
| 301 | zclient_start (zclient); |
| 302 | return CMD_SUCCESS; |
| 303 | } |
| 304 | |
| 305 | DEFUN (no_router_zebra, |
| 306 | no_router_zebra_cmd, |
| 307 | "no router zebra", |
| 308 | NO_STR |
| 309 | "Configure routing process\n" |
| 310 | "Disable connection to zebra daemon\n") |
| 311 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 312 | zclient->enable = 0; |
| 313 | zclient_stop (zclient); |
| 314 | return CMD_SUCCESS; |
| 315 | } |
| 316 | |
| 317 | /* Zebra configuration write function. */ |
| 318 | int |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 319 | config_write_ospf6_zebra (struct vty *vty) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 320 | { |
| 321 | if (! zclient->enable) |
| 322 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 323 | vty_out (vty, "no router zebra%s", VNL); |
| 324 | vty_out (vty, "!%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 325 | } |
| 326 | else if (! zclient->redist[ZEBRA_ROUTE_OSPF6]) |
| 327 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 328 | vty_out (vty, "router zebra%s", VNL); |
| 329 | vty_out (vty, " no redistribute ospf6%s", VNL); |
| 330 | vty_out (vty, "!%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 331 | } |
| 332 | return 0; |
| 333 | } |
| 334 | |
| 335 | /* Zebra node structure. */ |
| 336 | struct cmd_node zebra_node = |
| 337 | { |
| 338 | ZEBRA_NODE, |
| 339 | "%s(config-zebra)# ", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 340 | }; |
| 341 | |
| 342 | #define ADD 0 |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 343 | #define REM 1 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 344 | static void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 345 | ospf6_zebra_route_update (int type, struct ospf6_route *request) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 346 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 347 | struct zapi_ipv6 api; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 348 | char buf[64], ifname[IFNAMSIZ]; |
| 349 | int nhcount; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 350 | struct in6_addr **nexthops; |
| 351 | unsigned int *ifindexes; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 352 | int i, ret = 0; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 353 | struct prefix_ipv6 *dest; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 354 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 355 | if (IS_OSPF6_DEBUG_ZEBRA (SEND)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 356 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 357 | prefix2str (&request->prefix, buf, sizeof (buf)); |
| 358 | zlog_info ("Send %s route: %s", |
| 359 | (type == REM ? "remove" : "add"), buf); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | if (zclient->sock < 0) |
| 363 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 364 | if (IS_OSPF6_DEBUG_ZEBRA (SEND)) |
| 365 | zlog_info (" Not connected to Zebra"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 366 | return; |
| 367 | } |
| 368 | |
| 369 | if (request->path.origin.adv_router == ospf6->router_id && |
| 370 | (request->path.type == OSPF6_PATH_TYPE_EXTERNAL1 || |
| 371 | request->path.type == OSPF6_PATH_TYPE_EXTERNAL2)) |
| 372 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 373 | if (IS_OSPF6_DEBUG_ZEBRA (SEND)) |
| 374 | zlog_info (" Ignore self-originated external route"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 375 | return; |
| 376 | } |
| 377 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 378 | /* If removing is the best path and if there's another path, |
| 379 | treat this request as add the secondary path */ |
| 380 | if (type == REM && ospf6_route_is_best (request) && |
| 381 | request->next && ospf6_route_is_same (request, request->next)) |
| 382 | { |
| 383 | if (IS_OSPF6_DEBUG_ZEBRA (SEND)) |
| 384 | zlog_info (" Best-path removal resulted Sencondary addition"); |
| 385 | type = ADD; |
| 386 | request = request->next; |
| 387 | } |
| 388 | |
| 389 | /* Only the best path will be sent to zebra. */ |
| 390 | if (! ospf6_route_is_best (request)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 391 | { |
| 392 | /* this is not preferred best route, ignore */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 393 | if (IS_OSPF6_DEBUG_ZEBRA (SEND)) |
| 394 | zlog_info (" Ignore non-best route"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 395 | return; |
| 396 | } |
| 397 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 398 | nhcount = 0; |
| 399 | for (i = 0; i < OSPF6_MULTI_PATH_LIMIT; i++) |
| 400 | if (ospf6_nexthop_is_set (&request->nexthop[i])) |
| 401 | nhcount++; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 402 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 403 | if (nhcount == 0) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 404 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 405 | if (IS_OSPF6_DEBUG_ZEBRA (SEND)) |
| 406 | zlog_info (" No nexthop, ignore"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 407 | return; |
| 408 | } |
| 409 | |
| 410 | /* allocate memory for nexthop_list */ |
| 411 | nexthops = XCALLOC (MTYPE_OSPF6_OTHER, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 412 | nhcount * sizeof (struct in6_addr *)); |
| 413 | if (nexthops == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 414 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 415 | zlog_warn ("Can't send route to zebra: malloc failed"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 416 | return; |
| 417 | } |
| 418 | |
| 419 | /* allocate memory for ifindex_list */ |
| 420 | ifindexes = XCALLOC (MTYPE_OSPF6_OTHER, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 421 | nhcount * sizeof (unsigned int)); |
| 422 | if (ifindexes == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 423 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 424 | zlog_warn ("Can't send route to zebra: malloc failed"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 425 | XFREE (MTYPE_OSPF6_OTHER, nexthops); |
| 426 | return; |
| 427 | } |
| 428 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 429 | for (i = 0; i < nhcount; i++) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 430 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 431 | if (IS_OSPF6_DEBUG_ZEBRA (SEND)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 432 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 433 | inet_ntop (AF_INET6, &request->nexthop[i].address, |
| 434 | buf, sizeof (buf)); |
| 435 | if_indextoname (request->nexthop[i].ifindex, ifname); |
| 436 | zlog_info (" nexthop: %s%%%s(%d)", buf, ifname, |
| 437 | request->nexthop[i].ifindex); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 438 | } |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 439 | nexthops[i] = &request->nexthop[i].address; |
| 440 | ifindexes[i] = request->nexthop[i].ifindex; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 441 | } |
| 442 | |
| 443 | api.type = ZEBRA_ROUTE_OSPF6; |
| 444 | api.flags = 0; |
| 445 | api.message = 0; |
| 446 | SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 447 | api.nexthop_num = nhcount; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 448 | api.nexthop = nexthops; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 449 | SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX); |
| 450 | api.ifindex_num = nhcount; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 451 | api.ifindex = ifindexes; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 452 | SET_FLAG (api.message, ZAPI_MESSAGE_METRIC); |
| 453 | api.metric = (request->path.metric_type == 2 ? |
| 454 | request->path.cost_e2 : request->path.cost); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 455 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 456 | dest = (struct prefix_ipv6 *) &request->prefix; |
| 457 | if (type == REM) |
| 458 | ret = zapi_ipv6_route (ZEBRA_IPV6_ROUTE_DELETE, zclient, dest, &api); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 459 | else |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 460 | ret = zapi_ipv6_route (ZEBRA_IPV6_ROUTE_ADD, zclient, dest, &api); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 461 | |
| 462 | if (ret < 0) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 463 | zlog_err ("zapi_ipv6_route() %s failed: %s", |
ajs | 6099b3b | 2004-11-20 02:06:59 +0000 | [diff] [blame] | 464 | (type == REM ? "delete" : "add"), safe_strerror (errno)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 465 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 466 | XFREE (MTYPE_OSPF6_OTHER, nexthops); |
| 467 | XFREE (MTYPE_OSPF6_OTHER, ifindexes); |
| 468 | |
| 469 | return; |
| 470 | } |
| 471 | |
| 472 | void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 473 | ospf6_zebra_route_update_add (struct ospf6_route *request) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 474 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 475 | if (! zclient->redist[ZEBRA_ROUTE_OSPF6]) |
| 476 | { |
| 477 | ospf6->route_table->hook_add = NULL; |
| 478 | ospf6->route_table->hook_remove = NULL; |
| 479 | return; |
| 480 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 481 | ospf6_zebra_route_update (ADD, request); |
| 482 | } |
| 483 | |
| 484 | void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 485 | ospf6_zebra_route_update_remove (struct ospf6_route *request) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 486 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 487 | if (! zclient->redist[ZEBRA_ROUTE_OSPF6]) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 488 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 489 | ospf6->route_table->hook_add = NULL; |
| 490 | ospf6->route_table->hook_remove = NULL; |
| 491 | return; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 492 | } |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 493 | ospf6_zebra_route_update (REM, request); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 494 | } |
| 495 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 496 | DEFUN (redistribute_ospf6, |
| 497 | redistribute_ospf6_cmd, |
| 498 | "redistribute ospf6", |
| 499 | "Redistribute control\n" |
| 500 | "OSPF6 route\n") |
| 501 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 502 | struct ospf6_route *route; |
| 503 | |
| 504 | if (zclient->redist[ZEBRA_ROUTE_OSPF6]) |
| 505 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 506 | |
| 507 | zclient->redist[ZEBRA_ROUTE_OSPF6] = 1; |
| 508 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 509 | if (ospf6 == NULL) |
| 510 | return CMD_SUCCESS; |
| 511 | |
| 512 | /* send ospf6 route to zebra route table */ |
| 513 | for (route = ospf6_route_head (ospf6->route_table); route; |
| 514 | route = ospf6_route_next (route)) |
| 515 | ospf6_zebra_route_update_add (route); |
| 516 | |
| 517 | ospf6->route_table->hook_add = ospf6_zebra_route_update_add; |
| 518 | ospf6->route_table->hook_remove = ospf6_zebra_route_update_remove; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 519 | |
| 520 | return CMD_SUCCESS; |
| 521 | } |
| 522 | |
| 523 | DEFUN (no_redistribute_ospf6, |
| 524 | no_redistribute_ospf6_cmd, |
| 525 | "no redistribute ospf6", |
| 526 | NO_STR |
| 527 | "Redistribute control\n" |
| 528 | "OSPF6 route\n") |
| 529 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 530 | struct ospf6_route *route; |
| 531 | |
| 532 | if (! zclient->redist[ZEBRA_ROUTE_OSPF6]) |
| 533 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 534 | |
| 535 | zclient->redist[ZEBRA_ROUTE_OSPF6] = 0; |
| 536 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 537 | if (ospf6 == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 538 | return CMD_SUCCESS; |
| 539 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 540 | ospf6->route_table->hook_add = NULL; |
| 541 | ospf6->route_table->hook_remove = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 542 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 543 | /* withdraw ospf6 route from zebra route table */ |
| 544 | for (route = ospf6_route_head (ospf6->route_table); route; |
| 545 | route = ospf6_route_next (route)) |
| 546 | ospf6_zebra_route_update_remove (route); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 547 | |
| 548 | return CMD_SUCCESS; |
| 549 | } |
| 550 | |
| 551 | void |
| 552 | ospf6_zebra_init () |
| 553 | { |
| 554 | /* Allocate zebra structure. */ |
| 555 | zclient = zclient_new (); |
| 556 | zclient_init (zclient, ZEBRA_ROUTE_OSPF6); |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 557 | zclient->router_id_update = ospf6_router_id_update_zebra; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 558 | zclient->interface_add = ospf6_zebra_if_add; |
| 559 | zclient->interface_delete = ospf6_zebra_if_del; |
| 560 | zclient->interface_up = ospf6_zebra_if_state_update; |
| 561 | zclient->interface_down = ospf6_zebra_if_state_update; |
| 562 | zclient->interface_address_add = ospf6_zebra_if_address_update_add; |
| 563 | zclient->interface_address_delete = ospf6_zebra_if_address_update_delete; |
| 564 | zclient->ipv4_route_add = NULL; |
| 565 | zclient->ipv4_route_delete = NULL; |
| 566 | zclient->ipv6_route_add = ospf6_zebra_read_ipv6; |
| 567 | zclient->ipv6_route_delete = ospf6_zebra_read_ipv6; |
| 568 | |
| 569 | /* redistribute connected route by default */ |
| 570 | /* ospf6_zebra_redistribute (ZEBRA_ROUTE_CONNECT); */ |
| 571 | |
| 572 | /* Install zebra node. */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 573 | install_node (&zebra_node, config_write_ospf6_zebra); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 574 | |
| 575 | /* Install command element for zebra node. */ |
| 576 | install_element (VIEW_NODE, &show_zebra_cmd); |
| 577 | install_element (ENABLE_NODE, &show_zebra_cmd); |
| 578 | install_element (CONFIG_NODE, &router_zebra_cmd); |
| 579 | install_element (CONFIG_NODE, &no_router_zebra_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 580 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 581 | install_default (ZEBRA_NODE); |
| 582 | install_element (ZEBRA_NODE, &redistribute_ospf6_cmd); |
| 583 | install_element (ZEBRA_NODE, &no_redistribute_ospf6_cmd); |
| 584 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 585 | return; |
| 586 | } |
| 587 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 588 | /* Debug */ |
| 589 | |
| 590 | DEFUN (debug_ospf6_zebra_sendrecv, |
| 591 | debug_ospf6_zebra_sendrecv_cmd, |
| 592 | "debug ospf6 zebra (send|recv)", |
| 593 | DEBUG_STR |
| 594 | OSPF6_STR |
| 595 | "Debug connection between zebra\n" |
| 596 | "Debug Sending zebra\n" |
| 597 | "Debug Receiving zebra\n" |
| 598 | ) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 599 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 600 | unsigned char level = 0; |
| 601 | |
| 602 | if (argc) |
| 603 | { |
| 604 | if (! strncmp (argv[0], "s", 1)) |
| 605 | level = OSPF6_DEBUG_ZEBRA_SEND; |
| 606 | else if (! strncmp (argv[0], "r", 1)) |
| 607 | level = OSPF6_DEBUG_ZEBRA_RECV; |
| 608 | } |
| 609 | else |
| 610 | level = OSPF6_DEBUG_ZEBRA_SEND | OSPF6_DEBUG_ZEBRA_RECV; |
| 611 | |
| 612 | OSPF6_DEBUG_ZEBRA_ON (level); |
| 613 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 614 | } |
| 615 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 616 | ALIAS (debug_ospf6_zebra_sendrecv, |
| 617 | debug_ospf6_zebra_cmd, |
| 618 | "debug ospf6 zebra", |
| 619 | DEBUG_STR |
| 620 | OSPF6_STR |
| 621 | "Debug connection between zebra\n" |
| 622 | ); |
| 623 | |
| 624 | |
| 625 | DEFUN (no_debug_ospf6_zebra_sendrecv, |
| 626 | no_debug_ospf6_zebra_sendrecv_cmd, |
| 627 | "no debug ospf6 zebra (send|recv)", |
| 628 | NO_STR |
| 629 | DEBUG_STR |
| 630 | OSPF6_STR |
| 631 | "Debug connection between zebra\n" |
| 632 | "Debug Sending zebra\n" |
| 633 | "Debug Receiving zebra\n" |
| 634 | ) |
| 635 | { |
| 636 | unsigned char level = 0; |
| 637 | |
| 638 | if (argc) |
| 639 | { |
| 640 | if (! strncmp (argv[0], "s", 1)) |
| 641 | level = OSPF6_DEBUG_ZEBRA_SEND; |
| 642 | else if (! strncmp (argv[0], "r", 1)) |
| 643 | level = OSPF6_DEBUG_ZEBRA_RECV; |
| 644 | } |
| 645 | else |
| 646 | level = OSPF6_DEBUG_ZEBRA_SEND | OSPF6_DEBUG_ZEBRA_RECV; |
| 647 | |
| 648 | OSPF6_DEBUG_ZEBRA_OFF (level); |
| 649 | return CMD_SUCCESS; |
| 650 | } |
| 651 | |
| 652 | ALIAS (no_debug_ospf6_zebra_sendrecv, |
| 653 | no_debug_ospf6_zebra_cmd, |
| 654 | "no debug ospf6 zebra", |
| 655 | NO_STR |
| 656 | DEBUG_STR |
| 657 | OSPF6_STR |
| 658 | "Debug connection between zebra\n" |
| 659 | ); |
| 660 | |
| 661 | int |
| 662 | config_write_ospf6_debug_zebra (struct vty *vty) |
| 663 | { |
| 664 | if (IS_OSPF6_DEBUG_ZEBRA (SEND) && IS_OSPF6_DEBUG_ZEBRA (RECV)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 665 | vty_out (vty, "debug ospf6 zebra%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 666 | else |
| 667 | { |
| 668 | if (IS_OSPF6_DEBUG_ZEBRA (SEND)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 669 | vty_out (vty, "debug ospf6 zebra send%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 670 | if (IS_OSPF6_DEBUG_ZEBRA (RECV)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 671 | vty_out (vty, "debug ospf6 zebra recv%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 672 | } |
| 673 | return 0; |
| 674 | } |
| 675 | |
| 676 | void |
| 677 | install_element_ospf6_debug_zebra () |
| 678 | { |
| 679 | install_element (ENABLE_NODE, &debug_ospf6_zebra_cmd); |
| 680 | install_element (ENABLE_NODE, &no_debug_ospf6_zebra_cmd); |
| 681 | install_element (ENABLE_NODE, &debug_ospf6_zebra_sendrecv_cmd); |
| 682 | install_element (ENABLE_NODE, &no_debug_ospf6_zebra_sendrecv_cmd); |
| 683 | install_element (CONFIG_NODE, &debug_ospf6_zebra_cmd); |
| 684 | install_element (CONFIG_NODE, &no_debug_ospf6_zebra_cmd); |
| 685 | install_element (CONFIG_NODE, &debug_ospf6_zebra_sendrecv_cmd); |
| 686 | install_element (CONFIG_NODE, &no_debug_ospf6_zebra_sendrecv_cmd); |
| 687 | } |
| 688 | |
| 689 | |