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] | *device | Pointer to the device you would like to modify. |
[in] | command | The type of information you desire to set. |
| ... | The data you wish to set. Depends on command. |
- Returns
- int Error code.
- Return values
-
>=0 | Number of devices found. |
-EINVAL | Incorrect parameters. |
-EPERM | Communication error. |
References CEthernet_set_information(), ceth_ip_addr::i, SetDHCP, SetIPAddress, and SetName.