#include <dlfcn.h>
#include <errno.h>
#include <netinet/in.h>
-#include <netinet/ip.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
return "AF_INET6";
} else if (af == AF_IPX) {
return "AF_IPX";
+#ifdef AF_NETLINK
} else if (af == AF_NETLINK) {
return "AF_NETLINK";
+#endif
+#ifdef AF_X25
} else if (af == AF_X25) {
return "AF_X25";
+#endif
+#ifdef AF_AX25
} else if (af == AF_AX25) {
return "AF_AX25";
+#endif
+#ifdef AF_ATMPVC
} else if (af == AF_ATMPVC) {
return "AF_ATMPVC";
+#endif
} else if (af == AF_APPLETALK) {
return "AF_APPLETALK";
+#ifdef AF_PACKET
} else if (af == AF_PACKET) {
return "AF_PACKET";
+#endif
} else {
return "AF_UNKNOWN";
}
return "SOCK_RAW";
} else if (sock & SOCK_RDM) {
return "SOCK_RDM";
+#ifdef SOCK_PACKET
} else if (sock & SOCK_PACKET) {
return "SOCK_PACKET";
+#endif
} else {
return "SOCK_UNKNOWN";
}
static const char *level_to_name(int level) {
if (level == SOL_SOCKET) {
return "SOL_SOCKET";
+#ifdef SOL_IP
} else if (level == SOL_IP) {
return "SOL_IP";
+#endif
+#ifdef SOL_IPV6
} else if (level == SOL_IPV6) {
return "SOL_IPV6";
+#endif
} else if (level == IPPROTO_TCP) {
return "IPPROTO_TCP";
} else if (level == IPPROTO_UDP) {