testing of combination of LCS and LAN

Dependencies:   mbed

Committer:
damir
Date:
Wed Jan 14 13:29:55 2015 +0000
Revision:
0:a7a6a692162f
Test of LAN

Who changed what in which revision?

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