ConOpSys V2970
P004.07
ANVILEX control operating system
|
Modules | |
IPv4 address handling | |
IPv6 address handling | |
Client data handling | |
Flags | |
MIB2 statistics | |
Classes | |
union | netif_ext_callback_args_t |
Macros | |
#define | netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) |
Typedefs | |
typedef u16_t | netif_nsc_reason_t |
typedef void(* | netif_ext_callback_fn) (struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) |
Functions | |
struct netif * | netif_add_noaddr (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input) |
struct netif * | netif_add (struct netif *netif, void *state, netif_init_fn init, netif_input_fn input) |
void | netif_remove (struct netif *netif) |
void | netif_set_default (struct netif *netif) |
void | netif_set_up (struct netif *netif) |
void | netif_set_down (struct netif *netif) |
void | netif_set_link_up (struct netif *netif) |
void | netif_set_link_down (struct netif *netif) |
u8_t | netif_name_to_index (const char *name) |
char * | netif_index_to_name (u8_t idx, char *name) |
struct netif * | netif_get_by_index (u8_t idx) |
struct netif * | netif_find (const char *name) |
#define netif_is_up | ( | netif | ) | (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) |
Ask if an interface is up
typedef void(* netif_ext_callback_fn) (struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) |
Function used for extended netif status callbacks Note: When parsing reason argument, keep in mind that more reasons may be added in the future!
netif | netif that is affected by change |
reason | change reason |
args | depends on reason, see reason description |
typedef u16_t netif_nsc_reason_t |
Extended netif status callback (NSC) reasons flags. May be extended in the future!
struct netif* netif_add | ( | struct netif * | netif, |
void * | state, | ||
netif_init_fn | init, | ||
netif_input_fn | input | ||
) |
Add a network interface to the list of lwIP netifs.
netif | a pre-allocated netif structure |
ipaddr | IP address for the new netif |
netmask | network mask for the new netif |
gw | default gateway IP address for the new netif |
state | opaque data passed to the new netif |
init | callback function that initialises the interface |
input | callback function that is called to pass ingress packets up in the protocol layer stack. It is recommended to use a function that passes the input directly to the stack (netif_input(), NO_SYS=1 mode) or via sending a message to TCPIP thread (tcpip_input(), NO_SYS=0 mode). These functions use netif flags NETIF_FLAG_ETHARP and NETIF_FLAG_ETHERNET to decide whether to forward to ethernet_input() or ip_input(). In other words, the functions only work when the netif driver is implemented correctly! Most members of struct netif should be be initialised by the netif init function = netif driver (init parameter of this function). IPv6: Don't forget to call netif_create_ip6_linklocal_address() after setting the MAC address in struct netif.hwaddr (IPv6 requires a link-local address). |
References ERR_OK, flags, input, ip_addr_set_zero_ip6, LWIP_ASSERT, LWIP_ASSERT_CORE_LOCKED, LWIP_DEBUGF, LWIP_ERROR, LWIP_IPV6_NUM_ADDRESSES, LWIP_NSC_NETIF_ADDED, mib2_netif_added, mtu, name, NETIF_DEBUG, netif_default, NETIF_FLAG_IGMP, netif_invoke_ext_callback, netif_list, netif_num, NETIF_RESET_HINTS, NETIF_SET_CHECKSUM_CTRL, next, NULL, num, and state.
Referenced by TProtocol_IP_Over_ETHERNET::Init(), netif_add_noaddr(), and netif_init().
struct netif* netif_add_noaddr | ( | struct netif * | netif, |
void * | state, | ||
netif_init_fn | init, | ||
netif_input_fn | input | ||
) |
struct netif* netif_find | ( | const char * | name | ) |
Find a network interface by searching for its name
name | the name of the netif (like netif->name) plus concatenated number in ascii representation (e.g. 'en0') |
References LWIP_ASSERT_CORE_LOCKED, LWIP_DEBUGF, name, NETIF_DEBUG, NETIF_FOREACH, NULL, and num.
Referenced by netif_name_to_index().
Return the interface for the netif index
idx | index of netif to find |
References LWIP_ASSERT_CORE_LOCKED, NETIF_FOREACH, netif_get_index, NETIF_NO_INDEX, and NULL.
Referenced by netif_index_to_name().
char* netif_index_to_name | ( | u8_t | idx, |
char * | name | ||
) |
Return the interface name for the netif matching index or NULL if not found/on error
idx | the interface index of the netif |
name | char buffer of at least NETIF_NAMESIZE bytes |
References lwip_itoa(), name, netif_get_by_index(), netif_index_to_num, NETIF_NAMESIZE, and NULL.
u8_t netif_name_to_index | ( | const char * | name | ) |
Return the interface index for the netif with name or NETIF_NO_INDEX if not found/on error
name | the name of the netif |
References name, netif_find(), netif_get_index, NETIF_NO_INDEX, and NULL.
void netif_remove | ( | struct netif * | netif | ) |
Remove a network interface from the list of lwIP netifs.
netif | the network interface to remove |
References flags, LWIP_ASSERT_CORE_LOCKED, LWIP_DEBUGF, LWIP_IPV6_NUM_ADDRESSES, LWIP_NSC_NETIF_REMOVED, mib2_netif_removed, mib2_remove_ip4, NETIF_DEBUG, netif_default, netif_do_ip_addr_changed(), NETIF_FLAG_IGMP, NETIF_FOREACH, netif_invoke_ext_callback, netif_is_up, netif_list, netif_set_default(), netif_set_down(), next, and NULL.
void netif_set_default | ( | struct netif * | netif | ) |
Set a network interface as the default network interface (used to output all packets for which no specific route is found)
netif | the default network interface |
References LWIP_ASSERT_CORE_LOCKED, LWIP_DEBUGF, mib2_add_route_ip4, mib2_remove_route_ip4, name, NETIF_DEBUG, netif_default, and NULL.
Referenced by TProtocol_IP_Over_ETHERNET::Init(), and netif_remove().
void netif_set_down | ( | struct netif * | netif | ) |
Bring an interface down, disabling any traffic processing.
References flags, LWIP_ASSERT_CORE_LOCKED, LWIP_ERROR, LWIP_NSC_STATUS_CHANGED, MIB2_COPY_SYSUPTIME_TO, netif_clear_flags, NETIF_FLAG_ETHARP, NETIF_FLAG_UP, netif_invoke_ext_callback, NETIF_STATUS_CALLBACK, NULL, netif_ext_callback_args_t::status_changed_s::state, and netif_ext_callback_args_t::status_changed.
Referenced by TProtocol_IP_Over_ETHERNET::Init(), and netif_remove().
void netif_set_link_down | ( | struct netif * | netif | ) |
Called by a driver when its link goes down
References flags, netif_ext_callback_args_t::link_changed, LWIP_ASSERT_CORE_LOCKED, LWIP_ERROR, LWIP_NSC_LINK_CHANGED, netif_clear_flags, NETIF_FLAG_LINK_UP, netif_invoke_ext_callback, NETIF_LINK_CALLBACK, NULL, and netif_ext_callback_args_t::link_changed_s::state.
void netif_set_link_up | ( | struct netif * | netif | ) |
Called by a driver when its link goes up
References flags, netif_ext_callback_args_t::link_changed, LWIP_ASSERT_CORE_LOCKED, LWIP_ERROR, LWIP_NSC_LINK_CHANGED, NETIF_FLAG_LINK_UP, netif_invoke_ext_callback, netif_issue_reports(), NETIF_LINK_CALLBACK, NETIF_REPORT_TYPE_IPV4, NETIF_REPORT_TYPE_IPV6, netif_set_flags, NULL, and netif_ext_callback_args_t::link_changed_s::state.
Referenced by netif_init().
void netif_set_up | ( | struct netif * | netif | ) |
Bring an interface up, available for processing traffic.
References flags, LWIP_ASSERT_CORE_LOCKED, LWIP_ERROR, LWIP_NSC_STATUS_CHANGED, MIB2_COPY_SYSUPTIME_TO, NETIF_FLAG_UP, netif_invoke_ext_callback, netif_issue_reports(), NETIF_REPORT_TYPE_IPV4, NETIF_REPORT_TYPE_IPV6, netif_set_flags, NETIF_STATUS_CALLBACK, NULL, netif_ext_callback_args_t::status_changed_s::state, and netif_ext_callback_args_t::status_changed.
Referenced by TProtocol_IP_Over_ETHERNET::Init(), and netif_init().