ID the MBED processor on the network if you have more than one. View MBED name on DHCP of your Router - Example \"MBED PE\" Change your ID in Core / host.h

Committer:
JeffM
Date:
Sat Nov 06 14:11:02 2010 +0000
Revision:
0:fd3b85615428
MBED ID 1A

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JeffM 0:fd3b85615428 1 /**
JeffM 0:fd3b85615428 2 * @file
JeffM 0:fd3b85615428 3 * Abstract Syntax Notation One (ISO 8824, 8825) codec.
JeffM 0:fd3b85615428 4 */
JeffM 0:fd3b85615428 5
JeffM 0:fd3b85615428 6 /*
JeffM 0:fd3b85615428 7 * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands.
JeffM 0:fd3b85615428 8 * All rights reserved.
JeffM 0:fd3b85615428 9 *
JeffM 0:fd3b85615428 10 * Redistribution and use in source and binary forms, with or without modification,
JeffM 0:fd3b85615428 11 * are permitted provided that the following conditions are met:
JeffM 0:fd3b85615428 12 *
JeffM 0:fd3b85615428 13 * 1. Redistributions of source code must retain the above copyright notice,
JeffM 0:fd3b85615428 14 * this list of conditions and the following disclaimer.
JeffM 0:fd3b85615428 15 * 2. Redistributions in binary form must reproduce the above copyright notice,
JeffM 0:fd3b85615428 16 * this list of conditions and the following disclaimer in the documentation
JeffM 0:fd3b85615428 17 * and/or other materials provided with the distribution.
JeffM 0:fd3b85615428 18 * 3. The name of the author may not be used to endorse or promote products
JeffM 0:fd3b85615428 19 * derived from this software without specific prior written permission.
JeffM 0:fd3b85615428 20 *
JeffM 0:fd3b85615428 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
JeffM 0:fd3b85615428 22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
JeffM 0:fd3b85615428 23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
JeffM 0:fd3b85615428 24 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
JeffM 0:fd3b85615428 25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
JeffM 0:fd3b85615428 26 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
JeffM 0:fd3b85615428 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
JeffM 0:fd3b85615428 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
JeffM 0:fd3b85615428 29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
JeffM 0:fd3b85615428 30 * OF SUCH DAMAGE.
JeffM 0:fd3b85615428 31 *
JeffM 0:fd3b85615428 32 * Author: Christiaan Simons <christiaan.simons@axon.tv>
JeffM 0:fd3b85615428 33 */
JeffM 0:fd3b85615428 34
JeffM 0:fd3b85615428 35 #ifndef __LWIP_SNMP_ASN1_H__
JeffM 0:fd3b85615428 36 #define __LWIP_SNMP_ASN1_H__
JeffM 0:fd3b85615428 37
JeffM 0:fd3b85615428 38 #include "lwip/opt.h"
JeffM 0:fd3b85615428 39 #include "lwip/err.h"
JeffM 0:fd3b85615428 40 #include "lwip/pbuf.h"
JeffM 0:fd3b85615428 41 #include "lwip/snmp.h"
JeffM 0:fd3b85615428 42
JeffM 0:fd3b85615428 43 #if LWIP_SNMP
JeffM 0:fd3b85615428 44
JeffM 0:fd3b85615428 45 #ifdef __cplusplus
JeffM 0:fd3b85615428 46 extern "C" {
JeffM 0:fd3b85615428 47 #endif
JeffM 0:fd3b85615428 48
JeffM 0:fd3b85615428 49 #define SNMP_ASN1_UNIV (0) /* (!0x80 | !0x40) */
JeffM 0:fd3b85615428 50 #define SNMP_ASN1_APPLIC (0x40) /* (!0x80 | 0x40) */
JeffM 0:fd3b85615428 51 #define SNMP_ASN1_CONTXT (0x80) /* ( 0x80 | !0x40) */
JeffM 0:fd3b85615428 52
JeffM 0:fd3b85615428 53 #define SNMP_ASN1_CONSTR (0x20) /* ( 0x20) */
JeffM 0:fd3b85615428 54 #define SNMP_ASN1_PRIMIT (0) /* (!0x20) */
JeffM 0:fd3b85615428 55
JeffM 0:fd3b85615428 56 /* universal tags */
JeffM 0:fd3b85615428 57 #define SNMP_ASN1_INTEG 2
JeffM 0:fd3b85615428 58 #define SNMP_ASN1_OC_STR 4
JeffM 0:fd3b85615428 59 #define SNMP_ASN1_NUL 5
JeffM 0:fd3b85615428 60 #define SNMP_ASN1_OBJ_ID 6
JeffM 0:fd3b85615428 61 #define SNMP_ASN1_SEQ 16
JeffM 0:fd3b85615428 62
JeffM 0:fd3b85615428 63 /* application specific (SNMP) tags */
JeffM 0:fd3b85615428 64 #define SNMP_ASN1_IPADDR 0 /* octet string size(4) */
JeffM 0:fd3b85615428 65 #define SNMP_ASN1_COUNTER 1 /* u32_t */
JeffM 0:fd3b85615428 66 #define SNMP_ASN1_GAUGE 2 /* u32_t */
JeffM 0:fd3b85615428 67 #define SNMP_ASN1_TIMETICKS 3 /* u32_t */
JeffM 0:fd3b85615428 68 #define SNMP_ASN1_OPAQUE 4 /* octet string */
JeffM 0:fd3b85615428 69
JeffM 0:fd3b85615428 70 /* context specific (SNMP) tags */
JeffM 0:fd3b85615428 71 #define SNMP_ASN1_PDU_GET_REQ 0
JeffM 0:fd3b85615428 72 #define SNMP_ASN1_PDU_GET_NEXT_REQ 1
JeffM 0:fd3b85615428 73 #define SNMP_ASN1_PDU_GET_RESP 2
JeffM 0:fd3b85615428 74 #define SNMP_ASN1_PDU_SET_REQ 3
JeffM 0:fd3b85615428 75 #define SNMP_ASN1_PDU_TRAP 4
JeffM 0:fd3b85615428 76
JeffM 0:fd3b85615428 77 err_t snmp_asn1_dec_type(struct pbuf *p, u16_t ofs, u8_t *type);
JeffM 0:fd3b85615428 78 err_t snmp_asn1_dec_length(struct pbuf *p, u16_t ofs, u8_t *octets_used, u16_t *length);
JeffM 0:fd3b85615428 79 err_t snmp_asn1_dec_u32t(struct pbuf *p, u16_t ofs, u16_t len, u32_t *value);
JeffM 0:fd3b85615428 80 err_t snmp_asn1_dec_s32t(struct pbuf *p, u16_t ofs, u16_t len, s32_t *value);
JeffM 0:fd3b85615428 81 err_t snmp_asn1_dec_oid(struct pbuf *p, u16_t ofs, u16_t len, struct snmp_obj_id *oid);
JeffM 0:fd3b85615428 82 err_t snmp_asn1_dec_raw(struct pbuf *p, u16_t ofs, u16_t len, u16_t raw_len, u8_t *raw);
JeffM 0:fd3b85615428 83
JeffM 0:fd3b85615428 84 void snmp_asn1_enc_length_cnt(u16_t length, u8_t *octets_needed);
JeffM 0:fd3b85615428 85 void snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed);
JeffM 0:fd3b85615428 86 void snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed);
JeffM 0:fd3b85615428 87 void snmp_asn1_enc_oid_cnt(u8_t ident_len, s32_t *ident, u16_t *octets_needed);
JeffM 0:fd3b85615428 88 err_t snmp_asn1_enc_type(struct pbuf *p, u16_t ofs, u8_t type);
JeffM 0:fd3b85615428 89 err_t snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length);
JeffM 0:fd3b85615428 90 err_t snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, u32_t value);
JeffM 0:fd3b85615428 91 err_t snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, s32_t value);
JeffM 0:fd3b85615428 92 err_t snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident);
JeffM 0:fd3b85615428 93 err_t snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u16_t raw_len, u8_t *raw);
JeffM 0:fd3b85615428 94
JeffM 0:fd3b85615428 95 #ifdef __cplusplus
JeffM 0:fd3b85615428 96 }
JeffM 0:fd3b85615428 97 #endif
JeffM 0:fd3b85615428 98
JeffM 0:fd3b85615428 99 #endif /* LWIP_SNMP */
JeffM 0:fd3b85615428 100
JeffM 0:fd3b85615428 101 #endif /* __LWIP_SNMP_ASN1_H__ */