xref: /illumos-gate/usr/src/uts/common/inet/kstatcom.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_INET_KSTATCOM_H
28 #define	_INET_KSTATCOM_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 
35 #include <sys/kstat.h>
36 
37 
38 
39 typedef struct ip_named_kstat {
40 	kstat_named_t forwarding;
41 	kstat_named_t defaultTTL;
42 	kstat_named_t inReceives;
43 	kstat_named_t inHdrErrors;
44 	kstat_named_t inAddrErrors;
45 	kstat_named_t forwDatagrams;
46 	kstat_named_t inUnknownProtos;
47 	kstat_named_t inDiscards;
48 	kstat_named_t inDelivers;
49 	kstat_named_t outRequests;
50 	kstat_named_t outDiscards;
51 	kstat_named_t outNoRoutes;
52 	kstat_named_t reasmTimeout;
53 	kstat_named_t reasmReqds;
54 	kstat_named_t reasmOKs;
55 	kstat_named_t reasmFails;
56 	kstat_named_t fragOKs;
57 	kstat_named_t fragFails;
58 	kstat_named_t fragCreates;
59 	kstat_named_t addrEntrySize;
60 	kstat_named_t routeEntrySize;
61 	kstat_named_t netToMediaEntrySize;
62 	kstat_named_t routingDiscards;
63 	kstat_named_t inErrs;
64 	kstat_named_t noPorts;
65 	kstat_named_t inCksumErrs;
66 	kstat_named_t reasmDuplicates;
67 	kstat_named_t reasmPartDups;
68 	kstat_named_t forwProhibits;
69 	kstat_named_t udpInCksumErrs;
70 	kstat_named_t udpInOverflows;
71 	kstat_named_t rawipInOverflows;
72 	kstat_named_t ipsecInSucceeded;
73 	kstat_named_t ipsecInFailed;
74 	kstat_named_t memberEntrySize;
75 	kstat_named_t inIPv6;
76 	kstat_named_t outIPv6;
77 	kstat_named_t outSwitchIPv6;
78 } ip_named_kstat_t;
79 
80 
81 typedef struct ipv6IfStatsEntry_named_kstat {
82 	kstat_named_t ifIndex;
83 	kstat_named_t forwarding;
84 	kstat_named_t defaultHopLimit;
85 	kstat_named_t ifStatsEntrySize;
86 	kstat_named_t addrEntrySize;
87 	kstat_named_t routeEntrySize;
88 	kstat_named_t netToMediaEntrySize;
89 	kstat_named_t memberEntrySize;
90 	kstat_named_t inReceives;
91 	kstat_named_t inHdrErrors;
92 	kstat_named_t inTooBigErrors;
93 	kstat_named_t InUnknownProtos;
94 	kstat_named_t inTruncatedPkts;
95 	kstat_named_t inDisards;
96 	kstat_named_t inDelivers;
97 	kstat_named_t outForwDatagrams;
98 	kstat_named_t outRequests;
99 	kstat_named_t outDiscards;
100 	kstat_named_t outFragOKs;
101 	kstat_named_t outFragFails;
102 	kstat_named_t outFragCreates;
103 	kstat_named_t reasmReqds;
104 	kstat_named_t reasmOKs;
105 	kstat_named_t reasmFails;
106 	kstat_named_t inMcastPkts;
107 	kstat_named_t outMcastPkts;
108 	kstat_named_t outNoRoutes;
109 	kstat_named_t reasmDuplicates;
110 	kstat_named_t reasmPartDups;
111 	kstat_named_t forwProhibits;
112 	kstat_named_t inChksumerrs;
113 	kstat_named_t inOverflows;
114 } ipv6IfStatsEntry_named_kstat_t;
115 
116 
117 typedef struct ipAddrEntry_named_kstat {
118 	kstat_named_t addr;
119 	kstat_named_t ifIndex;
120 	kstat_named_t netMask;
121 	kstat_named_t bcastAddr;
122 	kstat_named_t reasmMaxSize;
123 	kstat_named_t mtu;
124 	kstat_named_t metric;
125 	kstat_named_t broadcast_addr;
126 	kstat_named_t pp_dst_addr;
127 	kstat_named_t flags;
128 	kstat_named_t ibcnt;
129 	kstat_named_t obcnt;
130 	kstat_named_t focnt;
131 	kstat_named_t subnet;
132 	kstat_named_t subnet_len;
133 	kstat_named_t src_addr;
134 } ipAddrEntry_named_kstat_t;
135 
136 
137 typedef struct ipv6AddrEntry_named_kstat {
138 	kstat_named_t ifIndex;
139 	kstat_named_t address;
140 	kstat_named_t pfxLength;
141 	kstat_named_t type;
142 	kstat_named_t anycastFlag;
143 	kstat_named_t status;
144 	kstat_named_t mtu;
145 	kstat_named_t metric;
146 	kstat_named_t pp_dst_addr;
147 	kstat_named_t flags;
148 	kstat_named_t ibcnt;
149 	kstat_named_t obcnt;
150 	kstat_named_t focnt;
151 	kstat_named_t subnet;
152 	kstat_named_t subnet_len;
153 	kstat_named_t src_addr;
154 } ipv6AddrEntry_named_kstat_t;
155 
156 
157 typedef struct ipRouteEntry_named_kstat {
158 	kstat_named_t dest;
159 	kstat_named_t ifIndex;
160 	kstat_named_t metric1;
161 	kstat_named_t metric2;
162 	kstat_named_t metric3;
163 	kstat_named_t metric4;
164 	kstat_named_t nextHop;
165 	kstat_named_t type;
166 	kstat_named_t proto;
167 	kstat_named_t age;
168 	kstat_named_t mask;
169 	kstat_named_t metric5;
170 	kstat_named_t max_frag;
171 	kstat_named_t rtt;
172 	kstat_named_t ref;
173 	kstat_named_t frag_flag;
174 	kstat_named_t src_addr;
175 	kstat_named_t ire_type;
176 	kstat_named_t obppkt;
177 	kstat_named_t ibpkt;
178 	kstat_named_t flags;
179 	kstat_named_t in_ill;
180 	kstat_named_t in_src_addr;
181 } ipRouteEntry_named_kstat_t;
182 
183 
184 typedef struct ipv6RouteEntry_named_kstat {
185 	kstat_named_t dest;
186 	kstat_named_t pfxLength;
187 	kstat_named_t index;
188 	kstat_named_t ifIndex;
189 	kstat_named_t nextHop;
190 	kstat_named_t type;
191 	kstat_named_t protocol;
192 	kstat_named_t policy;
193 	kstat_named_t age;
194 	kstat_named_t nextHopRDI;
195 	kstat_named_t metric;
196 	kstat_named_t weight;
197 	kstat_named_t max_frag;
198 	kstat_named_t rtt;
199 	kstat_named_t ref;
200 	kstat_named_t frag_flag;
201 	kstat_named_t src_addr;
202 	kstat_named_t ire_type;
203 	kstat_named_t obpkt;
204 	kstat_named_t ibpkt;
205 	kstat_named_t flags;
206 } ipv6RouteEntry_named_kstat_t;
207 
208 
209 typedef struct ipNextToMediaEntry_named_kstat {
210 	kstat_named_t ifIndex;
211 	kstat_named_t physAddress;
212 	kstat_named_t netAddress;
213 	kstat_named_t type;
214 	kstat_named_t mask;
215 	kstat_named_t flags;
216 } ipNextToMediaEntry_named_kstat_t;
217 
218 typedef struct ipv6NextToMediaEntry_named_kstat {
219 	kstat_named_t ifIndex;
220 	kstat_named_t netAddress;
221 	kstat_named_t physAddress;
222 	kstat_named_t type;
223 	kstat_named_t state;
224 	kstat_named_t lastUpdated;
225 } ipv6NextToMediaEntry_named_kstat_t;
226 
227 typedef struct icmp_named_kstat {
228 	kstat_named_t inMsgs;
229 	kstat_named_t inErrors;
230 	kstat_named_t inDestUnreachs;
231 	kstat_named_t inTimeExcds;
232 	kstat_named_t inParmProbs;
233 	kstat_named_t inSrcQuenchs;
234 	kstat_named_t inRedirects;
235 	kstat_named_t inEchos;
236 	kstat_named_t inEchoReps;
237 	kstat_named_t inTimestamps;
238 	kstat_named_t inTimestampReps;
239 	kstat_named_t inAddrMasks;
240 	kstat_named_t inAddrMaskReps;
241 	kstat_named_t outMsgs;
242 	kstat_named_t outErrors;
243 	kstat_named_t outDestUnreachs;
244 	kstat_named_t outTimeExcds;
245 	kstat_named_t outParmProbs;
246 	kstat_named_t outSrcQuenchs;
247 	kstat_named_t outRedirects;
248 	kstat_named_t outEchos;
249 	kstat_named_t outEchoReps;
250 	kstat_named_t outTimestamps;
251 	kstat_named_t outTimestampReps;
252 	kstat_named_t outAddrMasks;
253 	kstat_named_t outAddrMaskReps;
254 	kstat_named_t inCksumErrs;
255 	kstat_named_t inUnknowns;
256 	kstat_named_t inFragNeeded;
257 	kstat_named_t outFragNeeded;
258 	kstat_named_t outDrops;
259 	kstat_named_t inOverflows;
260 	kstat_named_t inBadRedirects;
261 } icmp_named_kstat_t;
262 
263 
264 typedef struct ipv6IfIcmpEntry_named_kstat {
265 	kstat_named_t ifIndex;
266 	kstat_named_t entrySize;
267 	kstat_named_t inMsgs;
268 	kstat_named_t inErrors;
269 	kstat_named_t inDestUnreachs;
270 	kstat_named_t inAdminProhibs;
271 	kstat_named_t inTimeExcds;
272 	kstat_named_t inParmProblems;
273 	kstat_named_t inPktTooBigs;
274 	kstat_named_t inEchos;
275 	kstat_named_t inEchoReplies;
276 	kstat_named_t inRouterSolicits;
277 	kstat_named_t inRouterAdvertisements;
278 	kstat_named_t inNeighborSolicits;
279 	kstat_named_t inNeighborAdvertisements;
280 	kstat_named_t inRedirects;
281 	kstat_named_t inGroupMembQueries;
282 	kstat_named_t inGroupMembResponses;
283 	kstat_named_t inGroupMembReductions;
284 	kstat_named_t outMsgs;
285 	kstat_named_t outErrors;
286 	kstat_named_t outDestUnreachs;
287 	kstat_named_t outAdminProhibs;
288 	kstat_named_t outTimeExcds;
289 	kstat_named_t outParmProblems;
290 	kstat_named_t outPktTooBigs;
291 	kstat_named_t outEchos;
292 	kstat_named_t outEchoReplies;
293 	kstat_named_t outRouterSolicits;
294 	kstat_named_t outRouterAdvertisements;
295 	kstat_named_t outNeighborSolicits;
296 	kstat_named_t outNeighborAdvertisements;
297 	kstat_named_t outRedirects;
298 	kstat_named_t outGroupMembQueries;
299 	kstat_named_t outGroupMembResponses;
300 	kstat_named_t outGroupMembReductions;
301 	kstat_named_t inOverflows;
302 	kstat_named_t badHopLimit;
303 	kstat_named_t inBadNeighborAdvertisemets;
304 	kstat_named_t inBadNeighborSolicitations;
305 	kstat_named_t inBadRedirects;
306 	kstat_named_t inGroupMembBadQueries;
307 	kstat_named_t inGroupMembBadReports;
308 	kstat_named_t inGroupMembOurReports;
309 } ipv6IfIcmpEntry_named_kstat_t;
310 
311 
312 typedef struct sctp_named_kstat {
313 	kstat_named_t	sctpRtoAlgorithm;
314 	kstat_named_t	sctpRtoMin;
315 	kstat_named_t	sctpRtoMax;
316 	kstat_named_t	sctpRtoInitial;
317 	kstat_named_t	sctpMaxAssocs;
318 	kstat_named_t	sctpValCookieLife;
319 	kstat_named_t	sctpMaxInitRetr;
320 	kstat_named_t	sctpCurrEstab;
321 	kstat_named_t	sctpActiveEstab;
322 	kstat_named_t	sctpPassiveEstab;
323 	kstat_named_t	sctpAborted;
324 	kstat_named_t	sctpShutdowns;
325 	kstat_named_t	sctpOutOfBlue;
326 	kstat_named_t	sctpChecksumError;
327 	kstat_named_t	sctpOutCtrlChunks;
328 	kstat_named_t	sctpOutOrderChunks;
329 	kstat_named_t	sctpOutUnorderChunks;
330 	kstat_named_t	sctpRetransChunks;
331 	kstat_named_t	sctpOutAck;
332 	kstat_named_t	sctpOutAckDelayed;
333 	kstat_named_t	sctpOutWinUpdate;
334 	kstat_named_t	sctpOutFastRetrans;
335 	kstat_named_t	sctpOutWinProbe;
336 	kstat_named_t	sctpInCtrlChunks;
337 	kstat_named_t	sctpInOrderChunks;
338 	kstat_named_t	sctpInUnorderChunks;
339 	kstat_named_t	sctpInAck;
340 	kstat_named_t	sctpInDupAck;
341 	kstat_named_t	sctpInAckUnsent;
342 	kstat_named_t	sctpFragUsrMsgs;
343 	kstat_named_t	sctpReasmUsrMsgs;
344 	kstat_named_t	sctpOutSCTPPkts;
345 	kstat_named_t	sctpInSCTPPkts;
346 	kstat_named_t	sctpInInvalidCookie;
347 	kstat_named_t	sctpTimRetrans;
348 	kstat_named_t	sctpTimRetransDrop;
349 	kstat_named_t	sctpTimHeartBeatProbe;
350 	kstat_named_t	sctpTimHeartBeatDrop;
351 	kstat_named_t	sctpListenDrop;
352 	kstat_named_t	sctpInClosed;
353 } sctp_named_kstat_t;
354 
355 
356 typedef struct tcp_named_kstat {
357 	kstat_named_t rtoAlgorithm;
358 	kstat_named_t rtoMin;
359 	kstat_named_t rtoMax;
360 	kstat_named_t maxConn;
361 	kstat_named_t activeOpens;
362 	kstat_named_t passiveOpens;
363 	kstat_named_t attemptFails;
364 	kstat_named_t estabResets;
365 	kstat_named_t currEstab;
366 	kstat_named_t inSegs;
367 	kstat_named_t outSegs;
368 	kstat_named_t retransSegs;
369 	kstat_named_t connTableSize;
370 	kstat_named_t outRsts;
371 	kstat_named_t outDataSegs;
372 	kstat_named_t outDataBytes;
373 	kstat_named_t retransBytes;
374 	kstat_named_t outAck;
375 	kstat_named_t outAckDelayed;
376 	kstat_named_t outUrg;
377 	kstat_named_t outWinUpdate;
378 	kstat_named_t outWinProbe;
379 	kstat_named_t outControl;
380 	kstat_named_t outFastRetrans;
381 	kstat_named_t inAckSegs;
382 	kstat_named_t inAckBytes;
383 	kstat_named_t inDupAck;
384 	kstat_named_t inAckUnsent;
385 	kstat_named_t inDataInorderSegs;
386 	kstat_named_t inDataInorderBytes;
387 	kstat_named_t inDataUnorderSegs;
388 	kstat_named_t inDataUnorderBytes;
389 	kstat_named_t inDataDupSegs;
390 	kstat_named_t inDataDupBytes;
391 	kstat_named_t inDataPartDupSegs;
392 	kstat_named_t inDataPartDupBytes;
393 	kstat_named_t inDataPastWinSegs;
394 	kstat_named_t inDataPastWinBytes;
395 	kstat_named_t inWinProbe;
396 	kstat_named_t inWinUpdate;
397 	kstat_named_t inClosed;
398 	kstat_named_t rttNoUpdate;
399 	kstat_named_t rttUpdate;
400 	kstat_named_t timRetrans;
401 	kstat_named_t timRetransDrop;
402 	kstat_named_t timKeepalive;
403 	kstat_named_t timKeepaliveProbe;
404 	kstat_named_t timKeepaliveDrop;
405 	kstat_named_t listenDrop;
406 	kstat_named_t listenDropQ0;
407 	kstat_named_t halfOpenDrop;
408 	kstat_named_t outSackRetransSegs;
409 	kstat_named_t connTableSize6;
410 } tcp_named_kstat_t;
411 
412 typedef struct tcpConnEntry_named_kstat { /* IPv4 and IPv6 unified */
413 	kstat_named_t state;
414 	kstat_named_t localAddress;
415 	kstat_named_t localPort;
416 	kstat_named_t remAddress;
417 	kstat_named_t remPort;
418 	kstat_named_t snxt;
419 	kstat_named_t suna;
420 	kstat_named_t swnd;
421 	kstat_named_t rnxt;
422 	kstat_named_t rack;
423 	kstat_named_t rwnd;
424 	kstat_named_t rto;
425 	kstat_named_t mss;
426 	kstat_named_t internalState;
427 	kstat_named_t ifIndex;
428 	kstat_named_t version;
429 	kstat_named_t pid;
430 } tcpConnEntry_named_kstat_t;
431 
432 typedef struct udp_named_kstat {
433 	kstat_named_t inDatagrams;
434 	kstat_named_t inErrors;
435 	kstat_named_t outDatagrams;
436 	kstat_named_t entrySize;
437 	kstat_named_t entry6Size;
438 	kstat_named_t outErrors;
439 } udp_named_kstat_t;
440 
441 typedef struct udpEntry_named_kstat {
442 	kstat_named_t localAddress;
443 	kstat_named_t localPort;
444 	kstat_named_t state;
445 	kstat_named_t remoteAddress;
446 	kstat_named_t remotePort;
447 } udpEntry_named_kstat_t;
448 
449 
450 typedef struct udp6Entry_named_kstat {
451 	kstat_named_t localAddress;
452 	kstat_named_t localPort;
453 	kstat_named_t ifIndex;
454 	kstat_named_t state;
455 	kstat_named_t remoteAddress;
456 	kstat_named_t remotePort;
457 } udp6Entry_named_kstat_t;
458 
459 
460 typedef struct rawip_named_kstat {
461 	kstat_named_t inDatagrams;
462 	kstat_named_t inCksumErrs;
463 	kstat_named_t inErrors;
464 	kstat_named_t outDatagrams;
465 	kstat_named_t outErrors;
466 } rawip_named_kstat_t;
467 
468 
469 #define	NUM_OF_FIELDS(S)	(sizeof (S) / sizeof (kstat_named_t))
470 
471 #ifdef	__cplusplus
472 }
473 #endif
474 
475 #endif	/* _INET_KSTATCOM_H */
476