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 * lcp.h - Network Link Control 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-11-05 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 * lcp.h - Link Control 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 * $Id: lcp.h,v 1.4 2010/01/18 20:49:43 goldsimon Exp $
igorsk 0:b56b6a05cad4 52 */
igorsk 0:b56b6a05cad4 53
igorsk 0:b56b6a05cad4 54 #ifndef LCP_H
igorsk 0:b56b6a05cad4 55 #define LCP_H
igorsk 0:b56b6a05cad4 56 /*
igorsk 0:b56b6a05cad4 57 * Options.
igorsk 0:b56b6a05cad4 58 */
igorsk 0:b56b6a05cad4 59 #define CI_MRU 1 /* Maximum Receive Unit */
igorsk 0:b56b6a05cad4 60 #define CI_ASYNCMAP 2 /* Async Control Character Map */
igorsk 0:b56b6a05cad4 61 #define CI_AUTHTYPE 3 /* Authentication Type */
igorsk 0:b56b6a05cad4 62 #define CI_QUALITY 4 /* Quality Protocol */
igorsk 0:b56b6a05cad4 63 #define CI_MAGICNUMBER 5 /* Magic Number */
igorsk 0:b56b6a05cad4 64 #define CI_PCOMPRESSION 7 /* Protocol Field Compression */
igorsk 0:b56b6a05cad4 65 #define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
igorsk 0:b56b6a05cad4 66 #define CI_CALLBACK 13 /* callback */
igorsk 0:b56b6a05cad4 67 #define CI_MRRU 17 /* max reconstructed receive unit; multilink */
igorsk 0:b56b6a05cad4 68 #define CI_SSNHF 18 /* short sequence numbers for multilink */
igorsk 0:b56b6a05cad4 69 #define CI_EPDISC 19 /* endpoint discriminator */
igorsk 0:b56b6a05cad4 70
igorsk 0:b56b6a05cad4 71 /*
igorsk 0:b56b6a05cad4 72 * LCP-specific packet types (code numbers).
igorsk 0:b56b6a05cad4 73 */
igorsk 0:b56b6a05cad4 74 #define PROTREJ 8 /* Protocol Reject */
igorsk 0:b56b6a05cad4 75 #define ECHOREQ 9 /* Echo Request */
igorsk 0:b56b6a05cad4 76 #define ECHOREP 10 /* Echo Reply */
igorsk 0:b56b6a05cad4 77 #define DISCREQ 11 /* Discard Request */
igorsk 0:b56b6a05cad4 78 #define CBCP_OPT 6 /* Use callback control protocol */
igorsk 0:b56b6a05cad4 79
igorsk 0:b56b6a05cad4 80 /*
igorsk 0:b56b6a05cad4 81 * The state of options is described by an lcp_options structure.
igorsk 0:b56b6a05cad4 82 */
igorsk 0:b56b6a05cad4 83 typedef struct lcp_options {
igorsk 0:b56b6a05cad4 84 u_int passive : 1; /* Don't die if we don't get a response */
igorsk 0:b56b6a05cad4 85 u_int silent : 1; /* Wait for the other end to start first */
igorsk 0:b56b6a05cad4 86 u_int restart : 1; /* Restart vs. exit after close */
igorsk 0:b56b6a05cad4 87 u_int neg_mru : 1; /* Negotiate the MRU? */
igorsk 0:b56b6a05cad4 88 u_int neg_asyncmap : 1; /* Negotiate the async map? */
igorsk 0:b56b6a05cad4 89 u_int neg_upap : 1; /* Ask for UPAP authentication? */
igorsk 0:b56b6a05cad4 90 u_int neg_chap : 1; /* Ask for CHAP authentication? */
igorsk 0:b56b6a05cad4 91 u_int neg_magicnumber : 1; /* Ask for magic number? */
igorsk 0:b56b6a05cad4 92 u_int neg_pcompression : 1; /* HDLC Protocol Field Compression? */
igorsk 0:b56b6a05cad4 93 u_int neg_accompression : 1; /* HDLC Address/Control Field Compression? */
igorsk 0:b56b6a05cad4 94 u_int neg_lqr : 1; /* Negotiate use of Link Quality Reports */
igorsk 0:b56b6a05cad4 95 u_int neg_cbcp : 1; /* Negotiate use of CBCP */
igorsk 0:b56b6a05cad4 96 #ifdef PPP_MULTILINK
igorsk 0:b56b6a05cad4 97 u_int neg_mrru : 1; /* Negotiate multilink MRRU */
igorsk 0:b56b6a05cad4 98 u_int neg_ssnhf : 1; /* Negotiate short sequence numbers */
igorsk 0:b56b6a05cad4 99 u_int neg_endpoint : 1; /* Negotiate endpoint discriminator */
igorsk 0:b56b6a05cad4 100 #endif
igorsk 0:b56b6a05cad4 101 u_short mru; /* Value of MRU */
igorsk 0:b56b6a05cad4 102 #ifdef PPP_MULTILINK
igorsk 0:b56b6a05cad4 103 u_short mrru; /* Value of MRRU, and multilink enable */
igorsk 0:b56b6a05cad4 104 #endif
igorsk 0:b56b6a05cad4 105 u_char chap_mdtype; /* which MD type (hashing algorithm) */
igorsk 0:b56b6a05cad4 106 u32_t asyncmap; /* Value of async map */
igorsk 0:b56b6a05cad4 107 u32_t magicnumber;
igorsk 0:b56b6a05cad4 108 int numloops; /* Number of loops during magic number neg. */
igorsk 0:b56b6a05cad4 109 u32_t lqr_period; /* Reporting period for LQR 1/100ths second */
igorsk 0:b56b6a05cad4 110 #ifdef PPP_MULTILINK
igorsk 0:b56b6a05cad4 111 struct epdisc endpoint; /* endpoint discriminator */
igorsk 0:b56b6a05cad4 112 #endif
igorsk 0:b56b6a05cad4 113 } lcp_options;
igorsk 0:b56b6a05cad4 114
igorsk 0:b56b6a05cad4 115 /*
igorsk 0:b56b6a05cad4 116 * Values for phase from BSD pppd.h based on RFC 1661.
igorsk 0:b56b6a05cad4 117 */
igorsk 0:b56b6a05cad4 118 typedef enum {
igorsk 0:b56b6a05cad4 119 PHASE_DEAD = 0,
igorsk 0:b56b6a05cad4 120 PHASE_INITIALIZE,
igorsk 0:b56b6a05cad4 121 PHASE_ESTABLISH,
igorsk 0:b56b6a05cad4 122 PHASE_AUTHENTICATE,
igorsk 0:b56b6a05cad4 123 PHASE_CALLBACK,
igorsk 0:b56b6a05cad4 124 PHASE_NETWORK,
igorsk 0:b56b6a05cad4 125 PHASE_TERMINATE
igorsk 0:b56b6a05cad4 126 } LinkPhase;
igorsk 0:b56b6a05cad4 127
igorsk 0:b56b6a05cad4 128
igorsk 0:b56b6a05cad4 129
igorsk 0:b56b6a05cad4 130 extern LinkPhase lcp_phase[NUM_PPP]; /* Phase of link session (RFC 1661) */
igorsk 0:b56b6a05cad4 131 extern lcp_options lcp_wantoptions[];
igorsk 0:b56b6a05cad4 132 extern lcp_options lcp_gotoptions[];
igorsk 0:b56b6a05cad4 133 extern lcp_options lcp_allowoptions[];
igorsk 0:b56b6a05cad4 134 extern lcp_options lcp_hisoptions[];
igorsk 0:b56b6a05cad4 135 extern ext_accm xmit_accm[];
igorsk 0:b56b6a05cad4 136
igorsk 0:b56b6a05cad4 137
igorsk 0:b56b6a05cad4 138 void lcp_init (int);
igorsk 0:b56b6a05cad4 139 void lcp_open (int);
igorsk 0:b56b6a05cad4 140 void lcp_close (int, char *);
igorsk 0:b56b6a05cad4 141 void lcp_lowerup (int);
igorsk 0:b56b6a05cad4 142 void lcp_lowerdown(int);
igorsk 0:b56b6a05cad4 143 void lcp_sprotrej (int, u_char *, int); /* send protocol reject */
igorsk 0:b56b6a05cad4 144
igorsk 0:b56b6a05cad4 145 extern struct protent lcp_protent;
igorsk 0:b56b6a05cad4 146
igorsk 0:b56b6a05cad4 147 /* Default number of times we receive our magic number from the peer
igorsk 0:b56b6a05cad4 148 before deciding the link is looped-back. */
igorsk 0:b56b6a05cad4 149 #define DEFLOOPBACKFAIL 10
igorsk 0:b56b6a05cad4 150
igorsk 0:b56b6a05cad4 151 #endif /* LCP_H */