Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ns3: kill dead prototypes
[simgrid.git] / src / surf / ns3 / ns3_simulator.hpp
1 /* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef NS3_SIMULATOR_HPP
7 #define NS3_SIMULATOR_HPP
8
9 #include "ns3_interface.hpp"
10
11 #include <ns3/tcp-socket-factory.h>
12
13 #include <cstdint>
14
15 class XBT_PRIVATE SgFlow {
16 public:
17   SgFlow(uint32_t totalBytes, simgrid::surf::NetworkNS3Action* action);
18
19   // private:
20   std::uint32_t bufferedBytes_ = 0;
21   std::uint32_t sentBytes_     = 0;
22   std::uint32_t remaining_;
23   std::uint32_t totalBytes_;
24   bool finished_ = false;
25   simgrid::surf::NetworkNS3Action* action_;
26 };
27
28 void StartFlow(ns3::Ptr<ns3::Socket> sock, const char* to, uint16_t port_number);
29
30 static inline std::string transformSocketPtr(ns3::Ptr<ns3::Socket> localSocket)
31 {
32   std::stringstream sstream;
33   sstream << localSocket;
34   return sstream.str();
35 }
36
37 #endif