mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 05:09:14 +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:
24
nmap.h
24
nmap.h
@@ -150,20 +150,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
|
||||
#endif
|
||||
#ifndef __USE_BSD
|
||||
#define __USE_BSD
|
||||
#endif
|
||||
#ifndef _BSD_SOURCE
|
||||
#define _BSD_SOURCE
|
||||
#endif
|
||||
|
||||
/* BSDI needs this to insure the correct struct ip */
|
||||
#undef _IP_VHL
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if HAVE_RPC_TYPES_H
|
||||
@@ -204,16 +190,6 @@ void *realloc();
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#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
|
||||
// #include <netinet/ip_icmp.h>
|
||||
|
||||
#if HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user