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