]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
client: display numeric PCP
authorVincent Bernat <vincent@bernat.im>
Tue, 15 Dec 2015 08:46:29 +0000 (09:46 +0100)
committerVincent Bernat <vincent@bernat.im>
Tue, 15 Dec 2015 08:46:29 +0000 (09:46 +0100)
Since the string value for network policy priority can change depending
on the used standard, it seems better to also provide a numeric
value. We name it PCP.

src/client/display.c

index be0c2ce4579a0ed763d618058fce1605242c7e0f..2695a719bc2a279e95cdc79152683f21d079a42c 100644 (file)
@@ -110,6 +110,11 @@ display_med(struct writer *w, lldpctl_atom_t *port, lldpctl_atom_t *chassis)
                tag_datatag(w, "priority", "Priority",
                    lldpctl_atom_get_str(medpolicy,
                        lldpctl_k_med_policy_priority));
+               /* Also give a numeric value */
+               int pcp = lldpctl_atom_get_int(medpolicy,
+                   lldpctl_k_med_policy_priority);
+               char spcp[2] = { pcp + '0', '\0' };
+               tag_datatag(w, "pcp", "PCP", spcp);
                tag_datatag(w, "dscp", "DSCP Value",
                    lldpctl_atom_get_str(medpolicy,
                        lldpctl_k_med_policy_dscp));