Netservices modded to read fragmented HTTP respsonse/payload from special purpose server - 180 bytes only

Committer:
RodColeman
Date:
Thu Sep 08 10:41:36 2011 +0000
Revision:
0:8f5825f330b0
setDataLen hacked to 180bytes

Who changed what in which revision?

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