lldpd (0.6)
+ * Features:
+ + Allow lldpctl to display hidden ports.
* Global changes:
+ Partial rewrite of the SNMP part. Less code.
+ Unit tests for SNMP.
.Sh SYNOPSIS
.Nm
.Op Fl d
+.Op Fl a
.Op Fl L Ar location
.Op Fl P Ar policy
.Op Fl O Ar poe
.Bl -tag -width Ds
.It Fl d
Enable more debugging information.
+.It Fl a
+Display all remote ports, including those hidden by the smart filter.
.It Fl f Ar format
Choose the output format. Currently
.Em plain ,
}
void
-display_interfaces(int s, const char * fmt, int argc, char *argv[])
+display_interfaces(int s, const char * fmt, int hidden, int argc, char *argv[])
{
int i;
struct writer * w;
if (TAILQ_EMPTY(&hardware->h_rports))
continue;
TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
- if (SMART_HIDDEN(port)) continue;
+ if (!hidden && SMART_HIDDEN(port)) continue;
chassis = port->p_chassis;
tag_start(w, "interface", "Interface");
# define __progname "lldpctl"
#endif
-#define LLDPCTL_ARGS "hdf:L:P:O:o:"
+#define LLDPCTL_ARGS "hdaf:L:P:O:o:"
static void
usage(void)
fprintf(stderr, "\n");
fprintf(stderr, "-d Enable more debugging information.\n");
+ fprintf(stderr, "-a Display all remote ports, including hidden ones.\n");
fprintf(stderr, "-f format Choose output format (plain, keyvalue or xml).\n");
#ifdef ENABLE_LLDPMED
fprintf(stderr, "-L location Enable the transmission of LLDP-MED location TLV for the\n");
{
int ch, s, debug = 1;
char * fmt = "plain";
- int action = 0;
+ int action = 0, hidden = 0;
/*
* Get and parse command line options
case 'd':
debug++;
break;
+ case 'a':
+ hidden = 1;
+ break;
case 'f':
fmt = optarg;
break;
fatalx("unable to connect to socket " LLDPD_CTL_SOCKET);
if (!action)
- display_interfaces(s, fmt, argc, argv);
+ display_interfaces(s, fmt, hidden, argc, argv);
else
set_port(s, argc, argv, action);
struct lldpd_hardware *get_interface(int, char *);
/* display.c */
-void display_interfaces(int, const char *, int, char **);
+void display_interfaces(int, const char *, int, int, char **);
#endif