lldpd (0.5.5)
* Features:
+ Support for PPVID and PI Dot1 TLV, thanks to Shuah Khan.
+ + Extend whitelist with possibility to blacklist.
* Fixes:
+ Key/value output was incorrect when a dot was present in
interface names. This is fixed but it is preferable to use XML
.Nm
will listen on all available interfaces. This option can use
wildcards. Several interfaces can be specified separated by commas.
+It is also possible to blacklist an interface by suffixing it with an
+exclamation mark. When an interface is both specified with and without
+an exclamation mark, it is blacklisted. For example, with
+.Em eth*,!eth1,!eth2
+.Nm
+will only listen to interfaces starting by
+.Em eth
+with the exception of
+.Em eth1
+and
+.Em eth2 .
.It Fl M Ar class
Enable emission of LLDP-MED frame. The class should be one of the
following value:
struct ifaddrs *ifa;
char *interfaces = NULL;
char *pattern;
+ int whitelisted;
if (!cfg->g_interfaces)
return;
for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
if (ifa->ifa_flags == 0) continue; /* Already handled by someone else */
strcpy(interfaces, cfg->g_interfaces); /* Restore our list of interfaces */
- pattern = strtok(interfaces, ",");
- while (pattern != NULL) {
- if (fnmatch(pattern, ifa->ifa_name, 0) == 0) {
- /* This interface is whitelisted */
+ whitelisted = 0;
+ ;
+ for (whitelisted = 0, pattern = strtok(interfaces, ",");
+ pattern != NULL;
+ pattern = strtok(NULL, ",")) {
+ if ((pattern[0] == '!') &&
+ ((fnmatch(pattern + 1, ifa->ifa_name, 0) == 0))) {
+ /* Blacklisted. Definitive */
+ whitelisted = 0;
break;
}
- pattern = strtok(NULL, ",");
+ if (fnmatch(pattern, ifa->ifa_name, 0) == 0)
+ whitelisted = 1;
}
- if (pattern == NULL) {
+ if (!whitelisted) {
/* This interface was not found. We flag it. */
LLOG_DEBUG("blacklist %s", ifa->ifa_name);
ifa->ifa_flags = 0;
fprintf(stderr, "-S descr Override the default system description.\n");
fprintf(stderr, "-m IP Specify the management address of this system.\n");
fprintf(stderr, "-H mode Specify the behaviour when detecting multiple neighbors.\n");
+ fprintf(stderr, "-I iface Limit interfaces to use.\n")
#ifdef ENABLE_LLDPMED
fprintf(stderr, "-M class Enable emission of LLDP-MED frame. 'class' should be one of:\n");
fprintf(stderr, " 1 Generic Endpoint (Class I)\n");