Ipv4AddressHelper::Allocate -> Ipv4AddressHelper::Assign
This commit is contained in:
@@ -81,9 +81,9 @@ main (int argc, char *argv[])
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.0.0", "255.255.255.0");
|
||||
ipv4.Allocate (n0);
|
||||
ipv4.Assign (n0);
|
||||
ipv4.SetBase ("192.168.1.0", "255.255.255.0");
|
||||
ipv4.Allocate (n1);
|
||||
ipv4.Assign (n1);
|
||||
|
||||
|
||||
// RFC 863 discard port ("9") indicates packet should be thrown away
|
||||
|
||||
@@ -89,9 +89,9 @@ main (int argc, char *argv[])
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
Ipv4AddressHelper ipv4Addr;
|
||||
ipv4Addr.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
ipv4Addr.Allocate (nd0);
|
||||
ipv4Addr.Assign (nd0);
|
||||
ipv4Addr.SetBase ("10.1.2.0", "255.255.255.0");
|
||||
ipv4Addr.Allocate (nd1);
|
||||
ipv4Addr.Assign (nd1);
|
||||
|
||||
NS_LOG_INFO ("Configure multicasting.");
|
||||
//
|
||||
|
||||
@@ -86,7 +86,7 @@ main (int argc, char *argv[])
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
ipv4.Allocate (nd0);
|
||||
ipv4.Assign (nd0);
|
||||
|
||||
//
|
||||
// Create an OnOff application to send UDP datagrams from node zero to node 1.
|
||||
|
||||
@@ -123,16 +123,16 @@ main (int argc, char *argv[])
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
ipv4.Allocate (d0d2);
|
||||
ipv4.Assign (d0d2);
|
||||
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
|
||||
ipv4.Allocate (d1d2);
|
||||
ipv4.Assign (d1d2);
|
||||
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i5i6 = ipv4.Allocate (d5d6);
|
||||
Ipv4InterfaceContainer i5i6 = ipv4.Assign (d5d6);
|
||||
|
||||
ipv4.SetBase ("10.250.1.0", "255.255.255.0");
|
||||
ipv4.Allocate (d2345);
|
||||
ipv4.Assign (d2345);
|
||||
|
||||
// Create router nodes, initialize routing database and set up the routing
|
||||
// tables in the nodes.
|
||||
|
||||
@@ -117,16 +117,16 @@ main (int argc, char *argv[])
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.0.0.0", "255.255.255.0");
|
||||
ipv4.Allocate (d0d2);
|
||||
ipv4.Assign (d0d2);
|
||||
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i1i2 = ipv4.Allocate (d1d2);
|
||||
Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
|
||||
|
||||
ipv4.SetBase ("10.2.2.0", "255.255.255.0");
|
||||
ipv4.Allocate (d3d2);
|
||||
ipv4.Assign (d3d2);
|
||||
|
||||
ipv4.SetBase ("10.3.3.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i1i3 = ipv4.Allocate (d1d3);
|
||||
Ipv4InterfaceContainer i1i3 = ipv4.Assign (d1d3);
|
||||
|
||||
i1i3.SetMetric (0, sampleMetric);
|
||||
i1i3.SetMetric (1, sampleMetric);
|
||||
|
||||
@@ -105,13 +105,13 @@ main (int argc, char *argv[])
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
ipv4.Allocate (d0d2);
|
||||
ipv4.Assign (d0d2);
|
||||
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i1i2 = ipv4.Allocate (d1d2);
|
||||
Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
|
||||
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i3i2 = ipv4.Allocate (d3d2);
|
||||
Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
|
||||
|
||||
NS_LOG_INFO ("Use global routing.");
|
||||
GlobalRouteManager::PopulateRoutingTables ();
|
||||
|
||||
@@ -105,13 +105,13 @@ main (int argc, char *argv[])
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i0i2 = ipv4.Allocate (d0d2);
|
||||
Ipv4InterfaceContainer i0i2 = ipv4.Assign (d0d2);
|
||||
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i1i2 = ipv4.Allocate (d1d2);
|
||||
Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
|
||||
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i3i2 = ipv4.Allocate (d3d2);
|
||||
Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
|
||||
|
||||
// Create router nodes, initialize routing database and set up the routing
|
||||
// tables in the nodes.
|
||||
|
||||
@@ -105,16 +105,16 @@ main (int argc, char *argv[])
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i02 = ipv4.Allocate (nd02);
|
||||
Ipv4InterfaceContainer i02 = ipv4.Assign (nd02);
|
||||
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i12 = ipv4.Allocate (nd12);
|
||||
Ipv4InterfaceContainer i12 = ipv4.Assign (nd12);
|
||||
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i32 = ipv4.Allocate (nd32);
|
||||
Ipv4InterfaceContainer i32 = ipv4.Assign (nd32);
|
||||
|
||||
ipv4.SetBase ("10.1.4.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i34 = ipv4.Allocate (nd34);
|
||||
Ipv4InterfaceContainer i34 = ipv4.Assign (nd34);
|
||||
|
||||
// Enable OLSR
|
||||
NS_LOG_INFO ("Enabling OLSR Routing.");
|
||||
|
||||
@@ -150,9 +150,9 @@ int main (int argc, char *argv[])
|
||||
// Later, we add IP addresses.
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
|
||||
ipv4.Allocate (dev0);
|
||||
ipv4.Assign (dev0);
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer ipInterfs = ipv4.Allocate (dev1);
|
||||
Ipv4InterfaceContainer ipInterfs = ipv4.Assign (dev1);
|
||||
|
||||
// and setup ip routing tables to get total ip-level connectivity.
|
||||
GlobalRouteManager::PopulateRoutingTables ();
|
||||
|
||||
@@ -97,7 +97,7 @@ main (int argc, char *argv[])
|
||||
//
|
||||
NS_LOG_INFO ("Assign IP Addresses.");
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i = ipv4.Allocate (d);
|
||||
Ipv4InterfaceContainer i = ipv4.Assign (d);
|
||||
|
||||
NS_LOG_INFO ("Create Applications.");
|
||||
//
|
||||
|
||||
@@ -121,7 +121,7 @@ Ipv4AddressHelper::NewNetwork (void)
|
||||
}
|
||||
|
||||
Ipv4InterfaceContainer
|
||||
Ipv4AddressHelper::Allocate (const NetDeviceContainer &c)
|
||||
Ipv4AddressHelper::Assign (const NetDeviceContainer &c)
|
||||
{
|
||||
NS_LOG_FUNCTION;
|
||||
Ipv4InterfaceContainer retval;
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
* @see SetBase
|
||||
* @see NewNetwork
|
||||
*/
|
||||
Ipv4InterfaceContainer Allocate (const NetDeviceContainer &c);
|
||||
Ipv4InterfaceContainer Assign (const NetDeviceContainer &c);
|
||||
|
||||
private:
|
||||
uint32_t NumAddressBits (uint32_t maskbits) const;
|
||||
|
||||
@@ -46,7 +46,7 @@ main (int argc, char *argv[])
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.0.0", "255.255.0.0", "0.0.0.3");
|
||||
Ipv4InterfaceContainer i = ipv4.Allocate (nd);
|
||||
Ipv4InterfaceContainer i = ipv4.Assign (nd);
|
||||
|
||||
uint32_t port = 7;
|
||||
UdpEchoClientHelper client;
|
||||
|
||||
@@ -44,7 +44,7 @@ main (int argc, char *argv[])
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i = ipv4.Allocate (nd);
|
||||
Ipv4InterfaceContainer i = ipv4.Assign (nd);
|
||||
|
||||
uint16_t port = 7;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ main (int argc, char *argv[])
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i = ipv4.Allocate (nd);
|
||||
Ipv4InterfaceContainer i = ipv4.Assign (nd);
|
||||
|
||||
uint16_t port = 7;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ main (int argc, char *argv[])
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i = ipv4.Allocate (nd);
|
||||
Ipv4InterfaceContainer i = ipv4.Assign (nd);
|
||||
|
||||
uint16_t port = 7;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ main (int argc, char *argv[])
|
||||
NetDeviceContainer dev1 = csma.Install (lan1);
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i1 = ipv4.Allocate (dev1);
|
||||
Ipv4InterfaceContainer i1 = ipv4.Assign (dev1);
|
||||
|
||||
|
||||
//
|
||||
@@ -70,7 +70,7 @@ main (int argc, char *argv[])
|
||||
|
||||
NetDeviceContainer dev2 = csma.Install (lan2);
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
|
||||
Ipv4InterfaceContainer i2 = ipv4.Allocate (dev2);
|
||||
Ipv4InterfaceContainer i2 = ipv4.Assign (dev2);
|
||||
|
||||
|
||||
//
|
||||
@@ -82,7 +82,7 @@ main (int argc, char *argv[])
|
||||
p2p.SetChannelParameter ("Delay", MilliSeconds (20));
|
||||
NetDeviceContainer dev3 = p2p.Install (backbone);
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
|
||||
ipv4.Allocate (dev3);
|
||||
ipv4.Assign (dev3);
|
||||
|
||||
//
|
||||
// Create data flows across the link:
|
||||
|
||||
@@ -51,7 +51,7 @@ main (int argc, char *argv[])
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i = ipv4.Allocate (nd);
|
||||
Ipv4InterfaceContainer i = ipv4.Assign (nd);
|
||||
|
||||
uint16_t port = 7;
|
||||
UdpEchoClientHelper client;
|
||||
|
||||
@@ -68,17 +68,17 @@ main (int argc, char *argv[])
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i01 = ipv4.Allocate (d01);
|
||||
Ipv4InterfaceContainer i01 = ipv4.Assign (d01);
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i02 = ipv4.Allocate (d02);
|
||||
Ipv4InterfaceContainer i02 = ipv4.Assign (d02);
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i03 = ipv4.Allocate (d03);
|
||||
Ipv4InterfaceContainer i03 = ipv4.Assign (d03);
|
||||
ipv4.SetBase ("10.1.4.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i04 = ipv4.Allocate (d04);
|
||||
Ipv4InterfaceContainer i04 = ipv4.Assign (d04);
|
||||
ipv4.SetBase ("10.1.5.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i05 = ipv4.Allocate (d05);
|
||||
Ipv4InterfaceContainer i05 = ipv4.Assign (d05);
|
||||
ipv4.SetBase ("10.1.6.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i06 = ipv4.Allocate (d06);
|
||||
Ipv4InterfaceContainer i06 = ipv4.Assign (d06);
|
||||
|
||||
uint16_t port = 7;
|
||||
|
||||
|
||||
@@ -67,17 +67,17 @@ main (int argc, char *argv[])
|
||||
|
||||
Ipv4AddressHelper ipv4;
|
||||
ipv4.SetBase ("10.1.1.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i01 = ipv4.Allocate (d01);
|
||||
Ipv4InterfaceContainer i01 = ipv4.Assign (d01);
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i02 = ipv4.Allocate (d02);
|
||||
Ipv4InterfaceContainer i02 = ipv4.Assign (d02);
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i03 = ipv4.Allocate (d03);
|
||||
Ipv4InterfaceContainer i03 = ipv4.Assign (d03);
|
||||
ipv4.SetBase ("10.1.4.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i04 = ipv4.Allocate (d04);
|
||||
Ipv4InterfaceContainer i04 = ipv4.Assign (d04);
|
||||
ipv4.SetBase ("10.1.5.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i05 = ipv4.Allocate (d05);
|
||||
Ipv4InterfaceContainer i05 = ipv4.Assign (d05);
|
||||
ipv4.SetBase ("10.1.6.0", "255.255.255.252");
|
||||
Ipv4InterfaceContainer i06 = ipv4.Allocate (d06);
|
||||
Ipv4InterfaceContainer i06 = ipv4.Assign (d06);
|
||||
|
||||
uint16_t port = 7;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user