NetTribute library with debug turned on in FShandler Donatien Garner -> Segundo Equipo -> this version

Committer:
hexley
Date:
Fri Nov 19 01:54:45 2010 +0000
Revision:
0:281d6ff68967

        

Who changed what in which revision?

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