1 /* Copyright (c) 2007-2016. 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 _NS3_INTERFACE_H
7 #define _NS3_INTERFACE_H
10 #include "xbt/dynar.h"
12 #include "xbt/sysdep.h"
13 #include <xbt/Extendable.hpp>
15 #include <simgrid/s4u/host.hpp>
16 #include <surf/surf_routing.h>
20 class NetworkNS3Action;
26 static simgrid::xbt::Extension<simgrid::s4u::Host, HostNs3> EXTENSION_ID;
34 XBT_PUBLIC(void) ns3_initialize(const char* TcpProtocol);
35 XBT_PUBLIC(void) ns3_create_flow(const char* a,const char *b,double start,u_int32_t TotalBytes,simgrid::surf::NetworkNS3Action * action);
36 XBT_PUBLIC(void) ns3_simulator(double maxSeconds);
37 XBT_PUBLIC(void *) ns3_add_router(const char * id);
38 XBT_PUBLIC(void) ns3_add_link(int src, int dst, char * bw,char * lat);
39 XBT_PUBLIC(void) ns3_add_cluster(const char* id, char* bw, char* lat);
41 inline HostNs3* ns3_find_host(const char* id)
43 sg_host_t host = sg_host_by_name(id);
47 return host->extension<HostNs3>();