HTTPClient using static IP

Dependencies:   mbed

Committer:
mr_q
Date:
Mon May 30 11:53:37 2011 +0000
Revision:
0:d8f2f7d5f31b
v0.01 Draft

Who changed what in which revision?

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