Experimental HTTPClient with proxy support

Committer:
igorsk
Date:
Wed Jun 29 16:01:58 2011 +0000
Revision:
0:b56b6a05cad4

        

Who changed what in which revision?

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