Trial code integration web page update with analogue data and ntp support

Dependencies:   NTPClient_NetServices mbed

Committer:
pmr1
Date:
Fri Aug 06 17:57:45 2010 +0000
Revision:
0:8cc2035bebfc

        

Who changed what in which revision?

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