Measure system

Dependencies:   EthernetNetIf mbed RF12B

Committer:
benecsj
Date:
Thu Mar 10 19:56:45 2011 +0000
Revision:
1:b26ab2467b1a

        

Who changed what in which revision?

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