--- a/src/devices/p2p/p2p-topology.cc Mon Mar 26 06:39:20 2007 -0700
+++ b/src/devices/p2p/p2p-topology.cc Mon Mar 26 06:50:33 2007 -0700
@@ -92,23 +92,49 @@
return channel;
}
-#if 0
+#ifdef NOTYET
+
+// Get the net device connecting node n1 to n2. For topologies where
+// there are possibly multiple devices connecting n1 and n2 (for example
+// wireless with two devices on different channels) this will return
+// the first one found.
+PointToPointNetDevice* PointToPointTopology::GetNetDevice(Node* n1, Node* n2)
+{
+ // First get the NetDeviceList capability from node 1
+ NetDeviceList* ndl1 = n1->GetNetDeviceList();
+ if (!ndl1) return 0; // No devices, return nil
+ // Get the list of devices
+ const NetDeviceList::NetDevices_t& dlist = ndl1->GetAll();
+ for (NetDeviceList::NetDevices_t::const_iterator i = dlist.Begin();
+ i != dlist.End(); ++i)
+ { // Check each device
+ NetDevice* nd = *i; // next device
+ Channel* c = nd->GetChannel();
+ if (!c) continue; // No channel
+ if (c->NodeIsPeer(n2)) return nd; // found it
+ }
+ return 0; // None found
+}
+
// Get the channel connecting node n1 to node n2
-Channel* Topology::GetChannel(Node* n1, Node* n2)
+PointToPointChannel* PointToPointTopology::GetChannel(
+ Node* n1,
+ Node* n2
+)
{
NetDevice* nd = GetNetDevice(n1, n2);
if (!nd) return 0; // No net device, so no channel
return nd->GetChannel();
}
-Queue* Topology::GetQueue(Node* n1, Node* n2)
+Queue* PointToPointTopology::GetQueue(Node* n1, Node* n2)
{
NetDevice* nd = GetNetDevice(n1, n2);
if (!nd) return 0; // No net device, so in queue
return nd->GetQueue();
}
-Queue* Topology::SetQueue(Node* n1, Node* n2, const Queue& q)
+Queue* PointToPointTopology::SetQueue(Node* n1, Node* n2, const Queue& q)
{
NetDevice* nd = GetNetDevice(n1, n2);
if (!nd) return 0; // No net device, can't set queue
@@ -116,7 +142,9 @@
return nd->SetQueue(q);
}
+#endif
+#ifdef GFR
P2PChannel* Topology::AddDuplexLink(Node* n1, const IPAddr& ip1,
Node* n2, const IPAddr& ip2,
const Rate& rate, const Time& delay)
@@ -148,28 +176,6 @@
return dynamic_cast<P2PChannel*>(nd1->GetChannel()); // Always succeeds
}
-// Get the net device connecting node n1 to n2. For topologies where
-// there are possibly multiple devices connecting n1 and n2 (for example
-// wireless with two devices on different channels) this will return
-// the first one found.
-NetDevice* Topology::GetNetDevice(Node* n1, Node* n2)
-{
- // First get the NetDeviceList capability from node 1
- NetDeviceList* ndl1 = n1->GetNetDeviceList();
- if (!ndl1) return 0; // No devices, return nil
- // Get the list of devices
- const NetDeviceList::NetDevices_t& dlist = ndl1->GetAll();
- for (NetDeviceList::NetDevices_t::const_iterator i = dlist.Begin();
- i != dlist.End(); ++i)
- { // Check each device
- NetDevice* nd = *i; // next device
- Channel* c = nd->GetChannel();
- if (!c) continue; // No channel
- if (c->NodeIsPeer(n2)) return nd; // found it
- }
- return 0; // None found
-}
-
// Get the channel connecting node n1 to node n2
Channel* Topology::GetChannel(Node* n1, Node* n2)
{
--- a/src/devices/p2p/p2p-topology.h Mon Mar 26 06:39:20 2007 -0700
+++ b/src/devices/p2p/p2p-topology.h Mon Mar 26 06:50:33 2007 -0700
@@ -32,8 +32,7 @@
class Node;
class IPAddr;
class DataRate;
-//class PointToPointNetDevice;
-//class Queue;
+class Queue;
//class Time;
class PointToPointTopology {
@@ -50,9 +49,9 @@
const Time&);
// Get the connecting node n1 to node n2
- static Channel* GetChannel(Node*, Node*);
+ static PointToPointChannel* GetChannel(Node*, Node*);
// Get the NetDevice connecting node n1 to n2
- static NetDevice* GetNetDevice(Node*, Node*);
+ static PointToPointNetDevice* GetNetDevice(Node*, Node*);
/// Get the queue associated with a link between two nodes
static Queue* GetQueue(Node*, Node*);
// Set the queue associated with a link between two nodes