Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't copy&change ns3::point-to-point-helper
[simgrid.git] / src / surf / ns3 / ns3_simulator.h
1 /* Copyright (c) 2007-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _NS3_SIM_H
8 #define _NS3_SIM_H
9
10 #ifdef __cplusplus
11
12 #include <cstdint>
13
14 #include "ns3_interface.h"
15 #include <ns3/core-module.h>
16
17 #include <ns3/node.h>
18 #include <ns3/global-route-manager.h>
19 #include <ns3/csma-helper.h>
20 #include <ns3/internet-stack-helper.h>
21 #include <ns3/ipv4-address-helper.h>
22 #include <ns3/point-to-point-helper.h>
23 #include <ns3/packet-sink-helper.h>
24 #include <ns3/inet-socket-address.h>
25 #include <ns3/tcp-socket-factory.h>
26
27 class SgFlow {
28 public:
29   SgFlow(uint32_t totalBytes, simgrid::surf::NetworkNS3Action * action);
30
31 //private:
32   std::uint32_t bufferedBytes_ = 0;
33   std::uint32_t sentBytes_ = 0;
34   std::uint32_t remaining_;
35   std::uint32_t totalBytes_;
36   bool finished_ = false;
37   simgrid::surf::NetworkNS3Action* action_;
38 };
39
40 //Simulator s;
41 class NS3Sim {
42
43 private:
44
45 public:
46   NS3Sim();
47   void create_flow_NS3(ns3::Ptr<ns3::Node> src,
48             ns3::Ptr<ns3::Node> dst,
49             std::uint16_t port_number,
50             double start,
51             const char *addr,
52             std::uint32_t TotalBytes,
53             simgrid::surf::NetworkNS3Action * action);
54   void simulator_start(double min);
55 };
56
57 #endif                          /* __cplusplus */
58
59 #endif