Dependencies:   FatFileSystem mbed WeatherMeters SDFileSystem

Committer:
dcoban
Date:
Tue Apr 03 18:43:13 2012 +0000
Revision:
0:1a61c61d0845

        

Who changed what in which revision?

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