patch to add multicast inscription in a group

Eric Doutreleau Eric.Doutreleau at int-evry.fr
Wed Mar 6 15:08:02 CET 2002


Here is my patch to add multicast inscription for the vls in order to
make it work well with CGMP on cisco 

Hope this help


-- 
Eric Doutreleau
I.N.T			| Tel	: +33 (0) 160764687
9 rue Charles Fourier	| Fax	: +33 (0) 160764321
91011 Evry   France	| email	: Eric.Doutreleau at int-evry.fr


-- Attached file included as plaintext by Ecartis --
-- File: grospatch.3

diff -ur vls.old/src/modules/netchannel/netoutput.cpp vls/src/modules/netchannel/netoutput.cpp
--- vls.old/src/modules/netchannel/netoutput.cpp	Mon Mar  4 02:55:50 2002
+++ vls/src/modules/netchannel/netoutput.cpp	Mon Mar  4 13:08:54 2002
@@ -38,6 +38,7 @@
 #include "../../server/output.h"
 
 #include "netoutput.h"
+#include <arpa/inet.h>
 
 
 //******************************************************************************
@@ -138,8 +139,14 @@
     if((m_strType == "unicast") || (m_strType == "broadcast"))
       m_cSocket.SetOption(IPPROTO_IP, IP_TTL, &m_iTTL, sizeof(m_iTTL));
     else if(m_strType == "multicast")
+	{
       m_cSocket.SetOption(IPPROTO_IP, IP_MULTICAST_TTL,
                           &m_iTTL, sizeof(m_iTTL));
+	struct ip_mreq imr;
+        imr.imr_interface.s_addr = INADDR_ANY;
+        imr.imr_multiaddr.s_addr = inet_addr(m_strDstHost.GetString());
+        m_cSocket.SetOption(IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*)&imr,sizeof(struct ip_mreq) );
+	}
   }
 
   // Bind it to the local address if specified
@@ -160,6 +167,13 @@
 {
   try
   {
+   if(m_strType == "multicast")
+        {
+        struct ip_mreq imr;
+        imr.imr_interface.s_addr = INADDR_ANY;
+        imr.imr_multiaddr.s_addr = inet_addr(m_strDstHost.GetString());
+        m_cSocket.SetOption(IPPROTO_IP, IP_DROP_MEMBERSHIP, (char*)&imr,sizeof(struct ip_mreq) );
+        }
     m_cSocket.Close();
   }
   catch(E_Exception e)

-- 
This is the vls-devel mailing-list, see http://www.videolan.org/vls-devel/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vls-devel mailing list