|
From: | Philip Prindeville |
Subject: | Re: Detecting IP_TOS (and IPPROTO_IP vs. SOL_IP) |
Date: | Sun, 04 Jul 2010 19:51:29 -0600 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 |
On 3/26/10 1:51 PM, Ralf Wildenhues wrote:
Hello Philip, * Philip A. Prindeville wrote on Mon, Mar 22, 2010 at 08:42:51AM CET:Calling the sequence: setsockopt(fd, XXXX, IP_TOS,&foo, sizeof(foo)); can be tricky. Linux uses SOL_IP for XXXX, whereas Solaris and BSD use IPPROTO_IP for this instead. Not sure what MacOS or HP-UX do. Do the newer versions of autoconf have canned code for detecting what to use?No. My version of Linux defines both SOL_IP and IPPROTO_IP to the same value. Since changing it would seem to break the API, I *think* if looking at Linux alone you should be able to just go with IPPROTO_IP. Untested, you get to keep the pieces if it breaks.And if not, can someone please add it? I just grepped the 2.65 tarball but didn't find anything in there.Generally, for such issues it might be a good idea to just use gnulib if you can; but I just looked and it doesn't address this particular issue yet. Cheers, Ralf
Ok, slightly different issue.I'm trying to test for the presence/usability of <netinet/ip.h>, but on certain platforms I need to include <netinet/insystm.h> first.
configure:21873: checking netinet/ip.h usability configure:21873: gcc -c -g -O2 conftest.c>&5 In file included from conftest.c:155: /usr/include/netinet/ip.h:67: error: field `ip_src' has incomplete type /usr/include/netinet/ip.h:67: error: field `ip_dst' has incomplete type /usr/include/netinet/ip.h:160: error: syntax error before "n_long" /usr/include/netinet/ip.h:162: error: field `ipt_addr' has incomplete type /usr/include/netinet/ip.h:163: error: syntax error before "n_long" /usr/include/netinet/ip.h:198: error: field `ippseudo_src' has incomplete type /usr/include/netinet/ip.h:199: error: field `ippseudo_dst' has incomplete type configure:21873: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define __EXTENSIONS__ 1 | #define _ALL_SOURCE 1 | #define _GNU_SOURCE 1 | #define _POSIX_PTHREAD_SEMANTICS 1 | #define _TANDEM_SOURCE 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define HAVE_PTHREAD_H 1 | #define HAVE_PTHREAD_H 1 | #define HAVE_PTHREAD_MUTEX_RECURSIVE 1 | #define HAVE_PTHREAD_KEY_DELETE 1 | #define HAVE_PTHREAD_RWLOCK_INIT 1 | #define HAVE_PTHREAD_ATTR_SETGUARDSIZE 1 | #define HAVE_PTHREAD_YIELD 1 | #define HAVE_PTHREAD_RWLOCKS 1 | #define READDIR_IS_THREAD_SAFE 1 | #define GETHOSTBYNAME_IS_THREAD_SAFE 1 | #define GETHOSTBYADDR_IS_THREAD_SAFE 1 | #define GETSERVBYNAME_IS_THREAD_SAFE 1 | #define HAVE_GETHOSTBYNAME_R 1 | #define HAVE_GETHOSTBYADDR_R 1 | #define HAVE_GETSERVBYNAME_R 1 | #define HAVE_SIGSUSPEND 1 | #define HAVE_SIGWAIT 1 | #define HAVE_POLL 1 | #define HAVE_KQUEUE 1 | #define HAVE_GETPWNAM_R 1 | #define HAVE_GETPWUID_R 1 | #define HAVE_GETGRNAM_R 1 | #define HAVE_GETGRGID_R 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_MMAN_H 1 | #define HAVE_SYS_IPC_H 1 | #define HAVE_SYS_MUTEX_H 1 | #define HAVE_SYS_SHM_H 1 | #define HAVE_SYS_FILE_H 1 | #define HAVE_MMAP 1 | #define HAVE_MUNMAP 1 | #define HAVE_SHM_OPEN 1 | #define HAVE_SHM_UNLINK 1 | #define HAVE_SHMGET 1 | #define HAVE_SHMAT 1 | #define HAVE_SHMDT 1 | #define HAVE_SHMCTL 1 | #define HAVE_MAP_ANON 1 | #define anonymous shared memory allocation method 1 | #define USE_SHMEM_MMAP_ANON 1 | #define namebased memory allocation method 1 | #define USE_SHMEM_SHMGET 1 | #define HAVE_ALLOCA 1 | #define HAVE_CALLOC 1 | #define HAVE_SETSID 1 | #define HAVE_ISINF 1 | #define HAVE_ISNAN 1 | #define HAVE_GETENV 1 | #define HAVE_PUTENV 1 | #define HAVE_SETENV 1 | #define HAVE_UNSETENV 1 | #define HAVE_WRITEV 1 | #define HAVE_GETIFADDRS 1 | #define HAVE_UTIME 1 | #define HAVE_UTIMES 1 | #define HAVE_SETRLIMIT 1 | #define HAVE_GETRLIMIT 1 | #define HAVE_SENDFILE 1 | #define HAVE_SIGACTION 1 | #define HAVE_DECL_SYS_SIGLIST 1 | #define HAVE_FORK 1 | #define HAVE_STRERROR_R 1 | #define STRERROR_R_RC_INT 1 | #define HAVE_MMAP 1 | #define HAVE_MEMMOVE 1 | #define HAVE_GETPASS 1 | #define HAVE_GMTIME_R 1 | #define HAVE_LOCALTIME_R 1 | #define HAVE_MKSTEMP 1 | #define STDC_HEADERS 1 | #define HAVE_CTYPE_H 1 | #define HAVE_DIRENT_H 1 | #define HAVE_DLFCN_H 1 | #define HAVE_ERRNO_H 1 | #define HAVE_FCNTL_H 1 | #define HAVE_GRP_H 1 | #define HAVE_IFADDRS_H 1 | #define HAVE_LIMITS_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_NETDB_H 1 | #define HAVE_OSRELDATE_H 1 | #define HAVE_POLL_H 1 | #define HAVE_PWD_H 1 | #define HAVE_SEMAPHORE_H 1 | #define HAVE_SIGNAL_H 1 | #define HAVE_STDARG_H 1 | #define HAVE_STDDEF_H 1 | #define HAVE_STDIO_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_TERMIOS_H 1 | #define HAVE_TIME_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_ARPA_INET_H 1 | #define HAVE_NETINET_IN_H 1 | /* end confdefs.h. */ | #include<stdio.h> | #ifdef HAVE_SYS_TYPES_H | # include<sys/types.h> | #endif | #ifdef HAVE_SYS_STAT_H | # include<sys/stat.h> | #endif | #ifdef STDC_HEADERS | # include<stdlib.h> | # include<stddef.h> | #else | # ifdef HAVE_STDLIB_H | # include<stdlib.h> | # endif | #endif | #ifdef HAVE_STRING_H | # if !defined STDC_HEADERS&& defined HAVE_MEMORY_H | # include<memory.h> | # endif | # include<string.h> | #endif | #ifdef HAVE_STRINGS_H | # include<strings.h> | #endif | #ifdef HAVE_INTTYPES_H | # include<inttypes.h> | #endif | #ifdef HAVE_STDINT_H | # include<stdint.h> | #endif | #ifdef HAVE_UNISTD_H | # include<unistd.h> | #endif | #include<netinet/ip.h>
[Prev in Thread] | Current Thread | [Next in Thread] |