1 /* Copyright (c) 2004-2015. The SimGrid Team.
2 * All rights reserved. */
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 #ifndef NETWORK_NS3_HPP_
7 #define NETWORK_NS3_HPP_
12 #include "network_interface.hpp"
13 #include "src/surf/ns3/ns3_interface.h"
18 class NetworkNS3Model : public NetworkModel {
22 LinkImpl* createLink(const char* name, double bandwidth, double latency,
23 e_surf_link_sharing_policy_t policy) override;
24 Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
25 double nextOccuringEvent(double now) override;
26 bool nextOccuringEventIsIdempotent() {return false;}
27 void updateActionsState(double now, double delta) override;
33 class LinkNS3 : public LinkImpl {
35 explicit LinkNS3(NetworkNS3Model* model, const char* name, double bandwidth, double latency);
38 void apply_event(tmgr_trace_iterator_t event, double value) override;
39 void setBandwidth(double value) override { THROW_UNIMPLEMENTED; }
40 void setLatency(double value) override { THROW_UNIMPLEMENTED; }
41 void setBandwidthTrace(tmgr_trace_t trace) override;
42 void setLatencyTrace(tmgr_trace_t trace) override;
48 class XBT_PRIVATE NetworkNS3Action : public NetworkAction {
50 NetworkNS3Action(Model* model, double cost, s4u::Host* src, s4u::Host* dst);
66 #endif /* NETWORK_NS3_HPP_ */