Laser Sensing Display for UI interfaces in the real world

Dependencies:   mbed

Fork of skinGames_forktest by Alvaro Cassinelli

Committer:
mbedalvaro
Date:
Thu Apr 17 08:04:14 2014 +0000
Revision:
47:199042980678
Parent:
31:5f039cbddee8
publishing for sharing with Ken Iwasaki

Who changed what in which revision?

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