Minetest  5.4.0
con Namespace Reference

Classes

struct  BufferedPacket
 
struct  IncomingSplitPacket
 
class  ReliablePacketBuffer
 
class  IncomingSplitBuffer
 
struct  OutgoingPacket
 
struct  ConnectionCommand
 
class  Channel
 
class  PeerHelper
 
class  Peer
 
class  UDPPeer
 
struct  ConnectionEvent
 
class  Connection
 
class  ConnectionSendThread
 
class  ConnectionReceiveThread
 
class  NotFoundException
 
class  PeerNotFoundException
 
class  ConnectionException
 
class  ConnectionBindFailed
 
class  InvalidIncomingDataException
 
class  NoIncomingDataException
 
class  ProcessedSilentlyException
 
class  ProcessedQueued
 
class  IncomingDataCorruption
 
class  PeerHandler
 
struct  PeerChange
 

Typedefs

typedef enum con::MTProtocols MTProtocols
 
typedef std::list< BufferedPacket >::iterator RPBSearchResult
 

Enumerations

enum  MTProtocols { MTP_PRIMARY , MTP_UDP , MTP_MINETEST_RELIABLE_UDP }
 
enum  PacketType : u8 {
  PACKET_TYPE_CONTROL = 0 , PACKET_TYPE_ORIGINAL = 1 , PACKET_TYPE_SPLIT = 2 , PACKET_TYPE_RELIABLE = 3 ,
  PACKET_TYPE_MAX
}
 
enum  ConnectionCommandType {
  CONNCMD_NONE , CONNCMD_SERVE , CONNCMD_CONNECT , CONNCMD_DISCONNECT ,
  CONNCMD_DISCONNECT_PEER , CONNCMD_SEND , CONNCMD_SEND_TO_ALL , CONCMD_ACK ,
  CONCMD_CREATE_PEER
}
 
enum  rate_stat_type {
  CUR_DL_RATE , AVG_DL_RATE , CUR_INC_RATE , AVG_INC_RATE ,
  CUR_LOSS_RATE , AVG_LOSS_RATE
}
 
enum  ConnectionEventType {
  CONNEVENT_NONE , CONNEVENT_DATA_RECEIVED , CONNEVENT_PEER_ADDED , CONNEVENT_PEER_REMOVED ,
  CONNEVENT_BIND_FAILED
}
 
enum  rtt_stat_type {
  MIN_RTT , MAX_RTT , AVG_RTT , MIN_JITTER ,
  MAX_JITTER , AVG_JITTER
}
 
enum  PeerChangeType : u8 { PEER_ADDED , PEER_REMOVED }
 

Functions

BufferedPacket makePacket (Address &address, const SharedBuffer< u8 > &data, u32 protocol_id, session_t sender_peer_id, u8 channel)
 
SharedBuffer< u8 > makeOriginalPacket (const SharedBuffer< u8 > &data)
 
void makeSplitPacket (const SharedBuffer< u8 > &data, u32 chunksize_max, u16 seqnum, std::list< SharedBuffer< u8 >> *chunks)
 
void makeAutoSplitPacket (const SharedBuffer< u8 > &data, u32 chunksize_max, u16 &split_seqnum, std::list< SharedBuffer< u8 >> *list)
 
SharedBuffer< u8 > makeReliablePacket (const SharedBuffer< u8 > &data, u16 seqnum)
 
bool seqnum_higher (u16 totest, u16 base)
 
bool seqnum_in_window (u16 seqnum, u16 next, u16 window_size)
 
static float CALC_DTIME (u64 lasttime, u64 curtime)
 
static session_t readPeerId (u8 *packetdata)
 
static u8 readChannel (u8 *packetdata)
 

Variables

std::mutex log_conthread_mutex
 

Typedef Documentation

◆ MTProtocols

◆ RPBSearchResult

typedef std::list<BufferedPacket>::iterator con::RPBSearchResult

Enumeration Type Documentation

◆ ConnectionCommandType

Enumerator
CONNCMD_NONE 
CONNCMD_SERVE 
CONNCMD_CONNECT 
CONNCMD_DISCONNECT 
CONNCMD_DISCONNECT_PEER 
CONNCMD_SEND 
CONNCMD_SEND_TO_ALL 
CONCMD_ACK 
CONCMD_CREATE_PEER 

◆ ConnectionEventType

Enumerator
CONNEVENT_NONE 
CONNEVENT_DATA_RECEIVED 
CONNEVENT_PEER_ADDED 
CONNEVENT_PEER_REMOVED 
CONNEVENT_BIND_FAILED 

◆ MTProtocols

Enumerator
MTP_PRIMARY 
MTP_UDP 
MTP_MINETEST_RELIABLE_UDP 

◆ PacketType

enum con::PacketType : u8
Enumerator
PACKET_TYPE_CONTROL 
PACKET_TYPE_ORIGINAL 
PACKET_TYPE_SPLIT 
PACKET_TYPE_RELIABLE 
PACKET_TYPE_MAX 

◆ PeerChangeType

Enumerator
PEER_ADDED 
PEER_REMOVED 

◆ rate_stat_type

Enumerator
CUR_DL_RATE 
AVG_DL_RATE 
CUR_INC_RATE 
AVG_INC_RATE 
CUR_LOSS_RATE 
AVG_LOSS_RATE 

◆ rtt_stat_type

Enumerator
MIN_RTT 
MAX_RTT 
AVG_RTT 
MIN_JITTER 
MAX_JITTER 
AVG_JITTER 

Function Documentation

◆ CALC_DTIME()

static float con::CALC_DTIME ( u64  lasttime,
u64  curtime 
)
inlinestatic

References MYMAX, and MYMIN.

Referenced by con::Peer::isTimedOut(), con::ConnectionSendThread::run(), and con::ConnectionReceiveThread::run().

+ Here is the caller graph for this function:

◆ makeAutoSplitPacket()

void con::makeAutoSplitPacket ( const SharedBuffer< u8 > &  data,
u32  chunksize_max,
u16 &  split_seqnum,
std::list< SharedBuffer< u8 >> *  list 
)

References SharedBuffer< T >::getSize(), makeOriginalPacket(), and makeSplitPacket().

Referenced by con::UDPPeer::processReliableSendCommand(), and con::ConnectionSendThread::send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeOriginalPacket()

SharedBuffer<u8> con::makeOriginalPacket ( const SharedBuffer< u8 > &  data)

References SharedBuffer< T >::getSize(), PACKET_TYPE_ORIGINAL, and writeU8().

Referenced by makeAutoSplitPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makePacket()

BufferedPacket con::makePacket ( Address address,
const SharedBuffer< u8 > &  data,
u32  protocol_id,
session_t  sender_peer_id,
u8  channel 
)

References BASE_HEADER_SIZE, SharedBuffer< T >::getSize(), p(), writeU16(), writeU32(), and writeU8().

Referenced by con::ConnectionReceiveThread::handlePacketType_Reliable(), con::ConnectionReceiveThread::handlePacketType_Split(), con::UDPPeer::processReliableSendCommand(), con::ConnectionSendThread::rawSendAsPacket(), and TestConnection::testHelpers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeReliablePacket()

SharedBuffer< u8 > con::makeReliablePacket ( const SharedBuffer< u8 > &  data,
u16  seqnum 
)

References SharedBuffer< T >::getSize(), PACKET_TYPE_RELIABLE, writeU16(), and writeU8().

Referenced by con::UDPPeer::processReliableSendCommand(), con::ConnectionSendThread::rawSendAsPacket(), and TestConnection::testHelpers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeSplitPacket()

void con::makeSplitPacket ( const SharedBuffer< u8 > &  data,
u32  chunksize_max,
u16  seqnum,
std::list< SharedBuffer< u8 >> *  chunks 
)

References SharedBuffer< T >::getSize(), PACKET_TYPE_SPLIT, writeU16(), and writeU8().

Referenced by makeAutoSplitPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readChannel()

static u8 con::readChannel ( u8 *  packetdata)
static

References readU8().

Referenced by con::ConnectionReceiveThread::checkIncomingBuffers(), con::ConnectionReceiveThread::receive(), and con::ConnectionSendThread::runTimeouts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPeerId()

static session_t con::readPeerId ( u8 *  packetdata)
static

References readU16().

Referenced by con::ConnectionReceiveThread::checkIncomingBuffers(), con::ConnectionReceiveThread::receive(), and con::ConnectionSendThread::runTimeouts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ seqnum_higher()

bool con::seqnum_higher ( u16  totest,
u16  base 
)
inline

References SEQNUM_MAX.

Referenced by con::ConnectionReceiveThread::handlePacketType_Reliable().

+ Here is the caller graph for this function:

◆ seqnum_in_window()

bool con::seqnum_in_window ( u16  seqnum,
u16  next,
u16  window_size 
)
inline

References SEQNUM_MAX.

Referenced by con::ConnectionReceiveThread::handlePacketType_Reliable(), and con::ReliablePacketBuffer::insert().

+ Here is the caller graph for this function:

Variable Documentation

◆ log_conthread_mutex

std::mutex con::log_conthread_mutex