diff options
author | Richard Alpe <richard.alpe@ericsson.com> | 2016-03-04 11:04:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-07 14:56:41 -0500 |
commit | 49cc66eaee19e772997b63b057ea4b4bf7d48db0 (patch) | |
tree | 94239e052435b3c2d505c8be6e2f7582db5d1da8 /net/tipc/netlink.c | |
parent | 8dfd329fbc240729938d24bf87aca49ea89289c5 (diff) |
tipc: move netlink policies to netlink.c
Make the c files less cluttered and enable netlink attributes to be
shared between files.
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/netlink.c')
-rw-r--r-- | net/tipc/netlink.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 8975b0135b76..56935df2167a 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c | |||
@@ -55,6 +55,75 @@ static const struct nla_policy tipc_nl_policy[TIPC_NLA_MAX + 1] = { | |||
55 | [TIPC_NLA_NAME_TABLE] = { .type = NLA_NESTED, } | 55 | [TIPC_NLA_NAME_TABLE] = { .type = NLA_NESTED, } |
56 | }; | 56 | }; |
57 | 57 | ||
58 | const struct nla_policy | ||
59 | tipc_nl_name_table_policy[TIPC_NLA_NAME_TABLE_MAX + 1] = { | ||
60 | [TIPC_NLA_NAME_TABLE_UNSPEC] = { .type = NLA_UNSPEC }, | ||
61 | [TIPC_NLA_NAME_TABLE_PUBL] = { .type = NLA_NESTED } | ||
62 | }; | ||
63 | |||
64 | const struct nla_policy tipc_nl_sock_policy[TIPC_NLA_SOCK_MAX + 1] = { | ||
65 | [TIPC_NLA_SOCK_UNSPEC] = { .type = NLA_UNSPEC }, | ||
66 | [TIPC_NLA_SOCK_ADDR] = { .type = NLA_U32 }, | ||
67 | [TIPC_NLA_SOCK_REF] = { .type = NLA_U32 }, | ||
68 | [TIPC_NLA_SOCK_CON] = { .type = NLA_NESTED }, | ||
69 | [TIPC_NLA_SOCK_HAS_PUBL] = { .type = NLA_FLAG } | ||
70 | }; | ||
71 | |||
72 | const struct nla_policy tipc_nl_net_policy[TIPC_NLA_NET_MAX + 1] = { | ||
73 | [TIPC_NLA_NET_UNSPEC] = { .type = NLA_UNSPEC }, | ||
74 | [TIPC_NLA_NET_ID] = { .type = NLA_U32 } | ||
75 | }; | ||
76 | |||
77 | const struct nla_policy tipc_nl_link_policy[TIPC_NLA_LINK_MAX + 1] = { | ||
78 | [TIPC_NLA_LINK_UNSPEC] = { .type = NLA_UNSPEC }, | ||
79 | [TIPC_NLA_LINK_NAME] = { .type = NLA_STRING, | ||
80 | .len = TIPC_MAX_LINK_NAME }, | ||
81 | [TIPC_NLA_LINK_MTU] = { .type = NLA_U32 }, | ||
82 | [TIPC_NLA_LINK_BROADCAST] = { .type = NLA_FLAG }, | ||
83 | [TIPC_NLA_LINK_UP] = { .type = NLA_FLAG }, | ||
84 | [TIPC_NLA_LINK_ACTIVE] = { .type = NLA_FLAG }, | ||
85 | [TIPC_NLA_LINK_PROP] = { .type = NLA_NESTED }, | ||
86 | [TIPC_NLA_LINK_STATS] = { .type = NLA_NESTED }, | ||
87 | [TIPC_NLA_LINK_RX] = { .type = NLA_U32 }, | ||
88 | [TIPC_NLA_LINK_TX] = { .type = NLA_U32 } | ||
89 | }; | ||
90 | |||
91 | const struct nla_policy tipc_nl_node_policy[TIPC_NLA_NODE_MAX + 1] = { | ||
92 | [TIPC_NLA_NODE_UNSPEC] = { .type = NLA_UNSPEC }, | ||
93 | [TIPC_NLA_NODE_ADDR] = { .type = NLA_U32 }, | ||
94 | [TIPC_NLA_NODE_UP] = { .type = NLA_FLAG } | ||
95 | }; | ||
96 | |||
97 | /* Properties valid for media, bearer and link */ | ||
98 | const struct nla_policy tipc_nl_prop_policy[TIPC_NLA_PROP_MAX + 1] = { | ||
99 | [TIPC_NLA_PROP_UNSPEC] = { .type = NLA_UNSPEC }, | ||
100 | [TIPC_NLA_PROP_PRIO] = { .type = NLA_U32 }, | ||
101 | [TIPC_NLA_PROP_TOL] = { .type = NLA_U32 }, | ||
102 | [TIPC_NLA_PROP_WIN] = { .type = NLA_U32 } | ||
103 | }; | ||
104 | |||
105 | const struct nla_policy tipc_nl_bearer_policy[TIPC_NLA_BEARER_MAX + 1] = { | ||
106 | [TIPC_NLA_BEARER_UNSPEC] = { .type = NLA_UNSPEC }, | ||
107 | [TIPC_NLA_BEARER_NAME] = { .type = NLA_STRING, | ||
108 | .len = TIPC_MAX_BEARER_NAME }, | ||
109 | [TIPC_NLA_BEARER_PROP] = { .type = NLA_NESTED }, | ||
110 | [TIPC_NLA_BEARER_DOMAIN] = { .type = NLA_U32 } | ||
111 | }; | ||
112 | |||
113 | const struct nla_policy tipc_nl_media_policy[TIPC_NLA_MEDIA_MAX + 1] = { | ||
114 | [TIPC_NLA_MEDIA_UNSPEC] = { .type = NLA_UNSPEC }, | ||
115 | [TIPC_NLA_MEDIA_NAME] = { .type = NLA_STRING }, | ||
116 | [TIPC_NLA_MEDIA_PROP] = { .type = NLA_NESTED } | ||
117 | }; | ||
118 | |||
119 | const struct nla_policy tipc_nl_udp_policy[TIPC_NLA_UDP_MAX + 1] = { | ||
120 | [TIPC_NLA_UDP_UNSPEC] = {.type = NLA_UNSPEC}, | ||
121 | [TIPC_NLA_UDP_LOCAL] = {.type = NLA_BINARY, | ||
122 | .len = sizeof(struct sockaddr_storage)}, | ||
123 | [TIPC_NLA_UDP_REMOTE] = {.type = NLA_BINARY, | ||
124 | .len = sizeof(struct sockaddr_storage)}, | ||
125 | }; | ||
126 | |||
58 | /* Users of the legacy API (tipc-config) can't handle that we add operations, | 127 | /* Users of the legacy API (tipc-config) can't handle that we add operations, |
59 | * so we have a separate genl handling for the new API. | 128 | * so we have a separate genl handling for the new API. |
60 | */ | 129 | */ |