#include <stdio.h>#include <stdlib.h>#include <string.h>#include <signal.h>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include <ctype.h>#include <netdb.h>#include <poll.h>#include <sys/select.h>#include <sys/time.h>#include <sys/types.h>#include <sys/resource.h>#include <sys/wait.h>#include <sys/param.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <ngc/core/ngcbSocket.h>Macros | |
| #define | _GNU_SOURCE |
| #define | _REENTRANT |
Functions | |
| void | ngcbRegisterLock (void(*lock)(void), void(*unlock)(void)) |
| void | ngcbLock (void) |
| void | ngcbUnlock (void) |
| void | ngcbIpAddrCache (int flag) |
| int | ngcbGetHostName (char *name, int size) |
| int | ngcbGetHost (const char *name, char *ipAddr, char *hostName, char *erms) |
| int | ngcbGetIpAddr (const char *name, char *ipAddr, char *erms) |
| int | ngcbSocketPort (int fd) |
| void | ngcbSocketHost (int fd, char *ipAddr) |
| int | ngcbSocketWait (int fd, int timeout, char *erms) |
| int | ngcbSocketWaitIntr (int fd1, int fd2, int timeout, char *erms) |
| int | ngcbSocketPair (int fd[2], int bufferSize, char *erms) |
| int | ngcbHostCompare (const char *host1, const char *host2) |
| #define _GNU_SOURCE |
| #define _REENTRANT |
| int ngcbGetHost | ( | const char * | name, |
| char * | ipAddr, | ||
| char * | hostName, | ||
| char * | erms ) |
Convert name to ip-address if name is a hostname or converts name to hostname, if name is an ip-address.
| int ngcbGetHostName | ( | char * | name, |
| int | size ) |
Returns the host name of the calling host. The maximum length of the name is given by size.
| int ngcbGetIpAddr | ( | const char * | name, |
| char * | ipAddr, | ||
| char * | erms ) |
Converts name to an ip-address.
| int ngcbHostCompare | ( | const char * | host1, |
| const char * | host2 ) |
Check, whether two hosts are identical. The function returns zero if the comparison was successfull, otherwise a non-zero value is returned.
| void ngcbIpAddrCache | ( | int | flag | ) |
Enable/disable IP-address cache.
| void ngcbLock | ( | void | ) |
Lock - using the registered functions
| void ngcbRegisterLock | ( | void(* | lock )(void), |
| void(* | unlock )(void) ) |
Register locking functions
| void ngcbSocketHost | ( | int | fd, |
| char * | ipAddr ) |
Returns the peer (remote) ipAddr (as string) associated with a socket.
| int ngcbSocketPair | ( | int | fd[2], |
| int | bufferSize, | ||
| char * | erms ) |
Create a pair of connected UNIX-domain sockets.
| int ngcbSocketPort | ( | int | fd | ) |
Return the port number associated with a socket. If the socket is not valid zero is returned.
| int ngcbSocketWait | ( | int | fd, |
| int | timeout, | ||
| char * | erms ) |
Wait with timeout (in millisconds) for a socket to become readable. A negative value means no-timeout.
| int ngcbSocketWaitIntr | ( | int | fd1, |
| int | fd2, | ||
| int | timeout, | ||
| char * | erms ) |
Waits with timeout (in millisconds) for socket fd1 or fd2 to become readable. A negative value means no-timeout. If a timeout occurs, the value -1 is returned. If socket fd2 becomes readable first, the value -2 is returned (interrupted).
| void ngcbUnlock | ( | void | ) |
Unlock - using the registered functions