2007-02-08 15:37:48 +01:00
|
|
|
// -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*-
|
|
|
|
|
//
|
|
|
|
|
// Copyright (c) 2006 Georgia Tech Research Corporation
|
|
|
|
|
// All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License version 2 as
|
|
|
|
|
// published by the Free Software Foundation;
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
//
|
|
|
|
|
// Author: George F. Riley<riley@ece.gatech.edu>
|
|
|
|
|
//
|
|
|
|
|
// Implementation of the InternetNode class for ns3.
|
|
|
|
|
// George F. Riley, Georgia Tech, Fall 2006
|
|
|
|
|
|
|
|
|
|
#include "net-device-list.h"
|
|
|
|
|
#include "l3-demux.h"
|
2007-02-12 13:06:05 +01:00
|
|
|
#include "ipv4-l3-protocol.h"
|
2007-02-08 15:37:48 +01:00
|
|
|
#include "ipv4-l4-demux.h"
|
|
|
|
|
#include "internet-node.h"
|
2007-02-10 11:29:44 +01:00
|
|
|
#include "udp.h"
|
|
|
|
|
#include "ipv4.h"
|
2007-02-08 15:37:48 +01:00
|
|
|
|
|
|
|
|
namespace ns3 {
|
|
|
|
|
|
|
|
|
|
InternetNode::InternetNode()
|
|
|
|
|
{
|
|
|
|
|
// Instantiate the capabilities
|
|
|
|
|
m_netDevices = new NetDeviceList();
|
2007-02-12 13:06:05 +01:00
|
|
|
m_l3Demux = new L3Demux(this);
|
|
|
|
|
m_ipv4L4Demux = new Ipv4L4Demux(this);
|
|
|
|
|
m_udp = new Udp (this);
|
|
|
|
|
m_ipv4 = new Ipv4 (this);
|
|
|
|
|
m_l3Demux->Insert (Ipv4L3Protocol (this));
|
2007-02-10 11:29:44 +01:00
|
|
|
// add a udp protocol handler.
|
2007-02-12 13:06:05 +01:00
|
|
|
//m_ipv4L4Demux->Insert (udp);
|
2007-02-08 15:37:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Copy this node
|
|
|
|
|
InternetNode*
|
|
|
|
|
InternetNode::Copy() const
|
|
|
|
|
{
|
2007-02-12 13:06:05 +01:00
|
|
|
//return new InternetNode(*this);
|
|
|
|
|
return 0;
|
2007-02-08 15:37:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NetDeviceList*
|
|
|
|
|
InternetNode::GetNetDevices() const
|
|
|
|
|
{
|
|
|
|
|
return m_netDevices;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
L3Demux*
|
|
|
|
|
InternetNode::GetL3Demux() const
|
|
|
|
|
{
|
|
|
|
|
return m_l3Demux;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ipv4L4Demux*
|
|
|
|
|
InternetNode::GetIpv4L4Demux() const
|
|
|
|
|
{
|
|
|
|
|
return m_ipv4L4Demux;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}//namespace ns3
|