Trying to use hooks
This commit is contained in:
parent
0b94c99567
commit
1d159e6d7c
4 changed files with 27 additions and 8 deletions
3
ESPTest/include/lwip_hooks.h
Normal file
3
ESPTest/include/lwip_hooks.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#define LWIP_HOOK_IP4_INPUT lwip_hook_ip4_input
|
9
ESPTest/include/myhook.c
Normal file
9
ESPTest/include/myhook.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include "lwip/netif.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
int IRAM_ATTR lwip_hook_ip4_input(struct pbuf *pbuf, struct netif *input_netif)
|
||||
{
|
||||
ESP_LOGI("HOOK", "Testing...");
|
||||
return 0; // we don't consume the packet
|
||||
}
|
15
ESPTest/include/myhook.h
Normal file
15
ESPTest/include/myhook.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/pbuf.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
int lwip_hook_ip4_input(struct pbuf *pbuf, struct netif *input_netif);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in a new issue