1 /* Copyright (c) 2004-2018. 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"
16 class NetworkNS3Model : public NetworkModel {
20 LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
21 e_surf_link_sharing_policy_t policy) override;
22 kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
23 double nextOccuringEvent(double now) override;
24 bool nextOccuringEventIsIdempotent() override { return false; }
25 void updateActionsState(double now, double delta) override;
31 class LinkNS3 : public LinkImpl {
33 explicit LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwidth, double latency);
36 void apply_event(tmgr_trace_event_t event, double value) override;
37 void setBandwidth(double value) override { THROW_UNIMPLEMENTED; }
38 void setLatency(double value) override { THROW_UNIMPLEMENTED; }
39 void setBandwidthTrace(tmgr_trace_t trace) override;
40 void setLatencyTrace(tmgr_trace_t trace) override;
46 class XBT_PRIVATE NetworkNS3Action : public NetworkAction {
48 NetworkNS3Action(kernel::resource::Model* model, double cost, s4u::Host* src, s4u::Host* dst);
50 bool isSuspended() override;
52 void suspend() override;
53 void resume() override;
54 std::list<LinkImpl*> links() override;
65 #endif /* NETWORK_NS3_HPP_ */