EthernetNetIf

Dependents:   XBee_WiFi_EA_LPC4088

Committer:
hmike
Date:
Wed Nov 19 12:00:42 2014 +0000
Revision:
0:62580107d20c
EthernetNetIf

Who changed what in which revision?

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