]> Kevux Git Server - fll/commitdiff
Update: Relocate firewall rules to under the /etc/network/firewall/.
authorKevin Day <Kevin@kevux.org>
Tue, 17 Sep 2024 02:19:41 +0000 (21:19 -0500)
committerKevin Day <Kevin@kevux.org>
Tue, 17 Sep 2024 02:19:41 +0000 (21:19 -0500)
This should help isolate all of the firewall rules from other network related tasks.

level_3/firewall/c/main/common/string.c
level_3/firewall/c/main/common/string.h
level_3/firewall/c/main/operate.c
level_3/firewall/c/main/operate/process.c
level_3/firewall/data/settings/network/firewall/default-blacklist [moved from level_3/firewall/data/settings/network/default-blacklist with 100% similarity]
level_3/firewall/data/settings/network/firewall/default-whitelist [moved from level_3/firewall/data/settings/network/default-whitelist with 100% similarity]
level_3/firewall/data/settings/network/firewall/example-device-firewall [moved from level_3/firewall/data/settings/network/example-device-firewall with 100% similarity]
level_3/firewall/data/settings/network/firewall/firewall-first [moved from level_3/firewall/data/settings/network/firewall-first with 100% similarity]
level_3/firewall/data/settings/network/firewall/firewall-last [moved from level_3/firewall/data/settings/network/firewall-last with 100% similarity]
level_3/firewall/data/settings/network/firewall/firewall-other [moved from level_3/firewall/data/settings/network/firewall-other with 100% similarity]

index afb34403ea9fbb3d40b46ec5ec5ee2613a636f5b..42a6675227ddf724e839b057772e39d5f67e66a7 100644 (file)
@@ -99,7 +99,7 @@ extern "C" {
   const f_string_static_t firewall_file_other_s = macro_f_string_static_t_initialize_1(FIREWALL_file_other_s, 0, FIREWALL_file_other_s_length);
   const f_string_static_t firewall_file_suffix_s = macro_f_string_static_t_initialize_1(FIREWALL_file_suffix_s, 0, FIREWALL_file_suffix_s_length);
 
-  const f_string_static_t firewall_network_path_s = macro_f_string_static_t_initialize_1(FIREWALL_network_path_s, 0, FIREWALL_network_path_s_length);
+  const f_string_static_t firewall_network_firewall_path_s = macro_f_string_static_t_initialize_1(FIREWALL_network_firewall_path_s, 0, FIREWALL_network_firewall_path_s_length);
   const f_string_static_t firewall_network_devices_s = macro_f_string_static_t_initialize_1(FIREWALL_network_devices_s, 0, FIREWALL_network_devices_s_length);
 #endif // _di_firewall_path_s_
 
index 32760bb208d0fa2d17e5f9eb5c8de59ab0663218..47d695dd4d5493b04cd5f0202dd26aaa29f6d202 100644 (file)
@@ -328,23 +328,23 @@ extern "C" {
   #define FIREWALL_file_other_s  "firewall-other"
   #define FIREWALL_file_suffix_s "-firewall"
 
-  #define FIREWALL_network_path_s    "/etc/network/"
-  #define FIREWALL_network_devices_s "/sys/class/net/"
+  #define FIREWALL_network_firewall_path_s "/etc/network/firewall/"
+  #define FIREWALL_network_devices_s       "/sys/class/net/"
 
   #define FIREWALL_file_first_s_length   14
   #define FIREWALL_file_last_s_length    13
   #define FIREWALL_file_other_s_length   14
   #define FIREWALL_file_suffix_s_length  9
 
-  #define FIREWALL_network_path_s_length    13
-  #define FIREWALL_network_devices_s_length 15
+  #define FIREWALL_network_firewall_path_s_length 22
+  #define FIREWALL_network_devices_s_length       15
 
   extern const f_string_static_t firewall_file_first_s;
   extern const f_string_static_t firewall_file_last_s;
   extern const f_string_static_t firewall_file_other_s;
   extern const f_string_static_t firewall_file_suffix_s;
 
-  extern const f_string_static_t firewall_network_path_s;
+  extern const f_string_static_t firewall_network_firewall_path_s;
   extern const f_string_static_t firewall_network_devices_s;
 #endif // _di_firewall_path_s_
 
index 7497fd719e9b44cf43a8e036eff79bf2f85d153b..17791593aa5eb5664a9ef982ee5990b696daa285 100644 (file)
@@ -55,14 +55,14 @@ extern "C" {
     main->data.file.used = 0;
 
     if (main->setting.flag & firewall_main_flag_operation_stop_restart_lock_d) {
-      main->data.file.used = firewall_network_path_s.used + firewall_file_other_s.used;
+      main->data.file.used = firewall_network_firewall_path_s.used + firewall_file_other_s.used;
 
       f_char_t path_file_other[main->data.file.used + 1];
       main->data.file.string = path_file_other;
       path_file_other[main->data.file.used] = 0;
 
-      memcpy(path_file_other, firewall_network_path_s.string, sizeof(f_char_t) * firewall_network_path_s.used);
-      memcpy(path_file_other + firewall_network_path_s.used, firewall_file_other_s.string, sizeof(f_char_t) * firewall_file_other_s.used);
+      memcpy(path_file_other, firewall_network_firewall_path_s.string, sizeof(f_char_t) * firewall_network_firewall_path_s.used);
+      memcpy(path_file_other + firewall_network_firewall_path_s.used, firewall_file_other_s.string, sizeof(f_char_t) * firewall_file_other_s.used);
 
       firewall_operate_buffer_chain(main, main->data.file, F_false);
       if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) return;
@@ -140,14 +140,14 @@ extern "C" {
     }
 
     if (main->setting.flag & firewall_main_flag_operation_start_restart_d) {
-      main->data.file.used = firewall_network_path_s.used + firewall_file_first_s.used;
+      main->data.file.used = firewall_network_firewall_path_s.used + firewall_file_first_s.used;
 
       f_char_t path_file_first[main->data.file.used + 1];
       main->data.file.string = path_file_first;
       path_file_first[main->data.file.used] = 0;
 
-      memcpy(path_file_first, firewall_network_path_s.string, sizeof(f_char_t) * firewall_network_path_s.used);
-      memcpy(path_file_first + firewall_network_path_s.used, firewall_file_first_s.string, sizeof(f_char_t) * firewall_file_first_s.used);
+      memcpy(path_file_first, firewall_network_firewall_path_s.string, sizeof(f_char_t) * firewall_network_firewall_path_s.used);
+      memcpy(path_file_first + firewall_network_firewall_path_s.used, firewall_file_first_s.string, sizeof(f_char_t) * firewall_file_first_s.used);
 
       firewall_operate_buffer_chain(main, main->data.file, F_false);
 
@@ -172,7 +172,7 @@ extern "C" {
         main->cache.path_file.used = 0;
         main->data.device = j;
 
-        main->setting.state.status = f_memory_array_increase_by(firewall_network_path_s.used + main->setting.devices.array[j].used + firewall_file_suffix_s.used + 1, sizeof(f_char_t), (void **) &main->cache.path_file.string, &main->cache.path_file.used, &main->cache.path_file.size);
+        main->setting.state.status = f_memory_array_increase_by(firewall_network_firewall_path_s.used + main->setting.devices.array[j].used + firewall_file_suffix_s.used + 1, sizeof(f_char_t), (void **) &main->cache.path_file.string, &main->cache.path_file.used, &main->cache.path_file.size);
 
         if (F_status_is_error(main->setting.state.status)) {
           firewall_print_error(&main->program.error, macro_firewall_f(f_memory_array_increase_by));
@@ -182,7 +182,7 @@ extern "C" {
 
         main->data.file = main->cache.path_file;
 
-        main->setting.state.status = f_string_dynamic_append(firewall_network_path_s, &main->cache.path_file);
+        main->setting.state.status = f_string_dynamic_append(firewall_network_firewall_path_s, &main->cache.path_file);
 
         if (F_status_is_error_not(main->setting.state.status)) {
           main->setting.state.status = f_string_dynamic_append(main->setting.devices.array[j], &main->cache.path_file);
@@ -210,7 +210,7 @@ extern "C" {
 
       main->cache.path_file.used = 0;
 
-      main->setting.state.status = f_string_dynamic_append(firewall_network_path_s, &main->cache.path_file);
+      main->setting.state.status = f_string_dynamic_append(firewall_network_firewall_path_s, &main->cache.path_file);
 
       if (F_status_is_error_not(main->setting.state.status)) {
         main->setting.state.status = f_string_dynamic_append(firewall_file_last_s, &main->cache.path_file);
index b7a028c022758f59d4193c69f72c1c8076391f32..f03f55cb790f97b7c363d533a7cb6a71b5c189f4 100644 (file)
@@ -438,7 +438,7 @@ extern "C" {
             main->cache.delimits.used = 0;
             main->cache.path_file_specific.used = 0;
 
-            main->setting.state.status = f_string_dynamic_append(firewall_network_path_s, &main->cache.path_file_specific);
+            main->setting.state.status = f_string_dynamic_append(firewall_network_firewall_path_s, &main->cache.path_file_specific);
 
             if (F_status_is_error_not(main->setting.state.status)) {
               main->setting.state.status = f_string_dynamic_append(main->cache.ip_list, &main->cache.path_file_specific);