branch merge
authorCraig Dowell <craigdo@ee.washington.edu>
Fri Jul 03 08:27:22 2009 -0700 (7 months ago)
changeset 4655fe0abefa9143
parent 4654 f292d41cb943
parent 4653 1d6962688009
child 4665 daf9af206d08
branch merge
     1.1 Binary file doc/manual/figures/internet-node-recv.dia has changed
     2.1 Binary file doc/manual/figures/internet-node-send.dia has changed
     3.1 --- a/doc/manual/node.texi	Fri Jul 03 08:26:52 2009 -0700
     3.2 +++ b/doc/manual/node.texi	Fri Jul 03 08:27:22 2009 -0700
     3.3 @@ -121,86 +121,74 @@
     3.4  Internet Nodes are not subclasses of class Node; they are simply Nodes 
     3.5  that have had a bunch of IPv4-related
     3.6  objects aggregated to them.  They can be put together by hand, or
     3.7 -via a helper function @code{AddInternetStack ()} which does the 
     3.8 -following:
     3.9 +via a helper function @code{InternetStackHelper::Install ()} which does the 
    3.10 +following to all nodes passed in as arguments:
    3.11  @verbatim
    3.12 -void AddInternetStack (Ptr<Node> node)
    3.13 +void
    3.14 +InternetStackHelper::Install (Ptr<Node> node) const
    3.15  {
    3.16 -  // Create layer-3 protocols 
    3.17 -  Ptr<Ipv4L3Protocol> ipv4 = CreateObject<Ipv4L3Protocol> ();
    3.18 -  Ptr<ArpL3Protocol> arp = CreateObject<ArpL3Protocol> ();
    3.19 -  ipv4->SetNode (node);
    3.20 -  arp->SetNode (node);
    3.21 +  if (node->GetObject<Ipv4> () != 0)
    3.22 +    {
    3.23 +      NS_FATAL_ERROR ("InternetStackHelper::Install(): Aggregating "
    3.24 +                      "an InternetStack to a node with an existing Ipv4 object");
    3.25 +      return;
    3.26 +    }
    3.27  
    3.28 -  // Create an L4 demux 
    3.29 -  Ptr<Ipv4L4Demux> ipv4L4Demux = CreateObject<Ipv4L4Demux> ();
    3.30 +  CreateAndAggregateObjectFromTypeId (node, "ns3::ArpL3Protocol");
    3.31 +  CreateAndAggregateObjectFromTypeId (node, "ns3::Ipv4L3Protocol");
    3.32 +  CreateAndAggregateObjectFromTypeId (node, "ns3::Icmpv4L4Protocol");
    3.33 +  CreateAndAggregateObjectFromTypeId (node, "ns3::UdpL4Protocol");
    3.34 +  node->AggregateObject (m_tcpFactory.Create<Object> ());
    3.35 +  Ptr<PacketSocketFactory> factory = CreateObject<PacketSocketFactory> ();
    3.36 +  node->AggregateObject (factory);
    3.37 +  // Set routing
    3.38 +  Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
    3.39 +  Ptr<Ipv4RoutingProtocol> ipv4Routing = m_routing->Create (node);
    3.40 +  ipv4->SetRoutingProtocol (ipv4Routing);
    3.41 +}
    3.42 +@end verbatim
    3.43  
    3.44 -  // Create transport protocols and insert them into the demux
    3.45 -  Ptr<UdpL4Protocol> udp = CreateObject<UdpL4Protocol> ();
    3.46 -  Ptr<TcpL4Protocol> tcp = CreateObject<TcpL4Protocol> ();
    3.47 -  
    3.48 -  ipv4L4Demux->SetNode (node);
    3.49 -  udp->SetNode (node);
    3.50 -  tcp->SetNode (node);
    3.51 -  
    3.52 -  ipv4L4Demux->Insert (udp);
    3.53 -  ipv4L4Demux->Insert (tcp);
    3.54 -  
    3.55 -  // Add factories for instantiating transport protocol sockets
    3.56 -  Ptr<UdpSocketFactoryImpl> udpFactory = CreateObject<UdpSocketFactoryImpl> ();
    3.57 -  Ptr<TcpSocketFactoryImpl> tcpFactory = CreateObject<TcpSocketFactoryImpl> ();
    3.58 -  Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> ();
    3.59 -  
    3.60 -  udpFactory->SetUdp (udp);
    3.61 -  tcpFactory->SetTcp (tcp);
    3.62 -  ipv4Impl->SetIpv4 (ipv4);
    3.63 -  
    3.64 -  // Aggregate all of these new objects to the node
    3.65 -  node->AggregateObject (ipv4);
    3.66 -  node->AggregateObject (arp);
    3.67 -  node->AggregateObject (ipv4Impl);
    3.68 -  node->AggregateObject (udpFactory);
    3.69 -  node->AggregateObject (tcpFactory);
    3.70 -  node->AggregateObject (ipv4L4Demux);
    3.71 +Note that the Ipv4 routing protocol is configured and set outside this
    3.72 +function.  By default, the following protocols are added to Ipv4:
    3.73 +@verbatim
    3.74 +InternetStackHelper::InternetStackHelper ()
    3.75 +{
    3.76 +  SetTcp ("ns3::TcpL4Protocol");
    3.77 +  static Ipv4StaticRoutingHelper staticRouting;
    3.78 +  static Ipv4GlobalRoutingHelper globalRouting;
    3.79 +  static Ipv4ListRoutingHelper listRouting;
    3.80 +  listRouting.Add (staticRouting, 0);
    3.81 +  listRouting.Add (globalRouting, -10);
    3.82 +  SetRoutingHelper (listRouting);
    3.83  }
    3.84  @end verbatim
    3.85  
    3.86  @subsection Internet Node structure
    3.87  
    3.88 -The Internet Node (an ns-3 Node augmented by aggregation to have one or more
    3.89 +An IPv4-capable Node (an ns-3 Node augmented by aggregation to have one or more
    3.90  IP stacks) has the following internal structure.
    3.91  
    3.92  @subsubsection Layer-3 protocols
    3.93  At the lowest layer, sitting above the NetDevices, are the "layer 3" 
    3.94 -protocols, including IPv4, IPv6, and ARP.  These protocols provide 
    3.95 -the following key methods and data members:
    3.96 +protocols, including IPv4, IPv6 (in the future), and ARP.  The 
    3.97 +@code{class Ipv4L3Protocol} is an 
    3.98 +implementation class whose public interface is 
    3.99 +typically @code{class Ipv4} (found in src/node directory), but the 
   3.100 +Ipv4L3Protocol public API is also used internally in the 
   3.101 +src/internet-stack directory at present.
   3.102  
   3.103 +In class Ipv4L3Protocol, one method described below is @code{Receive ()}:
   3.104  @verbatim
   3.105 -class Ipv4L3Protocol : public Object
   3.106 -{
   3.107 -public: 
   3.108 -  // Add an Ipv4 interface corresponding to the provided NetDevice
   3.109 -  uint32_t AddInterface (Ptr<NetDevice> device);
   3.110 -
   3.111 -  // Receive function that can be bound to a callback, for receiving
   3.112 -  // packets up the stack
   3.113 -  void Receive( Ptr<NetDevice> device, Ptr<Packet> p, uint16_t protocol, 
   3.114 -    const Address &from);
   3.115 -
   3.116 -  // Higher-level layers call this method to send a packet
   3.117 -  // down the stack to the MAC and PHY layers
   3.118 -  // 
   3.119 -  void Send (Ptr<Packet> packet, Ipv4Address source,
   3.120 -             Ipv4Address destination, uint8_t protocol);
   3.121 -
   3.122 -private:
   3.123 -  Ipv4InterfaceList m_interfaces;
   3.124 -
   3.125 -  // Protocol handlers
   3.126 -}
   3.127 + /**
   3.128 +   * Lower layer calls this method after calling L3Demux::Lookup
   3.129 +   * The ARP subclass needs to know from which NetDevice this
   3.130 +   * packet is coming to:
   3.131 +   *    - implement a per-NetDevice ARP cache
   3.132 +   *    - send back arp replies on the right device
   3.133 +   */
   3.134 +  void Receive( Ptr<NetDevice> device, Ptr<const Packet> p, uint16_t protocol, const Address &from,
   3.135 +                const Address &to, NetDevice::PacketType packetType);
   3.136  @end verbatim
   3.137 -There are many more functions (such as @code{Forward ()}) but we will
   3.138 -focus on the above four items from an architectural perspective.
   3.139  
   3.140  First, note that the @code{Receive ()} function has a matching signature
   3.141  to the ReceiveCallback in the @code{class Node}.  This function pointer
   3.142 @@ -228,24 +216,15 @@
   3.143  This class nicely demonstrates two techniques we exploit in
   3.144  ns-3 to bind objects together:  callbacks, and object aggregation.
   3.145  
   3.146 -Once IPv4 has determined that a packet is for the local node, it 
   3.147 +Once IPv4 routing has determined that a packet is for the local node, it 
   3.148  forwards it up the stack.  This is done with the following function:
   3.149  
   3.150  @verbatim
   3.151  void
   3.152 -Ipv4L3Protocol::ForwardUp (Ptr<Packet> p, Ipv4Header const&ip,
   3.153 -                           Ptr<Ipv4Interface> incomingInterface)
   3.154 -{
   3.155 -  NS_LOG_FUNCTION (this << p << &ip);
   3.156 -
   3.157 -  Ptr<Ipv4L4Demux> demux = m_node->GetObject<Ipv4L4Demux> ();
   3.158 -  Ptr<Ipv4L4Protocol> protocol = demux->GetProtocol (ip.GetProtocol ());
   3.159 -  protocol->Receive (p, ip.GetSource (), ip.GetDestination (), incomingInterface);
   3.160 -}
   3.161 +Ipv4L3Protocol::LocalDeliver (Ptr<const Packet> packet, Ipv4Header const&ip, uint32_t iif)
   3.162  @end verbatim
   3.163  
   3.164 -The first step is to find the aggregated Ipv4L4Demux object.  Then, this
   3.165 -object is consulted to look up the right Ipv4L4Protocol, based on IP protocol
   3.166 +The first step is to find the right Ipv4L4Protocol object , based on IP protocol
   3.167  number.  For instance, TCP is registered in the demux as protocol number 6.
   3.168  Finally, the @code{Receive()} function on the Ipv4L4Protocol (such as
   3.169  @code{TcpL4Protocol::Receive} is called.
   3.170 @@ -321,10 +300,10 @@
   3.171  address) associated with the socket, and a receive callback for the socket.
   3.172  @end itemize
   3.173  
   3.174 -@subsection Internet Node interfaces
   3.175 +@subsection Ipv4-capable node interfaces
   3.176  
   3.177  Many of the implementation details, or internal objects themselves, 
   3.178 -of Internet Node objects are not exposed at the simulator public
   3.179 +of Ipv4-capable Node objects are not exposed at the simulator public
   3.180  API.  This allows for different implementations; for instance, 
   3.181  replacing the native ns-3 models with ported TCP/IP stack code. 
   3.182   
     4.1 --- a/doc/manual/routing.texi	Fri Jul 03 08:26:52 2009 -0700
     4.2 +++ b/doc/manual/routing.texi	Fri Jul 03 08:27:22 2009 -0700
     4.3 @@ -106,18 +106,26 @@
     4.4  Presently, global centralized IPv4 unicast routing over both 
     4.5  point-to-point and shared (CSMA) links is supported.
     4.6  
     4.7 +By default, when using the ns-3 helper API and the default InternetStackHelper,
     4.8 +global routing capability will be added  to the node, and global routing
     4.9 +will be inserted as a routing protocol with lower priority than the
    4.10 +static routes (i.e., users can insert routes via Ipv4StaticRouting API
    4.11 +and they will take precedence over routes found by global routing).
    4.12 +
    4.13  @subsection Global Unicast Routing API
    4.14  
    4.15  The public API is very minimal.  User scripts include the following:
    4.16  @verbatim
    4.17 -#include "ns3/global-route-manager.h"
    4.18 +#include "ns3/helper-module.h"
    4.19  @end verbatim
    4.20  
    4.21 +If the default InternetStackHelper is used, then an instance of
    4.22 +global routing will be aggregated to each node.
    4.23  After IP addresses are configured, the following function call will
    4.24  cause all of the nodes that have an Ipv4 interface to receive
    4.25  forwarding tables entered automatically by the GlobalRouteManager:
    4.26  @verbatim
    4.27 -  GlobalRouteManager::PopulateRoutingTables ();
    4.28 +  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
    4.29  @end verbatim
    4.30  
    4.31  @emph{Note:} A reminder that the wifi NetDevice will work but does not
    4.32 @@ -127,7 +135,7 @@
    4.33  It is possible to call this function again in the midst of a simulation
    4.34  using the following additional public function:
    4.35  @verbatim
    4.36 -  GlobalRouteManager::RecomputeRoutingTables ();
    4.37 +  Ipv4GlobalRoutingHelper::RecomputeRoutingTables ();
    4.38  @end verbatim
    4.39  which flushes the old tables, queries the nodes for new interface information,
    4.40  and rebuilds the routes.
    4.41 @@ -135,7 +143,7 @@
    4.42  For instance, this scheduling call will cause the tables to be rebuilt
    4.43  at time 5 seconds:
    4.44  @verbatim
    4.45 -  Simulator::Schedule (Seconds (5),&GlobalRouteManager::RecomputeRoutingTables);
    4.46 +  Simulator::Schedule (Seconds (5),&Ipv4GlobalRoutingHelper::RecomputeRoutingTables);
    4.47  @end verbatim
    4.48  
    4.49  @subsection Global Routing Implementation
     5.1 --- a/examples/virtual-net-device.cc	Fri Jul 03 08:26:52 2009 -0700
     5.2 +++ b/examples/virtual-net-device.cc	Fri Jul 03 08:27:22 2009 -0700
     5.3 @@ -78,23 +78,33 @@
     5.4    
     5.5    
     5.6    bool
     5.7 -  N0N1VirtualSend (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
     5.8 +  N0VirtualSend (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
     5.9    {
    5.10 -    m_n3Socket->SendTo (packet, 0, InetSocketAddress (m_n3Address, 667));
    5.11 +    NS_LOG_DEBUG ("Send to " << m_n3Address << ": " << *packet);
    5.12 +    m_n0Socket->SendTo (packet, 0, InetSocketAddress (m_n3Address, 667));
    5.13 +    return true;
    5.14 +  }
    5.15 +
    5.16 +  bool
    5.17 +  N1VirtualSend (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
    5.18 +  {
    5.19 +    NS_LOG_DEBUG ("Send to " << m_n3Address << ": " << *packet);
    5.20 +    m_n1Socket->SendTo (packet, 0, InetSocketAddress (m_n3Address, 667));
    5.21      return true;
    5.22    }
    5.23  
    5.24    bool
    5.25    N3VirtualSend (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
    5.26    {
    5.27 -    
    5.28      if (m_rng.GetValue () < 0.25)
    5.29        {
    5.30 -        m_n0Socket->SendTo (packet, 0, InetSocketAddress (m_n0Address, 667));
    5.31 +        NS_LOG_DEBUG ("Send to " << m_n0Address << ": " << *packet);
    5.32 +        m_n3Socket->SendTo (packet, 0, InetSocketAddress (m_n0Address, 667));
    5.33        }
    5.34      else 
    5.35        {
    5.36 -        m_n1Socket->SendTo (packet, 0, InetSocketAddress (m_n1Address, 667));
    5.37 +        NS_LOG_DEBUG ("Send to " << m_n1Address << ": " << *packet);
    5.38 +        m_n3Socket->SendTo (packet, 0, InetSocketAddress (m_n1Address, 667));
    5.39        }
    5.40      return true;
    5.41    }
    5.42 @@ -102,6 +112,7 @@
    5.43    void N3SocketRecv (Ptr<Socket> socket)
    5.44    {
    5.45      Ptr<Packet> packet = socket->Recv (65535, 0);
    5.46 +    NS_LOG_DEBUG ("N3SocketRecv: " << *packet);
    5.47      SocketAddressTag socketAddressTag;
    5.48      packet->RemovePacketTag (socketAddressTag);
    5.49      m_n3Tap->Receive (packet, 0x0800, m_n3Tap->GetAddress (), m_n3Tap->GetAddress (), NetDevice::PACKET_HOST);
    5.50 @@ -110,6 +121,7 @@
    5.51    void N0SocketRecv (Ptr<Socket> socket)
    5.52    {
    5.53      Ptr<Packet> packet = socket->Recv (65535, 0);
    5.54 +    NS_LOG_DEBUG ("N0SocketRecv: " << *packet);
    5.55      SocketAddressTag socketAddressTag;
    5.56      packet->RemovePacketTag (socketAddressTag);
    5.57      m_n0Tap->Receive (packet, 0x0800, m_n0Tap->GetAddress (), m_n0Tap->GetAddress (), NetDevice::PACKET_HOST);
    5.58 @@ -118,6 +130,7 @@
    5.59    void N1SocketRecv (Ptr<Socket> socket)
    5.60    {
    5.61      Ptr<Packet> packet = socket->Recv (65535, 0);
    5.62 +    NS_LOG_DEBUG ("N1SocketRecv: " << *packet);
    5.63      SocketAddressTag socketAddressTag;
    5.64      packet->RemovePacketTag (socketAddressTag);
    5.65      m_n1Tap->Receive (packet, 0x0800, m_n1Tap->GetAddress (), m_n1Tap->GetAddress (), NetDevice::PACKET_HOST);
    5.66 @@ -144,7 +157,7 @@
    5.67      // n0 tap device
    5.68      m_n0Tap = CreateObject<VirtualNetDevice> ();
    5.69      m_n0Tap->SetAddress (Mac48Address ("11:00:01:02:03:01"));
    5.70 -    m_n0Tap->SetSendCallback (MakeCallback (&Tunnel::N0N1VirtualSend, this));
    5.71 +    m_n0Tap->SetSendCallback (MakeCallback (&Tunnel::N0VirtualSend, this));
    5.72      n0->AddDevice (m_n0Tap);
    5.73      Ptr<Ipv4> ipv4 = n0->GetObject<Ipv4> ();
    5.74      uint32_t i = ipv4->AddInterface (m_n0Tap);
    5.75 @@ -154,7 +167,7 @@
    5.76      // n1 tap device
    5.77      m_n1Tap = CreateObject<VirtualNetDevice> ();
    5.78      m_n1Tap->SetAddress (Mac48Address ("11:00:01:02:03:02"));
    5.79 -    m_n1Tap->SetSendCallback (MakeCallback (&Tunnel::N0N1VirtualSend, this));
    5.80 +    m_n1Tap->SetSendCallback (MakeCallback (&Tunnel::N1VirtualSend, this));
    5.81      n1->AddDevice (m_n1Tap);
    5.82      ipv4 = n1->GetObject<Ipv4> ();
    5.83      i = ipv4->AddInterface (m_n1Tap);
    5.84 @@ -186,6 +199,8 @@
    5.85  #if 0 
    5.86    LogComponentEnable ("VirtualNetDeviceExample", LOG_LEVEL_INFO);
    5.87  #endif
    5.88 +  Packet::EnablePrinting ();
    5.89 +  
    5.90  
    5.91    // Set up some default values for the simulation.  Use the 
    5.92    Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
    5.93 @@ -260,11 +275,11 @@
    5.94      Address (InetSocketAddress (Ipv4Address::GetAny (), port)));
    5.95    apps = sink.Install (c.Get (3));
    5.96    apps.Start (Seconds (1.0));
    5.97 -  apps.Stop (Seconds (10.0));
    5.98 +  //apps.Stop (Seconds (10.0));
    5.99  
   5.100    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
   5.101    onoff.SetAttribute ("Remote", 
   5.102 -                      AddressValue (InetSocketAddress (Ipv4Address ("11.0.0.2"), port)));
   5.103 +                      AddressValue (InetSocketAddress (Ipv4Address ("11.0.0.1"), port)));
   5.104    apps = onoff.Install (c.Get (3));
   5.105    apps.Start (Seconds (1.1));
   5.106    apps.Stop (Seconds (10.0));
   5.107 @@ -272,7 +287,7 @@
   5.108    // Create a packet sink to receive these packets
   5.109    apps = sink.Install (c.Get (1));
   5.110    apps.Start (Seconds (1.1));
   5.111 -  apps.Stop (Seconds (10.0));
   5.112 +  //apps.Stop (Seconds (10.0));
   5.113  
   5.114    std::ofstream ascii;
   5.115    ascii.open ("virtual-net-device.tr");
     6.1 --- a/src/core/global-value.cc	Fri Jul 03 08:26:52 2009 -0700
     6.2 +++ b/src/core/global-value.cc	Fri Jul 03 08:27:22 2009 -0700
     6.3 @@ -174,6 +174,30 @@
     6.4  {
     6.5    return GetVector ()->end ();
     6.6  }
     6.7 +
     6.8 +bool
     6.9 +GlobalValue::GetValueByNameFailSafe (std::string name, AttributeValue &value)
    6.10 +{
    6.11 +  for (GlobalValue::Iterator gvit = GlobalValue::Begin (); gvit != GlobalValue::End (); ++gvit)
    6.12 +    {
    6.13 +      if ((*gvit)->GetName () == name)
    6.14 +         {
    6.15 +           (*gvit)->GetValue (value);  
    6.16 +           return true;
    6.17 +         }
    6.18 +    } 
    6.19 +  return false; // not found
    6.20 +}
    6.21 +
    6.22 +void
    6.23 +GlobalValue::GetValueByName (std::string name, AttributeValue &value)
    6.24 +{
    6.25 +  if (! GetValueByNameFailSafe (name, value))
    6.26 +    {
    6.27 +      NS_FATAL_ERROR ("Could not find GlobalValue named \"" << name << "\"");
    6.28 +    }
    6.29 +}
    6.30 +
    6.31  GlobalValue::Vector *
    6.32  GlobalValue::GetVector (void)
    6.33  {
     7.1 --- a/src/core/global-value.h	Fri Jul 03 08:26:52 2009 -0700
     7.2 +++ b/src/core/global-value.h	Fri Jul 03 08:27:22 2009 -0700
     7.3 @@ -114,6 +114,30 @@
     7.4     * \returns an iterator which represents a pointer to the last GlobalValue registered.
     7.5     */
     7.6    static Iterator End (void);
     7.7 +
     7.8 +
     7.9 +  /** 
    7.10 +   * finds the GlobalValue with the given name and returns its value
    7.11 +   * 
    7.12 +   * @param name the name of the GlobalValue to be found
    7.13 +   * @param value where to store the value of the found GlobalValue
    7.14 +   * 
    7.15 +   * @return true if the GlobalValue was found, false otherwise
    7.16 +   */
    7.17 +  static bool GetValueByNameFailSafe (std::string name, AttributeValue &value);
    7.18 +
    7.19 +  /** 
    7.20 +   * finds the GlobalValue with the given name and returns its
    7.21 +   * value. This method cannot fail, i.e., it will trigger a
    7.22 +   * NS_FATAL_ERROR if the requested GlobalValue is not found.
    7.23 +   * 
    7.24 +   * @param name the name of the GlobalValue to be found
    7.25 +   * @param value where to store the value of the found GlobalValue
    7.26 +   * 
    7.27 +   */
    7.28 +  static void GetValueByName (std::string name, AttributeValue &value);
    7.29 +  
    7.30 +
    7.31  private:
    7.32    friend class GlobalValueTests;
    7.33    static Vector *GetVector (void);
     8.1 --- a/src/helper/bridge-helper.h	Fri Jul 03 08:26:52 2009 -0700
     8.2 +++ b/src/helper/bridge-helper.h	Fri Jul 03 08:27:22 2009 -0700
     8.3 @@ -1,3 +1,23 @@
     8.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
     8.5 +/*
     8.6 + * Copyright (c) 2008 INRIA
     8.7 + *
     8.8 + * This program is free software; you can redistribute it and/or modify
     8.9 + * it under the terms of the GNU General Public License version 2 as
    8.10 + * published by the Free Software Foundation;
    8.11 + *
    8.12 + * This program is distributed in the hope that it will be useful,
    8.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    8.15 + * GNU General Public License for more details.
    8.16 + *
    8.17 + * You should have received a copy of the GNU General Public License
    8.18 + * along with this program; if not, write to the Free Software
    8.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    8.20 + *
    8.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
    8.22 + * Author: Gustavo Carneiro <gjc@inescporto.pt>
    8.23 + */
    8.24  #ifndef BRIDGE_HELPER_H
    8.25  #define BRIDGE_HELPER_H
    8.26  
    8.27 @@ -10,12 +30,42 @@
    8.28  class Node;
    8.29  class AttributeValue;
    8.30  
    8.31 +/**
    8.32 + * \brief Add capability to bridge multiple LAN segments (IEEE 802.1D bridging)
    8.33 + */
    8.34  class BridgeHelper
    8.35  {
    8.36  public:
    8.37    BridgeHelper ();
    8.38 +  /**
    8.39 +   * \param n1 the name of the attribute to set
    8.40 +   * \param v1 the value of the attribute to set
    8.41 +   *
    8.42 +   * Set an attribute on each ns3::BridgeNetDevice created by
    8.43 +   * BridgeHelper::Install
    8.44 +   */
    8.45    void SetDeviceAttribute (std::string n1, const AttributeValue &v1);
    8.46 +  /**
    8.47 +   * This method creates an ns3::BridgeNetDevice with the attributes
    8.48 +   * configured by BridgeHelper::SetDeviceAttribute, adds the device
    8.49 +   * to the node, and attaches the given NetDevices as ports of the
    8.50 +   * bridge.
    8.51 +   *
    8.52 +   * \param node The node to install the device in
    8.53 +   * \param c Container of NetDevices to add as bridge ports
    8.54 +   * \returns A containter holding the added net device.
    8.55 +   */
    8.56    NetDeviceContainer Install (Ptr<Node> node, NetDeviceContainer c);
    8.57 +  /**
    8.58 +   * This method creates an ns3::BridgeNetDevice with the attributes
    8.59 +   * configured by BridgeHelper::SetDeviceAttribute, adds the device
    8.60 +   * to the node, and attaches the given NetDevices as ports of the
    8.61 +   * bridge.
    8.62 +   *
    8.63 +   * \param nodeName The name of the node to install the device in
    8.64 +   * \param c Container of NetDevices to add as bridge ports
    8.65 +   * \returns A containter holding the added net device.
    8.66 +   */
    8.67    NetDeviceContainer Install (std::string nodeName, NetDeviceContainer c);
    8.68  private:
    8.69    ObjectFactory m_deviceFactory;
     9.1 --- a/src/internet-stack/ipv4-interface.cc	Fri Jul 03 08:26:52 2009 -0700
     9.2 +++ b/src/internet-stack/ipv4-interface.cc	Fri Jul 03 08:27:22 2009 -0700
     9.3 @@ -178,7 +178,7 @@
     9.4  void
     9.5  Ipv4Interface::Send (Ptr<Packet> p, Ipv4Address dest)
     9.6  {
     9.7 -  NS_LOG_FUNCTION_NOARGS ();
     9.8 +  NS_LOG_FUNCTION (dest << *p);
     9.9    if (!IsUp()) 
    9.10      {
    9.11        return;