Reputation: 1578
For each network interface linux contains a directory in /sys/class/net There is a file with name "type". Its value is: 1 - for wlan0/eth0. 772 - for lo. 512 - for rmnet0/rmnet1/...
So what is the meaning of these values? Where can I find any descriptions?
Upvotes: 10
Views: 10648
Reputation: 318
This header will show you the way to the world of work with interfaces:
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/if_arp.h#L30
There are many, but the most common:
#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
#define ARPHRD_LOOPBACK 772 /* Loopback device */
Upvotes: 10