Serves a webpage and saves the user entered data in a .txt file all on the MBED

Dependents:   HTTPServerCustom

Fork of EthernetNetIf by Donatien Garnier

Committer:
wellmon7
Date:
Mon Sep 29 23:43:13 2014 +0000
Revision:
6:5ff4a18d103e
Parent:
0:422060928e37
I don't know what this is asking for...we made slight changes to make the router and mbed applicable

Who changed what in which revision?

UserRevisionLine numberNew contents of line
donatien 0:422060928e37 1 /*
donatien 0:422060928e37 2 * Redistribution and use in source and binary forms, with or without modification,
donatien 0:422060928e37 3 * are permitted provided that the following conditions are met:
donatien 0:422060928e37 4 *
donatien 0:422060928e37 5 * 1. Redistributions of source code must retain the above copyright notice,
donatien 0:422060928e37 6 * this list of conditions and the following disclaimer.
donatien 0:422060928e37 7 * 2. Redistributions in binary form must reproduce the above copyright notice,
donatien 0:422060928e37 8 * this list of conditions and the following disclaimer in the documentation
donatien 0:422060928e37 9 * and/or other materials provided with the distribution.
donatien 0:422060928e37 10 * 3. The name of the author may not be used to endorse or promote products
donatien 0:422060928e37 11 * derived from this software without specific prior written permission.
donatien 0:422060928e37 12 *
donatien 0:422060928e37 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
donatien 0:422060928e37 14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
donatien 0:422060928e37 15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
donatien 0:422060928e37 16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
donatien 0:422060928e37 17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
donatien 0:422060928e37 18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
donatien 0:422060928e37 19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
donatien 0:422060928e37 20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
donatien 0:422060928e37 21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
donatien 0:422060928e37 22 * OF SUCH DAMAGE.
donatien 0:422060928e37 23 *
donatien 0:422060928e37 24 * This file is part of the lwIP TCP/IP stack.
donatien 0:422060928e37 25 *
donatien 0:422060928e37 26 */
donatien 0:422060928e37 27
donatien 0:422060928e37 28 #ifndef __LWIP_NETIFAPI_H__
donatien 0:422060928e37 29 #define __LWIP_NETIFAPI_H__
donatien 0:422060928e37 30
donatien 0:422060928e37 31 #include "lwip/opt.h"
donatien 0:422060928e37 32
donatien 0:422060928e37 33 #if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
donatien 0:422060928e37 34
donatien 0:422060928e37 35 #include "lwip/sys.h"
donatien 0:422060928e37 36 #include "lwip/netif.h"
donatien 0:422060928e37 37 #include "lwip/dhcp.h"
donatien 0:422060928e37 38 #include "lwip/autoip.h"
donatien 0:422060928e37 39
donatien 0:422060928e37 40 #ifdef __cplusplus
donatien 0:422060928e37 41 extern "C" {
donatien 0:422060928e37 42 #endif
donatien 0:422060928e37 43
donatien 0:422060928e37 44 typedef void (*netifapi_void_fn)(struct netif *netif);
donatien 0:422060928e37 45 typedef err_t (*netifapi_errt_fn)(struct netif *netif);
donatien 0:422060928e37 46
donatien 0:422060928e37 47 struct netifapi_msg_msg {
donatien 0:422060928e37 48 #if !LWIP_TCPIP_CORE_LOCKING
donatien 0:422060928e37 49 sys_sem_t sem;
donatien 0:422060928e37 50 #endif /* !LWIP_TCPIP_CORE_LOCKING */
donatien 0:422060928e37 51 err_t err;
donatien 0:422060928e37 52 struct netif *netif;
donatien 0:422060928e37 53 union {
donatien 0:422060928e37 54 struct {
donatien 0:422060928e37 55 ip_addr_t *ipaddr;
donatien 0:422060928e37 56 ip_addr_t *netmask;
donatien 0:422060928e37 57 ip_addr_t *gw;
donatien 0:422060928e37 58 void *state;
donatien 0:422060928e37 59 netif_init_fn init;
donatien 0:422060928e37 60 netif_input_fn input;
donatien 0:422060928e37 61 } add;
donatien 0:422060928e37 62 struct {
donatien 0:422060928e37 63 netifapi_void_fn voidfunc;
donatien 0:422060928e37 64 netifapi_errt_fn errtfunc;
donatien 0:422060928e37 65 } common;
donatien 0:422060928e37 66 } msg;
donatien 0:422060928e37 67 };
donatien 0:422060928e37 68
donatien 0:422060928e37 69 struct netifapi_msg {
donatien 0:422060928e37 70 void (* function)(struct netifapi_msg_msg *msg);
donatien 0:422060928e37 71 struct netifapi_msg_msg msg;
donatien 0:422060928e37 72 };
donatien 0:422060928e37 73
donatien 0:422060928e37 74
donatien 0:422060928e37 75 /* API for application */
donatien 0:422060928e37 76 err_t netifapi_netif_add ( struct netif *netif,
donatien 0:422060928e37 77 ip_addr_t *ipaddr,
donatien 0:422060928e37 78 ip_addr_t *netmask,
donatien 0:422060928e37 79 ip_addr_t *gw,
donatien 0:422060928e37 80 void *state,
donatien 0:422060928e37 81 netif_init_fn init,
donatien 0:422060928e37 82 netif_input_fn input);
donatien 0:422060928e37 83
donatien 0:422060928e37 84 err_t netifapi_netif_set_addr ( struct netif *netif,
donatien 0:422060928e37 85 ip_addr_t *ipaddr,
donatien 0:422060928e37 86 ip_addr_t *netmask,
donatien 0:422060928e37 87 ip_addr_t *gw );
donatien 0:422060928e37 88
donatien 0:422060928e37 89 err_t netifapi_netif_common ( struct netif *netif,
donatien 0:422060928e37 90 netifapi_void_fn voidfunc,
donatien 0:422060928e37 91 netifapi_errt_fn errtfunc);
donatien 0:422060928e37 92
donatien 0:422060928e37 93 #define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL)
donatien 0:422060928e37 94 #define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL)
donatien 0:422060928e37 95 #define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL)
donatien 0:422060928e37 96 #define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL)
donatien 0:422060928e37 97 #define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start)
donatien 0:422060928e37 98 #define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL)
donatien 0:422060928e37 99 #define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start)
donatien 0:422060928e37 100 #define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop)
donatien 0:422060928e37 101
donatien 0:422060928e37 102 #ifdef __cplusplus
donatien 0:422060928e37 103 }
donatien 0:422060928e37 104 #endif
donatien 0:422060928e37 105
donatien 0:422060928e37 106 #endif /* LWIP_NETIF_API */
donatien 0:422060928e37 107
donatien 0:422060928e37 108 #endif /* __LWIP_NETIFAPI_H__ */