drbd: The kernel code is now equivalent to out of tree release 8.3.7
[safe/jmp/linux-2.6] / include / linux / netlink.h
index 1e6bf99..fde27c0 100644 (file)
 
 struct net;
 
-struct sockaddr_nl
-{
+struct sockaddr_nl {
        sa_family_t     nl_family;      /* AF_NETLINK   */
        unsigned short  nl_pad;         /* zero         */
        __u32           nl_pid;         /* port ID      */
                __u32           nl_groups;      /* multicast groups mask */
 };
 
-struct nlmsghdr
-{
+struct nlmsghdr {
        __u32           nlmsg_len;      /* Length of message including header */
        __u16           nlmsg_type;     /* Message content */
        __u16           nlmsg_flags;    /* Additional flags */
@@ -94,8 +92,7 @@ struct nlmsghdr
 
 #define NLMSG_MIN_TYPE         0x10    /* < 0x10: reserved control messages */
 
-struct nlmsgerr
-{
+struct nlmsgerr {
        int             error;
        struct nlmsghdr msg;
 };
@@ -104,9 +101,9 @@ struct nlmsgerr
 #define NETLINK_DROP_MEMBERSHIP        2
 #define NETLINK_PKTINFO                3
 #define NETLINK_BROADCAST_ERROR        4
+#define NETLINK_NO_ENOBUFS     5
 
-struct nl_pktinfo
-{
+struct nl_pktinfo {
        __u32   group;
 };
 
@@ -126,8 +123,7 @@ enum {
  *  <-------------- nlattr->nla_len -------------->
  */
 
-struct nlattr
-{
+struct nlattr {
        __u16           nla_len;
        __u16           nla_type;
 };
@@ -160,8 +156,7 @@ static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
        return (struct nlmsghdr *)skb->data;
 }
 
-struct netlink_skb_parms
-{
+struct netlink_skb_parms {
        struct ucred            creds;          /* Skb credentials      */
        __u32                   pid;
        __u32                   dst_group;
@@ -175,13 +170,18 @@ struct netlink_skb_parms
 #define NETLINK_CREDS(skb)     (&NETLINK_CB((skb)).creds)
 
 
+extern void netlink_table_grab(void);
+extern void netlink_table_ungrab(void);
+
 extern struct sock *netlink_kernel_create(struct net *net,
                                          int unit,unsigned int groups,
                                          void (*input)(struct sk_buff *skb),
                                          struct mutex *cb_mutex,
                                          struct module *module);
 extern void netlink_kernel_release(struct sock *sk);
+extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
 extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
+extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group);
 extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
 extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
 extern int netlink_has_listeners(struct sock *sk, unsigned int group);
@@ -214,18 +214,17 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
 #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN)
 
 
-struct netlink_callback
-{
-       struct sk_buff  *skb;
-       struct nlmsghdr *nlh;
-       int             (*dump)(struct sk_buff * skb, struct netlink_callback *cb);
-       int             (*done)(struct netlink_callback *cb);
-       int             family;
-       long            args[6];
+struct netlink_callback {
+       struct sk_buff          *skb;
+       const struct nlmsghdr   *nlh;
+       int                     (*dump)(struct sk_buff * skb,
+                                       struct netlink_callback *cb);
+       int                     (*done)(struct netlink_callback *cb);
+       int                     family;
+       long                    args[6];
 };
 
-struct netlink_notify
-{
+struct netlink_notify {
        struct net *net;
        int pid;
        int protocol;
@@ -257,7 +256,7 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
        NLMSG_NEW(skb, pid, seq, type, len, 0)
 
 extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
-                             struct nlmsghdr *nlh,
+                             const struct nlmsghdr *nlh,
                              int (*dump)(struct sk_buff *skb, struct netlink_callback*),
                              int (*done)(struct netlink_callback*));