4 /* Private copy of needed Linux netlink/rtnetlink definitions.
6 * This should be replaced with user space header once one is available with C
14 #define IFLA_WIRELESS 11
17 #define NETLINK_ROUTE 0
20 #define RTM_NEWLINK (RTM_BASE + 0)
21 #define RTM_DELLINK (RTM_BASE + 1)
23 #define NLMSG_ALIGNTO 4
24 #define NLMSG_ALIGN(len) (((len) + NLMSG_ALIGNTO - 1) & ~(NLMSG_ALIGNTO - 1))
25 #define NLMSG_LENGTH(len) ((len) + NLMSG_ALIGN(sizeof(struct nlmsghdr)))
26 #define NLMSG_DATA(nlh) ((void*) (((char*) nlh) + NLMSG_LENGTH(0)))
29 #define RTA_ALIGN(len) (((len) + RTA_ALIGNTO - 1) & ~(RTA_ALIGNTO - 1))
30 #define RTA_OK(rta,len) \
31 ((len) > 0 && (rta)->rta_len >= sizeof(struct rtattr) && \
32 (rta)->rta_len <= (len))
33 #define RTA_NEXT(rta,attrlen) \
34 ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
35 (struct rtattr *) (((char *)(rta)) + RTA_ALIGN((rta)->rta_len)))
40 sa_family_t nl_family
;
41 unsigned short nl_pad
;
57 unsigned char ifi_family
;
58 unsigned char __ifi_pad
;
59 unsigned short ifi_type
;
67 unsigned short rta_len
;
68 unsigned short rta_type
;
71 #endif /* PRIV_NETLINK_H */