xref: /reactos/sdk/include/psdk/ipmib.h (revision c2c66aff)
1 /*
2  * Copyright (C) 2003 Juan Lang
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 #ifndef __WINE_IPMIB_H
19 #define __WINE_IPMIB_H
20 
21 #include <ifmib.h>
22 #include <nldef.h>
23 
24 /* Flags used in the wType field from MIB_IPADDRROW */
25 
26 #define MIB_IPADDR_PRIMARY 0x0001
27 #define MIB_IPADDR_DYNAMIC 0x0004
28 #define MIB_IPADDR_DISCONNECTED 0x0008
29 #define MIB_IPADDR_DELETED 0x0040
30 #define MIB_IPADDR_TRANSIENT 0x0080
31 
32 /* IPADDR table */
33 
34 typedef struct _MIB_IPADDRROW
35 {
36     DWORD          dwAddr;
37     IF_INDEX       dwIndex;
38     DWORD          dwMask;
39     DWORD          dwBCastAddr;
40     DWORD          dwReasmSize;
41     unsigned short unused1;
42     unsigned short wType;
43 } MIB_IPADDRROW, *PMIB_IPADDRROW;
44 
45 typedef struct _MIB_IPADDRTABLE
46 {
47     DWORD         dwNumEntries;
48     MIB_IPADDRROW table[1];
49 } MIB_IPADDRTABLE, *PMIB_IPADDRTABLE;
50 
51 
52 /* IPFORWARD table */
53 
54 typedef struct _MIB_IPFORWARDNUMBER
55 {
56     DWORD dwValue;
57 } MIB_IPFORWARDNUMBER, *PMIB_IPFORWARDNUMBER;
58 
59 typedef enum
60 {
61     MIB_IPROUTE_TYPE_OTHER = 1,
62     MIB_IPROUTE_TYPE_INVALID = 2,
63     MIB_IPROUTE_TYPE_DIRECT = 3,
64     MIB_IPROUTE_TYPE_INDIRECT = 4,
65 } MIB_IPFORWARD_TYPE;
66 
67 typedef NL_ROUTE_PROTOCOL MIB_IPFORWARD_PROTO;
68 
69 typedef struct _MIB_IPFORWARDROW
70 {
71     DWORD    dwForwardDest;
72     DWORD    dwForwardMask;
73     DWORD    dwForwardPolicy;
74     DWORD    dwForwardNextHop;
75     IF_INDEX dwForwardIfIndex;
76     union
77     {
78         DWORD              dwForwardType;
79         MIB_IPFORWARD_TYPE ForwardType;
80     } DUMMYUNIONNAME1;
81     union
82     {
83         DWORD               dwForwardProto;
84         MIB_IPFORWARD_PROTO ForwardProto;
85     } DUMMYUNIONNAME2;
86     DWORD    dwForwardAge;
87     DWORD    dwForwardNextHopAS;
88     DWORD    dwForwardMetric1;
89     DWORD    dwForwardMetric2;
90     DWORD    dwForwardMetric3;
91     DWORD    dwForwardMetric4;
92     DWORD    dwForwardMetric5;
93 } MIB_IPFORWARDROW, *PMIB_IPFORWARDROW;
94 
95 typedef struct _MIB_IPFORWARDTABLE
96 {
97     DWORD            dwNumEntries;
98     MIB_IPFORWARDROW table[1];
99 } MIB_IPFORWARDTABLE, *PMIB_IPFORWARDTABLE;
100 
101 
102 /* IPNET table */
103 
104 typedef enum
105 {
106     MIB_IPNET_TYPE_OTHER = 1,
107     MIB_IPNET_TYPE_INVALID = 2,
108     MIB_IPNET_TYPE_DYNAMIC = 3,
109     MIB_IPNET_TYPE_STATIC = 4,
110 } MIB_IPNET_TYPE;
111 
112 typedef struct _MIB_IPNETROW
113 {
114     DWORD dwIndex;
115     DWORD dwPhysAddrLen;
116     BYTE  bPhysAddr[MAXLEN_PHYSADDR];
117     DWORD dwAddr;
118     union
119     {
120         DWORD          dwType;
121         MIB_IPNET_TYPE Type;
122     } DUMMYUNIONNAME;
123 } MIB_IPNETROW, *PMIB_IPNETROW;
124 
125 typedef struct _MIB_IPNETTABLE
126 {
127     DWORD        dwNumEntries;
128     MIB_IPNETROW table[1];
129 } MIB_IPNETTABLE, *PMIB_IPNETTABLE;
130 
131 
132 /* IP statistics */
133 
134 typedef enum
135 {
136     MIB_IP_FORWARDING = 1,
137     MIB_IP_NOT_FORWARDING = 2,
138 } MIB_IPSTATS_FORWARDING, *PMIB_IPSTATS_FORWARDING;
139 
140 typedef struct _MIB_IPSTATS
141 {
142     union
143     {
144         DWORD                  dwForwarding;
145         MIB_IPSTATS_FORWARDING Forwarding;
146     } DUMMYUNIONNAME;
147     DWORD dwDefaultTTL;
148     DWORD dwInReceives;
149     DWORD dwInHdrErrors;
150     DWORD dwInAddrErrors;
151     DWORD dwForwDatagrams;
152     DWORD dwInUnknownProtos;
153     DWORD dwInDiscards;
154     DWORD dwInDelivers;
155     DWORD dwOutRequests;
156     DWORD dwRoutingDiscards;
157     DWORD dwOutDiscards;
158     DWORD dwOutNoRoutes;
159     DWORD dwReasmTimeout;
160     DWORD dwReasmReqds;
161     DWORD dwReasmOks;
162     DWORD dwReasmFails;
163     DWORD dwFragOks;
164     DWORD dwFragFails;
165     DWORD dwFragCreates;
166     DWORD dwNumIf;
167     DWORD dwNumAddr;
168     DWORD dwNumRoutes;
169 } MIB_IPSTATS, *PMIB_IPSTATS;
170 
171 
172 /* ICMP statistics */
173 
174 typedef struct _MIBICMPSTATS
175 {
176     DWORD dwMsgs;
177     DWORD dwErrors;
178     DWORD dwDestUnreachs;
179     DWORD dwTimeExcds;
180     DWORD dwParmProbs;
181     DWORD dwSrcQuenchs;
182     DWORD dwRedirects;
183     DWORD dwEchos;
184     DWORD dwEchoReps;
185     DWORD dwTimestamps;
186     DWORD dwTimestampReps;
187     DWORD dwAddrMasks;
188     DWORD dwAddrMaskReps;
189 } MIBICMPSTATS, *PMIBICMPSTATS;
190 
191 typedef struct _MIBICMPINFO
192 {
193     MIBICMPSTATS icmpInStats;
194     MIBICMPSTATS icmpOutStats;
195 } MIBICMPINFO;
196 
197 typedef struct _MIB_ICMP
198 {
199     MIBICMPINFO stats;
200 } MIB_ICMP, *PMIB_ICMP;
201 
202 typedef enum
203 {
204     ICMP4_ECHO_REPLY        =  0,
205     ICMP4_DST_UNREACH       =  3,
206     ICMP4_SOURCE_QUENCH     =  4,
207     ICMP4_REDIRECT          =  5,
208     ICMP4_ECHO_REQUEST      =  8,
209     ICMP4_ROUTER_ADVERT     =  9,
210     ICMP4_ROUTER_SOLICIT    = 10,
211     ICMP4_TIME_EXCEEDED     = 11,
212     ICMP4_PARAM_PROB        = 12,
213     ICMP4_TIMESTAMP_REQUEST = 13,
214     ICMP4_TIMESTAMP_REPLY   = 14,
215     ICMP4_MASK_REQUEST      = 17,
216     ICMP4_MASK_REPLY        = 18,
217 } ICMP4_TYPE, *PICMP4_TYPE;
218 
219 typedef enum
220 {
221     ICMP6_DST_UNREACH          =   1,
222     ICMP6_PACKET_TOO_BIG       =   2,
223     ICMP6_TIME_EXCEEDED        =   3,
224     ICMP6_PARAM_PROB           =   4,
225     ICMP6_ECHO_REQUEST         = 128,
226     ICMP6_ECHO_REPLY           = 129,
227     ICMP6_MEMBERSHIP_QUERY     = 130,
228     ICMP6_MEMBERSHIP_REPORT    = 131,
229     ICMP6_MEMBERSHIP_REDUCTION = 132,
230     ND_ROUTER_SOLICIT          = 133,
231     ND_ROUTER_ADVERT           = 134,
232     ND_NEIGHBOR_SOLICIT        = 135,
233     ND_NEIGHBOR_ADVERT         = 136,
234     ND_REDIRECT                = 137,
235     ICMP6_V2_MEMBERSHIP_REPORT = 143,
236 } ICMP6_TYPE, *PICMP6_TYPE;
237 
238 typedef struct _MIBICMPSTATS_EX
239 {
240     DWORD dwMsgs;
241     DWORD dwErrors;
242     DWORD rgdwTypeCount[256];
243 } MIBICMPSTATS_EX, *PMIBICMPSTATS_EX;
244 
245 typedef struct _MIB_ICMP_EX
246 {
247   MIBICMPSTATS_EX icmpInStats;
248   MIBICMPSTATS_EX icmpOutStats;
249 } MIB_ICMP_EX, *PMIB_ICMP_EX;
250 
251 #endif /* __WINE_IPMIB_H */
252