1 /* Copyright (c) 2007, 2008, 2009, 2010. 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 #include "surf/ns3/ns3_interface.h"
8 #include "ns3/core-module.h"
9 #include "ns3/simulator-module.h"
10 #include "ns3/node-module.h"
11 #include "ns3/helper-module.h"
12 #include "ns3/global-route-manager.h"
16 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(interface_ns3, surf,
17 "Logging specific to the SURF network NS3 module");
20 int number_of_nodes = 0;
22 void * ns3_add_host(char * id)
24 ns3_nodes_t host = xbt_new0(s_ns3_nodes_t,1);
25 XBT_INFO("Interface ns3 add host '%s'",id);
26 Ptr<Node> node = CreateObject<Node> (0);
29 host->node_num = number_of_nodes;
30 host->type = NS3_NETWORK_ELEMENT_HOST;
31 host->data = nodes.Get(number_of_nodes);
32 XBT_INFO("node %p",host->data);
37 void * ns3_add_router(char * id)
39 ns3_nodes_t router = xbt_new0(s_ns3_nodes_t,1);
40 XBT_INFO("Interface ns3 add router '%s'",id);
41 Ptr<Node> node = CreateObject<Node> (0);
43 router->node_num = number_of_nodes;
44 router->type = NS3_NETWORK_ELEMENT_ROUTER;
50 void * ns3_add_link(char * id)
52 XBT_INFO("Interface ns3 add link '%s'",id);
53 PointToPointHelper pointToPoint_5Mbps;
54 pointToPoint_5Mbps.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
55 pointToPoint_5Mbps.SetChannelAttribute ("Delay", StringValue ("2ms"));
56 return NULL;//&pointToPoint_5Mbps;
59 void * ns3_add_AS(char * id)
61 XBT_INFO("Interface ns3 add AS '%s'",id);
65 void ns3_add_route(char * src,char * dst)
67 XBT_INFO("Interface ns3 add route from '%s' to '%s'",src,dst);
70 void ns3_add_ASroute(char * src,char * dst)
72 XBT_INFO("Interface ns3 add ASroute from '%s' to '%s'",src,dst);
75 void free_ns3_elmts(void * elmts)
77 XBT_INFO("Free ns3 elmts");