congestvpn/UdpVpnClient.cpp

18 lines
421 B
C++
Raw Normal View History

#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(
2020-06-26 19:41:55 +02:00
VpnDataPacket& packet,
const sockaddr_in6&)
{
if(!packet.parse_as_ipv6())
return;
_peer->set_int_addr(packet.get_ipv6_header().source);
}