congestvpn/UdpVpnClient.cpp

17 lines
422 B
C++

#include <string.h>
#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);
}