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 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
shintamainjp 0:521ba375aa0f 3 * All rights reserved.
shintamainjp 0:521ba375aa0f 4 *
shintamainjp 0:521ba375aa0f 5 * Redistribution and use in source and binary forms, with or without modification,
shintamainjp 0:521ba375aa0f 6 * are permitted provided that the following conditions are met:
shintamainjp 0:521ba375aa0f 7 *
shintamainjp 0:521ba375aa0f 8 * 1. Redistributions of source code must retain the above copyright notice,
shintamainjp 0:521ba375aa0f 9 * this list of conditions and the following disclaimer.
shintamainjp 0:521ba375aa0f 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
shintamainjp 0:521ba375aa0f 11 * this list of conditions and the following disclaimer in the documentation
shintamainjp 0:521ba375aa0f 12 * and/or other materials provided with the distribution.
shintamainjp 0:521ba375aa0f 13 * 3. The name of the author may not be used to endorse or promote products
shintamainjp 0:521ba375aa0f 14 * derived from this software without specific prior written permission.
shintamainjp 0:521ba375aa0f 15 *
shintamainjp 0:521ba375aa0f 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
shintamainjp 0:521ba375aa0f 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
shintamainjp 0:521ba375aa0f 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
shintamainjp 0:521ba375aa0f 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
shintamainjp 0:521ba375aa0f 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
shintamainjp 0:521ba375aa0f 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
shintamainjp 0:521ba375aa0f 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
shintamainjp 0:521ba375aa0f 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
shintamainjp 0:521ba375aa0f 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
shintamainjp 0:521ba375aa0f 25 * OF SUCH DAMAGE.
shintamainjp 0:521ba375aa0f 26 *
shintamainjp 0:521ba375aa0f 27 * This file is part of the lwIP TCP/IP stack.
shintamainjp 0:521ba375aa0f 28 *
shintamainjp 0:521ba375aa0f 29 * Author: Adam Dunkels <adam@sics.se>
shintamainjp 0:521ba375aa0f 30 *
shintamainjp 0:521ba375aa0f 31 */
shintamainjp 0:521ba375aa0f 32
shintamainjp 0:521ba375aa0f 33 #ifndef __LWIP_PBUF_H__
shintamainjp 0:521ba375aa0f 34 #define __LWIP_PBUF_H__
shintamainjp 0:521ba375aa0f 35
shintamainjp 0:521ba375aa0f 36 #include "lwip/opt.h"
shintamainjp 0:521ba375aa0f 37 #include "lwip/err.h"
shintamainjp 0:521ba375aa0f 38
shintamainjp 0:521ba375aa0f 39 #ifdef __cplusplus
shintamainjp 0:521ba375aa0f 40 extern "C" {
shintamainjp 0:521ba375aa0f 41 #endif
shintamainjp 0:521ba375aa0f 42
shintamainjp 0:521ba375aa0f 43 /* Currently, the pbuf_custom code is only needed for one specific configuration
shintamainjp 0:521ba375aa0f 44 * of IP_FRAG */
shintamainjp 0:521ba375aa0f 45 #define LWIP_SUPPORT_CUSTOM_PBUF (IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF)
shintamainjp 0:521ba375aa0f 46
shintamainjp 0:521ba375aa0f 47 #define PBUF_TRANSPORT_HLEN 20
shintamainjp 0:521ba375aa0f 48 #define PBUF_IP_HLEN 20
shintamainjp 0:521ba375aa0f 49
shintamainjp 0:521ba375aa0f 50 typedef enum {
shintamainjp 0:521ba375aa0f 51 PBUF_TRANSPORT,
shintamainjp 0:521ba375aa0f 52 PBUF_IP,
shintamainjp 0:521ba375aa0f 53 PBUF_LINK,
shintamainjp 0:521ba375aa0f 54 PBUF_RAW
shintamainjp 0:521ba375aa0f 55 } pbuf_layer;
shintamainjp 0:521ba375aa0f 56
shintamainjp 0:521ba375aa0f 57 typedef enum {
shintamainjp 0:521ba375aa0f 58 PBUF_RAM, /* pbuf data is stored in RAM */
shintamainjp 0:521ba375aa0f 59 PBUF_ROM, /* pbuf data is stored in ROM */
shintamainjp 0:521ba375aa0f 60 PBUF_REF, /* pbuf comes from the pbuf pool */
shintamainjp 0:521ba375aa0f 61 PBUF_POOL /* pbuf payload refers to RAM */
shintamainjp 0:521ba375aa0f 62 } pbuf_type;
shintamainjp 0:521ba375aa0f 63
shintamainjp 0:521ba375aa0f 64
shintamainjp 0:521ba375aa0f 65 /* indicates this packet's data should be immediately passed to the application */
shintamainjp 0:521ba375aa0f 66 #define PBUF_FLAG_PUSH 0x01U
shintamainjp 0:521ba375aa0f 67 /* indicates this is a custom pbuf: pbuf_free and pbuf_header handle such a
shintamainjp 0:521ba375aa0f 68 a pbuf differently */
shintamainjp 0:521ba375aa0f 69 #define PBUF_FLAG_IS_CUSTOM 0x02U
shintamainjp 0:521ba375aa0f 70 /* indicates this pbuf is UDP multicast to be looped back */
shintamainjp 0:521ba375aa0f 71 #define PBUF_FLAG_MCASTLOOP 0x04U
shintamainjp 0:521ba375aa0f 72
shintamainjp 0:521ba375aa0f 73 struct pbuf {
shintamainjp 0:521ba375aa0f 74 /* next pbuf in singly linked pbuf chain */
shintamainjp 0:521ba375aa0f 75 struct pbuf *next;
shintamainjp 0:521ba375aa0f 76
shintamainjp 0:521ba375aa0f 77 /* pointer to the actual data in the buffer */
shintamainjp 0:521ba375aa0f 78 void *payload;
shintamainjp 0:521ba375aa0f 79
shintamainjp 0:521ba375aa0f 80 /**
shintamainjp 0:521ba375aa0f 81 * total length of this buffer and all next buffers in chain
shintamainjp 0:521ba375aa0f 82 * belonging to the same packet.
shintamainjp 0:521ba375aa0f 83 *
shintamainjp 0:521ba375aa0f 84 * For non-queue packet chains this is the invariant:
shintamainjp 0:521ba375aa0f 85 * p->tot_len == p->len + (p->next? p->next->tot_len: 0)
shintamainjp 0:521ba375aa0f 86 */
shintamainjp 0:521ba375aa0f 87 u16_t tot_len;
shintamainjp 0:521ba375aa0f 88
shintamainjp 0:521ba375aa0f 89 /* length of this buffer */
shintamainjp 0:521ba375aa0f 90 u16_t len;
shintamainjp 0:521ba375aa0f 91
shintamainjp 0:521ba375aa0f 92 /* pbuf_type as u8_t instead of enum to save space */
shintamainjp 0:521ba375aa0f 93 u8_t /*pbuf_type*/ type;
shintamainjp 0:521ba375aa0f 94
shintamainjp 0:521ba375aa0f 95 /* misc flags */
shintamainjp 0:521ba375aa0f 96 u8_t flags;
shintamainjp 0:521ba375aa0f 97
shintamainjp 0:521ba375aa0f 98 /**
shintamainjp 0:521ba375aa0f 99 * the reference count always equals the number of pointers
shintamainjp 0:521ba375aa0f 100 * that refer to this pbuf. This can be pointers from an application,
shintamainjp 0:521ba375aa0f 101 * the stack itself, or pbuf->next pointers from a chain.
shintamainjp 0:521ba375aa0f 102 */
shintamainjp 0:521ba375aa0f 103 u16_t ref;
shintamainjp 0:521ba375aa0f 104 };
shintamainjp 0:521ba375aa0f 105
shintamainjp 0:521ba375aa0f 106 #if LWIP_SUPPORT_CUSTOM_PBUF
shintamainjp 0:521ba375aa0f 107 /* Prototype for a function to free a custom pbuf */
shintamainjp 0:521ba375aa0f 108 typedef void (*pbuf_free_custom_fn)(struct pbuf *p);
shintamainjp 0:521ba375aa0f 109
shintamainjp 0:521ba375aa0f 110 /* A custom pbuf: like a pbuf, but following a function pointer to free it. */
shintamainjp 0:521ba375aa0f 111 struct pbuf_custom {
shintamainjp 0:521ba375aa0f 112 /* The actual pbuf */
shintamainjp 0:521ba375aa0f 113 struct pbuf pbuf;
shintamainjp 0:521ba375aa0f 114 /* This function is called when pbuf_free deallocates this pbuf(_custom) */
shintamainjp 0:521ba375aa0f 115 pbuf_free_custom_fn custom_free_function;
shintamainjp 0:521ba375aa0f 116 };
shintamainjp 0:521ba375aa0f 117 #endif /* LWIP_SUPPORT_CUSTOM_PBUF */
shintamainjp 0:521ba375aa0f 118
shintamainjp 0:521ba375aa0f 119 /* Initializes the pbuf module. This call is empty for now, but may not be in future. */
shintamainjp 0:521ba375aa0f 120 #define pbuf_init()
shintamainjp 0:521ba375aa0f 121
shintamainjp 0:521ba375aa0f 122 struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type);
shintamainjp 0:521ba375aa0f 123 #if LWIP_SUPPORT_CUSTOM_PBUF
shintamainjp 0:521ba375aa0f 124 struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type,
shintamainjp 0:521ba375aa0f 125 struct pbuf_custom *p, void *payload_mem,
shintamainjp 0:521ba375aa0f 126 u16_t payload_mem_len);
shintamainjp 0:521ba375aa0f 127 #endif /* LWIP_SUPPORT_CUSTOM_PBUF */
shintamainjp 0:521ba375aa0f 128 void pbuf_realloc(struct pbuf *p, u16_t size);
shintamainjp 0:521ba375aa0f 129 u8_t pbuf_header(struct pbuf *p, s16_t header_size);
shintamainjp 0:521ba375aa0f 130 void pbuf_ref(struct pbuf *p);
shintamainjp 0:521ba375aa0f 131 u8_t pbuf_free(struct pbuf *p);
shintamainjp 0:521ba375aa0f 132 u8_t pbuf_clen(struct pbuf *p);
shintamainjp 0:521ba375aa0f 133 void pbuf_cat(struct pbuf *head, struct pbuf *tail);
shintamainjp 0:521ba375aa0f 134 void pbuf_chain(struct pbuf *head, struct pbuf *tail);
shintamainjp 0:521ba375aa0f 135 struct pbuf *pbuf_dechain(struct pbuf *p);
shintamainjp 0:521ba375aa0f 136 err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from);
shintamainjp 0:521ba375aa0f 137 u16_t pbuf_copy_partial(struct pbuf *p, void *dataptr, u16_t len, u16_t offset);
shintamainjp 0:521ba375aa0f 138 err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len);
shintamainjp 0:521ba375aa0f 139 struct pbuf *pbuf_coalesce(struct pbuf *p, pbuf_layer layer);
shintamainjp 0:521ba375aa0f 140 #if LWIP_CHECKSUM_ON_COPY
shintamainjp 0:521ba375aa0f 141 err_t pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr,
shintamainjp 0:521ba375aa0f 142 u16_t len, u16_t *chksum);
shintamainjp 0:521ba375aa0f 143 #endif /* LWIP_CHECKSUM_ON_COPY */
shintamainjp 0:521ba375aa0f 144
shintamainjp 0:521ba375aa0f 145 u8_t pbuf_get_at(struct pbuf* p, u16_t offset);
shintamainjp 0:521ba375aa0f 146 u16_t pbuf_memcmp(struct pbuf* p, u16_t offset, const void* s2, u16_t n);
shintamainjp 0:521ba375aa0f 147 u16_t pbuf_memfind(struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset);
shintamainjp 0:521ba375aa0f 148 u16_t pbuf_strstr(struct pbuf* p, const char* substr);
shintamainjp 0:521ba375aa0f 149
shintamainjp 0:521ba375aa0f 150 #ifdef __cplusplus
shintamainjp 0:521ba375aa0f 151 }
shintamainjp 0:521ba375aa0f 152 #endif
shintamainjp 0:521ba375aa0f 153
shintamainjp 0:521ba375aa0f 154 #endif /* __LWIP_PBUF_H__ */