src/internet-stack/udp-test.cc
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 03 Jun 2009 08:49:40 +0200
changeset 4502 07d34c0d8d18
parent 4472 e20a31541404
child 4551 2081e0f6709d
child 5034 18b071e2103c
permissions -rw-r--r--
new tags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     2
/*
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     3
 * Copyright (c) 2007 Georgia Tech Research Corporation
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     4
 * 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     8
 *
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    12
 * GNU General Public License for more details.
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    13
 *
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    17
 *
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    18
 * Author: Raj Bhattacharjea <raj.b@gatech.edu>
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    19
 */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    20
/**
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    21
 * This is the test code for udp-socket-impl.cc, it was moved out of udp-socket-impl.cc to 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    22
 * be in an independent file for clarity purposes.
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    23
 */
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    24
#ifdef RUN_SELF_TESTS
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    25
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    26
#include "ns3/test.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    27
#include "ns3/socket-factory.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    28
#include "ns3/udp-socket-factory.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    29
#include "ns3/simulator.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    30
#include "ns3/simple-channel.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    31
#include "ns3/simple-net-device.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    32
#include "ns3/drop-tail-queue.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    33
#include "ns3/socket.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    34
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    35
#include "ns3/log.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    36
#include "ns3/node.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    37
#include "ns3/inet-socket-address.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    38
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    39
#include "arp-l3-protocol.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    40
#include "ipv4-l3-protocol.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    41
#include "icmpv4-l4-protocol.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    42
#include "udp-l4-protocol.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    43
#include "tcp-l4-protocol.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    44
#include "ipv4-list-routing-impl.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    45
#include "ipv4-static-routing-impl.h"
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    46
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    47
#include <string>
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    48
#include <limits>
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    49
namespace ns3 {
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    50
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    51
static void
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    52
AddInternetStack (Ptr<Node> node)
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    53
{
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    54
  //ARP
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    55
  Ptr<ArpL3Protocol> arp = CreateObject<ArpL3Protocol> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    56
  node->AggregateObject(arp);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    57
  //IPV4
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    58
  Ptr<Ipv4L3Protocol> ipv4 = CreateObject<Ipv4L3Protocol> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    59
  //Routing for Ipv4
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    60
  Ptr<Ipv4ListRoutingImpl> ipv4RoutingImpl = CreateObject<Ipv4ListRoutingImpl> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    61
  ipv4->SetRoutingProtocol (ipv4RoutingImpl);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    62
  ipv4RoutingImpl->SetNode (node);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    63
  Ptr<Ipv4StaticRoutingImpl> ipv4staticRoutingImpl = CreateObject<Ipv4StaticRoutingImpl> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    64
  ipv4staticRoutingImpl->SetNode (node);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    65
  ipv4RoutingImpl->AddRoutingProtocol (ipv4staticRoutingImpl, 0);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    66
  node->AggregateObject(ipv4);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    67
  //ICMP
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    68
  Ptr<Icmpv4L4Protocol> icmp = CreateObject<Icmpv4L4Protocol> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    69
  node->AggregateObject(icmp);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    70
  //UDP
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    71
  Ptr<UdpL4Protocol> udp = CreateObject<UdpL4Protocol> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    72
  node->AggregateObject(udp); 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    73
  //TCP
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    74
  Ptr<TcpL4Protocol> tcp = CreateObject<TcpL4Protocol> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    75
  node->AggregateObject(tcp);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    76
}
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    77
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    78
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    79
class UdpSocketImplTest: public Test
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    80
{
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    81
  Ptr<Packet> m_receivedPacket;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    82
  Ptr<Packet> m_receivedPacket2;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    83
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    84
public:
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    85
  virtual bool RunTests (void);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    86
  UdpSocketImplTest ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    87
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    88
  void ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    89
  void ReceivePacket2 (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    90
  void ReceivePkt (Ptr<Socket> socket);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    91
  void ReceivePkt2 (Ptr<Socket> socket);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    92
};
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    93
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    94
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    95
UdpSocketImplTest::UdpSocketImplTest ()
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    96
  : Test ("UdpSocketImpl") 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    97
{
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    98
}
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    99
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   100
void UdpSocketImplTest::ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from)
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   101
{
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   102
  m_receivedPacket = packet;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   103
}
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   104
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   105
void UdpSocketImplTest::ReceivePacket2 (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from)
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   106
{
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   107
  m_receivedPacket2 = packet;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   108
}
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   109
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   110
void UdpSocketImplTest::ReceivePkt (Ptr<Socket> socket)
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   111
{
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   112
  uint32_t availableData;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   113
  availableData = socket->GetRxAvailable ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   114
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   115
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   116
}
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   117
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   118
void UdpSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   119
{
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   120
  uint32_t availableData;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   121
  availableData = socket->GetRxAvailable ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   122
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   123
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   124
}
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   125
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   126
bool
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   127
UdpSocketImplTest::RunTests (void)
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   128
{
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   129
  bool result = true;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   130
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   131
  // Create topology
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   132
  
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   133
  // Receiver Node
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   134
  Ptr<Node> rxNode = CreateObject<Node> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   135
  AddInternetStack (rxNode);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   136
  Ptr<SimpleNetDevice> rxDev1, rxDev2;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   137
  { // first interface
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   138
    rxDev1 = CreateObject<SimpleNetDevice> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   139
    rxDev1->SetAddress (Mac48Address::Allocate ());
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   140
    rxNode->AddDevice (rxDev1);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   141
    Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   142
    uint32_t netdev_idx = ipv4->AddInterface (rxDev1);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   143
    Ipv4InterfaceAddress ipv4Addr = Ipv4InterfaceAddress (Ipv4Address ("10.0.0.1"), Ipv4Mask (0xffff0000U));
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   144
    ipv4->AddAddress (netdev_idx, ipv4Addr);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   145
    ipv4->SetUp (netdev_idx);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   146
  }
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   147
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   148
  { // second interface
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   149
    rxDev2 = CreateObject<SimpleNetDevice> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   150
    rxDev2->SetAddress (Mac48Address::Allocate ());
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   151
    rxNode->AddDevice (rxDev2);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   152
    Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   153
    uint32_t netdev_idx = ipv4->AddInterface (rxDev2);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   154
    Ipv4InterfaceAddress ipv4Addr = Ipv4InterfaceAddress (Ipv4Address ("10.0.1.1"), Ipv4Mask (0xffff0000U));
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   155
    ipv4->AddAddress (netdev_idx, ipv4Addr);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   156
    ipv4->SetUp (netdev_idx);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   157
  }
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   158
  
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   159
  // Sender Node
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   160
  Ptr<Node> txNode = CreateObject<Node> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   161
  AddInternetStack (txNode);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   162
  Ptr<SimpleNetDevice> txDev1;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   163
  {
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   164
    txDev1 = CreateObject<SimpleNetDevice> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   165
    txDev1->SetAddress (Mac48Address::Allocate ());
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   166
    txNode->AddDevice (txDev1);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   167
    Ptr<Ipv4> ipv4 = txNode->GetObject<Ipv4> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   168
    uint32_t netdev_idx = ipv4->AddInterface (txDev1);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   169
    Ipv4InterfaceAddress ipv4Addr = Ipv4InterfaceAddress (Ipv4Address ("10.0.0.2"), Ipv4Mask (0xffff0000U));
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   170
    ipv4->AddAddress (netdev_idx, ipv4Addr);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   171
    ipv4->SetUp (netdev_idx);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   172
  }
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   173
  Ptr<SimpleNetDevice> txDev2;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   174
  {
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   175
    txDev2 = CreateObject<SimpleNetDevice> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   176
    txDev2->SetAddress (Mac48Address::Allocate ());
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   177
    txNode->AddDevice (txDev2);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   178
    Ptr<Ipv4> ipv4 = txNode->GetObject<Ipv4> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   179
    uint32_t netdev_idx = ipv4->AddInterface (txDev2);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   180
    Ipv4InterfaceAddress ipv4Addr = Ipv4InterfaceAddress (Ipv4Address ("10.0.1.2"), Ipv4Mask (0xffff0000U));
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   181
    ipv4->AddAddress (netdev_idx, ipv4Addr);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   182
    ipv4->SetUp (netdev_idx);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   183
  }
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   184
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   185
  // link the two nodes
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   186
  Ptr<SimpleChannel> channel1 = CreateObject<SimpleChannel> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   187
  rxDev1->SetChannel (channel1);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   188
  txDev1->SetChannel (channel1);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   189
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   190
  Ptr<SimpleChannel> channel2 = CreateObject<SimpleChannel> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   191
  rxDev2->SetChannel (channel2);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   192
  txDev2->SetChannel (channel2);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   193
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   194
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   195
  // Create the UDP sockets
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   196
  Ptr<SocketFactory> rxSocketFactory = rxNode->GetObject<UdpSocketFactory> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   197
  Ptr<Socket> rxSocket = rxSocketFactory->CreateSocket ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   198
  NS_TEST_ASSERT_EQUAL (rxSocket->Bind (InetSocketAddress (Ipv4Address ("10.0.0.1"), 1234)), 0);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   199
  rxSocket->SetRecvCallback (MakeCallback (&UdpSocketImplTest::ReceivePkt, this));
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   200
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   201
  Ptr<Socket> rxSocket2 = rxSocketFactory->CreateSocket ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   202
  rxSocket2->SetRecvCallback (MakeCallback (&UdpSocketImplTest::ReceivePkt2, this));
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   203
  NS_TEST_ASSERT_EQUAL (rxSocket2->Bind (InetSocketAddress (Ipv4Address ("10.0.1.1"), 1234)), 0);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   204
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   205
  Ptr<SocketFactory> txSocketFactory = txNode->GetObject<UdpSocketFactory> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   206
  Ptr<Socket> txSocket = txSocketFactory->CreateSocket ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   207
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   208
  // ------ Now the tests ------------
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   209
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   210
  // Unicast test
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   211
  m_receivedPacket = Create<Packet> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   212
  m_receivedPacket2 = Create<Packet> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   213
  NS_TEST_ASSERT_EQUAL (txSocket->SendTo ( Create<Packet> (123), 0, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   214
    InetSocketAddress (Ipv4Address("10.0.0.1"), 1234)), 123);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   215
  Simulator::Run ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   216
  NS_TEST_ASSERT_EQUAL (m_receivedPacket->GetSize (), 123);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   217
  NS_TEST_ASSERT_EQUAL (m_receivedPacket2->GetSize (), 0); // second interface should receive it
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   218
4502
07d34c0d8d18 new tags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   219
  m_receivedPacket->RemoveAllByteTags ();
07d34c0d8d18 new tags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   220
  m_receivedPacket2->RemoveAllByteTags ();
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   221
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   222
  // Simple broadcast test
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   223
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   224
  m_receivedPacket = Create<Packet> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   225
  m_receivedPacket2 = Create<Packet> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   226
  NS_TEST_ASSERT_EQUAL (txSocket->SendTo ( Create<Packet> (123), 0, 
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   227
    InetSocketAddress (Ipv4Address("255.255.255.255"), 1234)), 123);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   228
  Simulator::Run ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   229
  NS_TEST_ASSERT_EQUAL (m_receivedPacket->GetSize (), 123);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   230
  // second socket should not receive it (it is bound specifically to the second interface's address
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   231
  NS_TEST_ASSERT_EQUAL (m_receivedPacket2->GetSize (), 0);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   232
4502
07d34c0d8d18 new tags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   233
  m_receivedPacket->RemoveAllByteTags ();
07d34c0d8d18 new tags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   234
  m_receivedPacket2->RemoveAllByteTags ();
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   235
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   236
  // Broadcast test with multiple receiving sockets
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   237
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   238
  // When receiving broadcast packets, all sockets sockets bound to
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   239
  // the address/port should receive a copy of the same packet -- if
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   240
  // the socket address matches.
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   241
  rxSocket2->Dispose ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   242
  rxSocket2 = rxSocketFactory->CreateSocket ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   243
  rxSocket2->SetRecvCallback (MakeCallback (&UdpSocketImplTest::ReceivePkt2, this));
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   244
  NS_TEST_ASSERT_EQUAL (rxSocket2->Bind (InetSocketAddress (Ipv4Address ("0.0.0.0"), 1234)), 0);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   245
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   246
  m_receivedPacket = Create<Packet> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   247
  m_receivedPacket2 = Create<Packet> ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   248
  NS_TEST_ASSERT_EQUAL (txSocket->SendTo (Create<Packet> (123), 0,
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   249
InetSocketAddress (Ipv4Address("255.255.255.255"), 1234)), 123);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   250
  Simulator::Run ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   251
  NS_TEST_ASSERT_EQUAL (m_receivedPacket->GetSize (), 123);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   252
  NS_TEST_ASSERT_EQUAL (m_receivedPacket2->GetSize (), 123);
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   253
4502
07d34c0d8d18 new tags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   254
  m_receivedPacket->RemoveAllByteTags ();
07d34c0d8d18 new tags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   255
  m_receivedPacket2->RemoveAllByteTags ();
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   256
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   257
  Simulator::Destroy ();
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   258
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   259
  return result;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   260
}
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   261
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   262
static UdpSocketImplTest gUdpSocketImplTest;
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   263
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   264
}; // namespace ns3
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   265
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   266
#endif /* RUN_SELF_TESTS */