Hi. This is the feed program for Cosm. (The previous name of the services is Pachube.)

Dependencies:   mbed ThermistorPack Pachube ConfigFile EthernetNetIf TextLCD HTTPClient_ToBeRemoved FatFileSystem SDFileSystem

Committer:
shintamainjp
Date:
Mon Aug 06 12:37:59 2012 +0000
Revision:
0:521ba375aa0f
Pachube renamed to Cosm.

Who changed what in which revision?

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