|
|
# source: xio.help# Copyright Gerhard Rieger and contributors (see file CHANGES)
Operating systems:
The options and features described in this document have been implemented (butnot always tested) on the operating systems listed below, unless otherwisenoted:
SuSE 10.1 Linux on x86Solaris 8 on Sparc with gccFreeBSD 6.1 on x86HP-UX B 11.11 on PA-RISC with gcc
===============================================================================
The following sections describe the syntax and semantics of the socat commandline stream arguments.
Usually a socat stream argument defines a one- or bidirectional stream. Thereare two principal forms:* a single stream. Depending on use of the -u or -U options and implicitsemantics of the stream, such an argument may be resolved to a one- ortwodirectional stream.* two onedirectional streams, separated by '!!'. An argument of this formalways specifies a twodirectional stream. The first single stream is only usedfor reading data, and the second is only used for writing data.
The general structure of a single stream is:keyword[:required-parameters][,options]
The options part starts with the first ',' of the argument. The requiredparameters are separated by ':' from their predecessor. The last requiredparameter is terminated by the end of the argument or by the first ',' thatiitroduces the first option. The options are separated with ','. The lastoption is terminated by end-of-string or by '!!'.
The are some abbreviations defined that allow to drop the keyword. In thesecases the argument syntax is:required-parameter[:required-parameters][,options]The implemented abbreviations are:short form canonical formnumber FD:number # decimal numberpath GOPEN:path # must must contain at least one '/' and must not contain ':' or ',' and must not start with a decimal digit
===============================================================================
Addresses:
Every address specification starts with a keyword or an abbreviation. Thesekeywords are case insensitive.Note: because the option group ANY applies for all addresses, it is notmentioned explicitely below.
Bidirectional only addresses:-----------------------------
PIPEFIFOECHO
Opens an unnamed pipe (fifo) where outbound traffic is sent to and inboundtraffic is read from. The special semantics of pipes results in an echo likebehaviour.Option groups: FD, FIFO (no specific FIFO options are defined yet)
Onedirectional only addresses:------------------------------
Currently all addresses may be used bidirectional.Note: for regular files, behaviour when being used bidirectionally isundefined.
One- and bidirectional addresses:---------------------------------
STDIO- ("minus")
Uses stdin (FD 0) for inbound traffic and/or stdout (FD 1) for outbound trafficon this address.Option groups: FD; others dependent on actual types of stdin and stdout (FIFO,CHR, BLK, REG, and/or SOCKET).
STDIN
Uses stdin for traffic. This might fail for outbound traffic.Option groups: FD; dependent on actual type of stdin (FIFO, CHR, BLK, REG, orSOCKET).
STDOUT
Uses stdout for traffic. This might fail for inbound traffic.Option groups: FD; dependent on actual type of stdout (FIFO, CHR, BLK, REG, orSOCKET).
STDERR
Uses stdout for traffic. This might fail for inbound traffic.Option group: FD; dependent on actual types of sterr (FIFO, CHR, BLK, REG, orSOCKET).
FD:numnum
Uses the already existing file descriptor <num> for traffic.Option groups: FD; dependent on actual types of file descriptor (FIFO, CHR,BLK, REG, or SOCKET).
READLINE
Uses the GNU readline function and history capabilies (best known from bash).It always works on stdin and stdout; if stdio is not a tty, readline does notseem to work correctly.Because readline is blocking during line editing, it does not fit well intosocats I/O philosophy. socat integrates readline by waiting in the select call as usual; when stdinreports available data, socat invokes readline(). readline blocks until theuser presses ENTER or EOF. Data on socats other stream is not handling in thistime.socat controls the ECHO flag of the stdin tty (off during select(), on forreadline()).When using socat with readline as front end to a service like telnet, POP3 oran other authenticated service, please note that the password is entered asordinary data, thus appears on the screen!Option groups: FD, READLINE, TERMIOSUseful options: history-file
OPEN:path
Applies an open() system call to the given path. If the path does not exist afile is created only if the option create is used; if a file, pipe, or devicewith this name already exists it is opened. Open for reading and/or writingdepends on the rw parameter of the xioopen call, or on usage in a socatargument. If no perm option is used, xioopen uses 600 (which might be modifiedby umask then). Applying this function to files conforms to the semantics as described by theopen(2) man page.Opening device files, like /dev/ttyS*, might block until the device gets active(until some peer is connected)With existing named pipes (fifos) please note the usual semantics:Opening the pipe in read/write mode results in an echo service;Opening the pipe in read mode blocks until a writer opens the pipe (closeby writer gives EOF for the reader); with option nonblock the open call doesnot block.Opening the pipe in write mode blocks until a reader opens the pipe (closeby reader gives "broken pipe" error on next write); with option nonblock theopen call terminates with error "no such device or address" in absence of areader. Opening a named UNIX stream socket with or without a listening peer mightsucceed depending on the operating system, but the resulting file descriptor erronously reports available data immediately,and the following read() or write() call always fails with "invalidargument". Even worse, while such a filesystem entry is identified as socket by"file" command and by fstat(), getsockopt() after open() gives error "Socket operation on non-socket".Use GOPEN for reasonable behaviour!Option groups: FD, OPEN, NAMED, and specific for data object type (FILE, FIFO,CHRDEV+TERMIOS, BLKDEV, or SOCKET).
GOPEN:pathpath
"Generic open". Tries to open the given path in a smarter way. If the pathexists and is a socket, it is connected to; if connecting fails,socat assumes a datagram socket and later uses sendto() calls for datatransfer.If the path exists and is not a socket, it is opened:in RDONLY environment for reading from position 0,in WRONLY environment for appending (O_APPEND),in RDWR env. for reading and/or writing starting from position 0.If the path does not exist:in RDONLY environment this is an errorin WRONLY environment the file is created (O_CREAT)in RDWR env. for reading and/or writing starting from position 0.However, these flags may be overriden by user supplied options(e.g., "append=0")Option groups: FD, NAMED, and specific for data object type (FILE, FIFO,CHRDEV+TERMIOS, BLKDEV, or SOCKET).
CREATE:pathCREAT:path
Opens the named file with creat(). With UNIX semantics, this address is just avariation of the OPEN address, see there for more details.Note: The creat() system call does not create a completely new file, butinherits some properties of the old file if it exists, e.g. permissions. Useoption "unlink-early" to remove the old entry before.Option groups: FD, NAMED, FILEUseful options: unlink-late
PIPE:pathFIFO:path
Creates and opens a pipe if path does not exist; opens path if it alreadyexists. Option groups: FD, NAMED, FIFONote: this address uses the mknod(2) system call to create the named pipe. OnFreeBSD, this call requires root privilege
EXEC:cmdline
Forks off a child process after establishing a bidirectional communicationchannel (with socketpair, pipes, or pty). The child then starts "cmdline" withexecvp().Note: spaces and shell meta characters in cmdline must be quoted if socat isinvoked from the command line.Option groups: FD, FORK, EXEC, SOCKET, SOCK_UNIX, FIFO, TERMIOSUseful options: path, fdin, fdout, chroot, su, pty, stderrNote: on AIX, search permissions on /dev/pts/ are required to use option pty.
SYSTEM:cmdline
Forks off a child process after establishing a bidirectional communicationchannel (with socketpair, pipes, or pty). The child then starts "cmdline" withsystem().Note: spaces and shell meta characters in cmdline must be quoted if socat isinvoked from the command line.Option groups: FD, FORK, EXEC, SOCKET, SOCK_UNIX, FIFO, TERMIOSUseful options: path, fdin, fdout, chroot, su, pty, stderrNote: there are slightly different semantics with options pty or pipes, becausethey do not communicate an EOF condition to the shell process. Therefore, theshell process and its child do not terminate due to EOF, but are explicitlykilled during close of the socat file handle. Consider usingexec:'/bin/sh -c command',pty...
UNIX:pathLOCAL:path
Connects to a UNIX domain socket.Option groups: FD, SOCKET, SOCK_UNIXNOTE: you need rw permissions to connect to a local socket. My Linux answerswith "connection refused" to insufficient permissions, not existing socket, not a socket, or just a socket entry without a listening process.NOTE: this address does not implement option group NAMED because its connectcall succeeds only if there is already someone listening, but at this point theNAMED group actions no longer affect this socket, only the fs entry.
UNIX-listen:pathUNIX-l:path
Create a listening UNIX domain socket. With the fork option, for each acceptedconnection a new process is forked off, and more connections are accepted onthe parent socket. Without fork, only the first connection is accepted.Option groups: FD, NAMED, SOCKET, SOCK_UNIX, LISTEN, CHILD
IP:host:protocolIP4:host:protocol
Open a raw socket with IP4 protocol. This mode sends packets to and acceptsthem only from host. protocol is a number from 0 to 255, with 1 meaning ICMP,6..TCP, 17..UDP, 255..raw IP; 0 might be unsupported by the local IP stack,resulting in an error. Requires root privilege.Note: my Linux 2.4.10 kernel seems to drop payloads smaller than 8bytes on their way from the network to the application.Option groups: FD, SOCKET, SOCK_IP
TCP:host:portTCP4:host:portINET:host:port
Create a TCP/IP4 client socket and connect to the given host/port combination.Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCPUseful options: crlf, bind, tos, mtudiscover, mss, nodelay,
TCP-l:portTCP-listen:portTCP4-l:portTCP4-listen:portINET-l:portINET-listen:port
Create a TCP/IP4 server socket and wait for an incoming connection. With thefork option, for each accepted connection a new process is forked off, and moreconnections are accepted on the parent socket. Without fork, only the firstconnection is accepted.Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP, LISTEN, RANGE, CHILDUseful options: fork, crlf, bind, backlog, mtu, tcpwrap
UDP:host:portUDP-CONNECT:host:port
Connects to port on host using UDP/IP version 4 or 6 depending on address specification, name resolution, or option pf. Please note that, due to UDP protocol properties, no real connection is established; data has to be sent for `connecting' to the server, and no end-of-file condition can be transported.Option groups: FD, SOCKET, SOCK_IP4, SOCK_IP6, IP_UDPUseful options: ttl
UDP4:host:portUDP4-CONNECT:host:port
Like UDP-CONNECT, but only supports IPv4 protocol.Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_UDP
UDP-listen:portUDP-l:port
Emulates a UDP server in the same way as netcat: Create a UDP/IP4 socket andbind to the given port. Then wait for the first packet, get its sender address(without consuming its data), connect() to this address, and leave xioopen().Afterwards, our socket only communicates with this peer.Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_UDP, RANGENote: with fork option, child processes might hang forever because UDP cannottransport EOF conditions.
#UDP-dgram:port#UDP-d:port##Create and use a pure datagram oriented UDP socket.#The following restrictions apply:#* range option does not work#* de facto this is a read-only endpoint: sending data to 0.0.0.0 might fail.
TCP6:host:portINET6:host:port
Create a TCP/IP6 client socket and connect to the given host/port combination.Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCPNote: Address syntax parsing is awkward, since the IPv6 address word separatoris ':' which is used as port separator too.An FTP listen entry looks in netstat ":::21"!
TCP6-l:portTCP6-listen:portINET6-l:portINET6-listen:port
Create a TCP server socket and wait for an incoming connection. With the forkoption, for each accepted connection a new process is forked off, and moreconnections are accepted on the parent socket. Without fork, only the firstconnection is accepted.Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP, LISTEN, RANGE, CHILD
SOCKS4:sockd:host:portSOCKS:sockd:host:port
Use a socks server, socks protocol version 4, to build a TCP (IPv4) connection.Sockd is the name or address of the socks server, host and port specify thedestination address. Use option socksport if the socks server does not listenon port 1080. Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP, IP_SOCKSUseful options: sp, socksport, socksuserNote: If you do not specify option socksuser, xioopen tries to derive it fromenvironment: LOGNAME or USER, and might therefore undisclose your identity.
SOCKS4a:sockd:host:port
Like SOCKS4, but use the socks version 4a extension for destination nameresolution on the socks server.Option groups: FD, SOCKET, SOCK_IP, IPAPP, IP_TCP, IP_SOCKS
PTY
Creates a pseudo terminal (pty) and uses its master side. Another process mayopen the pty�s slave side using it like a serial line or terminal.Option groups: FD,NAMED,PTY,TERMIOSUseful options: link, openpty, mode, user, group
OPENSSL-CONNECT:host:portOPENSSL:host:port
Tries to establish a SSL connection to port on host using TCP/IPv4.Note: this is currently only an experimental integration of openssl!(it does not provide any trust between the peers because is does not checkcertificates!)Option groups: FD,SOCKET,SOCK_IP4,IP_TCP,OPENSSL,RETRYUseful options: cipher, method, verify, cafile, capath, certificate, bind, sourceport, retry
OPENSSL-LISTEN:port
Listens on tcp4 port. When a connection is accepted, this address behaves asSSL server.Option groups: FD,SOCKET,SOCK_IP4,TCP,LISTEN,CHILD,RANGE,OPENSSL,RETRYUsefule options: cipher, method, verify, cafile, capath, certificate, retry
PROXY:proxy:host:portPROXY-CONNECT:proxy:host:port
Connects to an HTTP proxy server on port 8080 using TCP/IPv4, and sends aCONNECT request for host:port. If the proxy grants access and succeeds toconnect to the target, data transfer between socat and the target canstart. Note that the traffic need not be HTTP but can be an arbitraryprotocol.Option groups: FD,SOCKET,IP4,TCP,HTTPUseful options: proxyport, ignorecr, proxyauth, crnl, bind, mss, sourceport
===============================================================================
Option Groups:
Each option is member of one option group. Address definitions specify whichoption groups they support. This allows to reject unapplyable options in anearly stage of address processing.
Address groups are identified by single bit positions. Option definitionsspecify to which group the option belongs (some options are member or more thanone group). Addresses use a bit pattern to specify which option groups theysupport.
Currently the following option groups are defined:
GROUP_FD: All addresses that result in one or more file descriptors. Theseoptions are typically applied with fcntl() or some special calls like fchown()or fchmod(). There is no documented restriction to apply these functions to anyfile descriptor; but they are not always meaningful, and sometimes lead to OSexceptions.
GROUP_APPL: All addresses. The options do not need file descriptors, becausethey manipulate the data streams at application level (ignoreeof, lineterminator conversion).
GROUP_PROCESS: For options that change process related attributes, like user id(setuid).
GROUP_FIFO: Options for pipes. Currently not used.
GROUP_CHR: Options for character devices. Currently not used.
GROUP_BLK: Options for block devices. Currently not used.
GROUP_REG, GROUP_FILE: Options for regular files. Currently not used.
GROUP_SOCKET: Options for arbitrary type sockets, e.g. so-sndbuf, so-linger.
GROUP_NAMED: Options for file system entries, e.g. user-early, unlink.
GROUP_OPEN: Options that are applied with the open() system call.
GROUP_EXEC: Options for program or script execution, e.g. path.
GROUP_FORK: Options for communication with children processes, e.g. fdin, pty.
GROUP_LISTEN: Options for listening sockets. Only backlog.
GROUP_DEVICE: not used
GROUP_CHILD: Options for addresses that may fork off independent childprocesses. Currently only option fork.
GROUP_RETRY: Options for failure handling. Currently not used.
GROUP_TERMIOS: Options for terminal settings, e.g. echo, b38400, raw.
GROUP_READLINE: Options for readline (GNU line editing and history).
GROUP_RANGE: Options for checking peer address. Currently only range.
GROUP_SOCK_UNIX: Options for UNIX domain sockets. Currently not used.
GROUP_SOCK_IP4: Options for IP4 sockets. Currently not used.
GROUP_SOCK_IP6: Options for IP6 sockets. Currently not used.
GROUP_SOCK_IP: Options for IP sockets, e.g. mtu, ip-options, ttl.
GROUP_IP_UDP: Options for UDP sockets. Currently not used.
GROUP_IP_TCP: Options for TCP sockets, e.g. maxseg, nodelay.
GROUP_IPAPP: Options for UDP and TCP sockets. Currently only sourceport.
GROUP_IP_SOCKS4: Options for SOCKS client connections, e.g. socksuser.
GROUP_PROCESS: Options for process wide attributes, e.g. su, chroot.
GROUP_APPL: Options handled by application. Currently not used.
GROUP_PTY: Options for pseudo terminals. Used with addresses PTY, EXEC, andSYSTEM.
GROUP_OPENSSL: Options for the OPENSSL address.
There are "combined" group definitions too:#define GROUP_ANY (GROUP_PROCESS|GROUP_APPL)#define GROUP_ALL 0xffffffff
===============================================================================
Address Options
Address options are identified by a case insensitive keyword. If the optionsneeds a parameter value, the option syntax is always:OPTION=VALUECurrently there do not exist options that take more than one argument;sometimes, two values are combined to form one argument value, e.g. IP4 addressand port:192.168.0.1:80
Note:"Type" describes the type of data that may or must be given to the option andthat is passed to the system. There are some options with boolean semantics(on/off or yes/no), but their values are passed to the system with an int parameter. This situation is indicated as "Logical type: bool" and "Physicaltype: int". In this case xioopen passes the physical value to the system,giving the user one more hacking playground.
Option: append
Type: BOOLOption group: FDPhase: LATEPlatforms: all (UNIX98)
Sets the O_APPEND flag via a fcntl() call and F_SETFL; with OPEN typeaddresses, this flag is applied with the open() call. All data written isappended to the actual file end, even if other processes have written to ortruncated the file in the meantime.
Option: async
Type: BOOLOption group: FDPhase: LATEPlatforms: FreeBSD, Linux, SunOS
Sets the O_ASYNC (or FASYNC) flag via a fcntl() call and F_SETFL; with FILEaddresses, this flag is applied with the open() call. Consult your kerneldocumentation for effects of this flag. NOTE: socat does not handle the SIGIO signal.
Option: cloexec
Type: BOOLOption group: FDPhase: LATEPlatforms: all
Sets the FD_CLOEXEC (close-on-exec) flag on the file descriptor via afcntl()call with F_SETFD. Use with caution, because xioopen() makes use of thisflag to archieve what we consider the most reasonable behaviour; using thisoption overrides xioopen's setting!
Option: flock-exAliases: flock, lock
Type: BOOLOption group: FDPhase: FDPlatforms: FreeBSD, Linux
Applies the flock(fd, LOCK_EX) call to the file descriptor(s). This locks a fileexclusively (but only for processes also using flock() on this file - otherwise, they seem to have unrestricted access).If the file is already locked with flock, our flock call blocks until the otherprocesses lock is released.Note: the "lock" option name alias applies to this option only if the fcntl locking mechanism is not available on a platform.
Option: flock-ex-nbAliases: flock-nb
Type: BOOLOption group: FDPhase: FDPlatforms: FreeBSD, Linux
Applies the flock(fd, LOCK_EX|LOCK_NB) call to the file descriptor(s). This locks a fileexclusively (but only for processes also using flock() on this file -otherwise, they seem to have unrestricted access). If the file is already locked with flock, our flock call returns the error"Resource temporarily unavailable".
Option: flock-sh
Type: BOOLOption group: FDPhase: FDPlatforms: FreeBSD, Linux
Applies a shared advisory lock to the file using the flock(fd, LOCK_SH) call. This prevents processes from locking the file exclusively.If the file has already an exclusive lock, our flock call blocks until theother processes lock is released.
Option: flock-sh-nb
Type: BOOLOption group: FDPhase: FDPlatforms: FreeBSD, Linux
Applies a shared advisory lock to the file using the flock(fd, LOCK_SH|LOCK_NB) call. This prevents processes from locking the file exclusively.If the file has already an exclusive lock, our flock call returns with error"Resource temporarily unavailable".
Option: f-setlk-rdAliases: setlk-rd
Type: BOOLOption group: FDPhase: FDPlatforms: all
Locks the complete file with fcntl(fd, F_SETLK, {F_RDLCK}) (complete means from itsstart to its maximal length). This locks the file exclusively (but only if theother processes accessing this file also use f-setlk or f-setlkw - otherwise,they seem to have unrestricted access). If the file is already locked withf-setlk or f-setlkw, the fcntl call blocks until release by the other process.
Option: f-setlk-wrAliases: f-setlk, setlk-wr, setlk
Type: BOOLOption group: FDPhase: FDPlatforms: all
Locks the complete file with fcntl(fd, F_SETLK, {F_WRLCK}) (complete means from itsstart to its maximal length). This locks the file exclusively (but only if theother processes accessing this file also use f-setlk or f-setlkw - otherwise,they seem to have unrestricted access). If the file is already locked withf-setlk or f-setlkw, the fcntl call blocks until release by the other process.
Option: f-setlkw-rdAliases: setlkw-rd
Type: BOOLOption group: FDPhase: FDPlatforms: all
Locks the complete file with fcntl(fd, F_SETLKW, {F_RDLCK}) (complete means from itsstart to its maximal length). This locks the file exclusively (but only if theother processes accessing this file also use f-setlk or f-setlkw - otherwise,they seem to have unrestricted access). If the file is already locked withf-setlk or f-setlkw, fcntl returns with EAGAIN.
Option: f-setlkw-wrAliases: setlkw-wr, f-setlkw, setlkw, lockw, lock
Type: BOOLOption group: FDPhase: FDPlatforms: all
Locks the complete file with fcntl(fd, F_SETLKW, {F_WRLCK}) (complete means from itsstart to its maximal length). This locks the file exclusively (but only if theother processes accessing this file also use f-setlk or f-setlkw - otherwise,they seem to have unrestricted access). If the file is already locked withf-setlk or f-setlkw, fcntl returns with EAGAIN.
Option: fork
Type: BOOLOption group: CHILDPhase: PASTACCEPTPlatforms: all
Without fork (or fork=0), the listening process accepts exactly oneconnections, and terminates afterwards. With fork set, it forks off a new socatchild process for each incoming connection.It is very important to understand what socat does with this fork option:The parent process remains in a loop of accept() and fork() calls untilterminated from outside. The child process leaves this loop and goes on withthe socat processing. If the fork occurs in the first address argument, thechild process continues with parsing and activating the second addressargument. This will in most cases be what you want or expect.If the fork call occurs in socats second address argument, all children willinherit and share the already activated first address.
Option: group=valueAliases: gid=value
Type: GIDT or unsigned intOption group: NAMEDType: GIDTPlatforms: all
Takes one argument, a UNIX group name or a numeric group id. The firstcharacter of value is a digit for group ids.With NAMED addresses this option is applied via a chown() call, with a fchown() call otherwise.If groupname is a name it must be a valid groupname from /etc/group and isconverted to a group id with a getgrnam(3) call.On most modern operating systems, the owner of the process must be member ofthe group being set; only root may set any group, even numbers without groupname.A Linux 2.2.10 kernel SIGSEGVs the process in the fchown() call when thisoption is used with a socket or pipe. Is fixed with Linux 2.4.LINUXBUG TESTCASE:SH1: socat -D - unix-l:/tmp/socket,unlink-earlySH2: socat -d -d -d -d -D gopen:/tmp/socket,group=floppy -
Option: group-late=value
Type: GIDT or stringOption group: FDType: GIDTPlatforms: all
Takes one argument, a UNIX group name or a numeric group id. The firstcharacter of value is a digit for group ids.This option is applied via a fchown(2) call.If groupname is a name it must be a valid groupname from /etc/group and isconverted to a group id with a getgrnam(3) call.On most modern operating systems, the owner of the process must be member ofthe group being set; only root may set any group, even numberic group idswithout group name.
Option: o-nonblockAliases: nonblock
Type: BOOLOption group: FDPhase: FDPlatforms: all (UNIX98)
Sets the O_NONBLOCK flag of a file descriptor via a fcntl(2) call and F_SETFL;with OPEN type addresses, this flag is applied with the open() call.It does not change the behaviour of socat's data transfer loop because socatuses select() which blocks nevertheless.Currently is has only two documented uses:1) With address TCP, the connect() calldoes not block; instead, it continues through the open step. The channel ispassed to the select() call. If something is written to the channel before itis connected, this is an error. If connection fails, a read condition occursand read() returns the error.2) Opening a named pipe does not block with this option.
Option: o-ndelayAliases: ndelay
Type: BOOLOption group: FDPhase: LATEPlatforms: HP-UX, SunOS (UNIX98)
Under Solaris it sets the O_NDELAY of the file descriptor via a fcntl(2) calland F_SETFL; with OPEN type addresses, this flag is applied with the open()call.With all other operating systems, this is just another name for the nonblock option.
Option: o-noatimeAliases: noatime
Type: BOOLOption group: FDPhase: FDPlatforms: Linux
Sets the O_NOATIME flag of a file descriptor via a fcntl(2) call and F_SETFL;with OPEN type addresses, this flag is applied with the open() call.It prevents the access time from being updated during read operations.
Option: perm=valueAliases: mode=value
Type: MODET (mode_t)Option group: NAMEDPhase: FDPlatforms: all
This option changes the mode (permissions) of an addresses inode. xioopentries to apply this option already during open phase. If the address does nothave a open phase or if the option cannot be applied there, the value isapplied directly on the file descriptor afterwards.It is up to you to (1) have the permission to change the permissions, and (2)not to set permissions that prevent you from performing your transactions :-)NOTE: At least with some Linux 2.2, setting permissions on an existing file ordevice with fchmod() does not change the permissions of its inode on disk. Seeperm-early which uses chmod() instead.NOTE: At least with some Linux 2.2, restricting mode on file descriptors doesnot restrict this file descriptors data transfer capabilities.
Option: perm-late=value
Type: MODET (mode_t)Option group: FDPhase: LATEPlatforms: all
This option changes the mode (permissions) of a file descriptor with fchmod()in the last phase of address processing.
Option: seek-set=offsetAliases: lseek=offset, seek=offset
Type: OFF32 or OFF64Option group: BLKPhase: LATEPlatforms: HP-UX, Linux, SunOS
Positions the file at the given absolute offset, using lseek() (or lseek64() ifavailable) with SEEK_SET.
Option: seek-cur=offset
Type: OFF32 or OFF64Option group: BLKPhase: LATEPlatforms: HP-UX, Linux, SunOS
Positions the file at the given offset from the current position,using lseek() (or lseek64() if available) with SEEK_SET.
Option: seek-end=offset
Type: OFF32 or OFF64Option group: BLKPhase: LATEPlatforms: HP-UX, Linux, SunOS
Positions the file at the given offset from the file end,using lseek() (or lseek64() if available) with SEEK_END.
Option: lseek32-set=offsetAliases: lseek32=offset
Type: OFF32Option group: BLKPhase: LATEPlatforms: HP-UX, Linux, SunOS
Positions the file at the given absolute offset using lseek() with SEEK_SET.This call might fail for nonrandom access data objects like character devices or sockets.NOTE: this option seems to be useless on files with O_APPEND set.
Option: lseek32-cur=offset
Type: OFF32 (instead of off_t)Option group: BLKPhase: LATEPlatforms: HP-UX, Linux, SunOS
Positions the file at the given offset from the current position using lseek()with SEEK_CUR. This callmight fail for non random access data objects like character devices.On Linux, the seek() call fails on pipes, sockets and ttys but works on filesand /dev/null NOTE: this option seems to be useless on files with O_APPEND set.
Option: lseek32-end=offset
Type: OFF32Option group: BLKPhase: LATEPlatforms: HP-UX, Linux, SunOS
Positions the file at the given offset from the file end using lseek() withSEEK_END. This call might failfor non random access data objects like character devices.NOTE: this option seems to be useless on files with O_APPEND set.
Option: lseek64-set=offsetAliases: lseek64=offset
Type: OFF64Option group: BLKPhase: LATEPlatforms: all
Positions the file at the given absolute offset using lseek64() with SEEK_SET.This call might fail for nonrandom access data objects like character devices or sockets.NOTE: this option seems to be useless on files with O_APPEND set.
Option: lseek64-cur=offset
Type: OFF64Option group: BLKPhase: LATEPlatforms: all
Positions the file at the given offset from the current position usinglseek64() with SEEK_CUR. This callmight fail for non random access data objects like character devices.NOTE: this option seems to be useless on files with O_APPEND set.
Option: lseek64-end=offset
Type: OFF64Option group: BLKPhase: LATEPlatforms: all
Positions the file at the given offset from the file end using lseek64() withSEEK_END. This call might failfor non random access data objects like character devices.NOTE: this option seems to be useless on files with O_APPEND set.
Option: chroot=path
Type: STRINGOption group: PROCESSPhase: LATEPlatforms: all
Invokes the chroot() system call with the given path after the addressresolution, so the path names of the address must be specified with absolute pathes. Note: when you combine chroot with substuser, with substuser applied within thechroot environment, usually the etc/passwd and etc/group files in the chrootenvironment are used for group set etc.See appendix "generating a sandbox"
Option: chroot-early=path
Type: STRINGOption group: PROCESSPhase: EARLYPlatforms: all
Invokes the chroot() system call with the given path before the address isresolved, this means before file opening in OPEN, GOPEN and before programexecution in EXEC and SYSTEM, so their pathes must be specified related totheir chroot directory.See appendix "generating a sandbox"
Option: setgid=group
Type: GIDT (gid_t or string)Option group: PROCESSPhase: LATE2Platforms: all
Invokes setgid() with the group id. For EXEC and SYSTEM this call is performedfor the child process after the fork and therefore does not affect the socatprocess directly. For LISTEN group addresses with fork option, this call isperformed only on the child processes. For all other addresses, it is performedin the late phase of address processing, so it does not affect the addresswhere it is used, but for the next address (if any), and for the data loop.Note: setgid() does not remove any groups from the current process group set.
Option: setuid=user
Type: UIDT (uid_t or string)Option group: PROCESSPhase: LATE2Platforms: all
Invokes setuid() with the user id. For EXEC and SYSTEM this call is performedfor the child process after the fork and therefore does not affect the socatprocess directly. For LISTEN group addresses with fork option, this call isperformed only on the child processes. For all other addresses, it is performedin the late phase of address processing, so it does not affect the addresswhere it is used, but the next address (if any), and the data loop.Note: setuid() is invoked AFTER setgid(), if both are applied.Note: setuid() does not influence the processes group set; in most cases, youwant to prefer substuser option.
Option: substuser=userAliases: su=user
Type: UIDT (uid_t or string)Option group: PROCESSPhase: LATE2Platforms: all
Tries to switch the process to the given user and its group set.To make sure that the groups are set correctly for the new process owner, thesystem calls initgroups(), setgid(), and setuid() are invoked with theappropriate arguments.On sane operating system, this option requires root privileges.Note: this option sets the user and group ids of the process, but does notchange the environment; therefore, all variables including $USER, $HOME,$LOGNAME, $SHELL etc. are inherited from the old users environment.Note: starting a SETUID program after applying substuser or setuid gives theprocess the SETUID owner, which might give root privileges again.
Option: substuser-delayed=userAliases: su-d=user
Type: UIDT (unsigned int or string)Option group: PROCESSPhase: INITPlatforms: all
Like substuser, but reads the user and group information in an early phase ofaddress processing, but applies the appropriate system calls in a latephase. This allows to use user information from the host in a chrootenvironment, without exposing this data within the sandbox.
Option: o-truncAliases: trunc
Type: BOOLOption group: OPENPhase: LATEPlatforms: all
Sets the O_TRUNC flag of the open() call, thus truncating the file to zerolength.#! block devices?
Option: ftruncate=valueAliases: truncate=value
Type: OFF32 or OFF64Option group: REGPhase: LATEPlatforms: HP-UX, Linux, SunOS
Invokes the ftruncate() (or ftruncate64() if available) call for the file descriptor with the given value,thus reducing the length of the file to the given length.On Linux, ftruncate() fails on sockets and devices but works on regular filesand pipes.#! block devices?Note: AIX docu says: for regular files only
Option: ftruncate32=value
Type: OFF32Option group: REGPhase: LATEPlatforms: HP-UX, Linux, SunOS
Invokes the ftruncate() call (even if ftruncate64() is available) call for the file descriptor with the given value,thus reducing the length of the file to the given length.
Option: ftruncate64=value
Type: OFF64Option group: REGPhase: LATEPlatforms: all
Invokes the ftruncate64() call if available, for the file descriptor with the given value,thus reducing the length of the file to the given length.
Option: o-binaryAliases: binary, bin
Type: BOOLOption group: FDPhase: OPENPlatforms: none; Cygwin
Sets the O_BINARY flag with open() or fcntl() to avoid implicit line terminator conversions.
Option: o-textAliases: text
Type: BOOLOption group: FDPhase: OPENPlatforms: none; Cygwin
Sets the O_TEXT flag with open() or fcntl() to force implicit line terminator conversions.
Option: o-noinheritAliases: noinherit
Type: BOOLOption group: FDPhase: OPENPlatforms: none; Cygwin
Sets the O_NOINHERIT flag with open() or fcntl() to not keep this file open in a spawned process.
Option: cool-writeAliases: coolwrite
Type: BOOLOption group: FDPhase: INITPlatforms: all
Takes it easy when write fails with EPIPE or ECONNRESET and logs the message with notice level instead of error. This prevents the log file from being filled with useless error messages when socat is used as a high volume server or proxy where clients often abort the connection. This option is experimental.
Option: end-closeAliases: close
Type: CONSTOption group: FDPhase: INITPlatforms: all
Changes the (address dependent) method to close a connection to just close the file descriptors. This is useful when the connection is to be reused by or shared with other processes. Normally, socket connections will be ended with shutdown(2) which terminates the socket even if it is shared by multiple processes. close(2) "unlinks" the socket from the process but keeps it active as long as there are still links from other processes. Similarly, when an address of type EXEC or SYSTEM is ended, socat usually will explicitely kill the sub process. With this option, it will just close the file descriptors.
Option: user=valueAliases: owner=value, uid=value
Type: UIDT (unsigned int or string)Option group: NAMEDPhase: FDPlatforms: all
Takes one argument, a UNIX user name or a numeric user id. The firstcharacter of value is a digit for user ids.For NAMED addresses, if the file already exists, this option is applied via achown() call, with fchown() for all other cases.If username is a name it must be a valid username from /etc/passwd and isconverted to a user id with a getpwnam() call.On sane operating systems, the owner of the process must be root to changethe owner of a file descriptor; root may even apply undefined (unnamed) userids.My Linux 2.2 kernel SIGSEGVs the process in the fchown() call when thisoption is used with a (UNIX, unconnected or connected) socket or pipe. Linux2.4.0 handles this call correctly.TESTCASE: ./socat -d -d -d -d - tcp:loopback:21,user=root
Option: user-late=valueAliases: uid-l=value
Type: UIDT (unsigned int or string)Option group: FDPhase: LATEPlatforms: all
Takes one argument, a UNIX user name or a numeric user id. The firstcharacter of value is a digit for user ids.This option is applied via a fchown() call just before xioopen_single()terminates. If username is a name it must be a valid username from /etc/passwd and isconverted to a user id with a getpwnam() call.On sane operating systems, the owner of the process must be root to changethe owner of a file descriptor; root may even apply undefined (unnamed) userids.My Linux 2.2 kernel SIGSEGVs the process in the fchown() call when thisoption is used with a socket or pipe.
===============================================================================OPEN group optionsOptions of this group may be used with all addresses that support OPEN groupoptions.
Option: o-rdonlyAliases: rdonly
Type: BOOL (inherent - no value)Option group: OPENPhase: OPENPlatforms: all
Use O_RDONLY with the open() call instead of the position dependend default. Take care not to block later write operations.
Option: o-wronlyAliases: wronly
Type: BOOL (inherent - no value)Option group: OPENPhase: OPENPlatforms: all
Use O_WRONLY with the open() call instead of the position dependend default. Take care not to block later write operations.
Option: o-rdwrAliases: rdwr
Type: BOOL (inherent - no value)Option group: OPENPhase: OPENPlatforms: all
Use O_RDWR with the open() call instead of the position dependend default.
Option: o-createAliases: create, creat
Type: BOOLOption group: OPENPhase: OPENPlatforms: all
Sets the O_CREAT flag of the open() call. This means that it is not an error ifthe file does not exist.
Option: o-deferAliases: defer
Type: BOOLOption group: OPENPhase: OPENPlatforms: none
Sets the O_DEFER flag of the open() call. This means that write data is storedin paging space until an fsync() call.
Option: o-delayAliases: delay
Type: BOOLOption group: OPENPhase: OPENPlatforms: none
Sets the O_DELAY flag of the open() call. This lets open block until the shareconditions are fulfilled (see nshare, rshare)
Option: o-directAliases: direct
Type: BOOLOption group: OPENPhase: OPENPlatforms: FreeBSD, HP-UX, Linux
Sets the O_DIRECT flag of the open() call.
Option: o-directoryAliases: directory
Type: BOOLOption group: OPENPhase: OPENPlatforms: Linux
Sets the O_DIRECTORY flag of the open() call. This lets open fail if the givenpath is not a directory. This does not seem to be useful with socat.
Option: o-dsyncAliases: dsync
Type: BOOLOption group: OPENPhase: OPENPlatforms: HP-UX, Linux, SunOS (UNIX98)
Sets the O_DSYNC flag with the open() call. This lets write() calls wait untilmodification metainfo is physically written to media.
Option: o-exclAliases: excl
Type: BOOLOption group: OPENPhase: OPENPlatforms: all
Sets the O_EXCL flag of the open() call.
Option: o-largefileAliases: largefile
Type: BOOLOption group: OPENPhase: OPENPlatforms: HP-UX, Linux, SunOS
Sets the O_LARGEFILE flag of the open() flag.
Option: o-nocttyAliases: noctty
Type: BOOLOption group: OPENPhase: OPENPlatforms: all
Sets the O_NOCTTY flag of the open() call, so the opened device does not becomethe controlling tty of the process.
Option: o-nofollowAliases: nofollow
Type: BOOLOption group: OPENPhase: OPENPlatforms: FreeBSD, Linux
Sets the O_NOFOLLOW flag of the open() call. This means that the last componentof the open path must no be a symlink.
Option: o-syncAliases: sync
Type: BOOLOption group: OPENPhase: OPENPlatforms: all (UNIX98)
Sets the O_SYNC flag with the open() call. This lets write() calls wait untildata is physically written to media.
Option: o-rshareAliases: rshare
Type: BOOLOption group: OPENPhase: OPENPlatforms: none
Sets the O_RSHARE flag of the open() call. This means that the file must not beopened for writing by other processes ("read sharing").
Option: o-nshareAliases: nshare
Type: BOOLOption group: OPENPhase: OPENPlatforms: none
Sets the O_NSHARE flag of the open() call. This means that the file must not beshared with other processes ("no sharing").
Option: o-rsyncAliases: rsync
Type: BOOLOption group: OPENPhase: OPENPlatforms: HP-UX, Linux, SunOS (UNIX98)
Sets the O_RSYNC flag with the open() call. This lets write() calls wait untilread metainfo is physically written to media.
Option: o-privAliases: priv
Type: BOOLOption group: OPENPhase: OPENPlatforms: none (Solaris)
Sets the O_PRIV flag with the open() call.
===============================================================================NAMED group optionsThis group is valid for all addresses that refer to a file system entry likefile, device, named pipe, or named UNIX domain socket.
Option: unlink-earlyAliases: new
Type: BOOLOption group: NAMEDPhase: EARLYPlatforms: all
This options tries to remove the filesystem entry given in the address beforestarting any other processing (even before user-early, perm-early, orgroup-early). unlink() is called; note that this call, in contrast to rm(1),removes entries regardless of their permissions. Instead, ownership or rootprivileges and write permissions in the directory are required and sufficient.
Option: unlink
Type: BOOLOption group: NAMEDPhase: PREOPENPlatforms: all
This options tries to remove the filesystem entry given in the address beforeit is tried to open, but past user-early, perm-early, or group-early).unlink() is called; note that this call, in contrast to rm(1), removes entriesregardless of their permissions. Instead, ownership or root privileges andwrite permissions in the directory are required and sufficient.
Option: unlink-late
Type: BOOLOption group: NAMEDPhase: PASTOPENPlatforms: all
This option tries to remove the filesystem entry after it has been opened. Options can still be applied to the file descriptor, andthe node or files data can be used, but it can no longer be accessed by otherprocesses (except by tricks?), and after closing the stream the data or node iscompletely removed.unlink() is called; note that this call, in contrast to rm(1), removes entriesregardless of their permissions. Instead, ownership or root privileges andwrite permissions in the directory are required and sufficient.
Option: perm-early=value
Type: MODET (mode_t)Option group: NAMEDPhase: PREOPENPlatforms: all
This option changes the mode (permissions) of an already existing filesystementry with chmod() before the file is opened or after the UNIX domain socket isbound, but before it listens/connects.
Option: user-early=valueAliases: uid-e=value
Type: UIDT (unsigned int or string)Option group: NAMEDPhase: PREOPENPlatforms: all
Takes one argument, a UNIX user name or a numeric user id. The firstcharacter of value is a digit for user ids.This option is applied via a chown() call before the file system entry isopened or after the UNIX domain socket is bound, but before it starts tolisten/connect.If username is a name it must be a valid username from /etc/passwd and isconverted to a user id with a getpwnam() call.On sane operating systems, the owner of the process must be root to changethe owner of a file descriptor; root may even apply undefined (unnamed) userids.
Option: group-early=valueAliases: gid-e=value
Type: GIDT (unsigned int or string)Option group: NAMEDPhase: PREOPENPlatforms: all
Takes one argument, a UNIX group name or a numeric group id. The firstcharacter of value is a digit for group ids.This option is applied via a chown() call before the file system entry isopened or after the UNIX domain socket is bound, but before itlistens/connects.If groupname is a name it must be a valid groupname from /etc/group and isconverted to a group id with a getgrnam() call.On most modern operating systems, the owner of the process must be member ofthe group being set; only root may set any group, even numbers without groupname.
Option: umask=value
Type: MODETOption group: NAMEDPhase: EARLYPlatforms: all
Sets the umask before opening a file or creating a UNIX domain socket. This isespecially useful for these sockets, because there interface does not provide amode argument.
Option: unlink-close
Type: BOOLOption group: NAMEDPhase: LATEPlatforms: all
Remove the addresses file system entry when closing the address.For named pipes, listening unix domain sockets, and the symbolic links of ptyaddresses, the default is 1; for created files, opened files, generic openedfiles, and client unix domain sockets the default is 0.
===============================================================================FORK and EXEC options
Option: path=string
Type: STRINGOption group: EXECPhase: PREEXECPlatforms: all
Changes the PATH environment variable in the child process before the exec() orsystem() call.
Option: nofork
Type: BOOLOption group: FORKPhase: BIGENPlatforms: all
Does not fork a subprocess for executing the program, instead calls execvp()directly from the actual socat instance. This avoids the overhead of another processbetween the program and the communication peer, but introduces lots ofrestrictions: * this option can only be applied to the second socat() address. * the first socat address cannot be OPENSSL or READLINE * socat options -b, -t, -D, -l, -v, -x, -t become useless * for both addresses, options ignoreeof, cr and crnl become useless * for the second address (the one with option nofork), options append, async, cloexec, flock, user, group, mode, nonblock, perm-late, setlk, and setpgid cannot be applied, and should be used on the first address instead.
Option: pipes
Type: BOOLOption group: FORKPhase: BIGENPlatforms: all
For communication between the exec() or system() subprocess with socat, use twounnamed pipes instead of creating a socket pair.
Option: pty
Type: BOOLOption group: FORKPhase: BIGENPlatforms: all
For communication between the exec() or system() subprocess with socat, use apseudo terminal instead of a socket pair. The executed program gets the slaveside, and socat the controlling side of the pseudo terminal. This is especially useful if you want to use, e.g., chat with socat (seeEXAMPLES). Plus, ptys do not buffer I/O.Note: implementation of pseudo terminals are differing between platforms, soextra porting struggles might be required for porting this feature.
Option: fdin=num
Type: USHORTOption group: FORKPhase: PASTBIGENPlatforms: all
After forking the child process, assign the stream where the childreceives data from socat, to file descriptor num instead of stdin.
Option: fdout=num
Type: USHORTOption group: FORKPhase: PASTBIGENPlatforms: all
After forking the child process, assign the stream where the childwrites data to socat, to file descriptor num instead of stdout.
Option: stderr
Type: BOOLOption group: FORKPhase: PASTFORKPlatforms: all
Normally, the stderr filedescriptor of the forked program is a clone of socat'sstderr fd. If this option is used, the programs stderr filedescriptor is a copyof the "normal" data output of the program, i.e. of its stdout or fdout.
Option: setsidAliases: sid
Type: BOOLOption group: PROCESSPhase: LATEPlatforms: all
Invokes setsid() to make the forked off subprocess the leader of a newsession. This also generates a new process group with this process as leader.This is useful, e.g., when exec'ing ssh to get the password prompt into the I/Ochannel (see EXAMPLES)
Option: setpgidAliases: pgid
Type: INTOption group: FORKPhase: LATEPlatforms: all
Invokes setpgid(0, val) from the child process.
Option: tiocscttyAliases: ctty
Type: BOOLOption group: TERMIOSPhase: LATE2Platforms: all
Applies only in combination with the pty option or its variants. Tries to makethe pty the controlling terminal. May require option setsid to work correctly.
Option: dashAliases: login
Type: BOOLOption group: EXECPhase: PREEXECPlatforms: all
Prefixes argv[0] for the execvp() call with '-', thus making a shell behave aslogin shell.
Option: sighup
Type: CONSTOption group: PARENTPhase: LATEPlatforms: all
Has socat pass an eventual SIGHUP signal to the sub process. If no address has this option, socat terminates on SIGHUP.
Option: sigint
Type: CONSTOption group: PARENTPhase: LATEPlatforms: all
Has socat pass an eventual SIGINT signal to the sub process. If no address has this option, socat terminates on SIGINT.
Option: sigquit
Type: CONSTOption group: PARENTPhase: LATEPlatforms: all
Has socat pass an eventual SIGQUIT signal to the sub process. If no address has this option, socat dumps core and terminates on SIGQUIT.
===============================================================================PTY optionsThese options may be used with addresses that create a pseudo terminal (pty).In particular, these are addresses EXEC, SYSTEM, and PTY.
Option: openpty
Type: BOOLOption group: PTYPhase: BIGENPlatforms: FreeBSD, Linux
Like pty, but only use the openpty mechanism, not any other way for ptygeneration.
Option: ptmx
Type: BOOLOption group: PTYPhase: BIGENPlatforms: HP-UX, Linux, SunOS
Like pty, but only use the /dev/ptmx (/dev/ptc on AIX) mechanism, not any otherway for pty generation.
Option: symbolic-link=filename
Type: FILENAMEOption group: PTYPhase: LATEPlatforms: all
Generates a symbolic link that points to the actual pseudo terminal (pty). Thismight help to solve the problem that ptys are generated with more or lessunpredictable names, making it difficult to directly access the socat generatedpty automatically. With this option, the user can specify a "fix" point in thefile hierarchy that helps him to access the actual pty.
Option: pty-wait-slaveAliases: wait-slave, waitslave
Type: BOOLOption group: PTYPhase: EARLYPlatforms: all
Blocks the open phase until a process opens the slave side of the pty. Usually, socat continues after generating the pty with opening the next address or with entering the transfer engine. With the wait-slave option, socat waits until some process opens the slave side of the pty before continuing. This option only works if the operating system provides the tt(poll()) system call. And it depends on an undocumented behaviour of pty's, so it does not work on all operating systems. It has successfully been tested on Linux, FreeBSD, NetBSD, and on Tru64 with openpty.
Option: pty-interval
Type: TIMESPECOption group: PTYPhase: EARLYPlatforms: all
When the wait-slave option is set, socat periodically checks the HUP condition using poll() to find if the pty's slave side has been opened. The default polling interval is 1s. Use the pty-interval option to change this value.
===============================================================================SOCKET optionsThese are options that may be applied to all socket type addresses: UNIX(LOCAL) domain sockets (even with EXEC type addresses if not pipes), IP, andIPv6.
Option: so-debugAliases: debug
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_DEBUG socket option. Requires root.
Option: so-acceptconnAliases: acceptconn
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Tries to set the SO_ACCEPTCONN socket option. Read-only!
Option: so-broadcastAliases: broadcast
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_BROADCAST socket option.
Option: so-reuseaddrAliases: reuseaddr
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_REUSEADDR socket option. Allows to bind to a port even if thisport is already used for a connection.
Option: so-keepaliveAliases: keepalive
Logical type: boolPhysical type: INTOption group: SOCKETPhase: FDPlatforms: all (UNIX98)
Sets the SO_KEEPALIVE socket option.
Option: so-linger=valueAliases: linger=value
Type: LINGEROption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Activates the SO_LINGER option and sets a value (seconds) for it.This lets shutdown() or close() block until data transfers have finished or thegiven value timed out.Note: on some systems, the type for setsockopt() is struct { int; int; }In this case, xioopen() sets {1,value}.
Option: so-oobinlineAliases: oobinline
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_OOBINLINE socket option.
Option: so-sndbuf=valueAliases: sndbuf=value
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_SNDBUF option of the socket to the given value. This option isapplied after the socket() (or socketpair()) call.NOTE: The kernel might change the effective value:My Linux 2.2 with TCP doubles the value, but uses at least 2048.
Option: so-sndbuf-late=valueAliases: sndbuf-late=value
Type: INTOption group: SOCKETPhase: LATEPlatforms: all (UNIX98)
Sets the SO_SNDBUF option of the socket to the given value. This option isapplied after the connect() or accept() (or socketpair) call.NOTE: The kernel might change the effective value:My Linux 2.2 with TCP doubles the value, but uses at least 2048, and amaximum of 131070 (system limit?).
Option: so-rcvbuf=valueAliases: rcvbuf=value
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_RCVBUF option of the socket to the given value. This option isapplied after the socket() call.NOTE: The kernel might change the effective value:My Linux 2.2 with TCP connect doubles the value, but uses at least 256 andat most 131070.My Linux 2.2 with TCP listen doubles the value but uses at least 11772.NOTE: For applying the SO_RCVBUF options after the connect() or accept() callssee rcvbuf-late.
Option: so-rcvbuf-late=valueAliases: rcvbuf-late=value
Type: INTOption group: SOCKETPhase: LATEPlatforms: all (UNIX98)
Sets the SO_RCVBUF option of the socket to the given value. This option isapplied after the connect() or listen() call.NOTE: The kernel might change the effective value:My Linux 2.2 with TCP doubles the value, but uses at least 256 and maximal131070.NOTE: sequence of this call may be relevant for the effecting value (AIX4.3.3). For applying the SO_RCVBUF option immediately after the socket() callsee rcvbuf.
Option: so-errorAliases: error
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Tries to set the SO_ERROR socket option which is a read-only option.On my Linux 2.2 it gives "protocol not available".
Option: so-type=valueAliases: type=value
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all
Set the sockettype argument of the socket() or socketpair() call. Thisoverrides the per protocol default (e.g., TCP: SOCK_STREAM). Most values might not be supported by a given protocol.The following combinations are known to work at least under one OS:TCP SOCK_STREAM (system default)UDP SOCK_DGRAM (system default)IP SOCK_RAW (socat default)UNIX SOCK_STREAM (system default)UNIX SOCK_DGRAM
Option: so-dontrouteAliases: dontroute
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_DONTROUTE socket option.
Option: so-rcvlowat=valueAliases: rcvlowat=value
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_RCVLOWAT socket option. Cannot be changed in Linux (alwaysgives "protocol not available").
Option: so-rcvtimeo=valueAliases: rcvtimeo=value
Provided type: doublePhysical type: TIMEVAL (long[2])Option group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_RCVTIMOE socket option. Cannot be changed in Linux (alwaysgives "protocol not available").
Option: so-sndlowat=valueAliases: sndlowat=value
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_SNDLOWAT socket option. Cannot be changed in Linux (alwaysgives "protocol not available").
Option: so-sndtimeo=valueAliases: sndtimeo=value
Provided type: doublePhysical type: TIMEVAL (long[2])Option group: SOCKETPhase: PASTSOCKETPlatforms: all (UNIX98)
Sets the SO_SNDTIMEO socket option. Cannot be changed in Linux (alwaysgives "protocol not available").
Option: so-auditAliases: audit
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: none
Sets the SO_AUDIT socket option.
Option: so-attach-filterAliases: attach-filter, attachfilter
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Linux docu recommends to use libpcap for this feature."protocol not available", need kernel CONFIG_FILTER!
Option: so-detach-filterAliases: detach-filter, detachfilter
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: Linux
See Linux "man 7 socket"."protocol not available", need kernel CONFIG_FILTER!
Option: so-bindtodevice=stringAliases: bindtodevice, interface, if
Type: NAMEOption group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Binds the socket to a net interface, e.g. lo0 or eth0 (interface names dependon operating system). Might require root privilege.
Option: so-bsdcompatAliases: bsdcompat
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: none
Sets the SO_BSDCOMPAT socket option. See Linux "man 7 socket".
Option: so-cksumrecvAliases: cksumrecv
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: none
Sets the SO_CKSUMRECV socket option.
Option: so-kernacceptAliases: kernaccept
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: none
Sets the SO_KERNACCEPT socket option.
Option: so-no-checkAliases: no-check, nocheck
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Sets the SO_NO_CHECK socket option." Intentionally undocumented" underLinux (see "man 7 socket"), don't know what it does....
Option: so-noreuseaddrAliases: noreuseaddr
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: none
Sets the SO_NOREUSEADDR socket option.
Option: passcredAliases: so-passcred
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Sets the SO_PASSCRED option of a socket.
Option: so-peercredAliases: peercred
Type: INT3 or int[3]?Option group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Enables receiving of credentials. Read only.Not really implemented yet.Nevertheless, Gives "Protocol not available".
Option: so-priority=valueAliases: priority=value
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Sets the protocol defined priority for all packets to be sent on this socket.Docu says it requires root privileges. Normal user may set 0..6 for UNIX domainand TCP client sockets on Linux 2.2. root may send any int value.
Option: so-reuseportAliases: reuseport
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: FreeBSD, HP-UX
Sets the SO_REUSEPORT socket option.
Option: so-security-authenticationAliases: security-authentication, securityauthentication
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Sets the SO_SECURITY_AUTHENTICATION socket option. Gives "protocol notavailable" error.In Linux 2.2.16 source, only exists in asm-*/socket.h
Option: so-security-encryption-networkAliases: security-encryption-network, securityencryptionnetwork
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Sets the SO_SECURITY_ENCRYPTION_NETWORK option of the socket. Gives "protocolnot available" error.In Linux 2.2.16 source, only exists in asm-*/socket.h
Option: so-security-encryption-transportAliases: security-encryption-transport, securityencryptiontransport
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: Linux
Sets the SO_SECURITY_ENCRYPTION_TRANSPORT option of the socket. Gives "protocolnot available" error.In Linux 2.2.16 source, only exists in asm-*/socket.h
Option: so-use-ifbufsAliases: use-ifbufs, useifbufs
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: none
Sets the SO_USE_IFBUFS socket option.
Option: so-useloopbackAliases: useloopback
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: FreeBSD, HP-UX, SunOS
Sets the SO_USELOOPBACK socket option.
Option: so-dgram-errindAliases: dgram-errind, dgramerrind
Logical type: bool?Physical type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: SunOS
Sets the SO_DGRAM_ERRIND flag.
Option: so-dontlingerAliases: dontlinger
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: SunOS
Sets the SO_DONTLINGER socket option.
Option: so-prototypeAliases: prototype
Type: INT?Option group: SOCKETPhase: PASTSOCKETPlatforms: HP-UX, SunOS
Sets the SO_PROTOTYPE socket option.
Option: type
Type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: all
Sets the type of the socket, usually as argument to the socket() orsocketpair() call, to <type>. Under Linux, 1 means stream oriented socket, 2means datagram socket, and 3 means raw socket.
Option: protocol-familyAliases: pf
Type: STRINGOption group: SOCKETPhase: PRESOCKETPlatforms: all
Forces the use of the specified IP version. <string> can be something like"ip4" or "ip6".
Option: fiosetown
Logical type: boolPhysical type: INTOption group: SOCKETPhase: PASTSOCKETPlatforms: FreeBSD, Linux
Sets the FIOSETOWN ioctl (in "man 7 socket" called FIOCSETOWN).
#Option: ciocspgrp##Allowed in addresses: SOCKET#Logical type: bool#Physical type: int##Sets the CIOCSPGRP ioctl.
#Option: addr=value##Allowed in addresses: SOCKET#Type: socket-address##For client socket, sets the local (bind) address. Not yet implemented.
Option: bind=socketaddress
Type: STRINGOption group: SOCKETPhase: BINDPlatforms: all
Gives the address to be used in the bind(2) system call. The format of thesocketaddress depends on the socket type (see below). For "client" sockets thisoption inserts a bind(2) call between socket(2) and connect(2) calls. For"server" sockets this option is ignored! For datagram sockets behaviour of thisoption is currently unspecified.Note: for client sockets in the UNIX domain this option is not useful: with thesame address as connect it will conflict with the bind call of the serversocket; another address for bind is ignored (with Linux 2.2).For TCP sockets these formats are currently implemented:HOSTNAMEHOSTNAME:PORTIPADDRIPADDR:PORT:PORT.PORT
Option: connect-timeout=seconds
Type: TIMEVALOption group: SOCKETPhase: PASTSOCKETPlatforms: all
Abort the connection attempt after the given time with error status.
#Option: backlog=value
Type: INTOption group: LISTENPhase: LISTENPlatforms: all
Sets the value to be used with the listen(2) system call. The default is 5.It does not seem to work for Linux 2.2; Linux seems to allow much moreestablished connections, but then they stay even after server processshutdown...
Option: range=address:mask, range=address/bits
Type: STRINGOption group: RANGEPhase: ACCEPTPlatforms: allImplementation status: only for INET (IP4) addresses
Defines a subnet where clients may connect from. If other clients connect theaccepted connection is shut down immediately after examination of the clientaddress. If this option is not used, the default is 0.0.0.0:0.0.0.0, allowingarbitrary client addresses. bits is the number of high order bits that mustmatch between the range value and the clients address.
Option: tcpwrap, tcpwrap=name
Type: STRING_NULLOption group: RANGEPhase: ACCEPTPlatforms: (depends on libwrap installation)
Uses the rules introduced by Wietse Venema's libwrap (tcpd) library to checkif the client is allowed to connect. The configuration files are/etc/hosts.allow and /etc/hosts.deny. See "man 5 hosts_access" for more information. <name> is passed to the wrapper functions as daemonprocess name. If omitted, the basename of socats invokation (argv[0]) ispassed. If both tcpwrap and and range options are applied to an address, bothconditions must be fulfilled to allow the connection.
Option: hosts-allow, tcpwrap-hosts-allow-table
Type: FILENAMEOption group: RANGEPhase: ACCEPTPlatforms: (depends on libwrap installation)
Takes the specified file instead of /etc/hosts.allow.
Option: hosts-deny, tcpwrap-hosts-deny-table
Type: FILENAMEOption group: RANGEPhase: ACCEPTPlatforms: (depends on libwrap installation)
Takes the specified file instead of /etc/hosts.deny.
Option: tcpwrap-etc, tcpwrap-dir
Type: FILENAMEOption group: RANGEPhase: ACCEPTPlatforms: (depends on libwrap installation)
Looks for hosts.allow and hosts.deny in the specified directory. Is overriden by options hosts-allow and hosts-deny.
-------------------------------------------------------------------------------IP options
Option: ip-options=valuesAliases: ipoptions
Type: BINOption group: SOCK_IPPhase: PASTSOCKETPlatforms: all
Sets the IP_OPTIONS values of the IP socket. For example, to send packets todestination D.D.D.D via a router G.G.G.G you have to specify G.G.G.G as the"normal" destination, and D.D.D.D in the source route:TCP:G.G.G.G:25,ip-options=x890704ddddddddNote that the destination will see G.G.G.G as sender of the packets, andtherefore might not return the answers correctly.See RFC791 for detailed specification of IP option fields.Examples:x01 ... nopx8307040a000001 ... loose source routex890b040a000001c0c1c2c3 ... strict source routeNote: with source routes, you should not specifiy destination address andhops as defined in RFC791 (first hop as IP header destination address,further hops and final destination in source route) because the (Linux?) kernel changesthem to a more intuitive form (final destination as destination in IP header,gateways in source route). So, in destination address give the finaldestination, and in the source route the gateways!Note: this option may be mulitply applied per socket but the (Linux?) kernelpads each setting with 0' to align the options end to 4 octets. So you shouldbetter pad the options data with nops (01) yourself.
Option: ip-pktinfoAliases: ippktinfo, pktinfo
Type: INT (should be struct in_pktinfo)Option group: SOCK_IPPhase: PASTSOCKETPlatforms: LinuxStatus: Not completely implemented (ancillary messages are not supported bysocat/xio)
Pass an IP_PKTINFO ancillary message.
Option: ip-recvtosAliases: iprecvtos, recvtos
Logical type: boolPhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: LinuxStatus: Not completely implemented (ancillary messages are not supported bysocat/xio)
Set the IP_RECVTOS socket option which enables IP_TOS ancillary messagepassing.
Option: ip-recvttlAliases: iprecvttl, recvttl
Logical type: boolPhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: allImplementation status: No results.
Set the IP_RECVTTL socket option.
Option: ip-recvoptsAliases: iprecvopts, recvopts
Logical type: boolPhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: allImplementation status: No results.
Set the IP_RECVOPTS socket option.
Option: ip-retoptsAliases: ipretopts, retopts
Logical type: boolPhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: allImplementation status: No results.
Set the IP_RETOPTS socket option.
Option: ip-tos=valueAliases: iptos=value, tos=value
Logical type: bytePhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: all
Sets the TOS (type of service) flags for the outgoing IP headers of thesocket. My Linux 2.2 does not allow to set values other than 0 (probablyneeds some optional kernel features).
Option: ip-ttl=valueAliases: ipttl=value, ttl=value
Logical type: bytePhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: all
Sets the TTL (time to live) field for the outgoing IP headers of the socket.0 does not seem to be useful and gives "invalid argument" error in Linux.This option can be used to implement a "poor mans traceroute" in conjunctionwith tcpdump.
Option: ip-hdrinclAliases: iphdrincl, hdrincl
Logical type: boolPhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: all
Set the IP_HDRINCL socket option. User will supply IP header before userdata. For raw IP sockets only. Not tested.
Option: ip-recverrAliases: iprecverr, recverr
Type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: Linux
Set the IP_RECVERR socket option. Implementation status: No results.
Option: ip-mtu-discover=valueAliases: ipmtudiscover=value, mtudiscover=value
Type: INT (0..2)Option group: SOCK_IPPhase: PASTSOCKETPlatforms: Linux
Sets the IP_MTU_DISCOVER flag of the IP socket. In Linux there are three valuesdefined: 0..dont(never), 1..want(per route), 2..do(always)
Option: ip-mtuAliases: ipmtu, mtu
Type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: none
Sets the MTU (maximal transfer unit) of the socket. In Linux this is aread-only parameter and results in a "protocol not available" error.
Option: ip-freebindAliases: ipfreebind, freebind
Logical type: boolPhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: none
Allows the socket to locally bind to any address, even those that arenot covered by an interface address, alias address or a local subnet. Evenbroadcast and multicast addresses are possible.Note: this option has been found on Linux 2.4 in <linux/in.h>. This file mightnot be included per default, because it creates errors.To make this option available, "make" socat with the CCOPT environmentvariable set to "-DIP_FREEBIND=15"
Option: ip-router-alert=valueAliases: iprouteralert, routeralert
Type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: Linux
Sets the IP_ROUTER_ALERT socket option. Only works with raw sockets."Invalid argument"
Option: ip-add-membership=multicast-address:interface-address ip-add-membership=multicast-address:interface-name ip-add-membership=multicast-address:interface-index ip-add-membership=multicast-address:interface-address:interface-name ip-add-membership=multicast-address:interface-address:interface-indexAliases: add-membership ip-membership
Type: IP_MREQNOption group: SOCK_IPPhase: PASTSOCKETPlatforms: all
Makes the socket member of the specified multicast group. This is currently only implemented for IPv4. The option takes the IP address of the multicast group and info about the desired network interface. The most common syntax is the first one, while the others are only available on systems that provide tt(struct mreqn) (Linux).nl() The indices of active network interfaces can be shown using the utility procan().
Option: ip-drop-membership
Not implemented.
#! Option: ipv6-join-group
Option: ip-multicast-ttl=byteAliases: ipmulticastttl, multicastttl
Type: BYTEOption group: SOCK_IPPhase: PASTSOCKETPlatforms: all
Sets the TTL used for outgoing multicast traffic. Default is 1.
Option: ip-multicast-loopAliases: ipmulticastloop, multicastloop
Logical type: boolPhysical type: INTOption group: SOCK_IPPhase: PASTSOCKETPlatforms: all
Specifies if outgoing multicast traffic should loop back to the interface.
Option: ip-multicast-if=hostnameAliases: multicast-if
Type: IP4NAMEOption group: SOCK_IPPhase: PASTSOCKETPlatforms: all
Specifies hostname or address of the network interface to be used for multicast traffic.
Option: ip-pktoptionsAliases: ippktoptions, pktoptions, pktopts
Type: INT?Option group: SOCK_IPPhase: PASTSOCKETPlatforms: Linux
Set the IP_PKTOPTIONS socket option. No docu found.Implementation status: "Protocol not available".
Option: res-debug
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the debug resolver option to all queries of this XIO address.
Option: res-aaonlyAliases: aaonly
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the aaonly resolver option to all queries of this XIO address.
Option: res-usevcAliases: usevc
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the usevc resolver option to all queries of this XIO address.
Option: res-primaryAliases: primary
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the primary resolver option to all queries of this XIO address.
Option: res-igntcAliases: igntc
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the igntc resolver option to all queries of this XIO address.
Option: res-recurseAliases: recurse
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the recurse resolver option to all queries of this XIO address.
Option: res-defnamesAliases: defnames
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the defnames resolver option to all queries of this XIO address.
Option: res-stayopenAliases: stayopen
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the stayopen resolver option to all queries of this XIO address.
Option: res-dnsrchAliases: dnsrch
Type: BOOLOption group: SOCK_IPPhase: INITPlatforms: all
Apply the dnsrch resolver option to all queries of this XIO address.
-------------------------------------------------------------------------------IP6 options
Option: ipv6-v6only=valueAlias: ipv6only, v6only
Type: BOOLOption group: SOCK_IP6Phase: PASTSOCKETPlatforms: FreeBSD, Linux
Apply the IPV6_V6ONLY socket option to the file descriptor. This controls ifthe socket listens only on the IPv6 protocol or also on IPv4.
-------------------------------------------------------------------------------IPAPP (TCP and UDP) options
Option: sourceport=valueAlias: sp=value
Type: 2BYTEOption group: IPAPP (IP_TCP and IP_UDP)Phase: LATEPlatforms: all
For outgoing (client) TCP and UDP connections, it sets the source port (local port, client side port) ofthe socket connection. For server type addresses, requires the client to usethis sourceport, otherwise socat immediately shuts down the connection. On UNIX class operating systems root privilege are required to set a sourceport between 1 and 1023 incl. 0 gives a "random" port number >= 1024, which isthe default.
Option: lowport
Type: BOOLOption group: IPAPP (IP_TCP and IP_UDP)Phase: LATEPlatforms: all
For outgoing (client) TCP and UDP connections, it sets the sourceto an unused random port between 640 and 1023 incl. On UN*X type operatingsystems, this requires root privilege, and thus guaranties the peer to beroot authorized.With TCP or UDP listen addresses, socat immediately shuts down theconnection if the client does not use a sourceport <= 1023.This mechanism can provide limited authorization under some circumstances.
-------------------------------------------------------------------------------TCP options
Option: tcp-nodelayAliases: nodelay
Logical type: boolPhysical type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: all
Sets the TCP_NODELAY flag of the TCP socket. This turns off Nagles algorithm.
Option: tcp-maxsegAliases: maxseg, mss
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: all
Limits the MAXSEG (MSS) value of the TCP socket. This option is applied beforethe connect or listen call, so it is transferred in the SYN packet to the peersocket.Linux client: 0 gives "invalid argument", higher values are used in SYNnegotiation, but effective MSS is n-12, at least 8.On AIX, this is a read-only option.
Option: tcp-maxseg-lateAliases: maxseg-late, mss-late
Type: INTOption group: IP_TCPPhase: CONNECTEDPlatforms: all
Limits the MAXSEG (MSS) value of the TCP socket. This option is applied pastthe connect or accept call, so it is not transferred as MSS to the peer socket.Observation with Linux 2.2: does not influence the size of packets generatedby the local socket.
Option: tcp-corkAliases: cork
Logical type: boolPhysical type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_CORK option.
Option: tcp-stdurgAliases: stdurg
Logical type: boolPhysical type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: none
Applies the TCP_STDURG option with setsockopt. This enables RFC 1122 complianturgent point handling.
Option: tcp-rfc1323Aliases: rfc1323
Logical type: boolPhysical type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: none
Applies the TCP_RFC1323 option with setsockopt. This enables RFC1323 TCPenhancements (window scale, timestamp).
Option: tcp-keepidleAliases: keepidle
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_KEEPIDLE value of the socket with setsockopt(). Starts keepaliveafter this period (in seconds?)
Option: tcp-keepintvlAliases: keepintvl
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_KEEPINTVL value of the socket with setsockopt(). Interval betweenkeepalives (in seconds?)
Option: tcp-keepcntAliases: keepcnt
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_KEEPCNT value of the socket with setsockopt(). Number ofkeepalives before death.
Option: tcp-syncntAliases: syncnt
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_SYNCNT value of the socket with setsockopt(). Number of SYNretransmits.
Option: tcp-linger2Aliases: linger2
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_LINGER2 value of the socket with setsockopt(). Life time oforphaned FIN-WAIT-2 state.
Option: tcp-defer-acceptAliases: defer-accept
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_DEFER_ACCEPT value of the socket with setsockopt(). accept() ofthe listener will only return when data arrived at the new connection. Thevalue is converted to seconds by some algorithm.
Option: tcp-window-clampAliases: window-clamp
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_WINDOW_CLAMP value of the socket with setsockopt(). "Bound advertisedwindow".
Option: tcp-infoAliases: info
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: FreeBSD, Linux
Sets the TCP_INFO value of the socket with setsockopt(). Is a read only option,so it always generates an error.
Option: tcp-quickackAliases: quickack
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: Linux
Sets the TCP_QUICKACK option with setsockopt().
Option: tcp-md5sigAliases: md5sig
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: none
Enables generation of MD5 digests on the packets.
Option: tcp-nooptAliases: noopt
Type: INTOption: group: IP_TCPPhase: PASTSOCKETPlatforms: FreeBSD
Disables use of TCP options.
Option: tcp-nopushAliases: nopush
Type: INTOption: group: IP_TCPPhase: PASTSOCKETPlatforms: FreeBSD
Sets the TCP_NOPUSH option.
Option: tcp-sack-disableAliases: sack-disable
Type: INTOption: group: IP_TCPPhase: PASTSOCKETPlatforms: none
Disables use the selective acknowledge feature.
Option: tcp-signature-enableAliases: signature-enable
Type: INTOption: group: IP_TCPPhase: PASTSOCKETPlatforms: none
Enables generation of MD5 digests on the packets.
Option: tcp-abort-thresholdAliases: abort-threshold
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: HP-UX, SunOS
Sets the time to wait for an answer of the peer on an established connection.
Option: tcp-conn-abort-thresholdAliases: conn-abort-threshold
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: HP-UX, SunOS
Sets the time to wait for an answer of the server during the initial connect.
Option: tcp-keepinitAliases: keepinit
Type: INTOption group: IP_TCPPhase: PASTSOCKETPlatforms: none
Sets the time to wait for an answer of the server during connect() beforegiving up. Value in half seconds, default is 150 (75s).
Option: tcp-pawsAliases: paws
Type: BOOLOption group: IP_TCPPhase: PASTSOCKETPlatforms: none
Enables the "protect against wrapped sequence numbers" feature.
Option: tcp-sackenaAliases: sackena
Type: BOOLOption group: IP_TCPPhase: PASTSOCKETPlatforms: none
Enables selective acknowledge.
Option: tcp-tsoptenaAliases: tsoptena
Type: BOOLOption group: IP_TCPPhase: PASTSOCKETPlatforms: none
Enables the time stamp option that allows RTT recalculation on existingconnections.
===============================================================================SOCKS options
Option: socksport
Type: STRINGOption group: IP_SOCKS4Phase: LATEPlatforms: all
Overrides the default socks server port 1080
Option: socksuser
Type: NAMEOption group: IP_SOCKS4Phase: LATEPlatforms: all
Overrides the system derived socks user name ($USER or $LOGNAME or "anonymous")
===============================================================================HTTP options
Option: proxyport
Type: STRINGOption group: HTTPPhase: LATEPlatforms: all
Overrides the default HTTP proxy port 8080.
Option: ignorecr
Type: BOOLOption group: HTTPPhase: LATEPlatforms: all
The HTTP protocol requires the use of CR+NL as line terminator. When a proxyserver violates this standard, socat might not understand its answer. This option directs socat to interprete NL as line terminator andto ignore CR in the answer. Nevertheless, socat sends CR+NL to the proxy.
Option: proxyauth
Type: STRINGOption group: HTTPPhase: LATEPlatforms: all
Provide "basic" authentication to the proxy server. The argument to the optionmust be the username followed by ':' followed by the password. This string isused with a "Proxy-Authorize: Base" header in base64 encoded form.
Option: resolve
Type: BOOLOption group: HTTPPhase: LATEPlatforms: all
Per default, socat sends to the proxy a CONNECT request containing the targethostname. With this option, socat resolves the hostname locally and sends theIP address.
===============================================================================TERMIOS options
These options are applied with tcsetattr calls with a struct termios.Attention: Applying these options to stdin/stdout when they refer to yourterminal might directly effect your terminal!See Linux:"man 3 termios" and Linux:"man 2 stty"
-------------------------------------------------------------------------------TERMIOS combined modes
Option: raw
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: all
Is equivalent to ignbrk=0,brkint=0,ignpar=0,parmrk=0,inpck=0,istrip=0,inlcr=0,igncr=0,icrnl=0,ixon=0,ixoff=0,iuclc=0,ixany=0,imaxbel=0,opost=0,isig=0,icanon=0,xcase=0,vmin=1,vtime=0
Option: sane
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: all
Is equivalent tocread,ignbrk=0,brkint,inlcr=0,igncr=0,icrnl,ixoff=0,iuclc=0,-ixany=0,imaxbel,opost,olcuc=0,ocrnl=0,onlcr,onocr=0,onlret=0,ofill=0,ofdel=0,nl0,cr0,tab0,bs0,vt0,ff0,isig,icanon,iexten,echo,echoe,echok,echonl=0,noflsh=0,xcase=0,tostop=0,echoprt=0,echoctl,echoke
-------------------------------------------------------------------------------TERMIOS input mode flags
Option: ignbrk
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the IGNBRK flag of the terminal driver.
Option: brkint
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the BRKINT flag of the terminal driver.
Option: ignpar
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the IGNPAR flag of the terminal driver.
Option: parmrk
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the PARMRK flag of the terminal driver.
Option: inpck
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the INPCK flag of the terminal driver. Enables input parity checking.
Option: istrip
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ISTRIP flag of the terminal driver. Strips off the eighth bit.
Option: inlcr
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the INLCR flag of the terminal driver. Translates NL to CR on input.
Option: igncr
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the IGNCR flag of the terminal driver. Ignores CR character on input.
Option: icrnl
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ICRNL flag of the terminal driver. Translates CR to NL on input. Thisoption is ignored when IGNCR is set.
Option: iuclc
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the IUCLC flag of the terminal driver. Changes characters in input fromuppercase to lowercase.
Option: ixon
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the IXON flag of the terminal driver. Enables XON/XOFF flow control onoutput (?).
Option: ixany
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the IXANY flag of the terminal driver. Enables any character to restartoutput.
Option: ixoffAliases: tandem
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the IXOFF flag of the terminal driver. Enables XON/XOFF flow control oninput.
Option: imaxbel
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the IMAXBEL flag of the terminal driver. Rings the bell when the inputqueue is full.
-------------------------------------------------------------------------------TERMIOS output mode flags
Option: opost
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the OPOST flag of the terminal driver.
Option: olcuc
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the OLCUC flag of the terminal driver.
Option: onlcr
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ONLCR flag of the terminal driver.
Option: ocrnl
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the OCRNL flag of the terminal driver.
Option: onocr
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ONOCR flag of the terminal driver.
Option: onlret
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ONLRET flag of the terminal driver.
Option: ofill
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the OFILL flag of the terminal driver.
Option: ofdel
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the OFDEL flag of the terminal driver.
Option: nldly
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the NLDLY flag of the terminal driver. 0 sets the value to NL0, and 1 toNL1. See nl0, nl1.
Option: nl0
Type: CONST (const bool, always sets 0)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field NLDLY to the value NL0.
Option: nl1
Type: CONST (const bool, always sets 1)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field NLDLY to the value NL1.
Option: crdly=value
Type: UINT (0..3)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field CRDLY to the given value.See cr0, cr1, cr2, cr3.
Option: cr0
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the CRDLY field to the value CR0.See crdly.
Option: cr1
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the CRDLY field to the value CR1.See crdly.
Option: cr2
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the CRDLY field to the value CR2.See crdly.
Option: cr3
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the CRDLY field to the value CR3.See crdly.
Option: tab0
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the horizontal tab delay mask to TAB0.See tabdly.
Option: tab1
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the horizontal tab delay mask to TAB1.See tabdly.
Option: tab2
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the horizontal tab delay mask to TAB2.See tabdly.
Option: tab3
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the horizontal tab delay mask to TAB3.See tabdly.
Option: tabdly=value
Type: UINT (0..3)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field TABDLY to the given value.See tab0, tab1, tab2, and tab3.
Option: xtabs
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the horizontal tab delay mask to XTABS.
Option: bs0
Type: CONST (0)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field BSDLY to the value BS0
Option: bs1
Type: CONST (1)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field BSDLY to the value BS1
Option: bsdly
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the BSDLY flag of the terminal driver. 0 sets the value to BS0, and 1 toBS1. See bs0, bs1.
Option: vt0
Type: CONST (0)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field VTDLY to the value VT0
Option: vt1
Type: CONST (1)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field VTDLY to the value VT1
Option: vtdly
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the VTDLY flag of the terminal driver. 0 sets the value to VT0, and 1 toVT1. See vt0, vt1.
Option: ff0
Type: CONST (0)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field FFDLY to the value FF0See ffdly.
Option: ff1
Type: CONST (1)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the field FFDLY to the value FF1See ffdly.
Option: ffdly
Type: BOOL (0..1)Option group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the FFDLY flag of the terminal driver. 0 sets the value to FF0, and 1 toFF1. See ff0, ff1.
-------------------------------------------------------------------------------TERMIOS control mode flags
Option: cs5
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: all
Sets the field CSIZE to the value CS5
Option: cs6
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: all
Sets the field CSIZE to the value CS6
Option: cs7
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: all
Sets the field CSIZE to the value CS7
Option: cs8
Type: CONSTOption group: TERMIOSPhase: FDPlatforms: all
Sets the field CSIZE to the value CS8
Option: csize
Type: UINT (0..3)Option group: TERMIOSPhase: FDPlatforms: all
Sets the field CSIZE. 0..CS5, 1..CS6, 2..CS7, 3..CS8
Option: cstopb
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the flag CSTOPB.
Option: cread
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the value of the CREAD flag.
Option: parenb
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the PARENB flag of the terminal driver.
Option: parodd
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the PARODD flag of the terminal driver.
Option: hupclAliases: hup
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the HUPCL flag of the terminal driver.
Option: clocal
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the CLOCAL flag of the terminal driver.
Option: crtscts
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: FreeBSD, Linux, SunOS
Sets the CRTSCTS flag of the terminal driver.
Option: b0 (HP-UX, Linux, SunOS)Option: b50 (HP-UX, Linux, SunOS)Option: b75 (HP-UX, Linux, SunOS)Option: b110 (HP-UX, Linux, SunOS)Option: b134 (HP-UX, Linux, SunOS)Option: b150 (HP-UX, Linux, SunOS)Option: b200 (HP-UX, Linux, SunOS)Option: b300 (HP-UX, Linux, SunOS)Option: b600 (HP-UX, Linux, SunOS)Option: b900 (HP-UX)Option: b1200 (HP-UX, Linux, SunOS)Option: b1800 (HP-UX, Linux, SunOS)Option: b2400 (HP-UX, Linux, SunOS)Option: b3600 (HP-UX)Option: b4800 (HP-UX, Linux, SunOS)Option: b7200 (HP-UX)Option: b9600 (HP-UX, Linux, SunOS)Option: b19200 (HP-UX, Linux, SunOS)Option: b38400 (HP-UX, Linux, SunOS)Option: b57600 (HP-UX, Linux, SunOS)Option: b115200 (HP-UX, Linux, SunOS)Option: b230400 (HP-UX, Linux, SunOS)Option: b460800 (HP-UX, Linux, SunOS)Option: b500000 (Linux)Option: b576000 (Linux)Option: b921600 (Linux)Option: b1000000 (Linux)Option: b1152000 (Linux)Option: b1500000 (Linux)Option: b2000000 (Linux)Option: b2500000 (Linux)Option: b3000000 (Linux)Option: b3500000 (Linux)Option: b4000000 (Linux)
Type: CONSTOption group: TERMIOSPhase: FD
Sets the baud rate to the implied value. b0 "hangs up" the connection.
Option: ispeed
Type: UINTOption group: TERMIOSPhase: FDPlatforms: FreeBSD, Linux
Sets the input baud rate to the specified value. This works on systems wherestruct termios has a special c_ispeed field.
Option: ospeed
Type: UINTOption group: TERMIOSPhase: FDPlatforms: FreeBSD, Linux
Sets the input baud rate to the specified value. This works on systems wherestruct termios has a special c_ospeed field.
-------------------------------------------------------------------------------TERMIOS local mode flags
Option: isig
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ISIG flag of the terminal driver.
Option: icanon
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ICANON flag of the terminal driver.
Option: xcase
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: HP-UX, Linux, SunOS
Sets the XCASE flag of the terminal driver.
Option: echo
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ECHO flag of the terminal driver.
Option: echoeAliases: crterase
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ECHOE flag of the terminal driver.
Option: echok
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ECHOK flag of the terminal driver.
Option: echonl
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ECHONL flag of the terminal driver.
Option: echoctlAliases: ctlecho
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ECHOCTL flag of the terminal driver.
Option: echoprtAliases: prterase
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ECHOPRT flag of the terminal driver.
Option: echokeAliases: crtkill
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the ECHOKE flag of the terminal driver.
Option: flusho
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the FLUSHO flag of the terminal driver.
Option: noflsh
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the NOFLSH flag of the terminal driver.
Option: tostop
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the TOSTOP flag of the terminal driver.
Option: pendin
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the PENDIN flag of the terminal driver.
Option: iexten
Type: BOOLOption group: TERMIOSPhase: FDPlatforms: all
Sets the IEXTEN flag of the terminal driver.
-------------------------------------------------------------------------------TERMIOS options for functional characters
Option: vintr=valueAliases: intr=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VINTR character that interrupts the current process.On UNIX systems the preset value usually is 3 (^C).
Option: vquit=valueAliases: quit=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VQUIT character that quits the current process. On my Linux 2.2 system the preset value is 0x1c (^\).
Option: verase=valueAliases: erase=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VERASE character that erases the last character.On many UNIX systems the preset value is 0x7f.
Option: vkill=valueAliases: kill=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VKILL character that kills (erases) the current line.On my Linux 2.2 system systems the preset value is 0x15 (^U).
Option: veof=valueAliases: eof=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VEOF character that kills indicate end of file.On most UNIX systems the preset value is 0x04 (^D).
Option: vtime=valueAliases: time=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: not tested
Sets the value of VTIME. See "man 1 stty" / time.On my Linux 2.2 system the preset value is 0.
Option: vmin=valueAliases: min=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: not tested
Sets the value of VMIN. See "man 1 stty" / time.On my Linux 2.2 system the preset value is 1.
Option: vswtc=valueAliases: swtc=value, swtch=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: LinuxStatus: not tested
Sets the value of VSWTC. "Switches to a different shell layer".On my Linux 2.2 system the preset value is 0.
Option: vstart=valueAliases: start=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VSTART character that resumes data flow after a stop.Usually the preset value is 0x11 (^Q).
Option: vstop=valueAliases: stop=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VSTOP character that stops output.Usually the preset value is 0x13 (^S)
Option: vsusp=valueAliases: susp=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VSUSP character that suspends the current foregroundprocess and reactivates the shell.Usually the preset value is 0x1a (^Z)
Option: vdsusp=valueAliases: dsusp=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: FreeBSD, HP-UX, SunOSStatus: tested
Sets the value for the VDSUSP character that suspends the current foregroundprocess and reactivates the shell.
Option: veol=valueAliases: eol=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested with awkward results
Sets the value for the VEOL character that should indicate end of line.Not clear what differentiates it from the return key; xterm window put "xterm"into the input buffer.On my Linux 2.2 system the preset value is 0 (disabled)
Option: vreprint=valueAliases: reprint=value, rprnt=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: FreeBSD, Linux, SunOSStatus: not tested
Sets the value for the VREPRINT character that should reprint the current line.On my Linux 2.2 system the preset value is 0x12 (^R). Nevertheless, bashenters backward search mode.
Option: vdiscard=valueAliases: discard=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: FreeBSD, Linux, SunOSStatus: not tested
Sets the value for the VDISCARD character.On my Linux 2.2 system the preset value is 0x0f (^O)
Option: vwerase=valueAliases: werase=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VWERASE character that erases the last word.On my Linux 2.2 system the preset value is 0x17 (^W)
Option: vlnext=valueAliases: lnext=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: tested
Sets the value for the VLNEXT character that lets the next input character raw(not interpreted).On my Linux 2.2 system the preset value is 0x16 (^V)
Option: veol2=valueAliases: eol2=value
Type: BYTEOption group: TERMIOSPhase: FDPlatforms: allStatus: not tested
Sets the value for the VEOL2 character.On my Linux 2.2 system the preset value is 0 (disabled).
===============================================================================READLINE options
Option: history-file=filenameAliases: history=filename
Type: STRINGOption group: READLINEPhase: LATEPlatforms: (depends on libreadline installation)
Without this option, the readline address uses only a per process historylist. With this option, socat tries to read history lines during initializationfrom the given file, and on termination writes the old and new lines to thefile.NOTE: currently, no mechanism is implemented for limiting the length of thehistory file.NOTE: filename must be a valid relativ or absolute path; "~" is not supported!
Option: noprompt
Type: BOOLOption group: READLINEPhase: LATEPlatforms: all
Since version 1.3.3, socat per default tries to determine a prompt - that is then passed to the readline call - by remembering the lastincomplete line of the output. With this option, socat does not pass aprompt to the readline call, so it might set the cursor to the first columnof the terminal.
Option: noecho
Type: STRINGOption group: READLINEPhase: LATEPlatforms: all
Specifies a regular pattern for a prompt that prevents the following inputline from being displayed on the screen and from being added to the history.The prompt is defined as the text that was output to the readline address after the lastest newline character and before an input character wastyped. The pattern is a regular expression, e.g."^[Pp]assword:.*$" or "([Uu]ser:|[Pp]assword:)". See regex(7) for details.
Option: prompt
Type: STRINGOption group: READLINEPhase: LATEPlatforms: all
Passes the string as prompt to the readline function. readline prints thisprompt when stepping through the history. If this string matches a constantprompt issued by an interactive program on the other socat address,consistent look and feel can be archieved.
===============================================================================OPENSSL options
Option: openssl-cipherlist=stringAliases: cipherlist=string, ciphers=string, cipher=string
Type: STRINGOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
Selects the list of ciphers that may be used for the connection.See the man page ciphers(1), section CIPHER LIST FORMAT, fordetailed information about syntax, values, and default of the cipherliststring.Several cipher strings may be given, separated by ':'.Some simple cipher strings: 3DES Uses a cipher suite with triple DES. MD5 Uses a cipher suite with MD5. aNULL Uses a cipher suite without authentication. NULL Does not use encryption. HIGH Uses a cipher suite with "high" encryption.Note that the peer must support the selected property, or the negotiationwill fail.
Option: openssl-method=stringAliases: method=string
Type: STRINGOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
Sets the protocol version to be used. Valid strings (not case sensitive) are: SSLv2 Select SSL protocol version 2. SSLv3 Select SSL protocol version 3. SSLv23 Select SSL protocol version 2 or 3. This is the default when this option is not provided. TLSv1 Select TLS protocol version 1.
Option: openssl-verify=boolAliases: verify=bool
Type: BOOLOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
Controls check of the peer's certificate. Default is 1 (true). Disabling verify might open your socket for everyone!
Option: openssl-certificate=fileAliases: cert=file
Type: FILENAMEOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
Specifies the file with the certificate. The certificate must bein OpenSSL format (*.pem). With openssl-listen, this option is stronglyrecommended: except with cipher aNULL, "no shared ciphers" error mightoccur when no certificate is given.
Option: openssl-key=fileAliases: key
Type: FILENAMEOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
Specifies the file with the private key. The private key may be in thisfile or in the file given with the ref(cert) option. The party that hasto proof that it is the owner of a certificate needs the private key.
Option: openssl-cafile=fileAliases: cafile
Type: FILENAMEOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
Specifies the file with the trusted (root) authority certificates. The filemust be in PEM format and should contain one or more certificates.
Option: openssl-capath=directoryAliases: capath
Type: FILENAMEOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
Specify the directory with the trusted (root) certificates. The directorymust contain certificates in PEM format and their hashes (see OpenSSLdocumentation)
Option: openssl-egd=fileAliases: egd
Type: FILENAMEOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
On some systems, openssl requires an explicit source of random data. Specifythe socket name where an entropy gathering daemon like egd provides randomdata, e.g. /dev/egd-pool.
Option: openssl-pseudoAliases: pseudo
Type: BOOLOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
On systems where openssl cannot find an entropy source and where no entropygathering daemon can be utilized, this option activates a mechanism forproviding pseudo entropy. This is archieved by taking the current time inmicroseconds for feeding the libc pseudo random number generator with aninitial value. openssl is then feeded with output from random calls.NOTE:This mechanism is not sufficient for generation of secure keys!
Option: openssl-fipsAliases: fips
Type: BOOLOption group: BOOLPhase: SPECPlatforms: (depends on OpenSSL installation and FIPS implementation)
Enables FIPS mode if compiled in. For info about the FIPS encryptionimplementation standard see http://oss-institute.org/fips-faq.html.This mode might require that the involved certificates are generated with aFIPS enabled version of openssl. Setting or clearing this option on onesocat address affects all OpenSSL addresses of this process.
Option: openssl-compressAliases: compress
Type: STRINGOption group: OPENSSLPhase: SPECPlatforms: (depends on openssl installation)
Enable or disable the use of compression for a connection. Setting this to"none" disables compression, setting it to "auto" lets OpenSSL choose the bestavailable algorithm supported by both parties. The default is to not touch anycompression-related settings.NOTE: Requires OpenSSL 0.9.8 or higher.NOTE: Disabling compression with OpenSSL 0.9.8 affects all new connections inthe same process.
===============================================================================Application specific address options
Option: ignoreeofAliases: ignoreof
Type: BOOLOption group: APPLPhase: LATEPlatforms: all
This option has to be supported by the application. For socat it means that anEOF condition on this data source does not trigger termination procedures, but instead the read/write loop waits for one second and then tries to read moreinput data. This behaviour emulates "tail -f" and might not be useful for allkinds of input devices, but regular files and /dev/null are good candidates. Termination of socat then can only occur by EOF condition of the other inputdevice, an error, or by external events.
Option: cr
Type: CONSTOption group: APPLPhase: LATEPlatforms: all
The appropriate data endpoint uses CR ('\r', 0x0d) as line terminatorcharacter. Convert data to and from this stream appropriately.This is useful for, e.g., modems.
Option: crnlAliases: crlf
Type: CONSTOption group: APPLPhase: LATEPlatforms: all
The appropriate data endpoint uses CR+LF ("\r\n", 0x0d0a ) as line terminatorstring. Convert data to and from this stream appropriately.This is useful for, e.g., TCP protocols like SMTP and FTP.
Option: readbytes=numAliases: bytes
Type: SIZE_TOption group: APPLPhase: LATEPlatforms: all
socat reads only so many bytes from this address (the address providesonly so many bytes for transfer and pretends to be at EOF afterwards).
Option: lockfile=filename
Type: FILENAMEOption group: APPLPhase: INITPlatforms: all
If lockfile exists, exits with error. If lockfile does not exist, creates itand continues; removes lockfile on exit.
Option: waitlock=filename
Type: FILENAMEOption group: APPLPhase: INITPlatforms: all
If lockfile exists, waits until it disappears. When lockfile does not exist,creates it and continues; removes lockfile on exit.
===============================================================================RETRY options
Option: retry=<num>
Type: UINTOption group: RETRYPhase: INITPlatforms: all
Number of retries before the connection or listen attempt is aborted. Default is 0, which means just one attempt.
Option: interval=<double>
Type: TIMESPECOption group: RETRYPhase: INITPlatforms: all
Time between consecutive attempts (seconds). Default is 1 second.
Option: forever
Type: BOOLOption group: RETRYPhase: INITPlatforms: all
Performs an unlimited number of retry attempts.
===============================================================================EXT2 options
Option: ext2-secrm=<bool>Aliases: secrm=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the secrm file attribute on the file.
Option: ext2-unrm=<bool>Aliases: unrm=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the unrm file attribute on the file.
Option: ext2-compr=<bool>Aliases: compr=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the compr file attribute on the file.
Option: ext2-sync=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: all
Sets the sync file attribute on the file.
Option: ext2-immutable=<bool>Aliases: immutable=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the immutable file attribute on the file.
Option: ext2-append=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: all
Sets the append file attribute on the file.
Option: ext2-nodump=<bool>Aliases: nodump=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the nodump file attribute on the file.
Option: ext2-noatime=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the noatime file attribute on the file.
Option: ext2-journal-data=<bool>Aliases: journal-data=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the journal-data file attribute on the file.
Option: ext2-notail=<bool>Aliases: notail=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: none
Sets the notail file attribute on the file.
Option: ext2-dirsync=<bool>Aliases: dirsync=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the dirsync file attribute on the file.
Option: ext2-topdir=<bool>Aliases: topdir=<bool>
Type: BOOLOption group: REGPhase: FDPlatforms: Linux
Sets the topdir file attribute on the file.
===============================================================================
Appendix: generating a sandbox (chroot environment)
While it is possible to generate a sandbox almost anywhere in the file system,I recommend to use a file system that has been mounted with restrictions,especially nosuid and maybe nodev, or even ro.
You may mount a dedicated file system for the sandbox, so it gets a littleharder for the guests to determine for sure if they are within a sandbox whenusing "ls -id /"
The following desribes typical steps for generating a sandbox. Depending onyour operating system, application, and security requirements, your mileage mayvary. With the below steps, you will be able to run some check programs to playaround with the sandbox.
I Installation1) Create a sandbox group - but give it and all following "sandbox" ids a morecryptic name!2) Create a sandbox user, only in sandbox group. If this user must never login,give it a useless shell like /bin/false3) Check the sandbox home directory (e.g. /home/sandbox) and save and removeall .profile, public_html/ etc.4) Optionally mount a new file system over the new home directory5) Generate subdirectories bin, lib, etc, usr, usr/bin, usr/lib.Set their permissions and ownership equal to the original directories (or useonly root.root)6) Generate subdirectory home/sandbox (or similarly; like sandbox home)7) Generate etc/passwd with users sandbox and root, but do not store originalpassword hashes there!8) Generate etc/group with only groups sandbox and root (or system on AIX)9) Copy test programs and utilities to bin, e.g. su, id, ls, mount, strace (butwithout SUID/SGID)10) Copy the required shared libraries and the shared library loader to theirdirectories. On Linux, e.g. /lib/ld-linux.so.2, /lib/libnss_compat.so.2Note: it is often difficult to find out what shared libraries are (still) notinstalled in the sandbox. The programs invoked in the sandbox typically do notgive useful error messages. If chroot's exec call gives an error like "no suchfile or directory", and you do not know if it even found the program itself,then remove the test programs execute permission; the error message shouldchange to "execute permission denied" or so. Redo the execute permissions andlook for the shared libraries...List required libraries of a program:Linux: ldd <program>AIX: xdb <program> map
11) For testing purposes, install id, ls, su, mount, strace, and maybe sh inthe sandbox. Test it.
II Customization12) Copy your applications, configuration files, and data to the appropriatedirectories within the sandbox.Test function of the application in the sandbox, and add missing files andlibraries. If an application program gets killed immediately after start, itmight miss a shared library.
III Cleanup, check13) Implement your own tricks how to improve security of the sandbox14) Remove test programs like bin/sh, id, ls, mount, strace
===============================================================================socket types, modes and their security features:IP.v4.TCP.connectIP.v4.TCP.listen range tcpwrap srcport lowportIP.v4.UDP.connectIP.v4.UDP.listen range tcpwrap srcport lowportIP.v4.UDP.sendtoIP.v4.UDP.recvfrom range tcpwrap srcport lowportIP.v4.UDP.recv range tcpwrap srcport lowportIP.v4.raw.sendtoIP.v4.raw.recvfrom range tcpwrapIP.v4.raw.recv range tcpwrapIP.v6.TCP.connectIP.v6.TCP.listen range tcpwrap srcport lowportIP.v6.UDP.connectIP.v6.UDP.listen range tcpwrap srcport lowportIP.v6.UDP.sendtoIP.v6.UDP.recvfrom range tcpwrap srcport lowportIP.v6.UDP.recv range tcpwrap srcport lowportIP.v6.raw.sendtoIP.v6.raw.recvfrom range tcpwrapIP.v6.raw.recv srcport lowportUNIX.stream.connectUNIX.stream.listenUNIX.dgram.sendtoUNIX.dgram.recvfromUNIX.dgram.recvOPENSSL.connectOPENSSL.TCP4.listen range tcpwrap srcport lowportOPENSSL.TCP6.listen range tcpwrap srcport lowport
===============================================================================Missing features and Caveats:
. no support for SIGIO mechanism. no support for socket ancillary messages. Probably many ioctls not implemented due to missing documentation. only limited implementation of raw sockets and interfaces,. no support for high level sockets beyond UNIX, INET, and INET6 domains
|