From 7d0ec2734a6b050da6878fbc4d46c301c88daac4 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Wed, 6 May 2009 19:59:57 +0200 Subject: [PATCH] added environment example to doc/socat-multicast.html --- doc/socat-multicast.html | 51 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/doc/socat-multicast.html b/doc/socat-multicast.html index a4fb046..d1aba33 100644 --- a/doc/socat-multicast.html +++ b/doc/socat-multicast.html @@ -228,10 +228,10 @@ Set a multicast/broadcast route with the following command (Linux):

route add -net 224.0.0.0/3 gw 192.168.10.2 - +

ALL-SYSTEMS multicast address

-224.0.0.1 is the all-systems multicast address: all +224.0.0.1 is the all-systems multicast address: all datagram sockets appear to be automatically member of this group on all interfaces. This membership cannot be dropped on Linux (you need iptables to filter packets). @@ -304,7 +304,51 @@ Please note that the new features could not be successfully tested on IPv6; these sections thus apply to IPv4 only.

-

This document was last modified in April 2009.

+

New Features in socat 1.7.0

+ +

+socat version 1.7.0 helps to find more information about incoming packets in +environment variables that can be used in scripts or programs invoked by +socat. The option ip-pktinfo (on non-BSD systems) +or ip-recvdstaddr (on BSD systems) is required to get basic +information about incoming packets. +

+ +

+Example: Start a receiver of the following form (tried on Linux): +

+ + +socat -u udp-recvfrom:8888,reuseaddr,ip-add-membership=224.1.0.1:192.168.10.2,ip-pktinfo,fork system:export + + +

+Then send a multicast packet from the client: +

+ + +echo |socat -u - udp-datagram:224.1.0.1:8888 + + +

+On the server the following text should appear (only interesting lines shown): +

+ +
+export SOCAT_IP_DSTADDR="224.1.0.1"
+export SOCAT_IP_IF="eth0"
+export SOCAT_IP_LOCADDR="192.168.10.2"
+export SOCAT_PEERADDR="192.168.10.1"
+export SOCAT_PEERPORT="41159"
+
+ +

+SOCAT_IP_IF shows the interface where the packet entered the server; +SOCAT_IP_LOCADDR shows the IP address of this interface; +SOCAT_IP_DSTADDR shows the target address of the packet; +SOCAT_PEERADDR and SOCAT_PEERPORT are the client socket +values. +

More info about socat datagrams

@@ -339,6 +383,7 @@ with one peer address
broadcasting on Wikipedia

+This document was last modified in May 2009.
Copyright: Gerhard Rieger 2007-2009
License: GNU Free Documentation License (FDL)