* ipv4.c: IPv4 network abstraction layer
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: ipv4.c,v 1.13 2003/01/23 15:53:10 sam Exp $
+ * $Id: ipv4.c,v 1.14 2003/02/18 18:33:44 titer Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Mathias Kretschmer <mathias@research.att.com>
#endif
return( -1 );
}
+
+#ifndef WIN32
+ if( IN_MULTICAST( ntohl(sock.sin_addr.s_addr) ) )
+#else
+ if( IN_MULTICAST( ntohl(inet_addr(psz_server_addr) ) ) )
+#endif
+ {
+ /* set the time-to-live */
+ int ttl = config_GetInt( p_this, "ttl" );
+ if( ttl < 1 )
+ ttl = 1;
+
+ if( setsockopt( i_handle, IPPROTO_IP, IP_MULTICAST_TTL,
+ &ttl, sizeof( ttl ) ) < 0 )
+ {
+#ifdef HAVE_ERRNO_H
+ msg_Warn( p_this, "failed to set ttl (%s)",
+ strerror(errno) );
+#else
+ msg_Warn( p_this, "failed to set ttl" );
+#endif
+#if defined( WIN32 ) || defined( UNDER_CE )
+ closesocket( i_handle );
+#else
+ close( i_handle );
+#endif
+ return( -1 );
+ }
+ }
}
p_socket->i_handle = i_handle;
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.42 2003/02/09 01:13:43 massiot Exp $
+ * $Id: libvlc.h,v 1.43 2003/02/18 18:33:44 titer Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
"multicast solution, you will probably have to indicate the IP address " \
"of your multicasting interface here.")
+#define TTL_TEXT N_("time to live")
+#define TTL_LONGTEXT N_( \
+ "Indicate here the Time To Live of the multicast packets sent by " \
+ "the stream output.")
+
#define INPUT_PROGRAM_TEXT N_("choose program (SID)")
#define INPUT_PROGRAM_LONGTEXT N_( \
"Choose the program to select by giving its Service ID.")
add_string( "iface", "eth0", NULL, IFACE_TEXT, IFACE_LONGTEXT );
#endif
add_string( "iface-addr", "", NULL, IFACE_ADDR_TEXT, IFACE_ADDR_LONGTEXT );
+ add_integer( "ttl", 1, NULL, TTL_TEXT, TTL_LONGTEXT );
add_integer( "program", 0, NULL,
INPUT_PROGRAM_TEXT, INPUT_PROGRAM_LONGTEXT );