typos in doxygen, default to 0.0.0.1, avoid broadcast address
authorCraig Dowell <craigdo@ee.washington.edu>
Mon, 24 Mar 2008 12:45:02 -0700
changeset 2712 02f089bd33f0
parent 2711 83addb15f632
child 2713 d0d5904c0fe2
typos in doxygen, default to 0.0.0.1, avoid broadcast address
src/helper/ipv4-address-helper.cc
src/helper/ipv4-address-helper.h
--- a/src/helper/ipv4-address-helper.cc	Fri Mar 21 17:26:01 2008 -0700
+++ b/src/helper/ipv4-address-helper.cc	Mon Mar 24 12:45:02 2008 -0700
@@ -71,7 +71,7 @@
 // the maximum allowed address is with respect to the current mask.
 //
   m_shift = NumAddressBits (m_mask);
-  m_max = (1 << m_shift) - 1;
+  m_max = (1 << m_shift) - 2;
 
   NS_ASSERT_MSG(m_shift <= 32,
     "Ipv4AddressHelper::SetBase(): Unreasonable address length");
--- a/src/helper/ipv4-address-helper.h	Fri Mar 21 17:26:01 2008 -0700
+++ b/src/helper/ipv4-address-helper.h	Mon Mar 24 12:45:02 2008 -0700
@@ -63,22 +63,24 @@
  *
  *   SetBase ("192.168.1.0", "255.255.255.0", "0.0.0.3");
  *
- * If you don't care about the initial address it defaults to "0.0.0.0" in 
+ * If you don't care about the initial address it defaults to "0.0.0.1" in 
  * which case you can simply use,
  *
- *   SetBase ("192.168.1.0", "255.255.255.0", "0.0.0.3");
+ *   SetBase ("192.168.1.0", "255.255.255.0");
+ *
+ * and the first address generated will be 192.168.1.1.
  *
  * @param network The Ipv4Address containing the initial network number to
- * use during allocation.  The bits outside the nework mask are not used.
+ * use during allocation.  The bits outside the network mask are not used.
  * @param mask The Ipv4Mask containing one bits in each bit position of the 
  * network number.
  * @param base An optional Ipv4Address containing the initial address used for 
  * IP address alloction.  Will be combined (ORed) with the network number to
- * generate the first IP address.  Defaults to 0.0.0.0
+ * generate the first IP address.  Defaults to 0.0.0.1.
  * @returns Nothing.
  */
   void SetBase (Ipv4Address network, Ipv4Mask mask, 
-    Ipv4Address base = "0.0.0.0");
+    Ipv4Address base = "0.0.0.1");
 
 /**
  * @brief Increment the network number and reset the IP address counter to 
@@ -97,7 +99,7 @@
  * 192.168.1.0, 192.168.2.0, etc.  After each network number increment, the
  * IP address counter is reset to the initial value specified in SetBase.  In 
  * this case, that would be 0.0.0.3. so if you were to call NewAddress after
- * the increment that resulted in a network numebr of 192.168.2.0, the 
+ * the increment that resulted in a network number of 192.168.2.0, the 
  * allocated addresses returned by NewAddress would be 192.168.2.3, 
  * 192.168.2.4, etc.
  *
@@ -125,7 +127,7 @@
  * 255.255.255.0 and a base address of 0.0.0.3 in SetBase, the next call to
  * NewAddress will return 192.168.1.3.  The NewAddress method 
  * has post-increment semantics.  A following NewAddress would return 
- * 192.168.0.4, etc., until the 256th call which would assert due to an address
+ * 192.168.0.4, etc., until the 253rd call which would assert due to an address
  * overflow.
  *
  * @returns The value of the newly allocated IP address.