Luanti 5.16.0-dev
Loading...
Searching...
No Matches
con Namespace Reference

Classes

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

Typedefs

typedef std::shared_ptr< ConnectionEventConnectionEventPtr
typedef std::shared_ptr< ConnectionCommandConnectionCommandPtr
typedef std::shared_ptr< BufferedPacketBufferedPacketPtr

Enumerations

enum  rtt_stat_type : int {
  MIN_RTT , MAX_RTT , AVG_RTT , MIN_JITTER ,
  MAX_JITTER , AVG_JITTER
}
enum  rate_stat_type : int {
  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  PacketType : u8 {
  PACKET_TYPE_CONTROL = 0 , PACKET_TYPE_ORIGINAL = 1 , PACKET_TYPE_SPLIT = 2 , PACKET_TYPE_RELIABLE = 3 ,
  PACKET_TYPE_MAX
}
enum  ControlType : u8 { CONTROLTYPE_ACK = 0 , CONTROLTYPE_SET_PEER_ID = 1 , CONTROLTYPE_PING = 2 , CONTROLTYPE_DISCO = 3 }
enum  ConnectionCommandType {
  CONNCMD_NONE , CONNCMD_SERVE , CONNCMD_CONNECT , CONNCMD_DISCONNECT ,
  CONNCMD_DISCONNECT_PEER , CONNCMD_SEND , CONNCMD_SEND_TO_ALL , CONCMD_ACK ,
  CONCMD_CREATE_PEER , CONNCMD_RESEND_ONE , CONNCMD_PEER_ID_SET
}

Functions

IConnectioncreateMTP (float timeout, bool ipv6, PeerHandler *handler)
BufferedPacketPtr makePacket (const 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)
float CALC_DTIME (u64 lasttime, u64 curtime)
static session_t readPeerId (const u8 *packetdata)
static u8 readChannel (const u8 *packetdata)

Typedef Documentation

◆ BufferedPacketPtr

typedef std::shared_ptr<BufferedPacket> con::BufferedPacketPtr

◆ ConnectionCommandPtr

typedef std::shared_ptr<ConnectionCommand> con::ConnectionCommandPtr

◆ ConnectionEventPtr

typedef std::shared_ptr<ConnectionEvent> con::ConnectionEventPtr

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 
CONNCMD_RESEND_ONE 
CONNCMD_PEER_ID_SET 

◆ ConnectionEventType

Enumerator
CONNEVENT_NONE 
CONNEVENT_DATA_RECEIVED 
CONNEVENT_PEER_ADDED 
CONNEVENT_PEER_REMOVED 
CONNEVENT_BIND_FAILED 

◆ ControlType

enum con::ControlType : u8
Enumerator
CONTROLTYPE_ACK 
CONTROLTYPE_SET_PEER_ID 
CONTROLTYPE_PING 
CONTROLTYPE_DISCO 

◆ PacketType

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

◆ rate_stat_type

enum con::rate_stat_type : int
Enumerator
CUR_DL_RATE 
AVG_DL_RATE 
CUR_INC_RATE 
AVG_INC_RATE 
CUR_LOSS_RATE 
AVG_LOSS_RATE 

◆ rtt_stat_type

enum con::rtt_stat_type : int
Enumerator
MIN_RTT 
MAX_RTT 
AVG_RTT 
MIN_JITTER 
MAX_JITTER 
AVG_JITTER 

Function Documentation

◆ CALC_DTIME()

float con::CALC_DTIME ( u64 lasttime,
u64 curtime )
inline

References MYMAX, and MYMIN.

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

Here is the caller graph for this function:

◆ createMTP()

IConnection * con::createMTP ( float timeout,
bool ipv6,
PeerHandler * handler )

◆ 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()

BufferedPacketPtr con::makePacket ( const 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, sanity_check, writeU16(), and writeU8().

Referenced by makeAutoSplitPacket().

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

◆ readChannel()

u8 con::readChannel ( const u8 * packetdata)
inlinestatic

References readU8().

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

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

◆ readPeerId()

session_t con::readPeerId ( const u8 * packetdata)
inlinestatic

References readU16().

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

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: