Example:
Node Identity                    Hash     Is container? State
1001002                          01001002 no            up
1001010                          31000101 no            up
1001011                          31010101 no            up
1001012                          31020101 no            up
1001003                          31030001 yes           up
1001013                          31030101 no            up
1001004                          31040001 yes           up
1001014                          31040101 no            up
1001015                          31050101 no            up
1001006                          31060001 yes           up
1001016                          31060101 no            up
1001007                          31070001 yes           up
1001008                          31080001 yes           up
1001009                          31090001 yes           up
100100a                          31510001 yes           up
100100b                          31520001 yes           up
100100c                          31530001 yes           up
100100d                          31540001 no            up
100100e                          31550001 no            up
100100f                          31560001 no            up

Signed-off-by: Hoang Le <[email protected]>
---
 include/uapi/linux/tipc_netlink.h | 1 +
 tipc/node.c                       | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/tipc_netlink.h 
b/include/uapi/linux/tipc_netlink.h
index efb958fd167d..1a071268bf5d 100644
--- a/include/uapi/linux/tipc_netlink.h
+++ b/include/uapi/linux/tipc_netlink.h
@@ -160,6 +160,7 @@ enum {
        TIPC_NLA_NODE_UNSPEC,
        TIPC_NLA_NODE_ADDR,             /* u32 */
        TIPC_NLA_NODE_UP,               /* flag */
+       TIPC_NLA_NODE_LOCAL,            /* flag */
 
        __TIPC_NLA_NODE_MAX,
        TIPC_NLA_NODE_MAX = __TIPC_NLA_NODE_MAX - 1
diff --git a/tipc/node.c b/tipc/node.c
index 2fec6753c974..b4203af014d3 100644
--- a/tipc/node.c
+++ b/tipc/node.c
@@ -42,6 +42,11 @@ static int node_list_cb(const struct nlmsghdr *nlh, void 
*data)
        addr = mnl_attr_get_u32(attrs[TIPC_NLA_NODE_ADDR]);
        hash2nodestr(addr, str);
        printf("%-32s %08x ", str, addr);
+       if (attrs[TIPC_NLA_NODE_LOCAL])
+               printf("%-12s  ", "yes");
+       else
+               printf("%-12s  ", "no");
+
        if (attrs[TIPC_NLA_NODE_UP])
                printf("up\n");
        else
@@ -63,7 +68,7 @@ static int cmd_node_list(struct nlmsghdr *nlh, const struct 
cmd *cmd,
                fprintf(stderr, "error, message initialisation failed\n");
                return -1;
        }
-       printf("Node Identity                    Hash     State\n");
+       printf("Node Identity                    Hash     Is container? 
State\n");
        return msg_dumpit(nlh, node_list_cb, NULL);
 }
 
-- 
2.20.1



_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to