LineLedControl

Dependencies:   LPD8806 mbed

Fork of LPD8806_Test by Jelmer Tiete

Committer:
sfjmt
Date:
Mon Aug 19 12:14:37 2013 +0000
Revision:
3:b0a1b4b24d3c
LPD8806 control

Who changed what in which revision?

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