This library is stripped down version of NetServices library. HTTP server and client function is NOT supported.

Dependents:   imu-daq-eth

Committer:
idinor
Date:
Wed Jul 20 11:45:39 2011 +0000
Revision:
0:dcf3c92487ca

        

Who changed what in which revision?

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