1 /* Copyright (c) 2004-2014. The SimGrid Team.
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 #include "network_interface.hpp"
6 #include "surf/ns3/ns3_interface.h"
8 #ifndef NETWORK_NS3_HPP_
9 #define NETWORK_NS3_HPP_
14 class NetworkNS3Model;
15 typedef NetworkNS3Model *NetworkNS3ModelPtr;
18 typedef NetworkNS3Link *NetworkNS3LinkPtr;
20 class NetworkNS3Action;
21 typedef NetworkNS3Action *NetworkNS3ActionPtr;
27 void net_define_callbacks(void);
33 class NetworkNS3Model : public NetworkModel {
38 NetworkLinkPtr createResource(const char *name,
40 tmgr_trace_t bw_trace,
42 tmgr_trace_t lat_trace,
43 e_surf_resource_state_t state_initial,
44 tmgr_trace_t state_trace,
45 e_surf_link_sharing_policy_t policy,
46 xbt_dict_t properties);
47 xbt_dynar_t getRoute(RoutingEdgePtr src, RoutingEdgePtr dst);
48 ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
49 double size, double rate);
50 double shareResources(double now);
51 void updateActionsState(double now, double delta);
57 class NetworkNS3Link : public NetworkLink {
59 NetworkNS3Link(NetworkNS3ModelPtr model, const char *name, xbt_dict_t props,
60 double bw_initial, double lat_initial);
63 void updateState(tmgr_trace_event_t event_type, double value, double date);
65 double getBandwidth();
77 class NetworkNS3Action : public NetworkAction {
79 NetworkNS3Action(ModelPtr model, double cost, bool failed);
81 #ifdef HAVE_LATENCY_BOUND_TRACKING
82 int getLatencyLimited();
93 RoutingEdgePtr p_srcElm;
94 RoutingEdgePtr p_dstElm;
99 #endif /* NETWORK_NS3_HPP_ */