2020-07-22 15:52:55 +02:00
|
|
|
#include <string.h>
|
2020-06-05 16:14:49 +02:00
|
|
|
|
|
|
|
#include "UdpVpnClient.hpp"
|
|
|
|
#include "ip_header.hpp"
|
|
|
|
|
|
|
|
UdpVpnClient::UdpVpnClient(const struct sockaddr_in6& server) : UdpVpn() {
|
2020-07-22 17:04:22 +02:00
|
|
|
_peer = new VpnPeer(this, server, in6addr_any);
|
|
|
|
}
|
|
|
|
|
|
|
|
UdpVpnClient::~UdpVpnClient() {
|
|
|
|
delete _peer;
|
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
|
|
|
}
|