21 lines
461 B
C++
21 lines
461 B
C++
#include <string.h>
|
|
|
|
#include "UdpVpnClient.hpp"
|
|
#include "ip_header.hpp"
|
|
|
|
UdpVpnClient::UdpVpnClient(const struct sockaddr_in6& server) : UdpVpn() {
|
|
_peer = new VpnPeer(this, server, in6addr_any);
|
|
}
|
|
|
|
UdpVpnClient::~UdpVpnClient() {
|
|
delete _peer;
|
|
}
|
|
|
|
void UdpVpnClient::acquire_peer(
|
|
VpnDataPacket& packet,
|
|
const sockaddr_in6&)
|
|
{
|
|
if(!packet.parse_as_ipv6())
|
|
return;
|
|
_peer->set_int_addr(packet.get_ipv6_header().source);
|
|
}
|