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 * pap.h - PPP Password Authentication 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-12-04 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 * upap.h - User/Password Authentication 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
DieterGraef 0:f9b6112278fe 52 #ifndef PAP_H
DieterGraef 0:f9b6112278fe 53 #define PAP_H
DieterGraef 0:f9b6112278fe 54
DieterGraef 0:f9b6112278fe 55 #if PAP_SUPPORT /* don't build if not configured for use in lwipopts.h */
DieterGraef 0:f9b6112278fe 56
DieterGraef 0:f9b6112278fe 57 /*
DieterGraef 0:f9b6112278fe 58 * Packet header = Code, id, length.
DieterGraef 0:f9b6112278fe 59 */
DieterGraef 0:f9b6112278fe 60 #define UPAP_HEADERLEN (sizeof (u_char) + sizeof (u_char) + sizeof (u_short))
DieterGraef 0:f9b6112278fe 61
DieterGraef 0:f9b6112278fe 62
DieterGraef 0:f9b6112278fe 63 /*
DieterGraef 0:f9b6112278fe 64 * UPAP codes.
DieterGraef 0:f9b6112278fe 65 */
DieterGraef 0:f9b6112278fe 66 #define UPAP_AUTHREQ 1 /* Authenticate-Request */
DieterGraef 0:f9b6112278fe 67 #define UPAP_AUTHACK 2 /* Authenticate-Ack */
DieterGraef 0:f9b6112278fe 68 #define UPAP_AUTHNAK 3 /* Authenticate-Nak */
DieterGraef 0:f9b6112278fe 69
DieterGraef 0:f9b6112278fe 70 /*
DieterGraef 0:f9b6112278fe 71 * Each interface is described by upap structure.
DieterGraef 0:f9b6112278fe 72 */
DieterGraef 0:f9b6112278fe 73 typedef struct upap_state {
DieterGraef 0:f9b6112278fe 74 int us_unit; /* Interface unit number */
DieterGraef 0:f9b6112278fe 75 const char *us_user; /* User */
DieterGraef 0:f9b6112278fe 76 int us_userlen; /* User length */
DieterGraef 0:f9b6112278fe 77 const char *us_passwd; /* Password */
DieterGraef 0:f9b6112278fe 78 int us_passwdlen; /* Password length */
DieterGraef 0:f9b6112278fe 79 int us_clientstate; /* Client state */
DieterGraef 0:f9b6112278fe 80 int us_serverstate; /* Server state */
DieterGraef 0:f9b6112278fe 81 u_char us_id; /* Current id */
DieterGraef 0:f9b6112278fe 82 int us_timeouttime; /* Timeout (seconds) for auth-req retrans. */
DieterGraef 0:f9b6112278fe 83 int us_transmits; /* Number of auth-reqs sent */
DieterGraef 0:f9b6112278fe 84 int us_maxtransmits; /* Maximum number of auth-reqs to send */
DieterGraef 0:f9b6112278fe 85 int us_reqtimeout; /* Time to wait for auth-req from peer */
DieterGraef 0:f9b6112278fe 86 } upap_state;
DieterGraef 0:f9b6112278fe 87
DieterGraef 0:f9b6112278fe 88 /*
DieterGraef 0:f9b6112278fe 89 * Client states.
DieterGraef 0:f9b6112278fe 90 */
DieterGraef 0:f9b6112278fe 91 #define UPAPCS_INITIAL 0 /* Connection down */
DieterGraef 0:f9b6112278fe 92 #define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */
DieterGraef 0:f9b6112278fe 93 #define UPAPCS_PENDING 2 /* Connection down, have requested auth */
DieterGraef 0:f9b6112278fe 94 #define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */
DieterGraef 0:f9b6112278fe 95 #define UPAPCS_OPEN 4 /* We've received an Ack */
DieterGraef 0:f9b6112278fe 96 #define UPAPCS_BADAUTH 5 /* We've received a Nak */
DieterGraef 0:f9b6112278fe 97
DieterGraef 0:f9b6112278fe 98 /*
DieterGraef 0:f9b6112278fe 99 * Server states.
DieterGraef 0:f9b6112278fe 100 */
DieterGraef 0:f9b6112278fe 101 #define UPAPSS_INITIAL 0 /* Connection down */
DieterGraef 0:f9b6112278fe 102 #define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */
DieterGraef 0:f9b6112278fe 103 #define UPAPSS_PENDING 2 /* Connection down, have requested auth */
DieterGraef 0:f9b6112278fe 104 #define UPAPSS_LISTEN 3 /* Listening for an Authenticate */
DieterGraef 0:f9b6112278fe 105 #define UPAPSS_OPEN 4 /* We've sent an Ack */
DieterGraef 0:f9b6112278fe 106 #define UPAPSS_BADAUTH 5 /* We've sent a Nak */
DieterGraef 0:f9b6112278fe 107
DieterGraef 0:f9b6112278fe 108
DieterGraef 0:f9b6112278fe 109 extern upap_state upap[];
DieterGraef 0:f9b6112278fe 110
DieterGraef 0:f9b6112278fe 111 void upap_authwithpeer (int, char *, char *);
DieterGraef 0:f9b6112278fe 112 void upap_authpeer (int);
DieterGraef 0:f9b6112278fe 113
DieterGraef 0:f9b6112278fe 114 extern struct protent pap_protent;
DieterGraef 0:f9b6112278fe 115
DieterGraef 0:f9b6112278fe 116 #endif /* PAP_SUPPORT */
DieterGraef 0:f9b6112278fe 117
DieterGraef 0:f9b6112278fe 118 #endif /* PAP_H */