openDAQ
Open data acquisition platform
INetworkInterface Struct Referenceabstract

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...

+ Inheritance diagram for INetworkInterface:
+ Collaboration diagram for 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

virtual ErrCode INTERFACE_FUNC requestCurrentConfiguration (IPropertyObject **config)=0
 Requests the currently active configuration for the network interface. More...
 
virtual ErrCode INTERFACE_FUNC submitConfiguration (IPropertyObject *config)=0
 Submits a new configuration for the network interface. More...
 
virtual ErrCode INTERFACE_FUNC createDefaultConfiguration (IPropertyObject **defaultConfig)=0
 Creates a property object containing default configuration values for a network interface. More...
 
- Public Member Functions inherited from IBaseObject
virtual ErrCode INTERFACE_FUNC borrowInterface (const IntfID &intfID, void **obj) const =0
 Returns another interface which is supported by the object without incrementing the reference count. More...
 
virtual ErrCode INTERFACE_FUNC dispose ()=0
 Disposes all references held by the object. More...
 
virtual ErrCode INTERFACE_FUNC getHashCode (SizeT *hashCode)=0
 Returns hash code of the object. More...
 
virtual ErrCode INTERFACE_FUNC equals (IBaseObject *other, Bool *equal) const =0
 Compares object to another object for equality. More...
 
virtual ErrCode INTERFACE_FUNC toString (CharPtr *str)=0
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from IUnknown
virtual ErrCode INTERFACE_FUNC queryInterface (const IntfID &intfID, void **obj)=0
 Returns another interface which is supported by the object and increments the reference count. More...
 
virtual int INTERFACE_FUNC addRef ()=0
 Increments the reference count for an interface on an object. More...
 
virtual int INTERFACE_FUNC releaseRef ()=0
 Decrements the reference count for an interface on an object. More...
 

Member Function Documentation

◆ createDefaultConfiguration()

virtual ErrCode INTERFACE_FUNC createDefaultConfiguration ( IPropertyObject **  defaultConfig)
pure virtual

Creates a property object containing default configuration values for a network interface.

Parameters
[out]defaultConfigThe configuration object containing default settings for configuring device's network interface.

The created object can be modified or directly submitted using the submitConfiguration method.

◆ requestCurrentConfiguration()

virtual ErrCode INTERFACE_FUNC requestCurrentConfiguration ( IPropertyObject **  config)
pure virtual

Requests the currently active configuration for the network interface.

Parameters
[out]configThe property object containing the currently active configuration.
Return values
OPENDAQ_ERR_NOTIMPLEMENTEDif the device doesn't support retrieving the active configuration.

◆ submitConfiguration()

virtual ErrCode INTERFACE_FUNC submitConfiguration ( IPropertyObject config)
pure virtual

Submits a new configuration for the network interface.

Parameters
configThe new configuration to apply.
Return values
OPENDAQ_SUCCESSif the new configuration is applied successfully; otherwise, returns an informative error code.

The provided configuration must adhere to the required properties, including "dhcp4", "address4", "gateway4", and their IPv6 equivalents, as described in the class-level documentation.