diff options
author | Richard Alpe <richard.alpe@ericsson.com> | 2014-11-20 04:29:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-21 15:01:30 -0500 |
commit | 1a1a143daf84db95dd7212086042004a3abb7bc2 (patch) | |
tree | ac69d87fa4ab8434bf69f0121a51d83a48cf728d /net/tipc/netlink.c | |
parent | 34b78a127c4fd57cf3d5c64031693d10a8e0fae1 (diff) |
tipc: add publication dump to new netlink api
Add TIPC_NL_PUBL_GET command to the new tipc netlink API.
This command supports dumping of all publications for a specific
socket.
Netlink logical layout of request message:
-> socket
-> reference
Netlink logical layout of response message:
-> publication
-> type
-> lower
-> upper
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 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 951fabeec8b7..9bc64aaff466 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c | |||
@@ -74,6 +74,7 @@ static const struct nla_policy tipc_nl_policy[TIPC_NLA_MAX + 1] = { | |||
74 | [TIPC_NLA_UNSPEC] = { .type = NLA_UNSPEC, }, | 74 | [TIPC_NLA_UNSPEC] = { .type = NLA_UNSPEC, }, |
75 | [TIPC_NLA_BEARER] = { .type = NLA_NESTED, }, | 75 | [TIPC_NLA_BEARER] = { .type = NLA_NESTED, }, |
76 | [TIPC_NLA_SOCK] = { .type = NLA_NESTED, }, | 76 | [TIPC_NLA_SOCK] = { .type = NLA_NESTED, }, |
77 | [TIPC_NLA_PUBL] = { .type = NLA_NESTED, } | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | /* Legacy ASCII API */ | 80 | /* Legacy ASCII API */ |
@@ -130,9 +131,25 @@ static const struct genl_ops tipc_genl_v2_ops[] = { | |||
130 | .cmd = TIPC_NL_SOCK_GET, | 131 | .cmd = TIPC_NL_SOCK_GET, |
131 | .dumpit = tipc_nl_sk_dump, | 132 | .dumpit = tipc_nl_sk_dump, |
132 | .policy = tipc_nl_policy, | 133 | .policy = tipc_nl_policy, |
134 | }, | ||
135 | { | ||
136 | .cmd = TIPC_NL_PUBL_GET, | ||
137 | .dumpit = tipc_nl_publ_dump, | ||
138 | .policy = tipc_nl_policy, | ||
133 | } | 139 | } |
134 | }; | 140 | }; |
135 | 141 | ||
142 | int tipc_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr ***attr) | ||
143 | { | ||
144 | u32 maxattr = tipc_genl_v2_family.maxattr; | ||
145 | |||
146 | *attr = tipc_genl_v2_family.attrbuf; | ||
147 | if (!*attr) | ||
148 | return -EOPNOTSUPP; | ||
149 | |||
150 | return nlmsg_parse(nlh, GENL_HDRLEN, *attr, maxattr, tipc_nl_policy); | ||
151 | } | ||
152 | |||
136 | int tipc_netlink_start(void) | 153 | int tipc_netlink_start(void) |
137 | { | 154 | { |
138 | int res; | 155 | int res; |