From 0b5170a447e6bbb212b1eecb53e36584bf59b7cb Mon Sep 17 00:00:00 2001 From: beveloper Date: Tue, 3 Sep 2002 00:02:40 +0000 Subject: [PATCH] modified to support building of libnet git-svn-id: file:///srv/svn/repos/haiku/trunk/current@960 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/arpa/inet.h | 2 ++ headers/posix/arpa/nameser.h | 35 +---------------------------------- headers/posix/net/radix.h | 2 +- headers/posix/netinet/in.h | 4 ++++ headers/posix/resolv.h | 4 ++-- headers/posix/sys/socket.h | 7 ++++++- headers/posix/sys/socketvar.h | 2 +- headers/posix/sys/sockio.h | 28 ++++------------------------ 8 files changed, 21 insertions(+), 63 deletions(-) diff --git a/headers/posix/arpa/inet.h b/headers/posix/arpa/inet.h index 9e10b1dde9..ab1a9eef93 100644 --- a/headers/posix/arpa/inet.h +++ b/headers/posix/arpa/inet.h @@ -7,6 +7,8 @@ #include #include +#include +#include /* htonl, htons, ntohl, ntohs */ in_addr_t inet_addr (const char *); int inet_aton (const char *, struct in_addr *); diff --git a/headers/posix/arpa/nameser.h b/headers/posix/arpa/nameser.h index 4e747a764b..fbec406982 100644 --- a/headers/posix/arpa/nameser.h +++ b/headers/posix/arpa/nameser.h @@ -87,10 +87,7 @@ #include #include - -#ifdef _AUX_SOURCE -# include -#endif +#include /* * revision information. this is the release date in YYYYMMDD format. @@ -257,36 +254,6 @@ #define CONV_BADCKSUM (-3) #define CONV_BADBUFLEN (-4) -#ifndef BYTE_ORDER -#if (BSD >= 199103) -# include -#else -#ifdef linux -# include -#else -#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */ -#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ -#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/ - -#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \ - defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \ - defined(__alpha__) || defined(__alpha) -#define BYTE_ORDER LITTLE_ENDIAN -#endif - -#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \ - defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \ - defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\ - defined(apollo) || defined(__convex__) || defined(_CRAY) || \ - defined(__hppa) || defined(__hp9000) || \ - defined(__hp9000s300) || defined(__hp9000s700) || \ - defined (BIT_ZERO_ON_LEFT) || defined(m68k) -#define BYTE_ORDER BIG_ENDIAN -#endif -#endif /* linux */ -#endif /* BSD */ -#endif /* BYTE_ORDER */ - #if !defined(BYTE_ORDER) || \ (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \ BYTE_ORDER != PDP_ENDIAN) diff --git a/headers/posix/net/radix.h b/headers/posix/net/radix.h index 93080679a0..0b6b9eb19a 100644 --- a/headers/posix/net/radix.h +++ b/headers/posix/net/radix.h @@ -37,7 +37,7 @@ #ifndef _NET_RADIX_H_ #define _NET_RADIX_H_ -#include +//#include /* * Radix search tree node layout. diff --git a/headers/posix/netinet/in.h b/headers/posix/netinet/in.h index 02878a247a..51b8bc558e 100644 --- a/headers/posix/netinet/in.h +++ b/headers/posix/netinet/in.h @@ -5,8 +5,12 @@ //#include /* for htonl */ +#include #include +typedef uint16 in_port_t; +typedef uint32 in_addr_t; + /* Protocol definitions - add to as required... */ enum { diff --git a/headers/posix/resolv.h b/headers/posix/resolv.h index 19f92221c5..bb09a29b08 100644 --- a/headers/posix/resolv.h +++ b/headers/posix/resolv.h @@ -92,10 +92,10 @@ #ifndef _RESOLV_H_ #define _RESOLV_H_ -#include +/* #include */ #include #include -#include "sys/socket.h" +#include #include /* diff --git a/headers/posix/sys/socket.h b/headers/posix/sys/socket.h index a900f8aa05..a9ca808b68 100644 --- a/headers/posix/sys/socket.h +++ b/headers/posix/sys/socket.h @@ -4,10 +4,12 @@ #ifndef _SYS_SOCKET_H #define _SYS_SOCKET_H -#include +#include #include #include +typedef uint32 socklen_t; + /* These are the address/protocol families we'll be using... */ /* NB these should be added to as required... */ @@ -189,6 +191,7 @@ struct cmsghdr { /* there now follows uchar[] cmsg_data */ }; +#if 0 #define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */ #define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */ #define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */ @@ -225,6 +228,8 @@ struct cmsghdr { #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */ +#endif + #ifndef _KERNEL_MODE /* Function declarations */ diff --git a/headers/posix/sys/socketvar.h b/headers/posix/sys/socketvar.h index 7dbc086b2d..b324ad1491 100644 --- a/headers/posix/sys/socketvar.h +++ b/headers/posix/sys/socketvar.h @@ -5,7 +5,7 @@ #define _SYS_SOCKETVAR_H #include -#include +#include #include #include diff --git a/headers/posix/sys/sockio.h b/headers/posix/sys/sockio.h index a9b6f55327..e0516d493a 100644 --- a/headers/posix/sys/sockio.h +++ b/headers/posix/sys/sockio.h @@ -1,29 +1,9 @@ -/* net_ioctl.h */ +#ifndef _SYS_SOCKIO_H +#define _SYS_SOCKIO_H -#ifndef SYS_NET_IOCTL_H -#define SYS_NET_IOCTL_H - -#define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */ - -#define IOC_OUT (unsigned long)0x40000000 - /* copy parameters in */ -#define IOC_IN (unsigned long)0x80000000 - /* copy paramters in and out */ -#define IOC_INOUT (IOC_IN|IOC_OUT) - /* mask for IN/OUT/VOID */ - -#define _IOC(inout,group,num,len) \ - (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)) - -#define IOCGROUP(x) (((x) >> 8) & 0xff) - -#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) -#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) -#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) - -#define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ -#define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ +#include +/* Socket ioctl's. */ #define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */ #define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */ #define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */