lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] New Hook IP function for output packages


From: Daniel Lastanao
Subject: [lwip-devel] New Hook IP function for output packages
Date: Fri, 13 Jan 2023 20:31:11 +0100

I already wrote a thread a few months ago about implementing the functions  LWIP_HOOK_IP4_OUTPUT and LWIP_HOOK_IP6_OUTPUT. Now that I´m implementing it. I define these functions in ip4_output and in ip6_output as follows. 

ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
           u8_t ttl, u8_t tos, u8_t proto)
{
  struct netif *netif;

  ...

  #ifdef LWIP_HOOK_IP4_OUTPUT
  if (LWIP_HOOK_IP4_OUTPUT(p, src, dest, ttl, tos, proto, netif)) {
    /* the packet has been eaten */
    return ERR_OK;
  }
#endif
  return ip4_output_if(p, src, dest, ttl, tos, proto, netif);
}


I try to see if these functions work by printing a sentence each time the ESP32 sends a package and the program does not enter the function every time the esp32 sends a packet.

The function is defined in the opt.h file and in my files to use it in my main.cpp.

All help is welcome.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]