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 * lcp.h - Network Link Control Protocol header file.
shintamainjp 0:521ba375aa0f 3 *
shintamainjp 0:521ba375aa0f 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
shintamainjp 0:521ba375aa0f 5 * portions Copyright (c) 1997 Global Election Systems Inc.
shintamainjp 0:521ba375aa0f 6 *
shintamainjp 0:521ba375aa0f 7 * The authors hereby grant permission to use, copy, modify, distribute,
shintamainjp 0:521ba375aa0f 8 * and license this software and its documentation for any purpose, provided
shintamainjp 0:521ba375aa0f 9 * that existing copyright notices are retained in all copies and that this
shintamainjp 0:521ba375aa0f 10 * notice and the following disclaimer are included verbatim in any
shintamainjp 0:521ba375aa0f 11 * distributions. No written agreement, license, or royalty fee is required
shintamainjp 0:521ba375aa0f 12 * for any of the authorized uses.
shintamainjp 0:521ba375aa0f 13 *
shintamainjp 0:521ba375aa0f 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
shintamainjp 0:521ba375aa0f 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
shintamainjp 0:521ba375aa0f 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
shintamainjp 0:521ba375aa0f 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
shintamainjp 0:521ba375aa0f 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
shintamainjp 0:521ba375aa0f 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
shintamainjp 0:521ba375aa0f 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
shintamainjp 0:521ba375aa0f 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
shintamainjp 0:521ba375aa0f 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
shintamainjp 0:521ba375aa0f 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
shintamainjp 0:521ba375aa0f 24 *
shintamainjp 0:521ba375aa0f 25 ******************************************************************************
shintamainjp 0:521ba375aa0f 26 * REVISION HISTORY
shintamainjp 0:521ba375aa0f 27 *
shintamainjp 0:521ba375aa0f 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
shintamainjp 0:521ba375aa0f 29 * Ported to lwIP.
shintamainjp 0:521ba375aa0f 30 * 97-11-05 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
shintamainjp 0:521ba375aa0f 31 * Original derived from BSD codes.
shintamainjp 0:521ba375aa0f 32 *****************************************************************************/
shintamainjp 0:521ba375aa0f 33 /*
shintamainjp 0:521ba375aa0f 34 * lcp.h - Link Control Protocol definitions.
shintamainjp 0:521ba375aa0f 35 *
shintamainjp 0:521ba375aa0f 36 * Copyright (c) 1989 Carnegie Mellon University.
shintamainjp 0:521ba375aa0f 37 * All rights reserved.
shintamainjp 0:521ba375aa0f 38 *
shintamainjp 0:521ba375aa0f 39 * Redistribution and use in source and binary forms are permitted
shintamainjp 0:521ba375aa0f 40 * provided that the above copyright notice and this paragraph are
shintamainjp 0:521ba375aa0f 41 * duplicated in all such forms and that any documentation,
shintamainjp 0:521ba375aa0f 42 * advertising materials, and other materials related to such
shintamainjp 0:521ba375aa0f 43 * distribution and use acknowledge that the software was developed
shintamainjp 0:521ba375aa0f 44 * by Carnegie Mellon University. The name of the
shintamainjp 0:521ba375aa0f 45 * University may not be used to endorse or promote products derived
shintamainjp 0:521ba375aa0f 46 * from this software without specific prior written permission.
shintamainjp 0:521ba375aa0f 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
shintamainjp 0:521ba375aa0f 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
shintamainjp 0:521ba375aa0f 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
shintamainjp 0:521ba375aa0f 50 *
shintamainjp 0:521ba375aa0f 51 * $Id: lcp.h,v 1.4 2010/01/18 20:49:43 goldsimon Exp $
shintamainjp 0:521ba375aa0f 52 */
shintamainjp 0:521ba375aa0f 53
shintamainjp 0:521ba375aa0f 54 #ifndef LCP_H
shintamainjp 0:521ba375aa0f 55 #define LCP_H
shintamainjp 0:521ba375aa0f 56 /*
shintamainjp 0:521ba375aa0f 57 * Options.
shintamainjp 0:521ba375aa0f 58 */
shintamainjp 0:521ba375aa0f 59 #define CI_MRU 1 /* Maximum Receive Unit */
shintamainjp 0:521ba375aa0f 60 #define CI_ASYNCMAP 2 /* Async Control Character Map */
shintamainjp 0:521ba375aa0f 61 #define CI_AUTHTYPE 3 /* Authentication Type */
shintamainjp 0:521ba375aa0f 62 #define CI_QUALITY 4 /* Quality Protocol */
shintamainjp 0:521ba375aa0f 63 #define CI_MAGICNUMBER 5 /* Magic Number */
shintamainjp 0:521ba375aa0f 64 #define CI_PCOMPRESSION 7 /* Protocol Field Compression */
shintamainjp 0:521ba375aa0f 65 #define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
shintamainjp 0:521ba375aa0f 66 #define CI_CALLBACK 13 /* callback */
shintamainjp 0:521ba375aa0f 67 #define CI_MRRU 17 /* max reconstructed receive unit; multilink */
shintamainjp 0:521ba375aa0f 68 #define CI_SSNHF 18 /* short sequence numbers for multilink */
shintamainjp 0:521ba375aa0f 69 #define CI_EPDISC 19 /* endpoint discriminator */
shintamainjp 0:521ba375aa0f 70
shintamainjp 0:521ba375aa0f 71 /*
shintamainjp 0:521ba375aa0f 72 * LCP-specific packet types (code numbers).
shintamainjp 0:521ba375aa0f 73 */
shintamainjp 0:521ba375aa0f 74 #define PROTREJ 8 /* Protocol Reject */
shintamainjp 0:521ba375aa0f 75 #define ECHOREQ 9 /* Echo Request */
shintamainjp 0:521ba375aa0f 76 #define ECHOREP 10 /* Echo Reply */
shintamainjp 0:521ba375aa0f 77 #define DISCREQ 11 /* Discard Request */
shintamainjp 0:521ba375aa0f 78 #define CBCP_OPT 6 /* Use callback control protocol */
shintamainjp 0:521ba375aa0f 79
shintamainjp 0:521ba375aa0f 80 /*
shintamainjp 0:521ba375aa0f 81 * The state of options is described by an lcp_options structure.
shintamainjp 0:521ba375aa0f 82 */
shintamainjp 0:521ba375aa0f 83 typedef struct lcp_options {
shintamainjp 0:521ba375aa0f 84 u_int passive : 1; /* Don't die if we don't get a response */
shintamainjp 0:521ba375aa0f 85 u_int silent : 1; /* Wait for the other end to start first */
shintamainjp 0:521ba375aa0f 86 u_int restart : 1; /* Restart vs. exit after close */
shintamainjp 0:521ba375aa0f 87 u_int neg_mru : 1; /* Negotiate the MRU? */
shintamainjp 0:521ba375aa0f 88 u_int neg_asyncmap : 1; /* Negotiate the async map? */
shintamainjp 0:521ba375aa0f 89 u_int neg_upap : 1; /* Ask for UPAP authentication? */
shintamainjp 0:521ba375aa0f 90 u_int neg_chap : 1; /* Ask for CHAP authentication? */
shintamainjp 0:521ba375aa0f 91 u_int neg_magicnumber : 1; /* Ask for magic number? */
shintamainjp 0:521ba375aa0f 92 u_int neg_pcompression : 1; /* HDLC Protocol Field Compression? */
shintamainjp 0:521ba375aa0f 93 u_int neg_accompression : 1; /* HDLC Address/Control Field Compression? */
shintamainjp 0:521ba375aa0f 94 u_int neg_lqr : 1; /* Negotiate use of Link Quality Reports */
shintamainjp 0:521ba375aa0f 95 u_int neg_cbcp : 1; /* Negotiate use of CBCP */
shintamainjp 0:521ba375aa0f 96 #ifdef PPP_MULTILINK
shintamainjp 0:521ba375aa0f 97 u_int neg_mrru : 1; /* Negotiate multilink MRRU */
shintamainjp 0:521ba375aa0f 98 u_int neg_ssnhf : 1; /* Negotiate short sequence numbers */
shintamainjp 0:521ba375aa0f 99 u_int neg_endpoint : 1; /* Negotiate endpoint discriminator */
shintamainjp 0:521ba375aa0f 100 #endif
shintamainjp 0:521ba375aa0f 101 u_short mru; /* Value of MRU */
shintamainjp 0:521ba375aa0f 102 #ifdef PPP_MULTILINK
shintamainjp 0:521ba375aa0f 103 u_short mrru; /* Value of MRRU, and multilink enable */
shintamainjp 0:521ba375aa0f 104 #endif
shintamainjp 0:521ba375aa0f 105 u_char chap_mdtype; /* which MD type (hashing algorithm) */
shintamainjp 0:521ba375aa0f 106 u32_t asyncmap; /* Value of async map */
shintamainjp 0:521ba375aa0f 107 u32_t magicnumber;
shintamainjp 0:521ba375aa0f 108 int numloops; /* Number of loops during magic number neg. */
shintamainjp 0:521ba375aa0f 109 u32_t lqr_period; /* Reporting period for LQR 1/100ths second */
shintamainjp 0:521ba375aa0f 110 #ifdef PPP_MULTILINK
shintamainjp 0:521ba375aa0f 111 struct epdisc endpoint; /* endpoint discriminator */
shintamainjp 0:521ba375aa0f 112 #endif
shintamainjp 0:521ba375aa0f 113 } lcp_options;
shintamainjp 0:521ba375aa0f 114
shintamainjp 0:521ba375aa0f 115 /*
shintamainjp 0:521ba375aa0f 116 * Values for phase from BSD pppd.h based on RFC 1661.
shintamainjp 0:521ba375aa0f 117 */
shintamainjp 0:521ba375aa0f 118 typedef enum {
shintamainjp 0:521ba375aa0f 119 PHASE_DEAD = 0,
shintamainjp 0:521ba375aa0f 120 PHASE_INITIALIZE,
shintamainjp 0:521ba375aa0f 121 PHASE_ESTABLISH,
shintamainjp 0:521ba375aa0f 122 PHASE_AUTHENTICATE,
shintamainjp 0:521ba375aa0f 123 PHASE_CALLBACK,
shintamainjp 0:521ba375aa0f 124 PHASE_NETWORK,
shintamainjp 0:521ba375aa0f 125 PHASE_TERMINATE
shintamainjp 0:521ba375aa0f 126 } LinkPhase;
shintamainjp 0:521ba375aa0f 127
shintamainjp 0:521ba375aa0f 128
shintamainjp 0:521ba375aa0f 129
shintamainjp 0:521ba375aa0f 130 extern LinkPhase lcp_phase[NUM_PPP]; /* Phase of link session (RFC 1661) */
shintamainjp 0:521ba375aa0f 131 extern lcp_options lcp_wantoptions[];
shintamainjp 0:521ba375aa0f 132 extern lcp_options lcp_gotoptions[];
shintamainjp 0:521ba375aa0f 133 extern lcp_options lcp_allowoptions[];
shintamainjp 0:521ba375aa0f 134 extern lcp_options lcp_hisoptions[];
shintamainjp 0:521ba375aa0f 135 extern ext_accm xmit_accm[];
shintamainjp 0:521ba375aa0f 136
shintamainjp 0:521ba375aa0f 137
shintamainjp 0:521ba375aa0f 138 void lcp_init (int);
shintamainjp 0:521ba375aa0f 139 void lcp_open (int);
shintamainjp 0:521ba375aa0f 140 void lcp_close (int, char *);
shintamainjp 0:521ba375aa0f 141 void lcp_lowerup (int);
shintamainjp 0:521ba375aa0f 142 void lcp_lowerdown(int);
shintamainjp 0:521ba375aa0f 143 void lcp_sprotrej (int, u_char *, int); /* send protocol reject */
shintamainjp 0:521ba375aa0f 144
shintamainjp 0:521ba375aa0f 145 extern struct protent lcp_protent;
shintamainjp 0:521ba375aa0f 146
shintamainjp 0:521ba375aa0f 147 /* Default number of times we receive our magic number from the peer
shintamainjp 0:521ba375aa0f 148 before deciding the link is looped-back. */
shintamainjp 0:521ba375aa0f 149 #define DEFLOOPBACKFAIL 10
shintamainjp 0:521ba375aa0f 150
shintamainjp 0:521ba375aa0f 151 #endif /* LCP_H */