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.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 83d8239f0cce..7c1f3b1d2ee5 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -27,6 +27,8 @@
27 27
28#define MAX_LINKS 32 28#define MAX_LINKS 32
29 29
30struct net;
31
30struct sockaddr_nl 32struct sockaddr_nl
31{ 33{
32 sa_family_t nl_family; /* AF_NETLINK */ 34 sa_family_t nl_family; /* AF_NETLINK */
@@ -129,6 +131,20 @@ struct nlattr
129 __u16 nla_type; 131 __u16 nla_type;
130}; 132};
131 133
134/*
135 * nla_type (16 bits)
136 * +---+---+-------------------------------+
137 * | N | O | Attribute Type |
138 * +---+---+-------------------------------+
139 * N := Carries nested attributes
140 * O := Payload stored in network byte order
141 *
142 * Note: The N and O flag are mutually exclusive.
143 */
144#define NLA_F_NESTED (1 << 15)
145#define NLA_F_NET_BYTEORDER (1 << 14)
146#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
147
132#define NLA_ALIGNTO 4 148#define NLA_ALIGNTO 4
133#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) 149#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
134#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) 150#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
@@ -157,8 +173,9 @@ struct netlink_skb_parms
157#define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) 173#define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds)
158 174
159 175
160extern struct sock *netlink_kernel_create(int unit, unsigned int groups, 176extern struct sock *netlink_kernel_create(struct net *net,
161 void (*input)(struct sock *sk, int len), 177 int unit,unsigned int groups,
178 void (*input)(struct sk_buff *skb),
162 struct mutex *cb_mutex, 179 struct mutex *cb_mutex,
163 struct module *module); 180 struct module *module);
164extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 181extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
@@ -177,7 +194,7 @@ struct sock *netlink_getsockbyfilp(struct file *filp);
177int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, 194int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
178 long timeo, struct sock *ssk); 195 long timeo, struct sock *ssk);
179void netlink_detachskb(struct sock *sk, struct sk_buff *skb); 196void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
180int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); 197int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
181 198
182/* 199/*
183 * skb should fit one page. This choice is good for headerless malloc. 200 * skb should fit one page. This choice is good for headerless malloc.
@@ -206,6 +223,7 @@ struct netlink_callback
206 223
207struct netlink_notify 224struct netlink_notify
208{ 225{
226 struct net *net;
209 int pid; 227 int pid;
210 int protocol; 228 int protocol;
211}; 229};