ProjetoBB

Dependencies:   F7_Ethernet WebSocketClient mbed mcp3008

Fork of Nucleo_F746ZG_Ethernet by Dieter Graef

Committer:
DieterGraef
Date:
Sat Jun 18 10:49:12 2016 +0000
Revision:
0:f9b6112278fe
Ethernet for the NUCLEO STM32F746 Board Testprogram uses DHCP and NTP to set the clock

Who changed what in which revision?

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