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