TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Abstract base class for all network address and socket address classes. More...
#include <tsAbstractNetworkAddress.h>
Public Types | |
using | Port = uint16_t |
The concept of port is used by TCP and UDP over IP networks. | |
Public Member Functions | |
AbstractNetworkAddress ()=default | |
Default constructor. | |
virtual size_t | binarySize () const =0 |
Get the maximum binary size for an address of that class. | |
virtual void | clear () |
Clear the object, address and port if there is any. | |
virtual void | clearAddress ()=0 |
Clear the address field. | |
virtual void | clearPort () |
Clear the port. | |
virtual const UChar * | familyName () const =0 |
Get a human-readable family name for an address of that class. | |
virtual size_t | getAddress (void *addr, size_t size) const =0 |
Get the network address as binary data. | |
virtual bool | hasAddress () const =0 |
Check if this object is set to a valid address. | |
virtual bool | hasPort () const |
Check if a port is set. | |
virtual bool | isMulticast () const =0 |
Check if the address is a multicast address. | |
virtual Port | port () const |
Get the port if there is one. | |
virtual bool | resolve (const UString &name, Report &report)=0 |
Decode a string containing a network address in family-specific format. | |
virtual bool | setAddress (const void *addr, size_t size)=0 |
Set the network address from binary data. | |
virtual void | setPort (Port port) |
Set the port. | |
virtual UString | toFullString () const |
Convert to a string object in numeric format without the default compaction. | |
virtual UString | toString () const =0 |
Convert to a string object. | |
Static Public Attributes | |
static constexpr Port | AnyPort = 0 |
Wildcard integer value for "any port" or "no port". | |
Abstract base class for all network address and socket address classes.
For each family (IPv4, IPv6, MAC), there is a binary representation of the address (4, 16 or 7 bytes). In the IP families, socket addresses are subclasses of the address class, with the addition of a "port" value.
|
pure virtual |
Get the maximum binary size for an address of that class.
Implemented in ts::IPv4Address, ts::IPv6Address, and ts::MACAddress.
|
pure virtual |
Get a human-readable family name for an address of that class.
This is typically something like "IPv4" or "IPv6".
Implemented in ts::IPv4Address, ts::IPv6Address, and ts::MACAddress.
|
pure virtual |
Check if this object is set to a valid address.
Implemented in ts::IPv4Address, ts::IPv6Address, and ts::MACAddress.
|
pure virtual |
Get the network address as binary data.
[out] | addr | Address of binary buffer to receive binary data. |
[in] | size | Size in bytes of buffer. |
Implemented in ts::IPv4Address, ts::IPv6Address, and ts::MACAddress.
|
pure virtual |
Set the network address from binary data.
[in] | addr | Address of binary data. |
[in] | size | Size in bytes of binary data. |
Implemented in ts::IPv4Address, ts::IPv6Address, and ts::MACAddress.
|
pure virtual |
Clear the address field.
Implemented in ts::IPv4Address, ts::IPv6Address, and ts::MACAddress.
|
pure virtual |
Check if the address is a multicast address.
Implemented in ts::IPv4Address, ts::IPv6Address, and ts::MACAddress.
|
virtual |
Check if a port is set.
|
virtual |
Get the port if there is one.
The default implementation returns AnyPort.
Reimplemented in ts::IPv4SocketAddress, and ts::IPv6SocketAddress.
|
virtual |
Set the port.
The default implementation does nothing.
[in] | port | The port number as an integer in host byte order. |
Reimplemented in ts::IPv4SocketAddress, and ts::IPv6SocketAddress.
|
virtual |
Clear the port.
The default implementatio sets the port to AnyPort
|
pure virtual |
Decode a string containing a network address in family-specific format.
[in] | name | A string containing either a host name or a numerical representation of the address. |
[in] | report | Where to report errors. |
Implemented in ts::IPv4Address, ts::IPv4SocketAddress, ts::IPv6Address, ts::IPv6SocketAddress, and ts::MACAddress.
|
virtual |
Convert to a string object in numeric format without the default compaction.
The method toString() (inherited from StringifyInterface) returns a default representation of the string, with possible compaction of omitted defaults. This method returns a complete version of the address representation. The default implementation returns the same value as toString().
Reimplemented in ts::IPv6Address, and ts::IPv6SocketAddress.
|
pure virtualinherited |
Convert to a string object.
Implemented in ts::VLANIdStack, ts::IPv4Address, ts::IPv4AddressMask, ts::IPv4SocketAddress, ts::IPv6Address, ts::IPv6SocketAddress, ts::MACAddress, ts::Time, ts::xml::Document, ts::DeliverySystemSet, ts::LNB, ts::SignalState::Value, ts::SignalState, ts::CASDate< YEARBASE >, ts::AC3Attributes, ts::AVCAttributes, ts::HEVCAttributes, ts::MPEG2AudioAttributes, ts::MPEG2VideoAttributes, ts::hls::AltPlayList, ts::hls::MediaElement, ts::hls::MediaPlayList, ts::hls::PlayList, ts::Service, ts::ServiceIdTriplet, ts::TransportStreamId, and ts::PCRAnalyzer::Status.