Brandon Fictorie / Mbed 2 deprecated BF_Websocket

Dependencies:   mbed

Committer:
bfictorie
Date:
Sun Mar 25 17:26:30 2012 +0000
Revision:
0:8cdad1c73e8e

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bfictorie 0:8cdad1c73e8e 1 /*****************************************************************************
bfictorie 0:8cdad1c73e8e 2 * pap.h - PPP Password Authentication Protocol header file.
bfictorie 0:8cdad1c73e8e 3 *
bfictorie 0:8cdad1c73e8e 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
bfictorie 0:8cdad1c73e8e 5 * portions Copyright (c) 1997 Global Election Systems Inc.
bfictorie 0:8cdad1c73e8e 6 *
bfictorie 0:8cdad1c73e8e 7 * The authors hereby grant permission to use, copy, modify, distribute,
bfictorie 0:8cdad1c73e8e 8 * and license this software and its documentation for any purpose, provided
bfictorie 0:8cdad1c73e8e 9 * that existing copyright notices are retained in all copies and that this
bfictorie 0:8cdad1c73e8e 10 * notice and the following disclaimer are included verbatim in any
bfictorie 0:8cdad1c73e8e 11 * distributions. No written agreement, license, or royalty fee is required
bfictorie 0:8cdad1c73e8e 12 * for any of the authorized uses.
bfictorie 0:8cdad1c73e8e 13 *
bfictorie 0:8cdad1c73e8e 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
bfictorie 0:8cdad1c73e8e 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
bfictorie 0:8cdad1c73e8e 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
bfictorie 0:8cdad1c73e8e 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
bfictorie 0:8cdad1c73e8e 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
bfictorie 0:8cdad1c73e8e 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
bfictorie 0:8cdad1c73e8e 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
bfictorie 0:8cdad1c73e8e 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
bfictorie 0:8cdad1c73e8e 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
bfictorie 0:8cdad1c73e8e 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bfictorie 0:8cdad1c73e8e 24 *
bfictorie 0:8cdad1c73e8e 25 ******************************************************************************
bfictorie 0:8cdad1c73e8e 26 * REVISION HISTORY
bfictorie 0:8cdad1c73e8e 27 *
bfictorie 0:8cdad1c73e8e 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
bfictorie 0:8cdad1c73e8e 29 * Ported to lwIP.
bfictorie 0:8cdad1c73e8e 30 * 97-12-04 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
bfictorie 0:8cdad1c73e8e 31 * Original derived from BSD codes.
bfictorie 0:8cdad1c73e8e 32 *****************************************************************************/
bfictorie 0:8cdad1c73e8e 33 /*
bfictorie 0:8cdad1c73e8e 34 * upap.h - User/Password Authentication Protocol definitions.
bfictorie 0:8cdad1c73e8e 35 *
bfictorie 0:8cdad1c73e8e 36 * Copyright (c) 1989 Carnegie Mellon University.
bfictorie 0:8cdad1c73e8e 37 * All rights reserved.
bfictorie 0:8cdad1c73e8e 38 *
bfictorie 0:8cdad1c73e8e 39 * Redistribution and use in source and binary forms are permitted
bfictorie 0:8cdad1c73e8e 40 * provided that the above copyright notice and this paragraph are
bfictorie 0:8cdad1c73e8e 41 * duplicated in all such forms and that any documentation,
bfictorie 0:8cdad1c73e8e 42 * advertising materials, and other materials related to such
bfictorie 0:8cdad1c73e8e 43 * distribution and use acknowledge that the software was developed
bfictorie 0:8cdad1c73e8e 44 * by Carnegie Mellon University. The name of the
bfictorie 0:8cdad1c73e8e 45 * University may not be used to endorse or promote products derived
bfictorie 0:8cdad1c73e8e 46 * from this software without specific prior written permission.
bfictorie 0:8cdad1c73e8e 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
bfictorie 0:8cdad1c73e8e 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
bfictorie 0:8cdad1c73e8e 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
bfictorie 0:8cdad1c73e8e 50 */
bfictorie 0:8cdad1c73e8e 51
bfictorie 0:8cdad1c73e8e 52 #ifndef PAP_H
bfictorie 0:8cdad1c73e8e 53 #define PAP_H
bfictorie 0:8cdad1c73e8e 54
bfictorie 0:8cdad1c73e8e 55 #if PAP_SUPPORT /* don't build if not configured for use in lwipopts.h */
bfictorie 0:8cdad1c73e8e 56
bfictorie 0:8cdad1c73e8e 57 /*
bfictorie 0:8cdad1c73e8e 58 * Packet header = Code, id, length.
bfictorie 0:8cdad1c73e8e 59 */
bfictorie 0:8cdad1c73e8e 60 #define UPAP_HEADERLEN (sizeof (u_char) + sizeof (u_char) + sizeof (u_short))
bfictorie 0:8cdad1c73e8e 61
bfictorie 0:8cdad1c73e8e 62
bfictorie 0:8cdad1c73e8e 63 /*
bfictorie 0:8cdad1c73e8e 64 * UPAP codes.
bfictorie 0:8cdad1c73e8e 65 */
bfictorie 0:8cdad1c73e8e 66 #define UPAP_AUTHREQ 1 /* Authenticate-Request */
bfictorie 0:8cdad1c73e8e 67 #define UPAP_AUTHACK 2 /* Authenticate-Ack */
bfictorie 0:8cdad1c73e8e 68 #define UPAP_AUTHNAK 3 /* Authenticate-Nak */
bfictorie 0:8cdad1c73e8e 69
bfictorie 0:8cdad1c73e8e 70 /*
bfictorie 0:8cdad1c73e8e 71 * Each interface is described by upap structure.
bfictorie 0:8cdad1c73e8e 72 */
bfictorie 0:8cdad1c73e8e 73 typedef struct upap_state {
bfictorie 0:8cdad1c73e8e 74 int us_unit; /* Interface unit number */
bfictorie 0:8cdad1c73e8e 75 const char *us_user; /* User */
bfictorie 0:8cdad1c73e8e 76 int us_userlen; /* User length */
bfictorie 0:8cdad1c73e8e 77 const char *us_passwd; /* Password */
bfictorie 0:8cdad1c73e8e 78 int us_passwdlen; /* Password length */
bfictorie 0:8cdad1c73e8e 79 int us_clientstate; /* Client state */
bfictorie 0:8cdad1c73e8e 80 int us_serverstate; /* Server state */
bfictorie 0:8cdad1c73e8e 81 u_char us_id; /* Current id */
bfictorie 0:8cdad1c73e8e 82 int us_timeouttime; /* Timeout (seconds) for auth-req retrans. */
bfictorie 0:8cdad1c73e8e 83 int us_transmits; /* Number of auth-reqs sent */
bfictorie 0:8cdad1c73e8e 84 int us_maxtransmits; /* Maximum number of auth-reqs to send */
bfictorie 0:8cdad1c73e8e 85 int us_reqtimeout; /* Time to wait for auth-req from peer */
bfictorie 0:8cdad1c73e8e 86 } upap_state;
bfictorie 0:8cdad1c73e8e 87
bfictorie 0:8cdad1c73e8e 88 /*
bfictorie 0:8cdad1c73e8e 89 * Client states.
bfictorie 0:8cdad1c73e8e 90 */
bfictorie 0:8cdad1c73e8e 91 #define UPAPCS_INITIAL 0 /* Connection down */
bfictorie 0:8cdad1c73e8e 92 #define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */
bfictorie 0:8cdad1c73e8e 93 #define UPAPCS_PENDING 2 /* Connection down, have requested auth */
bfictorie 0:8cdad1c73e8e 94 #define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */
bfictorie 0:8cdad1c73e8e 95 #define UPAPCS_OPEN 4 /* We've received an Ack */
bfictorie 0:8cdad1c73e8e 96 #define UPAPCS_BADAUTH 5 /* We've received a Nak */
bfictorie 0:8cdad1c73e8e 97
bfictorie 0:8cdad1c73e8e 98 /*
bfictorie 0:8cdad1c73e8e 99 * Server states.
bfictorie 0:8cdad1c73e8e 100 */
bfictorie 0:8cdad1c73e8e 101 #define UPAPSS_INITIAL 0 /* Connection down */
bfictorie 0:8cdad1c73e8e 102 #define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */
bfictorie 0:8cdad1c73e8e 103 #define UPAPSS_PENDING 2 /* Connection down, have requested auth */
bfictorie 0:8cdad1c73e8e 104 #define UPAPSS_LISTEN 3 /* Listening for an Authenticate */
bfictorie 0:8cdad1c73e8e 105 #define UPAPSS_OPEN 4 /* We've sent an Ack */
bfictorie 0:8cdad1c73e8e 106 #define UPAPSS_BADAUTH 5 /* We've sent a Nak */
bfictorie 0:8cdad1c73e8e 107
bfictorie 0:8cdad1c73e8e 108
bfictorie 0:8cdad1c73e8e 109 extern upap_state upap[];
bfictorie 0:8cdad1c73e8e 110
bfictorie 0:8cdad1c73e8e 111 void upap_authwithpeer (int, char *, char *);
bfictorie 0:8cdad1c73e8e 112 void upap_authpeer (int);
bfictorie 0:8cdad1c73e8e 113
bfictorie 0:8cdad1c73e8e 114 extern struct protent pap_protent;
bfictorie 0:8cdad1c73e8e 115
bfictorie 0:8cdad1c73e8e 116 #endif /* PAP_SUPPORT */
bfictorie 0:8cdad1c73e8e 117
bfictorie 0:8cdad1c73e8e 118 #endif /* PAP_H */