2 * wpa_supplicant - Private copy of Linux netlink/rtnetlink definitions.
3 * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
15 #ifndef PRIV_NETLINK_H
16 #define PRIV_NETLINK_H
19 * This should be replaced with user space header once one is available with C
24 #define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
27 #define IFF_DORMANT 0x20000 /* driver signals dormant */
34 #define IFLA_WIRELESS 11
36 #ifndef IFLA_OPERSTATE
37 #define IFLA_OPERSTATE 16
40 #define IFLA_LINKMODE 17
41 #define IF_OPER_DORMANT 5
45 #define NLM_F_REQUEST 1
47 #define NETLINK_ROUTE 0
50 #define RTM_NEWLINK (RTM_BASE + 0)
51 #define RTM_DELLINK (RTM_BASE + 1)
52 #define RTM_SETLINK (RTM_BASE + 3)
54 #define NLMSG_ALIGNTO 4
55 #define NLMSG_ALIGN(len) (((len) + NLMSG_ALIGNTO - 1) & ~(NLMSG_ALIGNTO - 1))
56 #define NLMSG_LENGTH(len) ((len) + NLMSG_ALIGN(sizeof(struct nlmsghdr)))
57 #define NLMSG_DATA(nlh) ((void*) (((char*) nlh) + NLMSG_LENGTH(0)))
60 #define RTA_ALIGN(len) (((len) + RTA_ALIGNTO - 1) & ~(RTA_ALIGNTO - 1))
61 #define RTA_OK(rta,len) \
62 ((len) > 0 && (rta)->rta_len >= sizeof(struct rtattr) && \
63 (rta)->rta_len <= (len))
64 #define RTA_NEXT(rta,attrlen) \
65 ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
66 (struct rtattr *) (((char *)(rta)) + RTA_ALIGN((rta)->rta_len)))
67 #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
68 #define RTA_DATA(rta) ((void *) (((char *) (rta)) + RTA_LENGTH(0)))
73 sa_family_t nl_family
;
74 unsigned short nl_pad
;
90 unsigned char ifi_family
;
91 unsigned char __ifi_pad
;
92 unsigned short ifi_type
;
100 unsigned short rta_len
;
101 unsigned short rta_type
;
104 #endif /* PRIV_NETLINK_H */