diff options
author | Richard Alpe <richard.alpe@ericsson.com> | 2014-11-20 04:29:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-21 15:01:30 -0500 |
commit | 7be57fc6918470ecacd16b89c0d4f73d8fc265c4 (patch) | |
tree | 858e3477e2bf49f4f0d052e2ef5c82d93b8bd1b4 /net/tipc/netlink.c | |
parent | 1a1a143daf84db95dd7212086042004a3abb7bc2 (diff) |
tipc: add link get/dump to new netlink api
Add TIPC_NL_LINK_GET command to the new tipc netlink API.
This command supports dumping all information about all links
(including the broadcast link) or getting all information about a
specific link (not the broadcast link).
The information about a link includes name, transmission info,
properties and link statistics.
As the tipc broadcast link is special we unfortunately have to treat
it specially. It is a deliberate decision not to abstract the
broadcast link on this (API) level.
Netlink logical layout of link response message:
-> port
-> name
-> MTU
-> RX
-> TX
-> up flag
-> active flag
-> properties
-> priority
-> tolerance
-> window
-> statistics
-> rx_info
-> rx_fragments
-> rx_fragmented
-> rx_bundles
-> rx_bundled
-> tx_info
-> tx_fragments
-> tx_fragmented
-> tx_bundles
-> tx_bundled
-> msg_prof_tot
-> msg_len_cnt
-> msg_len_tot
-> msg_len_p0
-> msg_len_p1
-> msg_len_p2
-> msg_len_p3
-> msg_len_p4
-> msg_len_p5
-> msg_len_p6
-> rx_states
-> rx_probes
-> rx_nacks
-> rx_deferred
-> tx_states
-> tx_probes
-> tx_nacks
-> tx_acks
-> retransmitted
-> duplicates
-> link_congs
-> max_queue
-> avg_queue
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 | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 9bc64aaff466..ea168b889caa 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "config.h" | 38 | #include "config.h" |
39 | #include "socket.h" | 39 | #include "socket.h" |
40 | #include "bearer.h" | 40 | #include "bearer.h" |
41 | #include "link.h" | ||
41 | #include <net/genetlink.h> | 42 | #include <net/genetlink.h> |
42 | 43 | ||
43 | static int handle_cmd(struct sk_buff *skb, struct genl_info *info) | 44 | static int handle_cmd(struct sk_buff *skb, struct genl_info *info) |
@@ -74,7 +75,8 @@ static const struct nla_policy tipc_nl_policy[TIPC_NLA_MAX + 1] = { | |||
74 | [TIPC_NLA_UNSPEC] = { .type = NLA_UNSPEC, }, | 75 | [TIPC_NLA_UNSPEC] = { .type = NLA_UNSPEC, }, |
75 | [TIPC_NLA_BEARER] = { .type = NLA_NESTED, }, | 76 | [TIPC_NLA_BEARER] = { .type = NLA_NESTED, }, |
76 | [TIPC_NLA_SOCK] = { .type = NLA_NESTED, }, | 77 | [TIPC_NLA_SOCK] = { .type = NLA_NESTED, }, |
77 | [TIPC_NLA_PUBL] = { .type = NLA_NESTED, } | 78 | [TIPC_NLA_PUBL] = { .type = NLA_NESTED, }, |
79 | [TIPC_NLA_LINK] = { .type = NLA_NESTED, }, | ||
78 | }; | 80 | }; |
79 | 81 | ||
80 | /* Legacy ASCII API */ | 82 | /* Legacy ASCII API */ |
@@ -136,6 +138,12 @@ static const struct genl_ops tipc_genl_v2_ops[] = { | |||
136 | .cmd = TIPC_NL_PUBL_GET, | 138 | .cmd = TIPC_NL_PUBL_GET, |
137 | .dumpit = tipc_nl_publ_dump, | 139 | .dumpit = tipc_nl_publ_dump, |
138 | .policy = tipc_nl_policy, | 140 | .policy = tipc_nl_policy, |
141 | }, | ||
142 | { | ||
143 | .cmd = TIPC_NL_LINK_GET, | ||
144 | .doit = tipc_nl_link_get, | ||
145 | .dumpit = tipc_nl_link_dump, | ||
146 | .policy = tipc_nl_policy, | ||
139 | } | 147 | } |
140 | }; | 148 | }; |
141 | 149 | ||