Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
4f91f1aca5fadc21d231214228a20eee6c750ed5
[simgrid.git] / src / surf / ns3 / ns3_simulator.h
1 /* Copyright (c) 2007, 2008, 2009, 2010. 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 "ns3/core-module.h"
13
14 #ifdef _NS3_3_10
15         /*NS3 3.10*/
16         #include "ns3/helper-module.h"
17         #include "ns3/simulator-module.h"
18         #include "ns3/node-module.h"
19         #include "ns3/helper-module.h"
20         #include "ns3/global-routing-module.h"
21         #include "ns3/tcp-socket-factory.h"
22 #else
23         /*NS3 3.12*/
24         #include "ns3/node.h"
25         #include "ns3/global-route-manager.h"
26         #include "ns3/csma-helper.h"
27         #include "ns3/internet-stack-helper.h"
28         #include "ns3/ipv4-address-helper.h"
29         #include "ns3/point-to-point-helper.h"
30         #include "ns3/packet-sink-helper.h"
31         #include "ns3/inet-socket-address.h"
32 #endif
33
34 using namespace ns3;
35 using namespace std;
36
37 struct MySocket{
38   uint32_t bufferedBytes;
39   uint32_t sentBytes;
40   uint32_t remaining;
41   uint32_t totalBytes;
42   char finished;
43   void* action;
44 };
45
46 //Simulator s;
47 class NS3Sim {
48
49 private:
50
51 public:
52         NS3Sim();
53         ~NS3Sim();
54         void create_flow_NS3(Ptr<Node> src,
55                                                 Ptr<Node> dst,
56                                                 uint16_t port_number,
57                                                 double start,
58                                                 const char *addr,
59                                                 uint32_t TotalBytes,
60                                                 void * action);
61         void simulator_start(double min);
62         void* get_action_from_socket(void *socket);
63         double get_remains_from_socket(void *socket);
64         double get_sent_from_socket(void *socket);
65         char get_finished(void *socket);
66 };
67
68 #endif                          /* __cplusplus */
69
70 #endif