YAZ
5.34.0
|
Implements UNIX domain socket COMSTACK. More...
#include <yaz/yconfig.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <time.h>
#include <fcntl.h>
#include <signal.h>
#include <grp.h>
#include <yaz/unix.h>
#include <yaz/log.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 | 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 void | 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) |
Variables | |
static int | log_level = 0 |
Implements UNIX domain socket COMSTACK.
Definition in file unix.c.
#define SUN_LEN | ( | ptr | ) |
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, log_level, comstack::newfd, comstack::state, unix_state::towrite, unix_state::written, xfree, xmalloc, and yaz_log().
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, log_level, comstack::state, SUN_LEN, unix_state::uid, unix_state::umask, yaz_errno(), yaz_log(), 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, log_level, xfree, and yaz_log().
Referenced by unix_type().
|
static |
Definition at line 316 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, log_level, comstack::state, SUN_LEN, unix_rcvconnect(), yaz_errno(), and yaz_log().
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, log_level, xmalloc, xrealloc, yaz_errno(), and yaz_log().
Referenced by unix_type().
|
static |
Definition at line 94 of file unix.c.
References log_level, log_level_set, and yaz_log_module_level().
Referenced by unix_strtoaddr_ex(), and 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, log_level, comstack::newfd, comstack::state, yaz_errno(), yaz_log(), and YAZ_SOCKLEN_T.
|
static |
Referenced by unix_type().
|
static |
Definition at line 304 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 unix_state::buf, comstack::cerrno, comstack::cprivate, CS_DATA, CS_WANT_WRITE, CSWRONGBUF, CSYSERR, comstack::event, comstack::io_pending, comstack::iofile, log_level, unix_state::towrite, unix_state::written, yaz_errno(), and yaz_log().
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, log_level, comstack::state, and yaz_log().
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 285 of file unix.c.
References unix_straddr1(), xfree, and xstrdup.
Referenced by unix_type().
|
static |
Definition at line 188 of file unix.c.
References unix_state::addr, comstack::cprivate, unix_state::gid, log_level, unix_state::uid, unix_state::umask, unix_strtoaddr_ex(), and yaz_log().
Referenced by unix_straddr().
struct sockaddr_un* unix_strtoaddr | ( | const char * | str | ) |
Definition at line 293 of file unix.c.
References log_level, unix_strtoaddr_ex(), and yaz_log().
|
static |
Definition at line 173 of file unix.c.
References log_level, unix_init(), and yaz_log().
Referenced by unix_straddr1(), and unix_strtoaddr().
COMSTACK unix_type | ( | int | s, |
int | flags, | ||
int | protocol, | ||
void * | vp | ||
) |
Definition at line 108 of file unix.c.
References unix_state::altbuf, unix_state::altlen, unix_state::altsize, comstack::cerrno, unix_state::complete, 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, log_level, comstack::protocol, comstack::state, unix_state::towrite, 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(), comstack::user, unix_state::written, xmalloc, and yaz_log().
Referenced by cs_parse_host().
|
static |
Definition at line 92 of file unix.c.
Referenced by unix_accept(), unix_bind(), unix_close(), unix_connect(), unix_get(), unix_init(), unix_listen(), unix_put(), unix_rcvconnect(), unix_straddr1(), unix_strtoaddr(), unix_strtoaddr_ex(), and unix_type().