You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
951 B

/* 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