#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include "epicsThread.h"
#include "epicsEvent.h"
#include "epicsMutex.h"
#include "osiSock.h"
#include "epicsAssert.h"
#include "errlog.h"
Go to the source code of this file.
LIBCOM_API int epicsStdCall epicsSocketAccept |
( |
int |
sock, |
|
|
struct sockaddr * |
pAddr, |
|
|
osiSocklen_t * |
addrlen |
|
) |
| |
Definition at line 94 of file osdSock.c.
97 int newSock = accept ( sock, pAddr, addrlen );
102 int status = fcntl ( newSock, F_SETFD, FD_CLOEXEC );
107 "epicsSocketCreate: failed to " 108 "fcntl FD_CLOEXEC because \"%s\"\n",
void epicsSocketConvertErrnoToString(char *pBuf, unsigned bufSize)
int errlogPrintf(const char *pFormat,...)
LIBCOM_API SOCKET epicsStdCall epicsSocketCreate |
( |
int |
domain, |
|
|
int |
type, |
|
|
int |
protocol |
|
) |
| |
Definition at line 71 of file osdSock.c.
74 SOCKET sock = socket ( domain,
type, protocol );
79 int status = fcntl ( sock, F_SETFD, FD_CLOEXEC );
84 "epicsSocketCreate: failed to " 85 "fcntl FD_CLOEXEC because \"%s\"\n",
pvd::StructureConstPtr type
void epicsSocketConvertErrnoToString(char *pBuf, unsigned bufSize)
int errlogPrintf(const char *pFormat,...)
LIBCOM_API void epicsStdCall epicsSocketDestroy |
( |
SOCKET |
s | ) |
|
Definition at line 117 of file osdSock.c.
124 "epicsSocketDestroy: failed to " 125 "close a socket because \"%s\"\n",
void epicsSocketConvertErrnoToString(char *pBuf, unsigned bufSize)
int errlogPrintf(const char *pFormat,...)
LIBCOM_API int epicsStdCall hostToIPAddr |
( |
const char * |
pHostName, |
|
|
struct in_addr * |
pIPA |
|
) |
| |
Definition at line 162 of file osdSock.c.
168 phe = gethostbyname (pHostName);
169 if (phe && phe->h_addr_list[0]) {
170 if (phe->h_addrtype==AF_INET && phe->h_length<=
sizeof(
struct in_addr)) {
171 struct in_addr *pInAddrIn = (
struct in_addr *) phe->h_addr_list[0];
LIBCOM_API unsigned epicsStdCall ipAddrToHostName |
( |
const struct in_addr * |
pAddr, |
|
|
char * |
pBuf, |
|
|
unsigned |
bufSize |
|
) |
| |
Definition at line 136 of file osdSock.c.
146 ent = gethostbyaddr((
const char *) pAddr,
sizeof (*pAddr), AF_INET);
148 strncpy (pBuf, ent->h_name, bufSize);
149 pBuf[bufSize-1] =
'\0';
int osiSockAttach |
( |
void |
| ) |
|
void osiSockRelease |
( |
void |
| ) |
|