Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
bd08513cb2b2871423c7b89b9a1346586ce154d2
[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 #include "ns3/helper-module.h"
14 #include "ns3/simulator-module.h"
15 #include "ns3/node-module.h"
16 #include "ns3/helper-module.h"
17 #include "ns3/global-routing-module.h"
18 #include "ns3/tcp-socket-factory.h"
19
20 using namespace ns3;
21 using namespace std;
22
23 struct MySocket{
24         uint32_t sentBytes;
25         uint32_t remaining;
26         uint32_t TotalBytes;
27         uint32_t last_amount_sent;
28         char finished;
29         void* action;
30 };
31
32 //Simulator s;
33 class NS3Sim {
34
35 private:
36
37 public:
38         NS3Sim();
39         ~NS3Sim();
40         void create_flow_NS3(Ptr<Node> src,
41                                                 Ptr<Node> dst,
42                                                 uint16_t port_number,
43                                                 double start,
44                                                 const char *addr,
45                                                 uint32_t TotalBytes,
46                                                 void * action);
47         void simulator_stop(double min);
48         void simulator_start(void);
49         void* get_action_from_socket(void *socket);
50         double get_remains_from_socket(void *socket);
51         double get_last_amount_sent_from_socket(void *socket);
52         void reset_last_amount_sent_from_socket(void *socket);
53         char get_finished(void *socket);
54 };
55
56 #endif                          /* __cplusplus */
57
58 #endif