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 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
mkersh3 0:e7ca326e76ee 3 * All rights reserved.
mkersh3 0:e7ca326e76ee 4 *
mkersh3 0:e7ca326e76ee 5 * Redistribution and use in source and binary forms, with or without modification,
mkersh3 0:e7ca326e76ee 6 * are permitted provided that the following conditions are met:
mkersh3 0:e7ca326e76ee 7 *
mkersh3 0:e7ca326e76ee 8 * 1. Redistributions of source code must retain the above copyright notice,
mkersh3 0:e7ca326e76ee 9 * this list of conditions and the following disclaimer.
mkersh3 0:e7ca326e76ee 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
mkersh3 0:e7ca326e76ee 11 * this list of conditions and the following disclaimer in the documentation
mkersh3 0:e7ca326e76ee 12 * and/or other materials provided with the distribution.
mkersh3 0:e7ca326e76ee 13 * 3. The name of the author may not be used to endorse or promote products
mkersh3 0:e7ca326e76ee 14 * derived from this software without specific prior written permission.
mkersh3 0:e7ca326e76ee 15 *
mkersh3 0:e7ca326e76ee 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
mkersh3 0:e7ca326e76ee 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
mkersh3 0:e7ca326e76ee 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
mkersh3 0:e7ca326e76ee 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
mkersh3 0:e7ca326e76ee 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
mkersh3 0:e7ca326e76ee 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
mkersh3 0:e7ca326e76ee 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
mkersh3 0:e7ca326e76ee 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
mkersh3 0:e7ca326e76ee 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
mkersh3 0:e7ca326e76ee 25 * OF SUCH DAMAGE.
mkersh3 0:e7ca326e76ee 26 *
mkersh3 0:e7ca326e76ee 27 * This file is part of the lwIP TCP/IP stack.
mkersh3 0:e7ca326e76ee 28 *
mkersh3 0:e7ca326e76ee 29 * Author: Adam Dunkels <adam@sics.se>
mkersh3 0:e7ca326e76ee 30 * Simon Goldschmidt
mkersh3 0:e7ca326e76ee 31 *
mkersh3 0:e7ca326e76ee 32 */
mkersh3 0:e7ca326e76ee 33 #ifndef __LWIP_TIMERS_H__
mkersh3 0:e7ca326e76ee 34 #define __LWIP_TIMERS_H__
mkersh3 0:e7ca326e76ee 35
mkersh3 0:e7ca326e76ee 36 #include "lwip/opt.h"
mkersh3 0:e7ca326e76ee 37
mkersh3 0:e7ca326e76ee 38 /* Timers are not supported when NO_SYS==1 and NO_SYS_NO_TIMERS==1 */
mkersh3 0:e7ca326e76ee 39 #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS))
mkersh3 0:e7ca326e76ee 40
mkersh3 0:e7ca326e76ee 41 #if LWIP_TIMERS
mkersh3 0:e7ca326e76ee 42
mkersh3 0:e7ca326e76ee 43 #include "lwip/err.h"
mkersh3 0:e7ca326e76ee 44 #include "lwip/sys.h"
mkersh3 0:e7ca326e76ee 45
mkersh3 0:e7ca326e76ee 46 #ifdef __cplusplus
mkersh3 0:e7ca326e76ee 47 extern "C" {
mkersh3 0:e7ca326e76ee 48 #endif
mkersh3 0:e7ca326e76ee 49
mkersh3 0:e7ca326e76ee 50 #ifndef LWIP_DEBUG_TIMERNAMES
mkersh3 0:e7ca326e76ee 51 #ifdef LWIP_DEBUG
mkersh3 0:e7ca326e76ee 52 #define LWIP_DEBUG_TIMERNAMES SYS_DEBUG
mkersh3 0:e7ca326e76ee 53 #else /* LWIP_DEBUG */
mkersh3 0:e7ca326e76ee 54 #define LWIP_DEBUG_TIMERNAMES 0
mkersh3 0:e7ca326e76ee 55 #endif /* LWIP_DEBUG*/
mkersh3 0:e7ca326e76ee 56 #endif
mkersh3 0:e7ca326e76ee 57
mkersh3 0:e7ca326e76ee 58 /** Function prototype for a timeout callback function. Register such a function
mkersh3 0:e7ca326e76ee 59 * using sys_timeout().
mkersh3 0:e7ca326e76ee 60 *
mkersh3 0:e7ca326e76ee 61 * @param arg Additional argument to pass to the function - set up by sys_timeout()
mkersh3 0:e7ca326e76ee 62 */
mkersh3 0:e7ca326e76ee 63 typedef void (* sys_timeout_handler)(void *arg);
mkersh3 0:e7ca326e76ee 64
mkersh3 0:e7ca326e76ee 65 struct sys_timeo {
mkersh3 0:e7ca326e76ee 66 struct sys_timeo *next;
mkersh3 0:e7ca326e76ee 67 u32_t time;
mkersh3 0:e7ca326e76ee 68 sys_timeout_handler h;
mkersh3 0:e7ca326e76ee 69 void *arg;
mkersh3 0:e7ca326e76ee 70 #if LWIP_DEBUG_TIMERNAMES
mkersh3 0:e7ca326e76ee 71 const char* handler_name;
mkersh3 0:e7ca326e76ee 72 #endif /* LWIP_DEBUG_TIMERNAMES */
mkersh3 0:e7ca326e76ee 73 };
mkersh3 0:e7ca326e76ee 74
mkersh3 0:e7ca326e76ee 75 void sys_timeouts_init(void);
mkersh3 0:e7ca326e76ee 76
mkersh3 0:e7ca326e76ee 77 #if LWIP_DEBUG_TIMERNAMES
mkersh3 0:e7ca326e76ee 78 void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name);
mkersh3 0:e7ca326e76ee 79 #define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler)
mkersh3 0:e7ca326e76ee 80 #else /* LWIP_DEBUG_TIMERNAMES */
mkersh3 0:e7ca326e76ee 81 void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg);
mkersh3 0:e7ca326e76ee 82 #endif /* LWIP_DEBUG_TIMERNAMES */
mkersh3 0:e7ca326e76ee 83
mkersh3 0:e7ca326e76ee 84 void sys_untimeout(sys_timeout_handler handler, void *arg);
mkersh3 0:e7ca326e76ee 85 #if NO_SYS
mkersh3 0:e7ca326e76ee 86 void sys_check_timeouts(void);
mkersh3 0:e7ca326e76ee 87 void sys_restart_timeouts(void);
mkersh3 0:e7ca326e76ee 88 #else /* NO_SYS */
mkersh3 0:e7ca326e76ee 89 void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg);
mkersh3 0:e7ca326e76ee 90 #endif /* NO_SYS */
mkersh3 0:e7ca326e76ee 91
mkersh3 0:e7ca326e76ee 92
mkersh3 0:e7ca326e76ee 93 #ifdef __cplusplus
mkersh3 0:e7ca326e76ee 94 }
mkersh3 0:e7ca326e76ee 95 #endif
mkersh3 0:e7ca326e76ee 96
mkersh3 0:e7ca326e76ee 97 #endif /* LWIP_TIMERS */
mkersh3 0:e7ca326e76ee 98 #endif /* __LWIP_TIMERS_H__ */