![]() |
TSDuck v3.43-4480
MPEG Transport Stream Toolkit
|
Common arguments for IP clients and servers, UDP and TCP. More...
#include <tsIPArgs.h>


Public Member Functions | |
| IPArgs (const UString &description=u"server", const UString &prefix=UString()) | |
| Constructor. | |
| virtual void | defineClientArgs (Args &args) |
| Add some command line options for a client in an Args. | |
| virtual void | defineServerArgs (Args &args) |
| Add command line options for a server in an Args. | |
| bool | isAllowed (const IPAddress &client) const |
| On the server side, check if a client address is allowed, based on sets of allowed and denied clients. | |
| bool | loadAllowedClients (Args &args, const UChar *option) |
| Load the set of allowed clients from a command line (server side). | |
| virtual bool | loadClientArgs (Args &args, const UChar *server_option=nullptr) |
| Load arguments for a client from a command line. | |
| bool | loadDeniedClients (Args &args, const UChar *option) |
| Load the set of denied clients from a command line (server side). | |
| virtual bool | loadServerArgs (Args &args, const UChar *server_option=nullptr) |
| Load arguments for a server from a command line. | |
Public Attributes | |
| IPAddressSet | allowed_clients {} |
| White-list of allowed incoming clients. | |
| cn::milliseconds | connection_timeout {0} |
| Connection timeout in milliseconds (zero means none). | |
| IPAddressSet | denied_clients {} |
| Black-list of denied incoming clients. | |
| cn::milliseconds | receive_timeout {0} |
| Reception timeout in milliseconds (zero means none). | |
| bool | reuse_port = true |
| Reuse-port socket option. | |
| IPSocketAddress | server_addr {} |
| Server address and port. The address is optional on server side. | |
| UString | server_name {} |
| Server host name (required in addition to server address in some cases). | |
Protected Attributes | |
| UString | _description |
| Short description of the TLS service. | |
| UString | _prefix |
| Option prefix, ready to use in other option names. | |
Common arguments for IP clients and servers, UDP and TCP.
Can be set by fields or using command line options.
Constructor.
| [in] | description | Short description of the TLS service. Example: "control port". Use no initial cap, no final dot. |
| [in] | prefix | Optional prefix for all command line options. Example: when prefix is "foo", the option –certificate-path becomes –foo-certificate-path. |
|
virtual |
Add command line options for a server in an Args.
No options is defined for server [addr:]port because the description is probably too specific. Same for lists of allowed and denied clients.
| [in,out] | args | Command line arguments to update. |
Reimplemented in ts::TLSArgs, and ts::RestArgs.
|
virtual |
Add some command line options for a client in an Args.
No options is defined for server addr:port because the description is probably too specific.
| [in,out] | args | Command line arguments to update. |
Reimplemented in ts::TLSArgs, and ts::RestArgs.
|
virtual |
Load arguments for a server from a command line.
Args error indicator is set in case of incorrect arguments.
| [in,out] | args | Command line arguments. |
| [in] | server_option | Optional name of an option which defines the server port and optional address. |
Reimplemented in ts::TLSArgs, and ts::RestArgs.
|
virtual |
Load arguments for a client from a command line.
Args error indicator is set in case of incorrect arguments.
| [in,out] | args | Command line arguments. |
| [in] | server_option | Optional name of an option which defines the server name and address. |
Reimplemented in ts::TLSArgs, and ts::RestArgs.
Load the set of allowed clients from a command line (server side).
| [in,out] | args | Command line arguments. |
| [in] | option | Option which defines the client addresses. |
Load the set of denied clients from a command line (server side).
| [in,out] | args | Command line arguments. |
| [in] | option | Option which defines the client addresses. |
| bool ts::IPArgs::isAllowed | ( | const IPAddress & | client | ) | const |
On the server side, check if a client address is allowed, based on sets of allowed and denied clients.
| [in] | client | Incoming client address. |