Pars numeric flags ifconfig

The ifconfig command displays flags in both text and digital format. Although I can find a link here or there for numerical flags, I can not find any directions on how to interpret (mask) the number.

qfe2: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu
  1500 index 4
  usesrc vni0
  inet 1.2.3.4 netmask ffffff00 broadcast 1.2.3.255
  ether 0:3:ba:17:4b:e1
vni0: flags=20011100c1<UP,RUNNING,NOARP,NOXMIT,ROUTER,IPv4,VIRTUAL>
  mtu 0 index 5
  srcof qfe2
  inet 3.4.5.6 netmask ffffffff

In the above output, note the following:

flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4>

The numeric value " 1100843" maps to the flags " UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4".

Is there a link somewhere that I just don’t see that describes how to mask each flag ( UP,BROADCAST,etc.) from the encoded value " flags=NNNNNNNN"?

EDIT : Refine which flag interests me.

+2
1

/usr/include/net/if.h ( Solaris). , .

+3

Source: https://habr.com/ru/post/1741502/


All Articles