Browse Source

link.cpp: added comment regarding ifinfomsg.ifi_type

Fabian Peter Hammerle 7 years ago
parent
commit
67d34fc4e1
1 changed files with 7 additions and 0 deletions
  1. 7 0
      link.cpp

+ 7 - 0
link.cpp

@@ -4,6 +4,8 @@
 #include <linux/if_link.h> // IFLA_*
 #include <linux/if_link.h> // IFLA_*
 #include <string>          // std::string
 #include <string>          // std::string
 
 
+// https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/ip/iplink.c
+
 Link::Link(const ifinfomsg *msg) {
 Link::Link(const ifinfomsg *msg) {
   /*
   /*
   struct ifinfomsg {
   struct ifinfomsg {
@@ -13,6 +15,11 @@ Link::Link(const ifinfomsg *msg) {
       unsigned int   ifi_flags;  // Device flags
       unsigned int   ifi_flags;  // Device flags
       unsigned int   ifi_change; // change mask
       unsigned int   ifi_change; // change mask
   };
   };
+
+  see /usr/include/net/if_arp.h for ifi_type:
+  > #define ARPHRD_ETHER    1
+  > #define ARPHRD_LOOPBACK 772
+  > #define ARPHRD_SIT      776
   */
   */
   index = msg->ifi_index;
   index = msg->ifi_index;
 }
 }