cnet v4.0.4  

home topology files command‑line options the core API FAQ download and install

cnet's Application Programming Interface

NAME
CNET_set_nicaddr - set the NIC address of a LAN or WLAN link

SYNOPSIS
#include <cnet.h> int CNET_set_nicaddr(int link, CnetNICaddr new_nicaddr);

DESCRIPTION
CNET_set_nicaddr sets the hardware address recognized by the Network Interface Card (NIC) of the indicated physical link.

The new address may not be the zero address, 00:00:00:00:00:00, or the broadcast address, ff:ff:ff:ff:ff:ff. No check is made to ensure that the new address is unique within the network (thereby enabling some snooping/sniffing "protocols" to be developed).

NIC addresses may only be set for links of type LT_LAN or LT_WLAN.

RETURN VALUE
The value 0 is returned on success. On failure, the value -1 is returned, and the global variable cnet_errno is set to one of the following values to describe the error:

ER_BADARG
The value of new_nicaddr is either the zero or the broadcast address.
ER_BADLINK
The value of link is less than zero or greater than the number of physical links.
ER_NOTSUPPORTED
The current link is not of link type LT_LAN or LT_WLAN.
SEE ALSO
CNET_parse_nicaddr and CNET_format_nicaddr

cnet v4.0.4 - [email protected]