diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-12-19 18:33:56 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2021-04-30 10:33:15 +0200 |
| commit | 077c07cc58be1fbbe28a2df71cd884af87b121a7 (patch) | |
| tree | 71ca990630d121074fa3ae61acf0df0ea75d56c6 /zebra/interface.c | |
| parent | c962ab93a8dd2bb8255c2d5b70de77cb5fec96d4 (diff) | |
zebra: storage of gre information in zebra layer
zebra is able to get information about gre tunnels.
zebra_gre file is created to handle hooks, but is not yet used.
also, debug zebra gre command is done to add gre traces.
A zebra_gre file is used for complementary actions that may be needed.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 4b708496a1..5f3ee9428c 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1066,8 +1066,9 @@ void if_up(struct interface *ifp) zif->link_ifindex); if (link_if) zebra_vxlan_svi_up(ifp, link_if); - } else if (IS_ZEBRA_IF_MACVLAN(ifp)) + } else if (IS_ZEBRA_IF_MACVLAN(ifp)) { zebra_vxlan_macvlan_up(ifp); + } if (zif->es_info.es) zebra_evpn_es_if_oper_state_change(zif, true /*up*/); @@ -1105,8 +1106,9 @@ void if_down(struct interface *ifp) zif->link_ifindex); if (link_if) zebra_vxlan_svi_down(ifp, link_if); - } else if (IS_ZEBRA_IF_MACVLAN(ifp)) + } else if (IS_ZEBRA_IF_MACVLAN(ifp)) { zebra_vxlan_macvlan_down(ifp); + } if (zif->es_info.es) zebra_evpn_es_if_oper_state_change(zif, false /*up*/); @@ -1304,6 +1306,9 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type) case ZEBRA_IF_MACVLAN: return "macvlan"; + case ZEBRA_IF_GRE: + return "GRE"; + default: return "Unknown"; } @@ -1576,6 +1581,28 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) ifp->name); } vty_out(vty, "\n"); + } else if (IS_ZEBRA_IF_GRE(ifp)) { + struct zebra_l2info_gre *gre_info; + + gre_info = &zebra_if->l2info.gre; + if (gre_info->vtep_ip.s_addr != INADDR_ANY) { + vty_out(vty, " VTEP IP: %pI4", &gre_info->vtep_ip); + if (gre_info->vtep_ip_remote.s_addr != INADDR_ANY) + vty_out(vty, " , remote %pI4", + &gre_info->vtep_ip_remote); + vty_out(vty, "\n"); + } + if (gre_info->ifindex_link && + (gre_info->link_nsid != NS_UNKNOWN)) { + struct interface *ifp; + + ifp = if_lookup_by_index_per_ns( + zebra_ns_lookup(gre_info->link_nsid), + gre_info->ifindex_link); + vty_out(vty, " Link Interface %s\n", + ifp == NULL ? "Unknown" : + ifp->name); + } } if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp)) { |
