diff options
Diffstat (limited to 'zebra')
| -rw-r--r-- | zebra/if_netlink.c | 6 | ||||
| -rw-r--r-- | zebra/interface.c | 11 | ||||
| -rw-r--r-- | zebra/interface.h | 9 | ||||
| -rw-r--r-- | zebra/main.c | 7 | ||||
| -rw-r--r-- | zebra/zebra_mpls.c | 4 | ||||
| -rw-r--r-- | zebra/zebra_mpls.h | 4 | ||||
| -rw-r--r-- | zebra/zebra_netns_notify.c | 50 | ||||
| -rw-r--r-- | zebra/zebra_vrf.c | 15 | ||||
| -rw-r--r-- | zebra/zebra_vty.c | 45 | ||||
| -rw-r--r-- | zebra/zebra_vxlan.c | 37 | ||||
| -rw-r--r-- | zebra/zebra_vxlan.h | 36 | ||||
| -rw-r--r-- | zebra/zserv.c | 3 |
12 files changed, 152 insertions, 75 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index a15d914243..0dcf5082a2 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -259,6 +259,8 @@ static void netlink_determine_zebra_iftype(char *kind, zebra_iftype_t *zif_type) *zif_type = ZEBRA_IF_VXLAN; else if (strcmp(kind, "macvlan") == 0) *zif_type = ZEBRA_IF_MACVLAN; + else if (strcmp(kind, "veth") == 0) + *zif_type = ZEBRA_IF_VETH; } #define parse_rtattr_nested(tb, max, rta) \ @@ -675,7 +677,7 @@ static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup) SET_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK); /* Update link. */ - zebra_if_update_link(ifp, link_ifindex); + zebra_if_update_link(ifp, link_ifindex, ns_id); /* Hardware type and address. */ ifp->ll_type = netlink_to_zebra_link_type(ifi->ifi_type); @@ -1262,7 +1264,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) ZEBRA_INTERFACE_VRF_LOOPBACK); /* Update link. */ - zebra_if_update_link(ifp, link_ifindex); + zebra_if_update_link(ifp, link_ifindex, ns_id); netlink_interface_update_hw_addr(tb, ifp); diff --git a/zebra/interface.c b/zebra/interface.c index 763931d350..32ee1a566a 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1002,13 +1002,16 @@ void if_refresh(struct interface *ifp) if_get_flags(ifp); } -void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex) +void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex, + ns_id_t ns_id) { struct zebra_if *zif; + if (IS_ZEBRA_IF_VETH(ifp)) + return; zif = (struct zebra_if *)ifp->info; zif->link_ifindex = link_ifindex; - zif->link = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT), + zif->link = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id), link_ifindex); } @@ -1093,6 +1096,10 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type) return "VRF"; break; + case ZEBRA_IF_VETH: + return "VETH"; + break; + default: return "Unknown"; break; diff --git a/zebra/interface.h b/zebra/interface.h index 9634bfdb3f..956d430cf9 100644 --- a/zebra/interface.h +++ b/zebra/interface.h @@ -191,6 +191,7 @@ typedef enum { ZEBRA_IF_BRIDGE, /* bridge device */ ZEBRA_IF_VLAN, /* VLAN sub-interface */ ZEBRA_IF_MACVLAN, /* MAC VLAN interface*/ + ZEBRA_IF_VETH, /* VETH interface*/ } zebra_iftype_t; /* Zebra "slave" interface type */ @@ -312,7 +313,10 @@ static inline void zebra_if_set_ziftype(struct interface *ifp, #define IS_ZEBRA_IF_MACVLAN(ifp) \ (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_MACVLAN) -#define IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) \ +#define IS_ZEBRA_IF_VETH(ifp) \ + (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VETH) + +#define IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) \ (((struct zebra_if *)(ifp->info))->zif_slave_type \ == ZEBRA_IF_SLAVE_BRIDGE) @@ -344,7 +348,8 @@ extern int if_subnet_add(struct interface *, struct connected *); extern int if_subnet_delete(struct interface *, struct connected *); extern int ipv6_address_configured(struct interface *ifp); extern void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id); -extern void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex); +extern void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex, + ns_id_t ns_id); extern void vrf_add_update(struct vrf *vrfp); diff --git a/zebra/main.c b/zebra/main.c index 5e7c69382f..8db1c48f22 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -99,6 +99,7 @@ struct option longopts[] = { {"ecmp", required_argument, NULL, 'e'}, {"label_socket", no_argument, NULL, 'l'}, {"retain", no_argument, NULL, 'r'}, + {"vrfdefaultname", required_argument, NULL, 'o'}, #ifdef HAVE_NETLINK {"vrfwnetns", no_argument, NULL, 'n'}, {"nl-bufsize", required_argument, NULL, 's'}, @@ -235,7 +236,7 @@ int main(int argc, char **argv) frr_preinit(&zebra_di, argc, argv); frr_opt_add( - "bakz:e:l:r" + "bakz:e:l:o:r" #ifdef HAVE_NETLINK "s:n" #endif @@ -254,6 +255,7 @@ int main(int argc, char **argv) " -l, --label_socket Socket to external label manager\n" " -k, --keep_kernel Don't delete old routes which were installed by zebra.\n" " -r, --retain When program terminates, retain added route by zebra.\n" + " -o, --vrfdefaultname Set default VRF name.\n" #ifdef HAVE_NETLINK " -n, --vrfwnetns Use NetNS as VRF backend\n" " -s, --nl-bufsize Set netlink receive buffer size\n" @@ -296,6 +298,9 @@ int main(int argc, char **argv) return 1; } break; + case 'o': + vrf_set_default_name(optarg); + break; case 'z': zserv_path = optarg; if (!frr_zclient_addr(&dummy, &dummylen, optarg)) { diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index f7283aed36..8f48cc5191 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -2698,7 +2698,7 @@ void zebra_mpls_lsp_schedule(struct zebra_vrf *zvrf) * (VTY command handler). */ void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf, - mpls_label_t label, uint8_t use_json) + mpls_label_t label, bool use_json) { struct hash *lsp_table; zebra_lsp_t *lsp; @@ -2729,7 +2729,7 @@ void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf, * Display MPLS label forwarding table (VTY command handler). */ void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf, - uint8_t use_json) + bool use_json) { char buf[BUFSIZ]; json_object *json = NULL; diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index 65204a67dc..86bee129cf 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -349,13 +349,13 @@ void zebra_mpls_lsp_schedule(struct zebra_vrf *zvrf); * (VTY command handler). */ void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf, - mpls_label_t label, uint8_t use_json); + mpls_label_t label, bool use_json); /* * Display MPLS label forwarding table (VTY command handler). */ void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf, - uint8_t use_json); + bool use_json); /* * Display MPLS LSP configuration of all static LSPs (VTY command handler). diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 2b7bf04ec3..12207805d9 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -149,6 +149,41 @@ static int zebra_ns_delete(char *name) return 0; } +static int zebra_ns_notify_self_identify(struct stat *netst) +{ + char net_path[64]; + int netns; + + sprintf(net_path, "/proc/self/ns/net"); + netns = open(net_path, O_RDONLY); + if (netns < 0) + return -1; + if (fstat(netns, netst) < 0) { + close(netns); + return -1; + } + close(netns); + return 0; +} + +static bool zebra_ns_notify_is_default_netns(const char *name) +{ + struct stat default_netns_stat; + struct stat st; + char netnspath[64]; + + if (zebra_ns_notify_self_identify(&default_netns_stat)) + return false; + + memset(&st, 0, sizeof(struct stat)); + snprintf(netnspath, 64, "%s/%s", NS_RUN_DIR, name); + /* compare with local stat */ + if (stat(netnspath, &st) == 0 && + (st.st_dev == default_netns_stat.st_dev) && + (st.st_ino == default_netns_stat.st_ino)) + return true; + return false; +} static int zebra_ns_ready_read(struct thread *t) { @@ -178,6 +213,14 @@ static int zebra_ns_ready_read(struct thread *t) if (err < 0) return zebra_ns_continue_read(zns_info, stop_retry); + if (zebra_ns_notify_is_default_netns(basename(netnspath))) { + zlog_warn( + "NS notify : NS %s is default VRF." + " Updating VRF Name", basename(netnspath)); + vrf_set_default_name(basename(netnspath)); + return zebra_ns_continue_read(zns_info, 1); + } + /* success : close fd and create zns context */ zebra_ns_notify_create_context_from_entry_name(basename(netnspath)); return zebra_ns_continue_read(zns_info, 1); @@ -259,6 +302,13 @@ void zebra_ns_notify_parse(void) dent->d_name); continue; } + if (zebra_ns_notify_is_default_netns(dent->d_name)) { + zlog_warn( + "NS notify : NS %s is default VRF." + " Updating VRF Name", dent->d_name); + vrf_set_default_name(dent->d_name); + continue; + } zebra_ns_notify_create_context_from_entry_name(dent->d_name); } closedir(srcdir); diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index 05ae418b57..be8f879246 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -282,6 +282,19 @@ static int zebra_vrf_delete(struct vrf *vrf) return 0; } +static int zebra_vrf_update(struct vrf *vrf) +{ + struct zebra_vrf *zvrf = vrf->info; + + assert(zvrf); + if (IS_ZEBRA_DEBUG_EVENT) + zlog_debug("VRF %s id %u, name updated", vrf->name, + zvrf_id(zvrf)); + zebra_vrf_add_update(zvrf); + return 0; +} + + /* Return if this VRF has any FRR configuration or not. * IMPORTANT: This function needs to be updated when additional configuration * is added for a VRF. @@ -491,7 +504,7 @@ static int vrf_config_write(struct vty *vty) void zebra_vrf_init(void) { vrf_init(zebra_vrf_new, zebra_vrf_enable, zebra_vrf_disable, - zebra_vrf_delete); + zebra_vrf_delete, zebra_vrf_update); vrf_cmd_init(vrf_config_write, &zserv_privs); } diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 4f1d5cf6d5..de08e323af 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -55,7 +55,7 @@ extern int allow_delete; static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi, - safi_t safi, bool use_fib, uint8_t use_json, + safi_t safi, bool use_fib, bool use_json, route_tag_t tag, const struct prefix *longer_prefix_p, bool supernets_only, int type, @@ -135,7 +135,7 @@ DEFUN (show_ip_rpf, "Display RPF information for multicast source\n" JSON_STR) { - int uj = use_json(argc, argv); + bool uj = use_json(argc, argv); return do_show_ip_route(vty, VRF_DEFAULT_NAME, AFI_IP, SAFI_MULTICAST, false, uj, 0, NULL, false, 0, 0); } @@ -760,8 +760,7 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf, bool use_fib, route_tag_t tag, const struct prefix *longer_prefix_p, bool supernets_only, int type, - unsigned short ospf_instance_id, - uint8_t use_json) + unsigned short ospf_instance_id, bool use_json) { struct route_node *rn; struct route_entry *re; @@ -850,7 +849,7 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf, } static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi, - safi_t safi, bool use_fib, uint8_t use_json, + safi_t safi, bool use_fib, bool use_json, route_tag_t tag, const struct prefix *longer_prefix_p, bool supernets_only, int type, @@ -1723,7 +1722,7 @@ DEFUN (show_vrf_vni, struct zebra_vrf *zvrf; json_object *json = NULL; json_object *json_vrfs = NULL; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (uj) { json = json_object_new_object(); @@ -1759,7 +1758,7 @@ DEFUN (show_evpn_global, "EVPN\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); zebra_vxlan_print_evpn(vty, uj); return CMD_SUCCESS; @@ -1774,7 +1773,7 @@ DEFUN (show_evpn_vni, JSON_STR) { struct zebra_vrf *zvrf; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); zvrf = vrf_info_lookup(VRF_DEFAULT); zebra_vxlan_print_vnis(vty, zvrf, uj); @@ -1792,7 +1791,7 @@ DEFUN (show_evpn_vni_vni, { struct zebra_vrf *zvrf; vni_t vni; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); vni = strtoul(argv[3]->arg, NULL, 10); zvrf = vrf_info_lookup(VRF_DEFAULT); @@ -1814,7 +1813,7 @@ DEFUN (show_evpn_rmac_vni_mac, { vni_t l3vni = 0; struct ethaddr mac; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); l3vni = strtoul(argv[4]->arg, NULL, 10); if (!prefix_str2mac(argv[6]->arg, &mac)) { @@ -1836,7 +1835,7 @@ DEFUN (show_evpn_rmac_vni, JSON_STR) { vni_t l3vni = 0; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); l3vni = strtoul(argv[4]->arg, NULL, 10); zebra_vxlan_print_rmacs_l3vni(vty, l3vni, uj); @@ -1854,7 +1853,7 @@ DEFUN (show_evpn_rmac_vni_all, "All VNIs\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); zebra_vxlan_print_rmacs_all_l3vni(vty, uj); @@ -1875,7 +1874,7 @@ DEFUN (show_evpn_nh_vni_ip, { vni_t l3vni; struct ipaddr ip; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); l3vni = strtoul(argv[4]->arg, NULL, 10); if (str2ipaddr(argv[6]->arg, &ip) != 0) { @@ -1899,7 +1898,7 @@ DEFUN (show_evpn_nh_vni, JSON_STR) { vni_t l3vni; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); l3vni = strtoul(argv[4]->arg, NULL, 10); zebra_vxlan_print_nh_l3vni(vty, l3vni, uj); @@ -1917,7 +1916,7 @@ DEFUN (show_evpn_nh_vni_all, "All VNIs\n" JSON_STR) { - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); zebra_vxlan_print_nh_all_l3vni(vty, uj); @@ -1936,7 +1935,7 @@ DEFUN (show_evpn_mac_vni, { struct zebra_vrf *zvrf; vni_t vni; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); vni = strtoul(argv[4]->arg, NULL, 10); zvrf = vrf_info_lookup(VRF_DEFAULT); @@ -1955,7 +1954,7 @@ DEFUN (show_evpn_mac_vni_all, JSON_STR) { struct zebra_vrf *zvrf; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); zvrf = vrf_info_lookup(VRF_DEFAULT); zebra_vxlan_print_macs_all_vni(vty, zvrf, uj); @@ -1976,7 +1975,7 @@ DEFUN (show_evpn_mac_vni_all_vtep, { struct zebra_vrf *zvrf; struct in_addr vtep_ip; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); if (!inet_aton(argv[6]->arg, &vtep_ip)) { if (!uj) @@ -2030,7 +2029,7 @@ DEFUN (show_evpn_mac_vni_vtep, struct zebra_vrf *zvrf; vni_t vni; struct in_addr vtep_ip; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); vni = strtoul(argv[4]->arg, NULL, 10); if (!inet_aton(argv[6]->arg, &vtep_ip)) { @@ -2056,7 +2055,7 @@ DEFUN (show_evpn_neigh_vni, { struct zebra_vrf *zvrf; vni_t vni; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); vni = strtoul(argv[4]->arg, NULL, 10); zvrf = vrf_info_lookup(VRF_DEFAULT); @@ -2075,7 +2074,7 @@ DEFUN (show_evpn_neigh_vni_all, JSON_STR) { struct zebra_vrf *zvrf; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); zvrf = vrf_info_lookup(VRF_DEFAULT); zebra_vxlan_print_neigh_all_vni(vty, zvrf, uj); @@ -2097,7 +2096,7 @@ DEFUN (show_evpn_neigh_vni_neigh, struct zebra_vrf *zvrf; vni_t vni; struct ipaddr ip; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); vni = strtoul(argv[4]->arg, NULL, 10); if (str2ipaddr(argv[6]->arg, &ip) != 0) { @@ -2125,7 +2124,7 @@ DEFUN (show_evpn_neigh_vni_vtep, struct zebra_vrf *zvrf; vni_t vni; struct in_addr vtep_ip; - uint8_t uj = use_json(argc, argv); + bool uj = use_json(argc, argv); vni = strtoul(argv[4]->arg, NULL, 10); if (!inet_aton(argv[6]->arg, &vtep_ip)) { diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index b0fc0a39bd..9aced13a4f 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -4057,8 +4057,7 @@ void zebra_vxlan_evpn_vrf_route_del(vrf_id_t vrf_id, } void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni, - struct ethaddr *rmac, - uint8_t use_json) + struct ethaddr *rmac, bool use_json) { zebra_l3vni_t *zl3vni = NULL; zebra_mac_t *zrmac = NULL; @@ -4102,8 +4101,7 @@ void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni, } } -void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, - uint8_t use_json) +void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, bool use_json) { zebra_l3vni_t *zl3vni; uint32_t num_rmacs; @@ -4147,7 +4145,7 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, } } -void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, uint8_t use_json) +void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json) { struct zebra_ns *zns = NULL; json_object *json = NULL; @@ -4184,7 +4182,7 @@ void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, uint8_t use_json) } void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni, - struct ipaddr *ip, uint8_t use_json) + struct ipaddr *ip, bool use_json) { zebra_l3vni_t *zl3vni = NULL; zebra_neigh_t *n = NULL; @@ -4228,7 +4226,7 @@ void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni, } } -void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, uint8_t use_json) +void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, bool use_json) { uint32_t num_nh; struct nh_walk_ctx wctx; @@ -4272,7 +4270,7 @@ void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, uint8_t use_json) } } -void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, uint8_t use_json) +void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json) { struct zebra_ns *zns = NULL; json_object *json = NULL; @@ -4309,7 +4307,7 @@ void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, uint8_t use_json) /* * Display L3 VNI information (VTY command handler). */ -void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, uint8_t use_json) +void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, bool use_json) { void *args[2]; json_object *json = NULL; @@ -4382,7 +4380,7 @@ void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf, * Display Neighbors for a VNI (VTY command handler). */ void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf, - vni_t vni, uint8_t use_json) + vni_t vni, bool use_json) { zebra_vni_t *zvni; uint32_t num_neigh; @@ -4438,7 +4436,7 @@ void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf, * Display neighbors across all VNIs (VTY command handler). */ void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf, - uint8_t use_json) + bool use_json) { json_object *json = NULL; void *args[2]; @@ -4467,7 +4465,7 @@ void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf, */ void zebra_vxlan_print_specific_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, - struct ipaddr *ip, uint8_t use_json) + struct ipaddr *ip, bool use_json) { zebra_vni_t *zvni; zebra_neigh_t *n; @@ -4509,7 +4507,7 @@ void zebra_vxlan_print_specific_neigh_vni(struct vty *vty, */ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct in_addr vtep_ip, - uint8_t use_json) + bool use_json) { zebra_vni_t *zvni; uint32_t num_neigh; @@ -4551,7 +4549,7 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, * Display MACs for a VNI (VTY command handler). */ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf, - vni_t vni, uint8_t use_json) + vni_t vni, bool use_json) { zebra_vni_t *zvni; uint32_t num_macs; @@ -4606,7 +4604,7 @@ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf, * Display MACs for all VNIs (VTY command handler). */ void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf, - uint8_t use_json) + bool use_json) { struct mac_walk_ctx wctx; json_object *json = NULL; @@ -4636,8 +4634,7 @@ void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf, */ void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, - struct in_addr vtep_ip, - uint8_t use_json) + struct in_addr vtep_ip, bool use_json) { struct mac_walk_ctx wctx; json_object *json = NULL; @@ -4693,7 +4690,7 @@ void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf, */ void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct in_addr vtep_ip, - uint8_t use_json) + bool use_json) { zebra_vni_t *zvni; uint32_t num_macs; @@ -4743,7 +4740,7 @@ void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, * Display VNI information (VTY command handler). */ void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, - uint8_t use_json) + bool use_json) { json_object *json = NULL; void *args[2]; @@ -4831,7 +4828,7 @@ void zebra_vxlan_print_evpn(struct vty *vty, uint8_t uj) * Display VNI hash table (VTY command handler). */ void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf, - uint8_t use_json) + bool use_json) { json_object *json = NULL; struct zebra_ns *zns = NULL; diff --git a/zebra/zebra_vxlan.h b/zebra/zebra_vxlan.h index 2732ef72ed..6b2b57371c 100644 --- a/zebra/zebra_vxlan.h +++ b/zebra/zebra_vxlan.h @@ -68,53 +68,51 @@ extern int zebra_vxlan_vrf_enable(struct zebra_vrf *zvrf); extern int zebra_vxlan_vrf_disable(struct zebra_vrf *zvrf); extern int zebra_vxlan_vrf_delete(struct zebra_vrf *zvrf); extern void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni, - struct ipaddr *ip, uint8_t uj); + struct ipaddr *ip, bool uj); extern void zebra_vxlan_print_evpn(struct vty *vty, uint8_t uj); extern void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni, struct ethaddr *rmac, - uint8_t use_json); + bool use_json); extern void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf, - vni_t vni, uint8_t use_json); + vni_t vni, bool use_json); extern void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf, - uint8_t use_json); + bool use_json); extern void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, struct in_addr vtep_ip, - uint8_t use_json); + bool use_json); extern void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct ethaddr *mac); extern void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct in_addr vtep_ip, - uint8_t use_json); + bool use_json); extern void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf, - vni_t vni, uint8_t use_json); + vni_t vni, bool use_json); extern void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf, - uint8_t use_json); + bool use_json); extern void zebra_vxlan_print_specific_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct ipaddr *ip, - uint8_t use_json); + bool use_json); extern void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct in_addr vtep_ip, - uint8_t use_json); + bool use_json); extern void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf, - vni_t vni, uint8_t use_json); + vni_t vni, bool use_json); extern void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf, - uint8_t use_json); + bool use_json); extern void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t vni, - uint8_t use_json); -extern void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, - uint8_t use_json); + bool use_json); +extern void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json); extern void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t vni, - uint8_t use_json); -extern void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, uint8_t use_json); -extern void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, - uint8_t use_json); + bool use_json); +extern void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json); +extern void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, bool use_json); extern void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf, json_object *json_vrfs); extern int zebra_vxlan_add_del_gw_macip(struct interface *ifp, struct prefix *p, diff --git a/zebra/zserv.c b/zebra/zserv.c index 174e010743..4a341bfe1b 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -705,7 +705,8 @@ static struct zserv *zserv_client_create(int sock) .stop = frr_pthread_attr_default.stop }; client->pthread = - frr_pthread_new(&zclient_pthr_attrs, "Zebra API client thread"); + frr_pthread_new(&zclient_pthr_attrs, "Zebra API client thread", + "zebra_apic"); zebra_vrf_update_all(client); |
