STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
snmp.h
Go to the documentation of this file.
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  * Martin Hentschel <info@cl-soft.de>
32  *
33  */
34 #ifndef LWIP_HDR_APPS_SNMP_H
35 #define LWIP_HDR_APPS_SNMP_H
36 
37 #include "lwip/apps/snmp_opts.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 #include "lwip/err.h"
46 #include "lwip/apps/snmp_core.h"
47 
49 void snmp_init(void);
50 void snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs);
51 
65 void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_oid);
66 const struct snmp_obj_id* snmp_get_device_enterprise_oid(void);
67 
68 void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable);
69 void snmp_trap_dst_ip_set(u8_t dst_idx, const ip_addr_t *dst);
70 
71 #define SNMP_GENTRAP_COLDSTART 0
72 #define SNMP_GENTRAP_WARMSTART 1
73 #define SNMP_GENTRAP_LINKDOWN 2
74 #define SNMP_GENTRAP_LINKUP 3
75 #define SNMP_GENTRAP_AUTH_FAILURE 4
76 #define SNMP_GENTRAP_EGP_NEIGHBOR_LOSS 5
77 #define SNMP_GENTRAP_ENTERPRISE_SPECIFIC 6
78 err_t snmp_send_trap_generic(s32_t generic_trap);
79 err_t snmp_send_trap_specific(s32_t specific_trap);
80 
81 #define SNMP_AUTH_TRAPS_DISABLED 0
82 #define SNMP_AUTH_TRAPS_ENABLED 1
83 void snmp_set_auth_traps_enabled(u8_t enable);
84 u8_t snmp_get_auth_traps_enabled(void);
85 
86 const char * snmp_get_community(void);
87 const char * snmp_get_community_write(void);
88 const char * snmp_get_community_trap(void);
89 void snmp_set_community(const char * const community);
90 void snmp_set_community_write(const char * const community);
91 void snmp_set_community_trap(const char * const community);
92 
93 void snmp_coldstart_trap(void);
94 void snmp_authfail_trap(void);
95 
96 typedef void (*snmp_write_callback_fct)(const u32_t* oid, u8_t oid_len, void* callback_arg);
97 void snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg);
98 
99 #endif /* LWIP_SNMP */
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* LWIP_HDR_APPS_SNMP_H */
unsigned long u32_t
Definition: cc.h:42
s8_t err_t
Definition: err.h:47
unsigned char u8_t
Definition: cc.h:38
ip6_addr_t ip_addr_t
Definition: ip_addr.h:194
signed long s32_t
Definition: cc.h:43