Web server based weather station using Sparkfun Weather Meters.

Dependencies:   FatFileSystem mbed WeatherMeters SDFileSystem

Committer:
AdamGreen
Date:
Sat Feb 25 03:28:05 2012 +0000
Revision:
1:c7958aa34fa1
Parent:
0:616601bde9fb
Use published libraries where possible.

Who changed what in which revision?

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