Formatted help output; address keywords in help now uppercase

This commit is contained in:
Gerhard Rieger 2023-10-26 14:56:50 +02:00
parent 797d0f9695
commit d36f78d854
44 changed files with 374 additions and 340 deletions

View file

@ -28,8 +28,11 @@ Corrections:
Now catching the case of empty SNI host to prevent OpenSSL error. Now catching the case of empty SNI host to prevent OpenSSL error.
This is related to Red Hat issue 2081414. This is related to Red Hat issue 2081414.
Better formatted help output; address keywords in help output are now
printed in uppercase.
Coding: Coding:
Introduced groups_t instead of uint32_t, for more flexibility Introduced groups_t instead of uint32_t, for more flexibility.
Rearranged option group bits to only require 32 bits on older systems. Rearranged option group bits to only require 32 bits on older systems.

View file

@ -424,7 +424,7 @@ void socat_usage(FILE *fd) {
fputs(copyright_socat, fd); fputc('\n', fd); fputs(copyright_socat, fd); fputc('\n', fd);
fputs("Usage:\n", fd); fputs("Usage:\n", fd);
fputs("socat [options] <bi-address> <bi-address>\n", fd); fputs("socat [options] <bi-address> <bi-address>\n", fd);
fputs(" options:\n", fd); fputs(" options (general command line options):\n", fd);
fputs(" -V print version and feature information to stdout, and exit\n", fd); fputs(" -V print version and feature information to stdout, and exit\n", fd);
#if WITH_HELP #if WITH_HELP
fputs(" -h|-? print a help text describing command line options and addresses\n", fd); fputs(" -h|-? print a help text describing command line options and addresses\n", fd);

16
test.sh
View file

@ -622,7 +622,7 @@ case "$TESTS" in
# test if address options array ("optionnames") is sorted alphabetically: # test if address options array ("optionnames") is sorted alphabetically:
$ECHO "testing if address options are sorted...\c" $ECHO "testing if address options are sorted...\c"
TF="$TD/socat-qq" TF="$TD/socat-qq"
$SOCAT -??? |sed '1,/opt:/ d' |awk '{print($1);}' >"$TF" $SOCAT -hhh |sed '1,/opt:/ d' |awk '{print($1);}' >"$TF"
LC_ALL=C sort "$TF" |diff "$TF" - >"$TF-diff" LC_ALL=C sort "$TF" |diff "$TF" - >"$TF-diff"
if [ -s "$TF-diff" ]; then if [ -s "$TF-diff" ]; then
$ECHO "\n*** option array is not sorted. Wrong entries:" >&2 $ECHO "\n*** option array is not sorted. Wrong entries:" >&2
@ -776,7 +776,7 @@ testoptions () {
local a A; local a A;
for a in $@; do for a in $@; do
A=$(echo "$a" |tr 'a-z' 'A-Z') A=$(echo "$a" |tr 'a-z' 'A-Z')
if $SOCAT -??? |grep "[^a-z0-9-]$a[^a-z0-9-]" >/dev/null; then if $SOCAT -hhh |grep "[^a-z0-9-]$a[^a-z0-9-]" >/dev/null; then
shift shift
continue continue
fi fi
@ -933,35 +933,35 @@ runsip6 () {
# check if TCP on IPv4 is available on host # check if TCP on IPv4 is available on host
runstcp4 () { runstcp4 () {
runsip4 >/dev/null || { echo TCP4; return 1; } runsip4 >/dev/null || { echo TCP4; return 1; }
$SOCAT -h |grep ' tcp4-' >/dev/null || return 1 $SOCAT -h |grep -i ' TCP4-' >/dev/null || return 1
return 0; return 0;
} }
# check if TCP on IPv6 is available on host # check if TCP on IPv6 is available on host
runstcp6 () { runstcp6 () {
runsip6 >/dev/null || { echo TCP6; return 1; } runsip6 >/dev/null || { echo TCP6; return 1; }
$SOCAT -h |grep ' tcp6-' >/dev/null || return 1 $SOCAT -h |grep -i ' TCP6-' >/dev/null || return 1
return 0; return 0;
} }
# check if UDP on IPv4 is available on host # check if UDP on IPv4 is available on host
runsudp4 () { runsudp4 () {
runsip4 >/dev/null || { echo UDP4; return 1; } runsip4 >/dev/null || { echo UDP4; return 1; }
$SOCAT -h |grep ' udp4-' >/dev/null || return 1 $SOCAT -h |grep -i ' UDP4-' >/dev/null || return 1
return 0; return 0;
} }
# check if UDP on IPv6 is available on host # check if UDP on IPv6 is available on host
runsudp6 () { runsudp6 () {
runsip6 >/dev/null || { echo UDP6; return 1; } runsip6 >/dev/null || { echo UDP6; return 1; }
$SOCAT -h |grep ' udp6-' >/dev/null || return 1 $SOCAT -h |grep -i ' UDP6-' >/dev/null || return 1
return 0; return 0;
} }
# check if SCTP on IPv4 is available on host # check if SCTP on IPv4 is available on host
runssctp4 () { runssctp4 () {
runsip4 >/dev/null || { echo SCTP4; return 1; } runsip4 >/dev/null || { echo SCTP4; return 1; }
$SOCAT -h |grep ' sctp4-' >/dev/null || return 1 $SOCAT -h |grep -i ' SCTP4-' >/dev/null || return 1
$SOCAT /dev/null SCTP4-L:0,accept-timeout=0.001 2>/dev/null || return 1; $SOCAT /dev/null SCTP4-L:0,accept-timeout=0.001 2>/dev/null || return 1;
return 0; return 0;
} }
@ -969,7 +969,7 @@ runssctp4 () {
# check if SCTP on IPv6 is available on host # check if SCTP on IPv6 is available on host
runssctp6 () { runssctp6 () {
runsip6 >/dev/null || { echo SCTP6; return 1; } runsip6 >/dev/null || { echo SCTP6; return 1; }
$SOCAT -h |grep ' sctp6-' >/dev/null || return 1 $SOCAT -h |grep ' SCTP6-' >/dev/null || return 1
$SOCAT /dev/null SCTP6-L:0,accept-timeout=0.001 2>/dev/null || return 1; $SOCAT /dev/null SCTP6-L:0,accept-timeout=0.001 2>/dev/null || return 1;
return 0; return 0;
} }

View file

@ -17,7 +17,7 @@ static int xioopen_creat(int arg, const char *argv[], struct opt *opts, int rw,
/*! within stream model, this is a write-only address - use 2 instead of 3 */ /*! within stream model, this is a write-only address - use 2 instead of 3 */
const struct addrdesc addr_creat = { "create", 3, xioopen_creat, GROUP_FD|GROUP_NAMED|GROUP_FILE, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_creat = { "CREATE", 3, xioopen_creat, GROUP_FD|GROUP_NAMED|GROUP_FILE, 0, 0, 0 HELP(":<filename>") };
/* retrieve the mode option and perform the creat() call. /* retrieve the mode option and perform the creat() call.

View file

@ -5,6 +5,6 @@
#ifndef __xio_creat_h_included #ifndef __xio_creat_h_included
#define __xio_creat_h_included 1 #define __xio_creat_h_included 1
extern const struct addrdesc addr_creat; extern const struct addrdesc xioaddr_creat;
#endif /* !defined(__xio_creat_h_included) */ #endif /* !defined(__xio_creat_h_included) */

View file

@ -20,7 +20,7 @@ static int xioopen_exec(int argc, const char *argv[], struct opt *opts,
int dummy1, int dummy2, int dummy3 int dummy1, int dummy2, int dummy3
); );
const struct addrdesc addr_exec = { "exec", 3, xioopen_exec, GROUP_FD|GROUP_FORK|GROUP_EXEC|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_TERMIOS|GROUP_FIFO|GROUP_PTY|GROUP_PARENT, 0, 0, 0 HELP(":<command-line>") }; const struct addrdesc xioaddr_exec = { "EXEC", 3, xioopen_exec, GROUP_FD|GROUP_FORK|GROUP_EXEC|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_TERMIOS|GROUP_FIFO|GROUP_PTY|GROUP_PARENT, 0, 0, 0 HELP(":<command-line>") };
const struct optdesc opt_dash = { "dash", "login", OPT_DASH, GROUP_EXEC, PH_PREEXEC, TYPE_BOOL, OFUNC_SPEC }; const struct optdesc opt_dash = { "dash", "login", OPT_DASH, GROUP_EXEC, PH_PREEXEC, TYPE_BOOL, OFUNC_SPEC };

View file

@ -5,7 +5,7 @@
#ifndef __xio_exec_h_included #ifndef __xio_exec_h_included
#define __xio_exec_h_included 1 #define __xio_exec_h_included 1
extern const struct addrdesc addr_exec; extern const struct addrdesc xioaddr_exec;
extern const struct optdesc opt_dash; extern const struct optdesc opt_dash;

View file

@ -15,7 +15,7 @@
static int xioopen_fdnum(int argc, const char *argv[], struct opt *opts, int rw, xiofile_t *xfd, groups_t groups, int dummy1, int dummy2, int dummy3); static int xioopen_fdnum(int argc, const char *argv[], struct opt *opts, int rw, xiofile_t *xfd, groups_t groups, int dummy1, int dummy2, int dummy3);
const struct addrdesc addr_fd = { "fd", 3, xioopen_fdnum, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 0, 0, 0 HELP(":<num>") }; const struct addrdesc xioaddr_fd = { "FD", 3, xioopen_fdnum, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 0, 0, 0 HELP(":<num>") };
/* use some file descriptor and apply the options. Set the FD_CLOEXEC flag. */ /* use some file descriptor and apply the options. Set the FD_CLOEXEC flag. */

View file

@ -5,7 +5,7 @@
#ifndef __xio_fdnum_h_included #ifndef __xio_fdnum_h_included
#define __xio_fdnum_h_included 1 #define __xio_fdnum_h_included 1
extern const struct addrdesc addr_fd; extern const struct addrdesc xioaddr_fd;
extern int xioopen_fd(struct opt *opts, int rw, xiosingle_t *xfd, int numfd, int dummy2, int dummy3); extern int xioopen_fd(struct opt *opts, int rw, xiosingle_t *xfd, int numfd, int dummy2, int dummy3);

View file

@ -66,7 +66,7 @@ const struct optdesc opt_o_trunc = { "o-trunc", "trunc", OPT_O_TRUNC,
#if _WITH_FILE /*! inconsistent name FILE vs. OPEN */ #if _WITH_FILE /*! inconsistent name FILE vs. OPEN */
const struct addrdesc addr_open = { "open", 3, xioopen_open, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_REG|GROUP_NAMED|GROUP_OPEN|GROUP_FILE|GROUP_TERMIOS, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_open = { "OPEN", 3, xioopen_open, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_REG|GROUP_NAMED|GROUP_OPEN|GROUP_FILE|GROUP_TERMIOS, 0, 0, 0 HELP(":<filename>") };
/* open for writing: /* open for writing:
if the filesystem entry already exists, the data is appended if the filesystem entry already exists, the data is appended

View file

@ -26,6 +26,6 @@ extern const struct optdesc opt_o_priv;
extern const struct optdesc opt_o_trunc; extern const struct optdesc opt_o_trunc;
extern const struct optdesc opt_o_noatime; extern const struct optdesc opt_o_noatime;
extern const struct addrdesc addr_open; extern const struct addrdesc xioaddr_open;
#endif /* !defined(__xio_file_h_included) */ #endif /* !defined(__xio_file_h_included) */

View file

@ -17,7 +17,7 @@
static int xioopen_gopen(int argc, const char *argv[], struct opt *opts, int xioflags, xiofile_t *fd, groups_t groups, int dummy1, int dummy2, int dummy3); static int xioopen_gopen(int argc, const char *argv[], struct opt *opts, int xioflags, xiofile_t *fd, groups_t groups, int dummy1, int dummy2, int dummy3);
const struct addrdesc addr_gopen = { "gopen", 3, xioopen_gopen, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_REG|GROUP_NAMED|GROUP_OPEN|GROUP_FILE|GROUP_TERMIOS|GROUP_SOCKET|GROUP_SOCK_UNIX, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_gopen = { "GOPEN", 3, xioopen_gopen, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_REG|GROUP_NAMED|GROUP_OPEN|GROUP_FILE|GROUP_TERMIOS|GROUP_SOCKET|GROUP_SOCK_UNIX, 0, 0, 0 HELP(":<filename>") };
static int xioopen_gopen(int argc, const char *argv[], struct opt *opts, int xioflags, xiofile_t *fd, groups_t groups, int dummy1, int dummy2, int dummy3) { static int xioopen_gopen(int argc, const char *argv[], struct opt *opts, int xioflags, xiofile_t *fd, groups_t groups, int dummy1, int dummy2, int dummy3) {
const char *filename = argv[1]; const char *filename = argv[1];

View file

@ -5,6 +5,6 @@
#ifndef __xio_gopen_h_included #ifndef __xio_gopen_h_included
#define __xio_gopen_h_included 1 #define __xio_gopen_h_included 1
extern const struct addrdesc addr_gopen; extern const struct addrdesc xioaddr_gopen;
#endif /* !defined(__xio_gopen_h_included) */ #endif /* !defined(__xio_gopen_h_included) */

View file

@ -19,7 +19,7 @@ int xioopen_interface(int argc, const char *argv[], struct opt *opts,
int xioflags, xiofile_t *xfd, groups_t groups, int pf, int xioflags, xiofile_t *xfd, groups_t groups, int pf,
int dummy2, int dummy3); int dummy2, int dummy3);
const struct addrdesc xioaddr_interface= { "interface", 3, xioopen_interface, GROUP_FD|GROUP_SOCKET, PF_PACKET, 0, 0 HELP(":<interface>") }; const struct addrdesc xioaddr_interface= { "INTERFACE", 3, xioopen_interface, GROUP_FD|GROUP_SOCKET, PF_PACKET, 0, 0 HELP(":<interface>") };
static static

View file

@ -62,7 +62,7 @@ static int openssl_delete_cert_info(void);
/* description record for ssl connect */ /* description record for ssl connect */
const struct addrdesc xioaddr_openssl = { const struct addrdesc xioaddr_openssl = {
"openssl", /* keyword for selecting this address type in xioopen calls "OPENSSL", /* keyword for selecting this address type in xioopen calls
(canonical or main name) */ (canonical or main name) */
3, /* data flow directions this address supports on API layer: 3, /* data flow directions this address supports on API layer:
1..read, 2..write, 3..both */ 1..read, 2..write, 3..both */
@ -83,7 +83,7 @@ const struct addrdesc xioaddr_openssl = {
#if WITH_LISTEN #if WITH_LISTEN
/* description record for ssl listen */ /* description record for ssl listen */
const struct addrdesc xioaddr_openssl_listen = { const struct addrdesc xioaddr_openssl_listen = {
"openssl-listen", /* keyword for selecting this address type in xioopen calls "OPENSSL-LISTEN", /* keyword for selecting this address type in xioopen calls
(canonical or main name) */ (canonical or main name) */
3, /* data flow directions this address supports on API layer: 3, /* data flow directions this address supports on API layer:
1..read, 2..write, 3..both */ 1..read, 2..write, 3..both */
@ -102,9 +102,9 @@ const struct addrdesc xioaddr_openssl_listen = {
} ; } ;
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */
const struct addrdesc xioaddr_openssl_dtls_client = { "openssl-dtls-client", 3, xioopen_openssl_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_CHILD|GROUP_OPENSSL|GROUP_RETRY, 1, 0, 0 HELP(":<host>:<port>") } ; const struct addrdesc xioaddr_openssl_dtls_client = { "OPENSSL-DTLS-CLIENT", 3, xioopen_openssl_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_CHILD|GROUP_OPENSSL|GROUP_RETRY, 1, 0, 0 HELP(":<host>:<port>") } ;
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc xioaddr_openssl_dtls_server = { "openssl-dtls-server", 3, xioopen_openssl_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_OPENSSL|GROUP_RETRY, 1, 0, 0 HELP(":<port>") } ; const struct addrdesc xioaddr_openssl_dtls_server = { "OPENSSL-DTLS-SERVER", 3, xioopen_openssl_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_OPENSSL|GROUP_RETRY, 1, 0, 0 HELP(":<port>") } ;
#endif #endif
/* both client and server */ /* both client and server */

View file

@ -16,7 +16,7 @@ static int xioopen_fifo(int argc, const char *argv[], struct opt *opts, int xiof
static int xioopen_fifo_unnamed(xiofile_t *sock, struct opt *opts); static int xioopen_fifo_unnamed(xiofile_t *sock, struct opt *opts);
const struct addrdesc addr_pipe = { "pipe", 3, xioopen_fifo, GROUP_FD|GROUP_NAMED|GROUP_OPEN|GROUP_FIFO, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_pipe = { "PIPE", 3, xioopen_fifo, GROUP_FD|GROUP_NAMED|GROUP_OPEN|GROUP_FIFO, 0, 0, 0 HELP("[:<filename>]") };
/* process an unnamed bidirectional "pipe" or "fifo" or "echo" argument with /* process an unnamed bidirectional "pipe" or "fifo" or "echo" argument with

View file

@ -5,7 +5,7 @@
#ifndef __xio_pipe_h_included #ifndef __xio_pipe_h_included
#define __xio_pipe_h_included 1 #define __xio_pipe_h_included 1
const extern struct addrdesc addr_pipe; extern const struct addrdesc xioaddr_pipe;
extern int xioopen_fifo_unnamed(char *arg, xiofile_t *sock); extern int xioopen_fifo_unnamed(char *arg, xiofile_t *sock);

View file

@ -31,7 +31,7 @@ const struct optdesc opt_proxy_resolve = { "proxy-resolve", "resolve", OPT_P
const struct optdesc opt_proxy_authorization = { "proxy-authorization", "proxyauth", OPT_PROXY_AUTHORIZATION, GROUP_HTTP, PH_LATE, TYPE_STRING, OFUNC_SPEC }; const struct optdesc opt_proxy_authorization = { "proxy-authorization", "proxyauth", OPT_PROXY_AUTHORIZATION, GROUP_HTTP, PH_LATE, TYPE_STRING, OFUNC_SPEC };
const struct optdesc opt_proxy_authorization_file = { "proxy-authorization-file", "proxyauthfile", OPT_PROXY_AUTHORIZATION_FILE, GROUP_HTTP, PH_LATE, TYPE_STRING, OFUNC_SPEC }; const struct optdesc opt_proxy_authorization_file = { "proxy-authorization-file", "proxyauthfile", OPT_PROXY_AUTHORIZATION_FILE, GROUP_HTTP, PH_LATE, TYPE_STRING, OFUNC_SPEC };
const struct addrdesc addr_proxy_connect = { "proxy", 3, xioopen_proxy_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_HTTP|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<proxy-server>:<host>:<port>") }; const struct addrdesc xioaddr_proxy_connect = { "PROXY", 3, xioopen_proxy_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_HTTP|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<proxy-server>:<host>:<port>") };
/*0#define CONNLEN 40*/ /* "CONNECT 123.156.189.123:65432 HTTP/1.0\r\n\0" */ /*0#define CONNLEN 40*/ /* "CONNECT 123.156.189.123:65432 HTTP/1.0\r\n\0" */

View file

@ -21,7 +21,7 @@ extern const struct optdesc opt_proxy_resolve;
extern const struct optdesc opt_proxy_authorization; extern const struct optdesc opt_proxy_authorization;
extern const struct optdesc opt_proxy_authorization_file; extern const struct optdesc opt_proxy_authorization_file;
extern const struct addrdesc addr_proxy_connect; extern const struct addrdesc xioaddr_proxy_connect;
int _xioopen_proxy_prepare(struct proxyvars *proxyvars, struct opt *opts, int _xioopen_proxy_prepare(struct proxyvars *proxyvars, struct opt *opts,
const char *targetname, const char *targetport); const char *targetname, const char *targetport);

View file

@ -20,7 +20,7 @@
static int xioopen_pty(int argc, const char *argv[], struct opt *opts, int xioflags, xiofile_t *fd, groups_t groups, int dummy1, int dummy2, int dummy3); static int xioopen_pty(int argc, const char *argv[], struct opt *opts, int xioflags, xiofile_t *fd, groups_t groups, int dummy1, int dummy2, int dummy3);
const struct addrdesc addr_pty = { "pty", 3, xioopen_pty, GROUP_NAMED|GROUP_FD|GROUP_TERMIOS|GROUP_PTY, 0, 0, 0 HELP("") }; const struct addrdesc xioaddr_pty = { "PTY", 3, xioopen_pty, GROUP_NAMED|GROUP_FD|GROUP_TERMIOS|GROUP_PTY, 0, 0, 0 HELP("") };
const struct optdesc opt_symbolic_link = { "symbolic-link", "link", OPT_SYMBOLIC_LINK, GROUP_PTY, PH_LATE, TYPE_FILENAME, OFUNC_SPEC, 0, 0 }; const struct optdesc opt_symbolic_link = { "symbolic-link", "link", OPT_SYMBOLIC_LINK, GROUP_PTY, PH_LATE, TYPE_FILENAME, OFUNC_SPEC, 0, 0 };
#if HAVE_POLL #if HAVE_POLL

View file

@ -5,7 +5,7 @@
#ifndef __xio_pty_h_included #ifndef __xio_pty_h_included
#define __xio_pty_h_included 1 #define __xio_pty_h_included 1
extern const struct addrdesc addr_pty; extern const struct addrdesc xioaddr_pty;
extern const struct optdesc opt_symbolic_link; extern const struct optdesc opt_symbolic_link;
#if HAVE_POLL #if HAVE_POLL

View file

@ -39,23 +39,23 @@ int _xioopen_rawip_sendto(const char *hostname, const char *protname,
struct opt *opts, int xioflags, struct opt *opts, int xioflags,
xiofile_t *xxfd, groups_t groups, int *pf); xiofile_t *xxfd, groups_t groups, int *pf);
const struct addrdesc addr_rawip_sendto = { "ip-sendto", 3, xioopen_rawip_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6, PF_UNSPEC, 0, 0 HELP(":<host>:<protocol>") }; const struct addrdesc xioaddr_rawip_sendto = { "IP-SENDTO", 3, xioopen_rawip_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6, PF_UNSPEC, 0, 0 HELP(":<host>:<protocol>") };
const struct addrdesc addr_rawip_datagram= { "ip-datagram", 3, xioopen_rawip_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_RANGE, PF_UNSPEC, 0, 0 HELP(":<host>:<protocol>") }; const struct addrdesc xioaddr_rawip_datagram= { "IP-DATAGRAM", 3, xioopen_rawip_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_RANGE, PF_UNSPEC, 0, 0 HELP(":<host>:<protocol>") };
const struct addrdesc addr_rawip_recvfrom= { "ip-recvfrom", 3, xioopen_rawip_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_CHILD|GROUP_RANGE, PF_UNSPEC, SOCK_RAW, 0 HELP(":<protocol>") }; const struct addrdesc xioaddr_rawip_recvfrom= { "IP-RECVFROM", 3, xioopen_rawip_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_CHILD|GROUP_RANGE, PF_UNSPEC, SOCK_RAW, 0 HELP(":<protocol>") };
const struct addrdesc addr_rawip_recv = { "ip-recv", 1, xioopen_rawip_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_RANGE, PF_UNSPEC, SOCK_RAW, 0 HELP(":<protocol>") }; const struct addrdesc xioaddr_rawip_recv = { "IP-RECV", 1, xioopen_rawip_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_RANGE, PF_UNSPEC, SOCK_RAW, 0 HELP(":<protocol>") };
#if WITH_IP4 #if WITH_IP4
const struct addrdesc addr_rawip4_sendto = { "ip4-sendto", 3, xioopen_rawip_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4, PF_INET, 0, 0 HELP(":<host>:<protocol>") }; const struct addrdesc xioaddr_rawip4_sendto = { "IP4-SENDTO", 3, xioopen_rawip_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4, PF_INET, 0, 0 HELP(":<host>:<protocol>") };
const struct addrdesc addr_rawip4_datagram= { "ip4-datagram", 3, xioopen_rawip_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_RANGE, PF_INET, 0, 0 HELP(":<host>:<protocol>") }; const struct addrdesc xioaddr_rawip4_datagram= { "IP4-DATAGRAM", 3, xioopen_rawip_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_RANGE, PF_INET, 0, 0 HELP(":<host>:<protocol>") };
const struct addrdesc addr_rawip4_recvfrom= { "ip4-recvfrom", 3, xioopen_rawip_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_CHILD|GROUP_RANGE, PF_INET, SOCK_RAW, 0 HELP(":<protocol>") }; const struct addrdesc xioaddr_rawip4_recvfrom= { "IP4-RECVFROM", 3, xioopen_rawip_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_CHILD|GROUP_RANGE, PF_INET, SOCK_RAW, 0 HELP(":<protocol>") };
const struct addrdesc addr_rawip4_recv = { "ip4-recv", 1, xioopen_rawip_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_RANGE, PF_INET, SOCK_RAW, 0 HELP(":<protocol>") }; const struct addrdesc xioaddr_rawip4_recv = { "IP4-RECV", 1, xioopen_rawip_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_RANGE, PF_INET, SOCK_RAW, 0 HELP(":<protocol>") };
#endif #endif
#if WITH_IP6 #if WITH_IP6
const struct addrdesc addr_rawip6_sendto = { "ip6-sendto", 3, xioopen_rawip_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6, PF_INET6, 0, 0 HELP(":<host>:<protocol>") }; const struct addrdesc xioaddr_rawip6_sendto = { "IP6-SENDTO", 3, xioopen_rawip_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6, PF_INET6, 0, 0 HELP(":<host>:<protocol>") };
const struct addrdesc addr_rawip6_datagram= { "ip6-datagram", 3, xioopen_rawip_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_RANGE, PF_INET6, 0, 0 HELP(":<host>:<protocol>") }; const struct addrdesc xioaddr_rawip6_datagram= { "IP6-DATAGRAM", 3, xioopen_rawip_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_RANGE, PF_INET6, 0, 0 HELP(":<host>:<protocol>") };
const struct addrdesc addr_rawip6_recvfrom= { "ip6-recvfrom", 3, xioopen_rawip_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_CHILD|GROUP_RANGE, PF_INET6, SOCK_RAW, 0 HELP(":<protocol>") }; const struct addrdesc xioaddr_rawip6_recvfrom= { "IP6-RECVFROM", 3, xioopen_rawip_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_CHILD|GROUP_RANGE, PF_INET6, SOCK_RAW, 0 HELP(":<protocol>") };
const struct addrdesc addr_rawip6_recv = { "ip6-recv", 1, xioopen_rawip_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_RANGE, PF_INET6, SOCK_RAW, 0 HELP(":<protocol>") }; const struct addrdesc xioaddr_rawip6_recv = { "IP6-RECV", 1, xioopen_rawip_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_RANGE, PF_INET6, SOCK_RAW, 0 HELP(":<protocol>") };
#endif #endif

View file

@ -5,17 +5,17 @@
#ifndef __xio_rawip_h_included #ifndef __xio_rawip_h_included
#define __xio_rawip_h_included 1 #define __xio_rawip_h_included 1
extern const struct addrdesc addr_rawip_sendto; extern const struct addrdesc xioaddr_rawip_sendto;
extern const struct addrdesc addr_rawip_datagram; extern const struct addrdesc xioaddr_rawip_datagram;
extern const struct addrdesc addr_rawip_recvfrom; extern const struct addrdesc xioaddr_rawip_recvfrom;
extern const struct addrdesc addr_rawip_recv; extern const struct addrdesc xioaddr_rawip_recv;
extern const struct addrdesc addr_rawip4_sendto; extern const struct addrdesc xioaddr_rawip4_sendto;
extern const struct addrdesc addr_rawip4_datagram; extern const struct addrdesc xioaddr_rawip4_datagram;
extern const struct addrdesc addr_rawip4_recvfrom; extern const struct addrdesc xioaddr_rawip4_recvfrom;
extern const struct addrdesc addr_rawip4_recv; extern const struct addrdesc xioaddr_rawip4_recv;
extern const struct addrdesc addr_rawip6_sendto; extern const struct addrdesc xioaddr_rawip6_sendto;
extern const struct addrdesc addr_rawip6_datagram; extern const struct addrdesc xioaddr_rawip6_datagram;
extern const struct addrdesc addr_rawip6_recvfrom; extern const struct addrdesc xioaddr_rawip6_recvfrom;
extern const struct addrdesc addr_rawip6_recv; extern const struct addrdesc xioaddr_rawip6_recv;
#endif /* !defined(__xio_rawip_h_included) */ #endif /* !defined(__xio_rawip_h_included) */

View file

@ -30,7 +30,7 @@ static int xioopen_readline(int argc, const char *argv[], struct opt *opts,
int dummy1, int dummy2, int dummy3); int dummy1, int dummy2, int dummy3);
const struct addrdesc addr_readline = { "readline", 3, xioopen_readline, GROUP_FD|GROUP_TERMIOS|GROUP_READLINE, 0, 0, 0 HELP(NULL) }; const struct addrdesc xioaddr_readline = { "READLINE", 3, xioopen_readline, GROUP_FD|GROUP_TERMIOS|GROUP_READLINE, 0, 0, 0 HELP(NULL) };
const struct optdesc opt_history_file = { "history-file", "history", OPT_HISTORY_FILE, GROUP_READLINE, PH_LATE, TYPE_STRING, OFUNC_OFFSET, XIO_OFFSETOF(para.readline.history_file) }; const struct optdesc opt_history_file = { "history-file", "history", OPT_HISTORY_FILE, GROUP_READLINE, PH_LATE, TYPE_STRING, OFUNC_OFFSET, XIO_OFFSETOF(para.readline.history_file) };
const struct optdesc opt_prompt = { "prompt", NULL, OPT_PROMPT, GROUP_READLINE, PH_LATE, TYPE_STRING, OFUNC_OFFSET, XIO_OFFSETOF(para.readline.prompt) }; const struct optdesc opt_prompt = { "prompt", NULL, OPT_PROMPT, GROUP_READLINE, PH_LATE, TYPE_STRING, OFUNC_OFFSET, XIO_OFFSETOF(para.readline.prompt) };

View file

@ -5,7 +5,7 @@
#ifndef __xio_readline_h_included #ifndef __xio_readline_h_included
#define __xio_readline_h_included 1 #define __xio_readline_h_included 1
extern const struct addrdesc addr_readline; extern const struct addrdesc xioaddr_readline;
extern const struct optdesc opt_history_file; extern const struct optdesc opt_history_file;
extern const struct optdesc opt_prompt; extern const struct optdesc opt_prompt;

View file

@ -17,23 +17,23 @@
/****** SCTP addresses ******/ /****** SCTP addresses ******/
#if WITH_IP4 || WITH_IP6 #if WITH_IP4 || WITH_IP6
const struct addrdesc addr_sctp_connect = { "sctp-connect", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_SCTP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_UNSPEC HELP(":<host>:<port>") }; const struct addrdesc xioaddr_sctp_connect = { "SCTP-CONNECT", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_SCTP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_UNSPEC HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_sctp_listen = { "sctp-listen", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_SCTP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_UNSPEC HELP(":<port>") }; const struct addrdesc xioaddr_sctp_listen = { "SCTP-LISTEN", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_SCTP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_UNSPEC HELP(":<port>") };
#endif #endif
#endif #endif
#if WITH_IP4 #if WITH_IP4
const struct addrdesc addr_sctp4_connect = { "sctp4-connect", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_SCTP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_INET HELP(":<host>:<port>") }; const struct addrdesc xioaddr_sctp4_connect = { "SCTP4-CONNECT", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_SCTP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_INET HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_sctp4_listen = { "sctp4-listen", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_SCTP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_INET HELP(":<port>") }; const struct addrdesc xioaddr_sctp4_listen = { "SCTP4-LISTEN", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_SCTP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_INET HELP(":<port>") };
#endif #endif
#endif /* WITH_IP4 */ #endif /* WITH_IP4 */
#if WITH_IP6 #if WITH_IP6
const struct addrdesc addr_sctp6_connect = { "sctp6-connect", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_SCTP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_INET6 HELP(":<host>:<port>") }; const struct addrdesc xioaddr_sctp6_connect = { "SCTP6-CONNECT", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_SCTP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_INET6 HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_sctp6_listen = { "sctp6-listen", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_SCTP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_INET6 HELP(":<port>") }; const struct addrdesc xioaddr_sctp6_listen = { "SCTP6-LISTEN", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_SCTP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_SCTP, PF_INET6 HELP(":<port>") };
#endif #endif
#endif /* WITH_IP6 */ #endif /* WITH_IP6 */

View file

@ -5,12 +5,12 @@
#ifndef __xio_sctp_h_included #ifndef __xio_sctp_h_included
#define __xio_sctp_h_included 1 #define __xio_sctp_h_included 1
extern const struct addrdesc addr_sctp_connect; extern const struct addrdesc xioaddr_sctp_connect;
extern const struct addrdesc addr_sctp_listen; extern const struct addrdesc xioaddr_sctp_listen;
extern const struct addrdesc addr_sctp4_connect; extern const struct addrdesc xioaddr_sctp4_connect;
extern const struct addrdesc addr_sctp4_listen; extern const struct addrdesc xioaddr_sctp4_listen;
extern const struct addrdesc addr_sctp6_connect; extern const struct addrdesc xioaddr_sctp6_connect;
extern const struct addrdesc addr_sctp6_listen; extern const struct addrdesc xioaddr_sctp6_listen;
extern const struct optdesc opt_sctp_nodelay; extern const struct optdesc opt_sctp_nodelay;
extern const struct optdesc opt_sctp_maxseg; extern const struct optdesc opt_sctp_maxseg;

View file

@ -78,14 +78,14 @@ static int xiobind(
#if WITH_GENERICSOCKET #if WITH_GENERICSOCKET
/* generic socket addresses */ /* generic socket addresses */
const struct addrdesc xioaddr_socket_connect = { "socket-connect", 1, xioopen_socket_connect, GROUP_FD|GROUP_SOCKET|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<domain>:<protocol>:<remote-address>") }; const struct addrdesc xioaddr_socket_connect = { "SOCKET-CONNECT", 1, xioopen_socket_connect, GROUP_FD|GROUP_SOCKET|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<domain>:<protocol>:<remote-address>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc xioaddr_socket_listen = { "socket-listen", 1, xioopen_socket_listen, GROUP_FD|GROUP_SOCKET|GROUP_LISTEN|GROUP_RANGE|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<domain>:<protocol>:<local-address>") }; const struct addrdesc xioaddr_socket_listen = { "SOCKET-LISTEN", 1, xioopen_socket_listen, GROUP_FD|GROUP_SOCKET|GROUP_LISTEN|GROUP_RANGE|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<domain>:<protocol>:<local-address>") };
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */
const struct addrdesc xioaddr_socket_sendto = { "socket-sendto", 3, xioopen_socket_sendto, GROUP_FD|GROUP_SOCKET, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<remote-address>") }; const struct addrdesc xioaddr_socket_sendto = { "SOCKET-SENDTO", 3, xioopen_socket_sendto, GROUP_FD|GROUP_SOCKET, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<remote-address>") };
const struct addrdesc xioaddr_socket_datagram= { "socket-datagram", 3, xioopen_socket_datagram, GROUP_FD|GROUP_SOCKET|GROUP_RANGE, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<remote-address>") }; const struct addrdesc xioaddr_socket_datagram= { "SOCKET-DATAGRAM", 3, xioopen_socket_datagram, GROUP_FD|GROUP_SOCKET|GROUP_RANGE, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<remote-address>") };
const struct addrdesc xioaddr_socket_recvfrom= { "socket-recvfrom", 3, xioopen_socket_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_RANGE|GROUP_CHILD, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<local-address>") }; const struct addrdesc xioaddr_socket_recvfrom= { "SOCKET-RECVFROM", 3, xioopen_socket_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_RANGE|GROUP_CHILD, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<local-address>") };
const struct addrdesc xioaddr_socket_recv = { "socket-recv", 1, xioopen_socket_recv, GROUP_FD|GROUP_SOCKET|GROUP_RANGE, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<local-address>") }; const struct addrdesc xioaddr_socket_recv = { "SOCKET-RECV", 1, xioopen_socket_recv, GROUP_FD|GROUP_SOCKET|GROUP_RANGE, 0, 0, 0 HELP(":<domain>:<type>:<protocol>:<local-address>") };
#endif /* WITH_GENERICSOCKET */ #endif /* WITH_GENERICSOCKET */

View file

@ -35,9 +35,9 @@ static int xioopen_socks4_connect(int argc, const char *argv[], struct opt *opts
const struct optdesc opt_socksport = { "socksport", NULL, OPT_SOCKSPORT, GROUP_IP_SOCKS4, PH_LATE, TYPE_STRING, OFUNC_SPEC }; const struct optdesc opt_socksport = { "socksport", NULL, OPT_SOCKSPORT, GROUP_IP_SOCKS4, PH_LATE, TYPE_STRING, OFUNC_SPEC };
const struct optdesc opt_socksuser = { "socksuser", NULL, OPT_SOCKSUSER, GROUP_IP_SOCKS4, PH_LATE, TYPE_NAME, OFUNC_SPEC }; const struct optdesc opt_socksuser = { "socksuser", NULL, OPT_SOCKSUSER, GROUP_IP_SOCKS4, PH_LATE, TYPE_NAME, OFUNC_SPEC };
const struct addrdesc addr_socks4_connect = { "socks4", 3, xioopen_socks4_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_IP_SOCKS4|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<socks-server>:<host>:<port>") }; const struct addrdesc xioaddr_socks4_connect = { "SOCKS4", 3, xioopen_socks4_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_IP_SOCKS4|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<socks-server>:<host>:<port>") };
const struct addrdesc addr_socks4a_connect = { "socks4a", 3, xioopen_socks4_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_IP_SOCKS4|GROUP_CHILD|GROUP_RETRY, 1, 0, 0 HELP(":<socks-server>:<host>:<port>") }; const struct addrdesc xioaddr_socks4a_connect = { "SOCKS4A", 3, xioopen_socks4_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_IP_SOCKS4|GROUP_CHILD|GROUP_RETRY, 1, 0, 0 HELP(":<socks-server>:<host>:<port>") };
static int xioopen_socks4_connect(int argc, const char *argv[], struct opt *opts, static int xioopen_socks4_connect(int argc, const char *argv[], struct opt *opts,
int xioflags, xiofile_t *xxfd, int xioflags, xiofile_t *xxfd,

View file

@ -17,8 +17,8 @@ struct socks4 {
extern const struct optdesc opt_socksport; extern const struct optdesc opt_socksport;
extern const struct optdesc opt_socksuser; extern const struct optdesc opt_socksuser;
extern const struct addrdesc addr_socks4_connect; extern const struct addrdesc xioaddr_socks4_connect;
extern const struct addrdesc addr_socks4a_connect; extern const struct addrdesc xioaddr_socks4a_connect;
extern int _xioopen_socks4_prepare(const char *targetport, struct opt *opts, char **socksport, struct socks4 *sockhead, size_t *headlen); extern int _xioopen_socks4_prepare(const char *targetport, struct opt *opts, char **socksport, struct socks4 *sockhead, size_t *headlen);
extern int extern int

View file

@ -20,17 +20,17 @@ static int xioopen_stdfd(int argc, const char *argv[], struct opt *opts, int xio
/* we specify all option groups that we can imagine for a FD, becasue the /* we specify all option groups that we can imagine for a FD, becasue the
changed parsing mechanism does not allow us to check the type of FD before changed parsing mechanism does not allow us to check the type of FD before
applying the options */ applying the options */
const struct addrdesc addr_stdio = { "stdio", 3, xioopen_stdio, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 0, 0, 0 HELP(NULL) }; const struct addrdesc xioaddr_stdio = { "STDIO", 3, xioopen_stdio, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 0, 0, 0 HELP(NULL) };
const struct addrdesc addr_stdin = { "stdin", 1, xioopen_stdfd, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 0, 0, 0 HELP(NULL) }; const struct addrdesc xioaddr_stdin = { "STDIN", 1, xioopen_stdfd, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 0, 0, 0 HELP(NULL) };
const struct addrdesc addr_stdout = { "stdout", 2, xioopen_stdfd, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 1, 0, 0 HELP(NULL) }; const struct addrdesc xioaddr_stdout = { "STDOUT", 2, xioopen_stdfd, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 1, 0, 0 HELP(NULL) };
const struct addrdesc addr_stderr = { "stderr", 2, xioopen_stdfd, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 2, 0, 0 HELP(NULL) }; const struct addrdesc xioaddr_stderr = { "STDERR", 2, xioopen_stdfd, GROUP_FD|GROUP_FIFO|GROUP_CHR|GROUP_BLK|GROUP_FILE|GROUP_SOCKET|GROUP_TERMIOS|GROUP_SOCK_UNIX|GROUP_SOCK_IP|GROUP_IPAPP, 2, 0, 0 HELP(NULL) };
/* process a bidirectional "stdio" or "-" argument with options. /* process a bidirectional "stdio" or "-" argument with options.
generate a dual address. */ generate a dual address. */
int xioopen_stdio_bi(xiofile_t *sock) { int xioopen_stdio_bi(xiofile_t *sock) {
struct opt *optspr; struct opt *optspr;
groups_t groups1 = addr_stdio.groups; groups_t groups1 = xioaddr_stdio.groups;
int result; int result;
if (xioopen_makedual(sock) < 0) { if (xioopen_makedual(sock) < 0) {

View file

@ -9,9 +9,9 @@
extern int xioopen_stdio_bi(xiofile_t *sock); extern int xioopen_stdio_bi(xiofile_t *sock);
extern const struct addrdesc addr_stdio; extern const struct addrdesc xioaddr_stdio;
extern const struct addrdesc addr_stdin; extern const struct addrdesc xioaddr_stdin;
extern const struct addrdesc addr_stdout; extern const struct addrdesc xioaddr_stdout;
extern const struct addrdesc addr_stderr; extern const struct addrdesc xioaddr_stderr;
#endif /* !defined(__xio_stdio_h_included) */ #endif /* !defined(__xio_stdio_h_included) */

View file

@ -20,7 +20,7 @@ static int xioopen_system(int arg, const char *argv[], struct opt *opts,
int dummy1, int dummy2, int dummy3 int dummy1, int dummy2, int dummy3
); );
const struct addrdesc addr_system = { "system", 3, xioopen_system, GROUP_FD|GROUP_FORK|GROUP_EXEC|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_TERMIOS|GROUP_FIFO|GROUP_PTY|GROUP_PARENT, 1, 0, 0 HELP(":<shell-command>") }; const struct addrdesc xioaddr_system = { "SYSTEM", 3, xioopen_system, GROUP_FD|GROUP_FORK|GROUP_EXEC|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_TERMIOS|GROUP_FIFO|GROUP_PTY|GROUP_PARENT, 1, 0, 0 HELP(":<shell-command>") };
static int xioopen_system(int argc, const char *argv[], struct opt *opts, static int xioopen_system(int argc, const char *argv[], struct opt *opts,

View file

@ -5,6 +5,6 @@
#ifndef __xio_system_h_included #ifndef __xio_system_h_included
#define __xio_system_h_included 1 #define __xio_system_h_included 1
extern const struct addrdesc addr_system; extern const struct addrdesc xioaddr_system;
#endif /* !defined(__xio_system_h_included) */ #endif /* !defined(__xio_system_h_included) */

View file

@ -17,23 +17,23 @@
/****** TCP addresses ******/ /****** TCP addresses ******/
#if WITH_IP4 || WITH_IP6 #if WITH_IP4 || WITH_IP6
const struct addrdesc addr_tcp_connect = { "tcp-connect", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_UNSPEC HELP(":<host>:<port>") }; const struct addrdesc xioaddr_tcp_connect = { "TCP-CONNECT", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_UNSPEC HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_tcp_listen = { "tcp-listen", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_UNSPEC HELP(":<port>") }; const struct addrdesc xioaddr_tcp_listen = { "TCP-LISTEN", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_UNSPEC HELP(":<port>") };
#endif #endif
#endif #endif
#if WITH_IP4 #if WITH_IP4
const struct addrdesc addr_tcp4_connect = { "tcp4-connect", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_TCP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_INET HELP(":<host>:<port>") }; const struct addrdesc xioaddr_tcp4_connect = { "TCP4-CONNECT", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_TCP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_INET HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_tcp4_listen = { "tcp4-listen", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_TCP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_INET HELP(":<port>") }; const struct addrdesc xioaddr_tcp4_listen = { "TCP4-LISTEN", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_TCP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_INET HELP(":<port>") };
#endif #endif
#endif /* WITH_IP4 */ #endif /* WITH_IP4 */
#if WITH_IP6 #if WITH_IP6
const struct addrdesc addr_tcp6_connect = { "tcp6-connect", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_INET6 HELP(":<host>:<port>") }; const struct addrdesc xioaddr_tcp6_connect = { "TCP6-CONNECT", 1+XIO_RDWR, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_CHILD|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_INET6 HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_tcp6_listen = { "tcp6-listen", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_INET6 HELP(":<port>") }; const struct addrdesc xioaddr_tcp6_listen = { "TCP6-LISTEN", 1+XIO_RDWR, xioopen_ipapp_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_TCP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE|GROUP_RETRY, SOCK_STREAM, IPPROTO_TCP, PF_INET6 HELP(":<port>") };
#endif #endif
#endif /* WITH_IP6 */ #endif /* WITH_IP6 */

View file

@ -5,12 +5,12 @@
#ifndef __xio_tcp_h_included #ifndef __xio_tcp_h_included
#define __xio_tcp_h_included 1 #define __xio_tcp_h_included 1
extern const struct addrdesc addr_tcp_connect; extern const struct addrdesc xioaddr_tcp_connect;
extern const struct addrdesc addr_tcp_listen; extern const struct addrdesc xioaddr_tcp_listen;
extern const struct addrdesc addr_tcp4_connect; extern const struct addrdesc xioaddr_tcp4_connect;
extern const struct addrdesc addr_tcp4_listen; extern const struct addrdesc xioaddr_tcp4_listen;
extern const struct addrdesc addr_tcp6_connect; extern const struct addrdesc xioaddr_tcp6_connect;
extern const struct addrdesc addr_tcp6_listen; extern const struct addrdesc xioaddr_tcp6_listen;
extern const struct optdesc opt_tcp_nodelay; extern const struct optdesc opt_tcp_nodelay;
extern const struct optdesc opt_tcp_maxseg; extern const struct optdesc opt_tcp_maxseg;

View file

@ -44,7 +44,7 @@ const struct optdesc opt_iff_automedia = { "iff-automedia", "automedia", O
const struct optdesc opt_route = { "route", NULL, OPT_ROUTE, GROUP_INTERFACE, PH_INIT, TYPE_STRING, OFUNC_SPEC }; const struct optdesc opt_route = { "route", NULL, OPT_ROUTE, GROUP_INTERFACE, PH_INIT, TYPE_STRING, OFUNC_SPEC };
#endif #endif
const struct addrdesc xioaddr_tun = { "tun", 3, xioopen_tun, GROUP_FD|GROUP_CHR|GROUP_NAMED|GROUP_OPEN|GROUP_TUN, 0, 0, 0 HELP("[:<ip-addr>/<bits>]") }; const struct addrdesc xioaddr_tun = { "TUN", 3, xioopen_tun, GROUP_FD|GROUP_CHR|GROUP_NAMED|GROUP_OPEN|GROUP_TUN, 0, 0, 0 HELP("[:<ip-addr>/<bits>]") };
/* "if-name"=tun3 /* "if-name"=tun3
// "route"=address/netmask // "route"=address/netmask
// "ip6-route"=address/netmask // "ip6-route"=address/netmask

View file

@ -42,35 +42,35 @@ int _xioopen_udp_sendto(const char *hostname, const char *servname,
int xioflags, xiofile_t *xxfd, groups_t groups, int xioflags, xiofile_t *xxfd, groups_t groups,
int pf, int socktype, int ipproto); int pf, int socktype, int ipproto);
const struct addrdesc addr_udp_connect = { "udp-connect", 3, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP, SOCK_DGRAM, IPPROTO_UDP, PF_UNSPEC HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp_connect = { "UDP-CONNECT", 3, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP, SOCK_DGRAM, IPPROTO_UDP, PF_UNSPEC HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_udp_listen = { "udp-listen", 3, xioopen_ipdgram_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE, PF_UNSPEC, IPPROTO_UDP, PF_UNSPEC HELP(":<port>") }; const struct addrdesc xioaddr_udp_listen = { "UDP-LISTEN", 3, xioopen_ipdgram_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE, PF_UNSPEC, IPPROTO_UDP, PF_UNSPEC HELP(":<port>") };
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */
const struct addrdesc addr_udp_sendto = { "udp-sendto", 3, xioopen_udp_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP, PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp_sendto = { "UDP-SENDTO", 3, xioopen_udp_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP, PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") };
const struct addrdesc addr_udp_recvfrom = { "udp-recvfrom", 3, xioopen_udp_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_CHILD|GROUP_RANGE, PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") }; const struct addrdesc xioaddr_udp_recvfrom = { "UDP-RECVFROM", 3, xioopen_udp_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_CHILD|GROUP_RANGE, PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") };
const struct addrdesc addr_udp_recv = { "udp-recv", 1, xioopen_udp_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_RANGE, PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") }; const struct addrdesc xioaddr_udp_recv = { "UDP-RECV", 1, xioopen_udp_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_RANGE, PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") };
const struct addrdesc addr_udp_datagram = { "udp-datagram", 3, xioopen_udp_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_RANGE, PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp_datagram = { "UDP-DATAGRAM", 3, xioopen_udp_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_RANGE, PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") };
#if WITH_IP4 #if WITH_IP4
const struct addrdesc addr_udp4_connect = { "udp4-connect", 3, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP, SOCK_DGRAM, IPPROTO_UDP, PF_INET HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp4_connect = { "UDP4-CONNECT", 3, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP, SOCK_DGRAM, IPPROTO_UDP, PF_INET HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_udp4_listen = { "udp4-listen", 3, xioopen_ipdgram_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE, PF_INET, IPPROTO_UDP, PF_INET HELP(":<port>") }; const struct addrdesc xioaddr_udp4_listen = { "UDP4-LISTEN", 3, xioopen_ipdgram_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE, PF_INET, IPPROTO_UDP, PF_INET HELP(":<port>") };
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */
const struct addrdesc addr_udp4_sendto = { "udp4-sendto", 3, xioopen_udp_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP, PF_INET, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp4_sendto = { "UDP4-SENDTO", 3, xioopen_udp_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP, PF_INET, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") };
const struct addrdesc addr_udp4_datagram = { "udp4-datagram",3, xioopen_udp_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP|GROUP_RANGE, PF_INET, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp4_datagram = { "UDP4-DATAGRAM",3, xioopen_udp_datagram, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP|GROUP_RANGE, PF_INET, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") };
const struct addrdesc addr_udp4_recvfrom= { "udp4-recvfrom", 3, xioopen_udp_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP|GROUP_CHILD|GROUP_RANGE, PF_INET, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") }; const struct addrdesc xioaddr_udp4_recvfrom = { "UDP4-RECVFROM", 3, xioopen_udp_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP|GROUP_CHILD|GROUP_RANGE, PF_INET, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") };
const struct addrdesc addr_udp4_recv = { "udp4-recv", 1, xioopen_udp_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP|GROUP_RANGE, PF_INET, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") }; const struct addrdesc xioaddr_udp4_recv = { "UDP4-RECV", 1, xioopen_udp_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP4|GROUP_IP_UDP|GROUP_RANGE, PF_INET, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") };
#endif /* WITH_IP4 */ #endif /* WITH_IP4 */
#if WITH_IP6 #if WITH_IP6
const struct addrdesc addr_udp6_connect = { "udp6-connect", 3, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP, SOCK_DGRAM, IPPROTO_UDP, PF_INET6 HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp6_connect = { "UDP6-CONNECT", 3, xioopen_ipapp_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP, SOCK_DGRAM, IPPROTO_UDP, PF_INET6 HELP(":<host>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_udp6_listen = { "udp6-listen", 3, xioopen_ipdgram_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE, PF_INET6, IPPROTO_UDP, 0 HELP(":<port>") }; const struct addrdesc xioaddr_udp6_listen = { "UDP6-LISTEN", 3, xioopen_ipdgram_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_LISTEN|GROUP_CHILD|GROUP_RANGE, PF_INET6, IPPROTO_UDP, 0 HELP(":<port>") };
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */
const struct addrdesc addr_udp6_sendto = { "udp6-sendto", 3, xioopen_udp_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP, PF_INET6, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp6_sendto = { "UDP6-SENDTO", 3, xioopen_udp_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP, PF_INET6, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") };
const struct addrdesc addr_udp6_datagram= { "udp6-datagram", 3, xioopen_udp_datagram,GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_RANGE, PF_INET6, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") }; const struct addrdesc xioaddr_udp6_datagram = { "UDP6-DATAGRAM", 3, xioopen_udp_datagram,GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_RANGE, PF_INET6, SOCK_DGRAM, IPPROTO_UDP HELP(":<host>:<port>") };
const struct addrdesc addr_udp6_recvfrom= { "udp6-recvfrom", 3, xioopen_udp_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_CHILD|GROUP_RANGE, PF_INET6, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") }; const struct addrdesc xioaddr_udp6_recvfrom = { "UDP6-RECVFROM", 3, xioopen_udp_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_CHILD|GROUP_RANGE, PF_INET6, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") };
const struct addrdesc addr_udp6_recv = { "udp6-recv", 1, xioopen_udp_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_RANGE, PF_INET6, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") }; const struct addrdesc xioaddr_udp6_recv = { "UDP6-RECV", 1, xioopen_udp_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_IP6|GROUP_IP_UDP|GROUP_RANGE, PF_INET6, SOCK_DGRAM, IPPROTO_UDP HELP(":<port>") };
#endif /* WITH_IP6 */ #endif /* WITH_IP6 */

View file

@ -5,24 +5,24 @@
#ifndef __xio_udp_h_included #ifndef __xio_udp_h_included
#define __xio_udp_h_included 1 #define __xio_udp_h_included 1
extern const struct addrdesc addr_udp_connect; extern const struct addrdesc xioaddr_udp_connect;
extern const struct addrdesc addr_udp_listen; extern const struct addrdesc xioaddr_udp_listen;
extern const struct addrdesc addr_udp_sendto; extern const struct addrdesc xioaddr_udp_sendto;
extern const struct addrdesc addr_udp_datagram; extern const struct addrdesc xioaddr_udp_datagram;
extern const struct addrdesc addr_udp_recvfrom; extern const struct addrdesc xioaddr_udp_recvfrom;
extern const struct addrdesc addr_udp_recv; extern const struct addrdesc xioaddr_udp_recv;
extern const struct addrdesc addr_udp4_connect; extern const struct addrdesc xioaddr_udp4_connect;
extern const struct addrdesc addr_udp4_listen; extern const struct addrdesc xioaddr_udp4_listen;
extern const struct addrdesc addr_udp4_sendto; extern const struct addrdesc xioaddr_udp4_sendto;
extern const struct addrdesc addr_udp4_datagram; extern const struct addrdesc xioaddr_udp4_datagram;
extern const struct addrdesc addr_udp4_recvfrom; extern const struct addrdesc xioaddr_udp4_recvfrom;
extern const struct addrdesc addr_udp4_recv; extern const struct addrdesc xioaddr_udp4_recv;
extern const struct addrdesc addr_udp6_connect; extern const struct addrdesc xioaddr_udp6_connect;
extern const struct addrdesc addr_udp6_listen; extern const struct addrdesc xioaddr_udp6_listen;
extern const struct addrdesc addr_udp6_sendto; extern const struct addrdesc xioaddr_udp6_sendto;
extern const struct addrdesc addr_udp6_datagram; extern const struct addrdesc xioaddr_udp6_datagram;
extern const struct addrdesc addr_udp6_recvfrom; extern const struct addrdesc xioaddr_udp6_recvfrom;
extern const struct addrdesc addr_udp6_recv; extern const struct addrdesc xioaddr_udp6_recv;
extern int _xioopen_ipdgram_listen(struct single *sfd, extern int _xioopen_ipdgram_listen(struct single *sfd,
int xioflags, union sockaddr_union *us, socklen_t uslen, int xioflags, union sockaddr_union *us, socklen_t uslen,

View file

@ -38,23 +38,23 @@ int xioopen_unix_client(int argc, const char *argv[], struct opt *opts, int xiof
/* the first free parameter is 0 for "normal" unix domain sockets, or 1 for /* the first free parameter is 0 for "normal" unix domain sockets, or 1 for
abstract unix sockets (Linux); the second and third free parameter are abstract unix sockets (Linux); the second and third free parameter are
unsused */ unsused */
const struct addrdesc xioaddr_unix_connect = { "unix-connect", 3, xioopen_unix_connect, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_unix_connect = { "UNIX-CONNECT", 3, xioopen_unix_connect, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc xioaddr_unix_listen = { "unix-listen", 3, xioopen_unix_listen, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_LISTEN|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_unix_listen = { "UNIX-LISTEN", 3, xioopen_unix_listen, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_LISTEN|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") };
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */
const struct addrdesc xioaddr_unix_sendto = { "unix-sendto", 3, xioopen_unix_sendto, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_unix_sendto = { "UNIX-SENDTO", 3, xioopen_unix_sendto, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") };
const struct addrdesc xioaddr_unix_recvfrom= { "unix-recvfrom", 3, xioopen_unix_recvfrom, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY|GROUP_CHILD, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_unix_recvfrom= { "UNIX-RECVFROM", 3, xioopen_unix_recvfrom, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY|GROUP_CHILD, 0, 0, 0 HELP(":<filename>") };
const struct addrdesc xioaddr_unix_recv = { "unix-recv", 1, xioopen_unix_recv, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_unix_recv = { "UNIX-RECV", 1, xioopen_unix_recv, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") };
const struct addrdesc xioaddr_unix_client = { "unix-client", 3, xioopen_unix_client, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_unix_client = { "UNIX-CLIENT", 3, xioopen_unix_client, GROUP_FD|GROUP_NAMED|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 0, 0, 0 HELP(":<filename>") };
#if WITH_ABSTRACT_UNIXSOCKET #if WITH_ABSTRACT_UNIXSOCKET
const struct addrdesc xioaddr_abstract_connect = { "abstract-connect", 3, xioopen_unix_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_abstract_connect = { "ABSTRACT-CONNECT", 3, xioopen_unix_connect, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc xioaddr_abstract_listen = { "abstract-listen", 3, xioopen_unix_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_LISTEN|GROUP_CHILD|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_abstract_listen = { "ABSTRACT-LISTEN", 3, xioopen_unix_listen, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_LISTEN|GROUP_CHILD|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") };
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */
const struct addrdesc xioaddr_abstract_sendto = { "abstract-sendto", 3, xioopen_unix_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_abstract_sendto = { "ABSTRACT-SENDTO", 3, xioopen_unix_sendto, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") };
const struct addrdesc xioaddr_abstract_recvfrom= { "abstract-recvfrom", 3, xioopen_unix_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY|GROUP_CHILD, 1, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_abstract_recvfrom= { "ABSTRACT-RECVFROM", 3, xioopen_unix_recvfrom, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY|GROUP_CHILD, 1, 0, 0 HELP(":<filename>") };
const struct addrdesc xioaddr_abstract_recv = { "abstract-recv", 1, xioopen_unix_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_abstract_recv = { "ABSTRACT-RECV", 1, xioopen_unix_recv, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") };
const struct addrdesc xioaddr_abstract_client = { "abstract-client", 3, xioopen_unix_client, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") }; const struct addrdesc xioaddr_abstract_client = { "ABSTRACT-CLIENT", 3, xioopen_unix_client, GROUP_FD|GROUP_SOCKET|GROUP_SOCK_UNIX|GROUP_RETRY, 1, 0, 0 HELP(":<filename>") };
#endif /* WITH_ABSTRACT_UNIXSOCKET */ #endif /* WITH_ABSTRACT_UNIXSOCKET */
const struct optdesc xioopt_unix_tightsocklen = { "unix-tightsocklen", "tightsocklen", OPT_UNIX_TIGHTSOCKLEN, GROUP_SOCK_UNIX, PH_PREBIND, TYPE_BOOL, OFUNC_OFFSET, XIO_OFFSETOF(para.socket.un.tight), XIO_SIZEOF(para.socket.un.tight) }; const struct optdesc xioopt_unix_tightsocklen = { "unix-tightsocklen", "tightsocklen", OPT_UNIX_TIGHTSOCKLEN, GROUP_SOCK_UNIX, PH_PREBIND, TYPE_BOOL, OFUNC_OFFSET, XIO_OFFSETOF(para.socket.un.tight), XIO_SIZEOF(para.socket.un.tight) };

View file

@ -22,15 +22,9 @@ static int xioopen_vsock_listen(int argc, const char *argv[], struct opt *opts,
static void xiolog_vsock_cid(void); static void xiolog_vsock_cid(void);
const struct addrdesc addr_vsock_connect = { "vsock-connect", 1 + XIO_RDWR, const struct addrdesc xioaddr_vsock_connect = { "VSOCK-CONNECT", 1+XIO_RDWR, xioopen_vsock_connect, GROUP_FD|GROUP_SOCKET|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<cid>:<port>") };
xioopen_vsock_connect,
GROUP_FD|GROUP_SOCKET|GROUP_CHILD|GROUP_RETRY,
0, 0, 0 HELP(":<cid>:<port>") };
#if WITH_LISTEN #if WITH_LISTEN
const struct addrdesc addr_vsock_listen = { "vsock-listen", 1 + XIO_RDWR, const struct addrdesc xioaddr_vsock_listen = { "VSOCK-LISTEN", 1+XIO_RDWR, xioopen_vsock_listen, GROUP_FD|GROUP_SOCKET|GROUP_LISTEN|GROUP_CHILD|GROUP_RETRY, 0, 0, 0 HELP(":<port>") };
xioopen_vsock_listen,
GROUP_FD|GROUP_SOCKET|GROUP_LISTEN|GROUP_CHILD|GROUP_RETRY,
0, 0, 0 HELP(":<port>") };
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */

View file

@ -8,8 +8,8 @@
#if WITH_VSOCK #if WITH_VSOCK
extern const struct addrdesc addr_vsock_connect; extern const struct addrdesc xioaddr_vsock_connect;
extern const struct addrdesc addr_vsock_listen; extern const struct addrdesc xioaddr_vsock_listen;
extern int xiosetsockaddrenv_vsock(int idx, char *namebuff, size_t namelen, extern int xiosetsockaddrenv_vsock(int idx, char *namebuff, size_t namelen,
char *valuebuff, size_t valuelen, char *valuebuff, size_t valuelen,

View file

@ -73,22 +73,40 @@ static char *optionphasenames[] = {
/* print a line about a single option */ /* print a line about a single option */
static int xiohelp_option(FILE *of, const struct optname *on, const char *name) { static int xiohelp_option(FILE *of, const struct optname *on, const char *name) {
int j; int chars;
int i, j;
groups_t groups; groups_t groups;
bool occurred; bool occurred;
fprintf(of, " %s\tgroups=", name); chars = fprintf(of, " %s", name);
groups = on->desc->group; occurred = false; i = (16 - chars + 7) / 8;
for (j = 0; j < 32; ++j) { for (; i > 0; --i) { fputc('\t', of); }
fputc('\t', of);
fputs("groups=", of);
groups = on->desc->group;
occurred = false;
chars = 7;
for (j = 0; j < 8*sizeof(groups_t); ++j) {
if (groups & 1) { if (groups & 1) {
if (occurred) { fputc(',', of); } if (occurred) {
fprintf(of, "%s", addressgroupnames[j]); fputc(',', of);
++chars;
}
fputs(addressgroupnames[j], of);
chars += strlen(addressgroupnames[j]);
occurred = true; occurred = true;
} }
groups >>= 1; groups >>= 1;
} }
fprintf(of, "\tphase=%s", optionphasenames[on->desc->phase]); i = (24 - chars + 7) / 8;
fprintf(of, "\ttype=%s", optiontypenames[on->desc->type]); for (; i > 0; --i) { fputc('\t', of); }
chars = fprintf(of, "phase=%s", optionphasenames[on->desc->phase]);
i = (24 - chars + 7) / 8;
for (; i > 0; --i) { fputc('\t', of); }
fprintf(of, "type=%s", optiontypenames[on->desc->type]);
fputc('\n', of); fputc('\n', of);
return 0; return 0;
} }
@ -102,14 +120,9 @@ int xioopenhelp(FILE *of,
groups_t groups; groups_t groups;
bool occurred; bool occurred;
fputs(" bi-address:\n", of); fputs(" bi-address: /* is an address that may act both as data sync and source */\n", of);
fputs(" pipe[,<opts>]\tgroups=FD,FIFO\n", of);
if (level == 2) {
fputs(" echo is an alias for pipe\n", of);
fputs(" fifo is an alias for pipe\n", of);
}
fputs(" <single-address>!!<single-address>\n", of);
fputs(" <single-address>\n", of); fputs(" <single-address>\n", of);
fputs(" <single-address>!!<single-address>\n", of);
fputs(" single-address:\n", of); fputs(" single-address:\n", of);
fputs(" <address-head>[,<opts>]\n", of); fputs(" <address-head>[,<opts>]\n", of);
fputs(" address-head:\n", of); fputs(" address-head:\n", of);
@ -117,10 +130,16 @@ int xioopenhelp(FILE *of,
i = 0; i = 0;
while (addressnames[i].name) { while (addressnames[i].name) {
if (!strcmp(an->name, an->desc->defname)) { if (!strcmp(an->name, an->desc->defname)) {
int chars, i;
/* it is a canonical address name */ /* it is a canonical address name */
fprintf(of, " %s", an->name); chars = fprintf(of, " %s", an->name);
if (an->desc->syntax) { if (an->desc->syntax) {
fputs(an->desc->syntax, of); } fputs(an->desc->syntax, of);
chars += strlen(an->desc->syntax);
}
i = (40 - chars + 7) / 8;
for (; i > 0; --i) { fputc('\t', of); }
fputs("\tgroups=", of); fputs("\tgroups=", of);
groups = an->desc->groups; occurred = false; groups = an->desc->groups; occurred = false;
for (j = 0; j < 32; ++j) { for (j = 0; j < 32; ++j) {
@ -133,7 +152,13 @@ int xioopenhelp(FILE *of,
} }
fputc('\n', of); fputc('\n', of);
} else if (level == 2) { } else if (level == 2) {
fprintf(of, " %s is an alias name for %s\n", an->name, an->desc->defname); int chars, i;
chars = fprintf(of, " %s", an->name);
i = (40 - chars + 7) / 8;
for (; i > 0; --i) { fputc('\t', of); }
fprintf(of, "\tis an alias name for %s\n", an->desc->defname);
} }
++an; ++i; ++an; ++i;
} }
@ -149,10 +174,16 @@ int xioopenhelp(FILE *of,
fputs(" opt:\n", of); fputs(" opt:\n", of);
on = optionnames; on = optionnames;
while (on->name != NULL) { while (on->name != NULL) {
if (on->desc->nickname!= NULL if (on->desc->nickname != NULL
&& !strcmp(on->name, on->desc->nickname)) { && !strcmp(on->name, on->desc->nickname)) {
if (level == 2) { if (level == 2) {
fprintf(of, " %s is an alias for %s\n", on->name, on->desc->defname); int chars, i;
chars = fprintf(of, " %s", on->name);
i = (16 - chars + 7) / 8;
for (; i > 0; --i) { fputc('\t', of); }
fprintf(of, "\tis an alias for %s\n", on->desc->defname);
} else { } else {
xiohelp_option(of, on, on->name); xiohelp_option(of, on, on->name);
} }
@ -163,7 +194,13 @@ int xioopenhelp(FILE *of,
if (!strcmp(on->name, on->desc->defname)) { if (!strcmp(on->name, on->desc->defname)) {
xiohelp_option(of, on, on->name); xiohelp_option(of, on, on->name);
} else { } else {
fprintf(of, " %s is an alias for %s\n", on->name, on->desc->defname); int chars, i;
chars = fprintf(of, " %s", on->name);
i = (16 - chars + 7) / 8;
for (; i > 0; --i) { fputc('\t', of); }
fprintf(of, "\tis an alias for %s\n", on->desc->defname);
} }
} }
++on; ++on;

316
xioopen.c
View file

@ -20,300 +20,300 @@ static int xioopen_dual(xiofile_t *xfd, int xioflags);
const struct addrname addressnames[] = { const struct addrname addressnames[] = {
#if 1 #if 1
#if WITH_STDIO #if WITH_STDIO
{ "-", &addr_stdio }, { "-", &xioaddr_stdio },
#endif #endif
#if defined(WITH_UNIX) && defined(WITH_ABSTRACT_UNIXSOCKET) #if defined(WITH_UNIX) && defined(WITH_ABSTRACT_UNIXSOCKET)
{ "abstract", &xioaddr_abstract_client }, { "ABSTRACT", &xioaddr_abstract_client },
{ "abstract-client", &xioaddr_abstract_client }, { "ABSTRACT-CLIENT", &xioaddr_abstract_client },
{ "abstract-connect", &xioaddr_abstract_connect }, { "ABSTRACT-CONNECT", &xioaddr_abstract_connect },
#if WITH_LISTEN #if WITH_LISTEN
{ "abstract-listen", &xioaddr_abstract_listen }, { "ABSTRACT-LISTEN", &xioaddr_abstract_listen },
#endif #endif
{ "abstract-recv", &xioaddr_abstract_recv }, { "ABSTRACT-RECV", &xioaddr_abstract_recv },
{ "abstract-recvfrom", &xioaddr_abstract_recvfrom }, { "ABSTRACT-RECVFROM", &xioaddr_abstract_recvfrom },
{ "abstract-sendto", &xioaddr_abstract_sendto }, { "ABSTRACT-SENDTO", &xioaddr_abstract_sendto },
#endif /* defined(WITH_UNIX) && defined(WITH_ABSTRACT_UNIXSOCKET) */ #endif /* defined(WITH_UNIX) && defined(WITH_ABSTRACT_UNIXSOCKET) */
#if WITH_CREAT #if WITH_CREAT
{ "creat", &addr_creat }, { "CREAT", &xioaddr_creat },
{ "create", &addr_creat }, { "CREATE", &xioaddr_creat },
#endif #endif
#if WITH_GENERICSOCKET #if WITH_GENERICSOCKET
{ "datagram", &xioaddr_socket_datagram }, { "DATAGRAM", &xioaddr_socket_datagram },
{ "dgram", &xioaddr_socket_datagram }, { "DGRAM", &xioaddr_socket_datagram },
#endif #endif
#if WITH_OPENSSL #if WITH_OPENSSL
{ "dtls", &xioaddr_openssl_dtls_client }, { "DTLS", &xioaddr_openssl_dtls_client },
{ "dtls-c", &xioaddr_openssl_dtls_client }, { "DTLS-C", &xioaddr_openssl_dtls_client },
{ "dtls-client", &xioaddr_openssl_dtls_client }, { "DTLS-CLIENT", &xioaddr_openssl_dtls_client },
{ "dtls-connect", &xioaddr_openssl_dtls_client }, { "DTLS-CONNECT", &xioaddr_openssl_dtls_client },
#if WITH_LISTEN #if WITH_LISTEN
{ "dtls-l", &xioaddr_openssl_dtls_server }, { "DTLS-L", &xioaddr_openssl_dtls_server },
{ "dtls-listen", &xioaddr_openssl_dtls_server }, { "DTLS-LISTEN", &xioaddr_openssl_dtls_server },
{ "dtls-server", &xioaddr_openssl_dtls_server }, { "DTLS-SERVER", &xioaddr_openssl_dtls_server },
#endif #endif
#endif #endif
#if WITH_PIPE #if WITH_PIPE
{ "echo", &addr_pipe }, { "ECHO", &xioaddr_pipe },
#endif #endif
#if WITH_EXEC #if WITH_EXEC
{ "exec", &addr_exec }, { "EXEC", &xioaddr_exec },
#endif #endif
#if WITH_FDNUM #if WITH_FDNUM
{ "fd", &addr_fd }, { "FD", &xioaddr_fd },
#endif #endif
#if WITH_PIPE #if WITH_PIPE
{ "fifo", &addr_pipe }, { "FIFO", &xioaddr_pipe },
#endif #endif
#if WITH_FILE #if WITH_FILE
{ "file", &addr_open }, { "FILE", &xioaddr_open },
#endif #endif
#if WITH_GOPEN #if WITH_GOPEN
{ "gopen", &addr_gopen }, { "GOPEN", &xioaddr_gopen },
#endif #endif
#if WITH_INTERFACE #if WITH_INTERFACE
{ "if", &xioaddr_interface }, { "IF", &xioaddr_interface },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_TCP #if (WITH_IP4 || WITH_IP6) && WITH_TCP
{ "inet", &addr_tcp_connect }, { "INET", &xioaddr_tcp_connect },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_TCP && WITH_LISTEN #if (WITH_IP4 || WITH_IP6) && WITH_TCP && WITH_LISTEN
{ "inet-l", &addr_tcp_listen }, { "INET-L", &xioaddr_tcp_listen },
{ "inet-listen", &addr_tcp_listen }, { "INET-LISTEN", &xioaddr_tcp_listen },
#endif #endif
#if WITH_IP4 && WITH_TCP #if WITH_IP4 && WITH_TCP
{ "inet4", &addr_tcp4_connect }, { "INET4", &xioaddr_tcp4_connect },
#endif #endif
#if WITH_IP4 && WITH_TCP && WITH_LISTEN #if WITH_IP4 && WITH_TCP && WITH_LISTEN
{ "inet4-l", &addr_tcp4_listen }, { "INET4-L", &xioaddr_tcp4_listen },
{ "inet4-listen", &addr_tcp4_listen }, { "INET4-LISTEN", &xioaddr_tcp4_listen },
#endif #endif
#if WITH_IP6 && WITH_TCP #if WITH_IP6 && WITH_TCP
{ "inet6", &addr_tcp6_connect }, { "INET6", &xioaddr_tcp6_connect },
#endif #endif
#if WITH_IP6 && WITH_TCP && WITH_LISTEN #if WITH_IP6 && WITH_TCP && WITH_LISTEN
{ "inet6-l", &addr_tcp6_listen }, { "INET6-L", &xioaddr_tcp6_listen },
{ "inet6-listen", &addr_tcp6_listen }, { "INET6-LISTEN", &xioaddr_tcp6_listen },
#endif #endif
#if WITH_INTERFACE #if WITH_INTERFACE
{ "interface", &xioaddr_interface }, { "INTERFACE", &xioaddr_interface },
#endif #endif
#if WITH_RAWIP #if WITH_RAWIP
#if (WITH_IP4 || WITH_IP6) #if (WITH_IP4 || WITH_IP6)
{ "ip", &addr_rawip_sendto }, { "IP", &xioaddr_rawip_sendto },
{ "ip-datagram", &addr_rawip_datagram }, { "IP-DATAGRAM", &xioaddr_rawip_datagram },
{ "ip-dgram", &addr_rawip_datagram }, { "IP-DGRAM", &xioaddr_rawip_datagram },
{ "ip-recv", &addr_rawip_recv }, { "IP-RECV", &xioaddr_rawip_recv },
{ "ip-recvfrom", &addr_rawip_recvfrom }, { "IP-RECVFROM", &xioaddr_rawip_recvfrom },
{ "ip-send", &addr_rawip_sendto }, { "IP-SEND", &xioaddr_rawip_sendto },
{ "ip-sendto", &addr_rawip_sendto }, { "IP-SENDTO", &xioaddr_rawip_sendto },
#endif #endif
#if WITH_IP4 #if WITH_IP4
{ "ip4", &addr_rawip4_sendto }, { "IP4", &xioaddr_rawip4_sendto },
{ "ip4-datagram", &addr_rawip4_datagram }, { "IP4-DATAGRAM", &xioaddr_rawip4_datagram },
{ "ip4-dgram", &addr_rawip4_datagram }, { "IP4-DGRAM", &xioaddr_rawip4_datagram },
{ "ip4-recv", &addr_rawip4_recv }, { "IP4-RECV", &xioaddr_rawip4_recv },
{ "ip4-recvfrom", &addr_rawip4_recvfrom }, { "IP4-RECVFROM", &xioaddr_rawip4_recvfrom },
{ "ip4-send", &addr_rawip4_sendto }, { "IP4-SEND", &xioaddr_rawip4_sendto },
{ "ip4-sendto", &addr_rawip4_sendto }, { "IP4-SENDTO", &xioaddr_rawip4_sendto },
#endif #endif
#if WITH_IP6 #if WITH_IP6
{ "ip6", &addr_rawip6_sendto }, { "IP6", &xioaddr_rawip6_sendto },
{ "ip6-datagram", &addr_rawip6_datagram }, { "IP6-DATAGRAM", &xioaddr_rawip6_datagram },
{ "ip6-dgram", &addr_rawip6_datagram }, { "IP6-DGRAM", &xioaddr_rawip6_datagram },
{ "ip6-recv", &addr_rawip6_recv }, { "IP6-RECV", &xioaddr_rawip6_recv },
{ "ip6-recvfrom", &addr_rawip6_recvfrom }, { "IP6-RECVFROM", &xioaddr_rawip6_recvfrom },
{ "ip6-send", &addr_rawip6_sendto }, { "IP6-SEND", &xioaddr_rawip6_sendto },
{ "ip6-sendto", &addr_rawip6_sendto }, { "IP6-SENDTO", &xioaddr_rawip6_sendto },
#endif #endif
#endif /* WITH_RAWIP */ #endif /* WITH_RAWIP */
#if WITH_UNIX #if WITH_UNIX
{ "local", &xioaddr_unix_connect }, { "LOCAL", &xioaddr_unix_connect },
#endif #endif
#if WITH_FILE #if WITH_FILE
{ "open", &addr_open }, { "OPEN", &xioaddr_open },
#endif #endif
#if WITH_OPENSSL #if WITH_OPENSSL
{ "openssl", &xioaddr_openssl }, { "OPENSSL", &xioaddr_openssl },
{ "openssl-connect", &xioaddr_openssl }, { "OPENSSL-CONNECT", &xioaddr_openssl },
{ "openssl-dtls-client", &xioaddr_openssl_dtls_client }, { "OPENSSL-DTLS-CLIENT", &xioaddr_openssl_dtls_client },
{ "openssl-dtls-connect", &xioaddr_openssl_dtls_client }, { "OPENSSL-DTLS-CONNECT", &xioaddr_openssl_dtls_client },
#if WITH_LISTEN #if WITH_LISTEN
{ "openssl-dtls-listen", &xioaddr_openssl_dtls_server }, { "OPENSSL-DTLS-LISTEN", &xioaddr_openssl_dtls_server },
{ "openssl-dtls-server", &xioaddr_openssl_dtls_server }, { "OPENSSL-DTLS-SERVER", &xioaddr_openssl_dtls_server },
{ "openssl-listen", &xioaddr_openssl_listen }, { "OPENSSL-LISTEN", &xioaddr_openssl_listen },
#endif #endif
#endif #endif
#if WITH_PIPE #if WITH_PIPE
{ "pipe", &addr_pipe }, { "PIPE", &xioaddr_pipe },
#endif #endif
#if WITH_PROXY #if WITH_PROXY
{ "proxy", &addr_proxy_connect }, { "PROXY", &xioaddr_proxy_connect },
{ "proxy-connect", &addr_proxy_connect }, { "PROXY-CONNECT", &xioaddr_proxy_connect },
#endif #endif
#if WITH_PTY #if WITH_PTY
{ "pty", &addr_pty }, { "PTY", &xioaddr_pty },
#endif #endif
#if WITH_READLINE #if WITH_READLINE
{ "readline", &addr_readline }, { "READLINE", &xioaddr_readline },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_SCTP #if (WITH_IP4 || WITH_IP6) && WITH_SCTP
{ "sctp", &addr_sctp_connect }, { "SCTP", &xioaddr_sctp_connect },
{ "sctp-connect", &addr_sctp_connect }, { "SCTP-CONNECT", &xioaddr_sctp_connect },
#if WITH_LISTEN #if WITH_LISTEN
{ "sctp-l", &addr_sctp_listen }, { "SCTP-L", &xioaddr_sctp_listen },
{ "sctp-listen", &addr_sctp_listen }, { "SCTP-LISTEN", &xioaddr_sctp_listen },
#endif #endif
#if WITH_IP4 #if WITH_IP4
{ "sctp4", &addr_sctp4_connect }, { "SCTP4", &xioaddr_sctp4_connect },
{ "sctp4-connect", &addr_sctp4_connect }, { "SCTP4-CONNECT", &xioaddr_sctp4_connect },
#if WITH_LISTEN #if WITH_LISTEN
{ "sctp4-l", &addr_sctp4_listen }, { "SCTP4-L", &xioaddr_sctp4_listen },
{ "sctp4-listen", &addr_sctp4_listen }, { "SCTP4-LISTEN", &xioaddr_sctp4_listen },
#endif #endif
#endif /* WITH_IP4 */ #endif /* WITH_IP4 */
#if WITH_IP6 #if WITH_IP6
{ "sctp6", &addr_sctp6_connect }, { "SCTP6", &xioaddr_sctp6_connect },
{ "sctp6-connect", &addr_sctp6_connect }, { "SCTP6-CONNECT", &xioaddr_sctp6_connect },
#if WITH_LISTEN #if WITH_LISTEN
{ "sctp6-l", &addr_sctp6_listen }, { "SCTP6-L", &xioaddr_sctp6_listen },
{ "sctp6-listen", &addr_sctp6_listen }, { "SCTP6-LISTEN", &xioaddr_sctp6_listen },
#endif #endif
#endif /* WITH_IP6 */ #endif /* WITH_IP6 */
#endif /* (WITH_IP4 || WITH_IP6) && WITH_SCTP */ #endif /* (WITH_IP4 || WITH_IP6) && WITH_SCTP */
#if WITH_GENERICSOCKET #if WITH_GENERICSOCKET
{ "sendto", &xioaddr_socket_sendto }, { "SENDTO", &xioaddr_socket_sendto },
#endif #endif
#if WITH_GENERICSOCKET #if WITH_GENERICSOCKET
{ "socket-connect", &xioaddr_socket_connect }, { "SOCKET-CONNECT", &xioaddr_socket_connect },
{ "socket-datagram", &xioaddr_socket_datagram }, { "SOCKET-DATAGRAM", &xioaddr_socket_datagram },
#if WITH_LISTEN #if WITH_LISTEN
{ "socket-listen", &xioaddr_socket_listen }, { "SOCKET-LISTEN", &xioaddr_socket_listen },
#endif /* WITH_LISTEN */ #endif /* WITH_LISTEN */
{ "socket-recv", &xioaddr_socket_recv }, { "SOCKET-RECV", &xioaddr_socket_recv },
{ "socket-recvfrom", &xioaddr_socket_recvfrom }, { "SOCKET-RECVFROM", &xioaddr_socket_recvfrom },
{ "socket-sendto", &xioaddr_socket_sendto }, { "SOCKET-SENDTO", &xioaddr_socket_sendto },
#endif #endif
#if WITH_SOCKS4 #if WITH_SOCKS4
{ "socks", &addr_socks4_connect }, { "SOCKS", &xioaddr_socks4_connect },
{ "socks4", &addr_socks4_connect }, { "SOCKS4", &xioaddr_socks4_connect },
#endif #endif
#if WITH_SOCKS4A #if WITH_SOCKS4A
{ "socks4a", &addr_socks4a_connect }, { "SOCKS4A", &xioaddr_socks4a_connect },
#endif #endif
#if WITH_OPENSSL #if WITH_OPENSSL
{ "ssl", &xioaddr_openssl }, { "SSL", &xioaddr_openssl },
#if WITH_LISTEN #if WITH_LISTEN
{ "ssl-l", &xioaddr_openssl_listen }, { "SSL-L", &xioaddr_openssl_listen },
#endif #endif
#endif #endif
#if WITH_STDIO #if WITH_STDIO
{ "stderr", &addr_stderr }, { "STDERR", &xioaddr_stderr },
{ "stdin", &addr_stdin }, { "STDIN", &xioaddr_stdin },
{ "stdio", &addr_stdio }, { "STDIO", &xioaddr_stdio },
{ "stdout", &addr_stdout }, { "STDOUT", &xioaddr_stdout },
#endif #endif
#if WITH_SYSTEM #if WITH_SYSTEM
{ "system", &addr_system }, { "SYSTEM", &xioaddr_system },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_TCP #if (WITH_IP4 || WITH_IP6) && WITH_TCP
{ "tcp", &addr_tcp_connect }, { "TCP", &xioaddr_tcp_connect },
{ "tcp-connect", &addr_tcp_connect }, { "TCP-CONNECT", &xioaddr_tcp_connect },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_TCP && WITH_LISTEN #if (WITH_IP4 || WITH_IP6) && WITH_TCP && WITH_LISTEN
{ "tcp-l", &addr_tcp_listen }, { "TCP-L", &xioaddr_tcp_listen },
{ "tcp-listen", &addr_tcp_listen }, { "TCP-LISTEN", &xioaddr_tcp_listen },
#endif #endif
#if WITH_IP4 && WITH_TCP #if WITH_IP4 && WITH_TCP
{ "tcp4", &addr_tcp4_connect }, { "TCP4", &xioaddr_tcp4_connect },
{ "tcp4-connect", &addr_tcp4_connect }, { "TCP4-CONNECT", &xioaddr_tcp4_connect },
#endif #endif
#if WITH_IP4 && WITH_TCP && WITH_LISTEN #if WITH_IP4 && WITH_TCP && WITH_LISTEN
{ "tcp4-l", &addr_tcp4_listen }, { "TCP4-L", &xioaddr_tcp4_listen },
{ "tcp4-listen", &addr_tcp4_listen }, { "TCP4-LISTEN", &xioaddr_tcp4_listen },
#endif #endif
#if WITH_IP6 && WITH_TCP #if WITH_IP6 && WITH_TCP
{ "tcp6", &addr_tcp6_connect }, { "TCP6", &xioaddr_tcp6_connect },
{ "tcp6-connect", &addr_tcp6_connect }, { "TCP6-CONNECT", &xioaddr_tcp6_connect },
#endif #endif
#if WITH_IP6 && WITH_TCP && WITH_LISTEN #if WITH_IP6 && WITH_TCP && WITH_LISTEN
{ "tcp6-l", &addr_tcp6_listen }, { "TCP6-L", &xioaddr_tcp6_listen },
{ "tcp6-listen", &addr_tcp6_listen }, { "TCP6-LISTEN", &xioaddr_tcp6_listen },
#endif #endif
#if WITH_TUN #if WITH_TUN
{ "tun", &xioaddr_tun }, { "TUN", &xioaddr_tun },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_UDP #if (WITH_IP4 || WITH_IP6) && WITH_UDP
{ "udp", &addr_udp_connect }, { "UDP", &xioaddr_udp_connect },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_UDP #if (WITH_IP4 || WITH_IP6) && WITH_UDP
{ "udp-connect", &addr_udp_connect }, { "UDP-CONNECT", &xioaddr_udp_connect },
{ "udp-datagram", &addr_udp_datagram }, { "UDP-DATAGRAM", &xioaddr_udp_datagram },
{ "udp-dgram", &addr_udp_datagram }, { "UDP-DGRAM", &xioaddr_udp_datagram },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_UDP && WITH_LISTEN #if (WITH_IP4 || WITH_IP6) && WITH_UDP && WITH_LISTEN
{ "udp-l", &addr_udp_listen }, { "UDP-L", &xioaddr_udp_listen },
{ "udp-listen", &addr_udp_listen }, { "UDP-LISTEN", &xioaddr_udp_listen },
#endif #endif
#if (WITH_IP4 || WITH_IP6) && WITH_UDP #if (WITH_IP4 || WITH_IP6) && WITH_UDP
{ "udp-recv", &addr_udp_recv }, { "UDP-RECV", &xioaddr_udp_recv },
{ "udp-recvfrom", &addr_udp_recvfrom }, { "UDP-RECVFROM", &xioaddr_udp_recvfrom },
{ "udp-send", &addr_udp_sendto }, { "UDP-SEND", &xioaddr_udp_sendto },
{ "udp-sendto", &addr_udp_sendto }, { "UDP-SENDTO", &xioaddr_udp_sendto },
#endif #endif
#if WITH_IP4 && WITH_UDP #if WITH_IP4 && WITH_UDP
{ "udp4", &addr_udp4_connect }, { "UDP4", &xioaddr_udp4_connect },
{ "udp4-connect", &addr_udp4_connect }, { "UDP4-CONNECT", &xioaddr_udp4_connect },
{ "udp4-datagram", &addr_udp4_datagram }, { "UDP4-DATAGRAM", &xioaddr_udp4_datagram },
{ "udp4-dgram", &addr_udp4_datagram }, { "UDP4-DGRAM", &xioaddr_udp4_datagram },
#endif #endif
#if WITH_IP4 && WITH_UDP && WITH_LISTEN #if WITH_IP4 && WITH_UDP && WITH_LISTEN
{ "udp4-l", &addr_udp4_listen }, { "UDP4-L", &xioaddr_udp4_listen },
{ "udp4-listen", &addr_udp4_listen }, { "UDP4-LISTEN", &xioaddr_udp4_listen },
#endif #endif
#if WITH_IP4 && WITH_UDP #if WITH_IP4 && WITH_UDP
{ "udp4-recv", &addr_udp4_recv }, { "UDP4-RECV", &xioaddr_udp4_recv },
{ "udp4-recvfrom", &addr_udp4_recvfrom }, { "UDP4-RECVFROM", &xioaddr_udp4_recvfrom },
{ "udp4-send", &addr_udp4_sendto }, { "UDP4-SEND", &xioaddr_udp4_sendto },
{ "udp4-sendto", &addr_udp4_sendto }, { "UDP4-SENDTO", &xioaddr_udp4_sendto },
#endif #endif
#if WITH_IP6 && WITH_UDP #if WITH_IP6 && WITH_UDP
{ "udp6", &addr_udp6_connect }, { "UDP6", &xioaddr_udp6_connect },
{ "udp6-connect", &addr_udp6_connect }, { "UDP6-CONNECT", &xioaddr_udp6_connect },
{ "udp6-datagram", &addr_udp6_datagram }, { "UDP6-DATAGRAM", &xioaddr_udp6_datagram },
{ "udp6-dgram", &addr_udp6_datagram }, { "UDP6-DGRAM", &xioaddr_udp6_datagram },
#endif #endif
#if WITH_IP6 && WITH_UDP && WITH_LISTEN #if WITH_IP6 && WITH_UDP && WITH_LISTEN
{ "udp6-l", &addr_udp6_listen }, { "UDP6-L", &xioaddr_udp6_listen },
{ "udp6-listen", &addr_udp6_listen }, { "UDP6-LISTEN", &xioaddr_udp6_listen },
#endif #endif
#if WITH_IP6 && WITH_UDP #if WITH_IP6 && WITH_UDP
{ "udp6-recv", &addr_udp6_recv }, { "UDP6-RECV", &xioaddr_udp6_recv },
{ "udp6-recvfrom", &addr_udp6_recvfrom }, { "UDP6-RECVFROM", &xioaddr_udp6_recvfrom },
{ "udp6-send", &addr_udp6_sendto }, { "UDP6-SEND", &xioaddr_udp6_sendto },
{ "udp6-sendto", &addr_udp6_sendto }, { "UDP6-SENDTO", &xioaddr_udp6_sendto },
#endif #endif
#if WITH_UNIX #if WITH_UNIX
{ "unix", &xioaddr_unix_client }, { "UNIX", &xioaddr_unix_client },
{ "unix-client", &xioaddr_unix_client }, { "UNIX-CLIENT", &xioaddr_unix_client },
{ "unix-connect", &xioaddr_unix_connect }, { "UNIX-CONNECT", &xioaddr_unix_connect },
#endif #endif
#if WITH_UNIX && WITH_LISTEN #if WITH_UNIX && WITH_LISTEN
{ "unix-l", &xioaddr_unix_listen }, { "UNIX-L", &xioaddr_unix_listen },
{ "unix-listen", &xioaddr_unix_listen }, { "UNIX-LISTEN", &xioaddr_unix_listen },
#endif #endif
#if WITH_UNIX #if WITH_UNIX
{ "unix-recv", &xioaddr_unix_recv }, { "UNIX-RECV", &xioaddr_unix_recv },
{ "unix-recvfrom", &xioaddr_unix_recvfrom }, { "UNIX-RECVFROM", &xioaddr_unix_recvfrom },
{ "unix-send", &xioaddr_unix_sendto }, { "UNIX-SEND", &xioaddr_unix_sendto },
{ "unix-sendto", &xioaddr_unix_sendto }, { "UNIX-SENDTO", &xioaddr_unix_sendto },
#endif #endif
#if WITH_VSOCK #if WITH_VSOCK
{ "vsock", &addr_vsock_connect }, { "VSOCK", &xioaddr_vsock_connect },
{ "vsock-connect", &addr_vsock_connect }, { "VSOCK-CONNECT", &xioaddr_vsock_connect },
#endif #endif
#if WITH_VSOCK && WITH_LISTEN #if WITH_VSOCK && WITH_LISTEN
{ "vsock-l", &addr_vsock_listen }, { "VSOCK-L", &xioaddr_vsock_listen },
{ "vsock-listen", &addr_vsock_listen }, { "VSOCK-LISTEN", &xioaddr_vsock_listen },
#endif #endif
#else /* !0 */ #else /* !0 */
# if WITH_INTEGRATE # if WITH_INTEGRATE
@ -537,7 +537,7 @@ static xiosingle_t *xioparse_single(const char **addr) {
#if WITH_FDNUM #if WITH_FDNUM
} else if (isdigit(token[0]&0xff) && token[1] == '\0') { } else if (isdigit(token[0]&0xff) && token[1] == '\0') {
Info1("interpreting address \"%s\" as file descriptor", token); Info1("interpreting address \"%s\" as file descriptor", token);
addrdesc = &addr_fd; addrdesc = &xioaddr_fd;
if ((sfd->argv[sfd->argc++] = strdup("FD")) == NULL) { if ((sfd->argv[sfd->argc++] = strdup("FD")) == NULL) {
Error("strdup(\"FD\"): out of memory"); Error("strdup(\"FD\"): out of memory");
} }
@ -549,7 +549,7 @@ static xiosingle_t *xioparse_single(const char **addr) {
#if WITH_GOPEN #if WITH_GOPEN
} else if (strchr(token, '/')) { } else if (strchr(token, '/')) {
Info1("interpreting address \"%s\" as file name", token); Info1("interpreting address \"%s\" as file name", token);
addrdesc = &addr_gopen; addrdesc = &xioaddr_gopen;
if ((sfd->argv[sfd->argc++] = strdup("GOPEN")) == NULL) { if ((sfd->argv[sfd->argc++] = strdup("GOPEN")) == NULL) {
Error("strdup(\"GOPEN\"): out of memory"); Error("strdup(\"GOPEN\"): out of memory");
} }