ETCP: Fix protocol parsing and crypto nonce handling
- Fixed ACK section parsing (elm_cnt and till offset) - Fixed payload section to include seq number in packet - Fixed assembly trigger condition (last_delivered_id+1==seq) - Crypto: Added nonce transmission in encrypted packets - Crypto: Fixed nonce generation with usec timestamp - Reduced debug verbosity in connection handling - Added unknown section type handling
This commit is contained in:
1 parent
41626a02c3
commit
a34035f41f
22 files changed
+224265
-48
No files matched your search
@@ -0,0 +1,38 @@
|
||||
#include "lib/ll_queue.h"
|
||||
#include "lib/u_async.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct {
|
||||
int id;
|
||||
char name[32];
|
||||
int value;
|
||||
} test_data_t;
|
||||
|
||||
int main() {
|
||||
struct UASYNC* ua = uasync_create();
|
||||
struct ll_queue* q = queue_new(ua, 0);
|
||||
|
||||
/* Create test data */
|
||||
test_data_t* data1 = (test_data_t*)queue_data_new(sizeof(test_data_t));
|
||||
data1->id = 1;
|
||||
strcpy(data1->name, "test1");
|
||||
data1->value = 100;
|
||||
|
||||
printf("Created data: id=%d, name=%s, value=%d\n", data1->id, data1->name, data1->value);
|
||||
printf("Data pointer: %p\n", data1);
|
||||
|
||||
/* Put data into queue */
|
||||
queue_data_put(q, data1, data1->id);
|
||||
printf("After put: queue count = %d\n", queue_entry_count(q));
|
||||
|
||||
/* Get data from queue */
|
||||
test_data_t* retrieved = (test_data_t*)queue_data_get(q);
|
||||
printf("Retrieved pointer: %p\n", retrieved);
|
||||
printf("Retrieved data: id=%d, name=%s, value=%d\n", retrieved->id, retrieved->name, retrieved->value);
|
||||
|
||||
queue_free(q);
|
||||
uasync_destroy(ua, 0);
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user