Squashed 'external/toxcore/c-toxcore/' changes from e29e185c03..f1df709b87

f1df709b87 feat: add ngc events
1b6c907235 refactor: Make event dispatch ordered by receive time.
b7f9367f6f test: Upgrade cppcheck, fix some warnings.
766e62bc89 chore: Use `pkg_search_module` directly in cmake.
00ff078f91 cleanup: Use target_link_libraries directly in cmake.
c58928cc89 chore: Add `IMPORTED_TARGET` to pkg-config packages.
895a6af122 cleanup: Remove NaCl support.
41dfb1c1c0 fix: unpack enum function names in event impl generator
447666d1a1 chore: Disable targets for cross-compilation.
572924e924 chore: Build a docker image with coverage info in it.
415cb78f5e cleanup: Some portability/warning fixes for Windows builds.
425216d9ec fix: Correct a use-after-free and fix some memory leaks.
4b1cfa3e08 refactor: Change all enum-like `#define` sequences into enums.
d3c2704fa9 chore: Fix make_single_file to support core-only.
0ce46b644e refactor: Change the `TCP_PACKET_*` defines into an enum.
22cd38ad50 adopt event impl generation tool to #2392
f31ea1088a add the event impl generation tool
4e603bb613 refactor: Use `enum-from-int` rule from tokstyle.
19d8f180d6 chore: Update github actions `uses`.
6a895be0c7 test: Make esp32 build actually try to instantiate tox.
65d09c9bfb cleanup: Remove test net support.
REVERT: e29e185c03 feat: add ngc events

git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: f1df709b8792da4c0e946d826b11df77d565064d
This commit is contained in:
2023-12-27 12:37:22 +01:00
parent 83e200df43
commit b2ae9530a4
173 changed files with 9191 additions and 5633 deletions

View File

@ -97,56 +97,6 @@ Family net_family_tox_tcp_ipv6(void);
#define MAX_UDP_PACKET_SIZE 2048
#ifdef USE_TEST_NETWORK
typedef enum Net_Packet_Type {
NET_PACKET_PING_REQUEST = 0x05, /* Ping request packet ID. */
NET_PACKET_PING_RESPONSE = 0x06, /* Ping response packet ID. */
NET_PACKET_GET_NODES = 0x07, /* Get nodes request packet ID. */
NET_PACKET_SEND_NODES_IPV6 = 0x08, /* Send nodes response packet ID for other addresses. */
NET_PACKET_COOKIE_REQUEST = 0x1c, /* Cookie request packet */
NET_PACKET_COOKIE_RESPONSE = 0x1d, /* Cookie response packet */
NET_PACKET_CRYPTO_HS = 0x1e, /* Crypto handshake packet */
NET_PACKET_CRYPTO_DATA = 0x1f, /* Crypto data packet */
NET_PACKET_CRYPTO = 0x24, /* Encrypted data packet ID. */
NET_PACKET_LAN_DISCOVERY = 0x25, /* LAN discovery packet ID. */
NET_PACKET_GC_HANDSHAKE = 0x62, /* Group chat handshake packet ID */
NET_PACKET_GC_LOSSLESS = 0x63, /* Group chat lossless packet ID */
NET_PACKET_GC_LOSSY = 0x64, /* Group chat lossy packet ID */
/* See: `docs/Prevent_Tracking.txt` and `onion.{c,h}` */
NET_PACKET_ONION_SEND_INITIAL = 0x8f,
NET_PACKET_ONION_SEND_1 = 0x90,
NET_PACKET_ONION_SEND_2 = 0x91,
NET_PACKET_ANNOUNCE_REQUEST = 0x92,
NET_PACKET_ANNOUNCE_RESPONSE = 0x93,
NET_PACKET_ONION_DATA_REQUEST = 0x94,
NET_PACKET_ONION_DATA_RESPONSE = 0x95,
NET_PACKET_ANNOUNCE_REQUEST_OLD = 0x96, /* TODO: DEPRECATE */
NET_PACKET_ANNOUNCE_RESPONSE_OLD = 0x97, /* TODO: DEPRECATE */
NET_PACKET_ONION_RECV_3 = 0x9b,
NET_PACKET_ONION_RECV_2 = 0x9c,
NET_PACKET_ONION_RECV_1 = 0x9d,
NET_PACKET_FORWARD_REQUEST = 0x9e,
NET_PACKET_FORWARDING = 0x9f,
NET_PACKET_FORWARD_REPLY = 0xa0,
NET_PACKET_DATA_SEARCH_REQUEST = 0xa1,
NET_PACKET_DATA_SEARCH_RESPONSE = 0xa2,
NET_PACKET_DATA_RETRIEVE_REQUEST = 0xa3,
NET_PACKET_DATA_RETRIEVE_RESPONSE = 0xa4,
NET_PACKET_STORE_ANNOUNCE_REQUEST = 0xa5,
NET_PACKET_STORE_ANNOUNCE_RESPONSE = 0xa6,
BOOTSTRAP_INFO_PACKET_ID = 0xf1, /* Only used for bootstrap nodes */
NET_PACKET_MAX = 0xff, /* This type must remain within a single uint8. */
} Net_Packet_Type;
#else
typedef enum Net_Packet_Type {
NET_PACKET_PING_REQUEST = 0x00, /* Ping request packet ID. */
NET_PACKET_PING_RESPONSE = 0x01, /* Ping response packet ID. */
@ -195,7 +145,6 @@ typedef enum Net_Packet_Type {
NET_PACKET_MAX = 0xff, /* This type must remain within a single uint8. */
} Net_Packet_Type;
#endif // test network
#define TOX_PORTRANGE_FROM 33445
@ -591,7 +540,7 @@ char *net_new_strerror(int error);
* It's valid to pass NULL as the argument, the function does nothing in this
* case.
*/
non_null()
nullable(1)
void net_kill_strerror(char *strerror);
/** @brief Initialize networking.