diff options
author | Richard Alpe <richard.alpe@ericsson.com> | 2014-11-20 04:29:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-21 15:01:31 -0500 |
commit | 3e4b6ab58d614934e7ca99bdf448089695d34ffa (patch) | |
tree | d802397c1372ddba7e63eb784afb13261381d106 /net/tipc/netlink.c | |
parent | 1e55417d8fc6f6d93b1cc6995b911d48ded2adfb (diff) |
tipc: add node get/dump to new netlink api
Add TIPC_NL_NODE_GET to the new tipc netlink API.
This command can dump the address and node status of all nodes in the
tipc cluster.
Netlink logical layout of returned node/address data:
-> node
-> address
-> up flag
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/netlink.c')
-rw-r--r-- | net/tipc/netlink.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 8673e370b7ed..5b0e3c8457d2 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "socket.h" | 39 | #include "socket.h" |
40 | #include "bearer.h" | 40 | #include "bearer.h" |
41 | #include "link.h" | 41 | #include "link.h" |
42 | #include "node.h" | ||
42 | #include <net/genetlink.h> | 43 | #include <net/genetlink.h> |
43 | 44 | ||
44 | static int handle_cmd(struct sk_buff *skb, struct genl_info *info) | 45 | static int handle_cmd(struct sk_buff *skb, struct genl_info *info) |
@@ -78,6 +79,7 @@ static const struct nla_policy tipc_nl_policy[TIPC_NLA_MAX + 1] = { | |||
78 | [TIPC_NLA_PUBL] = { .type = NLA_NESTED, }, | 79 | [TIPC_NLA_PUBL] = { .type = NLA_NESTED, }, |
79 | [TIPC_NLA_LINK] = { .type = NLA_NESTED, }, | 80 | [TIPC_NLA_LINK] = { .type = NLA_NESTED, }, |
80 | [TIPC_NLA_MEDIA] = { .type = NLA_NESTED, }, | 81 | [TIPC_NLA_MEDIA] = { .type = NLA_NESTED, }, |
82 | [TIPC_NLA_NODE] = { .type = NLA_NESTED, } | ||
81 | }; | 83 | }; |
82 | 84 | ||
83 | /* Legacy ASCII API */ | 85 | /* Legacy ASCII API */ |
@@ -166,6 +168,11 @@ static const struct genl_ops tipc_genl_v2_ops[] = { | |||
166 | .cmd = TIPC_NL_MEDIA_SET, | 168 | .cmd = TIPC_NL_MEDIA_SET, |
167 | .doit = tipc_nl_media_set, | 169 | .doit = tipc_nl_media_set, |
168 | .policy = tipc_nl_policy, | 170 | .policy = tipc_nl_policy, |
171 | }, | ||
172 | { | ||
173 | .cmd = TIPC_NL_NODE_GET, | ||
174 | .dumpit = tipc_nl_node_dump, | ||
175 | .policy = tipc_nl_policy, | ||
169 | } | 176 | } |
170 | }; | 177 | }; |
171 | 178 | ||