1 /* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef NETWORK_NS3_HPP_
7 #define NETWORK_NS3_HPP_
11 #include "network_interface.hpp"
12 #include "src/surf/ns3/ns3_interface.hpp"
17 class NetworkNS3Model : public NetworkModel {
21 LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
22 e_surf_link_sharing_policy_t policy) override;
23 Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
24 double nextOccuringEvent(double now) override;
25 bool nextOccuringEventIsIdempotent() override { return false; }
26 void updateActionsState(double now, double delta) override;
32 class LinkNS3 : public LinkImpl {
34 explicit LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwidth, double latency);
37 void apply_event(tmgr_trace_event_t event, double value) override;
38 void setBandwidth(double value) override { THROW_UNIMPLEMENTED; }
39 void setLatency(double value) override { THROW_UNIMPLEMENTED; }
40 void setBandwidthTrace(tmgr_trace_t trace) override;
41 void setLatencyTrace(tmgr_trace_t trace) override;
47 class XBT_PRIVATE NetworkNS3Action : public NetworkAction {
49 NetworkNS3Action(Model* model, double cost, s4u::Host* src, s4u::Host* dst);
51 bool isSuspended() override;
53 void suspend() override;
54 void resume() override;
55 std::list<LinkImpl*> links() override;
66 #endif /* NETWORK_NS3_HPP_ */