57 #define CS_ST_OUTCON 3
58 #define CS_ST_DATAXFER 4
59 #define CS_ST_ACCEPT 5
60 #define CS_ST_CONNECTING 6
80 int (*check_ip)(
void *cd,
const char *a,
int len,
int type),
85 void *(*f_straddr)(
COMSTACK handle,
const char *str);
90 #define cs_put(handle, buf, size) ((*(handle)->f_put)(handle, buf, size))
91 #define cs_get(handle, buf, size) ((*(handle)->f_get)(handle, buf, size))
92 #define cs_more(handle) ((*(handle)->f_more)(handle))
93 #define cs_connect(handle, address) ((*(handle)->f_connect)(handle, address))
94 #define cs_rcvconnect(handle) ((*(handle)->f_rcvconnect)(handle))
95 #define cs_bind(handle, ad, mo) ((*(handle)->f_bind)(handle, ad, mo))
96 #define cs_listen(handle, ap, al) ((*(handle)->f_listen)(handle, ap, al, 0, 0))
97 #define cs_listen_check(handle, ap, al, cf, cd) ((*(handle)->f_listen)(handle, ap, al, cf, cd))
98 #define cs_accept(handle) ((*(handle)->f_accept)(handle))
99 #define cs_close(handle) ((*(handle)->f_close)(handle))
100 #define cs_create(type, blocking, proto) ((*type)(-1, blocking, proto, 0))
101 #define cs_createbysocket(sock, type, blocking, proto) \
102 ((*type)(sock, blocking, proto, 0))
103 #define cs_type(handle) ((handle)->type)
104 #define cs_fileno(handle) ((handle)->iofile)
105 #define cs_getstate(handle) ((handle)->getstate)
106 #define cs_errno(handle) ((handle)->cerrno)
107 #define cs_getproto(handle) ((handle)->protocol)
108 #define cs_addrstr(handle) ((*(handle)->f_addrstr)(handle))
109 #define cs_straddr(handle, str) ((*(handle)->f_straddr)(handle, str))
110 #define cs_want_read(handle) ((handle)->io_pending & CS_WANT_READ)
111 #define cs_want_write(handle) ((handle)->io_pending & CS_WANT_WRITE)
112 #define cs_set_blocking(handle,blocking) ((handle)->f_set_blocking(handle, blocking))
114 #define CS_WANT_READ 1
115 #define CS_WANT_WRITE 2
121 int blocking,
void **vp);
124 int blocking,
void **vp,
125 const char *proxy_host);
127 const char *proxy_host,
int *proxy_mode);
128 YAZ_EXPORT
void cs_get_host_args(
const char *type_and_host,
const char **args);
133 __attribute__ ((deprecated))
138 __attribute__ ((deprecated))
146 YAZ_EXPORT
int cs_parse_host(
const char *uri,
const char **host,
148 char **connect_host);
163 #define CSLASTERROR CSBUFSIZE
165 #define CS_FLAGS_BLOCKING 1
166 #define CS_FLAGS_NUMERICHOST 2
167 #define CS_FLAGS_DNS_NO_BLOCK 4
int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname)
void cs_print_session_info(COMSTACK cs)
COMSTACK cs_create_host(const char *type_and_host, int blocking, void **vp)
int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len)
void cs_set_max_recv_bytes(COMSTACK cs, int max_recv_bytes)
int cs_complete_auto(const char *buf, int len)
int cs_set_ssl_ctx(COMSTACK cs, void *ctx)
const char * cs_strerror(COMSTACK h)
void * cs_get_ssl(COMSTACK cs)
const char * cs_errmsg(int n)
int cs_parse_host(const char *uri, const char **host, CS_TYPE *t, enum oid_proto *proto, char **connect_host)
void cs_get_host_args(const char *type_and_host, const char **args)
int cs_complete_auto_head(const char *buf, int len)
struct comstack * COMSTACK
COMSTACK cs_create_host2(const char *vhost, int blocking, void **vp, const char *proxy_host, int *proxy_mode)
COMSTACK cs_create_host_proxy(const char *vhost, int blocking, void **vp, const char *proxy_host)
int cs_set_head_only(COMSTACK cs, int head_only)
COMSTACK(* CS_TYPE)(int s, int flags, int protocol, void *vp)
Header for OID basic functions.
int(* f_bind)(COMSTACK handle, void *address, int mode)
COMSTACK(* f_accept)(COMSTACK handle)
void(* f_close)(COMSTACK handle)
int(* f_listen)(COMSTACK h, char *raddr, int *addrlen, int(*check_ip)(void *cd, const char *a, int len, int type), void *cd)
int(* f_put)(COMSTACK handle, char *buf, int size)
int(* f_more)(COMSTACK handle)
int(* f_set_blocking)(COMSTACK handle, int blocking)
int(* f_rcvconnect)(COMSTACK handle)
int(* f_connect)(COMSTACK handle, void *address)
int(* f_get)(COMSTACK handle, char **buf, int *bufsize)
Header for memory handling functions.
Header with fundamental macros.