1 /* Copyright (c) 2007-2014. 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. */
7 #ifndef _NS3_INTERFACE_H
8 #define _NS3_INTERFACE_H
11 #include "xbt/dynar.h"
13 #include "xbt/sysdep.h"
14 #include <xbt/Extendable.hpp>
16 #include <simgrid/s4u/host.hpp>
17 #include <surf/surf_routing.h>
21 class NetworkNS3Action;
25 typedef struct ns3_node {
27 } s_ns3_node_t, *ns3_node_t;
29 XBT_PUBLIC_DATA(int) NS3_EXTENSION_ID;
33 XBT_PUBLIC(void) ns3_initialize(const char* TcpProtocol);
34 XBT_PUBLIC(void) ns3_create_flow(const char* a,const char *b,double start,u_int32_t TotalBytes,simgrid::surf::NetworkNS3Action * action);
35 XBT_PUBLIC(void) ns3_simulator(double maxSeconds);
36 XBT_PUBLIC(void *) ns3_add_host_cluster(const char * id);
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(char * bw,char * lat,const char *id);
42 ns3_node_t ns3_find_host(const char* id)
44 sg_host_t host = sg_host_by_name(id);
48 return (ns3_node_t) host->extension(NS3_EXTENSION_ID);