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