Dependents:   RTnoV3 RTnoV3_LED RTnoV3_Template RTnoV3_ADC ... more

Committer:
sherckuith
Date:
Sat Dec 31 11:25:27 2011 +0000
Revision:
0:479ce5546098
Ethernet

Who changed what in which revision?

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