Initial Version

This commit is contained in:
Janet B. Anderson
1997-03-13 16:42:52 +00:00
parent 85432e6307
commit 117f75eac4
2 changed files with 164 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
/*
* cygwin32 specific include
*/
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <netdb.h>
#include <unistd.h> /* close() and others */
void ipAddrToA(const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
/*
* as far as I can tell there is no header file for these
*/
int gethostname(char *name, int namelen);
int sethostname(char *name, int namelen);
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
/*
* Windows Sockets errors redefined as regular Berkeley error constants
*/
#define ETIMEDOUT WSAETIMEDOUT
/*
* All Windows Sockets error constants are biased by WSABASEERR from
* the "normal"
*/
#define WSABASEERR 10000
#define WSAETIMEDOUT (WSABASEERR+60)
#define IOCPARM_MASK 0xff /* parameters must be < 256 bytes */
#define IOC_OUT 0x40000000 /* copy out parameters */
#define IOC_IN 0x80000000 /* copy in parameters */
#define IOC_INOUT (IOC_IN|IOC_OUT)
#define _IOWR(x, y, t) \
(IOC_INOUT|((((int)sizeof (t))&IOCPARM_MASK)<<16)|(x<<8)|y)
/* Used by ca/if_depends.c */
#define SIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */
#define SIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */
/* Used by ca/if_depends.c db/drvTS.c dbtools/BSlib.c */
#define SIOCGIFBRDADDR _IOWR('i', 23, struct ifreq) /* get broadcast addr */
/* Used by ca/if_depends.c ca/ucx.h */
#define IFF_POINTOPOINT 0x10
#endif /*osiSockH*/

View File

@@ -0,0 +1,82 @@
/*
* cygwin32 specific include
*/
#ifndef osiSockH
#define osiSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <netdb.h>
#include <unistd.h> /* close() and others */
void ipAddrToA(const struct sockaddr_in *pInetAddr,
char *pBuf, const unsigned bufSize);
/*
* as far as I can tell there is no header file for these
*/
int gethostname(char *name, int namelen);
int sethostname(char *name, int namelen);
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
/*
* Windows Sockets errors redefined as regular Berkeley error constants
*/
#define ETIMEDOUT WSAETIMEDOUT
/*
* All Windows Sockets error constants are biased by WSABASEERR from
* the "normal"
*/
#define WSABASEERR 10000
#define WSAETIMEDOUT (WSABASEERR+60)
#define IOCPARM_MASK 0xff /* parameters must be < 256 bytes */
#define IOC_OUT 0x40000000 /* copy out parameters */
#define IOC_IN 0x80000000 /* copy in parameters */
#define IOC_INOUT (IOC_IN|IOC_OUT)
#define _IOWR(x, y, t) \
(IOC_INOUT|((((int)sizeof (t))&IOCPARM_MASK)<<16)|(x<<8)|y)
/* Used by ca/if_depends.c */
#define SIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */
#define SIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */
/* Used by ca/if_depends.c db/drvTS.c dbtools/BSlib.c */
#define SIOCGIFBRDADDR _IOWR('i', 23, struct ifreq) /* get broadcast addr */
/* Used by ca/if_depends.c ca/ucx.h */
#define IFF_POINTOPOINT 0x10
#endif /*osiSockH*/