lwip: Update AFL host test mock

This commit updates and refactors the AFL host test mock as follows:
- Isolates the mock so that it only relies on lwip component and linux stdlib headers
- Grouped all mock functions in 'esp32_mock.h/c'
- Updates the lwip esp32 port files to include 'esp32_mock.h' when building for linux
- Use host stdlib headers instead of xtensa stdlib headers
This commit is contained in:
Darian Leung
2022-04-28 23:04:07 +08:00
parent 4e4f20d82a
commit e08d574a5d
7 changed files with 303 additions and 191 deletions

View File

@@ -8,17 +8,22 @@
#ifndef LWIP_HDR_ESP_LWIPOPTS_H
#define LWIP_HDR_ESP_LWIPOPTS_H
#include <stdlib.h>
#include "sdkconfig.h"
#include <string.h> // For memcpy
#include <stdlib.h> // For malloc/free
#include <unistd.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/select.h>
#include "esp_task.h"
#include "esp_random.h"
#include "sdkconfig.h"
#include "netif/dhcp_state.h"
#include "sntp/sntp_get_set_time.h"
#ifdef __linux__
#include "esp32_mock.h"
#else
#include "esp_task.h"
#include "esp_random.h"
#endif // __linux__
/*