Implement support for multiple interfaces and improve code.

This commit is contained in:
Christian Deacon
2025-03-10 16:08:43 -04:00
parent 888028bac3
commit 5d7ca715d1
8 changed files with 304 additions and 113 deletions

View File

@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
if (cli.save || cli.mode == 0)
{
if ((ret = load_cfg(&cfg, cli.cfg_file, NULL)) != 0)
if ((ret = load_cfg(&cfg, cli.cfg_file, 1, NULL)) != 0)
{
fprintf(stderr, "[ERROR] Failed to load config at '%s' (%d)\n", cli.cfg_file, ret);

View File

@@ -10,7 +10,7 @@
struct cli
{
const char* cfg_file;
char* cfg_file;
int help;
@@ -20,7 +20,7 @@ struct cli
int idx;
const char* ip;
char* ip;
int v6;
s64 expires;
@@ -30,11 +30,11 @@ struct cli
int action;
s64 block_time;
const char* src_ip;
const char* dst_ip;
char* src_ip;
char* dst_ip;
const char* src_ip6;
const char* dst_ip6;
char* src_ip6;
char* dst_ip6;
s64 pps;
s64 bps;