We haven't supported VMS for YONKS...
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#ifndef epicsMathh
|
||||
#define epicsMathh
|
||||
|
||||
#include <math.h>
|
||||
#include <shareLib.h>
|
||||
|
||||
#define isinf(D) (!finite((D)) && !(isnan((D))))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
epicsShareExtern float epicsNAN;
|
||||
epicsShareExtern float epicsINF;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* epicsMathh */
|
||||
@@ -1,130 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Operating System Dependent Implementation of osiProcess.h
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <ssdef.h>
|
||||
#include <stsdef.h>
|
||||
#include <iodef.h>
|
||||
#include <psldef.h>
|
||||
#include <prcdef.h>
|
||||
#include <jpidef.h>
|
||||
#include <descrip.h>
|
||||
#include <starlet.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "osiProcess.h"
|
||||
|
||||
epicsShareFunc osiGetUserNameReturn epicsShareAPI osiGetUserName (char *pBuf, unsigned bufSizeIn)
|
||||
{
|
||||
struct {
|
||||
short buffer_length;
|
||||
short item_code;
|
||||
void *pBuf;
|
||||
void *pRetSize;
|
||||
} item_list[3];
|
||||
unsigned length;
|
||||
char pName[12]; /* the size of VMS user names */
|
||||
short nameLength;
|
||||
char *psrc;
|
||||
char *pdest;
|
||||
int status;
|
||||
char jobType;
|
||||
short jobTypeSize;
|
||||
char *pTmp;
|
||||
|
||||
item_list[0].buffer_length = sizeof (pName);
|
||||
item_list[0].item_code = JPI$_USERNAME; /* fetch the user name */
|
||||
item_list[0].pBuf = pName;
|
||||
item_list[0].pRetSize = &nameLength;
|
||||
|
||||
item_list[1].buffer_length = sizeof (jobType);
|
||||
item_list[1].item_code = JPI$_JOBTYPE; /* fetch the job type */
|
||||
item_list[1].pBuf = &jobType;
|
||||
item_list[1].pRetSize = &jobTypeSize;
|
||||
|
||||
item_list[2].buffer_length = 0;
|
||||
item_list[2].item_code = 0; /* none */
|
||||
item_list[2].pBuf = 0;
|
||||
item_list[2].pRetSize = 0;
|
||||
|
||||
status = sys$getjpiw (
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&item_list,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
if ( status != SS$_NORMAL ) {
|
||||
return osiGetUserNameFail;
|
||||
}
|
||||
|
||||
if ( jobTypeSize != sizeof (jobType) ) {
|
||||
return osiGetUserNameFail;
|
||||
}
|
||||
|
||||
/*
|
||||
* parse the user name string
|
||||
*/
|
||||
psrc = pName;
|
||||
length = 0;
|
||||
while ( psrc<&pName[nameLength] && !isspace(*psrc) ) {
|
||||
length++;
|
||||
psrc++;
|
||||
}
|
||||
|
||||
if ( length + 1 >= bufSizeIn ) {
|
||||
return osiGetUserNameFail;
|
||||
}
|
||||
|
||||
strncpy ( pBuf, pName, length );
|
||||
pBuf[length] = '\0';
|
||||
|
||||
return osiGetUserNameSuccess;
|
||||
}
|
||||
|
||||
epicsShareFunc osiSpawnDetachedProcessReturn epicsShareAPI osiSpawnDetachedProcess
|
||||
(const char *pProcessName, const char *pBaseExecutableName)
|
||||
{
|
||||
static $DESCRIPTOR (io, "EPICS_LOG_DEVICE");
|
||||
auto $DESCRIPTOR (image, pBaseExecutableName);
|
||||
auto $DESCRIPTOR (name, pProcessName);
|
||||
int status;
|
||||
unsigned long pid;
|
||||
|
||||
status = sys$creprc (
|
||||
&pid,
|
||||
&image,
|
||||
NULL, /* input (none) */
|
||||
&io, /* output */
|
||||
&io, /* error */
|
||||
NULL, /* use parents privs */
|
||||
NULL, /* use default quotas */
|
||||
&name,
|
||||
4, /* base priority */
|
||||
NULL,
|
||||
NULL,
|
||||
PRC$M_DETACH);
|
||||
if (status != SS$_NORMAL){
|
||||
lib$signal (status);
|
||||
return osiSpawnDetachedProcessFail;
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* vms specific socket include
|
||||
*/
|
||||
|
||||
#ifndef osdSockH
|
||||
#define osdSockH
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#if defined(MULTINET) && defined(__cplusplus)
|
||||
struct iovec;
|
||||
#endif
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#if defined(UCX) /* GeG 09-DEC-1992 */
|
||||
# include <errno>
|
||||
# include <sys/ucx$inetdef.h>
|
||||
# include <ucx.h>
|
||||
# include <netdb.h>
|
||||
#elif defined(MULTINET)
|
||||
# if defined(__DECCXX)
|
||||
# define __DECC 1
|
||||
# define __DECC_VER 999999999
|
||||
# include <tcp/errno.h>
|
||||
# include <sys/time.h>
|
||||
# undef __DECC
|
||||
# undef __DECC_VER
|
||||
# else
|
||||
# include <tcp/errno.h>
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
# if defined(__cplusplus)
|
||||
struct ifaddr;
|
||||
struct mbuf;
|
||||
# endif
|
||||
# include <sys/ioctl.h>
|
||||
# include <net/if.h>
|
||||
# include <vms/inetiodef.h>
|
||||
# include <sys/ioctl.h>
|
||||
# include <tcp/netdb.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* MULTINET defines none of these (if not using C++)
|
||||
*/
|
||||
#if defined(MULTINET) && defined(MULTINET_NO_PROTOTYPES)
|
||||
int gettimeofday (struct timeval *tp, struct timezone *tzp);
|
||||
int gethostname (char *name, int namelen);
|
||||
int getpeername (int socket, struct sockaddr *name, int *namelen);
|
||||
int connect (int socket, struct sockaddr *name, int namelen);
|
||||
int setsockopt (int socket, int level, int optname,
|
||||
char *optval, int optlen);
|
||||
int sendto (int socket, const char *buf, int len,
|
||||
int flags, struct sockaddr *to, int tolen);
|
||||
int select (int width, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, struct timeval *timeout);
|
||||
|
||||
int bind (int socket, struct sockaddr *name, int namelen);
|
||||
int send (int socket, const char *buf, int len, int flags);
|
||||
int recv (int socket, char *buf, int len, int flags);
|
||||
int getsockopt (int socket, int level, int optname,
|
||||
char *optval, int *optlen);
|
||||
int recvfrom (int socket, char *buf, int len,
|
||||
int flags, struct sockaddr *from, int *fromlen);
|
||||
int getsockname (int socket, struct sockaddr *name, int *namelen);
|
||||
int listen (int socket, int backlog);
|
||||
int shutdown (int socket, int how);
|
||||
int socket (int domain, int type, int protocol);
|
||||
|
||||
#endif /* defined(MULTINET) && defined(MULTINET_NO_PROTOTYPES) */
|
||||
|
||||
#ifdef MULTINET
|
||||
# include <arpa/inet.h>
|
||||
#else
|
||||
char * inet_ntoa (struct in_addr in);
|
||||
unsigned long inet_addr (const char *);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
struct hostent {
|
||||
char *h_name; /* official name of host */
|
||||
char **h_aliases; /* alias list */
|
||||
int h_addrtype; /* host address type */
|
||||
int h_length; /* length of address */
|
||||
char **h_addr_list; /* list of addresses from name server */
|
||||
#define h_addr h_addr_list[0] /* address, for backward compatiblity */
|
||||
};
|
||||
struct hostent *gethostbyaddr(char *addr, int len, int type);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef int SOCKET;
|
||||
#define INVALID_SOCKET (-1)
|
||||
#define INADDR_LOOPBACK ((u_long)0x7f000001)
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
# define INADDR_NONE (0xffffffff)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (the VAXC runtime lib has its own close
|
||||
*/
|
||||
#if defined(WINTCP) /* Wallangong */
|
||||
# define socket_close(S) netclose(S)
|
||||
# define socket_ioctl(A,B,C) ioctl(A,B,C)
|
||||
#endif
|
||||
#if defined(UCX) /* GeG 09-DEC-1992 */
|
||||
# define socket_close(S) close(S)
|
||||
# define socket_ioctl(A,B,C) ioctl(A,B,C)
|
||||
#endif
|
||||
typedef int osiSockIoctl_t;
|
||||
typedef int osiSocklen_t;
|
||||
|
||||
#if defined(WINTCP) /* Wallangong */
|
||||
extern int uerrno;
|
||||
# define SOCKERRNO uerrno
|
||||
#elif defined(MULTINET)
|
||||
# define SOCKERRNO socket_errno
|
||||
#else
|
||||
# define SOCKERRNO errno /* UCX and others? */
|
||||
#endif
|
||||
|
||||
#define MAXHOSTNAMELEN 75
|
||||
|
||||
#define SOCK_EWOULDBLOCK EWOULDBLOCK
|
||||
#define SOCK_ENOBUFS ENOBUFS
|
||||
#define SOCK_ECONNRESET ECONNRESET
|
||||
#define SOCK_ETIMEDOUT ETIMEDOUT
|
||||
#define SOCK_EADDRINUSE EADDRINUSE
|
||||
#define SOCK_ECONNREFUSED ECONNREFUSED
|
||||
#define SOCK_ECONNABORTED ECONNABORTED
|
||||
#define SOCK_EINPROGRESS EINPROGRESS
|
||||
#define SOCK_EISCONN EISCONN
|
||||
#define SOCK_EALREADY EALREADY
|
||||
#define SOCK_EINVAL EINVAL
|
||||
#define SOCK_EINTR EINTR
|
||||
#define SOCK_EPIPE EPIPE
|
||||
#define SOCK_EMFILE EMFILE
|
||||
#define SOCK_SHUTDOWN ESHUTDOWN
|
||||
#define SOCK_ENOTSOCK ENOTSOCK
|
||||
#define SOCK_EBADF EBADF
|
||||
|
||||
/*
|
||||
* Under MULTINET FD_SETSIZE does not apply
|
||||
* (can only guess about the others)
|
||||
*/
|
||||
#ifdef MULTINET
|
||||
# define FD_IN_FDSET(FD) (1)
|
||||
#else
|
||||
# define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE&&(FD)>=0)
|
||||
#endif
|
||||
|
||||
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
|
||||
|
||||
#endif /*osdSockH*/
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
//
|
||||
// should move the gettimeofday() proto for VMS
|
||||
// into a different header
|
||||
//
|
||||
#include "osiSock.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "epicsTime.h"
|
||||
#include "generalTimeSup.h"
|
||||
|
||||
//
|
||||
// epicsTime::osdGetCurrent ()
|
||||
//
|
||||
int osdTimeGetCurrent (epicsTimeStamp *pDest)
|
||||
{
|
||||
int status;
|
||||
#if defined(CLOCK_REALTIME)
|
||||
struct timespec t;
|
||||
status = clock_gettime(CLOCK_REALTIME, &t);
|
||||
#else
|
||||
struct timeval t;
|
||||
status = gettimeofday(&t, NULL);
|
||||
#endif
|
||||
if (status) {
|
||||
return epicsTimeERROR;
|
||||
}
|
||||
*pDest = epicsTime(t);
|
||||
return epicsTimeOK;
|
||||
}
|
||||
|
||||
static int timeRegister(void)
|
||||
{
|
||||
#if defined (CLOCK_REALTIME)
|
||||
const char *name = "gettimeofday";
|
||||
#else
|
||||
const char *name = "clock_gettime";
|
||||
#endif
|
||||
|
||||
generalTimeCurrentTpRegister(name, 150, osdTimeGetCurrent);
|
||||
return 1;
|
||||
}
|
||||
static int done = timeRegister();
|
||||
@@ -1,28 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#ifndef osdTimeh
|
||||
#define osdTimeh
|
||||
|
||||
/*
|
||||
* I assume that this is never defined on VMS ?
|
||||
*/
|
||||
struct timespec {
|
||||
time_t tv_sec; /* seconds since some epoch */
|
||||
long tv_nsec; /* nanoseconds within the second */
|
||||
};
|
||||
|
||||
#endif /* ifndef osdTimeh */
|
||||
@@ -1,138 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
// VMS specific wire formatting functions
|
||||
|
||||
//
|
||||
// We still use a big endian wire format for CA consistent with the internet,
|
||||
// but inconsistent with the vast majority of CPUs
|
||||
//
|
||||
|
||||
#ifndef osdWireFormat
|
||||
#define osdWireFormat
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#define EPICS_LITTLE_ENDIAN
|
||||
#define EPICS_CONVERSION_REQUIRED
|
||||
|
||||
template <>
|
||||
inline void WireGet < epicsFloat32 > (
|
||||
const epicsUInt8 * pWireSrc, epicsFloat32 & dst )
|
||||
{
|
||||
cvt$convert_float ( pWireSrc, CVT$K_IEEE_S, & dst, CVT$K_VAX_F, CVT$M_BIG_ENDIAN );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void WireGet < epicsFloat64 > (
|
||||
const epicsUInt8 * pWireSrc, epicsFloat64 & dst )
|
||||
{
|
||||
# if defined ( __G_FLOAT ) && ( __G_FLOAT == 1 )
|
||||
cvt$convert_float ( pWireSrc, CVT$K_IEEE_T, & dst, CVT$K_VAX_G, CVT$M_BIG_ENDIAN );
|
||||
# else
|
||||
cvt$convert_float ( pWireSrc, CVT$K_IEEE_T, & dst, CVT$K_VAX_D, CVT$M_BIG_ENDIAN );
|
||||
# endif
|
||||
}
|
||||
|
||||
inline void WireGet (
|
||||
const epicsUInt8 * pWireSrc, epicsOldString & dst )
|
||||
{
|
||||
memcpy ( dst, pWireSrc, sizeof ( dst ) );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void WireSet < epicsFloat32 > (
|
||||
const epicsFloat32 & src, epicsUInt8 * pWireDst )
|
||||
{
|
||||
cvt$convert_float ( & src, CVT$K_VAX_F , pWireDst, CVT$K_IEEE_S, CVT$M_BIG_ENDIAN );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void WireSet < epicsFloat64 > (
|
||||
const epicsFloat64 & src, epicsUInt8 * pWireDst )
|
||||
{
|
||||
# if defined ( __G_FLOAT ) && ( __G_FLOAT == 1 )
|
||||
cvt$convert_float ( & src, CVT$K_VAX_G , pWireDst, CVT$K_IEEE_T, CVT$M_BIG_ENDIAN );
|
||||
# else
|
||||
cvt$convert_float ( & src, CVT$K_VAX_D , pWireDst, CVT$K_IEEE_T, CVT$M_BIG_ENDIAN );
|
||||
# endif
|
||||
}
|
||||
|
||||
inline void WireSet (
|
||||
const epicsOldString & src, epicsUInt8 * pWireDst )
|
||||
{
|
||||
memcpy ( pWireDst, src, sizeof ( src ) );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void AlignedWireGet < epicsUInt16 > (
|
||||
const epicsUInt16 & src, epicsUInt16 & dst )
|
||||
{
|
||||
dst = byteSwap ( src );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void AlignedWireGet < epicsUInt32 > (
|
||||
const epicsUInt32 & src, epicsUInt32 & dst )
|
||||
{
|
||||
dst = byteSwap ( src );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void AlignedWireGet < epicsFloat32 > (
|
||||
const epicsFloat32 & src, epicsFloat32 & dst )
|
||||
{
|
||||
cvt$convert_float ( & src, CVT$K_IEEE_S, & dst, CVT$K_VAX_F, CVT$M_BIG_ENDIAN );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void AlignedWireGet < epicsFloat64 > (
|
||||
const epicsFloat64 & src, epicsFloat64 & dst )
|
||||
{
|
||||
# if defined ( __G_FLOAT ) && ( __G_FLOAT == 1 )
|
||||
cvt$convert_float ( & src, CVT$K_IEEE_T, & dst, CVT$K_VAX_G, CVT$M_BIG_ENDIAN );
|
||||
# else
|
||||
cvt$convert_float ( & src, CVT$K_IEEE_T, & dst, CVT$K_VAX_D, CVT$M_BIG_ENDIAN );
|
||||
# endif
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void AlignedWireSet < epicsUInt16 > (
|
||||
const epicsUInt16 & src, epicsUInt16 & dst )
|
||||
{
|
||||
dst = byteSwap ( src );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void AlignedWireSet < epicsUInt32 > (
|
||||
const epicsUInt32 & src, epicsUInt32 & dst )
|
||||
{
|
||||
dst = byteSwap ( src );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void AlignedWireSet < epicsFloat32 > (
|
||||
const epicsFloat32 & src, epicsFloat32 & dst )
|
||||
{
|
||||
cvt$convert_float ( & src, CVT$K_VAX_F , & dst, CVT$K_IEEE_S, CVT$M_BIG_ENDIAN );
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void AlignedWireSet < epicsFloat64 > (
|
||||
const epicsFloat64 & src, epicsFloat64 & dst )
|
||||
{
|
||||
# if defined ( __G_FLOAT ) && ( __G_FLOAT == 1 )
|
||||
cvt$convert_float ( & src, CVT$K_VAX_G , & dst, CVT$K_IEEE_T, CVT$M_BIG_ENDIAN );
|
||||
# else
|
||||
cvt$convert_float ( & src, CVT$K_VAX_D , & dst, CVT$K_IEEE_T, CVT$M_BIG_ENDIAN );
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif // osdWireFormat
|
||||
@@ -1,22 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* osiFileName.h
|
||||
* Author: Jeff Hill
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef osiFileNameH
|
||||
#define osiFileNameH
|
||||
|
||||
#define OSI_PATH_LIST_SEPARATOR ","
|
||||
#define OSI_PATH_SEPARATOR "."
|
||||
|
||||
#endif /* osiFileNameH */
|
||||
@@ -1,164 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* vms specific socket include
|
||||
*/
|
||||
|
||||
#ifndef osiSockH
|
||||
#define osiSockH
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#if defined(MULTINET) && defined(__cplusplus)
|
||||
struct iovec;
|
||||
#endif
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#if defined(UCX) /* GeG 09-DEC-1992 */
|
||||
# include <errno>
|
||||
# include <sys/ucx$inetdef.h>
|
||||
# include <ucx.h>
|
||||
# include <netdb.h>
|
||||
#elif defined(MULTINET)
|
||||
# if defined(__DECCXX)
|
||||
# define __DECC 1
|
||||
# define __DECC_VER 999999999
|
||||
# include <tcp/errno.h>
|
||||
# include <sys/time.h>
|
||||
# undef __DECC
|
||||
# undef __DECC_VER
|
||||
# else
|
||||
# include <tcp/errno.h>
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
# if defined(__cplusplus)
|
||||
struct ifaddr;
|
||||
struct mbuf;
|
||||
# endif
|
||||
# include <sys/ioctl.h>
|
||||
# include <net/if.h>
|
||||
# include <vms/inetiodef.h>
|
||||
# include <sys/ioctl.h>
|
||||
# include <tcp/netdb.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* MULTINET defines none of these (if not using C++)
|
||||
*/
|
||||
#if defined(MULTINET) && defined(MULTINET_NO_PROTOTYPES)
|
||||
int gettimeofday (struct timeval *tp, struct timezone *tzp);
|
||||
int gethostname (char *name, int namelen);
|
||||
int getpeername (int socket, struct sockaddr *name, int *namelen);
|
||||
int connect (int socket, struct sockaddr *name, int namelen);
|
||||
int setsockopt (int socket, int level, int optname,
|
||||
char *optval, int optlen);
|
||||
int sendto (int socket, const char *buf, int len,
|
||||
int flags, struct sockaddr *to, int tolen);
|
||||
int select (int width, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, struct timeval *timeout);
|
||||
|
||||
int bind (int socket, struct sockaddr *name, int namelen);
|
||||
int send (int socket, const char *buf, int len, int flags);
|
||||
int recv (int socket, char *buf, int len, int flags);
|
||||
int getsockopt (int socket, int level, int optname,
|
||||
char *optval, int *optlen);
|
||||
int recvfrom (int socket, char *buf, int len,
|
||||
int flags, struct sockaddr *from, int *fromlen);
|
||||
int getsockname (int socket, struct sockaddr *name, int *namelen);
|
||||
int listen (int socket, int backlog);
|
||||
int shutdown (int socket, int how);
|
||||
int socket (int domain, int type, int protocol);
|
||||
|
||||
#endif /* defined(MULTINET) && defined(MULTINET_NO_PROTOTYPES) */
|
||||
|
||||
#ifdef MULTINET
|
||||
# include <arpa/inet.h>
|
||||
#else
|
||||
char * inet_ntoa (struct in_addr in);
|
||||
unsigned long inet_addr (const char *);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
struct hostent {
|
||||
char *h_name; /* official name of host */
|
||||
char **h_aliases; /* alias list */
|
||||
int h_addrtype; /* host address type */
|
||||
int h_length; /* length of address */
|
||||
char **h_addr_list; /* list of addresses from name server */
|
||||
#define h_addr h_addr_list[0] /* address, for backward compatiblity */
|
||||
};
|
||||
struct hostent *gethostbyaddr(char *addr, int len, int type);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef int SOCKET;
|
||||
#define INVALID_SOCKET (-1)
|
||||
#define INADDR_LOOPBACK ((u_long)0x7f000001)
|
||||
|
||||
|
||||
/*
|
||||
* (the VAXC runtime lib has its own close
|
||||
*/
|
||||
#if defined(WINTCP) /* Wallangong */
|
||||
# define socket_close(S) netclose(S)
|
||||
# define socket_ioctl(A,B,C) ioctl(A,B,C)
|
||||
#endif
|
||||
#if defined(UCX) /* GeG 09-DEC-1992 */
|
||||
# define socket_close(S) close(S)
|
||||
# define socket_ioctl(A,B,C) ioctl(A,B,C)
|
||||
#endif
|
||||
typedef int osiSockIoctl_t;
|
||||
|
||||
#if defined(WINTCP) /* Wallangong */
|
||||
extern int uerrno;
|
||||
# define SOCKERRNO uerrno
|
||||
#elif defined(MULTINET)
|
||||
# define SOCKERRNO socket_errno
|
||||
#else
|
||||
# define SOCKERRNO errno /* UCX and others? */
|
||||
#endif
|
||||
|
||||
#define MAXHOSTNAMELEN 75
|
||||
|
||||
#define SOCK_EWOULDBLOCK EWOULDBLOCK
|
||||
#define SOCK_ENOBUFS ENOBUFS
|
||||
#define SOCK_ECONNRESET ECONNRESET
|
||||
#define SOCK_ETIMEDOUT ETIMEDOUT
|
||||
#define SOCK_EADDRINUSE EADDRINUSE
|
||||
#define SOCK_ECONNREFUSED ECONNREFUSED
|
||||
#define SOCK_ECONNABORTED ECONNABORTED
|
||||
#define SOCK_EINPROGRESS EINPROGRESS
|
||||
#define SOCK_EISCONN EISCONN
|
||||
#define SOCK_EALREADY EALREADY
|
||||
#define SOCK_EINVAL EINVAL
|
||||
#define SOCK_EINTR EINTR
|
||||
#define SOCK_EPIPE EPIPE
|
||||
#define SOCK_EMFILE EMFILE
|
||||
|
||||
/*
|
||||
* Under MULTINET FD_SETSIZE does not apply
|
||||
* (can only guess about the others)
|
||||
*/
|
||||
#ifdef MULTINET
|
||||
# define FD_IN_FDSET(FD) (1)
|
||||
#else
|
||||
# define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE&&(FD)>=0)
|
||||
#endif
|
||||
|
||||
#endif /*osiSockH*/
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
* U C X . H
|
||||
* UNIX ioctl structures and defines used for VAX/UCX
|
||||
*
|
||||
*/
|
||||
#ifndef _UCX_H_
|
||||
#define _UCX_H_
|
||||
#ifdef UCX
|
||||
|
||||
#define IFF_UP 0x1 /* interface is up */
|
||||
#define IFF_BROADCAST 0x2 /* broadcast address valid */
|
||||
#define IFF_LOOPBACK 0x8 /* is a loopback net */
|
||||
#define IFF_POINTOPOINT 0x10 /* interface is point to point */
|
||||
/*
|
||||
* Interface request structure used for socket
|
||||
* ioctl's. All interface ioctl's must have parameter
|
||||
* definitions which begin with ifr_name. The
|
||||
* remainder may be interface specific.
|
||||
*/
|
||||
struct ifreq {
|
||||
#define IFNAMSIZ 16
|
||||
char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
|
||||
union {
|
||||
struct sockaddr ifru_addr;
|
||||
struct sockaddr ifru_dstaddr;
|
||||
struct sockaddr ifru_broadaddr;
|
||||
short ifru_flags;
|
||||
int ifru_metric;
|
||||
caddr_t ifru_data;
|
||||
} ifr_ifru;
|
||||
#define ifr_addr ifr_ifru.ifru_addr /* address */
|
||||
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
|
||||
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
|
||||
#define ifr_flags ifr_ifru.ifru_flags /* flags */
|
||||
#define ifr_metric ifr_ifru.ifru_metric /* metric */
|
||||
#define ifr_data ifr_ifru.ifru_data /* for use by interface */
|
||||
};
|
||||
|
||||
/* Structure used in SIOCGIFCONF request.
|
||||
* Used to retrieve interface configuration
|
||||
* for machine (useful for programs which
|
||||
* must know all networks accessible).
|
||||
*/
|
||||
struct ifconf {
|
||||
int ifc_len; /* size of associated buffer */
|
||||
union {
|
||||
caddr_t ifcu_buf;
|
||||
struct ifreq *ifcu_req;
|
||||
} ifc_ifcu;
|
||||
#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
|
||||
#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
|
||||
};
|
||||
|
||||
#ifndef NBBY
|
||||
#define NBBY 8
|
||||
#endif
|
||||
|
||||
#ifndef FD_SETSIZE
|
||||
#define FD_SETSIZE 256
|
||||
#endif
|
||||
|
||||
typedef long fd_mask ;
|
||||
#define NFDBITS (sizeof (fd_mask) * NBBY ) /* bits per mask */
|
||||
#ifndef howmany
|
||||
#define howmany(x, y) (((x)+((y)-1))/(y))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Both DEC C and VAX C only allow 32 fd's at once
|
||||
*/
|
||||
typedef int fd_set ;
|
||||
|
||||
#define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS)))
|
||||
#define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS)))
|
||||
#define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS)))
|
||||
#define FD_ZERO(p) memset((char *)(p), 0, sizeof (*(p)))
|
||||
|
||||
#include <iodef.h>
|
||||
#define IO$_RECEIVE (IO$_WRITEVBLK)
|
||||
|
||||
struct timezone {
|
||||
int tz_minuteswest ; /* minutes west of Greenwich */
|
||||
int tz_dsttime ; /* type of dst correction */
|
||||
};
|
||||
|
||||
#define TWOPOWER32 4294967296.0
|
||||
#define TWOPOWER31 2147483648.0
|
||||
#define UNIX_EPOCH_AS_MJD 40587.0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user