Browse Source
- Add sa_family_t typedef for Windows in platform_compat.h - Add forward declaration of struct ll_queue in ll_queue.h to fix warnings - Replace arpa/inet.h includes with platform_compat.h in: tun_linux.c, etcp_connections.c, route_lib.c, route_bgp.c, utun_instance.c, routing.c, utun.c, packet_dump.h, config_parser.c - All 22 tests pass on Linuxnodeinfo-routing-update
57 changed files with 9070 additions and 9 deletions
@ -0,0 +1,130 @@
|
||||
make all-recursive |
||||
make[1]: Entering directory '/c/ARM/_uTun/utun2' |
||||
Making all in lib |
||||
make[2]: Entering directory '/c/ARM/_uTun/utun2/lib' |
||||
gcc -DHAVE_CONFIG_H -I. -I.. -D_ISOC99_SOURCE -DDEBUG_OUTPUT_STDERR -I../src -I../lib -g -O2 -MT libuasync_a-u_async.o -MD -MP -MF .deps/libuasync_a-u_async.Tpo -c -o libuasync_a-u_async.o `test -f 'u_async.c' || echo './'`u_async.c |
||||
gcc -DHAVE_CONFIG_H -I. -I.. -D_ISOC99_SOURCE -DDEBUG_OUTPUT_STDERR -I../src -I../lib -g -O2 -MT libuasync_a-ll_queue.o -MD -MP -MF .deps/libuasync_a-ll_queue.Tpo -c -o libuasync_a-ll_queue.o `test -f 'll_queue.c' || echo './'`ll_queue.c |
||||
gcc -DHAVE_CONFIG_H -I. -I.. -D_ISOC99_SOURCE -DDEBUG_OUTPUT_STDERR -I../src -I../lib -g -O2 -MT libuasync_a-debug_config.o -MD -MP -MF .deps/libuasync_a-debug_config.Tpo -c -o libuasync_a-debug_config.o `test -f 'debug_config.c' || echo './'`debug_config.c |
||||
In file included from ll_queue.c:6: |
||||
ll_queue.h:69:42: warning: 'struct ll_queue' declared inside parameter list will not be visible outside of this definition or declaration |
||||
69 | typedef void (*queue_callback_fn)(struct ll_queue* q, void* arg); |
||||
| ^~~~~~~~ |
||||
ll_queue.h:77:52: warning: 'struct ll_queue' declared inside parameter list will not be visible outside of this definition or declaration |
||||
77 | typedef void (*queue_threshold_callback_fn)(struct ll_queue* q, void* arg); |
||||
| ^~~~~~~~ |
||||
ll_queue.c: In function 'queue_resume_timeout_cb': |
||||
ll_queue.c:98:21: warning: passing argument 1 of 'q->callback' from incompatible pointer type [-Wincompatible-pointer-types] |
||||
98 | q->callback(q, q->callback_arg); |
||||
| ^ |
||||
| | |
||||
| struct ll_queue * |
||||
ll_queue.c:98:21: note: expected 'struct ll_queue *' but argument is of type 'struct ll_queue *' |
||||
ll_queue.c: In function 'check_waiters': |
||||
ll_queue.c:219:30: warning: passing argument 1 of 'waiter->callback' from incompatible pointer type [-Wincompatible-pointer-types] |
||||
219 | waiter->callback(q, waiter->callback_arg); |
||||
| ^ |
||||
| | |
||||
| struct ll_queue * |
||||
ll_queue.c:219:30: note: expected 'struct ll_queue *' but argument is of type 'struct ll_queue *' |
||||
ll_queue.c: In function 'queue_data_put': |
||||
ll_queue.c:259:21: warning: passing argument 1 of 'q->callback' from incompatible pointer type [-Wincompatible-pointer-types] |
||||
259 | q->callback(q, q->callback_arg); |
||||
| ^ |
||||
| | |
||||
| struct ll_queue * |
||||
ll_queue.c:259:21: note: expected 'struct ll_queue *' but argument is of type 'struct ll_queue *' |
||||
ll_queue.c: In function 'queue_data_put_first': |
||||
ll_queue.c:299:21: warning: passing argument 1 of 'q->callback' from incompatible pointer type [-Wincompatible-pointer-types] |
||||
299 | q->callback(q, q->callback_arg); |
||||
| ^ |
||||
| | |
||||
| struct ll_queue * |
||||
ll_queue.c:299:21: note: expected 'struct ll_queue *' but argument is of type 'struct ll_queue *' |
||||
ll_queue.c: In function 'queue_wait_threshold': |
||||
ll_queue.c:351:18: warning: passing argument 1 of 'callback' from incompatible pointer type [-Wincompatible-pointer-types] |
||||
351 | callback(q, arg); |
||||
| ^ |
||||
| | |
||||
| struct ll_queue * |
||||
ll_queue.c:351:18: note: expected 'struct ll_queue *' but argument is of type 'struct ll_queue *' |
||||
u_async.c: In function 'uasync_poll': |
||||
u_async.c:780:15: warning: implicit declaration of function 'poll' [-Wimplicit-function-declaration] |
||||
780 | int ret = poll(ua->poll_fds, ua->poll_fds_count, timeout_ms); |
||||
| ^~~~ |
||||
mv -f .deps/libuasync_a-ll_queue.Tpo .deps/libuasync_a-ll_queue.Po |
||||
mv -f .deps/libuasync_a-debug_config.Tpo .deps/libuasync_a-debug_config.Po |
||||
mv -f .deps/libuasync_a-u_async.Tpo .deps/libuasync_a-u_async.Po |
||||
rm -f libuasync.a |
||||
ar cru libuasync.a libuasync_a-u_async.o libuasync_a-ll_queue.o libuasync_a-debug_config.o libuasync_a-timeout_heap.o libuasync_a-memory_pool.o libuasync_a-sha256.o libuasync_a-socket_compat.o |
||||
C:\msys64\ucrt64\bin\ar.exe: `u' modifier ignored since `D' is the default (see `U') |
||||
ranlib libuasync.a |
||||
make[2]: Leaving directory '/c/ARM/_uTun/utun2/lib' |
||||
Making all in src |
||||
make[2]: Entering directory '/c/ARM/_uTun/utun2/src' |
||||
gcc -DHAVE_CONFIG_H -I. -I.. -I../lib -I../tinycrypt/lib/include -I../tinycrypt/lib/source -g -O2 -MT utun-utun.o -MD -MP -MF .deps/utun-utun.Tpo -c -o utun-utun.o `test -f 'utun.c' || echo './'`utun.c |
||||
gcc -DHAVE_CONFIG_H -I. -I.. -I../lib -I../tinycrypt/lib/include -I../tinycrypt/lib/source -g -O2 -MT utun-utun_instance.o -MD -MP -MF .deps/utun-utun_instance.Tpo -c -o utun-utun_instance.o `test -f 'utun_instance.c' || echo './'`utun_instance.c |
||||
gcc -DHAVE_CONFIG_H -I. -I.. -I../lib -I../tinycrypt/lib/include -I../tinycrypt/lib/source -g -O2 -MT utun-config_parser.o -MD -MP -MF .deps/utun-config_parser.Tpo -c -o utun-config_parser.o `test -f 'config_parser.c' || echo './'`config_parser.c |
||||
gcc -DHAVE_CONFIG_H -I. -I.. -I../lib -I../tinycrypt/lib/include -I../tinycrypt/lib/source -g -O2 -MT utun-config_updater.o -MD -MP -MF .deps/utun-config_updater.Tpo -c -o utun-config_updater.o `test -f 'config_updater.c' || echo './'`config_updater.c |
||||
In file included from etcp_api.h:19, |
||||
from utun_instance.h:9, |
||||
from utun_instance.c:2: |
||||
../lib/ll_queue.h:69:42: warning: 'struct ll_queue' declared inside parameter list will not be visible outside of this definition or declaration |
||||
69 | typedef void (*queue_callback_fn)(struct ll_queue* q, void* arg); |
||||
| ^~~~~~~~ |
||||
../lib/ll_queue.h:77:52: warning: 'struct ll_queue' declared inside parameter list will not be visible outside of this definition or declaration |
||||
77 | typedef void (*queue_threshold_callback_fn)(struct ll_queue* q, void* arg); |
||||
| ^~~~~~~~ |
||||
In file included from config_updater.c:4: |
||||
config_parser.h:18:5: error: unknown type name 'sa_family_t' |
||||
18 | sa_family_t family; |
||||
| ^~~~~~~~~~~ |
||||
In file included from utun_instance.c:3: |
||||
config_parser.h:18:5: error: unknown type name 'sa_family_t' |
||||
18 | sa_family_t family; |
||||
| ^~~~~~~~~~~ |
||||
utun_instance.c:18:10: fatal error: arpa/inet.h: No such file or directory |
||||
18 | #include <arpa/inet.h> |
||||
| ^~~~~~~~~~~~~ |
||||
compilation terminated. |
||||
make[2]: *** [Makefile:623: utun-utun_instance.o] Error 1 |
||||
make[2]: *** Waiting for unfinished jobs.... |
||||
In file included from utun.c:4: |
||||
config_parser.h:18:5: error: unknown type name 'sa_family_t' |
||||
18 | sa_family_t family; |
||||
| ^~~~~~~~~~~ |
||||
make[2]: *** [Makefile:651: utun-config_updater.o] Error 1 |
||||
In file included from etcp_api.h:19, |
||||
from utun_instance.h:9, |
||||
from etcp_connections.h:7, |
||||
from utun.c:5: |
||||
../lib/ll_queue.h:69:42: warning: 'struct ll_queue' declared inside parameter list will not be visible outside of this definition or declaration |
||||
69 | typedef void (*queue_callback_fn)(struct ll_queue* q, void* arg); |
||||
| ^~~~~~~~ |
||||
../lib/ll_queue.h:77:52: warning: 'struct ll_queue' declared inside parameter list will not be visible outside of this definition or declaration |
||||
77 | typedef void (*queue_threshold_callback_fn)(struct ll_queue* q, void* arg); |
||||
| ^~~~~~~~ |
||||
In file included from config_parser.c:3: |
||||
config_parser.h:18:5: error: unknown type name 'sa_family_t' |
||||
18 | sa_family_t family; |
||||
| ^~~~~~~~~~~ |
||||
utun.c:22:10: fatal error: arpa/inet.h: No such file or directory |
||||
22 | #include <arpa/inet.h> |
||||
| ^~~~~~~~~~~~~ |
||||
compilation terminated. |
||||
config_parser.c:10:10: fatal error: arpa/inet.h: No such file or directory |
||||
10 | #include <arpa/inet.h> |
||||
| ^~~~~~~~~~~~~ |
||||
compilation terminated. |
||||
make[2]: *** [Makefile:609: utun-utun.o] Error 1 |
||||
make[2]: *** [Makefile:637: utun-config_parser.o] Error 1 |
||||
make[2]: Leaving directory '/c/ARM/_uTun/utun2/src' |
||||
make[1]: *** [Makefile:379: all-recursive] Error 1 |
||||
make[1]: Leaving directory '/c/ARM/_uTun/utun2' |
||||
make: *** [Makefile:320: all] Error 2 |
||||
|
||||
make[1]: Leaving directory '/c/ARM/_uTun/utun2' |
||||
make: *** [Makefile:320: all] Error 2 |
||||
|
||||
Build completed successfully! |
||||
Binary: src/utun.exe |
||||
Make sure wintun.dll is in the same directory as utun.exe |
||||
@ -0,0 +1,41 @@
|
||||
подсистема роутинга |
||||
utun - это сеть узлов. у каждого узла есть собственные локальные подсети. |
||||
глобальная задача: создать у каждого узла полную таблицу маршрутизации. |
||||
Узлы преимущественно создают связь напрямую друг с другом. Но если это не получается отправляют трафик транзитом через доступные узлы. |
||||
Иногда бывает что через транзитные узлы метрики лучше чем напрямую. Используем приоритетно узлы с лучшей метриков, при нехватке bandwidth используем разные каналы (агрегируем). |
||||
Динамически обновлем метрики каналов чтобы при отказе быстро переключаться на другие и не фризить обмен из-за отказов. |
||||
|
||||
|
||||
и узлы обмениваются таблицой маршрутов между собой так чтобы у каждого была актуальная таблица подсетей всех узлов. |
||||
маршрутами меняются клиенты, подключения которых которые взяты из конфига. и сервера принявшие подключения если клиент инициировал обмен маршрутами. |
||||
|
||||
инициируется подключение, клиент отправляет свою таблицу. когда сервер принимает таблицу - сервер помечает что по этому маршруту надо обмениваться маршрутами, далее; |
||||
- добавляет узел в список рассылки обновлений маршрутов |
||||
- отправляет свою таблицу |
||||
- добавляет в свою таблицу отсутствующие маршруты |
||||
- если что-то добавил: |
||||
- рассылает измененные маршруты по списку рассылки |
||||
- список рассылки - это linked-list очередей (также на базе ll_queue - каждый элемент = подписчик). один маршрут = одна отправленная кодограмма |
||||
|
||||
|
||||
при подключении узла или изменении таблицы: узел шлёт свою таблицу |
||||
формат кодограммы: [0x01 - routing module] [subcmd] [data] |
||||
subcmd: |
||||
1 [route] - отправка маршрута |
||||
2, без данных - больше данных нет |
||||
|
||||
если сервер получил кодограмму маршрута - он помечает флаг в etcp что с узлом надо обмениваться маршрутами (etcp_conn->routing_exchange_active=2) и добавляет в очередь рассылки маршрутов |
||||
|
||||
|
||||
|
||||
========================================= |
||||
механизм инкрементальной синхронизации (реализация - потом, пока мысли) |
||||
1. вычисляем хеш каждой записи в роутинг таблице. используем ip+mask+node_uid |
||||
2. потом из этих хешей создаем хеш таблицу (старшие n бит номер ячейки). далее вычисляются хеши каждой ячейки. |
||||
на первом этапе n=16, на втором - n=16*16 на третьем n=16*16*16. |
||||
|
||||
отправляем хеши удаленному узлу в формате: [n, 1 байт] ([индекс хеша 2 байта - используется n старших бит][хеш - 8 байт]) |
||||
|
||||
удаленный узел считает свои хеши и сравнивает. где не совпало смотрит сколько записей. |
||||
если записей не много - передает эти записи. |
||||
если записей много - добавляет 4 бита к хеш таблице и строит субтаблицу для |
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,24 @@
|
||||
=== timeout_heap benchmark === |
||||
Operations: 100 each |
||||
|
||||
Push 100 items: |
||||
Total time: 0.002 ms |
||||
Average per push: 0.016 us |
||||
Heap size after: 100 |
||||
|
||||
Cancel 50 items: |
||||
Total time: 0.001 ms |
||||
Average per cancel: 0.022 us |
||||
Heap size: 100 (deleted marked) |
||||
|
||||
Pop 50 items: |
||||
Total time: 0.002 ms |
||||
Average per pop: 0.047 us |
||||
Heap size after: 0 |
||||
|
||||
=== Summary === |
||||
Push: 0.002 ms total, 0.016 us/op |
||||
Cancel: 0.001 ms total, 0.022 us/op |
||||
Pop: 0.002 ms total, 0.047 us/op |
||||
|
||||
Total operations: 250 |
||||
@ -0,0 +1,149 @@
|
||||
================================================= |
||||
uasync timeout benchmark: with vs without sockets |
||||
================================================= |
||||
|
||||
=== Test 1: Zero timeouts WITHOUT sockets === |
||||
|
||||
Set 100 zero timeouts: 0.008 ms (0.076 us/op) |
||||
Mainloop 100 iterations: 0.021 ms (0.205 us/iter) |
||||
|
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a83c47852b0 |
||||
Timer Statistics: allocated=100, freed=100, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
=== Test 2: Zero timeouts WITH 100 sockets === |
||||
|
||||
Created 100 sockets |
||||
|
||||
Set 100 zero timeouts: 0.004 ms (0.043 us/op) |
||||
Mainloop 100 iterations: 0.020 ms (0.197 us/iter) |
||||
|
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a83c4785360 |
||||
Timer Statistics: allocated=100, freed=100, active=0 |
||||
Socket Statistics: allocated=100, freed=0, active=100 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 128, active: 100 |
||||
Socket: fd=6, active=1 |
||||
Socket: fd=7, active=1 |
||||
Socket: fd=8, active=1 |
||||
Socket: fd=9, active=1 |
||||
Socket: fd=10, active=1 |
||||
Socket: fd=11, active=1 |
||||
Socket: fd=12, active=1 |
||||
Socket: fd=13, active=1 |
||||
Socket: fd=14, active=1 |
||||
Socket: fd=15, active=1 |
||||
Socket: fd=16, active=1 |
||||
Socket: fd=17, active=1 |
||||
Socket: fd=18, active=1 |
||||
Socket: fd=19, active=1 |
||||
Socket: fd=20, active=1 |
||||
Socket: fd=21, active=1 |
||||
Socket: fd=22, active=1 |
||||
Socket: fd=23, active=1 |
||||
Socket: fd=24, active=1 |
||||
Socket: fd=25, active=1 |
||||
Socket: fd=26, active=1 |
||||
Socket: fd=27, active=1 |
||||
Socket: fd=28, active=1 |
||||
Socket: fd=29, active=1 |
||||
Socket: fd=30, active=1 |
||||
Socket: fd=31, active=1 |
||||
Socket: fd=32, active=1 |
||||
Socket: fd=33, active=1 |
||||
Socket: fd=34, active=1 |
||||
Socket: fd=35, active=1 |
||||
Socket: fd=36, active=1 |
||||
Socket: fd=37, active=1 |
||||
Socket: fd=38, active=1 |
||||
Socket: fd=39, active=1 |
||||
Socket: fd=40, active=1 |
||||
Socket: fd=41, active=1 |
||||
Socket: fd=42, active=1 |
||||
Socket: fd=43, active=1 |
||||
Socket: fd=44, active=1 |
||||
Socket: fd=45, active=1 |
||||
Socket: fd=46, active=1 |
||||
Socket: fd=47, active=1 |
||||
Socket: fd=48, active=1 |
||||
Socket: fd=49, active=1 |
||||
Socket: fd=50, active=1 |
||||
Socket: fd=51, active=1 |
||||
Socket: fd=52, active=1 |
||||
Socket: fd=53, active=1 |
||||
Socket: fd=54, active=1 |
||||
Socket: fd=55, active=1 |
||||
Socket: fd=56, active=1 |
||||
Socket: fd=57, active=1 |
||||
Socket: fd=58, active=1 |
||||
Socket: fd=59, active=1 |
||||
Socket: fd=60, active=1 |
||||
Socket: fd=61, active=1 |
||||
Socket: fd=62, active=1 |
||||
Socket: fd=63, active=1 |
||||
Socket: fd=64, active=1 |
||||
Socket: fd=65, active=1 |
||||
Socket: fd=66, active=1 |
||||
Socket: fd=67, active=1 |
||||
Socket: fd=68, active=1 |
||||
Socket: fd=69, active=1 |
||||
Socket: fd=70, active=1 |
||||
Socket: fd=71, active=1 |
||||
Socket: fd=72, active=1 |
||||
Socket: fd=73, active=1 |
||||
Socket: fd=74, active=1 |
||||
Socket: fd=75, active=1 |
||||
Socket: fd=76, active=1 |
||||
Socket: fd=77, active=1 |
||||
Socket: fd=78, active=1 |
||||
Socket: fd=79, active=1 |
||||
Socket: fd=80, active=1 |
||||
Socket: fd=81, active=1 |
||||
Socket: fd=82, active=1 |
||||
Socket: fd=83, active=1 |
||||
Socket: fd=84, active=1 |
||||
Socket: fd=85, active=1 |
||||
Socket: fd=86, active=1 |
||||
Socket: fd=87, active=1 |
||||
Socket: fd=88, active=1 |
||||
Socket: fd=89, active=1 |
||||
Socket: fd=90, active=1 |
||||
Socket: fd=91, active=1 |
||||
Socket: fd=92, active=1 |
||||
Socket: fd=93, active=1 |
||||
Socket: fd=94, active=1 |
||||
Socket: fd=95, active=1 |
||||
Socket: fd=96, active=1 |
||||
Socket: fd=97, active=1 |
||||
Socket: fd=98, active=1 |
||||
Socket: fd=99, active=1 |
||||
Socket: fd=100, active=1 |
||||
Socket: fd=101, active=1 |
||||
Socket: fd=102, active=1 |
||||
Socket: fd=103, active=1 |
||||
Socket: fd=104, active=1 |
||||
Socket: fd=105, active=1 |
||||
Total active sockets: 100 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
================================================= |
||||
COMPARISON |
||||
================================================= |
||||
|
||||
Set 100 timeouts: |
||||
Without sockets: 0.008 ms (0.076 us/op) |
||||
With 100 sockets: 0.004 ms (0.043 us/op) |
||||
Difference: -43.31% |
||||
|
||||
Mainloop 100 iterations: |
||||
Without sockets: 0.021 ms (0.205 us/iter) |
||||
With 100 sockets: 0.020 ms (0.197 us/iter) |
||||
Difference: -4.00% |
||||
|
||||
================================================= |
||||
@ -0,0 +1,16 @@
|
||||
[03:05:50-837.191] [ERROR] [128] (test_config_debug.c:77) main() 1. До загрузки конфигурации: |
||||
[03:05:50-837.212] [ERROR] [128] (test_config_debug.c:78) main() ERROR сообщение до загрузки конфигурации |
||||
[03:05:50-837.217] [ERROR] [128] (test_config_debug.c:82) main() 2. Загрузка конфигурации из файла: /tmp/utun_test_ve46Ka/test.conf |
||||
[CONFIG DEBUG] Opening config file: /tmp/utun_test_ve46Ka/test.conf |
||||
[CONFIG DEBUG] Successfully opened config file |
||||
[03:05:50-837.245] [ERROR] [128] (test_config_debug.c:90) main() ✅ Конфигурация загружена успешно |
||||
[03:05:50-837.249] [ERROR] [128] (test_config_debug.c:91) main() Log file: /tmp/utun_debug.log |
||||
[03:05:50-837.252] [ERROR] [128] (test_config_debug.c:92) main() Debug level: debug |
||||
[03:05:50-837.255] [ERROR] [128] (test_config_debug.c:93) main() Debug categories: 0x2A |
||||
[03:05:50-837.267] [ERROR] [128] (test_config_debug.c:94) main() Enable timestamp: 1 |
||||
[03:05:50-837.270] [ERROR] [128] (test_config_debug.c:95) main() Enable colors: 1 |
||||
[03:05:50-837.273] [ERROR] [128] (test_config_debug.c:98) main() 4. Тестирование после применения настроек: |
||||
[03:05:50-837.277] [ERROR] [8] (test_config_debug.c:99) main() ERROR от ETCP (должен выводиться) |
||||
[03:05:50-837.280] [ERROR] [128] (test_config_debug.c:108) main() 5. Проверка вывода в файл: |
||||
[03:05:50-837.347] [ERROR] [128] (test_config_debug.c:117) main() === Тест завершен === |
||||
[03:05:50-837.354] [ERROR] [128] (test_config_debug.c:118) main() Проверьте файл /tmp/utun_debug.log для записанных сообщений |
||||
@ -0,0 +1,6 @@
|
||||
[03:05:50-314.146] [INFO] [16] (test_crypto.c:16) main() === Basic Crypto Test === |
||||
[03:05:50-314.202] [INFO] [16] (test_crypto.c:27) main() AES key setup successful |
||||
[03:05:50-314.209] [INFO] [16] (test_crypto.c:38) main() CCM config successful |
||||
[03:05:50-314.218] [INFO] [16] (test_crypto.c:50) main() Encryption successful |
||||
[03:05:50-314.224] [INFO] [16] (test_crypto.c:58) main() Decryption successful |
||||
[03:05:50-314.228] [INFO] [16] (test_crypto.c:61) main() Crypto test PASSED |
||||
@ -0,0 +1,8 @@
|
||||
[03:05:50-836.314] [INFO] [18446744073709551615] (test_debug_categories.c:87) main() === Тестовые сообщения === |
||||
[03:05:50-836.358] [INFO] [8] (test_debug_categories.c:90) main() Сообщение от ETCP категории |
||||
[03:05:50-836.363] [INFO] [2] (test_debug_categories.c:91) main() Сообщение от LL_QUEUE категории |
||||
[03:05:50-836.367] [INFO] [32] (test_debug_categories.c:92) main() Сообщение от MEMORY категории |
||||
[03:05:50-836.370] [INFO] [4] (test_debug_categories.c:93) main() Сообщение от CONNECTION категории |
||||
[03:05:50-836.373] [INFO] [16] (test_debug_categories.c:94) main() Сообщение от CRYPTO категории |
||||
[03:05:50-836.376] [INFO] [18446744073709551615] (test_debug_categories.c:96) main() === Информация о текущих настройках === |
||||
[03:05:50-836.379] [INFO] [18446744073709551615] (test_debug_categories.c:107) main() Активные категории: NONE |
||||
@ -0,0 +1,19 @@
|
||||
[03:05:50-802.156] [INFO] [16] (test_ecc_encrypt.c:182) main() Performing client-server key exchange and encryption test: |
||||
[03:05:50-802.217] [INFO] [16] (test_ecc_encrypt.c:90) test_key_exchange_and_encrypt() Generating client key pair... |
||||
|
||||
[03:05:50-803.153] [INFO] [16] (test_ecc_encrypt.c:96) test_key_exchange_and_encrypt() Generating server key pair... |
||||
|
||||
[03:05:50-803.840] [INFO] [16] (test_ecc_encrypt.c:103) test_key_exchange_and_encrypt() Computing shared secret on client side... |
||||
|
||||
[03:05:50-804.554] [INFO] [16] (test_ecc_encrypt.c:110) test_key_exchange_and_encrypt() Computing shared secret on server side... |
||||
|
||||
[03:05:50-805.204] [INFO] [16] (test_ecc_encrypt.c:123) test_key_exchange_and_encrypt() Shared secrets match. |
||||
|
||||
[03:05:50-805.208] [INFO] [16] (test_ecc_encrypt.c:145) test_key_exchange_and_encrypt() Encrypting plaintext... |
||||
|
||||
[03:05:50-805.213] [INFO] [16] (test_ecc_encrypt.c:155) test_key_exchange_and_encrypt() Decrypting ciphertext... |
||||
|
||||
[03:05:50-805.218] [INFO] [16] (test_ecc_encrypt.c:169) test_key_exchange_and_encrypt() Decryption successful. Test passed. |
||||
|
||||
[03:05:50-805.221] [INFO] [16] (test_ecc_encrypt.c:189) main() Result: PASS |
||||
[03:05:50-805.224] [INFO] [16] (test_ecc_encrypt.c:190) main() Test SUCCESSFUL |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,6 @@
|
||||
[03:05:50-311.973] [INFO] [16] (test_etcp_crypto.c:17) main() === ETCP Crypto Test === |
||||
[03:05:50-312.252] [ERROR] [16] (secure_channel.c:211) sc_set_peer_public_key() sc_set_peer_public_key: invalid key |
||||
[03:05:50-312.271] [ERROR] [16] (secure_channel.c:211) sc_set_peer_public_key() sc_set_peer_public_key: invalid key |
||||
[03:05:50-312.275] [INFO] [16] (test_etcp_crypto.c:54) main() Crypto contexts initialized |
||||
[03:05:50-313.172] [INFO] [16] (test_etcp_crypto.c:77) main() Client->Server encryption/decryption: PASSED |
||||
[03:05:50-313.182] [INFO] [16] (test_etcp_crypto.c:78) main() ETCP crypto test PASSED |
||||
@ -0,0 +1,46 @@
|
||||
=== Minimal ETCP Traffic Flow Debugging === |
||||
=== Testing Basic Packet Analysis === |
||||
Test packet: 00 00 06 00 01 48 65 6C 6C 6F |
||||
Section type: 0x00 |
||||
Section length: 6 |
||||
Total packet size: 10 |
||||
This is a PAYLOAD section |
||||
Packet ID: 1 |
||||
Payload size: 4 bytes |
||||
Payload data: 48 65 6C 6C |
||||
Payload as text: Hell |
||||
|
||||
=== Testing Multi-Section Packet === |
||||
Multi-section packet: 06 00 02 12 34 01 00 09 02 00 01 56 78 00 02 56 79 00 00 08 00 03 48 65 6C 6C 6F 21 |
||||
|
||||
Section 0 at position 0: |
||||
Type: 0x06 (TIMESTAMP) |
||||
Length: 2 bytes |
||||
Timestamp: 4660 |
||||
|
||||
Section 1 at position 5: |
||||
Type: 0x01 (ACK) |
||||
Length: 9 bytes |
||||
ACK count: 2 |
||||
ACK[0]: id=1, ts=22136 |
||||
ACK[1]: id=2, ts=22137 |
||||
|
||||
Section 2 at position 17: |
||||
Type: 0x00 (PAYLOAD) |
||||
Length: 8 bytes |
||||
Packet ID: 3 |
||||
Payload: Hello! |
||||
|
||||
Total sections parsed: 3 |
||||
|
||||
=== Testing Connection Establishment Packets === |
||||
INIT_REQUEST packet: |
||||
Node ID: 0x2222222222222222 |
||||
MTU: 1500 |
||||
Keepalive: 100 |
||||
|
||||
INIT_RESPONSE packet: |
||||
Node ID: 0x1111111111111111 |
||||
MTU: 1500 |
||||
|
||||
=== Test completed === |
||||
@ -0,0 +1,44 @@
|
||||
[03:05:50-806.564] [INFO] [32] (test_intensive_memory_pool.c:127) main() === Интенсивный тест пулов памяти === |
||||
[03:05:50-806.616] [INFO] [32] (test_intensive_memory_pool.c:128) main() Тестируется производительность с пулами vs без пулов |
||||
[03:05:50-806.621] [INFO] [32] (test_intensive_memory_pool.c:132) main() Запуск теста без пулов памяти... |
||||
[03:05:50-806.627] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-806.643] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
[03:05:50-806.649] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x5d04434eecc0, hash_size=0 |
||||
[03:05:50-806.979] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x5d04434eecc0, head=(nil), tail=(nil), count=0 |
||||
[03:05:50-806.982] [DEBUG] [1024] (u_async.c:1000) uasync_destroy() uasync_destroy: starting cleanup for ua=0x5d04434ee4c0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5d04434ee4c0 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-806.987] [DEBUG] [32] (u_async.c:1048) uasync_destroy() Freed 0 socket nodes in destroy |
||||
[03:05:50-806.998] [DEBUG] [1024] (u_async.c:1081) uasync_destroy() uasync_destroy: completed successfully for ua=0x5d04434ee4c0 |
||||
[03:05:50-807.001] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-807.008] [INFO] [32] (test_intensive_memory_pool.c:134) main() Время без пулов: 0.000 сек |
||||
[03:05:50-807.019] [INFO] [32] (test_intensive_memory_pool.c:135) main() Waiter callbacks: 32000 |
||||
[03:05:50-807.022] [INFO] [32] (test_intensive_memory_pool.c:139) main() Запуск теста с пулами памяти... |
||||
[03:05:50-807.026] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-807.033] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
[03:05:50-807.037] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x5d04434ef230, hash_size=0 |
||||
[03:05:50-807.361] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x5d04434ef230, head=(nil), tail=(nil), count=0 |
||||
[03:05:50-807.368] [DEBUG] [1024] (u_async.c:1000) uasync_destroy() uasync_destroy: starting cleanup for ua=0x5d04434eecc0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5d04434eecc0 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-807.372] [DEBUG] [32] (u_async.c:1048) uasync_destroy() Freed 0 socket nodes in destroy |
||||
[03:05:50-807.381] [DEBUG] [1024] (u_async.c:1081) uasync_destroy() uasync_destroy: completed successfully for ua=0x5d04434eecc0 |
||||
[03:05:50-807.384] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-807.388] [INFO] [32] (test_intensive_memory_pool.c:141) main() Время с пулами: 0.000 сек |
||||
[03:05:50-807.391] [INFO] [32] (test_intensive_memory_pool.c:142) main() Waiter callbacks: 32000 |
||||
[03:05:50-807.395] [INFO] [32] (test_intensive_memory_pool.c:146) main() Результат: пулы памяти дали 1.09x ускорение |
||||
[03:05:50-807.398] [INFO] [32] (test_intensive_memory_pool.c:148) main() ✅ Пулы памяти эффективны! |
||||
@ -0,0 +1,104 @@
|
||||
TEST: basic creation / free [03:05:50-799.553] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b35ab0, hash_size=0 |
||||
[03:05:50-799.583] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b35d60, hash_size=16 |
||||
[03:05:50-799.588] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b35ab0, head=(nil), tail=(nil), count=0 |
||||
[03:05:50-799.592] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b35d60, head=(nil), tail=(nil), count=0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x637c97b352b0 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
PASS |
||||
TEST: FIFO ordering [03:05:50-799.609] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b354c0, hash_size=0 |
||||
[03:05:50-799.614] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b354c0, head=(nil), tail=(nil), count=0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x637c97b35360 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
PASS |
||||
TEST: put_first (LIFO priority) [03:05:50-799.629] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b36bd0, hash_size=0 |
||||
[03:05:50-799.632] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b36bd0, head=(nil), tail=(nil), count=0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x637c97b35e80 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
PASS |
||||
TEST: callback serial processing [03:05:50-799.646] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b35ef0, hash_size=0 |
||||
[03:05:50-799.650] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b35ef0, head=(nil), tail=(nil), count=0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x637c97b36c60 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
PASS |
||||
TEST: wait_threshold + cancel [03:05:50-799.663] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b35ff0, hash_size=0 |
||||
[03:05:50-799.667] [DEBUG] [2] (ll_queue.c:216) check_waiters() check_waiters: condition met, calling callback, count=2<=2, bytes=0<=0 (max_bytes_check=disabled) |
||||
[03:05:50-799.674] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b35ff0, head=0x637c97b36310, tail=0x637c97b356f0, count=2 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x637c97b35f80 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
PASS |
||||
TEST: size limit + hash find/remove [03:05:50-799.687] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b360f0, hash_size=16 |
||||
[03:05:50-799.691] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b360f0, head=(nil), tail=(nil), count=0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x637c97b36080 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
PASS |
||||
TEST: memory_pool integration + reuse [03:05:50-799.704] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b36160, hash_size=0 |
||||
[03:05:50-799.712] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b36160, head=(nil), tail=(nil), count=0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x637c97b360f0 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
PASS |
||||
TEST: stress 10k ops [03:05:50-799.728] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x637c97b36d70, hash_size=64 |
||||
[03:05:50-800.874] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x637c97b36d70, head=(nil), tail=(nil), count=0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x637c97b36160 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
PASS |
||||
|
||||
=== SUMMARY === |
||||
run=8 passed=8 failed=0 |
||||
callbacks: queue=5 waiter=2 |
||||
ops=10000 time=1.39 ms |
||||
@ -0,0 +1,26 @@
|
||||
[03:05:50-808.132] [INFO] [32] (test_memory_pool_and_config.c:33) main() === Memory Pool and Config File Test === |
||||
[03:05:50-808.176] [INFO] [32] (test_memory_pool_and_config.c:36) main() Test 1: Memory pool optimization... |
||||
[03:05:50-808.181] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-808.190] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
[03:05:50-808.195] [DEBUG] [2] (ll_queue.c:37) queue_new() queue_new: created queue 0x5e1dfdbb3cc0, hash_size=0 |
||||
[03:05:50-808.200] [INFO] [32] (test_memory_pool_and_config.c:82) main() Pool statistics: allocations=0, reuse_count=0 |
||||
[03:05:50-808.203] [INFO] [32] (test_memory_pool_and_config.c:83) main() Pool efficiency: 0.0% |
||||
[03:05:50-808.211] [DEBUG] [2] (ll_queue.c:62) queue_free() queue_free: freeing queue 0x5e1dfdbb3cc0, head=(nil), tail=(nil), count=0 |
||||
[03:05:50-808.215] [DEBUG] [1024] (u_async.c:1000) uasync_destroy() uasync_destroy: starting cleanup for ua=0x5e1dfdbb34c0 |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5e1dfdbb34c0 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-808.219] [DEBUG] [32] (u_async.c:1048) uasync_destroy() Freed 0 socket nodes in destroy |
||||
[03:05:50-808.228] [DEBUG] [1024] (u_async.c:1081) uasync_destroy() uasync_destroy: completed successfully for ua=0x5e1dfdbb34c0 |
||||
[03:05:50-808.231] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-808.234] [INFO] [32] (test_memory_pool_and_config.c:89) main() Memory pool test: PASS |
||||
[03:05:50-808.245] [INFO] [128] (test_memory_pool_and_config.c:92) main() Test 2: Configuration file support... |
||||
[03:05:50-808.311] [ERROR] [128] (test_memory_pool_and_config.c:125) main() Failed to parse configuration |
||||
[03:05:50-808.344] [INFO] [128] (test_memory_pool_and_config.c:133) main() Configuration file test: PASS |
||||
[03:05:50-808.348] [INFO] [32] (test_memory_pool_and_config.c:135) main() === All tests completed successfully === |
||||
@ -0,0 +1,3 @@
|
||||
[03:05:50-809.037] [INFO] [8] (test_packet_dump.c:23) main() === Testing single-line packet dump === |
||||
[03:05:50-809.079] [INFO] [8] (test_packet_dump.c:14) test_packet_dump() TEST_SEND: len=6 hex=021122334455 |
||||
[03:05:50-809.084] [INFO] [8] (test_packet_dump.c:15) test_packet_dump() TEST_COMPACT: link=NULL type=0x02 ts=0 len=6 |
||||
@ -0,0 +1,29 @@
|
||||
=== PKT Normalizer Standalone Test (Loopback) === |
||||
MTU: 1500, Frag size: 1400 |
||||
Testing with 100 packets of random sizes (10-3000 bytes) |
||||
|
||||
Total data to transfer: 147790 bytes (1.44 KB average per packet) |
||||
|
||||
Normalizer created (frag_size=1400) |
||||
|
||||
Sending 100 packets... |
||||
All 100 packets queued to normalizer |
||||
|
||||
=== SUCCESS: All packets received! === |
||||
Sent: 100, Received: 100 |
||||
Fragments: sent=106, received=100 |
||||
Duration: 2.43 ms |
||||
|
||||
Cleaning up... |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x6075d41742b0 |
||||
Timer Statistics: allocated=104, freed=103, active=1 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Timer: node=0x6075d4174df0, expires=1771113951617 ms, cancelled=0 |
||||
Active timers in heap: 1 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
|
||||
=== TEST PASSED === |
||||
@ -0,0 +1,115 @@
|
||||
[03:05:50-809.881] [INFO] [1] (test_u_async_comprehensive.c:474) main() === lib Comprehensive Unit Tests === |
||||
[03:05:50-809.929] [INFO] [1] (test_u_async_comprehensive.c:475) main() Testing race conditions, memory management, and error handling |
||||
[03:05:50-809.934] [INFO] [1] (test_u_async_comprehensive.c:144) test_basic_timers() TEST: Basic timer functionality... |
||||
[03:05:50-809.937] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-809.948] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a0d63c1d4c0 |
||||
Timer Statistics: allocated=3, freed=3, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-812.297] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-812.323] [INFO] [1] (test_u_async_comprehensive.c:172) test_basic_timers() PASS |
||||
[03:05:50-812.328] [INFO] [1] (test_u_async_comprehensive.c:177) test_timer_cancellation_races() TEST: Timer cancellation race conditions... |
||||
[03:05:50-812.331] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-812.346] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a0d63c1d570 |
||||
Timer Statistics: allocated=3, freed=3, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-822.475] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-822.539] [INFO] [1] (test_u_async_comprehensive.c:224) test_timer_cancellation_races() PASS |
||||
[03:05:50-822.544] [INFO] [1] (test_u_async_comprehensive.c:229) test_immediate_timeouts() TEST: Immediate timeout handling... |
||||
[03:05:50-822.548] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-822.579] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a0d63c1e2d0 |
||||
Timer Statistics: allocated=5, freed=5, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-822.594] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-822.598] [INFO] [1] (test_u_async_comprehensive.c:261) test_immediate_timeouts() PASS |
||||
[03:05:50-822.602] [INFO] [1] (test_u_async_comprehensive.c:266) test_memory_leak_detection() TEST: Memory leak detection... |
||||
[03:05:50-822.605] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-822.613] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a0d63c1d5e0 |
||||
Timer Statistics: allocated=10, freed=10, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-832.234] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-832.275] [INFO] [1] (test_u_async_comprehensive.c:293) test_memory_leak_detection() PASS |
||||
[03:05:50-832.296] [INFO] [1] (test_u_async_comprehensive.c:298) test_socket_management() TEST: Socket management efficiency... |
||||
[03:05:50-832.303] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-832.323] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a0d63c1d790 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=10, freed=10, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-832.428] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-832.445] [INFO] [1] (test_u_async_comprehensive.c:340) test_socket_management() PASS |
||||
[03:05:50-832.449] [INFO] [1] (test_u_async_comprehensive.c:345) test_error_handling() TEST: Error injection and handling... |
||||
[03:05:50-832.453] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-832.463] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
[03:05:50-832.469] [ERROR] [1024] (u_async.c:410) uasync_cancel_timeout() uasync_cancel_timeout: invalid parameters ua=(nil), t_id=(nil), heap=(nil) |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a0d63c1e430 |
||||
Timer Statistics: allocated=1, freed=1, active=0 |
||||
Socket Statistics: allocated=0, freed=0, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-832.480] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-832.484] [INFO] [1] (test_u_async_comprehensive.c:375) test_error_handling() PASS |
||||
[03:05:50-832.488] [INFO] [1] (test_u_async_comprehensive.c:380) test_concurrent_operations() TEST: Concurrent operations stress test... |
||||
[03:05:50-832.492] [INFO] [8192] (socket_compat.c:54) socket_platform_init() POSIX socket subsystem ready |
||||
[03:05:50-832.501] [INFO] [1] (u_async.c:930) uasync_create() Using epoll for socket monitoring |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5a0d63c1d800 |
||||
Timer Statistics: allocated=10, freed=2, active=8 |
||||
Socket Statistics: allocated=2, freed=2, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 16, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
[03:05:50-832.637] [ERROR] [32] (u_async.c:1007) uasync_destroy() Memory leaks detected before cleanup: timers 10/2, sockets 2/2 |
||||
[03:05:50-832.644] [ERROR] [1024] (u_async.c:1009) uasync_destroy() Timer leak: allocated=10, freed=2, diff=8 |
||||
[03:05:50-832.648] [ERROR] [1024] (u_async.c:1012) uasync_destroy() Socket leak: allocated=2, freed=2, diff=0 |
||||
[03:05:50-832.658] [INFO] [8192] (socket_compat.c:60) socket_platform_cleanup() POSIX socket cleanup completed |
||||
[03:05:50-832.662] [INFO] [1] (test_u_async_comprehensive.c:465) test_concurrent_operations() PASS |
||||
[03:05:50-832.666] [INFO] [1] (test_u_async_comprehensive.c:487) main() === Test Statistics === |
||||
[03:05:50-832.670] [INFO] [1] (test_u_async_comprehensive.c:488) main() Tests run: 7 |
||||
[03:05:50-832.674] [INFO] [1] (test_u_async_comprehensive.c:489) main() Tests passed: 7 |
||||
[03:05:50-832.678] [INFO] [1] (test_u_async_comprehensive.c:490) main() Tests failed: 0 |
||||
[03:05:50-832.682] [INFO] [1] (test_u_async_comprehensive.c:491) main() Timer callbacks: 14 |
||||
[03:05:50-832.686] [INFO] [1] (test_u_async_comprehensive.c:492) main() Timer cancellations: 1 |
||||
[03:05:50-832.689] [INFO] [1] (test_u_async_comprehensive.c:493) main() Immediate timeouts: 9 |
||||
[03:05:50-832.693] [INFO] [1] (test_u_async_comprehensive.c:494) main() Socket events: 17 |
||||
[03:05:50-832.697] [INFO] [1] (test_u_async_comprehensive.c:495) main() Race condition errors: 1 |
||||
[03:05:50-832.701] [INFO] [1] (test_u_async_comprehensive.c:498) main() === Memory Leak Detection === |
||||
[03:05:50-832.705] [INFO] [1] (test_u_async_comprehensive.c:499) main() No memory leaks detected during testing |
||||
@ -0,0 +1,59 @@
|
||||
lib Socket Management Performance Benchmark |
||||
================================================ |
||||
|
||||
=== Socket Management Benchmark === |
||||
Testing with 25 sockets |
||||
|
||||
DEBUG: Socket 0 has fd=6 |
||||
Created 25 sockets |
||||
DEBUG: Total sockets added: 25 |
||||
Add 25 sockets: 30 us (1.20 us per socket) |
||||
SKIPPING POLLING to test corruption |
||||
DEBUG: Removing sockets using lookup by FD |
||||
DEBUG: Attempting to remove socket 0 (fd=6, id=0x653e819a3b90) |
||||
DEBUG: Attempting to remove socket 1 (fd=7, id=0x653e819a3bd8) |
||||
DEBUG: Attempting to remove socket 2 (fd=8, id=0x653e819a3c20) |
||||
DEBUG: Attempting to remove socket 3 (fd=9, id=0x653e819a3c68) |
||||
DEBUG: Attempting to remove socket 4 (fd=10, id=0x653e819a3cb0) |
||||
DEBUG: Attempting to remove socket 5 (fd=11, id=0x653e819a3cf8) |
||||
DEBUG: Attempting to remove socket 6 (fd=12, id=0x653e819a3d40) |
||||
DEBUG: Attempting to remove socket 7 (fd=13, id=0x653e819a3d88) |
||||
DEBUG: Attempting to remove socket 8 (fd=14, id=0x653e819a3dd0) |
||||
DEBUG: Attempting to remove socket 9 (fd=15, id=0x653e819a3e18) |
||||
DEBUG: Attempting to remove socket 10 (fd=16, id=0x653e819a3e60) |
||||
DEBUG: Attempting to remove socket 11 (fd=17, id=0x653e819a3ea8) |
||||
DEBUG: Attempting to remove socket 12 (fd=18, id=0x653e819a3ef0) |
||||
DEBUG: Attempting to remove socket 13 (fd=19, id=0x653e819a3f38) |
||||
DEBUG: Attempting to remove socket 14 (fd=20, id=0x653e819a3f80) |
||||
DEBUG: Attempting to remove socket 15 (fd=21, id=0x653e819a3fc8) |
||||
DEBUG: Attempting to remove socket 16 (fd=22, id=0x653e819a4010) |
||||
DEBUG: Attempting to remove socket 17 (fd=23, id=0x653e819a4058) |
||||
DEBUG: Attempting to remove socket 18 (fd=24, id=0x653e819a40a0) |
||||
DEBUG: Attempting to remove socket 19 (fd=25, id=0x653e819a40e8) |
||||
DEBUG: Attempting to remove socket 20 (fd=26, id=0x653e819a4130) |
||||
DEBUG: Attempting to remove socket 21 (fd=27, id=0x653e819a4178) |
||||
DEBUG: Attempting to remove socket 22 (fd=28, id=0x653e819a41c0) |
||||
DEBUG: Attempting to remove socket 23 (fd=29, id=0x653e819a4208) |
||||
DEBUG: Attempting to remove socket 24 (fd=30, id=0x653e819a4250) |
||||
DEBUG: Actually removed 25 sockets, failed 0 |
||||
Remove 25 sockets: 19 us (0.76 us per socket) |
||||
|
||||
Total time: 49 us |
||||
Average per operation: 0.98 us |
||||
SKIPPING memory stats for corruption testing |
||||
|
||||
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x653e819a32b0 |
||||
Timer Statistics: allocated=0, freed=0, active=0 |
||||
Socket Statistics: allocated=25, freed=25, active=0 |
||||
Active timers in heap: 0 |
||||
Socket array capacity: 32, active: 0 |
||||
Total active sockets: 0 |
||||
🔚 BEFORE_DESTROY: End of resource report |
||||
|
||||
|
||||
=== Benchmark Complete === |
||||
Array-based socket management provides: |
||||
- O(1) add/remove operations (vs O(n) for linked list) |
||||
- Better cache locality for sequential socket processing |
||||
- Direct FD-to-index mapping for fast lookups |
||||
- Reduced memory allocations per operation |
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue