An order header helps achieve something like serialization.
This is different from the packet number.
The order represets the order in regards to the packets sent and not the specific data (such as `part`).
For example, if a retry is requested for the same packet, then the order will have increased but the actual `part` number would be the same.
#define kt_tacocat_max_buffer_d 0x10000000 // 0x10^0x5 * 0x100 (Which is 256 Megabytes (0x10^0x5 where the base unit is 16 rather than 10 or 2 (maybe call this xytes? Megaxytes?)).
#define kt_tacocat_max_maintain_d 0x100000 // 0x10^5 (Which is 1 Megabyte in base 16 (1 Megaxyte (MX)).
#define kt_tacocat_max_buffer_d 0x10000000 // 0x10^0x5 * 0x100 (Which is 256 Megabytes (0x10^0x5 where the base unit is 16 rather than 10 or 2 (maybe call this xytes? Megaxytes?)).
#define kt_tacocat_max_maintain_d 0x100000 // 0x10^5 (Which is 1 Megabyte in base 16 (1 Megaxyte (MX)).
- #define kt_tacocat_packet_headers_d 0xb
+ #define kt_tacocat_packet_headers_d 0xc
#define kt_tacocat_packet_id_length_d 0x20
#define kt_tacocat_packet_minimum_d 0x11
#define kt_tacocat_packet_peek_d 0x40
#define kt_tacocat_packet_id_length_d 0x20
#define kt_tacocat_packet_minimum_d 0x11
#define kt_tacocat_packet_peek_d 0x40
const f_string_static_t kt_tacocat_network_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_network_s, KT_TACOCAT_network_s_length);
const f_string_static_t kt_tacocat_network_or_socket_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_network_or_socket_s, KT_TACOCAT_network_or_socket_s_length);
const f_string_static_t kt_tacocat_next_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_next_s, KT_TACOCAT_next_s_length);
const f_string_static_t kt_tacocat_network_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_network_s, KT_TACOCAT_network_s_length);
const f_string_static_t kt_tacocat_network_or_socket_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_network_or_socket_s, KT_TACOCAT_network_or_socket_s_length);
const f_string_static_t kt_tacocat_next_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_next_s, KT_TACOCAT_next_s_length);
+ const f_string_static_t kt_tacocat_order_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_order_s, KT_TACOCAT_order_s_length);
const f_string_static_t kt_tacocat_receive_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_receive_s, KT_TACOCAT_receive_s_length);
const f_string_static_t kt_tacocat_receive_done_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_receive_done_s, KT_TACOCAT_receive_done_s_length);
const f_string_static_t kt_tacocat_resend_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_resend_s, KT_TACOCAT_resend_s_length);
const f_string_static_t kt_tacocat_receive_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_receive_s, KT_TACOCAT_receive_s_length);
const f_string_static_t kt_tacocat_receive_done_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_receive_done_s, KT_TACOCAT_receive_done_s_length);
const f_string_static_t kt_tacocat_resend_s = macro_f_string_static_t_initialize_3(KT_TACOCAT_resend_s, KT_TACOCAT_resend_s_length);
#define KT_TACOCAT_network_s "network"
#define KT_TACOCAT_network_or_socket_s "network / socket"
#define KT_TACOCAT_next_s "next"
#define KT_TACOCAT_network_s "network"
#define KT_TACOCAT_network_or_socket_s "network / socket"
#define KT_TACOCAT_next_s "next"
+ #define KT_TACOCAT_order_s "order"
#define KT_TACOCAT_receive_s "receive"
#define KT_TACOCAT_receive_done_s "receive done"
#define KT_TACOCAT_resend_s "resend"
#define KT_TACOCAT_receive_s "receive"
#define KT_TACOCAT_receive_done_s "receive done"
#define KT_TACOCAT_resend_s "resend"
#define KT_TACOCAT_network_s_length 7
#define KT_TACOCAT_network_or_socket_s_length 17
#define KT_TACOCAT_next_s_length 4
#define KT_TACOCAT_network_s_length 7
#define KT_TACOCAT_network_or_socket_s_length 17
#define KT_TACOCAT_next_s_length 4
+ #define KT_TACOCAT_order_s_length 5
#define KT_TACOCAT_receive_s_length 7
#define KT_TACOCAT_receive_done_s_length 12
#define KT_TACOCAT_resend_s_length 6
#define KT_TACOCAT_receive_s_length 7
#define KT_TACOCAT_receive_done_s_length 12
#define KT_TACOCAT_resend_s_length 6
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_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_order_s;
extern const f_string_static_t kt_tacocat_receive_s;
extern const f_string_static_t kt_tacocat_receive_done_s;
extern const f_string_static_t kt_tacocat_resend_s;
extern const f_string_static_t kt_tacocat_receive_s;
extern const f_string_static_t kt_tacocat_receive_done_s;
extern const f_string_static_t kt_tacocat_resend_s;
* - flag: A set of flags.
* - step: The current step the socket set is operating under (this is either a send or receive step define depending on whether or not flag has the send bit set).
* - retry: The current number of retries performed.
* - flag: A set of flags.
* - step: The current step the socket set is operating under (this is either a send or receive step define depending on whether or not flag has the send bit set).
* - retry: The current number of retries performed.
+ * - order: An integer whose count increase on each packet (used for things like serialization and packet ordering).
* - part: The current active part number.
* - port: The current port number for the socket.
*
* - part: The current active part number.
* - port: The current port number for the socket.
*
uint16_t flag;
uint16_t step;
uint16_t retry;
uint16_t flag;
uint16_t step;
uint16_t retry;
f_number_unsigned_t part;
f_number_unsigned_t port;
f_number_unsigned_t part;
f_number_unsigned_t port;
.flag = kt_tacocat_socket_step_flag_none_d, \
.step = kt_tacocat_socket_step_receive_none_e, \
.retry = 0, \
.flag = kt_tacocat_socket_step_flag_none_d, \
.step = kt_tacocat_socket_step_receive_none_e, \
.retry = 0, \
.part = 0, \
.port = 0, \
.file = f_file_t_initialize, \
.part = 0, \
.port = 0, \
.file = f_file_t_initialize, \
.flag = kt_tacocat_socket_step_flag_none_d, \
.step = kt_tacocat_socket_step_receive_none_e, \
.retry = 0, \
.flag = kt_tacocat_socket_step_flag_none_d, \
.step = kt_tacocat_socket_step_receive_none_e, \
.retry = 0, \
.part = 0, \
.port = 0, \
.file = f_file_t_initialize, \
.part = 0, \
.port = 0, \
.file = f_file_t_initialize, \
.flag = kt_tacocat_socket_step_flag_none_d, \
.step = kt_tacocat_socket_step_receive_none_e, \
.retry = 0, \
.flag = kt_tacocat_socket_step_flag_none_d, \
.step = kt_tacocat_socket_step_receive_none_e, \
.retry = 0, \
.part = 0, \
.port = 0, \
.file = f_file_t_initialize, \
.part = 0, \
.port = 0, \
.file = f_file_t_initialize, \
f_range_t_initialize,
f_range_t_initialize,
f_range_t_initialize,
f_range_t_initialize,
f_range_t_initialize,
f_range_t_initialize,
};
f_status_t status = set->status = F_okay;
};
f_status_t status = set->status = F_okay;
f_fss_payload_object_time_s,
f_fss_payload_object_signature_s,
kt_tacocat_encrypt_s,
f_fss_payload_object_time_s,
f_fss_payload_object_signature_s,
kt_tacocat_encrypt_s,
};
for (; i < set->objects_header.used; ++i) {
};
for (; i < set->objects_header.used; ++i) {
// @todo convert encrypt (10).
// @todo convert encrypt (10).
- // Convert the length (2), part (3), total (4), and salt (6).
+ // Convert the length (2), part (3), total (4), salt (6), and order (11).
{
f_number_unsigned_t number = 0;
{
f_number_unsigned_t number = 0;
- for (i = 2; i < 7; ++i) {
+ for (i = 2; i < 12; ++i) {
- if (!set->abstruses.array[i].value.type || i == 5) continue;
+ if (!set->abstruses.array[i].value.type || i == 5 || (i > 6 && i < 11)) continue;
status = fl_conversion_dynamic_partial_to_unsigned(fl_conversion_data_base_10_c, set->buffer, ranges[i], &number);
status = fl_conversion_dynamic_partial_to_unsigned(fl_conversion_data_base_10_c, set->buffer, ranges[i], &number);
- // @todo index 9 is the signature.
-
set->abstruses.used = kt_tacocat_packet_headers_d;
}
#endif // _di_kt_tacocat_packet_extract_header_
set->abstruses.used = kt_tacocat_packet_headers_d;
}
#endif // _di_kt_tacocat_packet_extract_header_
#endif // _en_gpgme_support_
#ifdef _di_thread_support_
#endif // _en_gpgme_support_
#ifdef _di_thread_support_
- // @todo implement fork and wait for both receive and send.
+ // Not supported at this time.
#else
{
if (main->setting.flag & kt_tacocat_main_flag_receive_d) {
#else
{
if (main->setting.flag & kt_tacocat_main_flag_receive_d) {
set->abstruses.array[10].value.is.a_dynamic = f_string_empty_s;
set->abstruses.array[10].value.is.a_dynamic.size = 0;
set->abstruses.array[10].value.is.a_dynamic = f_string_empty_s;
set->abstruses.array[10].value.is.a_dynamic.size = 0;
+ // Index 11 is the order.
+ set->abstruses.array[11].key = kt_tacocat_order_s;
+ set->abstruses.array[11].value.type = f_abstruse_unsigned_e;
+ set->abstruses.array[11].value.is.a_unsigned = 0;
+
if ((main->setting.flag & kt_tacocat_main_flag_encrypt_d) && (set->flag & kt_tacocat_socket_step_flag_send_d)) {
#ifdef _en_gpgme_support_
set->abstruses.array[10].value.is.a_dynamic = kt_tacocat_gpgme_s;
if ((main->setting.flag & kt_tacocat_main_flag_encrypt_d) && (set->flag & kt_tacocat_socket_step_flag_send_d)) {
#ifdef _en_gpgme_support_
set->abstruses.array[10].value.is.a_dynamic = kt_tacocat_gpgme_s;
set->objects_delimits.used = 0;
set->contents_delimits.used = 0;
set->comments.used = 0;
set->objects_delimits.used = 0;
set->contents_delimits.used = 0;
set->comments.used = 0;
set->retry = 0;
set->size_done = 0;
set->size_total = 0;
set->retry = 0;
set->size_done = 0;
set->size_total = 0;
set->objects_delimits.used = 0;
set->contents_delimits.used = 0;
set->comments.used = 0;
set->objects_delimits.used = 0;
set->contents_delimits.used = 0;
set->comments.used = 0;
set->retry = 0;
set->size_done = 0;
set->size_total = 0;
set->retry = 0;
set->size_done = 0;
set->size_total = 0;
// @todo handle case when written < set->buffer.used, of which each pass. The entire buffer must be sent. May need another variable for say, set->size_process.
// @todo handle case when written < set->buffer.used, of which each pass. The entire buffer must be sent. May need another variable for say, set->size_process.
set->size_done += written;
set->step = kt_tacocat_socket_step_send_wait_e;
set->status = F_okay;
set->size_done += written;
set->step = kt_tacocat_socket_step_send_wait_e;
set->status = F_okay;
+ set->abstruses.array[11].value.is.a_unsigned = set->order;
+
set->step = kt_tacocat_socket_step_send_build_e;
}
#endif // _di_kt_tacocat_send_step_size_
set->step = kt_tacocat_socket_step_send_build_e;
}
#endif // _di_kt_tacocat_send_step_size_