Leest de waarde van een sensor binnen een maakt deze beschikbaar via internet

Dependencies:   NTPClient_NetServices mbed

Committer:
hendrikvincent
Date:
Mon Dec 02 09:01:23 2013 +0000
Revision:
0:05ccbd4f84f1
eerste programma;

Who changed what in which revision?

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