TSDuck Version 3.15-955 (TSDuck - The MPEG Transport Stream Toolkit)
tsIPUtils.h File Reference

Utilities for IP networking. More...

Namespaces

 ts
 TSDuck namespace, containing all TSDuck classes and functions.
 

Typedefs

typedef int ts::SocketErrorCode
 Type for socket error code.
 

Enumerations

enum  : uint8_t {
  ts::IPv4_PROTO_ICMP = 1,
  ts::IPv4_PROTO_IGMP = 2,
  ts::IPv4_PROTO_TCP = 6,
  ts::IPv4_PROTO_UDP = 17
}
 Selected IP protocol identifiers. More...
 

Functions

bool ts::GetLocalIPAddresses (IPAddressMaskVector &addresses, Report &report=(*ts::CerrReport::Instance()))
 Get the list of all local IPv4 addresses in the system with their network masks. More...
 
bool ts::GetLocalIPAddresses (IPAddressVector &addresses, Report &report=(*ts::CerrReport::Instance()))
 Get the list of all local IPv4 addresses in the system. More...
 
uint16_t ts::IPHeaderChecksum (const void *data, size_t size)
 Compute the checksum of an IPv4 header. More...
 
size_t ts::IPHeaderSize (const void *data, size_t size)
 Get the size in bytes of an IPv4 header. More...
 
bool ts::IPInitialize (Report &=(*ts::CerrReport::Instance()))
 Initialize the IP libraries in the current process. More...
 
bool ts::IsLocalIPAddress (const IPAddress &address)
 Check if a local system interface has a specified IP address. More...
 
SocketErrorCode ts::LastSocketErrorCode ()
 Get the error code of the last socket system call. More...
 
UString ts::SocketErrorCodeMessage (SocketErrorCode code=LastSocketErrorCode())
 Format a socket error code into a string. More...
 
bool ts::UpdateIPHeaderChecksum (void *data, size_t size)
 Update the checksum of an IPv4 header. More...
 
bool ts::VerifyIPHeaderChecksum (const void *data, size_t size)
 Verify the checksum of an IPv4 header. More...
 

Variables

const size_t ts::IP_MAX_PACKET_SIZE = 65536
 Maximum size of an IP packet.
 
const size_t ts::IPv4_CHECKSUM_OFFSET = 10
 Offset of the checksum in an IPv4 header.
 
const size_t ts::IPv4_DEST_ADDR_OFFSET = 16
 Offset of destination IP address in an IPv4 header.
 
const size_t ts::IPv4_MIN_HEADER_SIZE = 20
 Minimum size of an IPv4 header.
 
const size_t ts::IPv4_PROTOCOL_OFFSET = 9
 Offset of the protocol identifier in an IPv4 header.
 
const size_t ts::IPv4_SRC_ADDR_OFFSET = 12
 Offset of source IP address in an IPv4 header.
 
const uint8_t ts::IPv4_VERSION = 4
 Protocol version of IPv4 is ... 4 !
 
const size_t ts::UDP_HEADER_SIZE = 8
 Size of a UDP header.
 

Detailed Description

Utilities for IP networking.