.Os
.Sh NAME
.Nm lldpctl
-.Nd control the LLDP daemon
+.Nd retrieve neighbors discovered by the LLDP daemon
.Sh SYNOPSIS
.Nm
.Op Fl d
+.Op Ar interface ...
.Sh DESCRIPTION
The
.Nm
.It Fl d
Enable more debugging information.
.El
+.Pp
+Optionally, interfaces to display may be specified on the command
+line. By default, all interfaces are displayed.
.Sh FILES
.Bl -tag -width "/var/run/lldpd.socketXX" -compact
.It /var/run/lldpd.socket
int
main(int argc, char *argv[])
{
- int s;
+ int s, i;
int ch, debug = 1;
struct interfaces ifs;
#ifdef ENABLE_DOT1
default:
usage();
}
- }
+ }
log_init(debug);
memset(sep, '-', 79);
printf(" LLDP neighbors\n");
printf("%s\n", sep);
TAILQ_FOREACH(iff, &ifs, next) {
+ if (optind < argc) {
+ for (i = optind; i < argc; i++)
+ if (strncmp(argv[i], iff->name, IFNAMSIZ) == 0)
+ break;
+ if (i == argc)
+ continue;
+ }
if ((get_chassis(s, &chassis, iff->name) != -1) &&
(get_port(s, &port, iff->name) != -1)) {
printf("Interface: %s\n", iff->name);