[Ns-bugs] [Bug 458] New: socket attributes not hooked into the config namespace

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Fri Jan 2 09:43:06 PST 2009


http://www.nsnam.org/bugzilla/show_bug.cgi?id=458

           Summary: socket attributes not hooked into the config namespace
           Product: ns-3
           Version: ns-3-dev
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: internet-stack
        AssignedTo: ns-bugs at isi.edu
        ReportedBy: tomh at tomh.org
   Estimated Hours: 0.0


There seems to be no way to access socket attributes from the config namespace.

Example usecase:
--- a/examples/tcp-large-transfer.cc    Sat Dec 27 13:58:12 2008 -0800
+++ b/examples/tcp-large-transfer.cc    Fri Jan 02 09:36:00 2009 -0800
@@ -46,6 +46,11 @@ using namespace ns3;

 NS_LOG_COMPONENT_DEFINE ("TcpLargeTransfer");

+static void CwndTracer (uint32_t oldval, uint32_t newval)
+{
+  std::cout << "Moving cwnd from " << oldval << " to " << newval << std::endl;
+}
+
 // The number of bytes to send in this simulation.
 static uint32_t txBytes = 2000000;

@@ -143,6 +148,7 @@ int main (int argc, char *argv[])
   Ptr<Socket> localSocket =
       Socket::CreateSocket (n0n1.Get (0), TcpSocketFactory::GetTypeId ());
   localSocket->Bind ();
+  Config::ConnectWithoutContext
("/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow", MakeCallback
(&CwndTracer));

   // ...and schedule the sending "Application"; This is similar to what an 
   // ns3::Application subclass would do internally.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Ns-bugs mailing list