Ipv4AddressHelper::Allocate -> Ipv4AddressHelper::Assign
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon Apr 07 10:41:21 2008 -0700 (22 months ago)
changeset 2888872dc8466352
parent 2887 9a637e6daee0
child 2889 969d4f6ab9ba
Ipv4AddressHelper::Allocate -> Ipv4AddressHelper::Assign
examples/csma-broadcast.cc
examples/csma-multicast.cc
examples/csma-one-subnet.cc
examples/mixed-global-routing.cc
examples/simple-alternate-routing.cc
examples/simple-error-model.cc
examples/simple-global-routing.cc
examples/simple-point-to-point-olsr.cc
examples/tcp-large-transfer.cc
examples/udp-echo.cc
src/helper/ipv4-address-helper.cc
src/helper/ipv4-address-helper.h
tutorial/tutorial-bus-network.cc
tutorial/tutorial-csma-echo-ascii-trace.cc
tutorial/tutorial-csma-echo-pcap-trace.cc
tutorial/tutorial-csma-echo.cc
tutorial/tutorial-linear-dumbbell.cc
tutorial/tutorial-point-to-point.cc
tutorial/tutorial-star-routing.cc
tutorial/tutorial-star.cc
     1.1 --- a/examples/csma-broadcast.cc	Mon Apr 07 10:38:37 2008 -0700
     1.2 +++ b/examples/csma-broadcast.cc	Mon Apr 07 10:41:21 2008 -0700
     1.3 @@ -81,9 +81,9 @@
     1.4    NS_LOG_INFO ("Assign IP Addresses.");
     1.5    Ipv4AddressHelper ipv4;
     1.6    ipv4.SetBase ("10.1.0.0", "255.255.255.0");
     1.7 -  ipv4.Allocate (n0);
     1.8 +  ipv4.Assign (n0);
     1.9    ipv4.SetBase ("192.168.1.0", "255.255.255.0");
    1.10 -  ipv4.Allocate (n1);
    1.11 +  ipv4.Assign (n1);
    1.12  
    1.13  
    1.14    // RFC 863 discard port ("9") indicates packet should be thrown away
     2.1 --- a/examples/csma-multicast.cc	Mon Apr 07 10:38:37 2008 -0700
     2.2 +++ b/examples/csma-multicast.cc	Mon Apr 07 10:41:21 2008 -0700
     2.3 @@ -89,9 +89,9 @@
     2.4    NS_LOG_INFO ("Assign IP Addresses.");
     2.5    Ipv4AddressHelper ipv4Addr;
     2.6    ipv4Addr.SetBase ("10.1.1.0", "255.255.255.0");
     2.7 -  ipv4Addr.Allocate (nd0);
     2.8 +  ipv4Addr.Assign (nd0);
     2.9    ipv4Addr.SetBase ("10.1.2.0", "255.255.255.0");
    2.10 -  ipv4Addr.Allocate (nd1);
    2.11 +  ipv4Addr.Assign (nd1);
    2.12  
    2.13    NS_LOG_INFO ("Configure multicasting.");
    2.14    //
     3.1 --- a/examples/csma-one-subnet.cc	Mon Apr 07 10:38:37 2008 -0700
     3.2 +++ b/examples/csma-one-subnet.cc	Mon Apr 07 10:41:21 2008 -0700
     3.3 @@ -86,7 +86,7 @@
     3.4    NS_LOG_INFO ("Assign IP Addresses.");
     3.5    Ipv4AddressHelper ipv4;
     3.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
     3.7 -  ipv4.Allocate (nd0);
     3.8 +  ipv4.Assign (nd0);
     3.9  
    3.10  //
    3.11  // Create an OnOff application to send UDP datagrams from node zero to node 1.
     4.1 --- a/examples/mixed-global-routing.cc	Mon Apr 07 10:38:37 2008 -0700
     4.2 +++ b/examples/mixed-global-routing.cc	Mon Apr 07 10:41:21 2008 -0700
     4.3 @@ -123,16 +123,16 @@
     4.4    NS_LOG_INFO ("Assign IP Addresses.");
     4.5    Ipv4AddressHelper ipv4;
     4.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
     4.7 -  ipv4.Allocate (d0d2);
     4.8 +  ipv4.Assign (d0d2);
     4.9  
    4.10    ipv4.SetBase ("10.1.2.0", "255.255.255.0");
    4.11 -  ipv4.Allocate (d1d2);
    4.12 +  ipv4.Assign (d1d2);
    4.13  
    4.14    ipv4.SetBase ("10.1.3.0", "255.255.255.0");
    4.15 -  Ipv4InterfaceContainer i5i6 = ipv4.Allocate (d5d6);
    4.16 +  Ipv4InterfaceContainer i5i6 = ipv4.Assign (d5d6);
    4.17  
    4.18    ipv4.SetBase ("10.250.1.0", "255.255.255.0");
    4.19 -  ipv4.Allocate (d2345);
    4.20 +  ipv4.Assign (d2345);
    4.21  
    4.22    // Create router nodes, initialize routing database and set up the routing
    4.23    // tables in the nodes.
     5.1 --- a/examples/simple-alternate-routing.cc	Mon Apr 07 10:38:37 2008 -0700
     5.2 +++ b/examples/simple-alternate-routing.cc	Mon Apr 07 10:41:21 2008 -0700
     5.3 @@ -117,16 +117,16 @@
     5.4    NS_LOG_INFO ("Assign IP Addresses.");
     5.5    Ipv4AddressHelper ipv4;
     5.6    ipv4.SetBase ("10.0.0.0", "255.255.255.0");
     5.7 -  ipv4.Allocate (d0d2);
     5.8 +  ipv4.Assign (d0d2);
     5.9    
    5.10    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
    5.11 -  Ipv4InterfaceContainer i1i2 = ipv4.Allocate (d1d2);
    5.12 +  Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
    5.13    
    5.14    ipv4.SetBase ("10.2.2.0", "255.255.255.0");
    5.15 -  ipv4.Allocate (d3d2);
    5.16 +  ipv4.Assign (d3d2);
    5.17  
    5.18    ipv4.SetBase ("10.3.3.0", "255.255.255.0");
    5.19 -  Ipv4InterfaceContainer i1i3 = ipv4.Allocate (d1d3);
    5.20 +  Ipv4InterfaceContainer i1i3 = ipv4.Assign (d1d3);
    5.21  
    5.22    i1i3.SetMetric (0, sampleMetric);
    5.23    i1i3.SetMetric (1, sampleMetric);
     6.1 --- a/examples/simple-error-model.cc	Mon Apr 07 10:38:37 2008 -0700
     6.2 +++ b/examples/simple-error-model.cc	Mon Apr 07 10:41:21 2008 -0700
     6.3 @@ -105,13 +105,13 @@
     6.4    NS_LOG_INFO ("Assign IP Addresses.");
     6.5    Ipv4AddressHelper ipv4;
     6.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
     6.7 -  ipv4.Allocate (d0d2);
     6.8 +  ipv4.Assign (d0d2);
     6.9    
    6.10    ipv4.SetBase ("10.1.2.0", "255.255.255.0");
    6.11 -  Ipv4InterfaceContainer i1i2 = ipv4.Allocate (d1d2);
    6.12 +  Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
    6.13  
    6.14    ipv4.SetBase ("10.1.3.0", "255.255.255.0");
    6.15 -  Ipv4InterfaceContainer i3i2 = ipv4.Allocate (d3d2);
    6.16 +  Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
    6.17  
    6.18    NS_LOG_INFO ("Use global routing.");
    6.19    GlobalRouteManager::PopulateRoutingTables ();
     7.1 --- a/examples/simple-global-routing.cc	Mon Apr 07 10:38:37 2008 -0700
     7.2 +++ b/examples/simple-global-routing.cc	Mon Apr 07 10:41:21 2008 -0700
     7.3 @@ -105,13 +105,13 @@
     7.4    NS_LOG_INFO ("Assign IP Addresses.");
     7.5    Ipv4AddressHelper ipv4;
     7.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
     7.7 -  Ipv4InterfaceContainer i0i2 = ipv4.Allocate (d0d2);
     7.8 +  Ipv4InterfaceContainer i0i2 = ipv4.Assign (d0d2);
     7.9  
    7.10    ipv4.SetBase ("10.1.2.0", "255.255.255.0");
    7.11 -  Ipv4InterfaceContainer i1i2 = ipv4.Allocate (d1d2);
    7.12 +  Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2);
    7.13    
    7.14    ipv4.SetBase ("10.1.3.0", "255.255.255.0");
    7.15 -  Ipv4InterfaceContainer i3i2 = ipv4.Allocate (d3d2);
    7.16 +  Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2);
    7.17  
    7.18    // Create router nodes, initialize routing database and set up the routing
    7.19    // tables in the nodes.
     8.1 --- a/examples/simple-point-to-point-olsr.cc	Mon Apr 07 10:38:37 2008 -0700
     8.2 +++ b/examples/simple-point-to-point-olsr.cc	Mon Apr 07 10:41:21 2008 -0700
     8.3 @@ -105,16 +105,16 @@
     8.4    NS_LOG_INFO ("Assign IP Addresses.");
     8.5    Ipv4AddressHelper ipv4;
     8.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
     8.7 -  Ipv4InterfaceContainer i02 = ipv4.Allocate (nd02);
     8.8 +  Ipv4InterfaceContainer i02 = ipv4.Assign (nd02);
     8.9  
    8.10    ipv4.SetBase ("10.1.2.0", "255.255.255.0");
    8.11 -  Ipv4InterfaceContainer i12 = ipv4.Allocate (nd12);
    8.12 +  Ipv4InterfaceContainer i12 = ipv4.Assign (nd12);
    8.13    
    8.14    ipv4.SetBase ("10.1.3.0", "255.255.255.0");
    8.15 -  Ipv4InterfaceContainer i32 = ipv4.Allocate (nd32);
    8.16 +  Ipv4InterfaceContainer i32 = ipv4.Assign (nd32);
    8.17  
    8.18    ipv4.SetBase ("10.1.4.0", "255.255.255.0");
    8.19 -  Ipv4InterfaceContainer i34 = ipv4.Allocate (nd34);
    8.20 +  Ipv4InterfaceContainer i34 = ipv4.Assign (nd34);
    8.21  
    8.22    // Enable OLSR
    8.23    NS_LOG_INFO ("Enabling OLSR Routing.");
     9.1 --- a/examples/tcp-large-transfer.cc	Mon Apr 07 10:38:37 2008 -0700
     9.2 +++ b/examples/tcp-large-transfer.cc	Mon Apr 07 10:41:21 2008 -0700
     9.3 @@ -150,9 +150,9 @@
     9.4    // Later, we add IP addresses.  
     9.5    Ipv4AddressHelper ipv4;
     9.6    ipv4.SetBase ("10.1.3.0", "255.255.255.0");
     9.7 -  ipv4.Allocate (dev0);
     9.8 +  ipv4.Assign (dev0);
     9.9    ipv4.SetBase ("10.1.2.0", "255.255.255.0");
    9.10 -  Ipv4InterfaceContainer ipInterfs = ipv4.Allocate (dev1);
    9.11 +  Ipv4InterfaceContainer ipInterfs = ipv4.Assign (dev1);
    9.12  
    9.13    // and setup ip routing tables to get total ip-level connectivity.
    9.14    GlobalRouteManager::PopulateRoutingTables ();
    10.1 --- a/examples/udp-echo.cc	Mon Apr 07 10:38:37 2008 -0700
    10.2 +++ b/examples/udp-echo.cc	Mon Apr 07 10:41:21 2008 -0700
    10.3 @@ -97,7 +97,7 @@
    10.4  //
    10.5    NS_LOG_INFO ("Assign IP Addresses.");
    10.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
    10.7 -  Ipv4InterfaceContainer i = ipv4.Allocate (d);
    10.8 +  Ipv4InterfaceContainer i = ipv4.Assign (d);
    10.9  
   10.10    NS_LOG_INFO ("Create Applications.");
   10.11  //
    11.1 --- a/src/helper/ipv4-address-helper.cc	Mon Apr 07 10:38:37 2008 -0700
    11.2 +++ b/src/helper/ipv4-address-helper.cc	Mon Apr 07 10:41:21 2008 -0700
    11.3 @@ -121,7 +121,7 @@
    11.4  }
    11.5  
    11.6  Ipv4InterfaceContainer
    11.7 -Ipv4AddressHelper::Allocate (const NetDeviceContainer &c)
    11.8 +Ipv4AddressHelper::Assign (const NetDeviceContainer &c)
    11.9  {
   11.10    NS_LOG_FUNCTION;
   11.11    Ipv4InterfaceContainer retval;
    12.1 --- a/src/helper/ipv4-address-helper.h	Mon Apr 07 10:38:37 2008 -0700
    12.2 +++ b/src/helper/ipv4-address-helper.h	Mon Apr 07 10:41:21 2008 -0700
    12.3 @@ -165,7 +165,7 @@
    12.4   * @see SetBase
    12.5   * @see NewNetwork
    12.6   */
    12.7 -  Ipv4InterfaceContainer Allocate (const NetDeviceContainer &c);
    12.8 +  Ipv4InterfaceContainer Assign (const NetDeviceContainer &c);
    12.9  
   12.10  private:
   12.11    uint32_t NumAddressBits (uint32_t maskbits) const;
    13.1 --- a/tutorial/tutorial-bus-network.cc	Mon Apr 07 10:38:37 2008 -0700
    13.2 +++ b/tutorial/tutorial-bus-network.cc	Mon Apr 07 10:41:21 2008 -0700
    13.3 @@ -46,7 +46,7 @@
    13.4  
    13.5    Ipv4AddressHelper ipv4;
    13.6    ipv4.SetBase ("10.1.0.0", "255.255.0.0", "0.0.0.3");
    13.7 -  Ipv4InterfaceContainer i = ipv4.Allocate (nd);
    13.8 +  Ipv4InterfaceContainer i = ipv4.Assign (nd);
    13.9  
   13.10    uint32_t port = 7;
   13.11    UdpEchoClientHelper client;
    14.1 --- a/tutorial/tutorial-csma-echo-ascii-trace.cc	Mon Apr 07 10:38:37 2008 -0700
    14.2 +++ b/tutorial/tutorial-csma-echo-ascii-trace.cc	Mon Apr 07 10:41:21 2008 -0700
    14.3 @@ -44,7 +44,7 @@
    14.4  
    14.5    Ipv4AddressHelper ipv4;
    14.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
    14.7 -  Ipv4InterfaceContainer i = ipv4.Allocate (nd);
    14.8 +  Ipv4InterfaceContainer i = ipv4.Assign (nd);
    14.9  
   14.10    uint16_t port = 7;
   14.11  
    15.1 --- a/tutorial/tutorial-csma-echo-pcap-trace.cc	Mon Apr 07 10:38:37 2008 -0700
    15.2 +++ b/tutorial/tutorial-csma-echo-pcap-trace.cc	Mon Apr 07 10:41:21 2008 -0700
    15.3 @@ -42,7 +42,7 @@
    15.4  
    15.5    Ipv4AddressHelper ipv4;
    15.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
    15.7 -  Ipv4InterfaceContainer i = ipv4.Allocate (nd);
    15.8 +  Ipv4InterfaceContainer i = ipv4.Assign (nd);
    15.9  
   15.10    uint16_t port = 7;
   15.11  
    16.1 --- a/tutorial/tutorial-csma-echo.cc	Mon Apr 07 10:38:37 2008 -0700
    16.2 +++ b/tutorial/tutorial-csma-echo.cc	Mon Apr 07 10:41:21 2008 -0700
    16.3 @@ -42,7 +42,7 @@
    16.4  
    16.5    Ipv4AddressHelper ipv4;
    16.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
    16.7 -  Ipv4InterfaceContainer i = ipv4.Allocate (nd);
    16.8 +  Ipv4InterfaceContainer i = ipv4.Assign (nd);
    16.9  
   16.10    uint16_t port = 7;
   16.11  
    17.1 --- a/tutorial/tutorial-linear-dumbbell.cc	Mon Apr 07 10:38:37 2008 -0700
    17.2 +++ b/tutorial/tutorial-linear-dumbbell.cc	Mon Apr 07 10:41:21 2008 -0700
    17.3 @@ -58,7 +58,7 @@
    17.4    NetDeviceContainer dev1 = csma.Install (lan1);
    17.5    Ipv4AddressHelper ipv4;
    17.6    ipv4.SetBase ("10.1.1.0", "255.255.255.0");
    17.7 -  Ipv4InterfaceContainer i1 = ipv4.Allocate (dev1);
    17.8 +  Ipv4InterfaceContainer i1 = ipv4.Assign (dev1);
    17.9  
   17.10  
   17.11  //
   17.12 @@ -70,7 +70,7 @@
   17.13  
   17.14    NetDeviceContainer dev2 = csma.Install (lan2);
   17.15    ipv4.SetBase ("10.1.2.0", "255.255.255.0");
   17.16 -  Ipv4InterfaceContainer i2 = ipv4.Allocate (dev2);
   17.17 +  Ipv4InterfaceContainer i2 = ipv4.Assign (dev2);
   17.18  
   17.19  
   17.20  //
   17.21 @@ -82,7 +82,7 @@
   17.22    p2p.SetChannelParameter ("Delay", MilliSeconds (20));
   17.23    NetDeviceContainer dev3 = p2p.Install (backbone);
   17.24    ipv4.SetBase ("10.1.3.0", "255.255.255.0");
   17.25 -  ipv4.Allocate (dev3);
   17.26 +  ipv4.Assign (dev3);
   17.27  
   17.28  //
   17.29  // Create data flows across the link:
    18.1 --- a/tutorial/tutorial-point-to-point.cc	Mon Apr 07 10:38:37 2008 -0700
    18.2 +++ b/tutorial/tutorial-point-to-point.cc	Mon Apr 07 10:41:21 2008 -0700
    18.3 @@ -51,7 +51,7 @@
    18.4  
    18.5    Ipv4AddressHelper ipv4;
    18.6    ipv4.SetBase ("10.1.1.0", "255.255.255.252");
    18.7 -  Ipv4InterfaceContainer i = ipv4.Allocate (nd);
    18.8 +  Ipv4InterfaceContainer i = ipv4.Assign (nd);
    18.9  
   18.10    uint16_t port = 7;
   18.11    UdpEchoClientHelper client;
    19.1 --- a/tutorial/tutorial-star-routing.cc	Mon Apr 07 10:38:37 2008 -0700
    19.2 +++ b/tutorial/tutorial-star-routing.cc	Mon Apr 07 10:41:21 2008 -0700
    19.3 @@ -68,17 +68,17 @@
    19.4  
    19.5    Ipv4AddressHelper ipv4;
    19.6    ipv4.SetBase ("10.1.1.0", "255.255.255.252");
    19.7 -  Ipv4InterfaceContainer i01 = ipv4.Allocate (d01);
    19.8 +  Ipv4InterfaceContainer i01 = ipv4.Assign (d01);
    19.9    ipv4.SetBase ("10.1.2.0", "255.255.255.252");
   19.10 -  Ipv4InterfaceContainer i02 = ipv4.Allocate (d02);
   19.11 +  Ipv4InterfaceContainer i02 = ipv4.Assign (d02);
   19.12    ipv4.SetBase ("10.1.3.0", "255.255.255.252");
   19.13 -  Ipv4InterfaceContainer i03 = ipv4.Allocate (d03);
   19.14 +  Ipv4InterfaceContainer i03 = ipv4.Assign (d03);
   19.15    ipv4.SetBase ("10.1.4.0", "255.255.255.252");
   19.16 -  Ipv4InterfaceContainer i04 = ipv4.Allocate (d04);
   19.17 +  Ipv4InterfaceContainer i04 = ipv4.Assign (d04);
   19.18    ipv4.SetBase ("10.1.5.0", "255.255.255.252");
   19.19 -  Ipv4InterfaceContainer i05 = ipv4.Allocate (d05);
   19.20 +  Ipv4InterfaceContainer i05 = ipv4.Assign (d05);
   19.21    ipv4.SetBase ("10.1.6.0", "255.255.255.252");
   19.22 -  Ipv4InterfaceContainer i06 = ipv4.Allocate (d06);
   19.23 +  Ipv4InterfaceContainer i06 = ipv4.Assign (d06);
   19.24  
   19.25    uint16_t port = 7;
   19.26  
    20.1 --- a/tutorial/tutorial-star.cc	Mon Apr 07 10:38:37 2008 -0700
    20.2 +++ b/tutorial/tutorial-star.cc	Mon Apr 07 10:41:21 2008 -0700
    20.3 @@ -67,17 +67,17 @@
    20.4  
    20.5    Ipv4AddressHelper ipv4;
    20.6    ipv4.SetBase ("10.1.1.0", "255.255.255.252");
    20.7 -  Ipv4InterfaceContainer i01 = ipv4.Allocate (d01);
    20.8 +  Ipv4InterfaceContainer i01 = ipv4.Assign (d01);
    20.9    ipv4.SetBase ("10.1.2.0", "255.255.255.252");
   20.10 -  Ipv4InterfaceContainer i02 = ipv4.Allocate (d02);
   20.11 +  Ipv4InterfaceContainer i02 = ipv4.Assign (d02);
   20.12    ipv4.SetBase ("10.1.3.0", "255.255.255.252");
   20.13 -  Ipv4InterfaceContainer i03 = ipv4.Allocate (d03);
   20.14 +  Ipv4InterfaceContainer i03 = ipv4.Assign (d03);
   20.15    ipv4.SetBase ("10.1.4.0", "255.255.255.252");
   20.16 -  Ipv4InterfaceContainer i04 = ipv4.Allocate (d04);
   20.17 +  Ipv4InterfaceContainer i04 = ipv4.Assign (d04);
   20.18    ipv4.SetBase ("10.1.5.0", "255.255.255.252");
   20.19 -  Ipv4InterfaceContainer i05 = ipv4.Allocate (d05);
   20.20 +  Ipv4InterfaceContainer i05 = ipv4.Assign (d05);
   20.21    ipv4.SetBase ("10.1.6.0", "255.255.255.252");
   20.22 -  Ipv4InterfaceContainer i06 = ipv4.Allocate (d06);
   20.23 +  Ipv4InterfaceContainer i06 = ipv4.Assign (d06);
   20.24  
   20.25    uint16_t port = 7;
   20.26