简体   繁体   English

哪个Linux标头文件包含“ struct iface”的定义?

[英]Which Linux Header file includes the definition of “struct iface”?

In /usr/include/net/if.h on linux struct iface is mentioned as a Back pointer to Interface in ifaddr structure, but i can't get the header file defining this structure. 在Linux上的/usr/include/net/if.h结构中,iface被作为ifaddr结构中接口的后退指针提到,但是我无法获得定义此结构的头文件。

Please help me if anyone knows !!! 如果有人知道,请帮助我!

好吧,看起来它只是保留在结构中的旧代码以保持其结构。

struct ifaddr is of incomplete type, which means that the code would compile, but if you de-reference the pointer to struct iface , or make any other assignments, it would give an error. struct ifaddr类型不完整,这意味着代码可以编译,但是如果您取消引用struct iface的指针或进行任何其他赋值,则会出错。 As said earlier, struct iface is kept in the main structure for legacy reasons only. 如前所述, struct iface仅出于遗留原因而保留在主结构中。

struct ifaddr
  {
    struct sockaddr ifa_addr;   /* Address of interface.  */
    union
      {
        struct sockaddr ifu_broadaddr;
        struct sockaddr ifu_dstaddr;
      } ifa_ifu;
    struct iface *ifa_ifp;      /* Back-pointer to interface.  */
        struct manav p[8];
    struct ifaddr *ifa_next;    /* Next address for interface.  */
  };

See also: dereferencing pointer to incomplete type 另请参见: 取消引用不完整类型的指针

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM