Integrating the ublox LISA C200 modem

Fork of SprintUSBModemHTTPClientTest by Donatien Garnier

Committer:
sam_grove
Date:
Thu Sep 26 00:44:20 2013 -0500
Revision:
5:3f93dd1d4cb3
Exported program and replaced contents of the repo with the source
to build and debug using keil mdk. Libs NOT upto date are lwip, lwip-sys
and socket. these have newer versions under mbed_official but were starting
from a know working point

Who changed what in which revision?

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