add some documentation to updstunner.h

This commit is contained in:
sehraf 2020-02-05 19:01:42 +01:00
parent 1874241ddd
commit 4095d82a67
No known key found for this signature in database
GPG Key ID: DF09F6EAE356B2C6

View File

@ -30,10 +30,10 @@
#include "util/rsthreads.h"
#include <string>
/* UdpStun.
/**
* @brief The TouStunPeer class
* Stuns peers to determine external addresses.
*/
class TouStunPeer
{
public:
@ -53,10 +53,15 @@ class TouStunPeer
return;
}
/// id for identification
std::string id;
/// remote address
struct sockaddr_in remote, eaddr;
/// true when a response was received in the past
bool response;
/// used to rate limit STUN requests
rstime_t lastsend;
/// fail counter for dead/bad peer detection (0 = good)
uint32_t failCount;
};
@ -65,6 +70,13 @@ class TouStunPeer
* #define UDPSTUN_ALLOW_LOCALNET 1
*/
/**
* @brief The UdpStunner class
* The UDP stunner implements the STUN protocol to determin the NAT type (behind that RS is usually running).
* It maintains a list of DHT peers that are regulary contacted.
*
* The actual NAT type determination logic is located in void pqiNetStateBox::determineNetworkState()
*/
class UdpStunner: public UdpSubReceiver
{
public: