Stripped down version of Segundos NetService library (http://mbed.org/users/segundo/libraries/NetServices ). I have removed all NetServices, and all functions which had been disabled. Use this version when you need only pure TCP or UDP functions - this library compiles faster.

Dependencies:   lwip lwip-sys

Dependents:   christmasLights device_server pop3demo device_server_udp ... more

Committer:
hlipka
Date:
Mon Jan 10 21:03:11 2011 +0000
Revision:
0:8b387bed54c2
initial version

Who changed what in which revision?

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