]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Add some debug output to track know remote systems/ports.
authorVincent Bernat <bernat@luffy.cx>
Sun, 24 May 2009 17:16:01 +0000 (19:16 +0200)
committerVincent Bernat <bernat@luffy.cx>
Sun, 24 May 2009 19:31:18 +0000 (21:31 +0200)
src/lldpd.c

index 9a5fc6cffa999185c8c718fd4534719a297c78c7..13570a70ceb8e4ffdc77ac6b4b4d496752fbd46d 100644 (file)
@@ -619,6 +619,8 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s,
                port->p_chassis = chassis;
                chassis->c_refcount = 0;
                TAILQ_INSERT_TAIL(&cfg->g_chassis, chassis, c_entries);
+               i = 0; TAILQ_FOREACH(ochassis, &cfg->g_chassis, c_entries) i++;
+               LLOG_DEBUG("Currently, we know %d different systems", i);
        }
        /* Add port */
        port->p_lastchange = port->p_lastupdate = time(NULL);
@@ -630,6 +632,9 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s,
        TAILQ_INSERT_TAIL(&hardware->h_rports, port, p_entries);
        port->p_chassis = chassis;
        port->p_chassis->c_refcount++;
+       i = 0; TAILQ_FOREACH(oport, &hardware->h_rports, p_entries) i++;
+       LLOG_DEBUG("Currently, %s known %d neighbors",
+           hardware->h_ifname, i);
        return;
 }