当我在Linux中运行netstat -i时,我得到如下输出:
Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg eth0 1500 0 0 0 0 0 236 0 0 0 BMPRU eth1 1500 0 789 0 0 0 269 0 0 0 BMRU lo 16436 0 3715 0 0 0 3715 0 0 0 LRU
我想知道那些Flg是什么意思? 有人能给我一个穷尽的名单吗?
netstat是开源的,你可以在源代码中查找这些值。 该程序是从net-tools包build立的。 从lib/interface.c ife_print_short (通过ifconfig.c ):
if (ptr->flags == 0) printf(_("[NO FLAGS]")); if (ptr->flags & IFF_ALLMULTI) printf("A"); if (ptr->flags & IFF_BROADCAST) printf("B"); if (ptr->flags & IFF_DEBUG) printf("D"); if (ptr->flags & IFF_LOOPBACK) printf("L"); if (ptr->flags & IFF_MULTICAST) printf("M"); #ifdef HAVE_DYNAMIC if (ptr->flags & IFF_DYNAMIC) printf("d"); #endif if (ptr->flags & IFF_PROMISC) printf("P"); if (ptr->flags & IFF_NOTRAILERS) printf("N"); if (ptr->flags & IFF_NOARP) printf("O"); if (ptr->flags & IFF_POINTOPOINT) printf("P"); if (ptr->flags & IFF_SLAVE) printf("s"); if (ptr->flags & IFF_MASTER) printf("m"); if (ptr->flags & IFF_RUNNING) printf("R"); if (ptr->flags & IFF_UP) printf("U");