@ -116,8 +116,10 @@ struct ip_pcb {
/* Global variables of this module, kept in a struct for efficient access using base+index. */
struct ip_globals
{
/** The interface that provid ed the packet for the current callback invocation. */
/** The interface that accept ed the packet for the current callback invocation. */
struct netif * current_netif ;
/** The interface that received the packet for the current callback invocation. */
struct netif * current_input_netif ;
/** Header of the input packet currently being processed. */
const struct ip_hdr * current_ip4_header ;
# if LWIP_IPV6
@ -134,10 +136,15 @@ struct ip_globals
extern struct ip_globals ip_data ;
/** Get the interface that received the current packet.
/** Get the interface that accepted the current packet.
* This may or may not be the receiving netif , depending on your netif / network setup .
* This function must only be called from a receive callback ( udp_recv ,
* raw_recv , tcp_accept ) . It will return NULL otherwise . */
# define ip_current_netif() (ip_data.current_netif)
/** Get the interface that received the current packet.
* This function must only be called from a receive callback ( udp_recv ,
* raw_recv , tcp_accept ) . It will return NULL otherwise . */
# define ip_current_input_netif() (ip_data.current_input_netif)
/** Get the IP header of the current packet.
* This function must only be called from a receive callback ( udp_recv ,
* raw_recv , tcp_accept ) . It will return NULL otherwise . */