Netservices modded to read fragmented HTTP respsonse/payload from special purpose server - 180 bytes only

Committer:
RodColeman
Date:
Thu Sep 08 10:41:36 2011 +0000
Revision:
0:8f5825f330b0
setDataLen hacked to 180bytes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RodColeman 0:8f5825f330b0 1 /*****************************************************************************
RodColeman 0:8f5825f330b0 2 * lcp.h - Network Link Control Protocol header file.
RodColeman 0:8f5825f330b0 3 *
RodColeman 0:8f5825f330b0 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
RodColeman 0:8f5825f330b0 5 * portions Copyright (c) 1997 Global Election Systems Inc.
RodColeman 0:8f5825f330b0 6 *
RodColeman 0:8f5825f330b0 7 * The authors hereby grant permission to use, copy, modify, distribute,
RodColeman 0:8f5825f330b0 8 * and license this software and its documentation for any purpose, provided
RodColeman 0:8f5825f330b0 9 * that existing copyright notices are retained in all copies and that this
RodColeman 0:8f5825f330b0 10 * notice and the following disclaimer are included verbatim in any
RodColeman 0:8f5825f330b0 11 * distributions. No written agreement, license, or royalty fee is required
RodColeman 0:8f5825f330b0 12 * for any of the authorized uses.
RodColeman 0:8f5825f330b0 13 *
RodColeman 0:8f5825f330b0 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
RodColeman 0:8f5825f330b0 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
RodColeman 0:8f5825f330b0 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
RodColeman 0:8f5825f330b0 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
RodColeman 0:8f5825f330b0 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
RodColeman 0:8f5825f330b0 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
RodColeman 0:8f5825f330b0 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
RodColeman 0:8f5825f330b0 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
RodColeman 0:8f5825f330b0 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
RodColeman 0:8f5825f330b0 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
RodColeman 0:8f5825f330b0 24 *
RodColeman 0:8f5825f330b0 25 ******************************************************************************
RodColeman 0:8f5825f330b0 26 * REVISION HISTORY
RodColeman 0:8f5825f330b0 27 *
RodColeman 0:8f5825f330b0 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
RodColeman 0:8f5825f330b0 29 * Ported to lwIP.
RodColeman 0:8f5825f330b0 30 * 97-11-05 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
RodColeman 0:8f5825f330b0 31 * Original derived from BSD codes.
RodColeman 0:8f5825f330b0 32 *****************************************************************************/
RodColeman 0:8f5825f330b0 33 /*
RodColeman 0:8f5825f330b0 34 * lcp.h - Link Control Protocol definitions.
RodColeman 0:8f5825f330b0 35 *
RodColeman 0:8f5825f330b0 36 * Copyright (c) 1989 Carnegie Mellon University.
RodColeman 0:8f5825f330b0 37 * All rights reserved.
RodColeman 0:8f5825f330b0 38 *
RodColeman 0:8f5825f330b0 39 * Redistribution and use in source and binary forms are permitted
RodColeman 0:8f5825f330b0 40 * provided that the above copyright notice and this paragraph are
RodColeman 0:8f5825f330b0 41 * duplicated in all such forms and that any documentation,
RodColeman 0:8f5825f330b0 42 * advertising materials, and other materials related to such
RodColeman 0:8f5825f330b0 43 * distribution and use acknowledge that the software was developed
RodColeman 0:8f5825f330b0 44 * by Carnegie Mellon University. The name of the
RodColeman 0:8f5825f330b0 45 * University may not be used to endorse or promote products derived
RodColeman 0:8f5825f330b0 46 * from this software without specific prior written permission.
RodColeman 0:8f5825f330b0 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
RodColeman 0:8f5825f330b0 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
RodColeman 0:8f5825f330b0 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
RodColeman 0:8f5825f330b0 50 *
RodColeman 0:8f5825f330b0 51 * $Id: lcp.h,v 1.4 2010/01/18 20:49:43 goldsimon Exp $
RodColeman 0:8f5825f330b0 52 */
RodColeman 0:8f5825f330b0 53
RodColeman 0:8f5825f330b0 54 #ifndef LCP_H
RodColeman 0:8f5825f330b0 55 #define LCP_H
RodColeman 0:8f5825f330b0 56 /*
RodColeman 0:8f5825f330b0 57 * Options.
RodColeman 0:8f5825f330b0 58 */
RodColeman 0:8f5825f330b0 59 #define CI_MRU 1 /* Maximum Receive Unit */
RodColeman 0:8f5825f330b0 60 #define CI_ASYNCMAP 2 /* Async Control Character Map */
RodColeman 0:8f5825f330b0 61 #define CI_AUTHTYPE 3 /* Authentication Type */
RodColeman 0:8f5825f330b0 62 #define CI_QUALITY 4 /* Quality Protocol */
RodColeman 0:8f5825f330b0 63 #define CI_MAGICNUMBER 5 /* Magic Number */
RodColeman 0:8f5825f330b0 64 #define CI_PCOMPRESSION 7 /* Protocol Field Compression */
RodColeman 0:8f5825f330b0 65 #define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
RodColeman 0:8f5825f330b0 66 #define CI_CALLBACK 13 /* callback */
RodColeman 0:8f5825f330b0 67 #define CI_MRRU 17 /* max reconstructed receive unit; multilink */
RodColeman 0:8f5825f330b0 68 #define CI_SSNHF 18 /* short sequence numbers for multilink */
RodColeman 0:8f5825f330b0 69 #define CI_EPDISC 19 /* endpoint discriminator */
RodColeman 0:8f5825f330b0 70
RodColeman 0:8f5825f330b0 71 /*
RodColeman 0:8f5825f330b0 72 * LCP-specific packet types (code numbers).
RodColeman 0:8f5825f330b0 73 */
RodColeman 0:8f5825f330b0 74 #define PROTREJ 8 /* Protocol Reject */
RodColeman 0:8f5825f330b0 75 #define ECHOREQ 9 /* Echo Request */
RodColeman 0:8f5825f330b0 76 #define ECHOREP 10 /* Echo Reply */
RodColeman 0:8f5825f330b0 77 #define DISCREQ 11 /* Discard Request */
RodColeman 0:8f5825f330b0 78 #define CBCP_OPT 6 /* Use callback control protocol */
RodColeman 0:8f5825f330b0 79
RodColeman 0:8f5825f330b0 80 /*
RodColeman 0:8f5825f330b0 81 * The state of options is described by an lcp_options structure.
RodColeman 0:8f5825f330b0 82 */
RodColeman 0:8f5825f330b0 83 typedef struct lcp_options {
RodColeman 0:8f5825f330b0 84 u_int passive : 1; /* Don't die if we don't get a response */
RodColeman 0:8f5825f330b0 85 u_int silent : 1; /* Wait for the other end to start first */
RodColeman 0:8f5825f330b0 86 u_int restart : 1; /* Restart vs. exit after close */
RodColeman 0:8f5825f330b0 87 u_int neg_mru : 1; /* Negotiate the MRU? */
RodColeman 0:8f5825f330b0 88 u_int neg_asyncmap : 1; /* Negotiate the async map? */
RodColeman 0:8f5825f330b0 89 u_int neg_upap : 1; /* Ask for UPAP authentication? */
RodColeman 0:8f5825f330b0 90 u_int neg_chap : 1; /* Ask for CHAP authentication? */
RodColeman 0:8f5825f330b0 91 u_int neg_magicnumber : 1; /* Ask for magic number? */
RodColeman 0:8f5825f330b0 92 u_int neg_pcompression : 1; /* HDLC Protocol Field Compression? */
RodColeman 0:8f5825f330b0 93 u_int neg_accompression : 1; /* HDLC Address/Control Field Compression? */
RodColeman 0:8f5825f330b0 94 u_int neg_lqr : 1; /* Negotiate use of Link Quality Reports */
RodColeman 0:8f5825f330b0 95 u_int neg_cbcp : 1; /* Negotiate use of CBCP */
RodColeman 0:8f5825f330b0 96 #ifdef PPP_MULTILINK
RodColeman 0:8f5825f330b0 97 u_int neg_mrru : 1; /* Negotiate multilink MRRU */
RodColeman 0:8f5825f330b0 98 u_int neg_ssnhf : 1; /* Negotiate short sequence numbers */
RodColeman 0:8f5825f330b0 99 u_int neg_endpoint : 1; /* Negotiate endpoint discriminator */
RodColeman 0:8f5825f330b0 100 #endif
RodColeman 0:8f5825f330b0 101 u_short mru; /* Value of MRU */
RodColeman 0:8f5825f330b0 102 #ifdef PPP_MULTILINK
RodColeman 0:8f5825f330b0 103 u_short mrru; /* Value of MRRU, and multilink enable */
RodColeman 0:8f5825f330b0 104 #endif
RodColeman 0:8f5825f330b0 105 u_char chap_mdtype; /* which MD type (hashing algorithm) */
RodColeman 0:8f5825f330b0 106 u32_t asyncmap; /* Value of async map */
RodColeman 0:8f5825f330b0 107 u32_t magicnumber;
RodColeman 0:8f5825f330b0 108 int numloops; /* Number of loops during magic number neg. */
RodColeman 0:8f5825f330b0 109 u32_t lqr_period; /* Reporting period for LQR 1/100ths second */
RodColeman 0:8f5825f330b0 110 #ifdef PPP_MULTILINK
RodColeman 0:8f5825f330b0 111 struct epdisc endpoint; /* endpoint discriminator */
RodColeman 0:8f5825f330b0 112 #endif
RodColeman 0:8f5825f330b0 113 } lcp_options;
RodColeman 0:8f5825f330b0 114
RodColeman 0:8f5825f330b0 115 /*
RodColeman 0:8f5825f330b0 116 * Values for phase from BSD pppd.h based on RFC 1661.
RodColeman 0:8f5825f330b0 117 */
RodColeman 0:8f5825f330b0 118 typedef enum {
RodColeman 0:8f5825f330b0 119 PHASE_DEAD = 0,
RodColeman 0:8f5825f330b0 120 PHASE_INITIALIZE,
RodColeman 0:8f5825f330b0 121 PHASE_ESTABLISH,
RodColeman 0:8f5825f330b0 122 PHASE_AUTHENTICATE,
RodColeman 0:8f5825f330b0 123 PHASE_CALLBACK,
RodColeman 0:8f5825f330b0 124 PHASE_NETWORK,
RodColeman 0:8f5825f330b0 125 PHASE_TERMINATE
RodColeman 0:8f5825f330b0 126 } LinkPhase;
RodColeman 0:8f5825f330b0 127
RodColeman 0:8f5825f330b0 128
RodColeman 0:8f5825f330b0 129
RodColeman 0:8f5825f330b0 130 extern LinkPhase lcp_phase[NUM_PPP]; /* Phase of link session (RFC 1661) */
RodColeman 0:8f5825f330b0 131 extern lcp_options lcp_wantoptions[];
RodColeman 0:8f5825f330b0 132 extern lcp_options lcp_gotoptions[];
RodColeman 0:8f5825f330b0 133 extern lcp_options lcp_allowoptions[];
RodColeman 0:8f5825f330b0 134 extern lcp_options lcp_hisoptions[];
RodColeman 0:8f5825f330b0 135 extern ext_accm xmit_accm[];
RodColeman 0:8f5825f330b0 136
RodColeman 0:8f5825f330b0 137
RodColeman 0:8f5825f330b0 138 void lcp_init (int);
RodColeman 0:8f5825f330b0 139 void lcp_open (int);
RodColeman 0:8f5825f330b0 140 void lcp_close (int, char *);
RodColeman 0:8f5825f330b0 141 void lcp_lowerup (int);
RodColeman 0:8f5825f330b0 142 void lcp_lowerdown(int);
RodColeman 0:8f5825f330b0 143 void lcp_sprotrej (int, u_char *, int); /* send protocol reject */
RodColeman 0:8f5825f330b0 144
RodColeman 0:8f5825f330b0 145 extern struct protent lcp_protent;
RodColeman 0:8f5825f330b0 146
RodColeman 0:8f5825f330b0 147 /* Default number of times we receive our magic number from the peer
RodColeman 0:8f5825f330b0 148 before deciding the link is looped-back. */
RodColeman 0:8f5825f330b0 149 #define DEFLOOPBACKFAIL 10
RodColeman 0:8f5825f330b0 150
RodColeman 0:8f5825f330b0 151 #endif /* LCP_H */