Brian,

There is no such parameter, this was an oversight. Attached is a patch
that will set the TTL for the OTA and event multicast channels. We will
open a bug report to add a TTL parameter for both in the next release.

Note: I have only tested this patch with IPv4.

--
Steven Galgano
Adjacent Link LLC



On 04/11/2013 09:15 AM, Henz, Brian J CIV (US) wrote:
> Classification: UNCLASSIFIED
> Caveats: NONE
> 
> Hi,
>   I am using the emaneeventservice that comes precompiled with emane to send
> out location events. The TTL on these messages appears to be 1. Using
> libemaneeventservice I am able to set the TTL using the <ttl>32<\ttl> flag.
> Is there a parameter for the emaneeventservice to set the TTL?
> 
> Thanks,
>   Brian
> 
> 
> Classification: UNCLASSIFIED
> Caveats: NONE
> 
> 
> 
> 
> _______________________________________________
> emane-users mailing list
> [email protected]
> http://pf.itd.nrl.navy.mil/mailman/listinfo/emane-users
> 
Index: src/libemane/eventservice.cc
===================================================================
--- src/libemane/eventservice.cc	(revision 1)
+++ src/libemane/eventservice.cc	(working copy)
@@ -342,6 +342,33 @@
           }
         }
 
+      if(eventGroupAddress_.get_type() == AF_INET)
+        {
+          if(mcast_.set_option(IP_MULTICAST_TTL,32) == -1)
+            {
+              std::stringstream ssDescription;
+              ssDescription
+                <<"unable to set EventService TTL IP_MULTICAST_TTL"
+                <<std::ends;
+              throw EventServiceException(ssDescription.str()); 
+            }
+        }
+      else if(eventGroupAddress_.get_type() == AF_INET6)
+        {
+          int iTTL = 32;
+
+          if(mcast_.ACE_SOCK::set_option(IPPROTO_IPV6,IPV6_MULTICAST_HOPS,
+                                         &iTTL,
+                                         sizeof(iTTL)) == -1)
+            {
+              std::stringstream ssDescription;
+              ssDescription
+                <<"unable to set EventService TTL IPV6_MULTICAST_TTL"
+                <<std::ends;
+              throw EventServiceException(ssDescription.str()); 
+            }
+        }
+      
       EMANEUtils::spawn(*this,
                         &EMANE::EventService::receiveEventMessage,
                         &receiveThread_,
Index: src/libemane/otamanager.cc
===================================================================
--- src/libemane/otamanager.cc	(revision 1)
+++ src/libemane/otamanager.cc	(working copy)
@@ -258,15 +258,26 @@
       throw OTAException(sstream.str());
     }
 
-  if(otaGroupAddress.get_type() == AF_INET) {
+  if(otaGroupAddress.get_type() == AF_INET)
+    {
       if(mcast_.set_option(IP_MULTICAST_LOOP,0) == -1)
         {
           std::stringstream ssDescription;
           ssDescription<<"unable to unset OTA Manager group IP_MULTICAST_LOOP errno "<< ACE_OS::strerror (errno) << std::ends;
           throw OTAException(ssDescription.str()); 
         }
+
+      if(mcast_.set_option(IP_MULTICAST_TTL,32) == -1)
+        {
+          std::stringstream ssDescription;
+          ssDescription
+            <<"unable to set OTA Manager group IP_MULTICAST_TTL"
+            <<std::ends;
+          throw OTAException(ssDescription.str()); 
+        }
     }
-  else if(otaGroupAddress.get_type() == AF_INET6) {
+  else if(otaGroupAddress.get_type() == AF_INET6)
+    {
       int loop = 0;
       if(mcast_.ACE_SOCK::set_option(IPPROTO_IPV6,IPV6_MULTICAST_LOOP,&loop,sizeof(loop)) == -1)
         {
@@ -274,6 +285,18 @@
           ssDescription<<"unable to unset OTA Manager group IPV6_MULTICAST_LOOP errno " << ACE_OS::strerror (errno) << std::ends;
           throw OTAException(ssDescription.str()); 
         }
+
+      int iTTL = 32;
+      if(mcast_.ACE_SOCK::set_option(IPPROTO_IPV6,IPV6_MULTICAST_HOPS,
+                                     &iTTL,
+                                     sizeof(iTTL)) == -1)
+        {
+          std::stringstream ssDescription;
+          ssDescription
+            <<"unable to set  OTA Manager group IPV6_MULTICAST_HOPS"
+            <<std::ends;
+          throw OTAException(ssDescription.str()); 
+        }
     }
 
   
_______________________________________________
emane-users mailing list
[email protected]
http://pf.itd.nrl.navy.mil/mailman/listinfo/emane-users

Reply via email to