diff options
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 6d846c3ecb..72d0ced658 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -29,13 +29,14 @@ #include "rib.h" #include "nexthop.h" #include "vrf.h" +#include "lib/json.h" #include "zebra/zserv.h" #include "zebra/zebra_vrf.h" #include "zebra/zebra_rnh.h" #include "zebra/redistribute.h" #include "zebra/zebra_routemap.h" -#include "lib/json.h" +#include "zebra/zebra_static.h" extern int allow_delete; @@ -65,6 +66,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, struct zebra_vrf *zvrf = NULL; unsigned int ifindex = 0; const char *ifname = NULL; + u_char type = STATIC_IPV4_BLACKHOLE; ret = str2prefix (dest_str, &p); if (ret <= 0) @@ -116,9 +118,9 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, return CMD_WARNING; } if (add_cmd) - static_add_ipv4 (safi, &p, NULL, ifindex, ifname, ZEBRA_FLAG_BLACKHOLE, tag, distance, zvrf); + static_add_route (AFI_IP, safi, type, &p, NULL, ifindex, ifname, ZEBRA_FLAG_BLACKHOLE, tag, distance, zvrf); else - static_delete_ipv4 (safi, &p, NULL, ifindex, tag, distance, zvrf); + static_delete_route (AFI_IP, safi, type, &p, NULL, ifindex, tag, distance, zvrf); return CMD_SUCCESS; } @@ -142,9 +144,9 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (gate_str == NULL) { if (add_cmd) - static_add_ipv4 (safi, &p, NULL, ifindex, ifname, flag, tag, distance, zvrf); + static_add_route (AFI_IP, safi, type, &p, NULL, ifindex, ifname, flag, tag, distance, zvrf); else - static_delete_ipv4 (safi, &p, NULL, ifindex, tag, distance, zvrf); + static_delete_route (AFI_IP, safi, type, &p, NULL, ifindex, tag, distance, zvrf); return CMD_SUCCESS; } @@ -163,12 +165,15 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, else ifindex = ifp->ifindex; ifname = gate_str; + type = STATIC_IFINDEX; } + else + type = STATIC_IPV4_GATEWAY; if (add_cmd) - static_add_ipv4 (safi, &p, ifindex ? NULL : &gate, ifindex, ifname, flag, tag, distance, zvrf); + static_add_route (AFI_IP, safi, type, &p, ifindex ? NULL : (union g_addr *)&gate, ifindex, ifname, flag, tag, distance, zvrf); else - static_delete_ipv4 (safi, &p, ifindex ? NULL : &gate, ifindex, tag, distance, zvrf); + static_delete_route (AFI_IP, safi, type, &p, ifindex ? NULL : (union g_addr *)&gate, ifindex, tag, distance, zvrf); return CMD_SUCCESS; } @@ -1934,6 +1939,8 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast) vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric); if (rib->tag) vty_out (vty, ", tag %d", rib->tag); + if (rib->mtu) + vty_out (vty, ", mtu %u", rib->mtu); if (rib->vrf_id != VRF_DEFAULT) { zvrf = vrf_info_lookup(rib->vrf_id); @@ -3730,9 +3737,9 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, } if (add_cmd) - static_add_ipv6 (&p, type, gate, ifindex, ifname, flag, tag, distance, zvrf); + static_add_route (AFI_IP6, SAFI_UNICAST, type, &p, (union g_addr *)gate, ifindex, ifname, flag, tag, distance, zvrf); else - static_delete_ipv6 (&p, type, gate, ifindex, tag, distance, zvrf); + static_delete_route (AFI_IP6, SAFI_UNICAST, type, &p, (union g_addr *)gate, ifindex, tag, distance, zvrf); return CMD_SUCCESS; } |
