TSDuck v3.40-4033
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
tsIPProtocols.h File Reference

Definitions of protocols for IP networking. More...

Classes

class  ts::VLANId
 A structure which describes a VLAN identification. More...
 
class  ts::VLANIdStack
 A stack of VLAN identifiers, from outer to inner VLAN. More...
 

Namespaces

namespace  ts
 TSDuck namespace, containing all TSDuck classes and functions.
 

Typedefs

using ts::rtp_units = cn::duration< std::intmax_t, std::ratio< 1, RTP_RATE_MP2T > >
 Definition of a number of RTP clock units as a std::chrono::duration type.
 

Enumerations

enum  : uint16_t {
  ts::ETHERTYPE_IPv4 = 0x0800 ,
  ts::ETHERTYPE_ARP = 0x0806 ,
  ts::ETHERTYPE_WOL = 0x0842 ,
  ts::ETHERTYPE_RARP = 0x8035 ,
  ts::ETHERTYPE_802_1Q = 0x8100 ,
  ts::ETHERTYPE_IPv6 = 0x86DD ,
  ts::ETHERTYPE_802_1AD = 0x88A8 ,
  ts::ETHERTYPE_802_1AH = 0x88E7 ,
  ts::ETHERTYPE_NULL = 0xFFFF
}
 Selected Ethernet II protocol type identifiers. More...
 
enum  : uint8_t {
  ts::IP_SUBPROTO_HOPxHOP = 0 ,
  ts::IP_SUBPROTO_ICMP = 1 ,
  ts::IP_SUBPROTO_IGMP = 2 ,
  ts::IP_SUBPROTO_TCP = 6 ,
  ts::IP_SUBPROTO_UDP = 17 ,
  ts::IP_SUBPROTO_V6_ENCAP = 41 ,
  ts::IP_SUBPROTO_ROUTING = 43 ,
  ts::IP_SUBPROTO_FRAGMENT = 44 ,
  ts::IP_SUBPROTO_OSPF = 89 ,
  ts::IP_SUBPROTO_SCTP = 132
}
 Selected IP protocol identifiers. More...
 

Functions

UString ts::IPProtocolName (uint8_t protocol, bool long_format=false)
 Get the name of an IP protocol (UDP, TCP, etc).
 
bool ts::TCPOrderedSequence (uint32_t seq1, uint32_t seq2)
 Check if two TCP sequence numbers are ordered, including wrapping back at 0xFFFFFFFF.
 
uint32_t ts::TCPSequenceDiff (uint32_t seq1, uint32_t seq2)
 Compute the difference between two TCP sequence numbers, including wrapping back at 0xFFFFFFFF.
 

Variables

constexpr size_t ts::ETHER_ADDR_SIZE = 6
 Size in bytes of a MAC address in an Ethernet II header.
 
constexpr size_t ts::ETHER_CRC_SIZE = 4
 Size in bytes of the trailing CRC in an Ethernet II frame.
 
constexpr size_t ts::ETHER_DEST_ADDR_OFFSET = 0
 Offset of destination MAC address in an Ethernet II header.
 
constexpr size_t ts::ETHER_HEADER_SIZE = 14
 Size of an Ethernet II header.
 
constexpr size_t ts::ETHER_SRC_ADDR_OFFSET = 6
 Offset of destination MAC address in an Ethernet II header.
 
constexpr size_t ts::ETHER_TYPE_OFFSET = 12
 Offset of destination MAC address in an Ethernet II header.
 
constexpr size_t ts::IP_MAX_PACKET_SIZE = 65536
 Maximum size of an IP packet.
 
constexpr size_t ts::IPv4_CHECKSUM_OFFSET = 10
 Offset of the checksum in an IPv4 header.
 
constexpr size_t ts::IPv4_DEST_ADDR_OFFSET = 16
 Offset of destination IP address in an IPv4 header.
 
constexpr size_t ts::IPv4_FRAGMENT_OFFSET = 6
 Offset of the flags and fragments in an IPv4 header.
 
constexpr size_t ts::IPv4_LENGTH_OFFSET = 2
 Offset of the total packet length in an IPv4 header.
 
constexpr size_t ts::IPv4_MIN_HEADER_SIZE = 20
 Minimum size of an IPv4 header.
 
constexpr size_t ts::IPv4_PROTOCOL_OFFSET = 9
 Offset of the protocol identifier in an IPv4 header.
 
constexpr size_t ts::IPv4_SRC_ADDR_OFFSET = 12
 Offset of source IP address in an IPv4 header.
 
constexpr uint8_t ts::IPv4_VERSION = 4
 Protocol version of IPv4 is ... 4 !
 
constexpr size_t ts::IPv6_DEST_ADDR_OFFSET = 24
 Offset of destination IP address in an IPv6 header.
 
constexpr size_t ts::IPv6_EXT_HEADER_SIZE = 8
 Minimum size of an extended IPv6 header.
 
constexpr size_t ts::IPv6_LENGTH_OFFSET = 4
 Offset of the 16-bit payload length in an IPv6 header.
 
constexpr size_t ts::IPv6_MIN_HEADER_SIZE = 40
 Minimum size of an IPv6 header.
 
constexpr size_t ts::IPv6_NEXTHEAD_OFFSET = 6
 Offset of the 8-bit "next header" field in an IPv6 header.
 
constexpr size_t ts::IPv6_SRC_ADDR_OFFSET = 8
 Offset of source IP address in an IPv6 header.
 
constexpr uint8_t ts::IPv6_VERSION = 6
 Protocol version of IPv6 is ... 6 !
 
constexpr size_t ts::RTP_HEADER_SIZE = 12
 Size in bytes of the fixed part of the RTP header.
 
constexpr uint8_t ts::RTP_PT_MP2T = 33
 RTP payload type for MPEG2-TS.
 
constexpr uint64_t ts::RTP_RATE_MP2T = 90000
 RTP clock rate for MPEG2-TS.
 
constexpr size_t ts::TCP_DEST_PORT_OFFSET = 2
 Offset of destination port in a TCP header.
 
constexpr size_t ts::TCP_FLAGS_OFFSET = 13
 Offset of flags byte in a TCP header.
 
constexpr size_t ts::TCP_HEADER_LENGTH_OFFSET = 12
 Offset of TCP header length in a TCP header (number of 32-bit words).
 
constexpr size_t ts::TCP_MAX_PAYLOAD_SIZE = IP_MAX_PACKET_SIZE - IPv4_MIN_HEADER_SIZE - TCP_MIN_HEADER_SIZE
 Maximum size in bytes of a TCP payload.
 
constexpr size_t ts::TCP_MIN_HEADER_SIZE = 20
 Minimum size in bytes of a TCP header.
 
constexpr size_t ts::TCP_SEQUENCE_OFFSET = 4
 Offset of sequence number in a TCP header.
 
constexpr size_t ts::TCP_SRC_PORT_OFFSET = 0
 Offset of source port in a TCP header.
 
constexpr size_t ts::TCP_WSIZE_OFFSET = 14
 Offset of window size in a TCP header.
 
constexpr size_t ts::UDP_CHECKSUM_OFFSET = 6
 Offset of checksum in a UDP header.
 
constexpr size_t ts::UDP_DEST_PORT_OFFSET = 2
 Offset of destination port in a UDP header.
 
constexpr size_t ts::UDP_HEADER_SIZE = 8
 Size of a UDP header.
 
constexpr size_t ts::UDP_LENGTH_OFFSET = 4
 Offset of packet length (UDP header + UDP payload) in a UDP header.
 
constexpr size_t ts::UDP_SRC_PORT_OFFSET = 0
 Offset of source port in a UDP header.
 
constexpr uint32_t ts::VLAN_ID_NULL = 0xFFFFFFFF
 Invalid VLAN identifier, can be used as placeholder.
 

Detailed Description

Definitions of protocols for IP networking.