From 2218e346ae6ec412c7892adef43e286da8cb03be Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 22 Feb 2007 09:40:46 +0100 Subject: [PATCH] merge with trunk --- samples/ns-2/simple.tcl.cc | 13 +++++++++---- src/node/ipv4-address.cc | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/samples/ns-2/simple.tcl.cc b/samples/ns-2/simple.tcl.cc index bc41b66ae..fd208517c 100644 --- a/samples/ns-2/simple.tcl.cc +++ b/samples/ns-2/simple.tcl.cc @@ -23,10 +23,14 @@ #include #include +#include #include "ns3/debug.h" + #include "ns3/simulator.h" #include "ns3/nstime.h" +#include "ns3/trace-writer.h" + #include "ns3/internet-node.h" #include "ns3/serial-channel.h" #include "ns3/mac-address.h" @@ -186,7 +190,6 @@ AddDuplexLink( InternetNode* b, const Ipv4Address& addrb, const MacAddress& macaddrb, - const Ipv4Mask& netmask, // const Rate& rate, // const Time& delay, TraceContainer &traceContainer, @@ -195,6 +198,11 @@ AddDuplexLink( std::string qName; SerialChannel* channel = new SerialChannel(); + // Duplex link is assumed to be subnetted as a /30 + // May run this unnumbered in the future? + Ipv4Mask netmask("255.255.255.252"); + assert(netmask.IsMatch(addra,addrb)); + qName = name + "::Queue A"; DropTailQueue* dtqa = new DropTailQueue(qName); dtqa->RegisterTraces (traceContainer); @@ -293,7 +301,6 @@ int main (int argc, char *argv[]) SerialChannel* ch1 = AddDuplexLink ( n0, Ipv4Address("10.1.1.1"), MacAddress("00:00:00:00:00:01"), n2, Ipv4Address("10.1.1.2"), MacAddress("00:00:00:00:00:02"), - Ipv4Mask("255.255.255.0"), traceContainer, channelName); SetupTrace (traceContainer, tracer); @@ -301,7 +308,6 @@ int main (int argc, char *argv[]) SerialChannel* ch2 = AddDuplexLink ( n1, Ipv4Address("10.1.2.1"), MacAddress("00:00:00:00:00:03"), n2, Ipv4Address("10.1.2.2"), MacAddress("00:00:00:00:00:04"), - Ipv4Mask("255.255.255.0"), traceContainer, channelName); SetupTrace (traceContainer, tracer); @@ -309,7 +315,6 @@ int main (int argc, char *argv[]) SerialChannel* ch3 = AddDuplexLink ( n2, Ipv4Address("10.1.3.1"), MacAddress("00:00:00:00:00:05"), n3, Ipv4Address("10.1.3.2"), MacAddress("00:00:00:00:00:06"), - Ipv4Mask("255.255.255.0"), traceContainer, channelName); SetupTrace (traceContainer, tracer); diff --git a/src/node/ipv4-address.cc b/src/node/ipv4-address.cc index 00e985e72..86d02792a 100644 --- a/src/node/ipv4-address.cc +++ b/src/node/ipv4-address.cc @@ -18,9 +18,13 @@ * * Author: Mathieu Lacage */ +#include "ns3/debug.h" + +NS_DEBUG_COMPONENT_DEFINE("Ipv4Address"); #include "ipv4-address.h" + namespace ns3 { #define ASCII_DOT (0x2e)