VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlSocketStuff.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: vlSocketStuff.h,v $ $Revision: 1.3.6.1 $ $State: Exp $
7 *********************************************************************/
8 #ifndef vlSocketStuff_H_
9 #define vlSocketStuff_H_
10 
11 
16 
17 // For the errno redifinitions in Windows
18 #include <vlutil/vlInet.h>
19 
20 #if VMS
21 extern "C++"
22 {
23 #endif
24 
25 extern "C"
26 {
27 #ifdef _WIN32
28 #define close closesocket
29 #else
30 #include <netinet/in.h>
31 #include <netinet/tcp.h>
32 #include <sys/socket.h>
33 #include <errno.h>
34 #define ERRNO errno
35 #if !VXWORKS
36 #include <netdb.h>
37 #endif
38 #endif
39 
40 #include <stdlib.h>
41 #include <string.h>
42 #include <stddef.h>
43 #include <stdio.h>
44 #include <signal.h>
45 #include <fcntl.h>
46 #include <sys/types.h>
47 
48 #if VXWORKS
49 #include <ioLib.h>
50 #endif
51 
52 #ifndef _WIN32
53 #include <netinet/in.h>
54 #include <netinet/tcp.h>
55 #include <sys/socket.h>
56 #include <errno.h>
57 #define ERRNO errno
58 #if !VXWORKS
59 #include <netdb.h>
60 #endif
61 #endif
62 
63 #if DT_HAVE_NET_IF_H
64 #include <net/if.h>
65 #endif
66 
67 #if DT_HAVE_UNISTD_H
68 #include <unistd.h>
69 #endif
70 
71 #if DT_HAVE_STD_H
72 #include <std.h>
73 #endif
74 
75 #if DT_HAVE_PARAM_H
76 #include <sys/param.h>
77 #endif
78 
79 #if DT_FNDELAY_NOT_IN_FCNTL_H
80 #include <sys/file.h>
81 #endif
82 
83 #if DT_HAVE_SOCKIO_H
84 #include <sys/sockio.h>
85 #endif
86 
87 #if DT_HAVE_IOCTL_H
88 #include <sys/ioctl.h>
89 #endif
90 
91 #if !DT_HAVE_SOCKET_PROTOS
92 int socket (int, int, int);
93 int setsockopt (int, int, int, const char *, int);
94 int bind (int, struct sockaddr *, int);
95 int sendto (int, char *, int, int, sockaddr *, int);
96 int recvfrom(int, char *, int, int, sockaddr *, int *);
97 int getsockname (int s, struct sockaddr* name, int* namelen);
98 int accept(int s, struct sockaddr* addr, int* addrlen);
99 int listen (int s, int backlog);
100 int connect (int s, const struct sockaddr *name, int namelen);
101 int send(int s, char* buf, int bufLen, int flags);
102 int recv(int s, char* buf, int bufLen, int flags);
103 #endif
104 
106 #if sgi
107 #include <net/soioctl.h>
108 #include <CC/osfcn.h>
109 #elif DT_HPUX || VMS
110 #undef FNDELAY
111 #define FNDELAY O_NONBLOCK
112 #elif concurrent
113 #include <net/in.h>
114 #elif __OSF1__
115  struct ifaddr; struct rtentry; struct mbuf;
116 #elif ( __GNUC__ && ! __GNU_LIBRARY__ && !__darwin__ && !__solaris__ )
117  int ioctl(int fd, int request, caddr_t arg);
118 #elif VXWORKS
119 #include <sockLib.h>
120 #include <net/if.h>
121 #endif
122 }
123 
124 #if _PowerUX
125 #define sockaddrptr sockaddr*
126 #define constCharPtr caddr_t
127 #elif VXWORKS
128 #define sockaddrptr sockaddr*
129 #define constCharPtr char*
130 #else
131 #define sockaddrptr sockaddr*
132 #define constCharPtr const char*
133 #endif
134 
135 #if VXWORKS
136 #define IOCTL_DATA int
137 #else
138 #define IOCTL_DATA char*
139 #endif
140 
141 #if VMS
142 }
143 #endif
144 
145 #endif
146 

Document ID: Generated on Tue Mar 1 02:56:17 EST 2016 from SVN revision 162687
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)