Move command registry from components/command/ into components/core/. New modules: mod_canbus, mod_honeypot, mod_fallback, mod_redteam, mod_ota. Replace mod_proxy with tun_core (multiplexed SOCKS5 tunnel). Kconfig extended with per-module settings and async worker config.
67 lines
1.7 KiB
C
67 lines
1.7 KiB
C
/*
|
|
* fb_config.h
|
|
* NVS-backed known networks + C2 fallback addresses.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef CONFIG_FB_MAX_KNOWN_NETWORKS
|
|
#define CONFIG_FB_MAX_KNOWN_NETWORKS 16
|
|
#endif
|
|
|
|
#ifndef CONFIG_FB_MAX_C2_FALLBACKS
|
|
#define CONFIG_FB_MAX_C2_FALLBACKS 4
|
|
#endif
|
|
|
|
#define FB_SSID_MAX_LEN 33 /* 32 + NUL */
|
|
#define FB_PASS_MAX_LEN 65 /* 64 + NUL */
|
|
#define FB_ADDR_MAX_LEN 64 /* "ip:port" or "host:port" */
|
|
|
|
/* ============================================================
|
|
* Known WiFi networks
|
|
* ============================================================ */
|
|
|
|
typedef struct {
|
|
char ssid[FB_SSID_MAX_LEN];
|
|
char pass[FB_PASS_MAX_LEN];
|
|
} fb_network_t;
|
|
|
|
/* Init NVS namespace + migrate from old rt_cfg if needed. */
|
|
void fb_config_init(void);
|
|
|
|
bool fb_config_net_add(const char *ssid, const char *pass);
|
|
bool fb_config_net_remove(const char *ssid);
|
|
int fb_config_net_list(fb_network_t *out, int max_count);
|
|
int fb_config_net_count(void);
|
|
|
|
/* ============================================================
|
|
* C2 fallback addresses
|
|
* ============================================================ */
|
|
|
|
typedef struct {
|
|
char addr[FB_ADDR_MAX_LEN]; /* "ip:port" */
|
|
} fb_c2_addr_t;
|
|
|
|
bool fb_config_c2_add(const char *addr);
|
|
bool fb_config_c2_remove(const char *addr);
|
|
int fb_config_c2_list(fb_c2_addr_t *out, int max_count);
|
|
int fb_config_c2_count(void);
|
|
|
|
/* ============================================================
|
|
* Original MAC storage (for restoration)
|
|
* ============================================================ */
|
|
|
|
void fb_config_save_orig_mac(void);
|
|
bool fb_config_get_orig_mac(uint8_t mac[6]);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|