TuyaOS
netif.h
浏览该文件的文档.
1
6/*
7 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without modification,
11 * are permitted provided that the following conditions are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
24 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30 * OF SUCH DAMAGE.
31 *
32 * This file is part of the lwIP TCP/IP stack.
33 *
34 * Author: Adam Dunkels <adam@sics.se>
35 *
36 */
37#ifndef LWIP_HDR_NETIF_H
38#define LWIP_HDR_NETIF_H
39
40#include "lwip/opt.h"
41
42#define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
43
44#include "lwip/err.h"
45
46#include "lwip/ip_addr.h"
47
48#include "lwip/def.h"
49#include "lwip/pbuf.h"
50#include "lwip/stats.h"
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
56/* Throughout this file, IP addresses are expected to be in
57 * the same byte order as in IP_PCB. */
58
62#ifndef NETIF_MAX_HWADDR_LEN
63#define NETIF_MAX_HWADDR_LEN 6U
64#endif
65
70#define NETIF_NAMESIZE 6
71
84#define NETIF_FLAG_UP 0x01U
87#define NETIF_FLAG_BROADCAST 0x02U
93#define NETIF_FLAG_LINK_UP 0x04U
97#define NETIF_FLAG_ETHARP 0x08U
101#define NETIF_FLAG_ETHERNET 0x10U
104#define NETIF_FLAG_IGMP 0x20U
107#define NETIF_FLAG_MLD6 0x40U
108
113enum lwip_internal_netif_client_data_index
114{
115#if LWIP_IPV4
116#if LWIP_DHCP
117 LWIP_NETIF_CLIENT_DATA_INDEX_DHCP,
118#endif
119#if LWIP_AUTOIP
120 LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP,
121#endif
122#if LWIP_IGMP
123 LWIP_NETIF_CLIENT_DATA_INDEX_IGMP,
124#endif
125#endif /* LWIP_IPV4 */
126#if LWIP_IPV6
127#if LWIP_IPV6_DHCP6
128 LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6,
129#endif
130#if LWIP_IPV6_MLD
131 LWIP_NETIF_CLIENT_DATA_INDEX_MLD6,
132#endif
133#endif /* LWIP_IPV6 */
134 LWIP_NETIF_CLIENT_DATA_INDEX_MAX
135};
136
137#if LWIP_CHECKSUM_CTRL_PER_NETIF
138#define NETIF_CHECKSUM_GEN_IP 0x0001
139#define NETIF_CHECKSUM_GEN_UDP 0x0002
140#define NETIF_CHECKSUM_GEN_TCP 0x0004
141#define NETIF_CHECKSUM_GEN_ICMP 0x0008
142#define NETIF_CHECKSUM_GEN_ICMP6 0x0010
143#define NETIF_CHECKSUM_CHECK_IP 0x0100
144#define NETIF_CHECKSUM_CHECK_UDP 0x0200
145#define NETIF_CHECKSUM_CHECK_TCP 0x0400
146#define NETIF_CHECKSUM_CHECK_ICMP 0x0800
147#define NETIF_CHECKSUM_CHECK_ICMP6 0x1000
148#define NETIF_CHECKSUM_ENABLE_ALL 0xFFFF
149#define NETIF_CHECKSUM_DISABLE_ALL 0x0000
150#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */
151
152struct netif;
153
162
168typedef err_t (*netif_init_fn)(struct netif *netif);
178typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp);
179
180#if LWIP_IPV4
189typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p,
190 const ip4_addr_t *ipaddr);
191#endif /* LWIP_IPV4*/
192
193#if LWIP_IPV6
202typedef err_t (*netif_output_ip6_fn)(struct netif *netif, struct pbuf *p,
203 const ip6_addr_t *ipaddr);
204#endif /* LWIP_IPV6 */
205
212typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p);
214typedef void (*netif_status_callback_fn)(struct netif *netif);
215#if LWIP_IPV4 && LWIP_IGMP
217typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
218 const ip4_addr_t *group, enum netif_mac_filter_action action);
219#endif /* LWIP_IPV4 && LWIP_IGMP */
220#if LWIP_IPV6 && LWIP_IPV6_MLD
222typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif,
223 const ip6_addr_t *group, enum netif_mac_filter_action action);
224#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
225
226#if LWIP_DHCP || LWIP_AUTOIP || LWIP_IGMP || LWIP_IPV6_MLD || LWIP_IPV6_DHCP6 || (LWIP_NUM_NETIF_CLIENT_DATA > 0)
227#if LWIP_NUM_NETIF_CLIENT_DATA > 0
228u8_t netif_alloc_client_data_id(void);
229#endif
233#define netif_set_client_data(netif, id, data) netif_get_client_data(netif, id) = (data)
237#define netif_get_client_data(netif, id) (netif)->client_data[(id)]
238#endif
239
240#if (LWIP_IPV4 && LWIP_ARP && (ARP_TABLE_SIZE > 0x7f)) || (LWIP_IPV6 && (LWIP_ND6_NUM_DESTINATIONS > 0x7f))
241typedef u16_t netif_addr_idx_t;
242#define NETIF_ADDR_IDX_MAX 0x7FFF
243#else
244typedef u8_t netif_addr_idx_t;
245#define NETIF_ADDR_IDX_MAX 0x7F
246#endif
247
248#if LWIP_NETIF_HWADDRHINT
249#define LWIP_NETIF_USE_HINTS 1
250struct netif_hint {
251 netif_addr_idx_t addr_hint;
252};
253#else /* LWIP_NETIF_HWADDRHINT */
254#define LWIP_NETIF_USE_HINTS 0
255#endif /* LWIP_NETIF_HWADDRHINT */
256
260struct netif {
261#if !LWIP_SINGLE_NETIF
263 struct netif *next;
264#endif
265
266#if LWIP_IPV4
268 ip_addr_t ip_addr;
269 ip_addr_t netmask;
270 ip_addr_t gw;
271#endif /* LWIP_IPV4 */
272#if LWIP_IPV6
274 ip_addr_t ip6_addr[LWIP_IPV6_NUM_ADDRESSES];
277 u8_t ip6_addr_state[LWIP_IPV6_NUM_ADDRESSES];
278#if LWIP_IPV6_ADDRESS_LIFETIMES
282 u32_t ip6_addr_valid_life[LWIP_IPV6_NUM_ADDRESSES];
283 u32_t ip6_addr_pref_life[LWIP_IPV6_NUM_ADDRESSES];
284#endif /* LWIP_IPV6_ADDRESS_LIFETIMES */
285#endif /* LWIP_IPV6 */
289#if LWIP_IPV4
294 netif_output_fn output;
295#endif /* LWIP_IPV4 */
300#if LWIP_IPV6
305 netif_output_ip6_fn output_ip6;
306#endif /* LWIP_IPV6 */
307#if LWIP_NETIF_STATUS_CALLBACK
310 netif_status_callback_fn status_callback;
311#endif /* LWIP_NETIF_STATUS_CALLBACK */
312#if LWIP_NETIF_LINK_CALLBACK
315 netif_status_callback_fn link_callback;
316#endif /* LWIP_NETIF_LINK_CALLBACK */
317#if LWIP_NETIF_REMOVE_CALLBACK
319 netif_status_callback_fn remove_callback;
320#endif /* LWIP_NETIF_REMOVE_CALLBACK */
323 void *state;
324#ifdef netif_get_client_data
325 void* client_data[LWIP_NETIF_CLIENT_DATA_INDEX_MAX + LWIP_NUM_NETIF_CLIENT_DATA];
326#endif
327#if LWIP_NETIF_HOSTNAME
328 /* the hostname for this netif, NULL is a valid value */
329 const char* hostname;
330#endif /* LWIP_NETIF_HOSTNAME */
331#if LWIP_CHECKSUM_CTRL_PER_NETIF
332 u16_t chksum_flags;
333#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF*/
335 u16_t mtu;
336#if LWIP_IPV6 && LWIP_ND6_ALLOW_RA_UPDATES
338 u16_t mtu6;
339#endif /* LWIP_IPV6 && LWIP_ND6_ALLOW_RA_UPDATES */
345 u8_t flags;
347 char name[2];
350 u8_t num;
351#if LWIP_IPV6_AUTOCONFIG
353 u8_t ip6_autoconfig_enabled;
354#endif /* LWIP_IPV6_AUTOCONFIG */
355#if LWIP_IPV6_SEND_ROUTER_SOLICIT
357 u8_t rs_count;
358#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */
359#if MIB2_STATS
361 u8_t link_type;
363 u32_t link_speed;
365 u32_t ts;
367 struct stats_mib2_netif_ctrs mib2_counters;
368#endif /* MIB2_STATS */
369#if LWIP_IPV4 && LWIP_IGMP
372 netif_igmp_mac_filter_fn igmp_mac_filter;
373#endif /* LWIP_IPV4 && LWIP_IGMP */
374#if LWIP_IPV6 && LWIP_IPV6_MLD
377 netif_mld_mac_filter_fn mld_mac_filter;
378#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
379#if LWIP_NETIF_USE_HINTS
380 struct netif_hint *hints;
381#endif /* LWIP_NETIF_USE_HINTS */
382#if ENABLE_LOOPBACK
383 /* List of packets to be queued for ourselves. */
384 struct pbuf *loop_first;
385 struct pbuf *loop_last;
386#if LWIP_LOOPBACK_MAX_PBUFS
387 u16_t loop_cnt_current;
388#endif /* LWIP_LOOPBACK_MAX_PBUFS */
389#endif /* ENABLE_LOOPBACK */
390
391//#if ENABLE_TUYA_DHCPS
392 struct udp_pcb *dhcps_pcb;
393//#endif
394
395 /* Tuya add start. */
396 void (*dhcp_cb)(struct netif*, u8_t event, u8_t isup); /* callback for dhcp event, add a parameter to show dhcp status if needed */
397 /* Tuya add end. */
398};
399
400#if LWIP_CHECKSUM_CTRL_PER_NETIF
401#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags) do { \
402 (netif)->chksum_flags = chksumflags; } while(0)
403#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag) if (((netif) == NULL) || (((netif)->chksum_flags & (chksumflag)) != 0))
404#else /* LWIP_CHECKSUM_CTRL_PER_NETIF */
405#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags)
406#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag)
407#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */
408
409#if LWIP_SINGLE_NETIF
410#define NETIF_FOREACH(netif) if (((netif) = netif_default) != NULL)
411#else /* LWIP_SINGLE_NETIF */
413extern struct netif *netif_list;
414#define NETIF_FOREACH(netif) for ((netif) = netif_list; (netif) != NULL; (netif) = (netif)->next)
415#endif /* LWIP_SINGLE_NETIF */
417extern struct netif *netif_default;
418
419void netif_init(void);
420
421struct netif *netif_add_noaddr(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input);
422
423#if LWIP_IPV4
424struct netif *netif_add(struct netif *netif,
425 const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw,
427void netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask,
428 const ip4_addr_t *gw);
429#else /* LWIP_IPV4 */
430struct netif *netif_add(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input);
431#endif /* LWIP_IPV4 */
432void netif_remove(struct netif * netif);
433
434/* Returns a network interface given its name. The name is of the form
435 "et0", where the first two letters are the "name" field in the
436 netif structure, and the digit is in the num field in the same
437 structure. */
438struct netif *netif_find(const char *name);
439
440void netif_set_default(struct netif *netif);
441
442#if LWIP_IPV4
443void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr);
444void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask);
445void netif_set_gw(struct netif *netif, const ip4_addr_t *gw);
447#define netif_ip4_addr(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->ip_addr)))
449#define netif_ip4_netmask(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask)))
451#define netif_ip4_gw(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->gw)))
453#define netif_ip_addr4(netif) ((const ip_addr_t*)&((netif)->ip_addr))
455#define netif_ip_netmask4(netif) ((const ip_addr_t*)&((netif)->netmask))
457#define netif_ip_gw4(netif) ((const ip_addr_t*)&((netif)->gw))
458#endif /* LWIP_IPV4 */
459
460#define netif_set_flags(netif, set_flags) do { (netif)->flags = (u8_t)((netif)->flags | (set_flags)); } while(0)
461#define netif_clear_flags(netif, clr_flags) do { (netif)->flags = (u8_t)((netif)->flags & (u8_t)(~(clr_flags) & 0xff)); } while(0)
462#define netif_is_flag_set(nefif, flag) (((netif)->flags & (flag)) != 0)
463
464void netif_set_up(struct netif *netif);
465void netif_set_down(struct netif *netif);
469#define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0)
470
471#if LWIP_NETIF_STATUS_CALLBACK
472void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback);
473#endif /* LWIP_NETIF_STATUS_CALLBACK */
474#if LWIP_NETIF_REMOVE_CALLBACK
475void netif_set_remove_callback(struct netif *netif, netif_status_callback_fn remove_callback);
476#endif /* LWIP_NETIF_REMOVE_CALLBACK */
477
478void netif_set_link_up(struct netif *netif);
479void netif_set_link_down(struct netif *netif);
481#define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0)
482
483#if LWIP_NETIF_LINK_CALLBACK
484void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback);
485#endif /* LWIP_NETIF_LINK_CALLBACK */
486
487#if LWIP_NETIF_HOSTNAME
489#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0)
491#define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL)
492#endif /* LWIP_NETIF_HOSTNAME */
493
494#if LWIP_IGMP
496#define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0)
497#define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL)
498#endif /* LWIP_IGMP */
499
500#if LWIP_IPV6 && LWIP_IPV6_MLD
502#define netif_set_mld_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->mld_mac_filter = function; }}while(0)
503#define netif_get_mld_mac_filter(netif) (((netif) != NULL) ? ((netif)->mld_mac_filter) : NULL)
504#define netif_mld_mac_filter(netif, addr, action) do { if((netif) && (netif)->mld_mac_filter) { (netif)->mld_mac_filter((netif), (addr), (action)); }}while(0)
505#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
506
507#if ENABLE_LOOPBACK
508err_t netif_loop_output(struct netif *netif, struct pbuf *p);
509void netif_poll(struct netif *netif);
510#if !LWIP_NETIF_LOOPBACK_MULTITHREADING
511void netif_poll_all(void);
512#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */
513#endif /* ENABLE_LOOPBACK */
514
515err_t netif_input(struct pbuf *p, struct netif *inp);
516
517#if LWIP_IPV6
519#define netif_ip_addr6(netif, i) ((const ip_addr_t*)(&((netif)->ip6_addr[i])))
521#define netif_ip6_addr(netif, i) ((const ip6_addr_t*)ip_2_ip6(&((netif)->ip6_addr[i])))
522void netif_ip6_addr_set(struct netif *netif, s8_t addr_idx, const ip6_addr_t *addr6);
523void netif_ip6_addr_set_parts(struct netif *netif, s8_t addr_idx, u32_t i0, u32_t i1, u32_t i2, u32_t i3);
524#define netif_ip6_addr_state(netif, i) ((netif)->ip6_addr_state[i])
525void netif_ip6_addr_set_state(struct netif* netif, s8_t addr_idx, u8_t state);
526s8_t netif_get_ip6_addr_match(struct netif *netif, const ip6_addr_t *ip6addr);
527void netif_create_ip6_linklocal_address(struct netif *netif, u8_t from_mac_48bit);
528err_t netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx);
529#define netif_set_ip6_autoconfig_enabled(netif, action) do { if(netif) { (netif)->ip6_autoconfig_enabled = (action); }}while(0)
530#if LWIP_IPV6_ADDRESS_LIFETIMES
531#define netif_ip6_addr_valid_life(netif, i) \
532 (((netif) != NULL) ? ((netif)->ip6_addr_valid_life[i]) : IP6_ADDR_LIFE_STATIC)
533#define netif_ip6_addr_set_valid_life(netif, i, secs) \
534 do { if (netif != NULL) { (netif)->ip6_addr_valid_life[i] = (secs); }} while (0)
535#define netif_ip6_addr_pref_life(netif, i) \
536 (((netif) != NULL) ? ((netif)->ip6_addr_pref_life[i]) : IP6_ADDR_LIFE_STATIC)
537#define netif_ip6_addr_set_pref_life(netif, i, secs) \
538 do { if (netif != NULL) { (netif)->ip6_addr_pref_life[i] = (secs); }} while (0)
539#define netif_ip6_addr_isstatic(netif, i) \
540 (netif_ip6_addr_valid_life((netif), (i)) == IP6_ADDR_LIFE_STATIC)
541#else /* !LWIP_IPV6_ADDRESS_LIFETIMES */
542#define netif_ip6_addr_isstatic(netif, i) (1) /* all addresses are static */
543#endif /* !LWIP_IPV6_ADDRESS_LIFETIMES */
544#if LWIP_ND6_ALLOW_RA_UPDATES
545#define netif_mtu6(netif) ((netif)->mtu6)
546#else /* LWIP_ND6_ALLOW_RA_UPDATES */
547#define netif_mtu6(netif) ((netif)->mtu)
548#endif /* LWIP_ND6_ALLOW_RA_UPDATES */
549#endif /* LWIP_IPV6 */
550
551#if LWIP_NETIF_USE_HINTS
552#define NETIF_SET_HINTS(netif, netifhint) (netif)->hints = (netifhint)
553#define NETIF_RESET_HINTS(netif) (netif)->hints = NULL
554#else /* LWIP_NETIF_USE_HINTS */
555#define NETIF_SET_HINTS(netif, netifhint)
556#define NETIF_RESET_HINTS(netif)
557#endif /* LWIP_NETIF_USE_HINTS */
558
559u8_t netif_name_to_index(const char *name);
560char * netif_index_to_name(u8_t idx, char *name);
561struct netif* netif_get_by_index(u8_t idx);
562
563
570void netif_set_dhcp_cb(struct netif *netif, void (*cb)(struct netif*, u8_t event, u8_t isup));
571
572/* Interface indexes always start at 1 per RFC 3493, section 4, num starts at 0 (internal index is 0..254)*/
573#define netif_get_index(netif) ((u8_t)((netif)->num + 1))
574#define NETIF_NO_INDEX (0)
575
581typedef u16_t netif_nsc_reason_t;
582
583/* used for initialization only */
584#define LWIP_NSC_NONE 0x0000
586#define LWIP_NSC_NETIF_ADDED 0x0001
588#define LWIP_NSC_NETIF_REMOVED 0x0002
590#define LWIP_NSC_LINK_CHANGED 0x0004
594#define LWIP_NSC_STATUS_CHANGED 0x0008
596#define LWIP_NSC_IPV4_ADDRESS_CHANGED 0x0010
598#define LWIP_NSC_IPV4_GATEWAY_CHANGED 0x0020
600#define LWIP_NSC_IPV4_NETMASK_CHANGED 0x0040
602#define LWIP_NSC_IPV4_SETTINGS_CHANGED 0x0080
604#define LWIP_NSC_IPV6_SET 0x0100
606#define LWIP_NSC_IPV6_ADDR_STATE_CHANGED 0x0200
607
611typedef union
612{
615 {
617 u8_t state;
618 } link_changed;
621 {
623 u8_t state;
624 } status_changed;
627 {
629 const ip_addr_t* old_address;
630 const ip_addr_t* old_netmask;
631 const ip_addr_t* old_gw;
632 } ipv4_changed;
635 {
639 const ip_addr_t* old_address;
640 } ipv6_set;
643 {
649 const ip_addr_t* address;
650 } ipv6_addr_state_changed;
652
662
663#if LWIP_NETIF_EXT_STATUS_CALLBACK
664struct netif_ext_callback;
665typedef struct netif_ext_callback
666{
667 netif_ext_callback_fn callback_fn;
668 struct netif_ext_callback* next;
669} netif_ext_callback_t;
670
671#define NETIF_DECLARE_EXT_CALLBACK(name) static netif_ext_callback_t name;
672void netif_add_ext_callback(netif_ext_callback_t* callback, netif_ext_callback_fn fn);
673void netif_remove_ext_callback(netif_ext_callback_t* callback);
674void netif_invoke_ext_callback(struct netif* netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t* args);
675#else
676#define NETIF_DECLARE_EXT_CALLBACK(name)
677#define netif_add_ext_callback(callback, fn)
678#define netif_remove_ext_callback(callback)
679#define netif_invoke_ext_callback(netif, reason, args)
680#endif
681
682#ifdef __cplusplus
683}
684#endif
685
686#endif /* LWIP_HDR_NETIF_H */
s8_t err_t
Definition: err.h:96
#define LWIP_IPV6_NUM_ADDRESSES
Definition: opt.h:2420
#define LWIP_NUM_NETIF_CLIENT_DATA
Definition: opt.h:1666
void netif_set_dhcp_cb(struct netif *netif, void(*cb)(struct netif *, u8_t event, u8_t isup))
struct netif * netif_list
err_t(* netif_init_fn)(struct netif *netif)
Definition: netif.h:168
struct netif * netif_default
void(* netif_status_callback_fn)(struct netif *netif)
Definition: netif.h:214
void(* netif_ext_callback_fn)(struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args)
Definition: netif.h:661
netif_mac_filter_action
Definition: netif.h:156
@ NETIF_ADD_MAC_FILTER
Definition: netif.h:160
@ NETIF_DEL_MAC_FILTER
Definition: netif.h:158
err_t(* netif_input_fn)(struct pbuf *p, struct netif *inp)
Definition: netif.h:178
u16_t netif_nsc_reason_t
Definition: netif.h:581
err_t(* netif_linkoutput_fn)(struct netif *netif, struct pbuf *p)
Definition: netif.h:212
#define NETIF_MAX_HWADDR_LEN
Definition: netif.h:63
const ip_addr_t * old_address
Definition: netif.h:629
const ip_addr_t * address
Definition: netif.h:649
const ip_addr_t * old_address
Definition: netif.h:639
s8_t addr_index
Definition: netif.h:637
Definition: netif.h:260
u8_t flags
Definition: netif.h:345
char name[2]
Definition: netif.h:347
void * state
Definition: netif.h:323
netif_input_fn input
Definition: netif.h:288
u8_t num
Definition: netif.h:350
u16_t mtu
Definition: netif.h:335
netif_linkoutput_fn linkoutput
Definition: netif.h:299
struct netif * next
Definition: netif.h:263
u8_t hwaddr[6U]
Definition: netif.h:341
u8_t hwaddr_len
Definition: netif.h:343
Definition: pbuf.h:186
Definition: netif.h:612