From f9e6130f17d1b1e9b35d223d955b4b6bdad3d853 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 16 Jun 1998 02:12:05 +0000 Subject: [PATCH] installed --- src/libCom/bsdSocketResource.h | 48 ++++++++++++++++++++++++++++++++++ src/libCom/osiSleep.h | 15 +++++++++++ 2 files changed, 63 insertions(+) create mode 100644 src/libCom/bsdSocketResource.h create mode 100644 src/libCom/osiSleep.h diff --git a/src/libCom/bsdSocketResource.h b/src/libCom/bsdSocketResource.h new file mode 100644 index 000000000..82815f0e9 --- /dev/null +++ b/src/libCom/bsdSocketResource.h @@ -0,0 +1,48 @@ + +#include "osiSock.h" +#include "shareLib.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * convert IP address to ASCII in this order + * 1) look for matching host name + * 2) convert to traditional dotted IP address (with trailing port) + */ +epicsShareFunc void epicsShareAPI ipAddrToA + (const struct sockaddr_in *pInetAddr, char *pBuf, unsigned bufSize); + +/* + * attempt to convert ASCII string to an IP address in this order + * 1) look for traditional doted ip with optional port + * 2) look for raw number form of ip address with optional port + * 3) look for valid host name with optional port + */ +epicsShareFunc int epicsShareAPI aToIPAddr + (const char *pAddrString, unsigned short defaultPort, struct sockaddr_in *pIP); + +/* + * attempt to convert ASCII host name string with optional port to an IP address + */ +epicsShareFunc int epicsShareAPI hostToIPAddr + (const char *pHostName, struct in_addr *pIPA); +/* + * attach to BSD socket library + */ +epicsShareFunc int epicsShareAPI bsdSockAttach(); /* returns T if success, else F */ + +/* + * release BSD socket library + */ +epicsShareFunc void epicsShareAPI bsdSockRelease(); + +#ifdef _WIN32 +epicsShareFunc const char * epicsShareAPI getLastWSAErrorAsString(); +epicsShareFunc unsigned epicsShareAPI wsaMajorVersion(); +#endif + +#ifdef __cplusplus +} +#endif diff --git a/src/libCom/osiSleep.h b/src/libCom/osiSleep.h new file mode 100644 index 000000000..64eaa8e85 --- /dev/null +++ b/src/libCom/osiSleep.h @@ -0,0 +1,15 @@ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "shareLib.h" + +/* + * needs to be consolodated with other os independent stuff ... + */ +epicsShareFunc void epicsShareAPI osiSleep (unsigned sec, unsigned uSec); + +#ifdef __cplusplus +} +#endif