From f15d3950df21695baa418073d6ff5e4baeece0b2 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 3 Apr 2012 13:29:47 +0200 Subject: [PATCH] Allow compilation without Dot1. --- src/edp.c | 2 +- src/lldpd.h | 44 ++++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/edp.c b/src/edp.c index 66325fc7..b1c8a98b 100644 --- a/src/edp.c +++ b/src/edp.c @@ -230,8 +230,8 @@ edp_decode(struct lldpd *cfg, char *frame, int s, { struct lldpd_chassis *chassis; struct lldpd_port *port; - struct lldpd_mgmt *mgmt, *mgmt_next, *m; #ifdef ENABLE_DOT1 + struct lldpd_mgmt *mgmt, *mgmt_next, *m; struct lldpd_vlan *lvlan = NULL, *lvlan_next; #endif const unsigned char edpaddr[] = EDP_MULTICAST_ADDR; diff --git a/src/lldpd.h b/src/lldpd.h index 6466e56e..97c8531b 100644 --- a/src/lldpd.h +++ b/src/lldpd.h @@ -72,28 +72,6 @@ #define LLDPD_PPVID_CAP_SUPPORTED (1 << 1) #define LLDPD_PPVID_CAP_ENABLED (1 << 2) -enum { - LLDPD_AF_UNSPEC = 0, - LLDPD_AF_IPV4, - LLDPD_AF_IPV6, - LLDPD_AF_LAST -}; - -inline static int -lldpd_af(int af) -{ - switch (af) { - case LLDPD_AF_IPV4: - return AF_INET; - case LLDPD_AF_IPV6: - return AF_INET6; - case LLDPD_AF_LAST: - return AF_MAX; - default: - return AF_UNSPEC; - } -} - struct lldpd_ppvid { TAILQ_ENTRY(lldpd_ppvid) p_entries; u_int8_t p_cap_status; @@ -178,6 +156,28 @@ struct lldpd_dot3_power { MARSHAL(lldpd_dot3_power); #endif +enum { + LLDPD_AF_UNSPEC = 0, + LLDPD_AF_IPV4, + LLDPD_AF_IPV6, + LLDPD_AF_LAST +}; + +inline static int +lldpd_af(int af) +{ + switch (af) { + case LLDPD_AF_IPV4: + return AF_INET; + case LLDPD_AF_IPV6: + return AF_INET6; + case LLDPD_AF_LAST: + return AF_MAX; + default: + return AF_UNSPEC; + } +} + #define LLDPD_MGMT_MAXADDRSIZE 16 /* sizeof(struct in6_addr) */ struct lldpd_mgmt { TAILQ_ENTRY(lldpd_mgmt) m_entries; -- 2.39.5