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