First step: AutoIP compiled in and working

Dependencies:   mbed

Committer:
darran
Date:
Fri Jun 18 09:11:35 2010 +0000
Revision:
0:55a05330f8cc

        

Who changed what in which revision?

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