ReactOS 0.4.16-dev-297-gc569aee
snmp.h
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 2001, 2002 Leon Woestenberg <leon.woestenberg@axon.tv>
8 * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright notice,
17 * this list of conditions and the following disclaimer in the documentation
18 * and/or other materials provided with the distribution.
19 * 3. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
31 * OF SUCH DAMAGE.
32 *
33 * This file is part of the lwIP TCP/IP stack.
34 *
35 * Author: Leon Woestenberg <leon.woestenberg@axon.tv>
36 * Martin Hentschel <info@cl-soft.de>
37 *
38 */
39#ifndef LWIP_HDR_APPS_SNMP_H
40#define LWIP_HDR_APPS_SNMP_H
41
42#include "lwip/apps/snmp_opts.h"
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
49
50#include "lwip/err.h"
51#include "lwip/apps/snmp_core.h"
52
54struct snmp_varbind
55{
57 struct snmp_varbind *next;
59 struct snmp_varbind *prev;
60
62 struct snmp_obj_id oid;
63
65 u8_t type;
67 u16_t value_len;
69 void *value;
70};
71
76void snmp_init(void);
77void snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs);
78
79void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_oid);
80const struct snmp_obj_id* snmp_get_device_enterprise_oid(void);
81
82void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable);
83void snmp_trap_dst_ip_set(u8_t dst_idx, const ip_addr_t *dst);
84
86#define SNMP_GENTRAP_COLDSTART 0
88#define SNMP_GENTRAP_WARMSTART 1
90#define SNMP_GENTRAP_LINKDOWN 2
92#define SNMP_GENTRAP_LINKUP 3
94#define SNMP_GENTRAP_AUTH_FAILURE 4
96#define SNMP_GENTRAP_EGP_NEIGHBOR_LOSS 5
98#define SNMP_GENTRAP_ENTERPRISE_SPECIFIC 6
99
100err_t snmp_send_trap_generic(s32_t generic_trap);
101err_t snmp_send_trap_specific(s32_t specific_trap, struct snmp_varbind *varbinds);
102err_t snmp_send_trap(const struct snmp_obj_id* oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds);
103
104err_t snmp_send_inform_generic(s32_t generic_trap, struct snmp_varbind *varbinds, s32_t *ptr_request_id);
105err_t snmp_send_inform_specific(s32_t specific_trap, struct snmp_varbind *varbinds, s32_t *ptr_request_id);
106err_t snmp_send_inform(const struct snmp_obj_id* oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds, s32_t *ptr_request_id);
107struct snmp_request;
108typedef void (*snmp_inform_callback_fct)(struct snmp_request *request, void* callback_arg);
109void snmp_set_inform_callback(snmp_inform_callback_fct inform_callback, void* callback_arg);
110
111void snmp_set_default_trap_version(u8_t snmp_version);
112u8_t snmp_get_default_trap_version(void);
113
114#define SNMP_AUTH_TRAPS_DISABLED 0
115#define SNMP_AUTH_TRAPS_ENABLED 1
116void snmp_set_auth_traps_enabled(u8_t enable);
117u8_t snmp_get_auth_traps_enabled(void);
118
119u8_t snmp_v1_enabled(void);
120u8_t snmp_v2c_enabled(void);
121u8_t snmp_v3_enabled(void);
122void snmp_v1_enable(u8_t enable);
123void snmp_v2c_enable(u8_t enable);
124void snmp_v3_enable(u8_t enable);
125
126const char * snmp_get_community(void);
127const char * snmp_get_community_write(void);
128const char * snmp_get_community_trap(void);
129void snmp_set_community(const char * const community);
130void snmp_set_community_write(const char * const community);
131void snmp_set_community_trap(const char * const community);
132
133void snmp_coldstart_trap(void);
134void snmp_authfail_trap(void);
135
136typedef void (*snmp_write_callback_fct)(const u32_t* oid, u8_t oid_len, void* callback_arg);
137void snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg);
138
139#endif /* LWIP_SNMP */
140
141#ifdef __cplusplus
142}
143#endif
144
145#endif /* LWIP_HDR_APPS_SNMP_H */
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLenum dst
Definition: glext.h:6340
GLboolean enable
Definition: glext.h:11120
int32_t s32_t
Definition: arch.h:130
uint32_t u32_t
Definition: arch.h:129
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
s8_t err_t
Definition: err.h:96
ip6_addr_t ip_addr_t
Definition: ip_addr.h:344
static unsigned __int64 next
Definition: rand_nt.c:6
Definition: tftpd.h:86
Definition: pdh_main.c:94