]> Joshua Wise's Git repositories - netwatch.git/blame - lwip/src/include/lwip/snmp.h
even more dumb outputfs
[netwatch.git] / lwip / src / include / lwip / snmp.h
CommitLineData
6e6d4a8b
JP
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#ifdef __cplusplus
41extern "C" {
42#endif
43
44/**
45 * @see RFC1213, "MIB-II, 6. Definitions"
46 */
47enum snmp_ifType {
48 snmp_ifType_other=1, /* none of the following */
49 snmp_ifType_regular1822,
50 snmp_ifType_hdh1822,
51 snmp_ifType_ddn_x25,
52 snmp_ifType_rfc877_x25,
53 snmp_ifType_ethernet_csmacd,
54 snmp_ifType_iso88023_csmacd,
55 snmp_ifType_iso88024_tokenBus,
56 snmp_ifType_iso88025_tokenRing,
57 snmp_ifType_iso88026_man,
58 snmp_ifType_starLan,
59 snmp_ifType_proteon_10Mbit,
60 snmp_ifType_proteon_80Mbit,
61 snmp_ifType_hyperchannel,
62 snmp_ifType_fddi,
63 snmp_ifType_lapb,
64 snmp_ifType_sdlc,
65 snmp_ifType_ds1, /* T-1 */
66 snmp_ifType_e1, /* european equiv. of T-1 */
67 snmp_ifType_basicISDN,
68 snmp_ifType_primaryISDN, /* proprietary serial */
69 snmp_ifType_propPointToPointSerial,
70 snmp_ifType_ppp,
71 snmp_ifType_softwareLoopback,
72 snmp_ifType_eon, /* CLNP over IP [11] */
73 snmp_ifType_ethernet_3Mbit,
74 snmp_ifType_nsip, /* XNS over IP */
75 snmp_ifType_slip, /* generic SLIP */
76 snmp_ifType_ultra, /* ULTRA technologies */
77 snmp_ifType_ds3, /* T-3 */
78 snmp_ifType_sip, /* SMDS */
79 snmp_ifType_frame_relay
80};
81
82#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
83
84/** SNMP "sysuptime" Interval */
85#define SNMP_SYSUPTIME_INTERVAL 10
86
87/** fixed maximum length for object identifier type */
88#define LWIP_SNMP_OBJ_ID_LEN 32
89
90/** internal object identifier representation */
91struct snmp_obj_id
92{
93 u8_t len;
94 s32_t id[LWIP_SNMP_OBJ_ID_LEN];
95};
96
97/* system */
98void snmp_set_sysdesr(u8_t* str, u8_t* len);
99void snmp_set_sysobjid(struct snmp_obj_id *oid);
100void snmp_get_sysobjid_ptr(struct snmp_obj_id **oid);
101void snmp_inc_sysuptime(void);
102void snmp_add_sysuptime(u32_t value);
103void snmp_get_sysuptime(u32_t *value);
104void snmp_set_syscontact(u8_t *ocstr, u8_t *ocstrlen);
105void snmp_set_sysname(u8_t *ocstr, u8_t *ocstrlen);
106void snmp_set_syslocation(u8_t *ocstr, u8_t *ocstrlen);
107
108/* network interface */
109void snmp_add_ifinoctets(struct netif *ni, u32_t value);
110void snmp_inc_ifinucastpkts(struct netif *ni);
111void snmp_inc_ifinnucastpkts(struct netif *ni);
112void snmp_inc_ifindiscards(struct netif *ni);
113void snmp_add_ifoutoctets(struct netif *ni, u32_t value);
114void snmp_inc_ifoutucastpkts(struct netif *ni);
115void snmp_inc_ifoutnucastpkts(struct netif *ni);
116void snmp_inc_ifoutdiscards(struct netif *ni);
117void snmp_inc_iflist(void);
118void snmp_dec_iflist(void);
119
120/* ARP (for atTable and ipNetToMediaTable) */
121void snmp_insert_arpidx_tree(struct netif *ni, struct ip_addr *ip);
122void snmp_delete_arpidx_tree(struct netif *ni, struct ip_addr *ip);
123
124/* IP */
125void snmp_inc_ipinreceives(void);
126void snmp_inc_ipinhdrerrors(void);
127void snmp_inc_ipinaddrerrors(void);
128void snmp_inc_ipforwdatagrams(void);
129void snmp_inc_ipinunknownprotos(void);
130void snmp_inc_ipindiscards(void);
131void snmp_inc_ipindelivers(void);
132void snmp_inc_ipoutrequests(void);
133void snmp_inc_ipoutdiscards(void);
134void snmp_inc_ipoutnoroutes(void);
135void snmp_inc_ipreasmreqds(void);
136void snmp_inc_ipreasmoks(void);
137void snmp_inc_ipreasmfails(void);
138void snmp_inc_ipfragoks(void);
139void snmp_inc_ipfragfails(void);
140void snmp_inc_ipfragcreates(void);
141void snmp_inc_iproutingdiscards(void);
142void snmp_insert_ipaddridx_tree(struct netif *ni);
143void snmp_delete_ipaddridx_tree(struct netif *ni);
144void snmp_insert_iprteidx_tree(u8_t dflt, struct netif *ni);
145void snmp_delete_iprteidx_tree(u8_t dflt, struct netif *ni);
146
147/* ICMP */
148void snmp_inc_icmpinmsgs(void);
149void snmp_inc_icmpinerrors(void);
150void snmp_inc_icmpindestunreachs(void);
151void snmp_inc_icmpintimeexcds(void);
152void snmp_inc_icmpinparmprobs(void);
153void snmp_inc_icmpinsrcquenchs(void);
154void snmp_inc_icmpinredirects(void);
155void snmp_inc_icmpinechos(void);
156void snmp_inc_icmpinechoreps(void);
157void snmp_inc_icmpintimestamps(void);
158void snmp_inc_icmpintimestampreps(void);
159void snmp_inc_icmpinaddrmasks(void);
160void snmp_inc_icmpinaddrmaskreps(void);
161void snmp_inc_icmpoutmsgs(void);
162void snmp_inc_icmpouterrors(void);
163void snmp_inc_icmpoutdestunreachs(void);
164void snmp_inc_icmpouttimeexcds(void);
165void snmp_inc_icmpoutparmprobs(void);
166void snmp_inc_icmpoutsrcquenchs(void);
167void snmp_inc_icmpoutredirects(void);
168void snmp_inc_icmpoutechos(void);
169void snmp_inc_icmpoutechoreps(void);
170void snmp_inc_icmpouttimestamps(void);
171void snmp_inc_icmpouttimestampreps(void);
172void snmp_inc_icmpoutaddrmasks(void);
173void snmp_inc_icmpoutaddrmaskreps(void);
174
175/* TCP */
176void snmp_inc_tcpactiveopens(void);
177void snmp_inc_tcppassiveopens(void);
178void snmp_inc_tcpattemptfails(void);
179void snmp_inc_tcpestabresets(void);
180void snmp_inc_tcpinsegs(void);
181void snmp_inc_tcpoutsegs(void);
182void snmp_inc_tcpretranssegs(void);
183void snmp_inc_tcpinerrs(void);
184void snmp_inc_tcpoutrsts(void);
185
186/* UDP */
187void snmp_inc_udpindatagrams(void);
188void snmp_inc_udpnoports(void);
189void snmp_inc_udpinerrors(void);
190void snmp_inc_udpoutdatagrams(void);
191void snmp_insert_udpidx_tree(struct udp_pcb *pcb);
192void snmp_delete_udpidx_tree(struct udp_pcb *pcb);
193
194/* SNMP */
195void snmp_inc_snmpinpkts(void);
196void snmp_inc_snmpoutpkts(void);
197void snmp_inc_snmpinbadversions(void);
198void snmp_inc_snmpinbadcommunitynames(void);
199void snmp_inc_snmpinbadcommunityuses(void);
200void snmp_inc_snmpinasnparseerrs(void);
201void snmp_inc_snmpintoobigs(void);
202void snmp_inc_snmpinnosuchnames(void);
203void snmp_inc_snmpinbadvalues(void);
204void snmp_inc_snmpinreadonlys(void);
205void snmp_inc_snmpingenerrs(void);
206void snmp_add_snmpintotalreqvars(u8_t value);
207void snmp_add_snmpintotalsetvars(u8_t value);
208void snmp_inc_snmpingetrequests(void);
209void snmp_inc_snmpingetnexts(void);
210void snmp_inc_snmpinsetrequests(void);
211void snmp_inc_snmpingetresponses(void);
212void snmp_inc_snmpintraps(void);
213void snmp_inc_snmpouttoobigs(void);
214void snmp_inc_snmpoutnosuchnames(void);
215void snmp_inc_snmpoutbadvalues(void);
216void snmp_inc_snmpoutgenerrs(void);
217void snmp_inc_snmpoutgetrequests(void);
218void snmp_inc_snmpoutgetnexts(void);
219void snmp_inc_snmpoutsetrequests(void);
220void snmp_inc_snmpoutgetresponses(void);
221void snmp_inc_snmpouttraps(void);
222void snmp_get_snmpgrpid_ptr(struct snmp_obj_id **oid);
223void snmp_set_snmpenableauthentraps(u8_t *value);
224void snmp_get_snmpenableauthentraps(u8_t *value);
225
226/* LWIP_SNMP support not available */
227/* define everything to be empty */
228#else
229
230/* system */
231#define snmp_set_sysdesr(str, len)
232#define snmp_set_sysobjid(oid);
233#define snmp_get_sysobjid_ptr(oid)
234#define snmp_inc_sysuptime()
235#define snmp_add_sysuptime(value)
236#define snmp_get_sysuptime(value)
237#define snmp_set_syscontact(ocstr, ocstrlen);
238#define snmp_set_sysname(ocstr, ocstrlen);
239#define snmp_set_syslocation(ocstr, ocstrlen);
240
241/* network interface */
242#define snmp_add_ifinoctets(ni,value)
243#define snmp_inc_ifinucastpkts(ni)
244#define snmp_inc_ifinnucastpkts(ni)
245#define snmp_inc_ifindiscards(ni)
246#define snmp_add_ifoutoctets(ni,value)
247#define snmp_inc_ifoutucastpkts(ni)
248#define snmp_inc_ifoutnucastpkts(ni)
249#define snmp_inc_ifoutdiscards(ni)
250#define snmp_inc_iflist()
251#define snmp_dec_iflist()
252
253/* ARP */
254#define snmp_insert_arpidx_tree(ni,ip)
255#define snmp_delete_arpidx_tree(ni,ip)
256
257/* IP */
258#define snmp_inc_ipinreceives()
259#define snmp_inc_ipinhdrerrors()
260#define snmp_inc_ipinaddrerrors()
261#define snmp_inc_ipforwdatagrams()
262#define snmp_inc_ipinunknownprotos()
263#define snmp_inc_ipindiscards()
264#define snmp_inc_ipindelivers()
265#define snmp_inc_ipoutrequests()
266#define snmp_inc_ipoutdiscards()
267#define snmp_inc_ipoutnoroutes()
268#define snmp_inc_ipreasmreqds()
269#define snmp_inc_ipreasmoks()
270#define snmp_inc_ipreasmfails()
271#define snmp_inc_ipfragoks()
272#define snmp_inc_ipfragfails()
273#define snmp_inc_ipfragcreates()
274#define snmp_inc_iproutingdiscards()
275#define snmp_insert_ipaddridx_tree(ni)
276#define snmp_delete_ipaddridx_tree(ni)
277#define snmp_insert_iprteidx_tree(dflt, ni)
278#define snmp_delete_iprteidx_tree(dflt, ni)
279
280/* ICMP */
281#define snmp_inc_icmpinmsgs()
282#define snmp_inc_icmpinerrors()
283#define snmp_inc_icmpindestunreachs()
284#define snmp_inc_icmpintimeexcds()
285#define snmp_inc_icmpinparmprobs()
286#define snmp_inc_icmpinsrcquenchs()
287#define snmp_inc_icmpinredirects()
288#define snmp_inc_icmpinechos()
289#define snmp_inc_icmpinechoreps()
290#define snmp_inc_icmpintimestamps()
291#define snmp_inc_icmpintimestampreps()
292#define snmp_inc_icmpinaddrmasks()
293#define snmp_inc_icmpinaddrmaskreps()
294#define snmp_inc_icmpoutmsgs()
295#define snmp_inc_icmpouterrors()
296#define snmp_inc_icmpoutdestunreachs()
297#define snmp_inc_icmpouttimeexcds()
298#define snmp_inc_icmpoutparmprobs()
299#define snmp_inc_icmpoutsrcquenchs()
300#define snmp_inc_icmpoutredirects()
301#define snmp_inc_icmpoutechos()
302#define snmp_inc_icmpoutechoreps()
303#define snmp_inc_icmpouttimestamps()
304#define snmp_inc_icmpouttimestampreps()
305#define snmp_inc_icmpoutaddrmasks()
306#define snmp_inc_icmpoutaddrmaskreps()
307/* TCP */
308#define snmp_inc_tcpactiveopens()
309#define snmp_inc_tcppassiveopens()
310#define snmp_inc_tcpattemptfails()
311#define snmp_inc_tcpestabresets()
312#define snmp_inc_tcpinsegs()
313#define snmp_inc_tcpoutsegs()
314#define snmp_inc_tcpretranssegs()
315#define snmp_inc_tcpinerrs()
316#define snmp_inc_tcpoutrsts()
317
318/* UDP */
319#define snmp_inc_udpindatagrams()
320#define snmp_inc_udpnoports()
321#define snmp_inc_udpinerrors()
322#define snmp_inc_udpoutdatagrams()
323#define snmp_insert_udpidx_tree(pcb)
324#define snmp_delete_udpidx_tree(pcb)
325
326/* SNMP */
327#define snmp_inc_snmpinpkts()
328#define snmp_inc_snmpoutpkts()
329#define snmp_inc_snmpinbadversions()
330#define snmp_inc_snmpinbadcommunitynames()
331#define snmp_inc_snmpinbadcommunityuses()
332#define snmp_inc_snmpinasnparseerrs()
333#define snmp_inc_snmpintoobigs()
334#define snmp_inc_snmpinnosuchnames()
335#define snmp_inc_snmpinbadvalues()
336#define snmp_inc_snmpinreadonlys()
337#define snmp_inc_snmpingenerrs()
338#define snmp_add_snmpintotalreqvars(value)
339#define snmp_add_snmpintotalsetvars(value)
340#define snmp_inc_snmpingetrequests()
341#define snmp_inc_snmpingetnexts()
342#define snmp_inc_snmpinsetrequests()
343#define snmp_inc_snmpingetresponses()
344#define snmp_inc_snmpintraps()
345#define snmp_inc_snmpouttoobigs()
346#define snmp_inc_snmpoutnosuchnames()
347#define snmp_inc_snmpoutbadvalues()
348#define snmp_inc_snmpoutgenerrs()
349#define snmp_inc_snmpoutgetrequests()
350#define snmp_inc_snmpoutgetnexts()
351#define snmp_inc_snmpoutsetrequests()
352#define snmp_inc_snmpoutgetresponses()
353#define snmp_inc_snmpouttraps()
354#define snmp_get_snmpgrpid_ptr(oid)
355#define snmp_set_snmpenableauthentraps(value)
356#define snmp_get_snmpenableauthentraps(value)
357
358#endif /* LWIP_SNMP */
359
360#ifdef __cplusplus
361}
362#endif
363
364#endif /* __LWIP_SNMP_H__ */
This page took 0.053934 seconds and 4 git commands to generate.