2 * Copyright (c) 2001, 2002 Leon Woestenberg <leon.woestenberg@axon.tv>
3 * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands.
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
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.
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
28 * This file is part of the lwIP TCP/IP stack.
30 * Author: Leon Woestenberg <leon.woestenberg@axon.tv>
33 #ifndef LWIP_HDR_SNMP_H
34 #define LWIP_HDR_SNMP_H
37 #include "lwip/snmp_mib2.h"
43 #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
45 /** fixed maximum length for object identifier type */
46 #define LWIP_SNMP_OBJ_ID_LEN 32
48 /** internal object identifier representation */
52 s32_t id[LWIP_SNMP_OBJ_ID_LEN];
55 /** Agent setup, start listening to port 161. */
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);
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 */
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);
78 /* LWIP_SNMP support not available */
79 /* define everything to be empty */
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 */
95 #endif /* LWIP_HDR_SNMP_H */