I have a problem getting this to work. Server only recieves half of the data being sent. Whats wrong

Dependencies:   mbed

Committer:
tax
Date:
Tue Mar 29 13:20:15 2011 +0000
Revision:
0:66300c77c6e9

        

Who changed what in which revision?

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