Dependencies:   FatFileSystem mbed WeatherMeters SDFileSystem

Committer:
dcoban
Date:
Tue Apr 03 18:43:13 2012 +0000
Revision:
0:1a61c61d0845

        

Who changed what in which revision?

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