HTTPClient using static IP

Dependencies:   mbed

Committer:
mr_q
Date:
Mon May 30 11:53:37 2011 +0000
Revision:
0:d8f2f7d5f31b
v0.01 Draft

Who changed what in which revision?

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