Version of http://mbed.org/cookbook/NetServicesTribute with setting set the same for LPC2368

Dependents:   UDPSocketExample 24LCxx_I2CApp WeatherPlatform_pachube HvZServerLib ... more

Committer:
simon
Date:
Tue Nov 23 14:15:36 2010 +0000
Revision:
0:350011bf8be7
Experimental version for testing UDP

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 0:350011bf8be7 1 /*
simon 0:350011bf8be7 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
simon 0:350011bf8be7 3 * All rights reserved.
simon 0:350011bf8be7 4 *
simon 0:350011bf8be7 5 * Redistribution and use in source and binary forms, with or without modification,
simon 0:350011bf8be7 6 * are permitted provided that the following conditions are met:
simon 0:350011bf8be7 7 *
simon 0:350011bf8be7 8 * 1. Redistributions of source code must retain the above copyright notice,
simon 0:350011bf8be7 9 * this list of conditions and the following disclaimer.
simon 0:350011bf8be7 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
simon 0:350011bf8be7 11 * this list of conditions and the following disclaimer in the documentation
simon 0:350011bf8be7 12 * and/or other materials provided with the distribution.
simon 0:350011bf8be7 13 * 3. The name of the author may not be used to endorse or promote products
simon 0:350011bf8be7 14 * derived from this software without specific prior written permission.
simon 0:350011bf8be7 15 *
simon 0:350011bf8be7 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
simon 0:350011bf8be7 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
simon 0:350011bf8be7 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
simon 0:350011bf8be7 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
simon 0:350011bf8be7 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
simon 0:350011bf8be7 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
simon 0:350011bf8be7 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
simon 0:350011bf8be7 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
simon 0:350011bf8be7 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
simon 0:350011bf8be7 25 * OF SUCH DAMAGE.
simon 0:350011bf8be7 26 *
simon 0:350011bf8be7 27 * This file is part of the lwIP TCP/IP stack.
simon 0:350011bf8be7 28 *
simon 0:350011bf8be7 29 * Author: Adam Dunkels <adam@sics.se>
simon 0:350011bf8be7 30 *
simon 0:350011bf8be7 31 */
simon 0:350011bf8be7 32 #ifndef __LWIP_NETIF_H__
simon 0:350011bf8be7 33 #define __LWIP_NETIF_H__
simon 0:350011bf8be7 34
simon 0:350011bf8be7 35 #include "lwip/opt.h"
simon 0:350011bf8be7 36
simon 0:350011bf8be7 37 #define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
simon 0:350011bf8be7 38
simon 0:350011bf8be7 39 #include "lwip/err.h"
simon 0:350011bf8be7 40
simon 0:350011bf8be7 41 #include "lwip/ip_addr.h"
simon 0:350011bf8be7 42
simon 0:350011bf8be7 43 #include "lwip/def.h"
simon 0:350011bf8be7 44 #include "lwip/pbuf.h"
simon 0:350011bf8be7 45 #if LWIP_DHCP
simon 0:350011bf8be7 46 struct dhcp;
simon 0:350011bf8be7 47 #endif
simon 0:350011bf8be7 48 #if LWIP_AUTOIP
simon 0:350011bf8be7 49 struct autoip;
simon 0:350011bf8be7 50 #endif
simon 0:350011bf8be7 51
simon 0:350011bf8be7 52 #ifdef __cplusplus
simon 0:350011bf8be7 53 extern "C" {
simon 0:350011bf8be7 54 #endif
simon 0:350011bf8be7 55
simon 0:350011bf8be7 56 /* Throughout this file, IP addresses are expected to be in
simon 0:350011bf8be7 57 * the same byte order as in IP_PCB. */
simon 0:350011bf8be7 58
simon 0:350011bf8be7 59 /* must be the maximum of all used hardware address lengths
simon 0:350011bf8be7 60 across all types of interfaces in use */
simon 0:350011bf8be7 61 #define NETIF_MAX_HWADDR_LEN 6U
simon 0:350011bf8be7 62
simon 0:350011bf8be7 63 /* Whether the network interface is 'up'. This is
simon 0:350011bf8be7 64 * a software flag used to control whether this network
simon 0:350011bf8be7 65 * interface is enabled and processes traffic.
simon 0:350011bf8be7 66 * It is set by the startup code (for static IP configuration) or
simon 0:350011bf8be7 67 * by dhcp/autoip when an address has been assigned.
simon 0:350011bf8be7 68 */
simon 0:350011bf8be7 69 #define NETIF_FLAG_UP 0x01U
simon 0:350011bf8be7 70 /* If set, the netif has broadcast capability.
simon 0:350011bf8be7 71 * Set by the netif driver in its init function. */
simon 0:350011bf8be7 72 #define NETIF_FLAG_BROADCAST 0x02U
simon 0:350011bf8be7 73 /* If set, the netif is one end of a point-to-point connection.
simon 0:350011bf8be7 74 * Set by the netif driver in its init function. */
simon 0:350011bf8be7 75 #define NETIF_FLAG_POINTTOPOINT 0x04U
simon 0:350011bf8be7 76 /* If set, the interface is configured using DHCP.
simon 0:350011bf8be7 77 * Set by the DHCP code when starting or stopping DHCP. */
simon 0:350011bf8be7 78 #define NETIF_FLAG_DHCP 0x08U
simon 0:350011bf8be7 79 /* If set, the interface has an active link
simon 0:350011bf8be7 80 * (set by the network interface driver).
simon 0:350011bf8be7 81 * Either set by the netif driver in its init function (if the link
simon 0:350011bf8be7 82 * is up at that time) or at a later point once the link comes up
simon 0:350011bf8be7 83 * (if link detection is supported by the hardware). */
simon 0:350011bf8be7 84 #define NETIF_FLAG_LINK_UP 0x10U
simon 0:350011bf8be7 85 /* If set, the netif is an ethernet device using ARP.
simon 0:350011bf8be7 86 * Set by the netif driver in its init function.
simon 0:350011bf8be7 87 * Used to check input packet types and use of DHCP. */
simon 0:350011bf8be7 88 #define NETIF_FLAG_ETHARP 0x20U
simon 0:350011bf8be7 89 /* If set, the netif is an ethernet device. It might not use
simon 0:350011bf8be7 90 * ARP or TCP/IP if it is used for PPPoE only.
simon 0:350011bf8be7 91 */
simon 0:350011bf8be7 92 #define NETIF_FLAG_ETHERNET 0x40U
simon 0:350011bf8be7 93 /* If set, the netif has IGMP capability.
simon 0:350011bf8be7 94 * Set by the netif driver in its init function. */
simon 0:350011bf8be7 95 #define NETIF_FLAG_IGMP 0x80U
simon 0:350011bf8be7 96
simon 0:350011bf8be7 97 /* Function prototype for netif init functions. Set up flags and output/linkoutput
simon 0:350011bf8be7 98 * callback functions in this function.
simon 0:350011bf8be7 99 *
simon 0:350011bf8be7 100 * @param netif The netif to initialize
simon 0:350011bf8be7 101 */
simon 0:350011bf8be7 102 typedef err_t (*netif_init_fn)(struct netif *netif);
simon 0:350011bf8be7 103 /* Function prototype for netif->input functions. This function is saved as 'input'
simon 0:350011bf8be7 104 * callback function in the netif struct. Call it when a packet has been received.
simon 0:350011bf8be7 105 *
simon 0:350011bf8be7 106 * @param p The received packet, copied into a pbuf
simon 0:350011bf8be7 107 * @param inp The netif which received the packet
simon 0:350011bf8be7 108 */
simon 0:350011bf8be7 109 typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp);
simon 0:350011bf8be7 110 /* Function prototype for netif->output functions. Called by lwIP when a packet
simon 0:350011bf8be7 111 * shall be sent. For ethernet netif, set this to 'etharp_output' and set
simon 0:350011bf8be7 112 * 'linkoutput'.
simon 0:350011bf8be7 113 *
simon 0:350011bf8be7 114 * @param netif The netif which shall send a packet
simon 0:350011bf8be7 115 * @param p The packet to send (p->payload points to IP header)
simon 0:350011bf8be7 116 * @param ipaddr The IP address to which the packet shall be sent
simon 0:350011bf8be7 117 */
simon 0:350011bf8be7 118 typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p,
simon 0:350011bf8be7 119 ip_addr_t *ipaddr);
simon 0:350011bf8be7 120 /* Function prototype for netif->linkoutput functions. Only used for ethernet
simon 0:350011bf8be7 121 * netifs. This function is called by ARP when a packet shall be sent.
simon 0:350011bf8be7 122 *
simon 0:350011bf8be7 123 * @param netif The netif which shall send a packet
simon 0:350011bf8be7 124 * @param p The packet to send (raw ethernet packet)
simon 0:350011bf8be7 125 */
simon 0:350011bf8be7 126 typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p);
simon 0:350011bf8be7 127 /* Function prototype for netif status- or link-callback functions. */
simon 0:350011bf8be7 128 typedef void (*netif_status_callback_fn)(struct netif *netif);
simon 0:350011bf8be7 129 /* Function prototype for netif igmp_mac_filter functions */
simon 0:350011bf8be7 130 typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
simon 0:350011bf8be7 131 ip_addr_t *group, u8_t action);
simon 0:350011bf8be7 132
simon 0:350011bf8be7 133 /* Generic data structure used for all lwIP network interfaces.
simon 0:350011bf8be7 134 * The following fields should be filled in by the initialization
simon 0:350011bf8be7 135 * function for the device driver: hwaddr_len, hwaddr[], mtu, flags */
simon 0:350011bf8be7 136 struct netif {
simon 0:350011bf8be7 137 /* pointer to next in linked list */
simon 0:350011bf8be7 138 struct netif *next;
simon 0:350011bf8be7 139
simon 0:350011bf8be7 140 /* IP address configuration in network byte order */
simon 0:350011bf8be7 141 ip_addr_t ip_addr;
simon 0:350011bf8be7 142 ip_addr_t netmask;
simon 0:350011bf8be7 143 ip_addr_t gw;
simon 0:350011bf8be7 144
simon 0:350011bf8be7 145 /* This function is called by the network device driver
simon 0:350011bf8be7 146 * to pass a packet up the TCP/IP stack. */
simon 0:350011bf8be7 147 netif_input_fn input;
simon 0:350011bf8be7 148 /* This function is called by the IP module when it wants
simon 0:350011bf8be7 149 * to send a packet on the interface. This function typically
simon 0:350011bf8be7 150 * first resolves the hardware address, then sends the packet. */
simon 0:350011bf8be7 151 netif_output_fn output;
simon 0:350011bf8be7 152 /* This function is called by the ARP module when it wants
simon 0:350011bf8be7 153 * to send a packet on the interface. This function outputs
simon 0:350011bf8be7 154 * the pbuf as-is on the link medium. */
simon 0:350011bf8be7 155 netif_linkoutput_fn linkoutput;
simon 0:350011bf8be7 156 #if LWIP_NETIF_STATUS_CALLBACK
simon 0:350011bf8be7 157 /* This function is called when the netif state is set to up or down
simon 0:350011bf8be7 158 */
simon 0:350011bf8be7 159 netif_status_callback_fn status_callback;
simon 0:350011bf8be7 160 #endif /* LWIP_NETIF_STATUS_CALLBACK */
simon 0:350011bf8be7 161 #if LWIP_NETIF_LINK_CALLBACK
simon 0:350011bf8be7 162 /* This function is called when the netif link is set to up or down
simon 0:350011bf8be7 163 */
simon 0:350011bf8be7 164 netif_status_callback_fn link_callback;
simon 0:350011bf8be7 165 #endif /* LWIP_NETIF_LINK_CALLBACK */
simon 0:350011bf8be7 166 /* This field can be set by the device driver and could point
simon 0:350011bf8be7 167 * to state information for the device. */
simon 0:350011bf8be7 168 void *state;
simon 0:350011bf8be7 169 #if LWIP_DHCP
simon 0:350011bf8be7 170 /* the DHCP client state information for this netif */
simon 0:350011bf8be7 171 struct dhcp *dhcp;
simon 0:350011bf8be7 172 #endif /* LWIP_DHCP */
simon 0:350011bf8be7 173 #if LWIP_AUTOIP
simon 0:350011bf8be7 174 /* the AutoIP client state information for this netif */
simon 0:350011bf8be7 175 struct autoip *autoip;
simon 0:350011bf8be7 176 #endif
simon 0:350011bf8be7 177 #if LWIP_NETIF_HOSTNAME
simon 0:350011bf8be7 178 /* the hostname for this netif, NULL is a valid value */
simon 0:350011bf8be7 179 char* hostname;
simon 0:350011bf8be7 180 #endif /* LWIP_NETIF_HOSTNAME */
simon 0:350011bf8be7 181 /* maximum transfer unit (in bytes) */
simon 0:350011bf8be7 182 u16_t mtu;
simon 0:350011bf8be7 183 /* number of bytes used in hwaddr */
simon 0:350011bf8be7 184 u8_t hwaddr_len;
simon 0:350011bf8be7 185 /* link level hardware address of this interface */
simon 0:350011bf8be7 186 u8_t hwaddr[NETIF_MAX_HWADDR_LEN];
simon 0:350011bf8be7 187 /* flags (see NETIF_FLAG_ above) */
simon 0:350011bf8be7 188 u8_t flags;
simon 0:350011bf8be7 189 /* descriptive abbreviation */
simon 0:350011bf8be7 190 char name[2];
simon 0:350011bf8be7 191 /* number of this interface */
simon 0:350011bf8be7 192 u8_t num;
simon 0:350011bf8be7 193 #if LWIP_SNMP
simon 0:350011bf8be7 194 /* link type (from "snmp_ifType" enum from snmp.h) */
simon 0:350011bf8be7 195 u8_t link_type;
simon 0:350011bf8be7 196 /* (estimate) link speed */
simon 0:350011bf8be7 197 u32_t link_speed;
simon 0:350011bf8be7 198 /* timestamp at last change made (up/down) */
simon 0:350011bf8be7 199 u32_t ts;
simon 0:350011bf8be7 200 /* counters */
simon 0:350011bf8be7 201 u32_t ifinoctets;
simon 0:350011bf8be7 202 u32_t ifinucastpkts;
simon 0:350011bf8be7 203 u32_t ifinnucastpkts;
simon 0:350011bf8be7 204 u32_t ifindiscards;
simon 0:350011bf8be7 205 u32_t ifoutoctets;
simon 0:350011bf8be7 206 u32_t ifoutucastpkts;
simon 0:350011bf8be7 207 u32_t ifoutnucastpkts;
simon 0:350011bf8be7 208 u32_t ifoutdiscards;
simon 0:350011bf8be7 209 #endif /* LWIP_SNMP */
simon 0:350011bf8be7 210 #if LWIP_IGMP
simon 0:350011bf8be7 211 /* This function could be called to add or delete a entry in the multicast
simon 0:350011bf8be7 212 filter table of the ethernet MAC.*/
simon 0:350011bf8be7 213 netif_igmp_mac_filter_fn igmp_mac_filter;
simon 0:350011bf8be7 214 #endif /* LWIP_IGMP */
simon 0:350011bf8be7 215 #if LWIP_NETIF_HWADDRHINT
simon 0:350011bf8be7 216 u8_t *addr_hint;
simon 0:350011bf8be7 217 #endif /* LWIP_NETIF_HWADDRHINT */
simon 0:350011bf8be7 218 #if ENABLE_LOOPBACK
simon 0:350011bf8be7 219 /* List of packets to be queued for ourselves. */
simon 0:350011bf8be7 220 struct pbuf *loop_first;
simon 0:350011bf8be7 221 struct pbuf *loop_last;
simon 0:350011bf8be7 222 #if LWIP_LOOPBACK_MAX_PBUFS
simon 0:350011bf8be7 223 u16_t loop_cnt_current;
simon 0:350011bf8be7 224 #endif /* LWIP_LOOPBACK_MAX_PBUFS */
simon 0:350011bf8be7 225 #endif /* ENABLE_LOOPBACK */
simon 0:350011bf8be7 226 };
simon 0:350011bf8be7 227
simon 0:350011bf8be7 228 #if LWIP_SNMP
simon 0:350011bf8be7 229 #define NETIF_INIT_SNMP(netif, type, speed) \
simon 0:350011bf8be7 230 /* use "snmp_ifType" enum from snmp.h for "type", snmp_ifType_ethernet_csmacd by example */ \
simon 0:350011bf8be7 231 (netif)->link_type = (type); \
simon 0:350011bf8be7 232 /* your link speed here (units: bits per second) */ \
simon 0:350011bf8be7 233 (netif)->link_speed = (speed); \
simon 0:350011bf8be7 234 (netif)->ts = 0; \
simon 0:350011bf8be7 235 (netif)->ifinoctets = 0; \
simon 0:350011bf8be7 236 (netif)->ifinucastpkts = 0; \
simon 0:350011bf8be7 237 (netif)->ifinnucastpkts = 0; \
simon 0:350011bf8be7 238 (netif)->ifindiscards = 0; \
simon 0:350011bf8be7 239 (netif)->ifoutoctets = 0; \
simon 0:350011bf8be7 240 (netif)->ifoutucastpkts = 0; \
simon 0:350011bf8be7 241 (netif)->ifoutnucastpkts = 0; \
simon 0:350011bf8be7 242 (netif)->ifoutdiscards = 0
simon 0:350011bf8be7 243 #else /* LWIP_SNMP */
simon 0:350011bf8be7 244 #define NETIF_INIT_SNMP(netif, type, speed)
simon 0:350011bf8be7 245 #endif /* LWIP_SNMP */
simon 0:350011bf8be7 246
simon 0:350011bf8be7 247
simon 0:350011bf8be7 248 /* The list of network interfaces. */
simon 0:350011bf8be7 249 extern struct netif *netif_list;
simon 0:350011bf8be7 250 /* The default network interface. */
simon 0:350011bf8be7 251 extern struct netif *netif_default;
simon 0:350011bf8be7 252
simon 0:350011bf8be7 253 void netif_init(void);
simon 0:350011bf8be7 254
simon 0:350011bf8be7 255 struct netif *netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
simon 0:350011bf8be7 256 ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input);
simon 0:350011bf8be7 257
simon 0:350011bf8be7 258 void
simon 0:350011bf8be7 259 netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
simon 0:350011bf8be7 260 ip_addr_t *gw);
simon 0:350011bf8be7 261 void netif_remove(struct netif * netif);
simon 0:350011bf8be7 262
simon 0:350011bf8be7 263 /* Returns a network interface given its name. The name is of the form
simon 0:350011bf8be7 264 "et0", where the first two letters are the "name" field in the
simon 0:350011bf8be7 265 netif structure, and the digit is in the num field in the same
simon 0:350011bf8be7 266 structure. */
simon 0:350011bf8be7 267 struct netif *netif_find(char *name);
simon 0:350011bf8be7 268
simon 0:350011bf8be7 269 void netif_set_default(struct netif *netif);
simon 0:350011bf8be7 270
simon 0:350011bf8be7 271 void netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr);
simon 0:350011bf8be7 272 void netif_set_netmask(struct netif *netif, ip_addr_t *netmask);
simon 0:350011bf8be7 273 void netif_set_gw(struct netif *netif, ip_addr_t *gw);
simon 0:350011bf8be7 274
simon 0:350011bf8be7 275 void netif_set_up(struct netif *netif);
simon 0:350011bf8be7 276 void netif_set_down(struct netif *netif);
simon 0:350011bf8be7 277 /* Ask if an interface is up */
simon 0:350011bf8be7 278 #define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0)
simon 0:350011bf8be7 279
simon 0:350011bf8be7 280 #if LWIP_NETIF_STATUS_CALLBACK
simon 0:350011bf8be7 281 void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback);
simon 0:350011bf8be7 282 #endif /* LWIP_NETIF_STATUS_CALLBACK */
simon 0:350011bf8be7 283
simon 0:350011bf8be7 284 void netif_set_link_up(struct netif *netif);
simon 0:350011bf8be7 285 void netif_set_link_down(struct netif *netif);
simon 0:350011bf8be7 286 /* Ask if a link is up */
simon 0:350011bf8be7 287 #define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0)
simon 0:350011bf8be7 288
simon 0:350011bf8be7 289 #if LWIP_NETIF_LINK_CALLBACK
simon 0:350011bf8be7 290 void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback);
simon 0:350011bf8be7 291 #endif /* LWIP_NETIF_LINK_CALLBACK */
simon 0:350011bf8be7 292
simon 0:350011bf8be7 293 #if LWIP_NETIF_HOSTNAME
simon 0:350011bf8be7 294 #define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0)
simon 0:350011bf8be7 295 #define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL)
simon 0:350011bf8be7 296 #endif /* LWIP_NETIF_HOSTNAME */
simon 0:350011bf8be7 297
simon 0:350011bf8be7 298 #if LWIP_IGMP
simon 0:350011bf8be7 299 #define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0)
simon 0:350011bf8be7 300 #define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL)
simon 0:350011bf8be7 301 #endif /* LWIP_IGMP */
simon 0:350011bf8be7 302
simon 0:350011bf8be7 303 #if ENABLE_LOOPBACK
simon 0:350011bf8be7 304 err_t netif_loop_output(struct netif *netif, struct pbuf *p, ip_addr_t *dest_ip);
simon 0:350011bf8be7 305 void netif_poll(struct netif *netif);
simon 0:350011bf8be7 306 #if !LWIP_NETIF_LOOPBACK_MULTITHREADING
simon 0:350011bf8be7 307 void netif_poll_all(void);
simon 0:350011bf8be7 308 #endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */
simon 0:350011bf8be7 309 #endif /* ENABLE_LOOPBACK */
simon 0:350011bf8be7 310
simon 0:350011bf8be7 311 #ifdef __cplusplus
simon 0:350011bf8be7 312 }
simon 0:350011bf8be7 313 #endif
simon 0:350011bf8be7 314
simon 0:350011bf8be7 315 #endif /* __LWIP_NETIF_H__ */