![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsAbstractNetworkAddress.h>


Public Types | |
| using | Port = uint16_t |
Public Member Functions | |
| AbstractNetworkAddress ()=default | |
| virtual size_t | binarySize () const =0 |
| virtual void | clear () |
| virtual void | clearAddress ()=0 |
| virtual void | clearPort () |
| virtual const UChar * | familyName () const =0 |
| virtual size_t | getAddress (void *addr, size_t size) const =0 |
| virtual bool | hasAddress () const =0 |
| virtual bool | hasPort () const |
| virtual bool | isMulticast () const =0 |
| virtual Port | port () const |
| virtual bool | resolve (const UString &name, Report &report)=0 |
| virtual bool | setAddress (const void *addr, size_t size)=0 |
| virtual void | setPort (Port port) |
| virtual UString | toFullString () const |
| virtual UString | toString () const =0 |
Static Public Attributes | |
| static constexpr Port | AnyPort = 0 |
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.
| using ts::AbstractNetworkAddress::Port = uint16_t |
The concept of port is used by TCP and UDP over IP networks.
|
default |
Default constructor.
|
pure virtual |
Get the maximum binary size in bytes for an address of that class.
Implemented in ts::IPAddress, 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::IPAddress, and ts::MACAddress.
|
virtual |
Clear the object, address and port if there is any.
|
pure virtual |
Check if this object is set to a valid address.
Implemented in ts::IPAddress, 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::IPAddress, 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::IPAddress, and ts::MACAddress.
|
pure virtual |
Clear the address field.
Implemented in ts::IPAddress, and ts::MACAddress.
|
pure virtual |
Check if the address is a multicast address.
Implemented in ts::IPAddress, 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::IPSocketAddress.
|
virtual |
Set the port. The default implementation does nothing.
| [in] | port | The port number as an integer in host byte order. |
Reimplemented in ts::IPSocketAddress.
|
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::IPAddress, ts::IPAddressMask, ts::IPSocketAddress, 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::IPAddress, ts::IPAddressMask, and ts::IPSocketAddress.
|
pure virtualinherited |
Convert to a string object.
Implemented in ts::AC3Attributes, ts::AVCAttributes, ts::CASDate< YEARBASE >, ts::CASDate< 1980 >, ts::CASDate< 1990 >, ts::CASDate< 2000 >, ts::DeliverySystemSet, ts::HEVCAttributes, ts::hls::AltPlayList, ts::hls::MediaElement, ts::hls::MediaPlayList, ts::hls::PlayList, ts::IPAddress, ts::IPAddressMask, ts::IPSocketAddress, ts::LNB, ts::MACAddress, ts::mcast::FDTInstanceHeader, ts::mcast::FECPayloadId, ts::mcast::FECTransmissionInformation, ts::mcast::FluteSessionId, ts::mcast::LCTHeader, ts::mcast::NIPActualCarrierInformation, ts::mcast::NIPStreamId, ts::MPEG2AudioAttributes, ts::MPEG2VideoAttributes, ts::NetworkInterface, ts::PCRAnalyzer::Status, ts::Service, ts::ServiceIdTriplet, ts::SignalState, ts::SignalState::Value, ts::Time, ts::TransportStreamId, ts::Unicable, ts::VLANIdStack, and ts::xml::Document.
|
staticconstexpr |
Wildcard integer value for "any port" or "no port".