2020-06-05 16:14:49 +02:00
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
#include "UdpVpnClient.hpp"
|
|
|
|
#include "ip_header.hpp"
|
|
|
|
|
|
|
|
UdpVpnClient::UdpVpnClient(const struct sockaddr_in6& server) : UdpVpn() {
|
2020-06-15 20:21:07 +02:00
|
|
|
_peer = std::make_unique<VpnPeer>(this, server, in6addr_any);
|
2020-06-05 16:14:49 +02:00
|
|
|
}
|
|
|
|
|
2020-06-15 20:21:07 +02:00
|
|
|
void UdpVpnClient::acquire_peer(
|
2020-06-26 19:41:55 +02:00
|
|
|
VpnDataPacket& packet,
|
2020-06-15 20:21:07 +02:00
|
|
|
const sockaddr_in6&)
|
|
|
|
{
|
|
|
|
if(!packet.parse_as_ipv6())
|
2020-06-05 16:14:49 +02:00
|
|
|
return;
|
2020-06-15 20:21:07 +02:00
|
|
|
_peer->set_int_addr(packet.get_ipv6_header().source);
|
2020-06-05 16:14:49 +02:00
|
|
|
}
|