|
YAZ
4.2.57
|
Implements UNIX domain socket COMSTACK. More...
#include <stdio.h>#include <string.h>#include <stdlib.h>#include <errno.h>#include <fcntl.h>#include <signal.h>#include <grp.h>#include <yaz/unix.h>Go to the source code of this file.
Data Structures | |
| struct | unix_state |
Macros | |
| #define | YAZ_SOCKLEN_T int |
| #define | SUN_LEN(ptr) |
| #define | TRC(X) |
| #define | CS_UNIX_BUFCHUNK 4096 |
Typedefs | |
| typedef struct unix_state | unix_state |
Functions | |
| static void | unix_close (COMSTACK h) |
| static int | unix_put (COMSTACK h, char *buf, int size) |
| static int | unix_get (COMSTACK h, char **buf, int *bufsize) |
| static int | unix_connect (COMSTACK h, void *address) |
| static int | unix_more (COMSTACK h) |
| static int | unix_rcvconnect (COMSTACK h) |
| static int | unix_bind (COMSTACK h, void *address, int mode) |
| static int | unix_listen (COMSTACK h, char *raddr, int *addrlen, int(*check_ip)(void *cd, const char *a, int len, int type), void *cd) |
| static int | unix_set_blocking (COMSTACK p, int blocking) |
| static COMSTACK | unix_accept (COMSTACK h) |
| static const char * | unix_addrstr (COMSTACK h) |
| static void * | unix_straddr (COMSTACK h, const char *str) |
| static int | unix_init (void) |
| COMSTACK | unix_type (int s, int flags, int protocol, void *vp) |
| static int | unix_strtoaddr_ex (const char *str, struct sockaddr_un *add) |
| static void * | unix_straddr1 (COMSTACK h, const char *str, char *f) |
| struct sockaddr_un * | unix_strtoaddr (const char *str) |
| static int | unix_listen (COMSTACK h, char *raddr, int *addrlen, int(*check_ip)(void *cd, const char *a, int len, int t), void *cd) |
Implements UNIX domain socket COMSTACK.
Definition in file unix.c.
| #define CS_UNIX_BUFCHUNK 4096 |
Definition at line 556 of file unix.c.
Referenced by unix_get().
| #define SUN_LEN | ( | ptr | ) |
Definition at line 75 of file unix.c.
Referenced by unix_bind(), and unix_connect().
| #define TRC | ( | X | ) |
Definition at line 81 of file unix.c.
Referenced by unix_accept(), unix_bind(), unix_close(), unix_connect(), unix_get(), unix_listen(), unix_put(), unix_rcvconnect(), unix_straddr1(), unix_strtoaddr(), unix_strtoaddr_ex(), and unix_type().
| #define YAZ_SOCKLEN_T int |
Definition at line 47 of file unix.c.
Referenced by unix_listen().
| typedef struct unix_state unix_state |
Definition at line 487 of file unix.c.
References unix_state::addr, unix_state::altbuf, unix_state::altlen, unix_state::altsize, comstack::cerrno, unix_state::complete, comstack::cprivate, CS_DATA, CS_FLAGS_BLOCKING, CS_NONE, CS_ST_ACCEPT, CS_ST_DATAXFER, CS_ST_IDLE, CS_ST_INCON, CSOUTSTATE, CSYSERR, comstack::event, comstack::flags, comstack::io_pending, comstack::iofile, comstack::newfd, comstack::state, unix_state::towrite, TRC, unix_state::written, xfree, and xmalloc.
Referenced by unix_type().
|
static |
Definition at line 721 of file unix.c.
References unix_state::addr, unix_state::buf, and comstack::cprivate.
Referenced by unix_type().
|
static |
Definition at line 384 of file unix.c.
References comstack::cerrno, comstack::cprivate, CS_LISTEN, CS_SERVER, CS_ST_IDLE, CSYSERR, comstack::event, unix_state::gid, comstack::iofile, comstack::state, SUN_LEN, TRC, unix_state::uid, unix_state::umask, yaz_errno(), and yaz_set_errno().
Referenced by unix_type().
|
static |
Definition at line 706 of file unix.c.
References unix_state::altbuf, comstack::cprivate, comstack::iofile, TRC, and xfree.
Referenced by unix_type().
|
static |
Definition at line 319 of file unix.c.
References comstack::cerrno, CS_CONNECT, CS_ST_CONNECTING, CS_ST_UNBND, CS_WANT_WRITE, CSOUTSTATE, CSYSERR, comstack::event, comstack::io_pending, comstack::iofile, comstack::state, SUN_LEN, TRC, unix_rcvconnect(), and yaz_errno().
Referenced by unix_type().
|
static |
Definition at line 562 of file unix.c.
References unix_state::altbuf, unix_state::altlen, unix_state::altsize, unix_state::complete, comstack::cprivate, CS_UNIX_BUFCHUNK, CS_WANT_READ, comstack::io_pending, comstack::iofile, TRC, xmalloc, xrealloc, and yaz_errno().
Referenced by unix_type().
|
static |
Definition at line 101 of file unix.c.
Referenced by unix_strtoaddr_ex(), and unix_type().
|
static |
Referenced by unix_type().
|
static |
Definition at line 450 of file unix.c.
References comstack::cerrno, CS_ST_IDLE, CS_ST_INCON, CSNODATA, CSOUTSTATE, CSYSERR, comstack::iofile, comstack::newfd, comstack::state, TRC, yaz_errno(), and YAZ_SOCKLEN_T.
|
static |
Definition at line 307 of file unix.c.
References unix_state::altbuf, unix_state::altlen, unix_state::complete, and comstack::cprivate.
Referenced by unix_type().
|
static |
Definition at line 651 of file unix.c.
References comstack::cerrno, comstack::cprivate, CS_DATA, CS_WANT_WRITE, CSWRONGBUF, CSYSERR, comstack::event, comstack::io_pending, comstack::iofile, unix_state::towrite, TRC, unix_state::written, and yaz_errno().
Referenced by unix_type().
|
static |
Definition at line 368 of file unix.c.
References comstack::cerrno, CS_DATA, CS_ST_CONNECTING, CS_ST_DATAXFER, CSOUTSTATE, comstack::event, comstack::state, and TRC.
Referenced by unix_connect(), and unix_type().
|
static |
Definition at line 729 of file unix.c.
References CS_FLAGS_BLOCKING, comstack::flags, and comstack::iofile.
Referenced by unix_type().
|
static |
Definition at line 288 of file unix.c.
References unix_straddr1(), xfree, and xstrdup.
Referenced by unix_type().
|
static |
Definition at line 195 of file unix.c.
References unix_state::addr, comstack::cprivate, unix_state::gid, TRC, unix_state::uid, unix_state::umask, and unix_strtoaddr_ex().
Referenced by unix_straddr().
|
read |
Definition at line 296 of file unix.c.
References TRC, and unix_strtoaddr_ex().
|
static |
Definition at line 180 of file unix.c.
References TRC, and unix_init().
Referenced by unix_straddr1(), and unix_strtoaddr().
| COMSTACK unix_type | ( | int | s, |
| int | flags, | ||
| int | protocol, | ||
| void * | vp | ||
| ) |
Definition at line 110 of file unix.c.
References unix_state::altbuf, unix_state::altlen, unix_state::altsize, comstack::cerrno, unix_state::complete, completeWAIS(), COMSTACK_DEFAULT_TIMEOUT, comstack::cprivate, cs_complete_auto(), CS_FLAGS_BLOCKING, CS_NONE, CS_ST_IDLE, CS_ST_UNBND, comstack::event, comstack::f_accept, comstack::f_addrstr, comstack::f_bind, comstack::f_close, comstack::f_connect, comstack::f_get, comstack::f_listen, comstack::f_more, comstack::f_put, comstack::f_rcvconnect, comstack::f_set_blocking, comstack::f_straddr, comstack::flags, comstack::io_pending, comstack::iofile, PROTO_WAIS, comstack::protocol, comstack::state, comstack::timeout, unix_state::towrite, TRC, comstack::type, unix_accept(), unix_addrstr(), unix_bind(), unix_close(), unix_connect(), unix_get(), unix_init(), unix_listen(), unix_more(), unix_put(), unix_rcvconnect(), unix_set_blocking(), unix_straddr(), unix_type(), comstack::user, unix_state::written, and xmalloc.
Referenced by cs_parse_host(), cs_parse_uri(), and unix_type().
1.8.1.2