namespace canary
{
unsigned int get_interface_index(std::string const& name, canary::error_code& ec);
unsigned int get_interface_index(std::string const& name);
}
unsigned int get_interface_index(std::string const& name, canary::error_code& ec);
Retrieves the interface index required to bind a CAN socket to a particular CAN interface.
name
- The network interface name.
canary::error_code& ec
Set to indicate what error occurred when the function fails.
Returns: The interface index.
unsigned int get_interface_index(std::string const& name);
Retrieves the interface index required to bind a CAN socket to a particular CAN interface. Will throw an instance std::system_error if the function fails. \param name The network interface name. \returns The interface index.