Skip to content

Instantly share code, notes, and snippets.

@surajhande
Created February 15, 2016 09:45
Show Gist options
  • Save surajhande/65cae8e45eacc2954172 to your computer and use it in GitHub Desktop.
Save surajhande/65cae8e45eacc2954172 to your computer and use it in GitHub Desktop.
ns3 mandatory gsoc patch
--- src/applications/model/testapp.h 2016-02-15 15:00:22.086235125 +0530
+++ ns-3-dev/src/applications/model/testapp.h 2016-02-12 17:06:10.224473418 +0530
@@ -20,6 +20,10 @@
*
*
*/
+ virtual void StartApplication (void);
+ virtual void StopApplication (void);
+
+
};
}
--- src/applications/model/testapp.cc 2016-02-15 15:00:22.086235125 +0530
+++ ns-3-dev/src/applications/model/testapp.cc 2016-02-12 17:06:08.988473405 +0530
@@ -1,6 +1,6 @@
#include "ns3/log.h"
#include "testapp.h"
-
+#include <iostream>
NS_LOG_COMPONENT_DEFINE ("TestApplication");
namespace ns3 {
@@ -32,4 +32,17 @@
*
* */
+void TestApplication::StartApplication (void)
+{
+ std::cout<<"hello world!\n";
+ return ;
+}
+
+void TestApplication::StopApplication (void)
+{
+ std::cout<<"goodbye world!\n";
+ return ;
+}
+
+
} // namespace ns3
--- scratch/testapp-sim.cc 2016-02-15 15:00:35.400888886 +0530
+++ ns-3-dev/scratch/testapp-sim.cc 2016-02-15 15:04:49.663168867 +0530
@@ -20,6 +20,13 @@
* second of simulation time respectively.
*
* */
+
+ TestApplication test_app = TestApplication();
+
+ nodes.Get (0)->AddApplication(&test_app);
+ test_app.SetStartTime (Seconds (1.00));
+ test_app.SetStopTime (Seconds (2.00));
+
Simulator::Run ();
Simulator::Destroy ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment