00001 #ifndef __LINUX_NETLINK_H
00002 #define __LINUX_NETLINK_H
00003
00004 #define NETLINK_ROUTE 0
00005 #define NETLINK_W1 1
00006 #define NETLINK_USERSOCK 2
00007 #define NETLINK_FIREWALL 3
00008 #define NETLINK_INET_DIAG 4
00009 #define NETLINK_TCPDIAG NETLINK_INET_DIAG
00010 #define NETLINK_NFLOG 5
00011 #define NETLINK_XFRM 6
00012 #define NETLINK_SELINUX 7
00013 #define NETLINK_ISCSI 8
00014 #define NETLINK_AUDIT 9
00015 #define NETLINK_FIB_LOOKUP 10
00016 #define NETLINK_CONNECTOR 11
00017 #define NETLINK_NETFILTER 12
00018 #define NETLINK_IP6_FW 13
00019 #define NETLINK_DNRTMSG 14
00020 #define NETLINK_KOBJECT_UEVENT 15
00021 #define NETLINK_GENERIC 16
00022
00023 #define MAX_LINKS 32
00024
00025
00026
00027
00028
00029 struct sockaddr_nl
00030 {
00031
00032 sa_family_t nl_family;
00033
00034
00035 unsigned short nl_pad;
00036
00037
00038 uint32_t nl_pid;
00039
00040
00041 uint32_t nl_groups;
00042 };
00043
00044
00045
00046
00047
00048 struct nlmsghdr
00049 {
00050
00051
00052
00053 uint32_t nlmsg_len;
00054
00055
00056
00057
00058 uint16_t nlmsg_type;
00059
00060
00061
00062
00063 uint16_t nlmsg_flags;
00064
00065
00066
00067
00068 uint32_t nlmsg_seq;
00069
00070
00071
00072
00073 uint32_t nlmsg_pid;
00074 };
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 #define NLM_F_REQUEST 1
00087
00088
00089
00090
00091
00092 #define NLM_F_MULTI 2
00093
00094
00095
00096
00097 #define NLM_F_ACK 4
00098
00099
00100
00101
00102 #define NLM_F_ECHO 8
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115 #define NLM_F_ROOT 0x100
00116
00117
00118
00119
00120 #define NLM_F_MATCH 0x200
00121
00122
00123
00124
00125
00126
00127 #define NLM_F_ATOMIC 0x400
00128
00129
00130
00131
00132 #define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 #define NLM_F_REPLACE 0x100
00146
00147
00148
00149
00150 #define NLM_F_EXCL 0x200
00151
00152
00153
00154
00155 #define NLM_F_CREATE 0x400
00156
00157
00158
00159
00160 #define NLM_F_APPEND 0x800
00161
00162
00163
00164 #define NLMSG_ALIGNTO 4
00165 #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
00166 #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 #define NLMSG_NOOP 0x1
00178
00179
00180
00181
00182
00183
00184 #define NLMSG_ERROR 0x2
00185
00186
00187
00188
00189 #define NLMSG_DONE 0x3
00190
00191
00192
00193
00194 #define NLMSG_OVERRUN 0x4
00195
00196
00197
00198
00199 #define NLMSG_MIN_TYPE 0x10
00200
00201
00202
00203
00204
00205
00206
00207 struct nlmsgerr
00208 {
00209
00210 int error;
00211
00212
00213 struct nlmsghdr msg;
00214 };
00215
00216 #define NETLINK_ADD_MEMBERSHIP 1
00217 #define NETLINK_DROP_MEMBERSHIP 2
00218 #define NETLINK_PKTINFO 3
00219
00220 struct nl_pktinfo
00221 {
00222 __u32 group;
00223 };
00224
00225
00226
00227
00228
00229 struct nlattr
00230 {
00231
00232 __u16 nla_len;
00233
00234
00235 __u16 nla_type;
00236 };
00237
00238 #define NLA_ALIGNTO 4
00239 #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
00240 #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
00241
00242 #endif