I know that I can do this in windows using AddIPAddress but I am wondering if there is a cross platform (would love it if I could use boost since I already am in this project) way to add an IP Address to a specific NIC?
Example:
UINT iaIPAddress;
UINT iaIPMask;
iaIPAddress = inet_addr("192.168.0.5");
iaIPMask = inet_addr("255.255.255.0");
dwRetVal = AddIPAddress(iaIPAddress, iaIPMask, pIPAddrTable->table[0].dwIndex,
&NTEContext, &NTEInstance);
if (dwRetVal != NO_ERROR) {
printf("AddIPAddress call failed with %d\n", dwRetVal);
}
This works on windows, but how could I do the same on linux?
There is none.
Boost achieves platform independence by abstracting away OS interfaces, and letting the OS talk to the hardware
Hence Boost has no libraries for system management or peripheral control.
There are libraries surrounding operating system services that may be associated with certain devices (such as CPU resources (threads, scheduling, IPC and synchronization), filesystem and network services) but they stay at that layer of abstraction.
There is no Boost library to facilitate writing filesystem drivers, manipulate GPT partition tables, explicitly manage create sparse files or TRIM sectors on SSD drives.
Likewise, there is no Boost library to capture raw TCP packets or put your display in a graphics mode.