]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/netlink.h
[XFRM] user: Move attribute copying code into copy_to_user_state_extra
[linux-2.6-omap-h63xx.git] / include / linux / netlink.h
index 83d8239f0cce60ae79b79b7adaab7670073839cc..e638256ce4729cc6e5398644c77b6ebd9ee2bfa8 100644 (file)
@@ -27,6 +27,8 @@
 
 #define MAX_LINKS 32           
 
+struct net;
+
 struct sockaddr_nl
 {
        sa_family_t     nl_family;      /* AF_NETLINK   */
@@ -129,6 +131,20 @@ struct nlattr
        __u16           nla_type;
 };
 
+/*
+ * nla_type (16 bits)
+ * +---+---+-------------------------------+
+ * | N | O | Attribute Type                |
+ * +---+---+-------------------------------+
+ * N := Carries nested attributes
+ * O := Payload stored in network byte order
+ *
+ * Note: The N and O flag are mutually exclusive.
+ */
+#define NLA_F_NESTED           (1 << 15)
+#define NLA_F_NET_BYTEORDER    (1 << 14)
+#define NLA_TYPE_MASK          ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
+
 #define NLA_ALIGNTO            4
 #define NLA_ALIGN(len)         (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
 #define NLA_HDRLEN             ((int) NLA_ALIGN(sizeof(struct nlattr)))
@@ -157,7 +173,8 @@ struct netlink_skb_parms
 #define NETLINK_CREDS(skb)     (&NETLINK_CB((skb)).creds)
 
 
-extern struct sock *netlink_kernel_create(int unit, unsigned int groups,
+extern struct sock *netlink_kernel_create(struct net *net,
+                                         int unit,unsigned int groups,
                                          void (*input)(struct sock *sk, int len),
                                          struct mutex *cb_mutex,
                                          struct module *module);
@@ -206,6 +223,7 @@ struct netlink_callback
 
 struct netlink_notify
 {
+       struct net *net;
        int pid;
        int protocol;
 };