6

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?

4

1 回答 1

8

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      */
于 2013-09-03T18:01:00.827 回答