Skip to content

Commit 6de390c

Browse files
committed
new components and include structure
1 parent 9c83429 commit 6de390c

27 files changed

+422
-300
lines changed

components/acl/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Provides packet filtering for the ESP32 NAT Router.
44

55
idf_component_register(
6-
SRCS "acl.c"
6+
SRCS "acl.c" "acl_nvs.c"
77
INCLUDE_DIRS "include"
88
REQUIRES lwip esp_netif esp_timer
9+
PRIV_REQUIRES nvs_flash cmd_router
910
)

main/acl_nvs.c renamed to components/acl/acl_nvs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "esp_log.h"
99
#include "nvs.h"
1010
#include "acl.h"
11-
#include "router_globals.h"
11+
#include "router_config.h"
1212

1313
static const char *TAG = "acl_nvs";
1414

components/acl/include/acl.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <stdint.h>
1818
#include <stdbool.h>
19+
#include "esp_err.h"
1920
#include "lwip/pbuf.h"
2021

2122
#ifdef __cplusplus
@@ -208,6 +209,18 @@ char* acl_format_ip(uint32_t ip, uint32_t mask, char* buf, size_t buf_len);
208209
*/
209210
bool acl_parse_ip(const char* str, uint32_t* ip, uint32_t* mask);
210211

212+
/**
213+
* @brief Save all ACL rules to NVS
214+
* @return ESP_OK on success
215+
*/
216+
esp_err_t save_acl_rules(void);
217+
218+
/**
219+
* @brief Load all ACL rules from NVS
220+
* @return ESP_OK on success
221+
*/
222+
esp_err_t load_acl_rules(void);
223+
211224
#ifdef __cplusplus
212225
}
213226
#endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
idf_component_register(SRCS "cmd_router.c"
2-
INCLUDE_DIRS .
2+
INCLUDE_DIRS . "${CMAKE_SOURCE_DIR}/include"
33
REQUIRES console nvs_flash esp_wifi driver spi_flash pcap_capture acl remote_console oled_display mbedtls)

components/cmd_router/router_globals.h

Lines changed: 0 additions & 259 deletions
This file was deleted.

components/cmd_system/cmd_system.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "esp_console.h"
1515
#include "esp_system.h"
1616
#include "nvs.h"
17-
#include "router_globals.h"
17+
#include "router_config.h"
1818
#include "esp_sleep.h"
1919
#include "esp_flash.h"
2020
#include "esp_chip_info.h"

components/dhcpserver/dhcpserver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "dhcpserver/dhcpserver.h"
2121
#include "dhcpserver/dhcpserver_options.h"
22-
#include "router_globals.h"
22+
#include "dhcp_reservations.h"
2323

2424
#if ESP_DHCPS
2525

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
idf_component_register(
2+
SRCS "http_server.c"
3+
INCLUDE_DIRS "include"
4+
PRIV_REQUIRES esp_http_server esp_wifi esp_netif esp_event nvs_flash
5+
esp_timer json cmd_router acl pcap_capture
6+
remote_console dhcpserver wpa_supplicant
7+
)
8+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-function)

0 commit comments

Comments
 (0)