Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
netlink.h File Reference
#include <linux/socket.h>
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  sockaddr_nl
 
struct  nlmsghdr
 
struct  nlmsgerr
 
struct  nl_pktinfo
 
struct  nlattr
 

Macros

#define NETLINK_ROUTE   0 /* Routing/device hook */
 
#define NETLINK_UNUSED   1 /* Unused number */
 
#define NETLINK_USERSOCK   2 /* Reserved for user mode socket protocols */
 
#define NETLINK_FIREWALL   3 /* Unused number, formerly ip_queue */
 
#define NETLINK_SOCK_DIAG   4 /* socket monitoring */
 
#define NETLINK_NFLOG   5 /* netfilter/iptables ULOG */
 
#define NETLINK_XFRM   6 /* ipsec */
 
#define NETLINK_SELINUX   7 /* SELinux event notifications */
 
#define NETLINK_ISCSI   8 /* Open-iSCSI */
 
#define NETLINK_AUDIT   9 /* auditing */
 
#define NETLINK_FIB_LOOKUP   10
 
#define NETLINK_CONNECTOR   11
 
#define NETLINK_NETFILTER   12 /* netfilter subsystem */
 
#define NETLINK_IP6_FW   13
 
#define NETLINK_DNRTMSG   14 /* DECnet routing messages */
 
#define NETLINK_KOBJECT_UEVENT   15 /* Kernel messages to userspace */
 
#define NETLINK_GENERIC   16
 
#define NETLINK_SCSITRANSPORT   18 /* SCSI Transports */
 
#define NETLINK_ECRYPTFS   19
 
#define NETLINK_RDMA   20
 
#define NETLINK_CRYPTO   21 /* Crypto layer */
 
#define NETLINK_INET_DIAG   NETLINK_SOCK_DIAG
 
#define MAX_LINKS   32
 
#define NLM_F_REQUEST   1 /* It is request message. */
 
#define NLM_F_MULTI   2 /* Multipart message, terminated by NLMSG_DONE */
 
#define NLM_F_ACK   4 /* Reply with ack, with zero or error code */
 
#define NLM_F_ECHO   8 /* Echo this request */
 
#define NLM_F_DUMP_INTR   16 /* Dump was inconsistent due to sequence change */
 
#define NLM_F_ROOT   0x100 /* specify tree root */
 
#define NLM_F_MATCH   0x200 /* return all matching */
 
#define NLM_F_ATOMIC   0x400 /* atomic GET */
 
#define NLM_F_DUMP   (NLM_F_ROOT|NLM_F_MATCH)
 
#define NLM_F_REPLACE   0x100 /* Override existing */
 
#define NLM_F_EXCL   0x200 /* Do not touch, if it exists */
 
#define NLM_F_CREATE   0x400 /* Create, if it does not exist */
 
#define NLM_F_APPEND   0x800 /* Add to end of list */
 
#define NLMSG_ALIGNTO   4U
 
#define NLMSG_ALIGN(len)   ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
 
#define NLMSG_HDRLEN   ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
 
#define NLMSG_LENGTH(len)   ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
 
#define NLMSG_SPACE(len)   NLMSG_ALIGN(NLMSG_LENGTH(len))
 
#define NLMSG_DATA(nlh)   ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
 
#define NLMSG_NEXT(nlh, len)
 
#define NLMSG_OK(nlh, len)
 
#define NLMSG_PAYLOAD(nlh, len)   ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
 
#define NLMSG_NOOP   0x1 /* Nothing. */
 
#define NLMSG_ERROR   0x2 /* Error */
 
#define NLMSG_DONE   0x3 /* End of a dump */
 
#define NLMSG_OVERRUN   0x4 /* Data lost */
 
#define NLMSG_MIN_TYPE   0x10 /* < 0x10: reserved control messages */
 
#define NETLINK_ADD_MEMBERSHIP   1
 
#define NETLINK_DROP_MEMBERSHIP   2
 
#define NETLINK_PKTINFO   3
 
#define NETLINK_BROADCAST_ERROR   4
 
#define NETLINK_NO_ENOBUFS   5
 
#define NET_MAJOR   36 /* Major 36 is reserved for networking */
 
#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)))
 

Enumerations

enum  { NETLINK_UNCONNECTED = 0, NETLINK_CONNECTED }
 

Macro Definition Documentation

#define MAX_LINKS   32

Definition at line 32 of file netlink.h.

#define NET_MAJOR   36 /* Major 36 is reserved for networking */

Definition at line 113 of file netlink.h.

#define NETLINK_ADD_MEMBERSHIP   1

Definition at line 103 of file netlink.h.

#define NETLINK_AUDIT   9 /* auditing */

Definition at line 16 of file netlink.h.

#define NETLINK_BROADCAST_ERROR   4

Definition at line 106 of file netlink.h.

#define NETLINK_CONNECTOR   11

Definition at line 18 of file netlink.h.

#define NETLINK_CRYPTO   21 /* Crypto layer */

Definition at line 28 of file netlink.h.

#define NETLINK_DNRTMSG   14 /* DECnet routing messages */

Definition at line 21 of file netlink.h.

#define NETLINK_DROP_MEMBERSHIP   2

Definition at line 104 of file netlink.h.

#define NETLINK_ECRYPTFS   19

Definition at line 26 of file netlink.h.

#define NETLINK_FIB_LOOKUP   10

Definition at line 17 of file netlink.h.

#define NETLINK_FIREWALL   3 /* Unused number, formerly ip_queue */

Definition at line 10 of file netlink.h.

#define NETLINK_GENERIC   16

Definition at line 23 of file netlink.h.

#define NETLINK_INET_DIAG   NETLINK_SOCK_DIAG

Definition at line 30 of file netlink.h.

#define NETLINK_IP6_FW   13

Definition at line 20 of file netlink.h.

#define NETLINK_ISCSI   8 /* Open-iSCSI */

Definition at line 15 of file netlink.h.

#define NETLINK_KOBJECT_UEVENT   15 /* Kernel messages to userspace */

Definition at line 22 of file netlink.h.

#define NETLINK_NETFILTER   12 /* netfilter subsystem */

Definition at line 19 of file netlink.h.

#define NETLINK_NFLOG   5 /* netfilter/iptables ULOG */

Definition at line 12 of file netlink.h.

#define NETLINK_NO_ENOBUFS   5

Definition at line 107 of file netlink.h.

#define NETLINK_PKTINFO   3

Definition at line 105 of file netlink.h.

#define NETLINK_RDMA   20

Definition at line 27 of file netlink.h.

#define NETLINK_ROUTE   0 /* Routing/device hook */

Definition at line 7 of file netlink.h.

#define NETLINK_SCSITRANSPORT   18 /* SCSI Transports */

Definition at line 25 of file netlink.h.

#define NETLINK_SELINUX   7 /* SELinux event notifications */

Definition at line 14 of file netlink.h.

#define NETLINK_SOCK_DIAG   4 /* socket monitoring */

Definition at line 11 of file netlink.h.

#define NETLINK_UNUSED   1 /* Unused number */

Definition at line 8 of file netlink.h.

#define NETLINK_USERSOCK   2 /* Reserved for user mode socket protocols */

Definition at line 9 of file netlink.h.

#define NETLINK_XFRM   6 /* ipsec */

Definition at line 13 of file netlink.h.

#define NLA_ALIGN (   len)    (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))

Definition at line 149 of file netlink.h.

#define NLA_ALIGNTO   4

Definition at line 148 of file netlink.h.

#define NLA_F_NESTED   (1 << 15)

Definition at line 144 of file netlink.h.

#define NLA_F_NET_BYTEORDER   (1 << 14)

Definition at line 145 of file netlink.h.

#define NLA_HDRLEN   ((int) NLA_ALIGN(sizeof(struct nlattr)))

Definition at line 150 of file netlink.h.

#define NLA_TYPE_MASK   ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)

Definition at line 146 of file netlink.h.

#define NLM_F_ACK   4 /* Reply with ack, with zero or error code */

Definition at line 53 of file netlink.h.

#define NLM_F_APPEND   0x800 /* Add to end of list */

Definition at line 67 of file netlink.h.

#define NLM_F_ATOMIC   0x400 /* atomic GET */

Definition at line 60 of file netlink.h.

#define NLM_F_CREATE   0x400 /* Create, if it does not exist */

Definition at line 66 of file netlink.h.

#define NLM_F_DUMP   (NLM_F_ROOT|NLM_F_MATCH)

Definition at line 61 of file netlink.h.

#define NLM_F_DUMP_INTR   16 /* Dump was inconsistent due to sequence change */

Definition at line 55 of file netlink.h.

#define NLM_F_ECHO   8 /* Echo this request */

Definition at line 54 of file netlink.h.

#define NLM_F_EXCL   0x200 /* Do not touch, if it exists */

Definition at line 65 of file netlink.h.

#define NLM_F_MATCH   0x200 /* return all matching */

Definition at line 59 of file netlink.h.

#define NLM_F_MULTI   2 /* Multipart message, terminated by NLMSG_DONE */

Definition at line 52 of file netlink.h.

#define NLM_F_REPLACE   0x100 /* Override existing */

Definition at line 64 of file netlink.h.

#define NLM_F_REQUEST   1 /* It is request message. */

Definition at line 51 of file netlink.h.

#define NLM_F_ROOT   0x100 /* specify tree root */

Definition at line 58 of file netlink.h.

#define NLMSG_ALIGN (   len)    ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )

Definition at line 79 of file netlink.h.

#define NLMSG_ALIGNTO   4U

Definition at line 78 of file netlink.h.

#define NLMSG_DATA (   nlh)    ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))

Definition at line 83 of file netlink.h.

#define NLMSG_DONE   0x3 /* End of a dump */

Definition at line 93 of file netlink.h.

#define NLMSG_ERROR   0x2 /* Error */

Definition at line 92 of file netlink.h.

#define NLMSG_HDRLEN   ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))

Definition at line 80 of file netlink.h.

#define NLMSG_LENGTH (   len)    ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))

Definition at line 81 of file netlink.h.

#define NLMSG_MIN_TYPE   0x10 /* < 0x10: reserved control messages */

Definition at line 96 of file netlink.h.

#define NLMSG_NEXT (   nlh,
  len 
)
Value:
((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
(struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))

Definition at line 84 of file netlink.h.

#define NLMSG_NOOP   0x1 /* Nothing. */

Definition at line 91 of file netlink.h.

#define NLMSG_OK (   nlh,
  len 
)
Value:
((len) >= (int)sizeof(struct nlmsghdr) && \
(nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
(nlh)->nlmsg_len <= (len))

Definition at line 86 of file netlink.h.

#define NLMSG_OVERRUN   0x4 /* Data lost */

Definition at line 94 of file netlink.h.

#define NLMSG_PAYLOAD (   nlh,
  len 
)    ((nlh)->nlmsg_len - NLMSG_SPACE((len)))

Definition at line 89 of file netlink.h.

#define NLMSG_SPACE (   len)    NLMSG_ALIGN(NLMSG_LENGTH(len))

Definition at line 82 of file netlink.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
NETLINK_UNCONNECTED 
NETLINK_CONNECTED 

Definition at line 115 of file netlink.h.