source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/arduino/avr/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/lwip/snmp.h @ 4837

Last change on this file since 4837 was 4837, checked in by daduve, 2 years ago

Adding new version

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