Files
utun2/src/nat_transport.h
T
evgeny a97e8bcc1f docs: update file inventory and module header contracts
Refresh both AGENTS guides and clarify module purpose, usage, ownership, threading, return values and wire formats in headers. Remove the unused timeout_heap freed_count field and unimplemented getter.
2026-10-04 13:10:01 +02:00

35 lines
951 B
C

/* IPv4 NAT через отдельный TUN и сервис ETCP_RT_ID_NAT в UTUN-router.
* nat_via_node_id задаёт удалённого провайдера; при 0 узел сам выполняет eim_nat для клиентов.
* init создаёт TUN/обработчики по nat_enabled; destroy снимает их и освобождает ресурсы.
* Контекст принадлежит UTUN_INSTANCE; очереди и callbacks работают в uasync. */
#ifndef NAT_TRANSPORT_H
#define NAT_TRANSPORT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
struct tun_if;
struct ETCP_CONN;
struct nat_transport_ctx {
uint64_t self_node_id;
uint64_t nat_via_node_id;
struct tun_if* nat_tun;
int initialized;
};
struct UTUN_INSTANCE;
int nat_transport_init(struct UTUN_INSTANCE* inst);
void nat_transport_destroy(struct UTUN_INSTANCE* inst);
#ifdef __cplusplus
}
#endif
#endif