diff options
Diffstat (limited to 'src/include/linux/netlink.h')
-rw-r--r-- | src/include/linux/netlink.h | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/src/include/linux/netlink.h b/src/include/linux/netlink.h index 4289ce937..af65dc499 100644 --- a/src/include/linux/netlink.h +++ b/src/include/linux/netlink.h @@ -1,8 +1,8 @@ #ifndef __LINUX_NETLINK_H #define __LINUX_NETLINK_H -#include <stdint.h> -#include <sys/socket.h> /* for sa_family_t */ +#include <linux/socket.h> /* for sa_family_t */ +#include <linux/types.h> #define NETLINK_ROUTE 0 /* Routing/device hook */ #define NETLINK_W1 1 /* 1-wire subsystem */ @@ -28,17 +28,17 @@ struct sockaddr_nl { sa_family_t nl_family; /* AF_NETLINK */ unsigned short nl_pad; /* zero */ - uint32_t nl_pid; /* process pid */ - uint32_t nl_groups; /* multicast groups mask */ + __u32 nl_pid; /* process pid */ + __u32 nl_groups; /* multicast groups mask */ }; struct nlmsghdr { - uint32_t nlmsg_len; /* Length of message including header */ - uint16_t nlmsg_type; /* Message content */ - uint16_t nlmsg_flags; /* Additional flags */ - uint32_t nlmsg_seq; /* Sequence number */ - uint32_t nlmsg_pid; /* Sending process PID */ + __u32 nlmsg_len; /* Length of message including header */ + __u16 nlmsg_type; /* Message content */ + __u16 nlmsg_flags; /* Additional flags */ + __u32 nlmsg_seq; /* Sequence number */ + __u32 nlmsg_pid; /* Sending process PID */ }; /* Flags values */ @@ -101,7 +101,7 @@ struct nlmsgerr struct nl_pktinfo { - uint32_t group; + __u32 group; }; #define NET_MAJOR 36 /* Major 36 is reserved for networking */ @@ -122,8 +122,8 @@ enum { struct nlattr { - uint16_t nla_len; - uint16_t nla_type; + __u16 nla_len; + __u16 nla_type; }; #define NLA_ALIGNTO 4 @@ -132,15 +132,18 @@ struct nlattr #ifdef __KERNEL__ +#include <linux/capability.h> +#include <linux/skbuff.h> + struct netlink_skb_parms { struct ucred creds; /* Skb credentials */ - uint32_t pid; - uint32_t dst_pid; - uint32_t dst_group; + __u32 pid; + __u32 dst_pid; + __u32 dst_group; kernel_cap_t eff_cap; - uint32_t loginuid; /* Login (audit) uid */ - uint32_t sid; /* SELinux security id */ + __u32 loginuid; /* Login (audit) uid */ + __u32 sid; /* SELinux security id */ }; #define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) @@ -150,10 +153,10 @@ struct netlink_skb_parms extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); 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); -extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, uint32_t pid, int nonblock); -extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, uint32_t pid, - uint32_t group, gfp_t allocation); -extern void netlink_set_err(struct sock *ssk, uint32_t pid, uint32_t group, int code); +extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); +extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, + __u32 group, gfp_t allocation); +extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); extern int netlink_register_notifier(struct notifier_block *nb); extern int netlink_unregister_notifier(struct notifier_block *nb); @@ -188,7 +191,7 @@ struct netlink_notify }; static __inline__ struct nlmsghdr * -__nlmsg_put(struct sk_buff *skb, uint32_t pid, uint32_t seq, int type, int len, int flags) +__nlmsg_put(struct sk_buff *skb, __u32 pid, __u32 seq, int type, int len, int flags) { struct nlmsghdr *nlh; int size = NLMSG_LENGTH(len); |