Create Application Helper in ns-3

347 views
Skip to first unread message

Vikas Raunak

unread,
Feb 9, 2016, 6:29:30 AM2/9/16
to ns-3-users
I tried to create an application helper for MPTCP: MpTcpOnOffHelper like the OnOffHelper for TCP/UDP. I did like it was for TCP/UDP except with a few changes like the ones done in MpTcpBulkSendHelper (created along the lines of BulkSendHelper).

I created the files as required and in the main program when I tried to use the MpTCpOnOffHelper I get the error:

../scratch/mptcp.cc: In function ‘int main(int, char**)’:
../scratch/mptcp.cc:116:3: error: ‘MpTcpOnOffHelper’ was not declared in this scope
   MpTcpOnOffHelper source("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address(ipv4Ints[0].GetAddress (1)), port));
   ^
../scratch/mptcp.cc:117:3: error: ‘source’ was not declared in this scope
   source.SetAttribute("MaxBytes", UintegerValue(1000));
   ^
Waf: Leaving directory `/home/mptcp/build'
Build failed
 -> task in 'mptcp' failed (exit status 1): 
{task 140048544287696: cxx mptcp.cc -> mptcp.cc.9.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/freetype2', '-I/usr/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_GSL=1', '../scratch/mptcp.cc', '-c', '-o', 'scratch/mptcp.cc.9.o']


What step am I missing in creating a new helper ? 

Konstantinos

unread,
Feb 9, 2016, 6:53:09 AM2/9/16
to ns-3-users
Have you added the new files in the wscript file of the module you placed them?

Regards,
K. 

Vikas Raunak

unread,
Feb 9, 2016, 9:20:04 AM2/9/16
to ns-3-...@googlegroups.com
Thanks sir.

After including the files in wscript, I get

In file included from ./ns3/object.h:29:0,
                 from ./ns3/net-device.h:27,
                 from ./ns3/packet-socket-address.h:27,
                 from ../src/applications/model/mp-tcp-onoff-application.cc:29:
../src/applications/model/mp-tcp-onoff-application.cc: In constructor ‘ns3::XMpTcpOnOffApplicationRegistrationClass::XMpTcpOnOffApplicationRegistrationClass()’:
../src/applications/model/mp-tcp-onoff-application.cc:49:30: error: ‘MpTcpOnOffApplication’ has not been declared
 NS_OBJECT_ENSURE_REGISTERED (MpTcpOnOffApplication)
                              ^
./ns3/object-base.h:51:25: note: in definition of macro ‘NS_OBJECT_ENSURE_REGISTERED’
       ns3::TypeId tid = type::GetTypeId ();     \
                         ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:53:1: error: ‘MpTcpOnOffApplication’ has not been declared
 MpTcpOnOffApplication::GetTypeId (void)
 ^
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘ns3::TypeId ns3::GetTypeId()’:
../src/applications/model/mp-tcp-onoff-application.cc:57:21: error: ‘MpTcpOnOffApplication’ was not declared in this scope
     .AddConstructor<MpTcpOnOffApplication> ()
                     ^
../src/applications/model/mp-tcp-onoff-application.cc:57:45: error: no matching function for call to ‘ns3::TypeId::AddConstructor()’
     .AddConstructor<MpTcpOnOffApplication> ()


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/yqjeShTbnO4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Konstantinos

unread,
Feb 9, 2016, 9:32:28 AM2/9/16
to ns-3-users
Whenever you change a wscript file you should clean and rebuild NS-3.

./waf distclean
./waf configure (plus any other parameters you usually pass)
./waf

To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Vikas Raunak

unread,
Feb 9, 2016, 9:48:06 AM2/9/16
to ns-3-...@googlegroups.com
Thanks sir.

I still get the error:

In file included from ./ns3/object.h:29:0,
                 from ./ns3/net-device.h:27,
                 from ./ns3/packet-socket-address.h:27,
                 from ../src/applications/model/mp-tcp-onoff-application.cc:29:
../src/applications/model/mp-tcp-onoff-application.cc: In constructor ‘ns3::XMpTcpOnOffApplicationRegistrationClass::XMpTcpOnOffApplicationRegistrationClass()’:
../src/applications/model/mp-tcp-onoff-application.cc:49:30: error: ‘MpTcpOnOffApplication’ has not been declared
 NS_OBJECT_ENSURE_REGISTERED (MpTcpOnOffApplication)
                              ^
./ns3/object-base.h:51:25: note: in definition of macro ‘NS_OBJECT_ENSURE_REGISTERED’
       ns3::TypeId tid = type::GetTypeId ();     \
                         ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:53:1: error: ‘MpTcpOnOffApplication’ has not been declared
 MpTcpOnOffApplication::GetTypeId (void)


The code at this line is:


NS_LOG_COMPONENT_DEFINE ("MpTcpOnOffApplication");

namespace ns3 {

NS_OBJECT_ENSURE_REGISTERED (MpTcpOnOffApplication)
  ;

TypeId
MpTcpOnOffApplication::GetTypeId (void)
{
  static TypeId tid = TypeId ("ns3::MpTcpOnOffApplication")
    .SetParent<Application> ()
    .AddConstructor<MpTcpOnOffApplication> ()
    .AddAttribute ("DataRate", "The data rate in on state.",
                   DataRateValue (DataRate ("500kb/s")),
                   MakeDataRateAccessor (&MpTcpOnOffApplication::m_cbrRate),
                   MakeDataRateChecker ())
 

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/yqjeShTbnO4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Konstantinos

unread,
Feb 9, 2016, 9:54:59 AM2/9/16
to ns-3-users

NS_LOG_COMPONENT_DEFINE ("MpTcpOnOffApplication");

This has to be inside the ns3 namespace.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/yqjeShTbnO4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Vikas Raunak

unread,
Feb 10, 2016, 8:16:56 AM2/10/16
to ns-3-...@googlegroups.com
Thanks sir, Unfortunately I still get the same error. I am posting the entire error list, may be it could provide more information.

In file included from ./ns3/object.h:29:0,
                 from ./ns3/net-device.h:27,
                 from ./ns3/packet-socket-address.h:27,
                 from ../src/applications/model/mp-tcp-onoff-application.cc:29:
../src/applications/model/mp-tcp-onoff-application.cc: In constructor ‘ns3::XMpTcpOnOffApplicationRegistrationClass::XMpTcpOnOffApplicationRegistrationClass()’:
../src/applications/model/mp-tcp-onoff-application.cc:49:30: error: ‘MpTcpOnOffApplication’ has not been declared
 NS_OBJECT_ENSURE_REGISTERED (MpTcpOnOffApplication);
                              ^
./ns3/object-base.h:51:25: note: in definition of macro ‘NS_OBJECT_ENSURE_REGISTERED’
       ns3::TypeId tid = type::GetTypeId ();     \
                         ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:54:1: error: ‘MpTcpOnOffApplication’ has not been declared
 MpTcpOnOffApplication::GetTypeId (void)
 ^
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘ns3::TypeId ns3::GetTypeId()’:
../src/applications/model/mp-tcp-onoff-application.cc:58:21: error: ‘MpTcpOnOffApplication’ was not declared in this scope
     .AddConstructor<MpTcpOnOffApplication> ()
                     ^
../src/applications/model/mp-tcp-onoff-application.cc:58:45: error: no matching function for call to ‘ns3::TypeId::AddConstructor()’
     .AddConstructor<MpTcpOnOffApplication> ()
                                             ^
../src/applications/model/mp-tcp-onoff-application.cc:58:45: note: candidate is:
In file included from ./ns3/object-base.h:23:0,
                 from ./ns3/object.h:29,
                 from ./ns3/net-device.h:27,
                 from ./ns3/packet-socket-address.h:27,
                 from ../src/applications/model/mp-tcp-onoff-application.cc:29:
./ns3/type-id.h:249:10: note: template<class T> ns3::TypeId ns3::TypeId::AddConstructor()
   TypeId AddConstructor (void);
          ^
./ns3/type-id.h:249:10: note:   template argument deduction/substitution failed:
../src/applications/model/mp-tcp-onoff-application.cc:58:45: error: template argument 1 is invalid
     .AddConstructor<MpTcpOnOffApplication> ()
                                             ^
../src/applications/model/mp-tcp-onoff-application.cc:61:43: error: ‘MpTcpOnOffApplication’ is not a class or namespace
                    MakeDataRateAccessor (&MpTcpOnOffApplication::m_cbrRate),
                                           ^
../src/applications/model/mp-tcp-onoff-application.cc:65:43: error: ‘MpTcpOnOffApplication’ is not a class or namespace
                    MakeUintegerAccessor (&MpTcpOnOffApplication::m_pktSize),
                                           ^
../src/applications/model/mp-tcp-onoff-application.cc:69:42: error: ‘MpTcpOnOffApplication’ is not a class or namespace
                    MakeAddressAccessor (&MpTcpOnOffApplication::m_peer),
                                          ^
../src/applications/model/mp-tcp-onoff-application.cc:73:42: error: ‘MpTcpOnOffApplication’ is not a class or namespace
                    MakePointerAccessor (&MpTcpOnOffApplication::m_onTime),
                                          ^
../src/applications/model/mp-tcp-onoff-application.cc:77:42: error: ‘MpTcpOnOffApplication’ is not a class or namespace
                    MakePointerAccessor (&MpTcpOnOffApplication::m_offTime),
                                          ^
../src/applications/model/mp-tcp-onoff-application.cc:84:43: error: ‘MpTcpOnOffApplication’ is not a class or namespace
                    MakeUintegerAccessor (&MpTcpOnOffApplication::m_maxBytes),
                                           ^
../src/applications/model/mp-tcp-onoff-application.cc:88:41: error: ‘MpTcpOnOffApplication’ is not a class or namespace
                    MakeTypeIdAccessor (&MpTcpOnOffApplication::m_tid),
                                         ^
../src/applications/model/mp-tcp-onoff-application.cc:91:48: error: ‘MpTcpOnOffApplication’ is not a class or namespace
                      MakeTraceSourceAccessor (&MpTcpOnOffApplication::m_txTrace))
                                                ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:97:1: error: ‘MpTcpOnOffApplication’ does not name a type
 MpTcpOnOffApplication::MpTcpOnOffApplication ()
 ^
../src/applications/model/mp-tcp-onoff-application.cc:107:1: error: ‘MpTcpOnOffApplication’ does not name a type
 MpTcpOnOffApplication::~MpTcpOnOffApplication()
 ^
../src/applications/model/mp-tcp-onoff-application.cc:113:1: error: ‘MpTcpOnOffApplication’ has not been declared
 MpTcpOnOffApplication::SetMaxBytes (uint32_t maxBytes)
 ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::SetMaxBytes(uint32_t)’:
../src/applications/model/mp-tcp-onoff-application.cc:115:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this << maxBytes);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:116:3: error: ‘m_maxBytes’ was not declared in this scope
   m_maxBytes = maxBytes;
   ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:120:1: error: ‘MpTcpOnOffApplication’ has not been declared
 MpTcpOnOffApplication::GetSocket (void) const
 ^
../src/applications/model/mp-tcp-onoff-application.cc:120:41: error: non-member function ‘ns3::Ptr<ns3::Socket> ns3::GetSocket()’ cannot have cv-qualifier
 MpTcpOnOffApplication::GetSocket (void) const
                                         ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘ns3::Ptr<ns3::Socket> ns3::GetSocket()’:
../src/applications/model/mp-tcp-onoff-application.cc:122:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:123:10: error: ‘m_socket’ was not declared in this scope
   return m_socket;
          ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:127:1: error: ‘MpTcpOnOffApplication’ has not been declared
 MpTcpOnOffApplication::AssignStreams (int64_t stream)
 ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘int64_t ns3::AssignStreams(int64_t)’:
../src/applications/model/mp-tcp-onoff-application.cc:129:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this << stream);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:130:3: error: ‘m_onTime’ was not declared in this scope
   m_onTime->SetStream (stream);
   ^
../src/applications/model/mp-tcp-onoff-application.cc:131:3: error: ‘m_offTime’ was not declared in this scope
   m_offTime->SetStream (stream + 1);
   ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:136:1: error: ‘MpTcpOnOffApplication’ has not been declared
 MpTcpOnOffApplication::DoDispose (void)
 ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::DoDispose()’:
../src/applications/model/mp-tcp-onoff-application.cc:138:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:140:3: error: ‘m_socket’ was not declared in this scope
   m_socket = 0;
   ^
../src/applications/model/mp-tcp-onoff-application.cc:142:27: error: cannot call member function ‘virtual void ns3::Application::DoDispose()’ without object
   Application::DoDispose ();
                           ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:146:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::StartApplication () // Called at time specified by Start
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::StartApplication()’:
../src/applications/model/mp-tcp-onoff-application.cc:148:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:149:3: error: ‘cout’ was not declared in this scope
   cout<<"Hello\n";
   ^
../src/applications/model/mp-tcp-onoff-application.cc:149:3: note: suggested alternative:
In file included from ./ns3/log.h:25:0,
                 from ../src/applications/model/mp-tcp-onoff-application.cc:25:
/usr/include/c++/4.9/iostream:61:18: note:   ‘std::cout’
   extern ostream cout;  /// Linked to standard output
                  ^
../src/applications/model/mp-tcp-onoff-application.cc:151:8: error: ‘m_socket’ was not declared in this scope
   if (!m_socket)
        ^
../src/applications/model/mp-tcp-onoff-application.cc:153:49: error: ‘GetNode’ was not declared in this scope
       m_socket = Socket::CreateSocket (GetNode (), m_tid);
                                                 ^
../src/applications/model/mp-tcp-onoff-application.cc:153:52: error: ‘m_tid’ was not declared in this scope
       m_socket = Socket::CreateSocket (GetNode (), m_tid);
                                                    ^
../src/applications/model/mp-tcp-onoff-application.cc:154:47: error: ‘m_peer’ was not declared in this scope
       if (Inet6SocketAddress::IsMatchingType (m_peer))
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:163:26: error: ‘m_peer’ was not declared in this scope
       m_socket->Connect (m_peer);
                          ^
../src/applications/model/mp-tcp-onoff-application.cc:168:24: error: ‘MpTcpOnOffApplication’ has not been declared
         MakeCallback (&MpTcpOnOffApplication::ConnectionSucceeded, this),
                        ^
../src/applications/model/mp-tcp-onoff-application.cc:168:68: error: invalid use of ‘this’ in non-member function
         MakeCallback (&MpTcpOnOffApplication::ConnectionSucceeded, this),
                                                                    ^
../src/applications/model/mp-tcp-onoff-application.cc:169:24: error: ‘MpTcpOnOffApplication’ has not been declared
         MakeCallback (&MpTcpOnOffApplication::ConnectionFailed, this));
                        ^
../src/applications/model/mp-tcp-onoff-application.cc:169:65: error: invalid use of ‘this’ in non-member function
         MakeCallback (&MpTcpOnOffApplication::ConnectionFailed, this));
                                                                 ^
../src/applications/model/mp-tcp-onoff-application.cc:171:3: error: ‘m_cbrRateFailSafe’ was not declared in this scope
   m_cbrRateFailSafe = m_cbrRate;
   ^
../src/applications/model/mp-tcp-onoff-application.cc:171:23: error: ‘m_cbrRate’ was not declared in this scope
   m_cbrRateFailSafe = m_cbrRate;
                       ^
../src/applications/model/mp-tcp-onoff-application.cc:174:17: error: ‘CancelEvents’ was not declared in this scope
   CancelEvents ();
                 ^
../src/applications/model/mp-tcp-onoff-application.cc:178:23: error: ‘ScheduleStartEvent’ was not declared in this scope
   ScheduleStartEvent ();
                       ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:181:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::StopApplication () // Called at time specified by Stop
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::StopApplication()’:
../src/applications/model/mp-tcp-onoff-application.cc:183:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:185:17: error: ‘CancelEvents’ was not declared in this scope
   CancelEvents ();
                 ^
../src/applications/model/mp-tcp-onoff-application.cc:186:6: error: ‘m_socket’ was not declared in this scope
   if(m_socket != 0)
      ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:196:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::CancelEvents ()
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::CancelEvents()’:
../src/applications/model/mp-tcp-onoff-application.cc:198:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:200:7: error: ‘m_sendEvent’ was not declared in this scope
   if (m_sendEvent.IsRunning () && m_cbrRateFailSafe == m_cbrRate )
       ^
../src/applications/model/mp-tcp-onoff-application.cc:200:35: error: ‘m_cbrRateFailSafe’ was not declared in this scope
   if (m_sendEvent.IsRunning () && m_cbrRateFailSafe == m_cbrRate )
                                   ^
../src/applications/model/mp-tcp-onoff-application.cc:200:56: error: ‘m_cbrRate’ was not declared in this scope
   if (m_sendEvent.IsRunning () && m_cbrRateFailSafe == m_cbrRate )
                                                        ^
../src/applications/model/mp-tcp-onoff-application.cc:203:39: error: ‘m_lastStartTime’ was not declared in this scope
       Time delta (Simulator::Now () - m_lastStartTime);
                                       ^
../src/applications/model/mp-tcp-onoff-application.cc:205:7: error: ‘m_residualBits’ was not declared in this scope
       m_residualBits += bits.GetHigh ();
       ^
../src/applications/model/mp-tcp-onoff-application.cc:207:3: error: ‘m_cbrRateFailSafe’ was not declared in this scope
   m_cbrRateFailSafe = m_cbrRate;
   ^
../src/applications/model/mp-tcp-onoff-application.cc:207:23: error: ‘m_cbrRate’ was not declared in this scope
   m_cbrRateFailSafe = m_cbrRate;
                       ^
../src/applications/model/mp-tcp-onoff-application.cc:208:22: error: ‘m_sendEvent’ was not declared in this scope
   Simulator::Cancel (m_sendEvent);
                      ^
../src/applications/model/mp-tcp-onoff-application.cc:209:22: error: ‘m_startStopEvent’ was not declared in this scope
   Simulator::Cancel (m_startStopEvent);
                      ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:213:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::StartSending ()
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::StartSending()’:
../src/applications/model/mp-tcp-onoff-application.cc:215:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:216:3: error: ‘m_lastStartTime’ was not declared in this scope
   m_lastStartTime = Simulator::Now ();
   ^
../src/applications/model/mp-tcp-onoff-application.cc:217:19: error: ‘ScheduleNextTx’ was not declared in this scope
   ScheduleNextTx ();  // Schedule the send packet event
                   ^
../src/applications/model/mp-tcp-onoff-application.cc:218:22: error: ‘ScheduleStopEvent’ was not declared in this scope
   ScheduleStopEvent ();
                      ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:221:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::StopSending ()
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::StopSending()’:
../src/applications/model/mp-tcp-onoff-application.cc:223:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:226:23: error: ‘ScheduleStartEvent’ was not declared in this scope
   ScheduleStartEvent ();
                       ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:230:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::ScheduleNextTx ()
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::ScheduleNextTx()’:
../src/applications/model/mp-tcp-onoff-application.cc:232:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:234:7: error: ‘m_maxBytes’ was not declared in this scope
   if (m_maxBytes == 0 || m_totBytes < m_maxBytes)
       ^
../src/applications/model/mp-tcp-onoff-application.cc:234:26: error: ‘m_totBytes’ was not declared in this scope
   if (m_maxBytes == 0 || m_totBytes < m_maxBytes)
                          ^
../src/applications/model/mp-tcp-onoff-application.cc:236:23: error: ‘m_pktSize’ was not declared in this scope
       uint32_t bits = m_pktSize * 8 - m_residualBits;
                       ^
../src/applications/model/mp-tcp-onoff-application.cc:236:39: error: ‘m_residualBits’ was not declared in this scope
       uint32_t bits = m_pktSize * 8 - m_residualBits;
                                       ^
../src/applications/model/mp-tcp-onoff-application.cc:239:51: error: ‘m_cbrRate’ was not declared in this scope
                               static_cast<double>(m_cbrRate.GetBitRate ()))); // Time till next packet
                                                   ^
../src/applications/model/mp-tcp-onoff-application.cc:241:7: error: ‘m_sendEvent’ was not declared in this scope
       m_sendEvent = Simulator::Schedule (nextTime,
       ^
../src/applications/model/mp-tcp-onoff-application.cc:242:43: error: ‘MpTcpOnOffApplication’ has not been declared
                                          &MpTcpOnOffApplication::SendPacket, this);
                                           ^
../src/applications/model/mp-tcp-onoff-application.cc:242:78: error: invalid use of ‘this’ in non-member function
                                          &MpTcpOnOffApplication::SendPacket, this);
                                                                              ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:250:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::ScheduleStartEvent ()
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::ScheduleStartEvent()’:
../src/applications/model/mp-tcp-onoff-application.cc:252:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:254:31: error: ‘m_offTime’ was not declared in this scope
   Time offInterval = Seconds (m_offTime->GetValue ());
                               ^
../src/applications/model/mp-tcp-onoff-application.cc:256:3: error: ‘m_startStopEvent’ was not declared in this scope
   m_startStopEvent = Simulator::Schedule (offInterval, &MpTcpOnOffApplication::StartSending, this);
   ^
../src/applications/model/mp-tcp-onoff-application.cc:256:57: error: ‘MpTcpOnOffApplication’ has not been declared
   m_startStopEvent = Simulator::Schedule (offInterval, &MpTcpOnOffApplication::StartSending, this);
                                                         ^
../src/applications/model/mp-tcp-onoff-application.cc:256:94: error: invalid use of ‘this’ in non-member function
   m_startStopEvent = Simulator::Schedule (offInterval, &MpTcpOnOffApplication::StartSending, this);
                                                                                              ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:259:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::ScheduleStopEvent ()
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::ScheduleStopEvent()’:
../src/applications/model/mp-tcp-onoff-application.cc:261:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:263:30: error: ‘m_onTime’ was not declared in this scope
   Time onInterval = Seconds (m_onTime->GetValue ());
                              ^
../src/applications/model/mp-tcp-onoff-application.cc:265:3: error: ‘m_startStopEvent’ was not declared in this scope
   m_startStopEvent = Simulator::Schedule (onInterval, &MpTcpOnOffApplication::StopSending, this);
   ^
../src/applications/model/mp-tcp-onoff-application.cc:265:56: error: ‘MpTcpOnOffApplication’ has not been declared
   m_startStopEvent = Simulator::Schedule (onInterval, &MpTcpOnOffApplication::StopSending, this);
                                                        ^
../src/applications/model/mp-tcp-onoff-application.cc:265:92: error: invalid use of ‘this’ in non-member function
   m_startStopEvent = Simulator::Schedule (onInterval, &MpTcpOnOffApplication::StopSending, this);
                                                                                            ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:269:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::SendPacket ()
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::SendPacket()’:
../src/applications/model/mp-tcp-onoff-application.cc:271:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
In file included from ./ns3/ptr.h:26:0,
                 from ./ns3/attribute.h:25,
                 from ./ns3/address.h:26,
                 from ../src/applications/model/mp-tcp-onoff-application.cc:26:
../src/applications/model/mp-tcp-onoff-application.cc:273:14: error: ‘m_sendEvent’ was not declared in this scope
   NS_ASSERT (m_sendEvent.IsExpired ());
              ^
./ns3/assert.h:67:13: note: in definition of macro ‘NS_ASSERT’
       if (!(condition))                                         \
             ^
../src/applications/model/mp-tcp-onoff-application.cc:274:40: error: ‘m_pktSize’ was not declared in this scope
   Ptr<Packet> packet = Create<Packet> (m_pktSize);
                                        ^
../src/applications/model/mp-tcp-onoff-application.cc:275:20: error: ‘m_txTrace’ was not declared in this scope
   m_txTrace (packet);
                    ^
../src/applications/model/mp-tcp-onoff-application.cc:276:3: error: ‘m_socket’ was not declared in this scope
   m_socket->Send (packet);
   ^
../src/applications/model/mp-tcp-onoff-application.cc:277:3: error: ‘m_totBytes’ was not declared in this scope
   m_totBytes += m_pktSize;
   ^
../src/applications/model/mp-tcp-onoff-application.cc:278:42: error: ‘m_peer’ was not declared in this scope
   if (InetSocketAddress::IsMatchingType (m_peer))
                                          ^
../src/applications/model/mp-tcp-onoff-application.cc:296:3: error: ‘m_lastStartTime’ was not declared in this scope
   m_lastStartTime = Simulator::Now ();
   ^
../src/applications/model/mp-tcp-onoff-application.cc:297:3: error: ‘m_residualBits’ was not declared in this scope
   m_residualBits = 0;
   ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:302:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::ConnectionSucceeded (Ptr<Socket> socket)
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::ConnectionSucceeded(ns3::Ptr<ns3::Socket>)’:
../src/applications/model/mp-tcp-onoff-application.cc:304:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this << socket);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc:305:3: error: ‘m_connected’ was not declared in this scope
   m_connected = true;
   ^
../src/applications/model/mp-tcp-onoff-application.cc: At global scope:
../src/applications/model/mp-tcp-onoff-application.cc:308:6: error: ‘MpTcpOnOffApplication’ has not been declared
 void MpTcpOnOffApplication::ConnectionFailed (Ptr<Socket> socket)
      ^
In file included from ../src/applications/model/mp-tcp-onoff-application.cc:25:0:
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘void ns3::ConnectionFailed(ns3::Ptr<ns3::Socket>)’:
../src/applications/model/mp-tcp-onoff-application.cc:310:20: error: invalid use of ‘this’ in non-member function
   NS_LOG_FUNCTION (this << socket);
                    ^
./ns3/log.h:355:47: note: in definition of macro ‘NS_LOG_FUNCTION’
           ns3::ParameterLogger (std::clog) << parameters;       \
                                               ^
../src/applications/model/mp-tcp-onoff-application.cc: In function ‘ns3::Ptr<ns3::Socket> ns3::GetSocket()’:
../src/applications/model/mp-tcp-onoff-application.cc:124:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^


To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/yqjeShTbnO4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/yqjeShTbnO4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Konstantinos

unread,
Feb 10, 2016, 10:56:36 AM2/10/16
to ns-3-users
Hi Vikas,

It seems like you are forgetting to include a header or a circular dependency but without the code I can't be sure.
Have you added also the header files in the wscript file?

Regards,
K.

Vikas Raunak

unread,
Feb 10, 2016, 11:49:20 AM2/10/16
to ns-3-...@googlegroups.com
Thanks sir.

Yes, I have added the headers in the wscript.

Also, does the ns-3 team have OnOff Application helper in their code ? Could I access their code ?








--

Vikas Raunak

unread,
Feb 10, 2016, 11:51:27 AM2/10/16
to ns-3-...@googlegroups.com
* I meant the MPTCP code development team.

Thanks
Reply all
Reply to author
Forward
0 new messages