I know that udev manages devices in /dev and I expected to find information about available network cards (hardware) or at least network interfaces (software) there.ifconfig output shows me eth0 and lo, but /dev/net is empty. Well, almost empty:$ ls -la /dev/nettotal 0drwxr-xr-x  2 root root      60 Dec 13 09:37 .drwxr-xr-x 15 root root    4300 Dec 15 12:12 ..crw-rw-rw-  1 root root 10, 200 Dec 13 09:38 tunWhy there is no info about network interfaces in udev?I'd really like to avoid executing ifconfig in my server process.It is irrelevant to the question, but I expected to find ids (lo, eth0) and IP addresses there.
/dev/disk/ lists disks, why /dev/net/ doesn't list network interfaces?
linux;networking;udev
udev doesn't create any /dev files for network cards because network cards don't have device files. Network interfaces are one of the exceptions to everything is a file.You can, however, look in /sys/class/net. That's maintained by the kernel directly, and should show you all the network interfaces on the system. You can also get the list out of /proc (e.g., /proc/net/dev). These are Linux-specific.If you're working in C, you can use if_nameindex and friends.