Prusa MINI Firmware overview
|
Go to the documentation of this file.
37 #ifndef LWIP_HDR_NETIF_H
38 #define LWIP_HDR_NETIF_H
42 #define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
62 #ifndef NETIF_MAX_HWADDR_LEN
63 #define NETIF_MAX_HWADDR_LEN 6U
78 #define NETIF_FLAG_UP 0x01U
81 #define NETIF_FLAG_BROADCAST 0x02U
87 #define NETIF_FLAG_LINK_UP 0x04U
91 #define NETIF_FLAG_ETHARP 0x08U
95 #define NETIF_FLAG_ETHERNET 0x10U
98 #define NETIF_FLAG_IGMP 0x20U
101 #define NETIF_FLAG_MLD6 0x40U
110 LWIP_NETIF_CLIENT_DATA_INDEX_DHCP,
113 LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP,
116 LWIP_NETIF_CLIENT_DATA_INDEX_IGMP,
119 LWIP_NETIF_CLIENT_DATA_INDEX_MLD6,
124 #if LWIP_CHECKSUM_CTRL_PER_NETIF
125 #define NETIF_CHECKSUM_GEN_IP 0x0001
126 #define NETIF_CHECKSUM_GEN_UDP 0x0002
127 #define NETIF_CHECKSUM_GEN_TCP 0x0004
128 #define NETIF_CHECKSUM_GEN_ICMP 0x0008
129 #define NETIF_CHECKSUM_GEN_ICMP6 0x0010
130 #define NETIF_CHECKSUM_CHECK_IP 0x0100
131 #define NETIF_CHECKSUM_CHECK_UDP 0x0200
132 #define NETIF_CHECKSUM_CHECK_TCP 0x0400
133 #define NETIF_CHECKSUM_CHECK_ICMP 0x0800
134 #define NETIF_CHECKSUM_CHECK_ICMP6 0x1000
135 #define NETIF_CHECKSUM_ENABLE_ALL 0xFFFF
136 #define NETIF_CHECKSUM_DISABLE_ALL 0x0000
174 const ip4_addr_t *
ipaddr);
187 const ip6_addr_t *
ipaddr);
199 #if LWIP_IPV4 && LWIP_IGMP
204 #if LWIP_IPV6 && LWIP_IPV6_MLD
210 #if LWIP_DHCP || LWIP_AUTOIP || LWIP_IGMP || LWIP_IPV6_MLD || (LWIP_NUM_NETIF_CLIENT_DATA > 0)
211 u8_t netif_alloc_client_data_id(
void);
215 #define netif_set_client_data(netif, id, data) netif_get_client_data(netif, id) = (data)
219 #define netif_get_client_data(netif, id) (netif)->client_data[(id)]
250 netif_output_fn output;
261 netif_output_ip6_fn output_ip6;
263 #if LWIP_NETIF_STATUS_CALLBACK
268 #if LWIP_NETIF_LINK_CALLBACK
273 #if LWIP_NETIF_REMOVE_CALLBACK
280 #ifdef netif_get_client_data
283 #if LWIP_IPV6_AUTOCONFIG
285 u8_t ip6_autoconfig_enabled;
287 #if LWIP_IPV6_SEND_ROUTER_SOLICIT
291 #if LWIP_NETIF_HOSTNAME
293 const char* hostname;
295 #if LWIP_CHECKSUM_CTRL_PER_NETIF
318 struct stats_mib2_netif_ctrs mib2_counters;
320 #if LWIP_IPV4 && LWIP_IGMP
323 netif_igmp_mac_filter_fn igmp_mac_filter;
325 #if LWIP_IPV6 && LWIP_IPV6_MLD
328 netif_mld_mac_filter_fn mld_mac_filter;
330 #if LWIP_NETIF_HWADDRHINT
335 struct pbuf *loop_first;
336 struct pbuf *loop_last;
337 #if LWIP_LOOPBACK_MAX_PBUFS
338 u16_t loop_cnt_current;
343 #if LWIP_CHECKSUM_CTRL_PER_NETIF
344 #define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags) do { \
345 (netif)->chksum_flags = chksumflags; } while(0)
346 #define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag) if (((netif) == NULL) || (((netif)->chksum_flags & (chksumflag)) != 0))
348 #define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags)
349 #define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag)
361 const ip4_addr_t *
ipaddr,
const ip4_addr_t *
netmask,
const ip4_addr_t *
gw,
366 const ip4_addr_t *
gw);
381 void netif_set_gw(
struct netif *
netif,
const ip4_addr_t *
gw);
383 #define netif_ip4_addr(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->ip_addr)))
385 #define netif_ip4_netmask(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask)))
387 #define netif_ip4_gw(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->gw)))
389 #define netif_ip_addr4(netif) ((const ip_addr_t*)&((netif)->ip_addr))
391 #define netif_ip_netmask4(netif) ((const ip_addr_t*)&((netif)->netmask))
393 #define netif_ip_gw4(netif) ((const ip_addr_t*)&((netif)->gw))
401 #define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0)
403 #if LWIP_NETIF_STATUS_CALLBACK
406 #if LWIP_NETIF_REMOVE_CALLBACK
413 #define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0)
415 #if LWIP_NETIF_LINK_CALLBACK
419 #if LWIP_NETIF_HOSTNAME
421 #define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0)
423 #define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL)
428 #define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0)
429 #define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL)
432 #if LWIP_IPV6 && LWIP_IPV6_MLD
434 #define netif_set_mld_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->mld_mac_filter = function; }}while(0)
435 #define netif_get_mld_mac_filter(netif) (((netif) != NULL) ? ((netif)->mld_mac_filter) : NULL)
436 #define netif_mld_mac_filter(netif, addr, action) do { if((netif) && (netif)->mld_mac_filter) { (netif)->mld_mac_filter((netif), (addr), (action)); }}while(0)
442 #if !LWIP_NETIF_LOOPBACK_MULTITHREADING
443 void netif_poll_all(
void);
451 #define netif_ip_addr6(netif, i) ((const ip_addr_t*)(&((netif)->ip6_addr[i])))
453 #define netif_ip6_addr(netif, i) ((const ip6_addr_t*)ip_2_ip6(&((netif)->ip6_addr[i])))
454 void netif_ip6_addr_set(
struct netif *
netif,
s8_t addr_idx,
const ip6_addr_t *addr6);
456 #define netif_ip6_addr_state(netif, i) ((netif)->ip6_addr_state[i])
458 s8_t netif_get_ip6_addr_match(
struct netif *
netif,
const ip6_addr_t *ip6addr);
459 void netif_create_ip6_linklocal_address(
struct netif *
netif,
u8_t from_mac_48bit);
460 err_t netif_add_ip6_address(
struct netif *
netif,
const ip6_addr_t *ip6addr,
s8_t *chosen_idx);
461 #define netif_set_ip6_autoconfig_enabled(netif, action) do { if(netif) { (netif)->ip6_autoconfig_enabled = (action); }}while(0)
464 #if LWIP_NETIF_HWADDRHINT
465 #define NETIF_SET_HWADDRHINT(netif, hint) ((netif)->addr_hint = (hint))
467 #define NETIF_SET_HWADDRHINT(netif, hint)
#define LWIP_NUM_NETIF_CLIENT_DATA
Definition: opt.h:1457
#define NETIF_MAX_HWADDR_LEN
Definition: netif.h:63
void netif_set_up(struct netif *netif)
Definition: netif.c:624
void netif_set_down(struct netif *netif)
Definition: netif.c:682
ip4_addr_t ipaddr
Definition: lwip.c:73
uint16_t u16_t
Definition: arch.h:121
netif_input_fn input
Definition: netif.h:244
void netif_remove(struct netif *netif)
Definition: netif.c:377
u8_t hwaddr[NETIF_MAX_HWADDR_LEN]
Definition: netif.h:303
uint32_t u32_t
Definition: arch.h:123
void * state
Definition: netif.h:279
static volatile fsensor_t state
Definition: filament_sensor.c:23
u16_t mtu
Definition: netif.h:299
err_t(* netif_input_fn)(struct pbuf *p, struct netif *inp)
Definition: netif.h:162
u8_t flags
Definition: netif.h:305
struct netif * netif_find(const char *name)
Definition: netif.c:472
void(* netif_status_callback_fn)(struct netif *netif)
Definition: netif.h:198
netif_linkoutput_fn linkoutput
Definition: netif.h:255
ip4_addr_t gw
Definition: lwip.c:75
void netif_init(void)
Definition: netif.c:163
lwip_internal_netif_client_data_index
Definition: netif.h:107
u8_t num
Definition: netif.h:309
uint8_t u8_t
Definition: arch.h:119
ip4_addr_t netmask
Definition: lwip.c:74
ip6_addr_t ip_addr_t
Definition: ip_addr.h:290
err_t(* netif_linkoutput_fn)(struct netif *netif, struct pbuf *p)
Definition: netif.h:196
void
Definition: png.h:1083
u8_t hwaddr_len
Definition: netif.h:301
char name[2]
Definition: netif.h:307
struct netif * next
Definition: netif.h:227
int8_t s8_t
Definition: arch.h:120
void netif_set_default(struct netif *netif)
Definition: netif.c:604
struct netif * netif_list
Definition: netif.c:104
struct netif * netif_add(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
Definition: netif.c:241
s8_t err_t
Definition: err.h:57
err_t netif_input(struct pbuf *p, struct netif *inp)
Definition: netif.c:203
void netif_set_link_down(struct netif *netif)
Definition: netif.c:760
#define LWIP_IPV4
Definition: opt.h:640
void netif_set_link_up(struct netif *netif)
Definition: netif.c:735
#define LWIP_IPV6_NUM_ADDRESSES
Definition: opt.h:2160
err_t(* netif_init_fn)(struct netif *netif)
Definition: netif.h:155
netif_mac_filter_action
Definition: netif.h:143
struct netif * netif_default
Definition: netif.c:105