summaryrefslogblamecommitdiffstats
path: root/private/inc/sys/snet/inet_var.h
blob: 83e142ba76ab6ba13fc390e26e01b596a9633c63 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485




































































































































































































































































































































































































































































































                                                                                               
/*++

Copyright (c) 1991  Microsoft Corporation

Module Name:

    inet_var.h

Abstract:

    This module contains definitions for variable finding functions for
    the Internet MIB. Used by STREAMS drivers.

Author:

    Eric Chin (ericc)           July 18, 1991

Revision History:

--*/

/*
 *   Copyright (c) 1988  Spider Systems Limited
 *
 *    /usr/users/bridge/sccs/appln/snmp/corecode/s.inet_var.h
 *   @(#)inet_var.h     1.4
 *
 *   Last delta created  10:33:41 12/13/90
 *   This file extracted 19:57:15 12/20/90
 */
/*************************************************************************
 *
 *  SpiderSNMP
 *
 *  Copyright 1989  Spider Systems Limited
 *
 *  INET_VAR.H
 *
 *    Definitions for variable finding functions for the Internet
 *    MIB
 *
 *    Peter Reid     @ Spider Systems Limited
 *    Ted Socolofsky @ Spider Systems Limited
 *
 *************************************************************************/

/*
 *      Modifications:
 *
 *       /usr/projects/spare/PBRAIN/SCCS/pbrainG/dev/src/include/sys/snet/0/s.inet_var.h
 *      @(#)inet_var.h  1.24
 *
 *      Last delta created      12:10:30 1/9/91
 *      This file extracted     08:53:47 7/10/91
 *
 *      PR               1 Jun 89       Built simulator
 *      PR/TS           31 Jun 89       Built remote box simulation
 *      GSS              2 Mar 90       Put in Pbrain
 */


#ifndef _SYS_SNET_INET_VAR_
#define _SYS_SNET_INET_VAR_


#ifndef SPIDER_ROUTER
#ifndef SPIDER_BRIDGE
#ifdef SNMP
#define SPIDER_TCP
#define SYSTEM_MIB
#define IF_MIB2
#define AT_MIB
#define IP_MIB
#define ICMP_MIB
#define TCP_MIB
#define UDP_MIB
#endif /* SNMP */
#endif /* ~SPIDER_BRIDGE */
#endif /* SPIDER_ROUTER */

#ifdef SYSTEM_MIB
#ifndef SHMEM


/*
 * Internet variables
 */
#define SYSDESCRLEN     80

#ifndef SYSOBJLEN
#define SYSOBJLEN       32
#endif

extern char             sysDescr[];
#ifdef SID_T
extern SID_T            sysObjectID[];
#endif

#ifdef DOS_COMPILE
#ifdef SPIDER_PROBE
#define sysUpTime       tod_tick
extern u_long   tod_tick;
#endif /* SPIDER_PROBE */
#endif /* DOS_COMPILE */

#ifndef SPIDER_PROBE
extern int              sysObjectIDLen;
#endif

#endif /* ~SHMEM */

#endif /* SYSTEM_MIB */

#ifdef IF_MIB2

struct mib_interface {
        long    version;                /* version number of the MIB         */
        long    ifNumber;               /* number of interfaces              */
};

#define         IFDESCRLEN      64
#define         IFPHYSADDRLEN   64

struct mib_ifEntry {
        long    version;                /* version number of the MIB         */
        long    ifIndex;                /* index of this interface           */
        char    ifDescr[IFDESCRLEN];    /* English description of interface  */
        long    ifType;                 /* network type of device            */
        long    ifMtu;                  /* size of largest packet in bytes   */
        u_long  ifSpeed;                /* bandwidth in bits/sec             */
        u_char  ifPhysAddress[IFPHYSADDRLEN];   /* interface's address       */
        u_char  PhysAddrLen;            /* length of physAddr                */
        long    ifAdminStatus;          /* desired state of interface        */
        long    ifOperStatus;           /* current operational status        */
        u_long  ifLastChange;           /* sysUpTime when curr state entered */
        u_long  ifInOctets;             /* # octets received on interface    */
        u_long  ifInUcastPkts;          /* # unicast packets delivered       */
        u_long  ifInNUcastPkts;         /* # broadcasts or multicasts        */
        u_long  ifInDiscards;           /* # packets discarded with no error */
        u_long  ifInErrors;             /* # packets containing errors       */
        u_long  ifInUnknownProtos;      /* # packets with unknown protocol   */
        u_long  ifOutOctets;            /* # octets transmittedwn protocol   */
        u_long  ifOutUcastPkts;         /* # unicast packets sent protocol   */
        u_long  ifOutNUcastPkts;        /* # broadcast or multicast pkts     */
        u_long  ifOutDiscards;          /* # packets discarded with no error */
        u_long  ifOutErrors;            /* # pkts discarded with an error    */
        u_long  ifOutQLen;              /* # packets in output queue         */
        u_char  ifSpecificLen;          /* length of object ID */
        u_long  ifSpecific[SYSOBJLEN];  /* object ID of product specific stuf*/
};

#ifndef SPIDER_TCP
#define         MAX_INTERFACES          2
#define         MAXDATA                 630
#endif /* SPIDER_TCP */

#endif /* IF_MIB2 */

#ifdef AT_MIB

#ifdef SPIDER_TCP
#define         ATPHYSADDRLEN   64

#endif
struct mib_atEntry {
#ifdef SPIDER_TCP
        long    version;                /* version number of the MIB         */
#endif /* SPIDER_TCP */
        long    atIfIndex;              /* interface on which entry maps     */
#ifdef SPIDER_TCP
        u_char  atPhysAddress[ATPHYSADDRLEN];   /* physical address of destination   */
#else
        u_char  atPhysAddress[IFPHYSADDRLEN];   /* physical address of destination   */
#endif
        u_char  PhysAddressLen;         /* length of atPhysAddress           */
        u_long  atNetAddress;           /* IP address of physical address    */
        long    atType;                 /* Type of Entry */
};
#endif /* AT_MIB */

#ifdef IP_MIB

struct mib_ip {
#ifdef SPIDER_TCP
        long    version;                /* version number of the MIB         */
#endif /* SPIDER_TCP */
        long    ipForwarding;           /* 1 if gateway, 2 if host           */
        long    ipDefaultTTL;           /* default TTL for pkts from here    */
        u_long  ipInReceives;           /* # IP packets rcvd from interfaces */
        u_long  ipInHdrErrors;          /* # pkts discarded - header errors  */
        u_long  ipInAddrErrors;         /* # pkts discarded - bad address    */
        u_long  ipForwDatagrams;        /* # pkts forwarded through entity   */
        u_long  ipInUnknownProtos;      /* # local-addr pkts w/unknown proto */
        u_long  ipInDiscards;           /* # error-free packets discarded    */
        u_long  ipInDelivers;           /* # pkts delivered to upper level   */
        u_long  ipOutRequests;          /* # IP pkts originating locally     */
        u_long  ipOutDiscards;          /* # valid output IP pkts dropped    */
        u_long  ipOutNoRoutes;          /* # IP pkts discarded - no route    */
        long    ipReasmTimeout;         /* fragment reassembly time (secs)   */
        u_long  ipReasmReqds;           /* # fragments needing reassembly    */
        u_long  ipReasmOKs;             /* # fragments reassembled           */
        u_long  ipReasmFails;           /* # failures in IP reassembly       */
        u_long  ipFragOKs;              /* # datagrams fragmented here       */
        u_long  ipFragFails;            /* # pkts unable to be fragmented    */
        u_long  ipFragCreates;          /* # IP fragments created here       */
        u_long  ipRoutingDiscards;      /* # IP Routing Discards             */
};

struct mib_ipAddrEntry {
#ifdef SPIDER_TCP
        long    version;                /* version number of the MIB         */
#endif /* SPIDER_TCP */
        u_long  ipAdEntAddr;            /* IP address of this entry          */
        long    ipAdEntIfIndex;         /* IF for this entry                 */
        u_long  ipAdEntNetMask;         /* subnet mask of this entry         */
        long    ipAdEntBcastAddr;       /* read the MIB for this one         */
        u_long  ipAdEntReasmMaxSize;    /* and this one */
};

struct mib_ipRouteEntry {
#ifdef SPIDER_TCP
        long    version;        /* version number of the MIB                 */
#endif /* SPIDER_TCP */
        u_long  ipRouteDest;    /* destination IP addr for this route        */
        long    ipRouteIfIndex; /* index of local IF for this route          */
        long    ipRouteMetric1; /* Primary routing metric                    */
        long    ipRouteMetric2; /* Alternate routing metric                  */
        long    ipRouteMetric3; /* Alternate routing metric                  */
        long    ipRouteMetric4; /* Alternate routing metric                  */
        u_long  ipRouteNextHop; /* IP addr of next hop                       */
        long    ipRouteType;    /* Type of this route                        */
        long    ipRouteProto;   /* How this route was learned                */
        long    ipRouteAge;     /* No. of seconds since updating this route  */
        u_long  ipRouteMask;    /* */
        long    ipRouteMetric5; /* Alternate routing metric                  */
        u_char  ipRouteInfoLen; /* length of object ID */
        u_long  ipRouteInfo[SYSOBJLEN];  /* object ID of product specific stuf*/
};

#if 0 /* MIB_II */
#define IPNTOMPHYSADDRLEN       16
struct mib_ipNetToMediaEntry {
        long    ipNtoMIfIndex;          /* interface on which entry maps     */
        u_char  ipNtoMPhysAddress[IPNTOMPHYSADDRLEN];   /* physical address of destination   */
        u_char  NtoMPhysAddressLen;     /* length of atPhysAddress           */
        u_long  ipNtoMNetAddress;       /* IP address of physical address    */
        u_long  ipNtoMMediaType;        /* */
};
#endif /* MIB_II */

#ifndef SPIDER_TCP
#define IPFRAGTTL               15
#define ROUTE_ENTRIES           2
#endif /* SPIDER_TCP */

#endif /* IP_MIB */
#ifdef ICMP_MIB


struct mib_icmp {
#ifdef SPIDER_TCP
        long    version;              /* version number of the MIB          */
#endif /* SPIDER_TCP */
        u_long  icmpInMsgs;           /* Total of ICMP msgs received        */
        u_long  icmpInErrors;         /* Total ICMP msgs rcvd with errors   */
        u_long  icmpInDestUnreachs;   /*                                    */
        u_long  icmpInTimeExcds;      /*                                    */
        u_long  icmpInParmProbs;      /*                                    */
        u_long  icmpInSrcQuenchs;     /*                                    */
        u_long  icmpInRedirects;      /*                                    */
        u_long  icmpInEchos;          /*                                    */
        u_long  icmpInEchoReps;       /*                                    */
        u_long  icmpInTimestamps;     /*                                    */
        u_long  icmpInTimestampReps;  /*                                    */
        u_long  icmpInAddrMasks;      /*                                    */
        u_long  icmpInAddrMaskReps;   /*                                    */
        u_long  icmpOutMsgs;          /*                                    */
        u_long  icmpOutErrors;        /*                                    */
        u_long  icmpOutDestUnreachs;  /*                                    */
        u_long  icmpOutTimeExcds;     /*                                    */
        u_long  icmpOutParmProbs;     /*                                    */
        u_long  icmpOutSrcQuenchs;    /*                                    */
        u_long  icmpOutRedirects;     /*                                    */
        u_long  icmpOutEchos;         /*                                    */
        u_long  icmpOutEchoReps;      /*                                    */
        u_long  icmpOutTimestamps;    /*                                    */
        u_long  icmpOutTimestampReps; /*                                    */
        u_long  icmpOutAddrMasks;     /*                                    */
        u_long  icmpOutAddrMaskReps;  /*                                    */
};

#define ICMP_MAXTYPE            18

#endif /* ICMP_MIB */
#ifdef TCP_MIB

struct mib_tcp {
#ifdef SPIDER_TCP
        long    version;        /* version number of the MIB                 */
#endif /* SPIDER_TCP */
        long    tcpRtoAlgorithm;/* retransmission timeout algorithm          */
        long    tcpRtoMin;      /* minimum retransmission timeout (mS)       */
        long    tcpRtoMax;      /* maximum retransmission timeout (mS)       */
        long    tcpMaxConn;     /* maximum tcp connections possible          */
        u_long  tcpActiveOpens; /* number of SYN-SENT -> CLOSED transitions  */
        u_long  tcpPassiveOpens;/* number of SYN-RCVD -> LISTEN transitions  */
        u_long  tcpAttemptFails;/* (SYNSENT,SYNRCV)->CLOSED, SYN-RCV->LISTEN */
        u_long  tcpEstabResets; /* (ESTABLISHED,CLOSE-WAIT) -> CLOSED        */
        u_long  tcpCurrEstab;   /* number in ESTABLISHED or CLOSE-WAIT state */
        u_long  tcpInSegs;      /* number of segments received               */
        u_long  tcpOutSegs;     /* number of segments sent                   */
        u_long  tcpRetransSegs; /* number of retransmitted segments          */
        u_long  tcpInErrs;      /* # rcved in err */
        u_long  tcpOutRsts;     /* # segs sent with RST flag */
};

struct mib_tcpConnEntry {
#ifdef SPIDER_TCP
        long    version;                /* version number of the MIB         */
#endif /* SPIDER_TCP */
        long    tcpConnState;           /* State of this conn                */
        u_long  tcpConnLocalAddress;    /* local IP address for this conn    */
        long    tcpConnLocalPort;       /* local port for this conn          */
        u_long  tcpConnRemAddress;      /* remote IP address for this conn   */
        long    tcpConnRemPort;         /* remote port for this conn         */
};

#endif /* TCP_MIB */
#ifdef UDP_MIB

struct mib_udp {
#ifdef SPIDER_TCP
        long    version;                /* version number of the MIB         */
#endif /* SPIDER_TCP */
        u_long  udpInDatagrams;         /* # UDP pkts delivered to users     */
        u_long  udpNoPorts;             /* # UDP pkts to unbound port        */
        u_long  udpInErrors;            /* # UDP pkts unable to be delivered */
        u_long  udpOutDatagrams;        /* # UDP pkts sent from this entity  */
};

struct mib_udpEntry {
#ifdef SPIDER_TCP
        long    version;                /* version number of the MIB         */
#endif /* SPIDER_TCP */
        u_long udpLocalAddress;         /* local IP adress */
        u_long udpLocalPort;            /* local port */
};
#endif /* UDP_MIB */
#ifdef EGP_MIB

struct mib_egp {
#ifdef SPIDER_TCP
        long    version;                /* version number of the MIB         */
#endif /* SPIDER_TCP */
        u_long  egpInMsgs;      /* No. of EGP msgs received without error    */
        u_long  egpInErrors;    /* No. of EGP msgs received with error       */
        u_long  egpOutMsgs;     /* No. of EGP msgs sent                      */
        u_long  egpOutErrors;   /* No. of EGP TX msgs dropped due to error   */
};

struct mib_egpNeighEntry {
#ifdef SPIDER_TCP
        long    version;                /* version number of the MIB         */
#endif /* SPIDER_TCP */
        long    egpNeighState;  /* local EGP state with entry's neighbor     */
        u_long  egpNeighAddr;   /* IP address of this entry's neighbor       */
};

#endif /* EGP_MIB */

#ifdef SYSTEM_MIB
#define SYS_SERVICE_PHYS        1
#define SYS_SERVICE_DATALINK    2
#define SYS_SERVICE_INTERNET    3
#define SYS_SERVICE_ENDTOEND    4
#define SYS_SERVICE_APPLIC      7
#endif

#ifdef IF_MIB2
#define MIB_IFTYPE_OTHER                    1
#define MIB_IFTYPE_REGULAR1822              2
#define MIB_IFTYPE_HDH1822                  3
#define MIB_IFTYPE_DDNX25                   4
#define MIB_IFTYPE_RFC877X25                5
#define MIB_IFTYPE_ETHERNETCSMACD           6
#define MIB_IFTYPE_ISO88023CSMACD           7
#define MIB_IFTYPE_ISO88024TOKENBUS         8
#define MIB_IFTYPE_ISO88025TOKENRING        9
#define MIB_IFTYPE_ISO88026MAN              10
#define MIB_IFTYPE_STARLAN                  11
#define MIB_IFTYPE_PROTEON10MBIT            12
#define MIB_IFTYPE_PROTEON80MBIT            13
#define MIB_IFTYPE_HYPERCHANNEL             14
#define MIB_IFTYPE_FDDI                     15
#define MIB_IFTYPE_LAPB                     16
#define MIB_IFTYPE_SDLC                     17
#define MIB_IFTYPE_T1CARRIER                18
#define MIB_IFTYPE_CEPT                     19
#define MIB_IFTYPE_BASICISDN                20
#define MIB_IFTYPE_PRIMARYISDN              21
#define MIB_IFTYPE_PROPPNTTOPNTSERIAL       22
#define MIB_IFTYPE_PPP                      23
#define MIB_IFTYPE_SOFTWARELOOPBACK         24
#define MIB_IFTYPE_EON                      25
#define MIB_IFTYPE_ETHERNET3MBIT            26
#define MIB_IFTYPE_NSIP                     27
#define MIB_IFTYPE_SLIP                     28
#define MIB_IFTYPE_ULTRA                    29
#define MIB_IFTYPE_DS3                      30
#define MIB_IFTYPE_SIP                      31
#define MIB_IFTYPE_FRAMERELAY               32


#define MIB_IFMTU_ETH           1514

#define MIB_IFSPEED_ETH         10000000L

#define MIB_PHYADDRLEN_ETH      6

#define MIB_IFSTATUS_UP         1
#define MIB_IFSTATUS_DOWN       2
#define MIB_IFSTATUS_TESTING    3

#endif /* IF_MIB2 */

#define AT_OTHER                1
#define AT_INVALID              2
#define AT_DYNAMIC              3
#define AT_STATIC               4

#ifdef IP_MIB
#define MIB_FORWARD_GATEWAY     1
#define MIB_FORWARD_HOST        2

#define MIB_IPROUTETYPE_OTHER   1
#define MIB_IPROUTETYPE_INVALID 2
#define MIB_IPROUTETYPE_DIRECT  3
#define MIB_IPROUTETYPE_REMOTE  4

#define MIB_IPROUTEPROTO_OTHER      1
#define MIB_IPROUTEPROTO_LOCAL      2
#define MIB_IPROUTEPROTO_NETMGMT    3
#define MIB_IPROUTEPROTO_ICMP       4
#define MIB_IPROUTEPROTO_EGP        5
#define MIB_IPROUTEPROTO_GGP        6
#define MIB_IPROUTEPROTO_HELLO      7
#define MIB_IPROUTEPROTO_RIP        8
#define MIB_IPROUTEPROTO_ISIS       9
#define MIB_IPROUTEPROTO_ESIS       10
#define MIB_IPROUTEPROTO_CISCOIGRP  11
#define MIB_IPROUTEPROTO_BBNSPFIGP  12
#define MIB_IPROUTEPROTO_OIGP       13

#endif /* IP_MIB */
#ifdef TCP_MIB

#define MIB_TCPRTOALG_OTHER     1
#define MIB_TCPRTOALG_CONSTANT  2
#define MIB_TCPRTOALG_RSRE      3
#define MIB_TCPRTOALG_VANJ      4

#define MIB_TCPCONNSTATE_CLOSED         1
#define MIB_TCPCONNSTATE_LISTEN         2
#define MIB_TCPCONNSTATE_SYNSENT        3
#define MIB_TCPCONNSTATE_SYNRECEIVED    4
#define MIB_TCPCONNSTATE_ESTABLISHED    5
#define MIB_TCPCONNSTATE_FINWAIT1       6
#define MIB_TCPCONNSTATE_FINWAIT2       7
#define MIB_TCPCONNSTATE_CLOSEWAIT      8
#define MIB_TCPCONNSTATE_LASTACK        9
#define MIB_TCPCONNSTATE_CLOSING        10
#define MIB_TCPCONNSTATE_TIMEWAIT       11

#endif /* TCP_MIB */
#ifdef EGP_MIB

#define MIB_EGPNEIGHSTATE_IDLE          1
#define MIB_EGPNEIGHSTATE_AQUISITION    2
#define MIB_EGPNEIGHSTATE_DOWN          3
#define MIB_EGPNEIGHSTATE_UP            4
#define MIB_EGPNEIGHSTATE_CEASE         5

#endif /* EGP_MIB */

#endif /* _SYS_SNET_INET_VAR_ */