diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-01-15 17:36:33 +0200 |
---|---|---|
committer | Paul Jakma <paul.jakma@hpe.com> | 2016-02-26 14:11:46 +0000 |
commit | 954c7d6bcd04c2cf037965adda0f9d11afdcd165 (patch) | |
tree | 707ba870b0989d08a98e6b969fc1e2388f09e1c0 /zebra/interface.c | |
parent | 4d3ae716ce86c28e3979c9ae57c4e717ac5e27e4 (diff) | |
download | quagga-954c7d6bcd04c2cf037965adda0f9d11afdcd165.tar.bz2 quagga-954c7d6bcd04c2cf037965adda0f9d11afdcd165.tar.xz |
lib, zebra: unify link layer type and hardware address handling
This removes the BSD specific usage of struct sockaddr_dl
hardware address. This unifies to use explict hw_addr member for
the address, and zebra specific enumeration for the link layer
type.
Additionally the zapi is updated to never send platform specific
structures over the wire, but the ll_type along with hw_addr_len
and hw_addr are now sent for all platforms.
Based on initial work by Paul Jakma.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r-- | zebra/interface.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 411712d5..8a9225ac 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -705,9 +705,6 @@ nd_dump_vty (struct vty *vty, struct interface *ifp) static void if_dump_vty (struct vty *vty, struct interface *ifp) { -#ifdef HAVE_STRUCT_SOCKADDR_DL - struct sockaddr_dl *sdl; -#endif /* HAVE_STRUCT_SOCKADDR_DL */ struct connected *connected; struct listnode *node; struct route_node *rn; @@ -759,19 +756,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) if_flag_dump (ifp->flags), VTY_NEWLINE); /* Hardware address. */ -#ifdef HAVE_STRUCT_SOCKADDR_DL - sdl = &ifp->sdl; - if (sdl != NULL && sdl->sdl_alen != 0) - { - int i; - u_char *ptr; - - vty_out (vty, " HWaddr: "); - for (i = 0, ptr = (u_char *)LLADDR (sdl); i < sdl->sdl_alen; i++, ptr++) - vty_out (vty, "%s%02x", i == 0 ? "" : ":", *ptr); - vty_out (vty, "%s", VTY_NEWLINE); - } -#else + vty_out (vty, " Type: %s%s", if_link_type_str (ifp->ll_type), VTY_NEWLINE); if (ifp->hw_addr_len != 0) { int i; @@ -781,7 +766,6 @@ if_dump_vty (struct vty *vty, struct interface *ifp) vty_out (vty, "%s%02x", i == 0 ? "" : ":", ifp->hw_addr[i]); vty_out (vty, "%s", VTY_NEWLINE); } -#endif /* HAVE_STRUCT_SOCKADDR_DL */ /* Bandwidth in kbps */ if (ifp->bandwidth != 0) |