]> git.saurik.com Git - apple/xnu.git/blob - bsd/netat/at_snmp.h
xnu-792.tar.gz
[apple/xnu.git] / bsd / netat / at_snmp.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 #ifndef _NETAT_AT_SNMP_H_
23 #define _NETAT_AT_SNMP_H_
24 #include <sys/appleapiopts.h>
25
26 #ifdef __APPLE_API_OBSOLETE
27
28 #define MAX_PHYS_ADDR_SIZE 6 /* maximum physical addr size */
29 #define MAX_IFS 25 /* max # interfaces */
30 #define IF_NAME_SIZE 6 /* max name length of I/F name */
31 #define DDP_ADDR_SIZE 3
32 #define ZONE_SIZE NBP_NVE_STR_SIZE
33 #define OBJECT_SIZE NBP_NVE_STR_SIZE
34 #define TYPE_SIZE NBP_NVE_STR_SIZE
35 #define PORT_DESC_SIZE 50
36 #define UPDATE_IF_CHANGED 1 /* for ioctls */
37 #define UPDATE_UNCONDITIONAL 2
38 #define SNMP_NBP_HEADER_SIZE (sizeof(snmpNbpTable_t) - sizeof(snmpNbpEntry_t))
39
40 typedef struct snmpIfCfg {
41 u_short ifc_aarpSize; /* AARP table size for this I/F */
42 u_short ifc_addrSize; /* Mac address size in bytes */
43 u_short ifc_type; /* port type */
44 at_net_al ifc_start; /* net range start */
45 at_net_al ifc_end; /* net range end */
46 struct at_addr ifc_ddpAddr; /* ddp address of port */
47 u_short ifc_status; /* port status */
48 u_short ifc_netCfg;
49 u_short ifc_zoneCfg;
50 at_nvestr_t ifc_zoneName;
51 u_short ifc_index;
52 char ifc_name[IF_NAME_SIZE]; /* I/F name (e.g. ent0 */
53 } snmpIfCfg_t;
54
55
56 typedef struct snmpCfg {
57 int pad; /* pad for UPDATE flag when ioctl issued */
58 u_int cfg_flags; /* at_state flags */
59 int cfg_ifCnt; /* # I/F's up */
60 snmpIfCfg_t cfg_ifCfg[MAX_IFS];
61 } snmpCfg_t;
62
63 typedef struct snmpAarpEnt {
64 struct at_addr ap_ddpAddr;
65 u_char ap_physAddr[MAX_PHYS_ADDR_SIZE];
66 }snmpAarpEnt_t;
67
68 typedef struct snmpAarp { /* aarp info for 1 I/F */
69 time_t at_time; /* the time() we got this table */
70 int at_ifno; /* the (SNMP) I/F number of this table */
71 int at_maxSize; /* allocated size of as_table in entries */
72 int at_usedSize; /* size of at_table used portion */
73 snmpAarpEnt_t *at_table;
74 } snmpAarp_t;
75
76 typedef struct snmpFlags {
77 int lap_changed; /* set when any I/F state changes */
78 int rtmpAdded; /* set when rtmp entry ADDED */
79 int zipAdded; /* set when zip entry ADDED */
80 } snmpFlags_t;
81
82 typedef struct snmpNbpEntry {
83 at_nvestr_t nbpe_object;
84 at_nvestr_t nbpe_type;
85 }snmpNbpEntry_t;
86
87 typedef struct snmpNbpTable {
88 int nbpt_entries;
89 at_nvestr_t nbpt_zone;
90 snmpNbpEntry_t nbpt_table[1];
91 }snmpNbpTable_t;
92
93
94
95
96 typedef struct snmpStats {
97
98 /* ddp group */
99 u_int dd_outReq;
100 u_int dd_outShort;
101 u_int dd_outLong;
102 u_int dd_inTotal;
103 u_int dd_fwdReq;
104 u_int dd_inLocal;
105 u_int dd_noHandler;
106 u_int dd_noRoutes;
107 u_int dd_tooShort;
108 u_int dd_tooLong;
109 u_int dd_inBcastErr;
110 u_int dd_shortErr;
111 u_int dd_hopCount;
112 u_int dd_checkSum;
113
114 /* ATEcho group */
115
116 u_int ec_echoReq;
117 u_int ec_echoReply;
118 } snmpStats_t;
119
120 #define SNMP_TYPE_OTHER 1
121 #define SNMP_TYPE_LOCAL 2
122 #define SNMP_TYPE_ETHER1 3
123 #define SNMP_TYPE_ETHER2 4
124 #define SNMP_TYPE_TOKEN 5
125 #define SNMP_TYPE_IP 6
126 #define SNMP_TYPE_SERIALPPP 7
127 #define SNMP_TYPE_SERIALNONSTD 8
128 #define SNMP_TYPE_VIRTUAL 9
129 #define SNMP_CFG_CONFIGURED 1
130 #define SNMP_CFG_GARNERED 2
131 #define SNMP_CFG_GUESSED 3
132 #define SNMP_CFG_UNCONFIG 4
133
134 #define SNMP_OBJ_TYPE_AARP 0x0100
135 #define SNMP_OBJ_TYPE_ECHO 0x0200
136 #define SNMP_OBJ_TYPE_PORT 0x0300
137 #define SNMP_OBJ_TYPE_DDP 0x0400
138 #define SNMP_OBJ_TYPE_RTMP 0x0500
139 #define SNMP_OBJ_TYPE_ZIP 0x0600
140 #define SNMP_OBJ_TYPE_NBP 0x0700
141 #define SNMP_OBJ_TYPE_MASK 0x0f00
142
143 #define AARPIFINDEX 2 + SNMP_OBJ_TYPE_AARP
144 #define AARPNETADDRESS 3 + SNMP_OBJ_TYPE_AARP
145 #define AARPPHYSADDRESS 4 + SNMP_OBJ_TYPE_AARP
146 #define ATECHOREPLIES 6 + SNMP_OBJ_TYPE_AARP
147 #define ATECHOREQUESTS 7 + SNMP_OBJ_TYPE_AARP
148 #define ATPORTDESCR 8 + SNMP_OBJ_TYPE_PORT
149 #define ATPORTIFINDEX 10 + SNMP_OBJ_TYPE_PORT
150 #define ATPORTINDEX 11 + SNMP_OBJ_TYPE_PORT
151 #define ATPORTNETADDRESS 12 + SNMP_OBJ_TYPE_PORT
152 #define ATPORTNETCONFIG 13 + SNMP_OBJ_TYPE_PORT
153 #define ATPORTNETEND 14 + SNMP_OBJ_TYPE_PORT
154 #define ATPORTNETSTART 15 + SNMP_OBJ_TYPE_PORT
155 #define ATPORTSTATUS 16 + SNMP_OBJ_TYPE_PORT
156 #define ATPORTTYPE 18 + SNMP_OBJ_TYPE_PORT
157 #define ATPORTZONE 19 + SNMP_OBJ_TYPE_PORT
158 #define ATPORTZONECONFIG 20 + SNMP_OBJ_TYPE_PORT
159 #define DDPBROADCASTERRORS 21 + SNMP_OBJ_TYPE_DDP
160 #define DDPCHECKSUMERRORS 22 + SNMP_OBJ_TYPE_DDP
161 #define DDPFORWREQUESTS 23 + SNMP_OBJ_TYPE_DDP
162 #define DDPHOPCOUNTERRORS 24 + SNMP_OBJ_TYPE_DDP
163 #define DDPINLOCALDATAGRAMS 25 + SNMP_OBJ_TYPE_DDP
164 #define DDPINRECEIVES 26 + SNMP_OBJ_TYPE_DDP
165 #define DDPNOPROTOCOLHANDLERS 27 + SNMP_OBJ_TYPE_DDP
166 #define DDPOUTLONGS 28 + SNMP_OBJ_TYPE_DDP
167 #define DDPOUTNOROUTES 29 + SNMP_OBJ_TYPE_DDP
168 #define DDPOUTREQUESTS 30 + SNMP_OBJ_TYPE_DDP
169 #define DDPOUTSHORTS 31 + SNMP_OBJ_TYPE_DDP
170 #define DDPSHORTDDPERRORS 32 + SNMP_OBJ_TYPE_DDP
171 #define DDPTOOLONGERRORS 33 + SNMP_OBJ_TYPE_DDP
172 #define DDPTOOSHORTERRORS 34 + SNMP_OBJ_TYPE_DDP
173 #define KIPBCASTADDR 35
174 #define KIPCORE 36
175 #define KIPENTRY 37
176 #define KIPHOPCOUNT 38
177 #define KIPNETEND 39
178 #define KIPNETSTART 40
179 #define KIPNEXTHOP 41
180 #define KIPSHARE 42
181 #define KIPSTATE 43
182 #define KIPTABLE 44
183 #define KIPTYPE 45
184 #define LLAPCOLLISIONS 46
185 #define LLAPDEFERS 47
186 #define LLAPENTRY 48
187 #define LLAPFCSERRORS 49
188 #define LLAPIFINDEX 50
189 #define LLAPINERRORS 51
190 #define LLAPINLENGTHERRORS 52
191 #define LLAPINNOHANDLERS 53
192 #define LLAPINPKTS 54
193 #define LLAPNODATAERRORS 55
194 #define LLAPOUTPKTS 56
195 #define LLAPRANDOMCTSERRORS 57
196 #define NBPINDEX 60 + SNMP_OBJ_TYPE_NBP
197 #define NBPOBJECT 61 + SNMP_OBJ_TYPE_NBP
198 #define NBPSTATE 62 + SNMP_OBJ_TYPE_NBP
199 #define NBPTABLE 63 + SNMP_OBJ_TYPE_NBP
200 #define NBPTYPE 64 + SNMP_OBJ_TYPE_NBP
201 #define NBPZONE 65 + SNMP_OBJ_TYPE_NBP
202 #define RTMPHOPS 67 + SNMP_OBJ_TYPE_RTMP
203 #define RTMPNEXTHOP 68 + SNMP_OBJ_TYPE_RTMP
204 #define RTMPPORT 69 + SNMP_OBJ_TYPE_RTMP
205 #define RTMPRANGEEND 70 + SNMP_OBJ_TYPE_RTMP
206 #define RTMPRANGESTART 71 + SNMP_OBJ_TYPE_RTMP
207 #define RTMPSTATE 72 + SNMP_OBJ_TYPE_RTMP
208 #define RTMPTYPE 74 + SNMP_OBJ_TYPE_RTMP
209 #define ZIPZONEINDEX 77 + SNMP_OBJ_TYPE_ZIP
210 #define ZIPZONENAME 78 + SNMP_OBJ_TYPE_ZIP
211 #define ZIPZONENETEND 79 + SNMP_OBJ_TYPE_ZIP
212 #define ZIPZONENETSTART 80 + SNMP_OBJ_TYPE_ZIP
213 #define ZIPZONESTATE 81 + SNMP_OBJ_TYPE_ZIP
214
215 #define SNMP_TYPE(var,type) ((var & SNMP_OBJ_TYPE_MASK) == type)
216
217 #endif /* __APPLE_API_OBSOLETE */
218 #endif /* _NETAT_AT_SNMP_H_ */