|
|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
#include "../lib/socket_compat.h" |
|
|
|
|
#include "../lib/swm_min.h" |
|
|
|
|
#include <stdint.h> |
|
|
|
|
#include <stddef.h> |
|
|
|
|
|
|
|
|
|
#define UDP_HDR_SIZE 28// размер udp header + ethernet заголовков (ipv4) [для ipv6 = 48 байт]
|
|
|
|
|
#define UDP_SC_HDR_SIZE (13+8+4 + 5)// 13+8+4 - sc_nonce+tag size+crc, 5 - payload hdr
|
|
|
|
|
@ -35,6 +36,12 @@ struct ETCP_DGRAM {// пакет (незашифрованный)
|
|
|
|
|
}; |
|
|
|
|
#pragma pack(pop) |
|
|
|
|
|
|
|
|
|
/* Размер зашифрованного заголовка ETCP_DGRAM (timestamp + flag_up + padding) */ |
|
|
|
|
#define ETCP_ENCRYPTED_HDR_SIZE (offsetof(struct ETCP_DGRAM, data) - offsetof(struct ETCP_DGRAM, timestamp)) |
|
|
|
|
|
|
|
|
|
/* Размер базового ACK: type(1) + count(1) + last_delivered_id(4) + rx_dup_count(2) */ |
|
|
|
|
#define ETCP_ACK_BASE_SIZE (2 + 4 + 2) |
|
|
|
|
|
|
|
|
|
typedef void (*etcp_ping_callback_t)(int success, uint16_t rtt, void* arg, uint64_t nonce, |
|
|
|
|
const uint8_t* resp_data, size_t resp_data_len); |
|
|
|
|
struct PING_CONTEXT { |
|
|
|
|
|