root/webserver/example/freeRTOS/Demo/Common/ethernet/lwIP/include/lwip/snmp.h

Revision 14, 10.8 kB (checked in by phil, 15 years ago)

added unmodified FreeRTOS package V5.4.1 with only web srv demo source for LPC2368 for CrossWorks?

Line 
1 /*
2  * Copyright (c) 2001, 2002 Leon Woestenberg <leon.woestenberg@axon.tv>
3  * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without modification,
7  * are permitted provided that the following conditions are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright notice,
10  *    this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  *    this list of conditions and the following disclaimer in the documentation
13  *    and/or other materials provided with the distribution.
14  * 3. The name of the author may not be used to endorse or promote products
15  *    derived from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
18  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
20  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
22  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
26  * OF SUCH DAMAGE.
27  *
28  * This file is part of the lwIP TCP/IP stack.
29  *
30  * Author: Leon Woestenberg <leon.woestenberg@axon.tv>
31  *
32  */
33 #ifndef __LWIP_SNMP_H__
34 #define __LWIP_SNMP_H__
35
36 #include "lwip/opt.h"
37 #include "lwip/netif.h"
38 #include "lwip/udp.h"
39
40 /* SNMP support available? */
41 #if defined(LWIP_SNMP) && (LWIP_SNMP > 0)
42
43 /** fixed maximum length for object identifier type */
44 #define LWIP_SNMP_OBJ_ID_LEN 32
45 /** internal object identifier representation */
46 struct snmp_obj_id
47 {
48   u8_t len;
49   s32_t id[LWIP_SNMP_OBJ_ID_LEN];
50 };
51
52 /* system */
53 void snmp_set_sysdesr(u8_t* str, u8_t* strlen);
54 void snmp_set_sysobjid(struct snmp_obj_id *oid);
55 void snmp_get_sysobjid_ptr(struct snmp_obj_id **oid);
56 void snmp_inc_sysuptime(void);
57 void snmp_get_sysuptime(u32_t *value);
58 void snmp_set_syscontact(u8_t *ocstr, u8_t *ocstrlen);
59 void snmp_set_sysname(u8_t *ocstr, u8_t *ocstrlen);
60 void snmp_set_syslocation(u8_t *ocstr, u8_t *ocstrlen);
61
62 /* network interface */
63 void snmp_add_ifinoctets(struct netif *ni, u32_t value);
64 void snmp_inc_ifinucastpkts(struct netif *ni);
65 void snmp_inc_ifinnucastpkts(struct netif *ni);
66 void snmp_inc_ifindiscards(struct netif *ni);
67 void snmp_add_ifoutoctets(struct netif *ni, u32_t value);
68 void snmp_inc_ifoutucastpkts(struct netif *ni);
69 void snmp_inc_ifoutnucastpkts(struct netif *ni);
70 void snmp_inc_ifoutdiscards(struct netif *ni);
71 void snmp_inc_iflist(void);
72 void snmp_dec_iflist(void);
73
74 /* ARP (for atTable and ipNetToMediaTable) */
75 void snmp_insert_arpidx_tree(struct netif *ni, struct ip_addr *ip);
76 void snmp_delete_arpidx_tree(struct netif *ni, struct ip_addr *ip);
77
78 /* IP */
79 void snmp_inc_ipinreceives(void);
80 void snmp_inc_ipinhdrerrors(void);
81 void snmp_inc_ipinaddrerrors(void);
82 void snmp_inc_ipforwdatagrams(void);
83 void snmp_inc_ipinunknownprotos(void);
84 void snmp_inc_ipindiscards(void);
85 void snmp_inc_ipindelivers(void);
86 void snmp_inc_ipoutrequests(void);
87 void snmp_inc_ipoutdiscards(void);
88 void snmp_inc_ipoutnoroutes(void);
89 void snmp_inc_ipreasmreqds(void);
90 void snmp_inc_ipreasmoks(void);
91 void snmp_inc_ipreasmfails(void);
92 void snmp_inc_ipfragoks(void);
93 void snmp_inc_ipfragfails(void);
94 void snmp_inc_ipfragcreates(void);
95 void snmp_inc_iproutingdiscards(void);
96 void snmp_insert_ipaddridx_tree(struct netif *ni);
97 void snmp_delete_ipaddridx_tree(struct netif *ni);
98 void snmp_insert_iprteidx_tree(u8_t dflt, struct netif *ni);
99 void snmp_delete_iprteidx_tree(u8_t dflt, struct netif *ni);
100
101 /* ICMP */
102 void snmp_inc_icmpinmsgs(void);
103 void snmp_inc_icmpinerrors(void);
104 void snmp_inc_icmpindestunreachs(void);
105 void snmp_inc_icmpintimeexcds(void);
106 void snmp_inc_icmpinparmprobs(void);
107 void snmp_inc_icmpinsrcquenchs(void);
108 void snmp_inc_icmpinredirects(void);
109 void snmp_inc_icmpinechos(void);
110 void snmp_inc_icmpinechoreps(void);
111 void snmp_inc_icmpintimestamps(void);
112 void snmp_inc_icmpintimestampreps(void);
113 void snmp_inc_icmpinaddrmasks(void);
114 void snmp_inc_icmpinaddrmaskreps(void);
115 void snmp_inc_icmpoutmsgs(void);
116 void snmp_inc_icmpouterrors(void);
117 void snmp_inc_icmpoutdestunreachs(void);
118 void snmp_inc_icmpouttimeexcds(void);
119 void snmp_inc_icmpoutparmprobs(void);
120 void snmp_inc_icmpoutsrcquenchs(void);
121 void snmp_inc_icmpoutredirects(void);
122 void snmp_inc_icmpoutechos(void);
123 void snmp_inc_icmpoutechoreps(void);
124 void snmp_inc_icmpouttimestamps(void);
125 void snmp_inc_icmpouttimestampreps(void);
126 void snmp_inc_icmpoutaddrmasks(void);
127 void snmp_inc_icmpoutaddrmaskreps(void);
128
129 /* TCP */
130 void snmp_inc_tcpactiveopens(void);
131 void snmp_inc_tcppassiveopens(void);
132 void snmp_inc_tcpattemptfails(void);
133 void snmp_inc_tcpestabresets(void);
134 void snmp_inc_tcpinsegs(void);
135 void snmp_inc_tcpoutsegs(void);
136 void snmp_inc_tcpretranssegs(void);
137 void snmp_inc_tcpinerrs(void);
138 void snmp_inc_tcpoutrsts(void);
139
140 /* UDP */
141 void snmp_inc_udpindatagrams(void);
142 void snmp_inc_udpnoports(void);
143 void snmp_inc_udpinerrors(void);
144 void snmp_inc_udpoutdatagrams(void);
145 void snmp_insert_udpidx_tree(struct udp_pcb *pcb);
146 void snmp_delete_udpidx_tree(struct udp_pcb *pcb);
147
148 /* SNMP */
149 void snmp_inc_snmpinpkts(void);
150 void snmp_inc_snmpoutpkts(void);
151 void snmp_inc_snmpinbadversions(void);
152 void snmp_inc_snmpinbadcommunitynames(void);
153 void snmp_inc_snmpinbadcommunityuses(void);
154 void snmp_inc_snmpinasnparseerrs(void);
155 void snmp_inc_snmpintoobigs(void);
156 void snmp_inc_snmpinnosuchnames(void);
157 void snmp_inc_snmpinbadvalues(void);
158 void snmp_inc_snmpinreadonlys(void);
159 void snmp_inc_snmpingenerrs(void);
160 void snmp_add_snmpintotalreqvars(u8_t value);
161 void snmp_add_snmpintotalsetvars(u8_t value);
162 void snmp_inc_snmpingetrequests(void);
163 void snmp_inc_snmpingetnexts(void);
164 void snmp_inc_snmpinsetrequests(void);
165 void snmp_inc_snmpingetresponses(void);
166 void snmp_inc_snmpintraps(void);
167 void snmp_inc_snmpouttoobigs(void);
168 void snmp_inc_snmpoutnosuchnames(void);
169 void snmp_inc_snmpoutbadvalues(void);
170 void snmp_inc_snmpoutgenerrs(void);
171 void snmp_inc_snmpoutgetrequests(void);
172 void snmp_inc_snmpoutgetnexts(void);
173 void snmp_inc_snmpoutsetrequests(void);
174 void snmp_inc_snmpoutgetresponses(void);
175 void snmp_inc_snmpouttraps(void);
176 void snmp_get_snmpgrpid_ptr(struct snmp_obj_id **oid);
177 void snmp_set_snmpenableauthentraps(u8_t *value);
178 void snmp_get_snmpenableauthentraps(u8_t *value);
179
180 /* LWIP_SNMP support not available */
181 /* define everything to be empty */
182 #else
183
184 /* system */
185 #define snmp_set_sysdesr(str, strlen)
186 #define snmp_get_sysobjid_ptr(oid)
187 #define snmp_inc_sysuptime()
188 #define snmp_get_sysuptime(value)
189
190 /* network interface */
191 #define snmp_add_ifinoctets(ni,value)
192 #define snmp_inc_ifinucastpkts(ni)
193 #define snmp_inc_ifinnucastpkts(ni)
194 #define snmp_inc_ifindiscards(ni)
195 #define snmp_add_ifoutoctets(ni,value)
196 #define snmp_inc_ifoutucastpkts(ni)
197 #define snmp_inc_ifoutnucastpkts(ni)
198 #define snmp_inc_ifoutdiscards(ni)
199 #define snmp_inc_iflist()
200 #define snmp_dec_iflist()
201
202 /* ARP */
203 #define snmp_insert_arpidx_tree(ni,ip)
204 #define snmp_delete_arpidx_tree(ni,ip)
205
206 /* IP */
207 #define snmp_inc_ipinreceives()
208 #define snmp_inc_ipinhdrerrors()
209 #define snmp_inc_ipinaddrerrors()
210 #define snmp_inc_ipforwdatagrams()
211 #define snmp_inc_ipinunknownprotos()
212 #define snmp_inc_ipindiscards()
213 #define snmp_inc_ipindelivers()
214 #define snmp_inc_ipoutrequests()
215 #define snmp_inc_ipoutdiscards()
216 #define snmp_inc_ipoutnoroutes()
217 #define snmp_inc_ipreasmreqds()
218 #define snmp_inc_ipreasmoks()
219 #define snmp_inc_ipreasmfails()
220 #define snmp_inc_ipfragoks()
221 #define snmp_inc_ipfragfails()
222 #define snmp_inc_ipfragcreates()
223 #define snmp_inc_iproutingdiscards()
224 #define snmp_insert_ipaddridx_tree(ni)
225 #define snmp_delete_ipaddridx_tree(ni)
226 #define snmp_insert_iprteidx_tree(dflt, ni)
227 #define snmp_delete_iprteidx_tree(dflt, ni)
228
229 /* ICMP */
230 #define snmp_inc_icmpinmsgs()
231 #define snmp_inc_icmpinerrors()
232 #define snmp_inc_icmpindestunreachs()
233 #define snmp_inc_icmpintimeexcds()
234 #define snmp_inc_icmpinparmprobs()
235 #define snmp_inc_icmpinsrcquenchs()
236 #define snmp_inc_icmpinredirects()
237 #define snmp_inc_icmpinechos()
238 #define snmp_inc_icmpinechoreps()
239 #define snmp_inc_icmpintimestamps()
240 #define snmp_inc_icmpintimestampreps()
241 #define snmp_inc_icmpinaddrmasks()
242 #define snmp_inc_icmpinaddrmaskreps()
243 #define snmp_inc_icmpoutmsgs()
244 #define snmp_inc_icmpouterrors()
245 #define snmp_inc_icmpoutdestunreachs()
246 #define snmp_inc_icmpouttimeexcds()
247 #define snmp_inc_icmpoutparmprobs()
248 #define snmp_inc_icmpoutsrcquenchs()
249 #define snmp_inc_icmpoutredirects()
250 #define snmp_inc_icmpoutechos()
251 #define snmp_inc_icmpoutechoreps()
252 #define snmp_inc_icmpouttimestamps()
253 #define snmp_inc_icmpouttimestampreps()
254 #define snmp_inc_icmpoutaddrmasks()
255 #define snmp_inc_icmpoutaddrmaskreps()
256 /* TCP */
257 #define snmp_inc_tcpactiveopens()
258 #define snmp_inc_tcppassiveopens()
259 #define snmp_inc_tcpattemptfails()
260 #define snmp_inc_tcpestabresets()
261 #define snmp_inc_tcpinsegs()
262 #define snmp_inc_tcpoutsegs()
263 #define snmp_inc_tcpretranssegs()
264 #define snmp_inc_tcpinerrs()
265 #define snmp_inc_tcpoutrsts()
266
267 /* UDP */
268 #define snmp_inc_udpindatagrams()
269 #define snmp_inc_udpnoports()
270 #define snmp_inc_udpinerrors()
271 #define snmp_inc_udpoutdatagrams()
272 #define snmp_insert_udpidx_tree(pcb)
273 #define snmp_delete_udpidx_tree(pcb)
274
275 /* SNMP */
276 #define snmp_inc_snmpinpkts()
277 #define snmp_inc_snmpoutpkts()
278 #define snmp_inc_snmpinbadversions()
279 #define snmp_inc_snmpinbadcommunitynames()
280 #define snmp_inc_snmpinbadcommunityuses()
281 #define snmp_inc_snmpinasnparseerrs()
282 #define snmp_inc_snmpintoobigs()
283 #define snmp_inc_snmpinnosuchnames()
284 #define snmp_inc_snmpinbadvalues()
285 #define snmp_inc_snmpinreadonlys()
286 #define snmp_inc_snmpingenerrs()
287 #define snmp_add_snmpintotalreqvars(value)
288 #define snmp_add_snmpintotalsetvars(value)
289 #define snmp_inc_snmpingetrequests()
290 #define snmp_inc_snmpingetnexts()
291 #define snmp_inc_snmpinsetrequests()
292 #define snmp_inc_snmpingetresponses()
293 #define snmp_inc_snmpintraps()
294 #define snmp_inc_snmpouttoobigs()
295 #define snmp_inc_snmpoutnosuchnames()
296 #define snmp_inc_snmpoutbadvalues()
297 #define snmp_inc_snmpoutgenerrs()
298 #define snmp_inc_snmpoutgetrequests()
299 #define snmp_inc_snmpoutgetnexts()
300 #define snmp_inc_snmpoutsetrequests()
301 #define snmp_inc_snmpoutgetresponses()
302 #define snmp_inc_snmpouttraps()
303 #define snmp_get_snmpgrpid_ptr(oid)
304 #define snmp_set_snmpenableauthentraps(value)
305 #define snmp_get_snmpenableauthentraps(value)
306
307 #endif
308
309 #endif /* __LWIP_SNMP_H__ */
Note: See TracBrowser for help on using the browser.