openDAQ
Open data acquisition platform
NetworkInterfacePtr Class Reference

Provides an interface to manipulate the configuration of a device's (server's) network interface. Offers methods to update the IP configuration and retrieve the currently active one, if the corresponding feature supported by the device. Additionally, includes a helper method to create a prebuilt property object with valid default configuration. More...

Inherits ObjectPtr< INetworkInterface >.

Detailed Description

Provides an interface to manipulate the configuration of a device's (server's) network interface. Offers methods to update the IP configuration and retrieve the currently active one, if the corresponding feature supported by the device. Additionally, includes a helper method to create a prebuilt property object with valid default configuration.

The configuration property object, passed as a parameter to said methods, should include the following properties:

  • **"dhcp4"**: A boolean property indicating whether DHCP is enabled for IPv4. Defaults to True (DHCP enabled). If set to False (DHCP disabled), non-empty static configuration properties are required.
  • **"address4"**: A string property specifying the statically assigned IPv4 address in the format address/netmask (e.g. 192.168.1.2/24). This property is ignored when DHCP is enabled for IPv4. However, if DHCP is disabled, the list must include at least one address. Defaults to an empty string.
  • **"gateway4"**: A string property specifying the IPv4 gateway address. This is required if DHCP is disabled and ignored otherwise. Defaults to an empty string.
  • **"dhcp6"**, **"address6"**, **"gateway6"**: These properties follow the same format and rules as their IPv4 counterparts but apply to IPv6 configuration.

Public Member Functions

daq::PropertyObjectPtr requestCurrentConfiguration () const
 Requests the currently active configuration for the network interface. More...
 
void submitConfiguration (const daq::PropertyObjectPtr &config) const
 Submits a new configuration for the network interface. More...
 
daq::PropertyObjectPtr createDefaultConfiguration () const
 Creates a property object containing default configuration values for a network interface. More...