Since a node address now per definition is only an unstructured 32-bit
integer it makes no sense print it out as a structured string.

In this commit, we replace all occurrences of "<Z.C.N>" printouts with
just an "%x".

Signed-off-by: Jon Maloy <[email protected]>
---
 tipc/link.c      |  3 +--
 tipc/nametable.c |  8 +++-----
 tipc/node.c      | 11 ++---------
 tipc/socket.c    |  3 +--
 4 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/tipc/link.c b/tipc/link.c
index 4ae1c91..02f14aa 100644
--- a/tipc/link.c
+++ b/tipc/link.c
@@ -616,8 +616,7 @@ static void link_mon_print_non_applied(uint16_t applied, 
uint16_t member_cnt,
                if (i != applied)
                        printf(",");
 
-               sprintf(addr_str, "%u.%u.%u:", tipc_zone(members[i]),
-                       tipc_cluster(members[i]), tipc_node(members[i]));
+               sprintf(addr_str, "%x:", members[i]);
                state = map_get(up_map, i) ? 'U' : 'D';
                printf("%s%c", addr_str, state);
        }
diff --git a/tipc/nametable.c b/tipc/nametable.c
index 770a644..8473613 100644
--- a/tipc/nametable.c
+++ b/tipc/nametable.c
@@ -47,14 +47,12 @@ static int nametable_show_cb(const struct nlmsghdr *nlh, 
void *data)
 
        if (!*iteration)
                printf("%-10s %-10s %-10s %-26s %-10s\n",
-                      "Type", "Lower", "Upper", "Port Identity",
+                      "Type", "Lower", "Upper", "Node:Port",
                       "Publication Scope");
        (*iteration)++;
 
-       snprintf(port_id, sizeof(port_id), "<%u.%u.%u:%u>",
-                tipc_zone(mnl_attr_get_u32(publ[TIPC_NLA_PUBL_NODE])),
-                tipc_cluster(mnl_attr_get_u32(publ[TIPC_NLA_PUBL_NODE])),
-                tipc_node(mnl_attr_get_u32(publ[TIPC_NLA_PUBL_NODE])),
+       snprintf(port_id, sizeof(port_id), "%x:%u",
+                mnl_attr_get_u32(publ[TIPC_NLA_PUBL_NODE]),
                 mnl_attr_get_u32(publ[TIPC_NLA_PUBL_REF]));
 
        printf("%-10u %-10u %-10u %-26s %-12u",
diff --git a/tipc/node.c b/tipc/node.c
index a824ddf..5000ba2 100644
--- a/tipc/node.c
+++ b/tipc/node.c
@@ -40,10 +40,7 @@ static int node_list_cb(const struct nlmsghdr *nlh, void 
*data)
                return MNL_CB_ERROR;
 
        addr = mnl_attr_get_u32(attrs[TIPC_NLA_NODE_ADDR]);
-       printf("<%u.%u.%u>: ",
-               tipc_zone(addr),
-               tipc_cluster(addr),
-               tipc_node(addr));
+       printf("%x: ", addr);
 
        if (attrs[TIPC_NLA_NODE_UP])
                printf("up\n");
@@ -123,11 +120,7 @@ static int cmd_node_get_addr(struct nlmsghdr *nlh, const 
struct cmd *cmd,
        }
        close(sk);
 
-       printf("<%u.%u.%u>\n",
-               tipc_zone(addr.addr.id.node),
-               tipc_cluster(addr.addr.id.node),
-               tipc_node(addr.addr.id.node));
-
+       printf("%x\n", addr.addr.id.node);
        return 0;
 }
 
diff --git a/tipc/socket.c b/tipc/socket.c
index 48ba821..852984e 100644
--- a/tipc/socket.c
+++ b/tipc/socket.c
@@ -84,8 +84,7 @@ static int sock_list_cb(const struct nlmsghdr *nlh, void 
*data)
                mnl_attr_parse_nested(attrs[TIPC_NLA_SOCK_CON], parse_attrs, 
con);
                node = mnl_attr_get_u32(con[TIPC_NLA_CON_NODE]);
 
-               printf("  connected to <%u.%u.%u:%u>", tipc_zone(node),
-                       tipc_cluster(node), tipc_node(node),
+               printf("  connected to %x:%u", node,
                        mnl_attr_get_u32(con[TIPC_NLA_CON_SOCK]));
 
                if (con[TIPC_NLA_CON_FLAG])
-- 
2.1.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to