Sam Walsh / F7_Ethernet

Dependents:   Nucleo_F746ZG_Ethernet_MQTT_Ultrasound

Fork of F7_Ethernet by Dieter Graef

Committer:
DieterGraef
Date:
Sun Jun 19 16:23:40 2016 +0000
Revision:
0:d26c1b55cfca
Ethernet Library for Nucleo stm32f746ZG and Disco stm32f746NG  works under arm and gcc environment

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:d26c1b55cfca 1 /**
DieterGraef 0:d26c1b55cfca 2 * @file
DieterGraef 0:d26c1b55cfca 3 * SNMP Agent message handling structures.
DieterGraef 0:d26c1b55cfca 4 */
DieterGraef 0:d26c1b55cfca 5
DieterGraef 0:d26c1b55cfca 6 /*
DieterGraef 0:d26c1b55cfca 7 * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands.
DieterGraef 0:d26c1b55cfca 8 * All rights reserved.
DieterGraef 0:d26c1b55cfca 9 *
DieterGraef 0:d26c1b55cfca 10 * Redistribution and use in source and binary forms, with or without modification,
DieterGraef 0:d26c1b55cfca 11 * are permitted provided that the following conditions are met:
DieterGraef 0:d26c1b55cfca 12 *
DieterGraef 0:d26c1b55cfca 13 * 1. Redistributions of source code must retain the above copyright notice,
DieterGraef 0:d26c1b55cfca 14 * this list of conditions and the following disclaimer.
DieterGraef 0:d26c1b55cfca 15 * 2. Redistributions in binary form must reproduce the above copyright notice,
DieterGraef 0:d26c1b55cfca 16 * this list of conditions and the following disclaimer in the documentation
DieterGraef 0:d26c1b55cfca 17 * and/or other materials provided with the distribution.
DieterGraef 0:d26c1b55cfca 18 * 3. The name of the author may not be used to endorse or promote products
DieterGraef 0:d26c1b55cfca 19 * derived from this software without specific prior written permission.
DieterGraef 0:d26c1b55cfca 20 *
DieterGraef 0:d26c1b55cfca 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
DieterGraef 0:d26c1b55cfca 22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
DieterGraef 0:d26c1b55cfca 23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
DieterGraef 0:d26c1b55cfca 24 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
DieterGraef 0:d26c1b55cfca 25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
DieterGraef 0:d26c1b55cfca 26 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
DieterGraef 0:d26c1b55cfca 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
DieterGraef 0:d26c1b55cfca 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
DieterGraef 0:d26c1b55cfca 29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
DieterGraef 0:d26c1b55cfca 30 * OF SUCH DAMAGE.
DieterGraef 0:d26c1b55cfca 31 *
DieterGraef 0:d26c1b55cfca 32 * Author: Christiaan Simons <christiaan.simons@axon.tv>
DieterGraef 0:d26c1b55cfca 33 */
DieterGraef 0:d26c1b55cfca 34
DieterGraef 0:d26c1b55cfca 35 #ifndef __LWIP_SNMP_MSG_H__
DieterGraef 0:d26c1b55cfca 36 #define __LWIP_SNMP_MSG_H__
DieterGraef 0:d26c1b55cfca 37
DieterGraef 0:d26c1b55cfca 38 #include "lwip/opt.h"
DieterGraef 0:d26c1b55cfca 39 #include "lwip/snmp.h"
DieterGraef 0:d26c1b55cfca 40 #include "lwip/snmp_structs.h"
DieterGraef 0:d26c1b55cfca 41 #include "lwip/ip_addr.h"
DieterGraef 0:d26c1b55cfca 42 #include "lwip/err.h"
DieterGraef 0:d26c1b55cfca 43
DieterGraef 0:d26c1b55cfca 44 #if LWIP_SNMP
DieterGraef 0:d26c1b55cfca 45
DieterGraef 0:d26c1b55cfca 46 #if SNMP_PRIVATE_MIB
DieterGraef 0:d26c1b55cfca 47 /* When using a private MIB, you have to create a file 'private_mib.h' that contains
DieterGraef 0:d26c1b55cfca 48 * a 'struct mib_array_node mib_private' which contains your MIB. */
DieterGraef 0:d26c1b55cfca 49 #include "private_mib.h"
DieterGraef 0:d26c1b55cfca 50 #endif
DieterGraef 0:d26c1b55cfca 51
DieterGraef 0:d26c1b55cfca 52 #ifdef __cplusplus
DieterGraef 0:d26c1b55cfca 53 extern "C" {
DieterGraef 0:d26c1b55cfca 54 #endif
DieterGraef 0:d26c1b55cfca 55
DieterGraef 0:d26c1b55cfca 56 /* The listen port of the SNMP agent. Clients have to make their requests to
DieterGraef 0:d26c1b55cfca 57 this port. Most standard clients won't work if you change this! */
DieterGraef 0:d26c1b55cfca 58 #ifndef SNMP_IN_PORT
DieterGraef 0:d26c1b55cfca 59 #define SNMP_IN_PORT 161
DieterGraef 0:d26c1b55cfca 60 #endif
DieterGraef 0:d26c1b55cfca 61 /* The remote port the SNMP agent sends traps to. Most standard trap sinks won't
DieterGraef 0:d26c1b55cfca 62 work if you change this! */
DieterGraef 0:d26c1b55cfca 63 #ifndef SNMP_TRAP_PORT
DieterGraef 0:d26c1b55cfca 64 #define SNMP_TRAP_PORT 162
DieterGraef 0:d26c1b55cfca 65 #endif
DieterGraef 0:d26c1b55cfca 66
DieterGraef 0:d26c1b55cfca 67 #define SNMP_ES_NOERROR 0
DieterGraef 0:d26c1b55cfca 68 #define SNMP_ES_TOOBIG 1
DieterGraef 0:d26c1b55cfca 69 #define SNMP_ES_NOSUCHNAME 2
DieterGraef 0:d26c1b55cfca 70 #define SNMP_ES_BADVALUE 3
DieterGraef 0:d26c1b55cfca 71 #define SNMP_ES_READONLY 4
DieterGraef 0:d26c1b55cfca 72 #define SNMP_ES_GENERROR 5
DieterGraef 0:d26c1b55cfca 73
DieterGraef 0:d26c1b55cfca 74 #define SNMP_GENTRAP_COLDSTART 0
DieterGraef 0:d26c1b55cfca 75 #define SNMP_GENTRAP_WARMSTART 1
DieterGraef 0:d26c1b55cfca 76 #define SNMP_GENTRAP_AUTHFAIL 4
DieterGraef 0:d26c1b55cfca 77 #define SNMP_GENTRAP_ENTERPRISESPC 6
DieterGraef 0:d26c1b55cfca 78
DieterGraef 0:d26c1b55cfca 79 struct snmp_varbind
DieterGraef 0:d26c1b55cfca 80 {
DieterGraef 0:d26c1b55cfca 81 /* next pointer, NULL for last in list */
DieterGraef 0:d26c1b55cfca 82 struct snmp_varbind *next;
DieterGraef 0:d26c1b55cfca 83 /* previous pointer, NULL for first in list */
DieterGraef 0:d26c1b55cfca 84 struct snmp_varbind *prev;
DieterGraef 0:d26c1b55cfca 85
DieterGraef 0:d26c1b55cfca 86 /* object identifier length (in s32_t) */
DieterGraef 0:d26c1b55cfca 87 u8_t ident_len;
DieterGraef 0:d26c1b55cfca 88 /* object identifier array */
DieterGraef 0:d26c1b55cfca 89 s32_t *ident;
DieterGraef 0:d26c1b55cfca 90
DieterGraef 0:d26c1b55cfca 91 /* object value ASN1 type */
DieterGraef 0:d26c1b55cfca 92 u8_t value_type;
DieterGraef 0:d26c1b55cfca 93 /* object value length (in u8_t) */
DieterGraef 0:d26c1b55cfca 94 u8_t value_len;
DieterGraef 0:d26c1b55cfca 95 /* object value */
DieterGraef 0:d26c1b55cfca 96 void *value;
DieterGraef 0:d26c1b55cfca 97
DieterGraef 0:d26c1b55cfca 98 /* encoding varbind seq length length */
DieterGraef 0:d26c1b55cfca 99 u8_t seqlenlen;
DieterGraef 0:d26c1b55cfca 100 /* encoding object identifier length length */
DieterGraef 0:d26c1b55cfca 101 u8_t olenlen;
DieterGraef 0:d26c1b55cfca 102 /* encoding object value length length */
DieterGraef 0:d26c1b55cfca 103 u8_t vlenlen;
DieterGraef 0:d26c1b55cfca 104 /* encoding varbind seq length */
DieterGraef 0:d26c1b55cfca 105 u16_t seqlen;
DieterGraef 0:d26c1b55cfca 106 /* encoding object identifier length */
DieterGraef 0:d26c1b55cfca 107 u16_t olen;
DieterGraef 0:d26c1b55cfca 108 /* encoding object value length */
DieterGraef 0:d26c1b55cfca 109 u16_t vlen;
DieterGraef 0:d26c1b55cfca 110 };
DieterGraef 0:d26c1b55cfca 111
DieterGraef 0:d26c1b55cfca 112 struct snmp_varbind_root
DieterGraef 0:d26c1b55cfca 113 {
DieterGraef 0:d26c1b55cfca 114 struct snmp_varbind *head;
DieterGraef 0:d26c1b55cfca 115 struct snmp_varbind *tail;
DieterGraef 0:d26c1b55cfca 116 /* number of variable bindings in list */
DieterGraef 0:d26c1b55cfca 117 u8_t count;
DieterGraef 0:d26c1b55cfca 118 /* encoding varbind-list seq length length */
DieterGraef 0:d26c1b55cfca 119 u8_t seqlenlen;
DieterGraef 0:d26c1b55cfca 120 /* encoding varbind-list seq length */
DieterGraef 0:d26c1b55cfca 121 u16_t seqlen;
DieterGraef 0:d26c1b55cfca 122 };
DieterGraef 0:d26c1b55cfca 123
DieterGraef 0:d26c1b55cfca 124 /** output response message header length fields */
DieterGraef 0:d26c1b55cfca 125 struct snmp_resp_header_lengths
DieterGraef 0:d26c1b55cfca 126 {
DieterGraef 0:d26c1b55cfca 127 /* encoding error-index length length */
DieterGraef 0:d26c1b55cfca 128 u8_t erridxlenlen;
DieterGraef 0:d26c1b55cfca 129 /* encoding error-status length length */
DieterGraef 0:d26c1b55cfca 130 u8_t errstatlenlen;
DieterGraef 0:d26c1b55cfca 131 /* encoding request id length length */
DieterGraef 0:d26c1b55cfca 132 u8_t ridlenlen;
DieterGraef 0:d26c1b55cfca 133 /* encoding pdu length length */
DieterGraef 0:d26c1b55cfca 134 u8_t pdulenlen;
DieterGraef 0:d26c1b55cfca 135 /* encoding community length length */
DieterGraef 0:d26c1b55cfca 136 u8_t comlenlen;
DieterGraef 0:d26c1b55cfca 137 /* encoding version length length */
DieterGraef 0:d26c1b55cfca 138 u8_t verlenlen;
DieterGraef 0:d26c1b55cfca 139 /* encoding sequence length length */
DieterGraef 0:d26c1b55cfca 140 u8_t seqlenlen;
DieterGraef 0:d26c1b55cfca 141
DieterGraef 0:d26c1b55cfca 142 /* encoding error-index length */
DieterGraef 0:d26c1b55cfca 143 u16_t erridxlen;
DieterGraef 0:d26c1b55cfca 144 /* encoding error-status length */
DieterGraef 0:d26c1b55cfca 145 u16_t errstatlen;
DieterGraef 0:d26c1b55cfca 146 /* encoding request id length */
DieterGraef 0:d26c1b55cfca 147 u16_t ridlen;
DieterGraef 0:d26c1b55cfca 148 /* encoding pdu length */
DieterGraef 0:d26c1b55cfca 149 u16_t pdulen;
DieterGraef 0:d26c1b55cfca 150 /* encoding community length */
DieterGraef 0:d26c1b55cfca 151 u16_t comlen;
DieterGraef 0:d26c1b55cfca 152 /* encoding version length */
DieterGraef 0:d26c1b55cfca 153 u16_t verlen;
DieterGraef 0:d26c1b55cfca 154 /* encoding sequence length */
DieterGraef 0:d26c1b55cfca 155 u16_t seqlen;
DieterGraef 0:d26c1b55cfca 156 };
DieterGraef 0:d26c1b55cfca 157
DieterGraef 0:d26c1b55cfca 158 /** output response message header length fields */
DieterGraef 0:d26c1b55cfca 159 struct snmp_trap_header_lengths
DieterGraef 0:d26c1b55cfca 160 {
DieterGraef 0:d26c1b55cfca 161 /* encoding timestamp length length */
DieterGraef 0:d26c1b55cfca 162 u8_t tslenlen;
DieterGraef 0:d26c1b55cfca 163 /* encoding specific-trap length length */
DieterGraef 0:d26c1b55cfca 164 u8_t strplenlen;
DieterGraef 0:d26c1b55cfca 165 /* encoding generic-trap length length */
DieterGraef 0:d26c1b55cfca 166 u8_t gtrplenlen;
DieterGraef 0:d26c1b55cfca 167 /* encoding agent-addr length length */
DieterGraef 0:d26c1b55cfca 168 u8_t aaddrlenlen;
DieterGraef 0:d26c1b55cfca 169 /* encoding enterprise-id length length */
DieterGraef 0:d26c1b55cfca 170 u8_t eidlenlen;
DieterGraef 0:d26c1b55cfca 171 /* encoding pdu length length */
DieterGraef 0:d26c1b55cfca 172 u8_t pdulenlen;
DieterGraef 0:d26c1b55cfca 173 /* encoding community length length */
DieterGraef 0:d26c1b55cfca 174 u8_t comlenlen;
DieterGraef 0:d26c1b55cfca 175 /* encoding version length length */
DieterGraef 0:d26c1b55cfca 176 u8_t verlenlen;
DieterGraef 0:d26c1b55cfca 177 /* encoding sequence length length */
DieterGraef 0:d26c1b55cfca 178 u8_t seqlenlen;
DieterGraef 0:d26c1b55cfca 179
DieterGraef 0:d26c1b55cfca 180 /* encoding timestamp length */
DieterGraef 0:d26c1b55cfca 181 u16_t tslen;
DieterGraef 0:d26c1b55cfca 182 /* encoding specific-trap length */
DieterGraef 0:d26c1b55cfca 183 u16_t strplen;
DieterGraef 0:d26c1b55cfca 184 /* encoding generic-trap length */
DieterGraef 0:d26c1b55cfca 185 u16_t gtrplen;
DieterGraef 0:d26c1b55cfca 186 /* encoding agent-addr length */
DieterGraef 0:d26c1b55cfca 187 u16_t aaddrlen;
DieterGraef 0:d26c1b55cfca 188 /* encoding enterprise-id length */
DieterGraef 0:d26c1b55cfca 189 u16_t eidlen;
DieterGraef 0:d26c1b55cfca 190 /* encoding pdu length */
DieterGraef 0:d26c1b55cfca 191 u16_t pdulen;
DieterGraef 0:d26c1b55cfca 192 /* encoding community length */
DieterGraef 0:d26c1b55cfca 193 u16_t comlen;
DieterGraef 0:d26c1b55cfca 194 /* encoding version length */
DieterGraef 0:d26c1b55cfca 195 u16_t verlen;
DieterGraef 0:d26c1b55cfca 196 /* encoding sequence length */
DieterGraef 0:d26c1b55cfca 197 u16_t seqlen;
DieterGraef 0:d26c1b55cfca 198 };
DieterGraef 0:d26c1b55cfca 199
DieterGraef 0:d26c1b55cfca 200 /* Accepting new SNMP messages. */
DieterGraef 0:d26c1b55cfca 201 #define SNMP_MSG_EMPTY 0
DieterGraef 0:d26c1b55cfca 202 /* Search for matching object for variable binding. */
DieterGraef 0:d26c1b55cfca 203 #define SNMP_MSG_SEARCH_OBJ 1
DieterGraef 0:d26c1b55cfca 204 /* Perform SNMP operation on in-memory object.
DieterGraef 0:d26c1b55cfca 205 Pass-through states, for symmetry only. */
DieterGraef 0:d26c1b55cfca 206 #define SNMP_MSG_INTERNAL_GET_OBJDEF 2
DieterGraef 0:d26c1b55cfca 207 #define SNMP_MSG_INTERNAL_GET_VALUE 3
DieterGraef 0:d26c1b55cfca 208 #define SNMP_MSG_INTERNAL_SET_TEST 4
DieterGraef 0:d26c1b55cfca 209 #define SNMP_MSG_INTERNAL_GET_OBJDEF_S 5
DieterGraef 0:d26c1b55cfca 210 #define SNMP_MSG_INTERNAL_SET_VALUE 6
DieterGraef 0:d26c1b55cfca 211 /* Perform SNMP operation on object located externally.
DieterGraef 0:d26c1b55cfca 212 In theory this could be used for building a proxy agent.
DieterGraef 0:d26c1b55cfca 213 Practical use is for an enterprise spc. app. gateway. */
DieterGraef 0:d26c1b55cfca 214 #define SNMP_MSG_EXTERNAL_GET_OBJDEF 7
DieterGraef 0:d26c1b55cfca 215 #define SNMP_MSG_EXTERNAL_GET_VALUE 8
DieterGraef 0:d26c1b55cfca 216 #define SNMP_MSG_EXTERNAL_SET_TEST 9
DieterGraef 0:d26c1b55cfca 217 #define SNMP_MSG_EXTERNAL_GET_OBJDEF_S 10
DieterGraef 0:d26c1b55cfca 218 #define SNMP_MSG_EXTERNAL_SET_VALUE 11
DieterGraef 0:d26c1b55cfca 219
DieterGraef 0:d26c1b55cfca 220 #define SNMP_COMMUNITY_STR_LEN 64
DieterGraef 0:d26c1b55cfca 221 struct snmp_msg_pstat
DieterGraef 0:d26c1b55cfca 222 {
DieterGraef 0:d26c1b55cfca 223 /* lwIP local port (161) binding */
DieterGraef 0:d26c1b55cfca 224 struct udp_pcb *pcb;
DieterGraef 0:d26c1b55cfca 225 /* source IP address */
DieterGraef 0:d26c1b55cfca 226 ip_addr_t sip;
DieterGraef 0:d26c1b55cfca 227 /* source UDP port */
DieterGraef 0:d26c1b55cfca 228 u16_t sp;
DieterGraef 0:d26c1b55cfca 229 /* request type */
DieterGraef 0:d26c1b55cfca 230 u8_t rt;
DieterGraef 0:d26c1b55cfca 231 /* request ID */
DieterGraef 0:d26c1b55cfca 232 s32_t rid;
DieterGraef 0:d26c1b55cfca 233 /* error status */
DieterGraef 0:d26c1b55cfca 234 s32_t error_status;
DieterGraef 0:d26c1b55cfca 235 /* error index */
DieterGraef 0:d26c1b55cfca 236 s32_t error_index;
DieterGraef 0:d26c1b55cfca 237 /* community name (zero terminated) */
DieterGraef 0:d26c1b55cfca 238 u8_t community[SNMP_COMMUNITY_STR_LEN + 1];
DieterGraef 0:d26c1b55cfca 239 /* community string length (exclusive zero term) */
DieterGraef 0:d26c1b55cfca 240 u8_t com_strlen;
DieterGraef 0:d26c1b55cfca 241 /* one out of MSG_EMPTY, MSG_DEMUX, MSG_INTERNAL, MSG_EXTERNAL_x */
DieterGraef 0:d26c1b55cfca 242 u8_t state;
DieterGraef 0:d26c1b55cfca 243 /* saved arguments for MSG_EXTERNAL_x */
DieterGraef 0:d26c1b55cfca 244 struct mib_external_node *ext_mib_node;
DieterGraef 0:d26c1b55cfca 245 struct snmp_name_ptr ext_name_ptr;
DieterGraef 0:d26c1b55cfca 246 struct obj_def ext_object_def;
DieterGraef 0:d26c1b55cfca 247 struct snmp_obj_id ext_oid;
DieterGraef 0:d26c1b55cfca 248 /* index into input variable binding list */
DieterGraef 0:d26c1b55cfca 249 u8_t vb_idx;
DieterGraef 0:d26c1b55cfca 250 /* ptr into input variable binding list */
DieterGraef 0:d26c1b55cfca 251 struct snmp_varbind *vb_ptr;
DieterGraef 0:d26c1b55cfca 252 /* list of variable bindings from input */
DieterGraef 0:d26c1b55cfca 253 struct snmp_varbind_root invb;
DieterGraef 0:d26c1b55cfca 254 /* list of variable bindings to output */
DieterGraef 0:d26c1b55cfca 255 struct snmp_varbind_root outvb;
DieterGraef 0:d26c1b55cfca 256 /* output response lengths used in ASN encoding */
DieterGraef 0:d26c1b55cfca 257 struct snmp_resp_header_lengths rhl;
DieterGraef 0:d26c1b55cfca 258 };
DieterGraef 0:d26c1b55cfca 259
DieterGraef 0:d26c1b55cfca 260 struct snmp_msg_trap
DieterGraef 0:d26c1b55cfca 261 {
DieterGraef 0:d26c1b55cfca 262 /* lwIP local port (161) binding */
DieterGraef 0:d26c1b55cfca 263 struct udp_pcb *pcb;
DieterGraef 0:d26c1b55cfca 264 /* destination IP address in network order */
DieterGraef 0:d26c1b55cfca 265 ip_addr_t dip;
DieterGraef 0:d26c1b55cfca 266
DieterGraef 0:d26c1b55cfca 267 /* source enterprise ID (sysObjectID) */
DieterGraef 0:d26c1b55cfca 268 struct snmp_obj_id *enterprise;
DieterGraef 0:d26c1b55cfca 269 /* source IP address, raw network order format */
DieterGraef 0:d26c1b55cfca 270 u8_t sip_raw[4];
DieterGraef 0:d26c1b55cfca 271 /* generic trap code */
DieterGraef 0:d26c1b55cfca 272 u32_t gen_trap;
DieterGraef 0:d26c1b55cfca 273 /* specific trap code */
DieterGraef 0:d26c1b55cfca 274 u32_t spc_trap;
DieterGraef 0:d26c1b55cfca 275 /* timestamp */
DieterGraef 0:d26c1b55cfca 276 u32_t ts;
DieterGraef 0:d26c1b55cfca 277 /* list of variable bindings to output */
DieterGraef 0:d26c1b55cfca 278 struct snmp_varbind_root outvb;
DieterGraef 0:d26c1b55cfca 279 /* output trap lengths used in ASN encoding */
DieterGraef 0:d26c1b55cfca 280 struct snmp_trap_header_lengths thl;
DieterGraef 0:d26c1b55cfca 281 };
DieterGraef 0:d26c1b55cfca 282
DieterGraef 0:d26c1b55cfca 283 /** Agent Version constant, 0 = v1 oddity */
DieterGraef 0:d26c1b55cfca 284 extern const s32_t snmp_version;
DieterGraef 0:d26c1b55cfca 285 /** Agent default "public" community string */
DieterGraef 0:d26c1b55cfca 286 extern const char snmp_publiccommunity[7];
DieterGraef 0:d26c1b55cfca 287
DieterGraef 0:d26c1b55cfca 288 extern struct snmp_msg_trap trap_msg;
DieterGraef 0:d26c1b55cfca 289
DieterGraef 0:d26c1b55cfca 290 /** Agent setup, start listening to port 161. */
DieterGraef 0:d26c1b55cfca 291 void snmp_init(void);
DieterGraef 0:d26c1b55cfca 292 void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable);
DieterGraef 0:d26c1b55cfca 293 void snmp_trap_dst_ip_set(u8_t dst_idx, ip_addr_t *dst);
DieterGraef 0:d26c1b55cfca 294
DieterGraef 0:d26c1b55cfca 295 /** Varbind-list functions. */
DieterGraef 0:d26c1b55cfca 296 struct snmp_varbind* snmp_varbind_alloc(struct snmp_obj_id *oid, u8_t type, u8_t len);
DieterGraef 0:d26c1b55cfca 297 void snmp_varbind_free(struct snmp_varbind *vb);
DieterGraef 0:d26c1b55cfca 298 void snmp_varbind_list_free(struct snmp_varbind_root *root);
DieterGraef 0:d26c1b55cfca 299 void snmp_varbind_tail_add(struct snmp_varbind_root *root, struct snmp_varbind *vb);
DieterGraef 0:d26c1b55cfca 300 struct snmp_varbind* snmp_varbind_tail_remove(struct snmp_varbind_root *root);
DieterGraef 0:d26c1b55cfca 301
DieterGraef 0:d26c1b55cfca 302 /** Handle an internal (recv) or external (private response) event. */
DieterGraef 0:d26c1b55cfca 303 void snmp_msg_event(u8_t request_id);
DieterGraef 0:d26c1b55cfca 304 err_t snmp_send_response(struct snmp_msg_pstat *m_stat);
DieterGraef 0:d26c1b55cfca 305 err_t snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap);
DieterGraef 0:d26c1b55cfca 306 void snmp_coldstart_trap(void);
DieterGraef 0:d26c1b55cfca 307 void snmp_authfail_trap(void);
DieterGraef 0:d26c1b55cfca 308
DieterGraef 0:d26c1b55cfca 309 #ifdef __cplusplus
DieterGraef 0:d26c1b55cfca 310 }
DieterGraef 0:d26c1b55cfca 311 #endif
DieterGraef 0:d26c1b55cfca 312
DieterGraef 0:d26c1b55cfca 313 #endif /* LWIP_SNMP */
DieterGraef 0:d26c1b55cfca 314
DieterGraef 0:d26c1b55cfca 315 #endif /* __LWIP_SNMP_MSG_H__ */