Michiel Berckvens / Mbed 2 deprecated ProjectHTTP

Dependencies:   DS1307 TextLCD mbed

Committer:
Michielber
Date:
Thu Dec 04 10:36:40 2014 +0000
Revision:
0:f615d151a72c
Berckvens Michiel & Basteyns Jonas 4/12/2014

Who changed what in which revision?

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