-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mdns, dns, dhcp, dhcps: update fuzzer test to work in CI
Closes: IDF-1861 and IDF-1990 * Original commit: espressif/esp-idf@a43c06a
- Loading branch information
1 parent
9772e49
commit e0bc60a
Showing
10 changed files
with
597 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# The following four lines of boilerplate have to be in your project's CMakeLists | ||
# in this exact order for cmake to work correctly | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
|
||
project(fuzz_test_update) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
#define IRAM_ATTR | ||
#define FLAG_ATTR(TYPE) |
35 changes: 35 additions & 0 deletions
35
components/mdns/test_afl_fuzz_host/esp_netif_loopback_mock.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2020 Espressif Systems (Shanghai) CO LTD | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
|
||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "esp_netif_lwip_internal.h" | ||
|
||
esp_err_t esp_netif_get_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info) | ||
{ | ||
return ESP_ERR_NOT_SUPPORTED; | ||
} | ||
|
||
esp_err_t esp_netif_dhcpc_get_status(esp_netif_t *esp_netif, esp_netif_dhcp_status_t *status) | ||
{ | ||
return ESP_ERR_NOT_SUPPORTED; | ||
} | ||
|
||
const char *esp_netif_get_ifkey(esp_netif_t *esp_netif) | ||
{ | ||
return esp_netif->if_key; | ||
} | ||
|
||
esp_err_t esp_netif_get_ip6_linklocal(esp_netif_t *esp_netif, esp_ip6_addr_t *if_ip6) | ||
{ | ||
return ESP_ERR_NOT_SUPPORTED; | ||
} |
71 changes: 71 additions & 0 deletions
71
components/mdns/test_afl_fuzz_host/esp_netif_objects_mock.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright 2020 Espressif Systems (Shanghai) CO LTD | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
|
||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "esp_netif.h" | ||
#include "sys/queue.h" | ||
#include "esp_log.h" | ||
#include "freertos/FreeRTOS.h" | ||
#include "freertos/semphr.h" | ||
#include "esp_netif_private.h" | ||
#include <string.h> | ||
|
||
// | ||
// Purpose of this module is to provide list of esp-netif structures | ||
// - this module has no dependency on a specific network stack (lwip) | ||
// | ||
|
||
struct slist_netifs_s { | ||
esp_netif_t *netif; | ||
SLIST_ENTRY(slist_netifs_s) next; | ||
}; | ||
|
||
SLIST_HEAD(slisthead, slist_netifs_s) s_head = { .slh_first = NULL, }; | ||
|
||
static size_t s_esp_netif_counter = 0; | ||
|
||
ESP_EVENT_DEFINE_BASE(IP_EVENT); | ||
|
||
// | ||
// List manipulation functions | ||
// | ||
esp_err_t esp_netif_add_to_list(esp_netif_t *netif) | ||
{ | ||
return ESP_OK; | ||
} | ||
|
||
|
||
esp_err_t esp_netif_remove_from_list(esp_netif_t *netif) | ||
{ | ||
return ESP_ERR_NOT_FOUND; | ||
} | ||
|
||
size_t esp_netif_get_nr_of_ifs(void) | ||
{ | ||
return s_esp_netif_counter; | ||
} | ||
|
||
esp_netif_t* esp_netif_next(esp_netif_t* netif) | ||
{ | ||
return NULL; | ||
} | ||
|
||
esp_netif_t* esp_netif_next_unsafe(esp_netif_t* netif) | ||
{ | ||
return NULL; | ||
} | ||
|
||
esp_netif_t *esp_netif_get_handle_from_ifkey(const char *if_key) | ||
{ | ||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
#define ERR_OK 0 | ||
#define IPADDR_TYPE_V4 0U | ||
#define IPADDR_TYPE_V6 6U | ||
#define IPADDR_TYPE_ANY 46U |
Oops, something went wrong.