794fe355d3d41bfc95866e1f89308b08029fc5e6
Changed from global bindings to per-instance bindings: 1. Added struct ETCP_BINDINGS in etcp_api.h: - Contains array of callbacks[ETCP_MAX_BINDINGS] - NULL means not bound 2. Updated UTUN_INSTANCE (utun_instance.h): - Added field: struct ETCP_BINDINGS api_bindings - Initialized to NULL by calloc in utun_instance_create 3. Updated API functions (etcp_api.h/c): - etcp_bind(inst, id, callback) - per-instance binding - etcp_unbind(inst, id) - per-instance unbinding - Removed etcp_api_init/etcp_api_deinit (not needed) - etcp_int_recv now uses conn->instance->api_bindings.callbacks[id] 4. Updated test_etcp_api.c: - Separate callbacks for server and client - Register via etcp_bind(server_instance, ...) and etcp_bind(client_instance, ...) - Removed global etcp_api_init/etcp_api_deinit calls Test passes: All 100 packets transmitted in each direction.
…
…
…
Languages
C
77.9%
C++
12.7%
Kotlin
5.3%
HTML
2.6%
Python
0.5%
Other
0.7%