congestvpn/UdpVpnClient.cpp

17 lines
421 B
C++

#include <cstring>
#include "UdpVpnClient.hpp"
#include "ip_header.hpp"
UdpVpnClient::UdpVpnClient(const struct sockaddr_in6& server) : UdpVpn() {
_peer = std::make_unique<VpnPeer>(this, server, in6addr_any);
}
void UdpVpnClient::acquire_peer(
VpnDataPacket& packet,
const sockaddr_in6&)
{
if(!packet.parse_as_ipv6())
return;
_peer->set_int_addr(packet.get_ipv6_header().source);
}