]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/lwip/lib/contrib/src/include/lwip/snmp.h
Update
[l4.git] / l4 / pkg / lwip / lib / contrib / src / include / lwip / snmp.h
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_HDR_SNMP_H
34 #define LWIP_HDR_SNMP_H
35
36 #include "lwip/opt.h"
37 #include "lwip/snmp_mib2.h"
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
44
45 /** fixed maximum length for object identifier type */
46 #define LWIP_SNMP_OBJ_ID_LEN 32
47
48 /** internal object identifier representation */
49 struct snmp_obj_id
50 {
51   u8_t len;
52   s32_t id[LWIP_SNMP_OBJ_ID_LEN];
53 };
54
55 /** Agent setup, start listening to port 161. */
56 void snmp_init(void);
57 void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable);
58 void snmp_trap_dst_ip_set(u8_t dst_idx, const ip_addr_t *dst);
59
60 const char * snmp_get_community(void);
61 void snmp_set_community(const char * const community);
62 #if SNMP_COMMUNITY_EXT
63 const char * snmp_get_community_write(void);
64 const char * snmp_get_community_trap(void);
65 void snmp_set_community_write(const char * const community);
66 void snmp_set_community_trap(const char * const community);
67 #endif /* SNMP_COMMUNITY_EXT */
68
69 /* system */
70 void snmp_set_sysdescr(const u8_t* str, const u8_t* len);
71 void snmp_set_sysobjid(const struct snmp_obj_id *oid);
72 void snmp_get_sysobjid_ptr(const struct snmp_obj_id **oid);
73 void snmp_set_syscontact(u8_t *ocstr, u8_t *ocstrlen, u8_t bufsize);
74 void snmp_set_sysname(u8_t *ocstr, u8_t *ocstrlen, u8_t bufsize);
75 void snmp_set_syslocation(u8_t *ocstr, u8_t *ocstrlen, u8_t bufsize);
76 void snmp_set_snmpenableauthentraps(u8_t *value);
77 #else
78 /* LWIP_SNMP support not available */
79 /* define everything to be empty */
80
81 /* system */
82 #define snmp_set_sysdescr(str, len)
83 #define snmp_set_sysobjid(oid)
84 #define snmp_get_sysobjid_ptr(oid)
85 #define snmp_set_syscontact(ocstr, ocstrlen, bufsize)
86 #define snmp_set_sysname(ocstr, ocstrlen, bufsize)
87 #define snmp_set_syslocation(ocstr, ocstrlen, bufsize)
88 #define snmp_set_snmpenableauthentraps(value)
89 #endif /* LWIP_SNMP */
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif /* LWIP_HDR_SNMP_H */