AC_MSG_RESULT(no)
fi
+#Listen on vlan
+AC_ARG_ENABLE(listenvlan, AC_HELP_STRING([--enable-listenvlan],
+ [Allow to listen on VLAN]),
+ [enable_listenvlan=$enableval],[enable_listenvlan=no])
+AC_MSG_CHECKING(whether to allow to listen on VLAN)
+if test x$enable_listenvlan = xyes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([ENABLE_LISTENVLAN],, [Allow to listen on VLAN])
+else
+ AC_MSG_RESULT(no)
+fi
+
AC_OUTPUT
static int iface_bond_init(struct lldpd *, struct lldpd_hardware *);
static void iface_fds_close(struct lldpd *, struct lldpd_hardware *);
#ifdef ENABLE_DOT1
+#ifdef ENABLE_LISTENVLAN
static void iface_vlan_close(struct lldpd *, struct lldpd_hardware *);
static void iface_listen_vlan(struct lldpd *,
struct lldpd_hardware *, struct ifaddrs *);
+#endif
static void iface_append_vlan(struct lldpd *,
struct lldpd_hardware *, struct ifaddrs *);
#endif
static int
iface_eth_close(struct lldpd *cfg, struct lldpd_hardware *hardware)
{
-#ifdef ENABLE_DOT1
+#if defined(ENABLE_DOT1) && defined(ENABLE_LISTENVLAN)
iface_vlan_close(cfg, hardware);
#endif
close(hardware->h_sendfd);
static int
iface_bond_close(struct lldpd *cfg, struct lldpd_hardware *hardware)
{
-#ifdef ENABLE_DOT1
+#if defined(ENABLE_DOT1) && defined(ENABLE_LISTENVLAN)
iface_vlan_close(cfg, hardware);
#endif
iface_fds_close(cfg, hardware); /* h_sendfd is here too */
}
#ifdef ENABLE_DOT1
+#ifdef ENABLE_LISTENVLAN
/* We keep here the list of VLAN we listen to. */
struct iface_vlans {
TAILQ_ENTRY(iface_vlans) next;
ifvl->hardware = hardware;
TAILQ_INSERT_TAIL(&ifvls, ifvl, next);
}
+#endif /* ENABLE_LISTENVLAN */
static void
iface_append_vlan(struct lldpd *cfg,
vlan->v_vid = ifv.u.VID;
TAILQ_INSERT_TAIL(&port->p_vlans, vlan, v_entries);
+#ifdef ENABLE_LISTENVLAN
iface_listen_vlan(cfg, hardware, ifa);
+#endif
}
void
struct ifaddrs *ifa;
struct vlan_ioctl_args ifv;
struct lldpd_hardware *hardware;
- struct iface_vlans *ifvl;
+#ifdef ENABLE_LISTENVLAN
+ struct iface_vlans *ifvl;
if (cfg->g_listen_vlans) {
_iface_vlan_setup();
TAILQ_FOREACH(ifvl, &ifvls, next)
ifvl->refreshed = 0;
}
+#endif
for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
if (!ifa->ifa_flags)
hardware, ifa);
}
}
+#ifdef ENABLE_LISTENVLAN
iface_vlan_close(cfg, NULL);
+#endif
}
#endif
int snmp = 0;
#endif
char *mgmtp = NULL;
- char *popt, opts[] = "vdxm:p:M:i@ ";
- int i, found, vlan = 0;
+ char *popt, opts[] =
+#ifdef ENABLE_LISTENVLAN
+ "v"
+#endif
+ "dxm:p:M:i@ ";
+ int i, found;
+#ifdef ENABLE_LISTENVLAN
+ int vlan = 0;
+#endif
#ifdef ENABLE_LLDPMED
int lldpmed = 0, noinventory = 0;
#endif
*popt = '\0';
while ((ch = getopt(argc, argv, opts)) != -1) {
switch (ch) {
+#ifdef ENABLE_LISTENVLAN
case 'v':
vlan = 1;
break;
+#endif
case 'd':
debug++;
break;
fatal(NULL);
cfg->g_mgmt_pattern = mgmtp;
+#ifdef ENABLE_LISTENVLAN
cfg->g_listen_vlans = vlan;
+#endif
/* Get ioctl socket */
if ((cfg->g_sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1)