/home/tomh/openhip/hip-0.5/src/include/win32/netlink.h

Go to the documentation of this file.
00001 #ifndef __LINUX_NETLINK_H
00002 #define __LINUX_NETLINK_H
00003 
00004 #define NETLINK_ROUTE           0       /* Routing/device hook                          */
00005 #define NETLINK_SKIP            1       /* Reserved for ENskip                          */
00006 #define NETLINK_USERSOCK        2       /* Reserved for user mode socket protocols      */
00007 #define NETLINK_FIREWALL        3       /* Firewalling hook                             */
00008 #define NETLINK_TCPDIAG         4       /* TCP socket monitoring                        */
00009 #define NETLINK_NFLOG           5       /* netfilter/iptables ULOG */
00010 #define NETLINK_ARPD            8
00011 #define NETLINK_ROUTE6          11      /* af_inet6 route comm channel */
00012 #define NETLINK_IP6_FW          13
00013 #define NETLINK_DNRTMSG         14      /* DECnet routing messages */
00014 #define NETLINK_TAPBASE         16      /* 16 to 31 are ethertap */
00015 
00016 #define MAX_LINKS 32            
00017 
00018 #ifdef __WIN32__
00019 typedef unsigned char sa_family_t;
00020 #endif
00021 
00022 struct sockaddr_nl
00023 {
00024         sa_family_t     nl_family;      /* AF_NETLINK   */
00025         unsigned short  nl_pad;         /* zero         */
00026         __u32           nl_pid;         /* process pid  */
00027         __u32           nl_groups;      /* multicast groups mask */
00028 };
00029 
00030 struct nlmsghdr
00031 {
00032         __u32           nlmsg_len;      /* Length of message including header */
00033         __u16           nlmsg_type;     /* Message content */
00034         __u16           nlmsg_flags;    /* Additional flags */
00035         __u32           nlmsg_seq;      /* Sequence number */
00036         __u32           nlmsg_pid;      /* Sending process PID */
00037 };
00038 
00039 /* Flags values */
00040 
00041 #define NLM_F_REQUEST           1       /* It is request message.       */
00042 #define NLM_F_MULTI             2       /* Multipart message, terminated by NLMSG_DONE */
00043 #define NLM_F_ACK               4       /* Reply with ack, with zero or error code */
00044 #define NLM_F_ECHO              8       /* Echo this request            */
00045 
00046 /* Modifiers to GET request */
00047 #define NLM_F_ROOT      0x100   /* specify tree root    */
00048 #define NLM_F_MATCH     0x200   /* return all matching  */
00049 #define NLM_F_ATOMIC    0x400   /* atomic GET           */
00050 #define NLM_F_DUMP      (NLM_F_ROOT|NLM_F_MATCH)
00051 
00052 /* Modifiers to NEW request */
00053 #define NLM_F_REPLACE   0x100   /* Override existing            */
00054 #define NLM_F_EXCL      0x200   /* Do not touch, if it exists   */
00055 #define NLM_F_CREATE    0x400   /* Create, if it does not exist */
00056 #define NLM_F_APPEND    0x800   /* Add to end of list           */
00057 
00058 /*
00059    4.4BSD ADD           NLM_F_CREATE|NLM_F_EXCL
00060    4.4BSD CHANGE        NLM_F_REPLACE
00061 
00062    True CHANGE          NLM_F_CREATE|NLM_F_REPLACE
00063    Append               NLM_F_CREATE
00064    Check                NLM_F_EXCL
00065  */
00066 
00067 #define NLMSG_ALIGNTO   4
00068 #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
00069 #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr)))
00070 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
00071 #define NLMSG_DATA(nlh)  ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
00072 #define NLMSG_NEXT(nlh,len)      ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
00073                                   (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
00074 #define NLMSG_OK(nlh,len) ((len) > 0 && (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
00075                            (nlh)->nlmsg_len <= (len))
00076 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
00077 
00078 #define NLMSG_NOOP              0x1     /* Nothing.             */
00079 #define NLMSG_ERROR             0x2     /* Error                */
00080 #define NLMSG_DONE              0x3     /* End of a dump        */
00081 #define NLMSG_OVERRUN           0x4     /* Data lost            */
00082 
00083 struct nlmsgerr
00084 {
00085         int             error;
00086         struct nlmsghdr msg;
00087 };
00088 
00089 #define NET_MAJOR 36            /* Major 36 is reserved for networking                                          */
00090 
00091 
00092 #endif  /* __LINUX_NETLINK_H */

Generated on Mon Oct 22 11:43:43 2007 for OpenHIP by  doxygen 1.5.1