|
|
325a58 |
From cf3f54d1883e5bc23e4c4006a63e1dde88684013 Mon Sep 17 00:00:00 2001
|
|
|
325a58 |
From: Aaron Conole <aconole@redhat.com>
|
|
|
325a58 |
Date: Thu, 21 Jun 2018 13:28:48 -0400
|
|
|
325a58 |
Subject: [PATCH] basman_clif: print the OID properly
|
|
|
325a58 |
|
|
|
325a58 |
When invoking the lldp tool to view the management information, the display
|
|
|
325a58 |
for the OID is printed as the actual binary bits, rather than the
|
|
|
325a58 |
OID dotted-notation form.
|
|
|
325a58 |
|
|
|
325a58 |
This change will display the OID as expected.
|
|
|
325a58 |
|
|
|
325a58 |
Signed-off-by: Aaron Conole <aconole@redhat.com>
|
|
|
325a58 |
---
|
|
|
325a58 |
lldp_basman_clif.c | 18 ++++++++++++++++--
|
|
|
325a58 |
1 file changed, 16 insertions(+), 2 deletions(-)
|
|
|
325a58 |
|
|
|
325a58 |
diff --git a/lldp_basman_clif.c b/lldp_basman_clif.c
|
|
|
325a58 |
index 7dba9d2..abd152d 100644
|
|
|
325a58 |
--- a/lldp_basman_clif.c
|
|
|
325a58 |
+++ b/lldp_basman_clif.c
|
|
|
325a58 |
@@ -272,8 +272,15 @@ void print_mng_addr(u16 len, char *info)
|
|
|
325a58 |
memset(buf, 0, sizeof(buf));
|
|
|
325a58 |
if (hexstr2bin(info+offset, (u8 *)&buf, oidlen))
|
|
|
325a58 |
printf("\tOID: Error parsing OID\n");
|
|
|
325a58 |
- else
|
|
|
325a58 |
- printf("\tOID: %s\n", buf);
|
|
|
325a58 |
+ else {
|
|
|
325a58 |
+ printf("\tOID: 0.");
|
|
|
325a58 |
+ for (i = 0; i < oidlen; ++i) {
|
|
|
325a58 |
+ printf("%d", buf[i]);
|
|
|
325a58 |
+ if (i != (oidlen - 1))
|
|
|
325a58 |
+ printf(".");
|
|
|
325a58 |
+ }
|
|
|
325a58 |
+ printf("\n");
|
|
|
325a58 |
+ }
|
|
|
325a58 |
} else if (oidlen > 128) {
|
|
|
325a58 |
printf("\tOID: Invalid length = %d\n", oidlen);
|
|
|
325a58 |
}
|
|
|
325a58 |
@@ -310,3 +317,10 @@ u32 basman_lookup_tlv_name(char *tlvid_str)
|
|
|
325a58 |
}
|
|
|
325a58 |
return INVALID_TLVID;
|
|
|
325a58 |
}
|
|
|
325a58 |
+
|
|
|
325a58 |
+/* Local Variables: */
|
|
|
325a58 |
+/* c-indent-level: 8 */
|
|
|
325a58 |
+/* c-basic-offset: 8 */
|
|
|
325a58 |
+/* tab-width: 8 */
|
|
|
325a58 |
+/* indent-tabs-mode: t */
|
|
|
325a58 |
+/* End: */
|
|
|
325a58 |
--
|
|
|
325a58 |
2.14.3
|
|
|
325a58 |
|