]> Kevux Git Server - kevux-tools/commitdiff
Progress: Further work in TacocaT.
authorKevin Day <thekevinday@gmail.com>
Fri, 5 Jan 2024 02:32:31 +0000 (20:32 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 5 Jan 2024 02:40:34 +0000 (20:40 -0600)
Implements the processing of the Header.

12 files changed:
data/build/tacocat/dependencies
data/build/tacocat/settings
sources/c/tacocat/main/common/enumeration.h
sources/c/tacocat/main/common/print.c
sources/c/tacocat/main/common/print.h
sources/c/tacocat/main/common/string.c
sources/c/tacocat/main/common/string.h
sources/c/tacocat/main/print/error.c
sources/c/tacocat/main/print/error.h
sources/c/tacocat/main/receive.c
sources/c/tacocat/main/receive.h
sources/c/tacocat/main/tacocat.h

index 94519c67e4dcf9f9e9d0c10ced310f232690ed27..9bc3c9af5453ca08f709da97964fc3265fa68743 100644 (file)
@@ -26,6 +26,7 @@ f_time
 fl_conversion
 fl_fss
 fl_print
+fl_status_string
 
 fll_error
 fll_fss
index 05f59efe894f8e58e715a8c8f3ee0725a244c4fe..32f4e41ff88c559bf0f61bf9d316e9486dd80628 100644 (file)
@@ -32,7 +32,9 @@ build_indexer_arguments rcs
 build_language c
 
 build_libraries -lc
-build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_network -lf_path -lf_pipe -lf_print -lf_random -lf_signal -lf_socket -lf_status_string -lf_string -lf_time -lf_type_array -lf_utf
+build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program
+build_libraries-individual -lfl_conversion -lfl_fss -lfl_print -lfl_status_string
+build_libraries-individual -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_network -lf_path -lf_pipe -lf_print -lf_random -lf_signal -lf_socket -lf_status_string -lf_string -lf_time -lf_type_array -lf_utf
 build_libraries-individual_thread -lf_thread
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
index 7a74040d6b1f593af79a72632166103a5359c6a0..64bdb0acce7d0ccf7bacada9b6fa94b6dffe275e 100644 (file)
@@ -101,6 +101,26 @@ extern "C" {
 #endif // _di_kt_tacocat_parameter_e_
 
 /**
+ * Types of packets.
+ *
+ * kt_tacocat_print_flag_*_e:
+ *   - none:   No type is set.
+ *   - done:   The package concludes the connection (from the sender or receiver) or acknowledges the receipt of a packet (receiver).
+ *   - file:   The packet is a file.
+ *   - next:   The packet is a request for the next file.
+ *   - resend: The packet is a request to resend the given part number.
+ */
+#ifndef _di_kt_tacocat_print_flag_e_
+  enum {
+    kt_tacocat_packet_type_none_e   = 0x0,
+    kt_tacocat_packet_type_done_e   = 0x1,
+    kt_tacocat_packet_type_file_e   = 0x2,
+    kt_tacocat_packet_type_next_e   = 0x4,
+    kt_tacocat_packet_type_resend_e = 0x8,
+  }; // enum
+#endif // _di_kt_tacocat_print_flag_e_
+
+/**
  * Flags for fine-tuned print control.
  *
  * kt_tacocat_print_flag_*_e:
index 405f9eb3e1890bb581ca6c4936713370c7983c1b..f4219d1b9f772830ccf20050610536b793b93d4d 100644 (file)
@@ -40,6 +40,7 @@ extern "C" {
     "fl_conversion_dynamic_partial_to_unsigned_detect",
     "fl_conversion_dynamic_to_unsigned_detect",
     "fl_fss_payload_header_map",
+    "fl_status_string_from",
     "fll_fss_extended_read",
     "fll_fss_payload_read",
     "fll_program_parameter_process_context",
index 08c5acf92cdb9c92dfd460c80d30c2ffccf457ca..05f30a75f067beaa408bf654cf411831466d02d9 100644 (file)
@@ -73,6 +73,7 @@ extern "C" {
     kt_tacocat_f_fl_conversion_dynamic_partial_to_unsigned_detect_e,
     kt_tacocat_f_fl_conversion_dynamic_to_unsigned_detect_e,
     kt_tacocat_f_fl_fss_payload_header_map_e,
+    kt_tacocat_f_fl_status_string_from_e,
     kt_tacocat_f_fll_fss_extended_read_e,
     kt_tacocat_f_fll_fss_payload_read_e,
     kt_tacocat_f_fll_program_parameter_process_context_e,
index 071a743aa0c9d9fd246361f342266c61b8337278..ac28854dc5091cafd6f885cbb191c6eb404f2ca3 100644 (file)
@@ -20,11 +20,14 @@ extern "C" {
 #ifndef _di_kt_tacocat_s_
   const f_string_static_t kt_tacocat_classic_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_classic_s, 0, KT_TACOCAT_classic_s_length);
   const f_string_static_t kt_tacocat_digit_negative_one_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_digit_negative_one_s, 0, KT_TACOCAT_digit_negative_one_s_length);
+  const f_string_static_t kt_tacocat_done_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_done_s, 0, KT_TACOCAT_done_s_length);
   const f_string_static_t kt_tacocat_kevux_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_kevux_s, 0, KT_TACOCAT_kevux_s_length);
   const f_string_static_t kt_tacocat_file_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_file_s, 0, KT_TACOCAT_file_s_length);
   const f_string_static_t kt_tacocat_network_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_network_s, 0, KT_TACOCAT_network_s_length);
   const f_string_static_t kt_tacocat_network_or_socket_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_network_or_socket_s, 0, KT_TACOCAT_network_or_socket_s_length);
+  const f_string_static_t kt_tacocat_next_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_next_s, 0, KT_TACOCAT_next_s_length);
   const f_string_static_t kt_tacocat_receive_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_receive_s, 0, KT_TACOCAT_receive_s_length);
+  const f_string_static_t kt_tacocat_resend_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_resend_s, 0, KT_TACOCAT_resend_s_length);
   const f_string_static_t kt_tacocat_salt_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_salt_s, 0, KT_TACOCAT_salt_s_length);
   const f_string_static_t kt_tacocat_send_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_send_s, 0, KT_TACOCAT_send_s_length);
   const f_string_static_t kt_tacocat_send_build_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_send_build_s, 0, KT_TACOCAT_send_build_s_length);
index c53b3b25d961bd88662bf1dfffeaacb35dcf889f..6e69f9ae94eb5ca23e6dcd73a58f3adc27950b28 100644 (file)
@@ -74,11 +74,14 @@ extern "C" {
 #ifndef _di_kt_tacocat_s_
   #define KT_TACOCAT_classic_s            "classic"
   #define KT_TACOCAT_digit_negative_one_s "-1"
-  #define KT_TACOCAT_kevux_s              "kevux"
+  #define KT_TACOCAT_done_s               "done"
   #define KT_TACOCAT_file_s               "file"
+  #define KT_TACOCAT_kevux_s              "kevux"
   #define KT_TACOCAT_network_s            "network"
   #define KT_TACOCAT_network_or_socket_s  "network / socket"
+  #define KT_TACOCAT_next_s               "next"
   #define KT_TACOCAT_receive_s            "receive"
+  #define KT_TACOCAT_resend_s             "resend"
   #define KT_TACOCAT_salt_s               "salt"
   #define KT_TACOCAT_send_s               "send"
   #define KT_TACOCAT_send_build_s         "send build"
@@ -95,11 +98,14 @@ extern "C" {
 
   #define KT_TACOCAT_classic_s_length            7
   #define KT_TACOCAT_digit_negative_one_s_length 2
-  #define KT_TACOCAT_kevux_s_length              5
+  #define KT_TACOCAT_done_s_length               4
   #define KT_TACOCAT_file_s_length               4
+  #define KT_TACOCAT_kevux_s_length              5
   #define KT_TACOCAT_network_s_length            7
   #define KT_TACOCAT_network_or_socket_s_length  16
+  #define KT_TACOCAT_next_s_length               4
   #define KT_TACOCAT_receive_s_length            7
+  #define KT_TACOCAT_resend_s_length             6
   #define KT_TACOCAT_salt_s_length               4
   #define KT_TACOCAT_send_s_length               4
   #define KT_TACOCAT_send_build_s_length         19
@@ -116,11 +122,14 @@ extern "C" {
 
   extern const f_string_static_t kt_tacocat_classic_s;
   extern const f_string_static_t kt_tacocat_digit_negative_one_s;
+  extern const f_string_static_t kt_tacocat_done_s;
   extern const f_string_static_t kt_tacocat_kevux_s;
   extern const f_string_static_t kt_tacocat_file_s;
   extern const f_string_static_t kt_tacocat_network_s;
   extern const f_string_static_t kt_tacocat_network_or_socket_s;
+  extern const f_string_static_t kt_tacocat_next_s;
   extern const f_string_static_t kt_tacocat_receive_s;
+  extern const f_string_static_t kt_tacocat_resend_s;
   extern const f_string_static_t kt_tacocat_salt_s;
   extern const f_string_static_t kt_tacocat_send_s;
   extern const f_string_static_t kt_tacocat_send_build_s;
index 633b5d8972313c613302b157b7a247601f9e7ea8..a8882df0d431a4b47adc39b2859a0b76740fb7eb 100644 (file)
@@ -154,6 +154,34 @@ extern "C" {
   }
 #endif // _di_kt_tacocat_print_error_on_file_send_
 
+#ifndef _di_kt_tacocat_print_error_on_packet_header_value_invalid_
+  f_status_t kt_tacocat_print_error_on_packet_header_value_invalid(fl_print_t * const print, const f_string_static_t on, const f_string_static_t network, const f_status_t status, const f_string_static_t name, const f_string_static_t buffer, const f_range_t object, const f_range_t content) {
+
+    if (!print) return F_status_set_error(F_output_not);
+    if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    f_file_stream_lock(print->to);
+
+    fl_print_format("%[%QNetwork packet header on%] ", print->to, print->set->error, print->prefix, print->set->error);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, on, print->set->notable);
+    fl_print_format(" %[for '%]", print->to, print->set->error, print->set->error, f_string_eol_s);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, network, print->set->notable);
+    fl_print_format("%[' with file '%]", print->to, print->set->error, print->set->error, f_string_eol_s);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, name, print->set->notable);
+    fl_print_format("%[' is invalid for Object '%]", print->to, print->set->error, print->set->error, f_string_eol_s);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, buffer, object, print->set->notable);
+    fl_print_format("%[' and Content '%]", print->to, print->set->error, print->set->error, f_string_eol_s);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, buffer, content, print->set->notable);
+    fl_print_format("%[' with a status code of %]", print->to, print->set->error, print->set->error, f_string_eol_s);
+    fl_print_format(f_string_format_ul_single_s.string, print->to, print->set->notable, status, print->set->notable);
+    fl_print_format("%[.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print->to);
+
+    return F_okay;
+  }
+#endif // _di_kt_tacocat_print_error_on_packet_header_value_invalid_
+
 #ifndef _di_kt_tacocat_print_error_on_packet_invalid_
   f_status_t kt_tacocat_print_error_on_packet_invalid(fl_print_t * const print, const f_string_static_t on, const f_string_static_t network) {
 
index 342e77d023207a007d15b59c6b1459db1ed9c1d9..145d3b95163666a125502c90328a3292538db570 100644 (file)
@@ -245,6 +245,40 @@ extern "C" {
 #endif // _di_kt_tacocat_print_error_on_file_send_
 
 /**
+ * Print network-related error message for when a packet has an invalid header Object and Content.
+ *
+ * @param print
+ *   The output structure to print to.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param on
+ *   The network connection direction, which should either be "receive" or "send".
+ * @param network
+ *   The name of the network in which the error is related.
+ * @param status
+ *   The status code representing the error.
+ * @param name
+ *   The name of the file.
+ * @param buffer
+ *   The buffer containing the entire header.
+ * @param object
+ *   The range in the buffer representing the header Object with the error.
+ * @param content
+ *   The range in the buffer representing the header Content with the error.
+ *
+ * @return
+ *   F_okay on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_kt_tacocat_print_error_on_packet_header_value_invalid_
+  extern f_status_t kt_tacocat_print_error_on_packet_header_value_invalid(fl_print_t * const print, const f_string_static_t on, const f_string_static_t network, const f_status_t status, const f_string_static_t name, const f_string_static_t buffer, const f_range_t object, const f_range_t content);
+#endif // _di_kt_tacocat_print_error_on_packet_header_value_invalid_
+
+/**
  * Print network-related error message for when a packet is invalid.
  *
  * @param print
index aca37d2aad773273ebecbd6a8b8a93c7cbe3c7b7..d78700b639f00bc36e30344bc9d1beca5d79a1fc 100644 (file)
@@ -462,6 +462,7 @@ extern "C" {
         kt_tacocat_receive_process_extract_header(main, set, i);
 
         if (F_status_is_error(set->status)) {
+          // @todo handle F_packet error, setup the sending of an invalid packet response (things similar to this needs to be done in multiple places).
           ++set->retry;
 
           return;
@@ -525,7 +526,9 @@ extern "C" {
         return;
     }
 
-    for (f_number_unsigned_t i = 0; i < set->objects_header.used; ++i) {
+    f_number_unsigned_t i = 0;
+
+    for (; i < set->objects_header.used; ++i) {
 
       // Index 0 is the status.
       if (f_compare_dynamic_partial_string(f_fss_payload_object_status_s.string, set->buffer, f_fss_payload_object_status_s.used, set->objects_header.array[i]) == F_equal_to) {
@@ -547,14 +550,14 @@ extern "C" {
 
         // Require Content to exist.
         if (!set->contents_header.array[i].used) {
-         set->abstruses.array[0].value.type = f_abstruse_none_e;
+         set->abstruses.array[1].value.type = f_abstruse_none_e;
 
           continue;
         }
 
-        set->abstruses.array[0].key = f_fss_payload_object_type_s;
-        set->abstruses.array[0].value.type = f_abstruse_range_e;
-        set->abstruses.array[0].value.is.a_range = set->contents_header.array[i].array[0];
+        set->abstruses.array[1].key = f_fss_payload_object_type_s;
+        set->abstruses.array[1].value.type = f_abstruse_range_e;
+        set->abstruses.array[1].value.is.a_range = set->contents_header.array[i].array[0];
       }
 
       // Index 2 is the length.
@@ -562,14 +565,14 @@ extern "C" {
 
         // Require Content to exist.
         if (!set->contents_header.array[i].used) {
-         set->abstruses.array[1].value.type = f_abstruse_none_e;
+         set->abstruses.array[2].value.type = f_abstruse_none_e;
 
           continue;
         }
 
-        set->abstruses.array[1].key = f_fss_payload_object_length_s;
-        set->abstruses.array[1].value.type = f_abstruse_range_e;
-        set->abstruses.array[1].value.is.a_range = set->contents_header.array[i].array[0];
+        set->abstruses.array[2].key = f_fss_payload_object_length_s;
+        set->abstruses.array[2].value.type = f_abstruse_range_e;
+        set->abstruses.array[2].value.is.a_range = set->contents_header.array[i].array[0];
       }
 
       // Index 3 is the part.
@@ -577,14 +580,14 @@ extern "C" {
 
         // Require Content to exist.
         if (!set->contents_header.array[i].used) {
-         set->abstruses.array[2].value.type = f_abstruse_none_e;
+         set->abstruses.array[3].value.type = f_abstruse_none_e;
 
           continue;
         }
 
-        set->abstruses.array[2].key = f_fss_payload_object_part_s;
-        set->abstruses.array[2].value.type = f_abstruse_range_e;
-        set->abstruses.array[2].value.is.a_range = set->contents_header.array[i].array[0];
+        set->abstruses.array[3].key = f_fss_payload_object_part_s;
+        set->abstruses.array[3].value.type = f_abstruse_range_e;
+        set->abstruses.array[3].value.is.a_range = set->contents_header.array[i].array[0];
       }
 
       // Index 4 is the total number of packets (based on block size).
@@ -592,14 +595,14 @@ extern "C" {
 
         // Require Content to exist.
         if (!set->contents_header.array[i].used) {
-         set->abstruses.array[3].value.type = f_abstruse_none_e;
+         set->abstruses.array[4].value.type = f_abstruse_none_e;
 
           continue;
         }
 
-        set->abstruses.array[3].key = f_fss_payload_object_total_s;
-        set->abstruses.array[3].value.type = f_abstruse_range_e;
-        set->abstruses.array[3].value.is.a_range = set->contents_header.array[i].array[0];
+        set->abstruses.array[4].key = f_fss_payload_object_total_s;
+        set->abstruses.array[4].value.type = f_abstruse_range_e;
+        set->abstruses.array[4].value.is.a_range = set->contents_header.array[i].array[0];
       }
 
       // Index 5 is the name (file name).
@@ -607,32 +610,115 @@ extern "C" {
 
         // Require Content to exist.
         if (!set->contents_header.array[i].used) {
-         set->abstruses.array[4].value.type = f_abstruse_none_e;
+         set->abstruses.array[5].value.type = f_abstruse_none_e;
 
           continue;
         }
 
-        set->abstruses.array[4].key = f_fss_payload_object_name_s;
-        set->abstruses.array[4].value.type = f_abstruse_range_e;
-        set->abstruses.array[4].value.is.a_range = set->contents_header.array[i].array[0];
+        set->abstruses.array[5].key = f_fss_payload_object_name_s;
+        set->abstruses.array[5].value.type = f_abstruse_range_e;
+        set->abstruses.array[5].value.is.a_range = set->contents_header.array[i].array[0];
       }
 
-      // Index 5 is the name (file name).
+      // Index 6 is the salt.
       else if (f_compare_dynamic_partial_string(kt_tacocat_salt_s.string, set->buffer, kt_tacocat_salt_s.used, set->objects_header.array[i]) == F_equal_to) {
 
         // Require Content to exist.
         if (!set->contents_header.array[i].used) {
-          set->abstruses.array[5].value.type = f_abstruse_none_e;
+          set->abstruses.array[6].value.type = f_abstruse_none_e;
 
           continue;
         }
 
-        set->abstruses.array[5].key = kt_tacocat_salt_s;
-        set->abstruses.array[5].value.type = f_abstruse_range_e;
-        set->abstruses.array[5].value.is.a_range = set->contents_header.array[i].array[0];
+        set->abstruses.array[6].key = kt_tacocat_salt_s;
+        set->abstruses.array[6].value.type = f_abstruse_range_e;
+        set->abstruses.array[6].value.is.a_range = set->contents_header.array[i].array[0];
       }
     } // for
 
+    // Convert the status code.
+    if (set->abstruses.array[0].value.type) {
+      const f_number_unsigned_t length = set->abstruses.array[0].value.is.a_range.stop - set->abstruses.array[0].value.is.a_range.start + 1;
+      char buffer[length];
+      f_status_t status = F_false;
+
+      memcpy(buffer, set->buffer.string + set->abstruses.array[0].value.is.a_range.start, length);
+
+      const f_string_static_t status_string = macro_f_string_static_t_initialize_1(buffer, 0, length);
+
+      set->status = fl_status_string_from(status_string, &status);
+
+      if (set->status == F_okay) {
+        set->abstruses.array[0].value.type = f_abstruse_unsigned_e;
+        set->abstruses.array[0].value.is.a_unsigned = (f_number_unsigned_t) status;
+      }
+      else {
+        kt_tacocat_print_error_on_packet_header_value_invalid(&main->program.error, kt_tacocat_receive_s, set->network, set->status, set->name, set->buffer, set->objects.array[at], set->abstruses.array[6].value.is.a_range);
+
+        set->abstruses.array[0].value.type = f_abstruse_none_e;
+        set->abstruses.array[0].value.is.a_unsigned = 0;
+
+        set->status = F_status_set_error(F_packet);
+      }
+    }
+
+    // Convert the type.
+    if (set->abstruses.array[1].value.type) {
+      if (f_compare_dynamic_partial_string(kt_tacocat_file_s.string, set->buffer, kt_tacocat_file_s.used, set->abstruses.array[1].value.is.a_range) == F_equal_to) {
+        set->abstruses.array[1].value.type = f_abstruse_unsigned_e;
+        set->abstruses.array[1].value.is.a_unsigned = (f_number_unsigned_t) kt_tacocat_packet_type_file_e;
+      }
+      else if (f_compare_dynamic_partial_string(kt_tacocat_done_s.string, set->buffer, kt_tacocat_done_s.used, set->abstruses.array[1].value.is.a_range) == F_equal_to) {
+        set->abstruses.array[1].value.type = f_abstruse_unsigned_e;
+        set->abstruses.array[1].value.is.a_unsigned = (f_number_unsigned_t) kt_tacocat_packet_type_done_e;
+      }
+      else if (f_compare_dynamic_partial_string(kt_tacocat_next_s.string, set->buffer, kt_tacocat_next_s.used, set->abstruses.array[1].value.is.a_range) == F_equal_to) {
+        set->abstruses.array[1].value.type = f_abstruse_unsigned_e;
+        set->abstruses.array[1].value.is.a_unsigned = (f_number_unsigned_t) kt_tacocat_packet_type_next_e;
+      }
+      else if (f_compare_dynamic_partial_string(kt_tacocat_resend_s.string, set->buffer, kt_tacocat_resend_s.used, set->abstruses.array[1].value.is.a_range) == F_equal_to) {
+        set->abstruses.array[1].value.type = f_abstruse_unsigned_e;
+        set->abstruses.array[1].value.is.a_unsigned = (f_number_unsigned_t) kt_tacocat_packet_type_resend_e;
+      }
+      else {
+        set->status = F_status_set_error(F_found_not);
+
+        kt_tacocat_print_error_on_packet_header_value_invalid(&main->program.error, kt_tacocat_receive_s, set->network, set->status, set->name, set->buffer, set->objects.array[at], set->abstruses.array[6].value.is.a_range);
+
+        set->abstruses.array[1].value.type = f_abstruse_none_e;
+        set->abstruses.array[1].value.is.a_unsigned = 0;
+
+        set->status = F_status_set_error(F_packet);
+
+        return;
+      }
+    }
+
+    // Convert the length, part, and total.
+    {
+      f_number_unsigned_t number = 0;
+
+      for (i = 2; i < 5; ++i) {
+
+        if (!set->abstruses.array[i].value.type) continue;
+
+        set->status = fl_conversion_dynamic_partial_to_unsigned(fl_conversion_data_base_10_c, set->buffer, set->abstruses.array[i].value.is.a_range, &number);
+
+        if (set->status == F_okay) {
+          set->abstruses.array[i].value.type = f_abstruse_unsigned_e;
+          set->abstruses.array[i].value.is.a_unsigned = number;
+        }
+        else {
+          kt_tacocat_print_error_on_packet_header_value_invalid(&main->program.error, kt_tacocat_receive_s, set->network, set->status, set->name, set->buffer, set->objects.array[at], set->abstruses.array[6].value.is.a_range);
+
+          set->abstruses.array[i].value.type = f_abstruse_none_e;
+          set->abstruses.array[i].value.is.a_unsigned = 0;
+
+          set->status = F_status_set_error(F_packet);
+        }
+      } // for
+    }
+
     set->abstruses.used = 6;
     set->status = F_okay;
   }
index e75c5d2586f40ea02523bb8f11fa665e3735927e..a7c68cec4759353257224eb75562ebbb23906bc3 100644 (file)
@@ -169,6 +169,8 @@ extern "C" {
  *     F_okay on success.
  *     F_data_not on success, but no data to process.
  *
+ *     F_packet (with error bit) on invalid packet header.
+ *
  *     Errors (with error bit) from: fll_fss_extended_read().
  * @param at
  *   The index position representing which Object and Contents set to use.
index 1153e304cf7a9d9bb8bb534f0d356ca509d96afc..9a44f2f7240ca8779a597f14696bfe18af7638f4 100644 (file)
@@ -45,6 +45,7 @@
 #include <fll/level_1/fss.h>
 #include <fll/level_1/fss/payload.h>
 #include <fll/level_1/print.h>
+#include <fll/level_1/status_string.h>
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>