From: Vincent Bernat Date: Fri, 11 Mar 2016 23:58:34 +0000 (+0100) Subject: lldpcli: fix display of LLDP-MED POE TLV X-Git-Tag: 0.9.2~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60ad2804d138eafd817e25756e0965b1f39763d5;p=thirdparty%2Flldpd.git lldpcli: fix display of LLDP-MED POE TLV --- diff --git a/NEWS b/NEWS index 837833d1..fce3e93f 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ lldpd (0.9.2) * Change: + Ability to add/remove/replace custom TLV from lldpcli. + LLDP-MED capabilities are displayed differently in lldpcli. + * Fix: + + LLDP-MED POE TLV are now displayed in lldpcli. lldpd (0.9.1) * Change: diff --git a/src/client/display.c b/src/client/display.c index 6373bbd6..5101371e 100644 --- a/src/client/display.c +++ b/src/client/display.c @@ -61,6 +61,7 @@ display_med(struct writer *w, lldpctl_atom_t *port, lldpctl_atom_t *chassis) lldpctl_atom_t *medpolicies, *medpolicy; lldpctl_atom_t *medlocations, *medlocation; lldpctl_atom_t *caelements, *caelement; + lldpctl_atom_t *medpower; long int cap = lldpctl_atom_get_int(chassis, lldpctl_k_chassis_med_cap); const char *type; @@ -180,18 +181,22 @@ display_med(struct writer *w, lldpctl_atom_t *port, lldpctl_atom_t *chassis) lldpctl_atom_dec_ref(medlocations); /* LLDP MED power */ - if (lldpctl_atom_get_int(port, lldpctl_k_med_power_type) > 0) { + medpower = lldpctl_atom_get(port, lldpctl_k_port_med_power); + if (lldpctl_atom_get_int(medpower, lldpctl_k_med_power_type) > 0) { tag_start(w, "poe", "Extended Power-over-Ethernet"); tag_datatag(w, "device-type", "Power Type & Source", - lldpctl_atom_get_str(port, lldpctl_k_med_power_type)); + lldpctl_atom_get_str(medpower, lldpctl_k_med_power_type)); tag_datatag(w, "source", "Power Source", - lldpctl_atom_get_str(port, lldpctl_k_med_power_source)); + lldpctl_atom_get_str(medpower, lldpctl_k_med_power_source)); tag_datatag(w, "priority", "Power priority", - lldpctl_atom_get_str(port, lldpctl_k_med_power_priority)); + lldpctl_atom_get_str(medpower, lldpctl_k_med_power_priority)); tag_datatag(w, "power", "Power Value", - lldpctl_atom_get_str(port, lldpctl_k_med_power_val)); + lldpctl_atom_get_str(medpower, lldpctl_k_med_power_val)); + + tag_end(w); } + lldpctl_atom_dec_ref(medpower); /* LLDP MED inventory */ do {