]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
core: SMART_HIDDEN macro does not really need the configuration
authorVincent Bernat <bernat@luffy.cx>
Mon, 23 Jan 2012 17:05:13 +0000 (18:05 +0100)
committerVincent Bernat <bernat@luffy.cx>
Mon, 23 Jan 2012 18:52:20 +0000 (19:52 +0100)
src/agent.c
src/client.c
src/lldpd.c
src/lldpd.h

index fba56ee8d8bbc701d1e239c35ff51071fc33c44d..fe64bbaa82351df4e8343c310abcffba352c9a06 100644 (file)
@@ -210,7 +210,7 @@ header_tprindexed_table(struct variable *vp, oid *name, size_t *length,
        if (!header_index_init(vp, name, length, exact, var_len, write_method)) return NULL;
        TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) {
                TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                       if (SMART_HIDDEN(scfg, port)) continue;
+                       if (SMART_HIDDEN(port)) continue;
                        if (withmed && !port->p_chassis->c_med_cap_available) continue;
                        oid index[3] = { lastchange(port),
                                         hardware->h_ifindex,
@@ -253,7 +253,7 @@ header_tpripindexed_table(struct variable *vp, oid *name, size_t *length,
        if (!header_index_init(vp, name, length, exact, var_len, write_method)) return NULL;
        TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) {
                TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                       if (SMART_HIDDEN(scfg, port)) continue;
+                       if (SMART_HIDDEN(port)) continue;
                        if (port->p_chassis->c_mgmt.s_addr == INADDR_ANY)
                                continue;
                        oid index[9] = { lastchange(port),
@@ -285,7 +285,7 @@ header_tprmedindexed_table(struct variable *vp, oid *name, size_t *length,
        if (!header_index_init(vp, name, length, exact, var_len, write_method)) return NULL;
        TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) {
                TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                       if (SMART_HIDDEN(scfg, port)) continue;
+                       if (SMART_HIDDEN(port)) continue;
                        if (!port->p_chassis->c_med_cap_available) continue;
                        switch (variant) {
                        case TPR_VARIANT_MED_POLICY:
@@ -355,7 +355,7 @@ header_tprvindexed_table(struct variable *vp, oid *name, size_t *length,
        if (!header_index_init(vp, name, length, exact, var_len, write_method)) return NULL;
        TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) {
                TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                       if (SMART_HIDDEN(scfg, port)) continue;
+                       if (SMART_HIDDEN(port)) continue;
                         TAILQ_FOREACH(vlan, &port->p_vlans, v_entries) {
                                oid index[4] = { lastchange(port),
                                                 hardware->h_ifindex,
@@ -401,7 +401,7 @@ header_tprppvidindexed_table(struct variable *vp, oid *name, size_t *length,
        if (!header_index_init(vp, name, length, exact, var_len, write_method)) return NULL;
        TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) {
                TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                       if (SMART_HIDDEN(scfg, port)) continue;
+                       if (SMART_HIDDEN(port)) continue;
                         TAILQ_FOREACH(ppvid, &port->p_ppvids, p_entries) {
                                oid index[4] = { lastchange(port),
                                                 hardware->h_ifindex,
@@ -448,7 +448,7 @@ header_tprpiindexed_table(struct variable *vp, oid *name, size_t *length,
        if (!header_index_init(vp, name, length, exact, var_len, write_method)) return NULL;
        TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) {
                TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                       if (SMART_HIDDEN(scfg, port)) continue;
+                       if (SMART_HIDDEN(port)) continue;
                         TAILQ_FOREACH(pi, &port->p_pids, p_entries) {
                                oid index[4] = { lastchange(port),
                                                 hardware->h_ifindex,
@@ -595,7 +595,7 @@ agent_h_scalars(struct variable *vp, oid *name, size_t *length,
                long_ret = 0;
                TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries)
                    TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                       if (SMART_HIDDEN(scfg, port)) continue;
+                       if (SMART_HIDDEN(port)) continue;
                        if (port->p_lastchange > long_ret)
                                long_ret = port->p_lastchange;
                }
index 8b5ea28ba4c2e9d7b0efee029e6b249119dd7cac..036fa89d9ba277e2417dcdc32602dc9b16212726 100644 (file)
@@ -250,7 +250,7 @@ client_handle_port_related(struct lldpd *cfg, struct hmsg *r, struct hmsg *s)
                                p = &s->data;
                                i = 0;
                                TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                                       if (SMART_HIDDEN(cfg, port)) continue;
+                                       if (SMART_HIDDEN(port)) continue;
                                        i++;
                                }
                                memcpy(p, &i, sizeof(int));
@@ -272,7 +272,7 @@ client_handle_port_related(struct lldpd *cfg, struct hmsg *r, struct hmsg *s)
                                memcpy(&i, p, sizeof(int));
                                p = &s->data;
                                TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
-                                       if (SMART_HIDDEN(cfg, port)) continue;
+                                       if (SMART_HIDDEN(port)) continue;
                                        if (i-- == 0) break;
                                }
                                if (!port) {
index 6f592d61e35a584433be0e5fb038651fba3edc0b..7f99d9ff55a9827264424b6b3e8cb75890f49232 100644 (file)
@@ -898,8 +898,7 @@ lldpd_send_all(struct lldpd *cfg)
                        TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
                                /* If this remote port is disabled, we don't
                                 * consider it */
-                               if (port->p_hidden_out &&
-                                   (cfg->g_smart & SMART_OUTGOING_FILTER))
+                               if (port->p_hidden_out)
                                        continue;
                                if (port->p_protocol ==
                                    cfg->g_protocols[i].mode) {
index 646c5246cd53be4283905502e046d86cabad4557..ad9ce7da65c301ba83cad75592a3401b63c160f9 100644 (file)
@@ -335,7 +335,7 @@ struct protocol {
 #define SMART_OUTGOING (SMART_OUTGOING_FILTER |                \
                        SMART_OUTGOING_ONE_PROTO |      \
                        SMART_OUTGOING_ONE_NEIGH)
-#define SMART_HIDDEN(cfg, port) ((cfg->g_smart & SMART_INCOMING_FILTER) && port->p_hidden_in)
+#define SMART_HIDDEN(port) (port->p_hidden_in)
 
 
 #define CALLBACK_SIG struct lldpd*, struct lldpd_callback*