1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-21 06:59:01 +00:00

Use a special struct_ip.h to include <netinet/ip.h> and accoutrements.

The comment in struct_ip.h explains the reasoning for this. The AIX C library
uses #defines that change the names of members of struct ip, and conflict with
some existing code. (Notably struct ip_hdr in libdnet and IPv4Header::h in
libnetutil.) We can still use the AIX files if we include <netinet/ip.h> after
this other code has been preprocessed. That's hard to enforce when
<netinet/ip.h> is included from another header file; this new file allows
including it always late, and only where needed.
This commit is contained in:
david
2011-09-21 07:31:38 +00:00
parent c87da9aa8b
commit fee764a5d8
9 changed files with 85 additions and 48 deletions

24
tcpip.h
View File

@@ -133,19 +133,6 @@ void *realloc();
#include <sys/param.h> /* Defines MAXHOSTNAMELEN on BSD*/
#endif
/* Linux uses these defines in netinet/ip.h to use the correct struct ip */
#ifndef __FAVOR_BSD
#define __FAVOR_BSD 1
#endif
#ifndef _BSD_SOURCE
#define _BSD_SOURCE 1
#endif
#ifndef __USE_BSD
#define __USE_BSD 1
#endif
/* BSDI needs this to insure the correct struct ip */
#undef _IP_VHL
#include <stdio.h>
#if HAVE_NETINET_IN_H
@@ -165,14 +152,6 @@ void *realloc();
#endif
#include <arpa/inet.h>
#ifndef NETINET_IN_SYSTM_H /* This guarding is needed for at least some versions of OpenBSD */
#include <netinet/in_systm.h> /* defines n_long needed for netinet/ip.h */
#define NETINET_IN_SYSTM_H
#endif
#ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */
#include <netinet/ip.h>
#define NETINET_IP_H
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -208,9 +187,6 @@ extern "C" {
#include <errno.h>
#include <signal.h>
#include <dnet.h>
#ifndef WIN32
#include <netinet/ip_icmp.h>
#endif