@@ -55,6 +55,75 @@ static const struct nla_policy tipc_nl_policy[TIPC_NLA_MAX + 1] = {
5555 [TIPC_NLA_NAME_TABLE ] = { .type = NLA_NESTED , }
5656};
5757
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+
58127/* Users of the legacy API (tipc-config) can't handle that we add operations,
59128 * so we have a separate genl handling for the new API.
60129 */
0 commit comments