Converts the name of a network interface to its index.
If an interface with the name name cannot be found or another error occurres, returns 0.
Interface name.
Returns interface index or 0.
version (linux) { assert(nameToIndex("lo") == 1); } else version (Windows) { assert(nameToIndex("loopback_0") == 1); } else { assert(nameToIndex("lo0") == 1); } assert(nameToIndex("ecafretni") == 0);
See Implementation
Converts the name of a network interface to its index.
If an interface with the name name cannot be found or another error occurres, returns 0.