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 * lcp.h - Network Link Control 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-11-05 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 * lcp.h - Link Control 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 * $Id: lcp.h,v 1.4 2010/01/18 20:49:43 goldsimon Exp $
mbedalvaro 31:5f039cbddee8 52 */
mbedalvaro 31:5f039cbddee8 53
mbedalvaro 31:5f039cbddee8 54 #ifndef LCP_H
mbedalvaro 31:5f039cbddee8 55 #define LCP_H
mbedalvaro 31:5f039cbddee8 56 /*
mbedalvaro 31:5f039cbddee8 57 * Options.
mbedalvaro 31:5f039cbddee8 58 */
mbedalvaro 31:5f039cbddee8 59 #define CI_MRU 1 /* Maximum Receive Unit */
mbedalvaro 31:5f039cbddee8 60 #define CI_ASYNCMAP 2 /* Async Control Character Map */
mbedalvaro 31:5f039cbddee8 61 #define CI_AUTHTYPE 3 /* Authentication Type */
mbedalvaro 31:5f039cbddee8 62 #define CI_QUALITY 4 /* Quality Protocol */
mbedalvaro 31:5f039cbddee8 63 #define CI_MAGICNUMBER 5 /* Magic Number */
mbedalvaro 31:5f039cbddee8 64 #define CI_PCOMPRESSION 7 /* Protocol Field Compression */
mbedalvaro 31:5f039cbddee8 65 #define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
mbedalvaro 31:5f039cbddee8 66 #define CI_CALLBACK 13 /* callback */
mbedalvaro 31:5f039cbddee8 67 #define CI_MRRU 17 /* max reconstructed receive unit; multilink */
mbedalvaro 31:5f039cbddee8 68 #define CI_SSNHF 18 /* short sequence numbers for multilink */
mbedalvaro 31:5f039cbddee8 69 #define CI_EPDISC 19 /* endpoint discriminator */
mbedalvaro 31:5f039cbddee8 70
mbedalvaro 31:5f039cbddee8 71 /*
mbedalvaro 31:5f039cbddee8 72 * LCP-specific packet types (code numbers).
mbedalvaro 31:5f039cbddee8 73 */
mbedalvaro 31:5f039cbddee8 74 #define PROTREJ 8 /* Protocol Reject */
mbedalvaro 31:5f039cbddee8 75 #define ECHOREQ 9 /* Echo Request */
mbedalvaro 31:5f039cbddee8 76 #define ECHOREP 10 /* Echo Reply */
mbedalvaro 31:5f039cbddee8 77 #define DISCREQ 11 /* Discard Request */
mbedalvaro 31:5f039cbddee8 78 #define CBCP_OPT 6 /* Use callback control protocol */
mbedalvaro 31:5f039cbddee8 79
mbedalvaro 31:5f039cbddee8 80 /*
mbedalvaro 31:5f039cbddee8 81 * The state of options is described by an lcp_options structure.
mbedalvaro 31:5f039cbddee8 82 */
mbedalvaro 31:5f039cbddee8 83 typedef struct lcp_options {
mbedalvaro 31:5f039cbddee8 84 u_int passive : 1; /* Don't die if we don't get a response */
mbedalvaro 31:5f039cbddee8 85 u_int silent : 1; /* Wait for the other end to start first */
mbedalvaro 31:5f039cbddee8 86 u_int restart : 1; /* Restart vs. exit after close */
mbedalvaro 31:5f039cbddee8 87 u_int neg_mru : 1; /* Negotiate the MRU? */
mbedalvaro 31:5f039cbddee8 88 u_int neg_asyncmap : 1; /* Negotiate the async map? */
mbedalvaro 31:5f039cbddee8 89 u_int neg_upap : 1; /* Ask for UPAP authentication? */
mbedalvaro 31:5f039cbddee8 90 u_int neg_chap : 1; /* Ask for CHAP authentication? */
mbedalvaro 31:5f039cbddee8 91 u_int neg_magicnumber : 1; /* Ask for magic number? */
mbedalvaro 31:5f039cbddee8 92 u_int neg_pcompression : 1; /* HDLC Protocol Field Compression? */
mbedalvaro 31:5f039cbddee8 93 u_int neg_accompression : 1; /* HDLC Address/Control Field Compression? */
mbedalvaro 31:5f039cbddee8 94 u_int neg_lqr : 1; /* Negotiate use of Link Quality Reports */
mbedalvaro 31:5f039cbddee8 95 u_int neg_cbcp : 1; /* Negotiate use of CBCP */
mbedalvaro 31:5f039cbddee8 96 #ifdef PPP_MULTILINK
mbedalvaro 31:5f039cbddee8 97 u_int neg_mrru : 1; /* Negotiate multilink MRRU */
mbedalvaro 31:5f039cbddee8 98 u_int neg_ssnhf : 1; /* Negotiate short sequence numbers */
mbedalvaro 31:5f039cbddee8 99 u_int neg_endpoint : 1; /* Negotiate endpoint discriminator */
mbedalvaro 31:5f039cbddee8 100 #endif
mbedalvaro 31:5f039cbddee8 101 u_short mru; /* Value of MRU */
mbedalvaro 31:5f039cbddee8 102 #ifdef PPP_MULTILINK
mbedalvaro 31:5f039cbddee8 103 u_short mrru; /* Value of MRRU, and multilink enable */
mbedalvaro 31:5f039cbddee8 104 #endif
mbedalvaro 31:5f039cbddee8 105 u_char chap_mdtype; /* which MD type (hashing algorithm) */
mbedalvaro 31:5f039cbddee8 106 u32_t asyncmap; /* Value of async map */
mbedalvaro 31:5f039cbddee8 107 u32_t magicnumber;
mbedalvaro 31:5f039cbddee8 108 int numloops; /* Number of loops during magic number neg. */
mbedalvaro 31:5f039cbddee8 109 u32_t lqr_period; /* Reporting period for LQR 1/100ths second */
mbedalvaro 31:5f039cbddee8 110 #ifdef PPP_MULTILINK
mbedalvaro 31:5f039cbddee8 111 struct epdisc endpoint; /* endpoint discriminator */
mbedalvaro 31:5f039cbddee8 112 #endif
mbedalvaro 31:5f039cbddee8 113 } lcp_options;
mbedalvaro 31:5f039cbddee8 114
mbedalvaro 31:5f039cbddee8 115 /*
mbedalvaro 31:5f039cbddee8 116 * Values for phase from BSD pppd.h based on RFC 1661.
mbedalvaro 31:5f039cbddee8 117 */
mbedalvaro 31:5f039cbddee8 118 typedef enum {
mbedalvaro 31:5f039cbddee8 119 PHASE_DEAD = 0,
mbedalvaro 31:5f039cbddee8 120 PHASE_INITIALIZE,
mbedalvaro 31:5f039cbddee8 121 PHASE_ESTABLISH,
mbedalvaro 31:5f039cbddee8 122 PHASE_AUTHENTICATE,
mbedalvaro 31:5f039cbddee8 123 PHASE_CALLBACK,
mbedalvaro 31:5f039cbddee8 124 PHASE_NETWORK,
mbedalvaro 31:5f039cbddee8 125 PHASE_TERMINATE
mbedalvaro 31:5f039cbddee8 126 } LinkPhase;
mbedalvaro 31:5f039cbddee8 127
mbedalvaro 31:5f039cbddee8 128
mbedalvaro 31:5f039cbddee8 129
mbedalvaro 31:5f039cbddee8 130 extern LinkPhase lcp_phase[NUM_PPP]; /* Phase of link session (RFC 1661) */
mbedalvaro 31:5f039cbddee8 131 extern lcp_options lcp_wantoptions[];
mbedalvaro 31:5f039cbddee8 132 extern lcp_options lcp_gotoptions[];
mbedalvaro 31:5f039cbddee8 133 extern lcp_options lcp_allowoptions[];
mbedalvaro 31:5f039cbddee8 134 extern lcp_options lcp_hisoptions[];
mbedalvaro 31:5f039cbddee8 135 extern ext_accm xmit_accm[];
mbedalvaro 31:5f039cbddee8 136
mbedalvaro 31:5f039cbddee8 137
mbedalvaro 31:5f039cbddee8 138 void lcp_init (int);
mbedalvaro 31:5f039cbddee8 139 void lcp_open (int);
mbedalvaro 31:5f039cbddee8 140 void lcp_close (int, char *);
mbedalvaro 31:5f039cbddee8 141 void lcp_lowerup (int);
mbedalvaro 31:5f039cbddee8 142 void lcp_lowerdown(int);
mbedalvaro 31:5f039cbddee8 143 void lcp_sprotrej (int, u_char *, int); /* send protocol reject */
mbedalvaro 31:5f039cbddee8 144
mbedalvaro 31:5f039cbddee8 145 extern struct protent lcp_protent;
mbedalvaro 31:5f039cbddee8 146
mbedalvaro 31:5f039cbddee8 147 /* Default number of times we receive our magic number from the peer
mbedalvaro 31:5f039cbddee8 148 before deciding the link is looped-back. */
mbedalvaro 31:5f039cbddee8 149 #define DEFLOOPBACKFAIL 10
mbedalvaro 31:5f039cbddee8 150
mbedalvaro 31:5f039cbddee8 151 #endif /* LCP_H */