aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netlink.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r--include/linux/netlink.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index da14ab61f363..60e7137f840d 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -62,11 +62,35 @@ netlink_kernel_create(struct net *net, int unit, struct netlink_kernel_cfg *cfg)
62 return __netlink_kernel_create(net, unit, THIS_MODULE, cfg); 62 return __netlink_kernel_create(net, unit, THIS_MODULE, cfg);
63} 63}
64 64
65/**
66 * struct netlink_ext_ack - netlink extended ACK report struct
67 * @_msg: message string to report - don't access directly, use
68 * %NL_SET_ERR_MSG
69 * @bad_attr: attribute with error
70 */
71struct netlink_ext_ack {
72 const char *_msg;
73 const struct nlattr *bad_attr;
74};
75
76/* Always use this macro, this allows later putting the
77 * message into a separate section or such for things
78 * like translation or listing all possible messages.
79 * Currently string formatting is not supported (due
80 * to the lack of an output buffer.)
81 */
82#define NL_SET_ERR_MSG(extack, msg) do { \
83 static const char _msg[] = (msg); \
84 \
85 (extack)->_msg = _msg; \
86} while (0)
87
65extern void netlink_kernel_release(struct sock *sk); 88extern void netlink_kernel_release(struct sock *sk);
66extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); 89extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
67extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 90extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
68extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group); 91extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group);
69extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 92extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err,
93 const struct netlink_ext_ack *extack);
70extern int netlink_has_listeners(struct sock *sk, unsigned int group); 94extern int netlink_has_listeners(struct sock *sk, unsigned int group);
71 95
72extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock); 96extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);