Dependents:   RTnoV3 RTnoV3_LED RTnoV3_Template RTnoV3_ADC ... more

Committer:
sherckuith
Date:
Sat Dec 31 11:25:27 2011 +0000
Revision:
0:479ce5546098
Ethernet

Who changed what in which revision?

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