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 * pap.h - PPP Password Authentication 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-12-04 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 * upap.h - User/Password Authentication 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
RodColeman 0:8f5825f330b0 52 #ifndef PAP_H
RodColeman 0:8f5825f330b0 53 #define PAP_H
RodColeman 0:8f5825f330b0 54
RodColeman 0:8f5825f330b0 55 #if PAP_SUPPORT /* don't build if not configured for use in lwipopts.h */
RodColeman 0:8f5825f330b0 56
RodColeman 0:8f5825f330b0 57 /*
RodColeman 0:8f5825f330b0 58 * Packet header = Code, id, length.
RodColeman 0:8f5825f330b0 59 */
RodColeman 0:8f5825f330b0 60 #define UPAP_HEADERLEN (sizeof (u_char) + sizeof (u_char) + sizeof (u_short))
RodColeman 0:8f5825f330b0 61
RodColeman 0:8f5825f330b0 62
RodColeman 0:8f5825f330b0 63 /*
RodColeman 0:8f5825f330b0 64 * UPAP codes.
RodColeman 0:8f5825f330b0 65 */
RodColeman 0:8f5825f330b0 66 #define UPAP_AUTHREQ 1 /* Authenticate-Request */
RodColeman 0:8f5825f330b0 67 #define UPAP_AUTHACK 2 /* Authenticate-Ack */
RodColeman 0:8f5825f330b0 68 #define UPAP_AUTHNAK 3 /* Authenticate-Nak */
RodColeman 0:8f5825f330b0 69
RodColeman 0:8f5825f330b0 70 /*
RodColeman 0:8f5825f330b0 71 * Each interface is described by upap structure.
RodColeman 0:8f5825f330b0 72 */
RodColeman 0:8f5825f330b0 73 typedef struct upap_state {
RodColeman 0:8f5825f330b0 74 int us_unit; /* Interface unit number */
RodColeman 0:8f5825f330b0 75 const char *us_user; /* User */
RodColeman 0:8f5825f330b0 76 int us_userlen; /* User length */
RodColeman 0:8f5825f330b0 77 const char *us_passwd; /* Password */
RodColeman 0:8f5825f330b0 78 int us_passwdlen; /* Password length */
RodColeman 0:8f5825f330b0 79 int us_clientstate; /* Client state */
RodColeman 0:8f5825f330b0 80 int us_serverstate; /* Server state */
RodColeman 0:8f5825f330b0 81 u_char us_id; /* Current id */
RodColeman 0:8f5825f330b0 82 int us_timeouttime; /* Timeout (seconds) for auth-req retrans. */
RodColeman 0:8f5825f330b0 83 int us_transmits; /* Number of auth-reqs sent */
RodColeman 0:8f5825f330b0 84 int us_maxtransmits; /* Maximum number of auth-reqs to send */
RodColeman 0:8f5825f330b0 85 int us_reqtimeout; /* Time to wait for auth-req from peer */
RodColeman 0:8f5825f330b0 86 } upap_state;
RodColeman 0:8f5825f330b0 87
RodColeman 0:8f5825f330b0 88 /*
RodColeman 0:8f5825f330b0 89 * Client states.
RodColeman 0:8f5825f330b0 90 */
RodColeman 0:8f5825f330b0 91 #define UPAPCS_INITIAL 0 /* Connection down */
RodColeman 0:8f5825f330b0 92 #define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */
RodColeman 0:8f5825f330b0 93 #define UPAPCS_PENDING 2 /* Connection down, have requested auth */
RodColeman 0:8f5825f330b0 94 #define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */
RodColeman 0:8f5825f330b0 95 #define UPAPCS_OPEN 4 /* We've received an Ack */
RodColeman 0:8f5825f330b0 96 #define UPAPCS_BADAUTH 5 /* We've received a Nak */
RodColeman 0:8f5825f330b0 97
RodColeman 0:8f5825f330b0 98 /*
RodColeman 0:8f5825f330b0 99 * Server states.
RodColeman 0:8f5825f330b0 100 */
RodColeman 0:8f5825f330b0 101 #define UPAPSS_INITIAL 0 /* Connection down */
RodColeman 0:8f5825f330b0 102 #define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */
RodColeman 0:8f5825f330b0 103 #define UPAPSS_PENDING 2 /* Connection down, have requested auth */
RodColeman 0:8f5825f330b0 104 #define UPAPSS_LISTEN 3 /* Listening for an Authenticate */
RodColeman 0:8f5825f330b0 105 #define UPAPSS_OPEN 4 /* We've sent an Ack */
RodColeman 0:8f5825f330b0 106 #define UPAPSS_BADAUTH 5 /* We've sent a Nak */
RodColeman 0:8f5825f330b0 107
RodColeman 0:8f5825f330b0 108
RodColeman 0:8f5825f330b0 109 extern upap_state upap[];
RodColeman 0:8f5825f330b0 110
RodColeman 0:8f5825f330b0 111 void upap_authwithpeer (int, char *, char *);
RodColeman 0:8f5825f330b0 112 void upap_authpeer (int);
RodColeman 0:8f5825f330b0 113
RodColeman 0:8f5825f330b0 114 extern struct protent pap_protent;
RodColeman 0:8f5825f330b0 115
RodColeman 0:8f5825f330b0 116 #endif /* PAP_SUPPORT */
RodColeman 0:8f5825f330b0 117
RodColeman 0:8f5825f330b0 118 #endif /* PAP_H */