Ethernet test for ECE 4180 and others to find your IP address and do a simple HTTP GET request over port 80.

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Committer:
mkersh3
Date:
Thu Apr 04 05:26:09 2013 +0000
Revision:
0:e7ca326e76ee
Ethernet Test for ECE4180 and others to find their IP Address and do a simple HTTP GET request over port 80.

Who changed what in which revision?

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