Test protocol of "test-net_if.c" on OpenBSD 4.6 =============================================== Common compiling step $ gcc test-net_if.c Line numbering in printouts is consistent since all of my inclusion additions were inserted once and then deactivated using "//" as protector. ## ## Only removed from the suggested module. ## In file included from test-net_if.c:22: /usr/include/net/if.h:240: error: `AF_MAX' undeclared here (not in a function) /usr/include/net/if.h:578: error: field `ifru_addr' has incomplete type /usr/include/net/if.h:579: error: field `ifru_dstaddr' has incomplete type /usr/include/net/if.h:580: error: field `ifru_broadaddr' has incomplete type /usr/include/net/if.h:598: error: field `ifra_addr' has incomplete type /usr/include/net/if.h:599: error: field `ifra_dstaddr' has incomplete type /usr/include/net/if.h:601: error: field `ifra_mask' has incomplete type /usr/include/net/if.h:639: error: field `addr' has incomplete type /usr/include/net/if.h:640: error: field `dstaddr' has incomplete type In file included from /usr/include/net/if.h:657, from test-net_if.c:22: /usr/include/net/if_arp.h:79: error: field `arp_pa' has incomplete type /usr/include/net/if_arp.h:80: error: field `arp_ha' has incomplete type test-net_if.c: In function `main': test-net_if.c:30: error: `if_freenameindex' undeclared (first use in this function) test-net_if.c:30: error: (Each undeclared identifier is reported only once test-net_if.c:30: error: for each function it appears in.) ## ## Addition: ## ## #include ## In file included from test-net_if.c:22: /usr/include/net/if.h:240: error: `AF_MAX' undeclared here (not in a function) /usr/include/net/if.h:578: error: field `ifru_addr' has incomplete type /usr/include/net/if.h:579: error: field `ifru_dstaddr' has incomplete type /usr/include/net/if.h:580: error: field `ifru_broadaddr' has incomplete type /usr/include/net/if.h:598: error: field `ifra_addr' has incomplete type /usr/include/net/if.h:599: error: field `ifra_dstaddr' has incomplete type /usr/include/net/if.h:601: error: field `ifra_mask' has incomplete type /usr/include/net/if.h:639: error: field `addr' has incomplete type /usr/include/net/if.h:640: error: field `dstaddr' has incomplete type In file included from /usr/include/net/if.h:657, from test-net_if.c:22: /usr/include/net/if_arp.h:79: error: field `arp_pa' has incomplete type /usr/include/net/if_arp.h:80: error: field `arp_ha' has incomplete type test-net_if.c: In function `main': test-net_if.c:30: error: `if_freenameindex' undeclared (first use in this function) test-net_if.c:30: error: (Each undeclared identifier is reported only once test-net_if.c:30: error: for each function it appears in.) ## ## Addition: ## ## #include ## In file included from test-net_if.c:21: /usr/include/sys/socket.h:152: error: syntax error before "u_int8_t" /usr/include/sys/socket.h:170: error: syntax error before "u_int8_t" /usr/include/sys/socket.h:173: error: syntax error before "u_int64_t" /usr/include/sys/socket.h:239: error: syntax error before "uid_t" /usr/include/sys/socket.h:244: error: syntax error before "gid_t" /usr/include/sys/socket.h:372: error: syntax error before "socklen_t" /usr/include/sys/socket.h:376: error: syntax error before "socklen_t" /usr/include/sys/socket.h:398: error: syntax error before "socklen_t" /usr/include/sys/socket.h:454: error: syntax error before "caddr_t" /usr/include/sys/socket.h:458: error: syntax error before "caddr_t" In file included from test-net_if.c:21: /usr/include/sys/socket.h:469: error: syntax error before "socklen_t" /usr/include/sys/socket.h:470: error: syntax error before "socklen_t" /usr/include/sys/socket.h:471: error: syntax error before "socklen_t" /usr/include/sys/socket.h:472: error: syntax error before "uid_t" /usr/include/sys/socket.h:473: error: syntax error before "socklen_t" /usr/include/sys/socket.h:474: error: syntax error before "socklen_t" /usr/include/sys/socket.h:475: error: syntax error before "socklen_t" /usr/include/sys/socket.h:477: error: syntax error before "recv" /usr/include/sys/socket.h:477: error: syntax error before "size_t" /usr/include/sys/socket.h:478: error: syntax error before "recvfrom" /usr/include/sys/socket.h:478: error: syntax error before "size_t" /usr/include/sys/socket.h:479: error: syntax error before "recvmsg" /usr/include/sys/socket.h:480: error: syntax error before "send" /usr/include/sys/socket.h:480: error: syntax error before "size_t" /usr/include/sys/socket.h:481: error: syntax error before "sendto" /usr/include/sys/socket.h:482: error: syntax error before "size_t" /usr/include/sys/socket.h:483: error: syntax error before "sendmsg" /usr/include/sys/socket.h:484: error: syntax error before "socklen_t" test-net_if.c: In function `main': test-net_if.c:30: error: `if_freenameindex' undeclared (first use in this function) test-net_if.c:30: error: (Each undeclared identifier is reported only once test-net_if.c:30: error: for each function it appears in.) ## ## Additions: ## ## #include ## #include ## test-net_if.c: In function `main': test-net_if.c:30: error: `if_freenameindex' undeclared (first use in this function) test-net_if.c:30: error: (Each undeclared identifier is reported only once test-net_if.c:30: error: for each function it appears in.) ## ## Additions: ## ## #include ## #include ## ## #undefine if_freenameindex ## test-net_if.c: In function `main': test-net_if.c:32: error: `if_freenameindex' undeclared (first use in this function) test-net_if.c:32: error: (Each undeclared identifier is reported only once test-net_if.c:32: error: for each function it appears in.) test-net_if.c:84: error: `if_freenameindex' used prior to declaration ## ## Addendum: ## ## The relevant part from /usr/include/net/if.h is this #ifndef _KERNEL __BEGIN_DECLS unsigned int if_nametoindex(const char *); char *if_indextoname(unsigned int, char *); struct if_nameindex *if_nameindex(void); __END_DECLS #define if_freenameindex(x) free(x) #endif