diff -rauN socat-2.0.0-b4/doc/socat.1 socat-2.0.0-b4-p1/doc/socat.1 --- socat-2.0.0-b4/doc/socat.1 2010-07-06 07:59:41.000000000 +0200 +++ socat-2.0.0-b4-p1/doc/socat.1 2011-09-04 22:38:29.000000000 +0200 @@ -7,9 +7,9 @@ .SH "SYNOPSIS" \f(CWsocat [options] \fP .br -\f(CWsocat -V\fP +\f(CWsocat \-V\fP .br -\f(CWsocat -h[h[h]] | -?[?[?]]\fP +\f(CWsocat \-h[h[h]] | \-?[?[?]]\fP .br \f(CWfilan\fP .br @@ -27,7 +27,7 @@ .PP \fBFilan\fP is a utility that prints information about its active file descriptors to stdout\&. It has been written for debugging \fBsocat\fP, but might be -useful for other purposes too\&. Use the -h option to find more infos\&. +useful for other purposes too\&. Use the \-h option to find more infos\&. .PP \fBProcan\fP is a utility that prints information about process parameters to stdout\&. It has been written to better understand @@ -72,11 +72,11 @@ Print a help text to stdout describing command line options and available address types, and exit\&. .IP "\fB\f(CW-hh | -??\fP\fP" -Like -h, plus a list of the short names of all available address options\&. Some options are +Like \-h, plus a list of the short names of all available address options\&. Some options are platform dependend, so this output is helpful for checking the particular implementation\&. .IP "\fB\f(CW-hhh | -???\fP\fP" -Like -hh, plus a list of all available address option names\&. +Like \-hh, plus a list of all available address option names\&. .IP "\fB\f(CW-d\fP\fP" Without this option, only fatal and error messages are generated; applying this option also prints warning messages\&. See DIAGNOSTICS @@ -91,7 +91,7 @@ .IP "\fB\f(CW-D\fP\fP" Logs information about file descriptors before starting the transfer phase\&. .IP "\fB\f(CW-ly[]\fP\fP" -Writes messages to syslog instead of stderr; severity as defined with -d +Writes messages to syslog instead of stderr; severity as defined with \-d option\&. With optional , the syslog type can be selected, default is "daemon"\&. .IP "\fB\f(CW-lf\fP\fP\f(CW \fP" @@ -223,7 +223,7 @@ Some keywords are overloaded with multiple \fIaddress forms\fP that may differ in the following properties: Endpoint or inter address; number of parameters; supported transfer directions on the left side\&. To see all -address forms available invoke socat with option -h\&. The first +address forms available invoke socat with option \-h\&. The first set of rwb flags describes the transfer directions on the address\&'s left side (read, write, and bidirectional, as seen by this address)\&. The second set describes the required direction on the right side; empty means it is an @@ -232,7 +232,7 @@ When parsing the addresses within an address chain \fBsocat\fP takes care of the data transfer directions between consecutive addresses\&. For the first address the directions are bidirectional per default, or unidirectional when when -option -u or -U is used\&. For the following +option \-u or \-U is used\&. For the following addresses, the required directions are derived from the right side directions of the left neighbor\&. .PP @@ -243,7 +243,7 @@ For filtering the options that are useful with an address type, each option is member of one option group\&. For each address type there is a set of option groups allowed\&. Only options -belonging to one of these address groups may be used (except with option -g)\&. +belonging to one of these address groups may be used (except with option \-g)\&. .PP Address specifications following the above schema are also called \fIsingle\fP address specifications\&. @@ -772,7 +772,7 @@ Listens on [TCP service] and accepts a TCP/IP connection\&. The IP version is 4 or the one specified with address option pf, \fBsocat\fP option -(-4, -6), or environment variable SOCAT_DEFAULT_LISTEN_IP\&. +(\-4, \-6), or environment variable SOCAT_DEFAULT_LISTEN_IP\&. Note that opening this address usually blocks until a client connects\&. .br @@ -821,7 +821,7 @@ .br Please note that you can - beyond the options of the specified groups - also use options of higher level protocols when you apply \fBsocat\fP option --g\&. +\-g\&. .br Option groups: FD,SOCKET,CHILD,RETRY .br @@ -848,7 +848,7 @@ .br Please note that you can - beyond the options of the specified groups - also use options of higher level protocols when you apply \fBsocat\fP option --g\&. +\-g\&. .br Option groups: FD,SOCKET,RANGE .br @@ -876,7 +876,7 @@ .br Please note that you can - beyond the options of the specified groups - also use options of higher level protocols when you apply \fBsocat\fP option --g\&. +\-g\&. .br Option groups: FD,SOCKET,LISTEN,RANGE,CHILD,RETRY .br @@ -1108,7 +1108,7 @@ Listens on [TCP service] and accepts a TCP/IP connection\&. The IP version is 4 or the one specified with address option pf, \fBsocat\fP option -(-4, -6), or environment variable SOCAT_DEFAULT_LISTEN_IP\&. +(\-4, \-6), or environment variable SOCAT_DEFAULT_LISTEN_IP\&. Note that opening this address usually blocks until a client connects\&. .br @@ -1445,7 +1445,7 @@ .IP "\fB\f(CWUNIX-SENDTO:\fP\fP" Communicates with the specified peer socket, defined by [] assuming it is a UNIX domain datagram socket\&. It sends packets to and receives packets from that peer socket only\&. -Please note that it might be neccessary to bind the +Please note that it might be necessary to bind the local socket to an address (e\&.g\&. \f(CW/tmp/sock1\fP, which must not exist before)\&. This address type works well with \fBsocat\fP UNIX-RECVFROM and UNIX-RECV address @@ -1540,7 +1540,7 @@ will fail\&. To catch most useless combinations as early as in the open phase, the concept of \fIoption groups\fP was introduced\&. Each option belongs to one or more option groups\&. Options can be used only with address types that support -at least one of their option groups (but see option -g)\&. +at least one of their option groups (but see option \-g)\&. .PP Address options have data types that their values must conform to\&. Every address option consists of just a keyword or a keyword followed by @@ -1603,7 +1603,7 @@ options may be applied to any address\&. .br Note: Some of these options are also member of another option group, that -provides an other, non-fd based mechanism\&. +provides another, non-fd based mechanism\&. For these options, it depends on the actual address type and its option groups which mechanism is used\&. The second, non-fd based mechanism is prioritized\&. .IP "\fB\f(CWcloexec=\fP\fP" @@ -1788,7 +1788,7 @@ long as there are still links from other processes\&. .br Similarly, when an address of type EXEC or SYSTEM is ended, \fBsocat\fP usually -will explicitely kill the sub process\&. With this option, it will just close +will explicitly kill the sub process\&. With this option, it will just close the file descriptors\&. .IP "\fB\f(CWshut-none\fP\fP" Changes the (address dependent) method of shutting down the write part of a @@ -1812,7 +1812,7 @@ .IP "\fB\f(CWioctl-void=\fP\fP" Calls \f(CWioctl()\fP with the request value as second argument and NULL as third argument\&. This option allows to utilize ioctls that are not -explicitely implemented in socat\&. +explicitly implemented in socat\&. .IP "\fB\f(CWioctl-int=:\fP\fP" Calls \f(CWioctl()\fP with the request value as second argument and the integer value as third argument\&. @@ -2092,7 +2092,7 @@ Note: \fBsocat\fP simply strips all CR characters\&. .IP "\fB\f(CWignoreeof\fP\fP" When EOF occurs on this channel, \fBsocat\fP ignores it and tries to read more -data (like "tail -f") (example)\&. +data (like "tail \-f") (example)\&. .IP "\fB\f(CWreadbytes=\fP\fP" \fBsocat\fP reads only so many bytes from this address (the address provides only so many bytes for transfer and pretends to be at EOF afterwards)\&. @@ -2626,7 +2626,7 @@ .IP o the first \fBsocat\fP address cannot be OPENSSL or READLINE .IP o -\fBsocat\fP options -b, -t, -D, -l, -v, -x become useless +\fBsocat\fP options \-b, \-t, \-D, \-l, \-v, \-x become useless .IP o for both addresses, options ignoreeof, cr, and crnl become useless .IP o @@ -2693,7 +2693,7 @@ Disconnects the terminal\&. .IP "\fB\f(CWb19200\fP\fP" Sets the serial line speed to 19200 baud\&. Some other rates are possible; use -something like \f(CWsocat -hh |grep \&' b[1-9]\&'\fP to find all speeds supported by +something like \f(CWsocat \-hh |grep \&' b[1-9]\&'\fP to find all speeds supported by your implementation\&. .br Note: On some operating systems, these options may not be @@ -3207,14 +3207,14 @@ .IP \.LP \.nf -\fBsocat -d -d READLINE,history=$HOME/.http_history \\ +\fBsocat \-d \-d READLINE,history=$HOME/.http_history \\ TCP4:www.domain.org:www,crnl\fP \.fi .IP this is similar to the previous example, but you can edit the current line in a bash like manner (READLINE) and use the history file \&.http_history; \fBsocat\fP prints messages about -progress (-d -d)\&. The port is specified by service name +progress (\-d \-d)\&. The port is specified by service name (www), and correct network line termination characters (crnl) instead of NL are used\&. .IP @@ -3229,7 +3229,7 @@ .IP \.LP \.nf -\fBsocat -d -d -lmlocal2 \\ +\fBsocat \-d \-d \-lmlocal2 \\ TCP4-LISTEN:80,bind=myaddr1,reuseaddr,fork,su=nobody,range=10.0.0.0/8 \\ TCP4:www.domain.org:80,bind=myaddr2\fP \.fi @@ -3246,7 +3246,7 @@ (range); due to reuseaddr, it allows immediate restart after master process\&'s termination, even if some child sockets are not completely shut down\&. -With -lmlocal2, \fBsocat\fP logs to stderr until successfully +With \-lmlocal2, \fBsocat\fP logs to stderr until successfully reaching the accept loop\&. Further logging is directed to syslog with facility local2\&. .IP @@ -3323,18 +3323,18 @@ .IP this is an example for unidirectional data transfer -(-u)\&. \fBSocat\fP transfers data +(\-u)\&. \fBSocat\fP transfers data from file /tmp/readdata (implicit address GOPEN), starting at its current end (seek-end=0 lets \fBsocat\fP start reading at current end of file; use seek=0 or no -seek option to first read the existing data) in a "tail -f" like mode +seek option to first read the existing data) in a "tail \-f" like mode (ignoreeof)\&. The "file" might also be a listening UNIX domain socket (do not use a seek option then)\&. .IP \.LP \.nf \fB(sleep 5; echo PASSWORD; sleep 5; echo ls; sleep 1) | -socat - EXEC:'ssh -l user server',pty,setsid,ctty\fP +socat - EXEC:'ssh \-l user server',pty,setsid,ctty\fP \.fi .IP EXEC\&'utes an ssh session to server\&. Uses a pty for communication between \fBsocat\fP and @@ -3344,7 +3344,7 @@ .IP \.LP \.nf -\fBsocat -u TCP4-LISTEN:3334,reuseaddr,fork \\ +\fBsocat \-u TCP4-LISTEN:3334,reuseaddr,fork \\ OPEN:/tmp/in.log,creat,append\fP \.fi .IP @@ -3431,7 +3431,7 @@ connected to the TCP socket (nofork)\&. The shell starts filan and lets it print the socket addresses to stderr (your terminal window)\&. .IP -.IP "\fB\f(CWecho -e "\e0\e14\e0\e0\ec" |socat -u - file:/usr/bin/squid\&.exe,seek=0x00074420\fP\fP" +.IP "\fB\f(CWecho -e \(dq\e0\e14\e0\e0\ec\(dq |socat -u - file:/usr/bin/squid\&.exe,seek=0x00074420\fP\fP" .IP functions as primitive binary editor: it writes the 4 bytes 000 014 000 000 to @@ -3459,8 +3459,9 @@ sends a broadcast to the network 192\&.168\&.1\&.0/24 and receives the replies of the timeservers there\&. Ignores NTP packets from hosts outside this network\&. .IP -.IP "\fB\f(CWsocat - SOCKET-DATAGRAM:2:2:17:x007bxc0a80100x0000000000000000,bind=x007bx00000000x0000000000000000,setsockopt-int=1:6:1,range=x0000xc0a80100x0000000000000000:x0000xffffff00x0000000000000000\fP\fP" - +.ad l +.IP "\fB\f(CWsocat - SOCKET-DATAGRAM:2:2:17:x007bxc0a80100x0000000000000000,b\%ind=x007bx00000000x0000000000000000,setsockopt-int=1:6:1,r\%ange=x0000xc0a80100x0000000000000000:x0000xffffff00x0000000000000000\fP\fP" +.na .IP is semantically equivalent to the previous example, but all parameters are @@ -3503,9 +3504,10 @@ \fBsocat\fP creates a PTY to make pppd happy, binds to the network interface \f(CWhdlc0\fP, and can transfer data between both devices\&. Use pppd on device \f(CW/var/run/ppp\fP then\&. -.IP -.IP "\fB\f(CWsocat -T 1 -d -d TCP-L:10081,reuseaddr,fork,crlf SYSTEM:"echo -e \e"\e\e\e"HTTP/1\&.0 200 OK\e\e\enDocumentType: text/plain\e\e\en\e\e\endate: \e$\e(date\e)\e\e\enserver:\e$SOCAT_SOCKADDR:\e$SOCAT_SOCKPORT\e\e\enclient: \e$SOCAT_PEERADDR:\e$SOCAT_PEERPORT\e\e\en\e\e\e"\e"; cat; echo -e \e"\e\e\e"\e\e\en\e\e\e"\e""\fP\fP" - +.IP +.ad l +.IP "\fB\f(CWsocat -T 1 -d -d TCP-L:10081,reuseaddr,fork,crlf SYSTEM:\(dqecho -e \e\(dq\e\e\e\(dqHTTP/1\&.0 200 OK\e\e\enDocumentType: text/plain\e\e\en\e\e\endate: \e$\e(date\e)\e\e\enserver:\e$SOCAT_SOCKADDR:\e$SOCAT_SOCKPORT\e\e\enclient: \e$SOCAT_PEERADDR:\e$SOCAT_PEERPORT\e\e\en\e\e\e\(dq\e\(dq; cat; echo -e \e\(dq\e\e\e\(dq\e\e\en\e\e\e\(dq\e\(dq\(dq \fP\fP" +.na .IP creates a simple HTTP echo server: each HTTP client that connects gets a valid HTTP reply that contains information about the client address and port as it is @@ -3538,7 +3540,7 @@ .PP \fBSocat\fP uses a logging mechanism that allows to filter messages by severity\&. The severities provided are more or less compatible to the appropriate syslog -priority\&. With one or up to four occurrences of the -d command line option, the +priority\&. With one or up to four occurrences of the \-d command line option, the lowest priority of messages that are issued can be selected\&. Each message contains a single uppercase character specifying the messages severity (one of F, E, W, N, I, or D) @@ -3547,7 +3549,7 @@ Conditions that require unconditional and immediate program termination\&. .IP "ERROR:" Conditions that prevent proper program processing\&. Usually the -program is terminated (see option -s)\&. +program is terminated (see option \-s)\&. .IP "WARNING:" Something did not function correctly or is in a state where correct further processing cannot be guaranteed, but might be possible\&. @@ -3583,13 +3585,13 @@ .PP In the output variables beginning with "SOCAT" this prefix is actually replaced by the upper case name of the executable or the value of option --lp\&. +\-lp\&. .PP .IP "\fBSOCAT_DEFAULT_LISTEN_IP\fP (input)" (Values 4 or 6) Sets the IP version to be used for listen, recv, and recvfrom addresses if no pf (protocol-family) option is given\&. Is -overridden by \fBsocat\fP options -4 or -6\&. +overridden by \fBsocat\fP options \-4 or \-6\&. .IP .IP "\fBSOCAT_PREFERRED_RESOLVE_IP\fP (input)" (Values 0, 4, or 6) Sets the IP @@ -3701,7 +3703,7 @@ .IP .IP "\fBHOSTNAME\fP (input)" Is used to determine the hostname for logging (see --lh)\&. +\-lh)\&. .IP .IP "\fBLOGNAME\fP (input)" Is used as name for the socks client user name if no @@ -3760,11 +3762,11 @@ .PP Address option ftruncate without value uses default 1 instead of 0\&. .PP -Verbose modes (-x and/or -v) display line termination characters inconsistently +Verbose modes (\-x and/or \-v) display line termination characters inconsistently when address options cr or crnl are used: They show the data \fIafter\fP conversion in either direction\&. .PP -The data transfer blocksize setting (-b) is ignored with address readline\&. +The data transfer blocksize setting (\-b) is ignored with address readline\&. .PP Send bug reports to .PP diff -rauN socat-2.0.0-b4/xioopts.c socat-2.0.0-b4-p1/xioopts.c --- socat-2.0.0-b4/xioopts.c 2010-06-20 12:04:54.000000000 +0200 +++ socat-2.0.0-b4-p1/xioopts.c 2011-09-04 22:39:18.000000000 +0200 @@ -3995,10 +3995,10 @@ opt->desc = ODESC_ERROR; continue; } #else - if (Setsockopt(xfd->fd1, opt->desc->major, opt->desc->minor, + if (Setsockopt(xfd->rfd, opt->desc->major, opt->desc->minor, &ip4_mreqn.mreq, sizeof(ip4_mreqn.mreq)) < 0) { Error7("setsockopt(%d, %d, %d, {0x%08x,0x%08x}, "F_Zu"): %s", - xfd->fd1, opt->desc->major, opt->desc->minor, + xfd->rfd, opt->desc->major, opt->desc->minor, ip4_mreqn.mreq.imr_multiaddr, ip4_mreqn.mreq.imr_interface, sizeof(ip4_mreqn.mreq), diff -rauN socat-2.0.0-b4/doc/index.html socat-2.0.0-b4-p1/doc/index.html --- socat-2.0.0-b4/doc/index.html 1970-01-01 02:00:00.000000000 +0200 +++ socat-2.0.0-b4-p1/doc/index.html 2012-07-07 01:04:22.000000000 +0200 @@ -0,0 +1,16 @@ + + +Index of socat online documentation + + +
+

Index of socat online documentation

+Socat Manual Page

+Generic sockets with Socat

+IP Multicasting with Socat

+Securing Traffic Between two Socat Instances Using SSL

+Building TUN based virtual networks with socat

+Socat address chains

+Execute programs using soca

+ + diff -rauN socat-2.0.0-b4/sslcls.c socat-2.0.0-b4-p1/sslcls.c --- socat-2.0.0-b4/sslcls.c 1970-01-01 02:00:00.000000000 +0200 +++ socat-2.0.0-b4-p1/sslcls.c 2012-07-07 01:04:22.000000000 +0200 @@ -35,6 +35,7 @@ return result; } +#ifndef OPENSSL_NO_SSL2 SSL_METHOD *sycSSLv2_client_method(void) { SSL_METHOD *result; Debug("SSLv2_client_method()"); @@ -50,6 +51,7 @@ Debug1("SSLv2_server_method() -> %p", result); return result; } +#endif SSL_METHOD *sycSSLv3_client_method(void) { SSL_METHOD *result; diff -rauN socat-2.0.0-b4/xio-openssl.c socat-2.0.0-b4-p1/xio-openssl.c --- socat-2.0.0-b4/xio-openssl.c 1970-01-01 02:00:00.000000000 +0200 +++ socat-2.0.0-b4-p1/xio-openssl.c 2012-07-07 01:04:22.000000000 +0200 @@ -798,9 +798,12 @@ if (!server) { if (me_str != 0) { +#ifndef OPENSSL_NO_SSL2 if (!strcasecmp(me_str, "SSLv2") || !strcasecmp(me_str, "SSL2")) { method = sycSSLv2_client_method(); - } else if (!strcasecmp(me_str, "SSLv3") || !strcasecmp(me_str, "SSL3")) { + } else +#endif + if (!strcasecmp(me_str, "SSLv3") || !strcasecmp(me_str, "SSL3")) { method = sycSSLv3_client_method(); } else if (!strcasecmp(me_str, "SSLv23") || !strcasecmp(me_str, "SSL23") || !strcasecmp(me_str, "SSL")) { @@ -817,9 +820,12 @@ } } else /* server */ { if (me_str != 0) { +#ifndef OPENSSL_NO_SSL2 if (!strcasecmp(me_str, "SSLv2") || !strcasecmp(me_str, "SSL2")) { method = sycSSLv2_server_method(); - } else if (!strcasecmp(me_str, "SSLv3") || !strcasecmp(me_str, "SSL3")) { + } else +#endif + if (!strcasecmp(me_str, "SSLv3") || !strcasecmp(me_str, "SSL3")) { method = sycSSLv3_server_method(); } else if (!strcasecmp(me_str, "SSLv23") || !strcasecmp(me_str, "SSL23") || !strcasecmp(me_str, "SSL")) { diff -rauN socat-2.0.0-b4/sslcls.h socat-2.0.0-b4-p1/sslcls.h --- socat-2.0.0-b4/sslcls.h 1970-01-01 02:00:00.000000000 +0200 +++ socat-2.0.0-b4-p1/sslcls.h 2012-07-07 01:04:22.000000000 +0200 @@ -10,8 +10,10 @@ void sycSSL_load_error_strings(void); int sycSSL_library_init(void); +#ifndef OPENSSL_NO_SSL2 SSL_METHOD *sycSSLv2_client_method(void); SSL_METHOD *sycSSLv2_server_method(void); +#endif SSL_METHOD *sycSSLv3_client_method(void); SSL_METHOD *sycSSLv3_server_method(void); SSL_METHOD *sycSSLv23_client_method(void);