mbeduino + Weatherduino Weather Stations post test

Dependencies:   mbed

Committer:
okini3939
Date:
Tue Oct 26 17:19:28 2010 +0000
Revision:
0:10bcaa7c2253

        

Who changed what in which revision?

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