OpenTTD Source: src/network/core/tcp_stun.cpp Source File

OpenTTD Source 12.0-beta1

tcp_stun.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
12 #include "../../stdafx.h"
13 #include "../../debug.h"
14 #include "tcp_stun.h"
15
16 #include "../../safeguards.h"
17
23 bool NetworkStunSocketHandler::ReceiveInvalidPacket(PacketStunType type)
24 {
25 Debug(net, 0, "[tcp/stun] Received illegal packet type {}", type);
26 return false;
27 }
28
29 bool NetworkStunSocketHandler::Receive_SERCLI_STUN(Packet *p) { return this->ReceiveInvalidPacket(PACKET_STUN_SERCLI_STUN); }
tcp_stun.h
PACKET_STUN_SERCLI_STUN
@ PACKET_STUN_SERCLI_STUN
Send a STUN request to the STUN server.
Definition: tcp_stun.h:21
NetworkStunSocketHandler::ReceiveInvalidPacket
bool ReceiveInvalidPacket(PacketStunType type)
Helper for logging receiving invalid packets.
Definition: tcp_stun.cpp:23
NetworkStunSocketHandler::Receive_SERCLI_STUN
virtual bool Receive_SERCLI_STUN(Packet *p)
Send a STUN request to the STUN server letting the Game Coordinator know what our actually public IP:...
Definition: tcp_stun.cpp:29
Packet
Internal entity of a packet.
Definition: packet.h:44
Debug
#define Debug(name, level, format_string,...)
Ouptut a line of debugging information.
Definition: debug.h:37
PacketStunType
PacketStunType
Enum with all types of TCP STUN packets.
Definition: tcp_stun.h:20