modified to support building of libnet

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@960 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2002-09-03 00:02:40 +00:00
parent e1481ffc45
commit 0b5170a447
8 changed files with 21 additions and 63 deletions
+2
View File
@@ -7,6 +7,8 @@
#include <sys/param.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <ByteOrder.h> /* htonl, htons, ntohl, ntohs */
in_addr_t inet_addr (const char *);
int inet_aton (const char *, struct in_addr *);
+1 -34
View File
@@ -87,10 +87,7 @@
#include <sys/param.h>
#include <sys/types.h>
#ifdef _AUX_SOURCE
# include <sys/types.h>
#endif
#include <endian.h>
/*
* 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 <machine/endian.h>
#else
#ifdef linux
# include <endian.h>
#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)
+1 -1
View File
@@ -37,7 +37,7 @@
#ifndef _NET_RADIX_H_
#define _NET_RADIX_H_
#include <memheap.h>
//#include <memheap.h>
/*
* Radix search tree node layout.
+4
View File
@@ -5,8 +5,12 @@
//#include <ByteOrder.h> /* for htonl */
#include <sys/types.h>
#include <net/if.h>
typedef uint16 in_port_t;
typedef uint32 in_addr_t;
/* Protocol definitions - add to as required... */
enum {
+2 -2
View File
@@ -92,10 +92,10 @@
#ifndef _RESOLV_H_
#define _RESOLV_H_
#include <kernel/OS.h>
/* #include <kernel/OS.h> */
#include <sys/param.h>
#include <sys/types.h>
#include "sys/socket.h"
#include <sys/socket.h>
#include <stdio.h>
/*
+6 -1
View File
@@ -4,10 +4,12 @@
#ifndef _SYS_SOCKET_H
#define _SYS_SOCKET_H
#include <OS.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
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 */
+1 -1
View File
@@ -5,7 +5,7 @@
#define _SYS_SOCKETVAR_H
#include <OS.h>
#include <mbuf.h>
#include <sys/mbuf.h>
#include <sys/uio.h>
#include <sys/socket.h>
+4 -24
View File
@@ -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 <sys/ioccom.h>
/* 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 */