◆ set_information()

int CCEthernet::set_information ( ceth_device device,
ceth_set_types  command,
  ... 
)

Set a device's Ethernet configuration. This function can be used to change a device's DHCP name, IP, NetMask, and Gateway. You may also use this function to set a device to DHCP, IF it is still on your local subnet. If the device is no longer on your subnet, you may use the recover_module() function to re-enable DHCP mode. When you use the command SetIPAddress, you must supply IP, NetMask, and Gateway ceth_ip_address structs. Error checking will determine if you supply invalid IP and NetMask. ie a broadcast/home IP or nonstandard netmask.

You have the option of OR'ing an IP command with the SetName command. For example you may SetDHCP while also renaming a device like so: set_information(ceth_device*, SeaIO_Ethernet, SetDHCP & SetName, "Name"); If you SetIPAddress AND SetName, you MUST provide the name as the LAST parameter.

Parameters
[in]*devicePointer to the device you would like to modify.
[in]commandThe type of information you desire to set.
...The data you wish to set. Depends on command.
Returns
int Error code.
Return values
>=0Number of devices found.
-EINVALIncorrect parameters.
-EPERMCommunication error.

References CEthernet_set_information(), ceth_ip_addr::i, SetDHCP, SetIPAddress, and SetName.

 
 
Generated on Tue Sep 19 2017.