lwIP 2.0.0  lwIP 2.0.0
LightweightIPstack

Macros

#define LWIP_HOOK_IP4_INPUT(pbuf, input_netif)
 
#define LWIP_HOOK_IP4_ROUTE()
 
#define LWIP_HOOK_IP4_ROUTE_SRC(dest, src)
 
#define LWIP_HOOK_ETHARP_GET_GW(netif, dest)
 
#define LWIP_HOOK_IP6_INPUT(pbuf, input_netif)
 
#define LWIP_HOOK_IP6_ROUTE(src, dest)
 
#define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr)
 
#define LWIP_HOOK_VLAN_SET(netif, eth_hdr, vlan_hdr)
 
#define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type)
 

Detailed Description

Hooks are undefined by default, define them to a function if you need them.

Macro Definition Documentation

#define LWIP_HOOK_ETHARP_GET_GW (   netif,
  dest 
)

LWIP_HOOK_ETHARP_GET_GW(netif, dest):

  • called from etharp_output() (IPv4)
  • netif: the netif used for sending
  • dest: the destination IPv4 address Returns the IPv4 address of the gateway to handle the specified destination IPv4 address. If NULL is returned, the netif's default gateway is used. The returned address MUST be reachable on the specified netif! This function is meant to implement advanced IPv4 routing together with LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is not part of lwIP but can e.g. be hidden in the netif's state argument.
#define LWIP_HOOK_IP4_INPUT (   pbuf,
  input_netif 
)

LWIP_HOOK_IP4_INPUT(pbuf, input_netif):

  • called from ip_input() (IPv4)
  • pbuf: received struct pbuf passed to ip_input()
  • input_netif: struct netif on which the packet has been received Return values:
  • 0: Hook has not consumed the packet, packet is processed as normal
  • != 0: Hook has consumed the packet. If the hook consumed the packet, 'pbuf' is in the responsibility of the hook (i.e. free it when done).
#define LWIP_HOOK_IP4_ROUTE ( )

LWIP_HOOK_IP4_ROUTE(dest):

  • called from ip_route() (IPv4)
  • dest: destination IPv4 address Returns the destination netif or NULL if no destination netif is found. In that case, ip_route() continues as normal.
#define LWIP_HOOK_IP4_ROUTE_SRC (   dest,
  src 
)

LWIP_HOOK_IP4_ROUTE_SRC(dest, src):

#define LWIP_HOOK_IP6_INPUT (   pbuf,
  input_netif 
)

LWIP_HOOK_IP6_INPUT(pbuf, input_netif):

  • called from ip6_input() (IPv6)
  • pbuf: received struct pbuf passed to ip6_input()
  • input_netif: struct netif on which the packet has been received Return values:
  • 0: Hook has not consumed the packet, packet is processed as normal
  • != 0: Hook has consumed the packet. If the hook consumed the packet, 'pbuf' is in the responsibility of the hook (i.e. free it when done).
#define LWIP_HOOK_IP6_ROUTE (   src,
  dest 
)

LWIP_HOOK_IP6_ROUTE(src, dest):

  • called from ip6_route() (IPv6)
  • src: sourc IPv6 address
  • dest: destination IPv6 address Returns the destination netif or NULL if no destination netif is found. In that case, ip6_route() continues as normal.
#define LWIP_HOOK_MEMP_AVAILABLE (   memp_t_type)

LWIP_HOOK_MEMP_AVAILABLE(memp_t_type):

  • called from memp_free() when a memp pool was empty and an item is now available
#define LWIP_HOOK_VLAN_CHECK (   netif,
  eth_hdr,
  vlan_hdr 
)

LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr):

  • called from ethernet_input() if VLAN support is enabled
  • netif: struct netif on which the packet has been received
  • eth_hdr: struct eth_hdr of the packet
  • vlan_hdr: struct eth_vlan_hdr of the packet Return values:
  • 0: Packet must be dropped.
  • != 0: Packet must be accepted.
#define LWIP_HOOK_VLAN_SET (   netif,
  eth_hdr,
  vlan_hdr 
)

LWIP_HOOK_VLAN_SET(netif, eth_hdr, vlan_hdr):

  • called from etharp_raw() and etharp_send_ip() if VLAN support is enabled
  • netif: struct netif that the packet will be sent through
  • eth_hdr: struct eth_hdr of the packet
  • vlan_hdr: struct eth_vlan_hdr of the packet Return values:
  • 0: Packet shall not contain VLAN header.
  • != 0: Packet shall contain VLAN header. Hook can be used to set prio_vid field of vlan_hdr.