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