1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use shared::basetsd::ULONG64;
7 use shared::minwindef::ULONG;
8 use shared::ntdef::BOOLEAN;
9 ENUM!{enum NL_PREFIX_ORIGIN {
10     IpPrefixOriginOther = 0,
11     IpPrefixOriginManual,
12     IpPrefixOriginWellKnown,
13     IpPrefixOriginDhcp,
14     IpPrefixOriginRouterAdvertisement,
15     IpPrefixOriginUnchanged = 1 << 4,
16 }}
17 pub const NlpoOther: NL_PREFIX_ORIGIN = IpPrefixOriginOther;
18 pub const NlpoManual: NL_PREFIX_ORIGIN = IpPrefixOriginManual;
19 pub const NlpoWellKnown: NL_PREFIX_ORIGIN = IpPrefixOriginWellKnown;
20 pub const NlpoDhcp: NL_PREFIX_ORIGIN = IpPrefixOriginDhcp;
21 pub const NlpoRouterAdvertisement: NL_PREFIX_ORIGIN = IpPrefixOriginRouterAdvertisement;
22 ENUM!{enum NL_SUFFIX_ORIGIN {
23     NlsoOther = 0,
24     NlsoManual,
25     NlsoWellKnown,
26     NlsoDhcp,
27     NlsoLinkLayerAddress,
28     NlsoRandom,
29     IpSuffixOriginOther = 0,
30     IpSuffixOriginManual,
31     IpSuffixOriginWellKnown,
32     IpSuffixOriginDhcp,
33     IpSuffixOriginLinkLayerAddress,
34     IpSuffixOriginRandom,
35     IpSuffixOriginUnchanged = 1 << 4,
36 }}
37 ENUM!{enum NL_DAD_STATE {
38     NldsInvalid,
39     NldsTentative,
40     NldsDuplicate,
41     NldsDeprecated,
42     NldsPreferred,
43     IpDadStateInvalid = 0,
44     IpDadStateTentative,
45     IpDadStateDuplicate,
46     IpDadStateDeprecated,
47     IpDadStatePreferred,
48 }}
49 pub const NL_MAX_METRIC_COMPONENT: ULONG = (1u32 << 31) - 1;
50 ENUM!{enum NL_ROUTE_PROTOCOL {
51     RouteProtocolOther = 1,
52     RouteProtocolLocal = 2,
53     RouteProtocolNetMgmt = 3,
54     RouteProtocolIcmp = 4,
55     RouteProtocolEgp = 5,
56     RouteProtocolGgp = 6,
57     RouteProtocolHello = 7,
58     RouteProtocolRip = 8,
59     RouteProtocolIsIs = 9,
60     RouteProtocolEsIs = 10,
61     RouteProtocolCisco = 11,
62     RouteProtocolBbn = 12,
63     RouteProtocolOspf = 13,
64     RouteProtocolBgp = 14,
65     RouteProtocolIdpr = 15,
66     RouteProtocolEigrp = 16,
67     RouteProtocolDvmrp = 17,
68     RouteProtocolRpl = 18,
69     RouteProtocolDhcp = 19,
70     MIB_IPPROTO_OTHER = 1,
71     PROTO_IP_OTHER = 1,
72     MIB_IPPROTO_LOCAL = 2,
73     PROTO_IP_LOCAL = 2,
74     MIB_IPPROTO_NETMGMT = 3,
75     PROTO_IP_NETMGMT = 3,
76     MIB_IPPROTO_ICMP = 4,
77     PROTO_IP_ICMP = 4,
78     MIB_IPPROTO_EGP = 5,
79     PROTO_IP_EGP = 5,
80     MIB_IPPROTO_GGP = 6,
81     PROTO_IP_GGP = 6,
82     MIB_IPPROTO_HELLO = 7,
83     PROTO_IP_HELLO = 7,
84     MIB_IPPROTO_RIP = 8,
85     PROTO_IP_RIP = 8,
86     MIB_IPPROTO_IS_IS = 9,
87     PROTO_IP_IS_IS = 9,
88     MIB_IPPROTO_ES_IS = 10,
89     PROTO_IP_ES_IS = 10,
90     MIB_IPPROTO_CISCO = 11,
91     PROTO_IP_CISCO = 11,
92     MIB_IPPROTO_BBN = 12,
93     PROTO_IP_BBN = 12,
94     MIB_IPPROTO_OSPF = 13,
95     PROTO_IP_OSPF = 13,
96     MIB_IPPROTO_BGP = 14,
97     PROTO_IP_BGP = 14,
98     MIB_IPPROTO_IDPR = 15,
99     PROTO_IP_IDPR = 15,
100     MIB_IPPROTO_EIGRP = 16,
101     PROTO_IP_EIGRP = 16,
102     MIB_IPPROTO_DVMRP = 17,
103     PROTO_IP_DVMRP = 17,
104     MIB_IPPROTO_RPL = 18,
105     PROTO_IP_RPL = 18,
106     MIB_IPPROTO_DHCP = 19,
107     PROTO_IP_DHCP = 19,
108     MIB_IPPROTO_NT_AUTOSTATIC = 10002,
109     PROTO_IP_NT_AUTOSTATIC = 10002,
110     MIB_IPPROTO_NT_STATIC = 10006,
111     PROTO_IP_NT_STATIC = 10006,
112     MIB_IPPROTO_NT_STATIC_NON_DOD = 10007,
113     PROTO_IP_NT_STATIC_NON_DOD = 10007,
114 }}
115 pub type PNL_ROUTE_PROTOCOL = *mut NL_ROUTE_PROTOCOL;
116 ENUM!{enum NL_ADDRESS_TYPE {
117     NlatUnspecified = 0,
118     NlatUnicast = 1,
119     NlatAnycast = 2,
120     NlatMulticast = 3,
121     NlatBroadcast = 4,
122     NlatInvalid = 5,
123 }}
124 pub type PNL_ADDRESS_TYPE = *mut NL_ADDRESS_TYPE;
125 ENUM!{enum NL_ROUTE_ORIGIN {
126     NlroManual = 0,
127     NlroWellKnown = 1,
128     NlroDHCP = 2,
129     NlroRouterAdvertisement = 3,
130     Nlro6to4 = 4,
131 }}
132 pub type PNL_ROUTE_ORIGIN = *mut NL_ROUTE_ORIGIN;
133 ENUM!{enum NL_NEIGHBOR_STATE {
134     NlnsUnreachable = 0,
135     NlnsIncomplete = 1,
136     NlnsProbe = 2,
137     NlnsDelay = 3,
138     NlnsStale = 4,
139     NlnsReachable = 5,
140     NlnsPermanent = 6,
141     NlnsMaximum = 7,
142 }}
143 pub type PNL_NEIGHBOR_STATE = *mut NL_NEIGHBOR_STATE;
144 ENUM!{enum NL_LINK_LOCAL_ADDRESS_BEHAVIOR {
145     LinkLocalAlwaysOff = 0,
146     LinkLocalDelayed = 1,
147     LinkLocalAlwaysOn = 2,
148     LinkLocalUnchanged = -1i32 as u32,
149 }}
150 STRUCT!{struct NL_INTERFACE_OFFLOAD_ROD {
151     bitfield: BOOLEAN,
152 }}
153 BITFIELD!{NL_INTERFACE_OFFLOAD_ROD bitfield: BOOLEAN [
154     NlChecksumSupported set_NlChecksumSupported[0..1],
155     NlOptionsSupported set_NlOptionsSupported[1..2],
156     TlDatagramChecksumSupported set_TlDatagramChecksumSupported[2..3],
157     TlStreamChecksumSupported set_TlStreamChecksumSupported[3..4],
158     TlStreamOptionsSupported set_TlStreamOptionsSupported[4..5],
159     FastPathCompatible set_FastPathCompatible[5..6],
160     TlLargeSendOffloadSupported set_TlLargeSendOffloadSupported[6..7],
161     TlGiantSendOffloadSupported set_TlGiantSendOffloadSupported[7..8],
162 ]}
163 pub type PNL_INTERFACE_OFFLOAD_ROD = *mut NL_INTERFACE_OFFLOAD_ROD;
164 ENUM!{enum NL_ROUTER_DISCOVERY_BEHAVIOR {
165     RouterDiscoveryDisabled = 0,
166     RouterDiscoveryEnabled = 1,
167     RouterDiscoveryDhcp = 2,
168     RouterDiscoveryUnchanged = -1i32 as u32,
169 }}
170 ENUM!{enum NL_BANDWIDTH_FLAG {
171     NlbwDisabled = 0,
172     NlbwEnabled = 1,
173     NlbwUnchanged = -1i32 as u32,
174 }}
175 pub type PNL_BANDWIDTH_FLAG = *mut NL_BANDWIDTH_FLAG;
176 STRUCT!{struct NL_PATH_BANDWIDTH_ROD {
177     Bandwidth: ULONG64,
178     Instability: ULONG64,
179     BandwidthPeaked: BOOLEAN,
180 }}
181 pub type PNL_PATH_BANDWIDTH_ROD = *mut NL_PATH_BANDWIDTH_ROD;
182 ENUM!{enum NL_NETWORK_CATEGORY {
183     NetworkCategoryPublic = 0,
184     NetworkCategoryPrivate = 1,
185     NetworkCategoryDomainAuthenticated = 2,
186     NetworkCategoryUnchanged = -1i32 as u32,
187     NetworkCategoryUnknown = -1i32 as u32,
188 }}
189 pub type PNL_NETWORK_CATEGORY = *mut NL_NETWORK_CATEGORY;
190 ENUM!{enum NL_INTERFACE_NETWORK_CATEGORY_STATE {
191     NlincCategoryUnknown = 0,
192     NlincPublic = 1,
193     NlincPrivate = 2,
194     NlincDomainAuthenticated = 3,
195     NlincCategoryStateMax = 4,
196 }}
197 pub type PNL_INTERFACE_NETWORK_CATEGORY_STATE = *mut NL_INTERFACE_NETWORK_CATEGORY_STATE;
198 pub const NET_IF_CURRENT_SESSION: ULONG = -1i32 as u32;
199 STRUCT!{struct NL_BANDWIDTH_INFORMATION {
200     Bandwidth: ULONG64,
201     Instability: ULONG64,
202     BandwidthPeaked: BOOLEAN,
203 }}
204 pub type PNL_BANDWIDTH_INFORMATION = *mut NL_BANDWIDTH_INFORMATION;
205