Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 6e970c647d70aa79d97f7e9e3f4c1b9cb51acdd2 Mon Sep 17 00:00:00 2001
- From: parthyadav3105 <parthyadav3105@gmail.com>
- Date: Mon, 8 Apr 2019 00:22:20 +0530
- Subject: [PATCH] Signed-off-by Parth Yadav<parthyadav3105@gmail.com>
- ---
- scratch/p99-example.cc | 90 ++++++++++
- src/internet/helper/internet-stack-helper.cc | 1 +
- src/internet/model/ipv4-l3-protocol.cc | 5 +
- src/internet/model/p99-header.cc | 150 ++++++++++++++++
- src/internet/model/p99-header.h | 96 +++++++++++
- src/internet/model/p99-l3-protocol.cc | 172 +++++++++++++++++++
- src/internet/model/p99-l3-protocol.h | 130 ++++++++++++++
- src/internet/wscript | 4 +
- 8 files changed, 648 insertions(+)
- create mode 100644 scratch/p99-example.cc
- create mode 100644 src/internet/model/p99-header.cc
- create mode 100644 src/internet/model/p99-header.h
- create mode 100644 src/internet/model/p99-l3-protocol.cc
- create mode 100644 src/internet/model/p99-l3-protocol.h
- diff --git a/scratch/p99-example.cc b/scratch/p99-example.cc
- new file mode 100644
- index 000000000..d35e0e651
- --- /dev/null
- +++ b/scratch/p99-example.cc
- @@ -0,0 +1,90 @@
- +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
- +/*
- + * 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
- + */
- +
- +#include "ns3/core-module.h"
- +#include "ns3/network-module.h"
- +#include "ns3/internet-module.h"
- +#include "ns3/csma-module.h"
- +#include "ns3/point-to-point-module.h"
- +#include "ns3/applications-module.h"
- +#include "ns3/p99-header.h"
- +
- +using namespace ns3;
- +
- +NS_LOG_COMPONENT_DEFINE ("P99ProtocolExample");
- +
- +void
- +Send (Ptr<Node> node, Ptr<NetDevice> device, const Address &dest, uint16_t protocolNumber)
- +{
- +
- + uint64_t requestTime = Simulator::Now () .GetMilliSeconds ();
- +
- + P99Header p99;
- + p99.SetRequest (requestTime);
- + Ptr<Packet> packet = Create<Packet> ();
- + packet->AddHeader (p99);
- +
- + NS_LOG_INFO ( "node=" << node->GetId () <<
- + " send a P99 request --sending packet");
- + device-> Send (packet, dest, protocolNumber);
- +}
- +
- +int
- +main (int argc, char *argv[])
- +{
- + CommandLine cmd;
- + cmd.Parse (argc, argv);
- +
- + Time::SetResolution (Time::NS);
- +
- + LogComponentEnable ("P99L3Protocol", LOG_INFO);
- + //LogComponentEnable ("P99Header", LOG_LEVEL_LOGIC);
- +
- + LogComponentEnable ("P99ProtocolExample", LOG_LEVEL_ALL);
- +
- + NS_LOG_INFO("Creating 2 Nodes");
- + NodeContainer nodes;
- + nodes.Create (2);
- +
- + CsmaHelper csma;
- + csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
- + csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));
- + csma.SetDeviceAttribute ("EncapsulationMode", StringValue("Llc"));
- +
- + NetDeviceContainer devices;
- + devices = csma.Install (nodes);
- +
- + InternetStackHelper stack;
- + stack.Install (nodes);
- +
- + Ipv4AddressHelper address;
- + address.SetBase ("10.1.1.0", "255.255.255.0");
- +
- + Ipv4InterfaceContainer interfaces = address.Assign (devices);
- +
- +
- +
- +
- +
- + NS_LOG_INFO("Schedulig a P99 Packet from node1 to node2");
- + Simulator::Schedule(Seconds(3), &Send, nodes.Get(0) ,devices.Get (0), devices.Get(1)->GetAddress (), 0x0063);
- +
- + Simulator::Run ();
- + Simulator::Destroy ();
- + return 0;
- +}
- +
- +
- diff --git a/src/internet/helper/internet-stack-helper.cc b/src/internet/helper/internet-stack-helper.cc
- index 6d85d58a6..24ec1bd52 100644
- --- a/src/internet/helper/internet-stack-helper.cc
- +++ b/src/internet/helper/internet-stack-helper.cc
- @@ -302,6 +302,7 @@ InternetStackHelper::Install (Ptr<Node> node) const
- CreateAndAggregateObjectFromTypeId (node, "ns3::ArpL3Protocol");
- CreateAndAggregateObjectFromTypeId (node, "ns3::Ipv4L3Protocol");
- + CreateAndAggregateObjectFromTypeId (node, "ns3::P99L3Protocol");
- CreateAndAggregateObjectFromTypeId (node, "ns3::Icmpv4L4Protocol");
- if (m_ipv4ArpJitterEnabled == false)
- {
- diff --git a/src/internet/model/ipv4-l3-protocol.cc b/src/internet/model/ipv4-l3-protocol.cc
- index 9384d1bcd..bfafe0c26 100644
- --- a/src/internet/model/ipv4-l3-protocol.cc
- +++ b/src/internet/model/ipv4-l3-protocol.cc
- @@ -38,6 +38,7 @@
- #include "arp-l3-protocol.h"
- #include "arp-cache.h"
- #include "ipv4-l3-protocol.h"
- +#include "p99-l3-protocol.h"
- #include "icmpv4-l4-protocol.h"
- #include "ipv4-interface.h"
- #include "ipv4-raw-socket-impl.h"
- @@ -377,11 +378,15 @@ Ipv4L3Protocol::AddInterface (Ptr<NetDevice> device)
- Ipv4L3Protocol::PROT_NUMBER, device);
- m_node->RegisterProtocolHandler (MakeCallback (&TrafficControlLayer::Receive, tc),
- ArpL3Protocol::PROT_NUMBER, device);
- + m_node->RegisterProtocolHandler (MakeCallback (&TrafficControlLayer::Receive, tc),
- + P99L3Protocol::PROT_NUMBER, device);
- tc->RegisterProtocolHandler (MakeCallback (&Ipv4L3Protocol::Receive, this),
- Ipv4L3Protocol::PROT_NUMBER, device);
- tc->RegisterProtocolHandler (MakeCallback (&ArpL3Protocol::Receive, PeekPointer (GetObject<ArpL3Protocol> ())),
- ArpL3Protocol::PROT_NUMBER, device);
- + tc->RegisterProtocolHandler (MakeCallback (&P99L3Protocol::Receive, PeekPointer (GetObject<P99L3Protocol> ())),
- + P99L3Protocol::PROT_NUMBER, device);
- Ptr<Ipv4Interface> interface = CreateObject<Ipv4Interface> ();
- interface->SetNode (m_node);
- diff --git a/src/internet/model/p99-header.cc b/src/internet/model/p99-header.cc
- new file mode 100644
- index 000000000..b34248b5e
- --- /dev/null
- +++ b/src/internet/model/p99-header.cc
- @@ -0,0 +1,150 @@
- +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
- +/*
- + * Copyright (c) 2019
- + *
- + * 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: Parth Yadav <parthyadav3105@gmail.com>
- + */
- +
- +#include "ns3/assert.h"
- +#include "ns3/address-utils.h"
- +#include "p99-header.h"
- +#include "ns3/log.h"
- +
- +namespace ns3 {
- +
- +NS_LOG_COMPONENT_DEFINE ("P99Header");
- +
- +NS_OBJECT_ENSURE_REGISTERED (P99Header);
- +
- +void
- +P99Header::SetRequest (uint64_t startTime)
- +{
- + NS_LOG_FUNCTION (this << startTime );
- + m_type = P99_TYPE_REQUEST;
- + m_startTime = startTime;
- +}
- +
- +void
- +P99Header::SetReply (uint64_t startTime)
- +{
- + NS_LOG_FUNCTION (this << startTime );
- + m_type = P99_TYPE_REPLY;
- + m_startTime = startTime;
- +}
- +
- +bool
- +P99Header::IsRequest (void) const
- +{
- + NS_LOG_FUNCTION (this);
- + return (m_type == P99_TYPE_REQUEST) ? true : false;
- +}
- +
- +bool
- +P99Header::IsReply (void) const
- +{
- + NS_LOG_FUNCTION (this);
- + return (m_type == P99_TYPE_REPLY) ? true : false;
- +}
- +
- +uint64_t
- +P99Header::GetStartTime (void) const
- +{
- + NS_LOG_FUNCTION (this);
- + return m_startTime;
- +}
- +
- +TypeId
- +P99Header::GetTypeId (void)
- +{
- + static TypeId tid = TypeId ("ns3::P99Header")
- + .SetParent<Header> ()
- + .SetGroupName ("Internet")
- + .AddConstructor<P99Header> ()
- + ;
- + return tid;
- +}
- +
- +TypeId
- +P99Header::GetInstanceTypeId (void) const
- +{
- + NS_LOG_FUNCTION (this);
- + return GetTypeId ();
- +}
- +
- +void
- +P99Header::Print (std::ostream &os) const
- +{
- + NS_LOG_FUNCTION (this << &os);
- + if (IsRequest ())
- + {
- + os << "request ";
- + }
- + else
- + {
- + NS_ASSERT (IsReply ());
- + os << "reply ";
- + }
- +}
- +
- +uint32_t
- +P99Header::GetSerializedSize (void) const
- +{
- + NS_LOG_FUNCTION (this);
- +
- + uint32_t length = 2; // 2 bytes for m_type
- + length+=2; //2 bytes for protocol type
- + length +=8; // 8 bytes for storing time
- +
- + return length;
- +}
- +
- +
- +void
- +P99Header::Serialize (Buffer::Iterator start) const
- +{
- + NS_LOG_FUNCTION (this << &start);
- + Buffer::Iterator i = start;
- +
- + i.WriteHtonU16 (0x0063); // write protocol number 99
- + i.WriteHtonU16 (m_type); // write packet type request/reply
- + i.WriteHtonU64 (m_startTime);
- +}
- +
- +
- +
- +uint32_t
- +P99Header::Deserialize (Buffer::Iterator start)
- +{
- + NS_LOG_FUNCTION (this << &start);
- + Buffer::Iterator i = start;
- +
- + uint32_t protocolType = i.ReadNtohU16 (); // Read Protocol Number
- +
- + //
- + // It is implicit here that we have a protocol type of 0x0063 (99).
- + //
- + if (protocolType != 0x0063)
- + {
- + return 0;
- + }
- +
- + m_type = i.ReadNtohU16 (); // Read OP
- + m_startTime = i.ReadNtohU64 ();
- + return GetSerializedSize ();
- +}
- +
- +
- +} // namespace ns3
- diff --git a/src/internet/model/p99-header.h b/src/internet/model/p99-header.h
- new file mode 100644
- index 000000000..69d51ba37
- --- /dev/null
- +++ b/src/internet/model/p99-header.h
- @@ -0,0 +1,96 @@
- +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
- +/*
- + * Copyright (c) 2019
- + *
- + * 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: Parth Yadav <parthyadav3105@gmail.com>
- + */
- +
- +#ifndef P99_HEADER_H
- +#define P99_HEADER_H
- +
- +#include "ns3/header.h"
- +#include "ns3/address.h"
- +#include "ns3/ipv4-address.h"
- +#include <string>
- +
- +namespace ns3 {
- +
- +/**
- + * \ingroup p99
- + * \brief The packet header for an P99 packet
- + */
- +class P99Header : public Header
- +{
- +
- +public:
- +
- + /**
- + * \brief Set the P99 request parameters
- + * \param startTime the time at which ping request was made
- + */
- + void SetRequest (uint64_t startTime);
- +
- + /**
- + * \brief Set the P99 reply parameters
- + * \param startTime the time at which ping request was made
- + */
- + void SetReply (uint64_t startTime);
- +
- + /**
- + * \brief Check if the P99 is a request
- + * \returns true if it is a request
- + */
- + bool IsRequest (void) const;
- +
- + /**
- + * \brief Check if the P99 is a reply
- + * \returns true if it is a reply
- + */
- + bool IsReply (void) const;
- +
- + /**
- + * \brief Returns the Time at which P99 request was made
- + * \returns Time at which Packet was sent
- + */
- + uint64_t GetStartTime (void) const;
- +
- + /**
- + * \brief Get the type ID.
- + * \return the object TypeId
- + */
- + static TypeId GetTypeId (void);
- + virtual TypeId GetInstanceTypeId (void) const;
- + virtual void Print (std::ostream &os) const;
- + virtual uint32_t GetSerializedSize (void) const;
- + virtual void Serialize (Buffer::Iterator start) const;
- + virtual uint32_t Deserialize (Buffer::Iterator start);
- +
- + /**
- + * \brief Enumeration listing the possible P99 types
- + */
- + enum P99Type_e {
- + P99_TYPE_REQUEST = 1,
- + P99_TYPE_REPLY = 2
- + };
- +
- + uint16_t m_type; //!< type of the P99 packet (P99_TYPE_REQUEST)
- + uint64_t m_startTime; //!< Time at which a request is made in milliseconds
- +
- +};
- +
- +} // namespace ns3
- +
- +#endif /* P99_HEADER_H */
- diff --git a/src/internet/model/p99-l3-protocol.cc b/src/internet/model/p99-l3-protocol.cc
- new file mode 100644
- index 000000000..2ade16e5a
- --- /dev/null
- +++ b/src/internet/model/p99-l3-protocol.cc
- @@ -0,0 +1,172 @@
- +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
- +/*
- + * Copyright (c) 2019
- + *
- + * 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: Parth Yadav <parthyadav3105@gmail.com>
- + */
- +#include "ns3/packet.h"
- +#include "ns3/log.h"
- +#include "ns3/node.h"
- +#include "ns3/net-device.h"
- +#include "ns3/object-vector.h"
- +#include "ns3/pointer.h"
- +#include "ns3/string.h"
- +
- +#include "ipv4-l3-protocol.h"
- +#include "p99-l3-protocol.h"
- +#include "p99-header.h"
- +#include "ipv4-interface.h"
- +
- +namespace ns3 {
- +
- +NS_LOG_COMPONENT_DEFINE ("P99L3Protocol");
- +
- +const uint16_t P99L3Protocol::PROT_NUMBER = 0x0063;
- +
- +NS_OBJECT_ENSURE_REGISTERED (P99L3Protocol);
- +
- +TypeId
- +P99L3Protocol::GetTypeId (void)
- +{
- + static TypeId tid = TypeId ("ns3::P99L3Protocol")
- + .SetParent<Object> ()
- + .AddConstructor<P99L3Protocol> ()
- + .SetGroupName ("Internet")
- + ;
- + return tid;
- +}
- +
- +P99L3Protocol::P99L3Protocol ()
- +{
- + NS_LOG_FUNCTION (this);
- +}
- +
- +P99L3Protocol::~P99L3Protocol ()
- +{
- + NS_LOG_FUNCTION (this);
- +}
- +
- +void
- +P99L3Protocol::SetNode (Ptr<Node> node)
- +{
- + NS_LOG_FUNCTION (this << node);
- + m_node = node;
- +}
- +
- +/*
- + * This method is called by AddAgregate and completes the aggregation
- + * by setting the node in the ipv4 stack
- + */
- +void
- +P99L3Protocol::NotifyNewAggregate ()
- +{
- + NS_LOG_FUNCTION (this);
- + if (m_node == 0)
- + {
- + Ptr<Node>node = this->GetObject<Node> ();
- + //verify that it's a valid node and that
- + //the node was not set before
- + if (node != 0)
- + {
- + this->SetNode (node);
- + }
- + }
- + Object::NotifyNewAggregate ();
- +}
- +
- +void
- +P99L3Protocol::DoDispose (void)
- +{
- + NS_LOG_FUNCTION (this);
- + m_node = 0;
- + Object::DoDispose ();
- +}
- +
- +void
- +P99L3Protocol::Receive (Ptr<NetDevice> device, Ptr<const Packet> p, uint16_t protocol, const Address &from,
- + const Address &to, NetDevice::PacketType packetType)
- +{
- + NS_LOG_FUNCTION (this << device << p->GetSize () << protocol << from << to << packetType);
- +
- + Ptr<Packet> packet = p->Copy ();
- +
- + NS_LOG_LOGIC ("P99: received packet of size "<< packet->GetSize ());
- +
- + // The P99Header will return 0 if it can't deal
- + // with the received header.
- + P99Header p99;
- + uint32_t size = packet->RemoveHeader (p99);
- + if (size == 0)
- + {
- + NS_LOG_LOGIC ("P99: Cannot remove P99 header");
- + return;
- + }
- +
- +
- + if ( p99.IsRequest () )
- + {
- +
- + NS_LOG_INFO ( "node=" << m_node->GetId () << " got P99 request --echo packet " );
- +
- + SendP99Reply ( device, from, p99.GetStartTime () );
- +
- + }
- + else if ( p99.IsReply () )
- + {
- + u_int64_t pingms = ( Simulator::Now ().GetMilliSeconds () ) - p99.GetStartTime () ;
- +
- + NS_LOG_INFO ( "node=" << m_node->GetId () << " got reply to P99 request in " << pingms << "ms " );
- +
- + }
- +
- +}
- +
- +
- +void
- +P99L3Protocol::SendP99Request (Ptr<NetDevice> device, const Address &to, uint64_t requestTime)
- +{
- + NS_LOG_FUNCTION (this << device << to << requestTime );
- +
- + P99Header p99;
- + p99.SetRequest (requestTime);
- + Ptr<Packet> packet = Create<Packet> ();
- + packet->AddHeader (p99);
- +
- + NS_LOG_LOGIC ("P99: sending request from node "<<m_node->GetId ()<<
- + " || dst: " << to);
- +
- + device->Send (packet, to, PROT_NUMBER);
- +}
- +
- +
- +void
- +P99L3Protocol::SendP99Reply (Ptr<NetDevice> device, const Address &to, uint64_t requestTime)
- +{
- + NS_LOG_FUNCTION (this << device << to << requestTime );
- +
- + P99Header p99;
- + p99.SetReply (requestTime);
- + Ptr<Packet> packet = Create<Packet> ();
- + packet->AddHeader (p99);
- +
- + NS_LOG_LOGIC ("P99: sending reply from node "<<m_node->GetId ()<<
- + " || dst: " << to);
- +
- + device->Send (packet, to, PROT_NUMBER);
- +}
- +
- +
- +} // namespace ns3
- diff --git a/src/internet/model/p99-l3-protocol.h b/src/internet/model/p99-l3-protocol.h
- new file mode 100644
- index 000000000..0a96c9cf8
- --- /dev/null
- +++ b/src/internet/model/p99-l3-protocol.h
- @@ -0,0 +1,130 @@
- +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
- +/*
- + * Copyright (c) 2019
- + *
- + * 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: Parth Yadav <parthyadav3105@gmail.com>
- + */
- +#ifndef P99_L3_PROTOCOL_H
- +#define P99_L3_PROTOCOL_H
- +
- +#include <list>
- +#include "ns3/net-device.h"
- +#include "ns3/address.h"
- +#include "ns3/ptr.h"
- +
- +namespace ns3 {
- +
- +class NetDevice;
- +class Node;
- +class Packet;
- +
- +/**
- + * \ingroup ipv4
- + * \defgroup p99 P99 protocol.
- + *
- + * The P99 protocol is responsible for simple ping
- + */
- +
- +/**
- + * \ingroup p99
- + * \brief An implementation of the P99 protocol.
- + */
- +class P99L3Protocol : public Object
- +{
- +public:
- +
- + /**
- + * \brief Get the type ID.
- + * \return the object TypeId
- + */
- + static TypeId GetTypeId (void);
- + static const uint16_t PROT_NUMBER; //!< P99 protocol number (0x0063)
- +
- + P99L3Protocol ();
- + virtual ~P99L3Protocol ();
- +
- + /**
- + * \brief Set the node the P99 L3 protocol is associated with
- + * \param node the node
- + */
- + void SetNode (Ptr<Node> node);
- +
- + /**
- + * \brief Receive a packet
- + * \param device the source NetDevice
- + * \param p the packet
- + * \param protocol the protocol
- + * \param from the source address
- + * \param to the destination address
- + * \param packetType type of packet (i.e., unicast, multicast, etc.)
- + */
- + void Receive (Ptr<NetDevice> device, Ptr<const Packet> p, uint16_t protocol, const Address &from, const Address &to,
- + NetDevice::PacketType packetType);
- +
- + /**
- + * \brief Send an P99 request to an host
- + * \param device the source NetDevice
- + * \param to Address of destination Node
- + * \param requestTime the time at which request was made
- + */
- + void SendP99Request (Ptr<NetDevice> device, const Address &to, uint64_t requestTime);
- +
- + /**
- + * \brief Send an P99 reply to an host
- + * \param device the source NetDevice
- + * \param to Address of destination Node
- + * \param requestTime the time at which request was made
- + */
- + void SendP99Reply (Ptr<NetDevice> device, const Address &to, uint64_t requestTime);
- +
- +
- +protected:
- +
- + virtual void DoDispose (void);
- +
- + /*
- + * This function will notify other components connected to the node that a new stack member is now connected
- + * This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.
- + */
- + virtual void NotifyNewAggregate ();
- +
- +
- +
- +private:
- +
- + /**
- + * \brief Copy constructor
- + *
- + * Defined and unimplemented to avoid misuse
- + * \param o
- + */
- + P99L3Protocol (const P99L3Protocol &o);
- +
- + /**
- + * \brief Copy constructor
- + *
- + * Defined and unimplemented to avoid misuse
- + * \param o
- + * \returns
- + */
- + P99L3Protocol &operator = (const P99L3Protocol &o);
- +
- + Ptr<Node> m_node; //!< node the P99 L3 protocol is associated with
- +};
- +
- +} // namespace ns3
- +
- +#endif /* P99_L3_PROTOCOL_H */
- diff --git a/src/internet/wscript b/src/internet/wscript
- index 571afc86d..821b7619a 100644
- --- a/src/internet/wscript
- +++ b/src/internet/wscript
- @@ -227,6 +227,8 @@ def build(bld):
- 'model/rip.cc',
- 'model/rip-header.cc',
- 'helper/rip-helper.cc',
- + 'model/p99-l3-protocol.cc',
- + 'model/p99-header.cc',
- ]
- internet_test = bld.create_ns3_module_test_library('internet')
- @@ -410,6 +412,8 @@ def build(bld):
- 'model/rip.h',
- 'model/rip-header.h',
- 'helper/rip-helper.h',
- + 'model/p99-l3-protocol.h',
- + 'model/p99-header.h',
- ]
- if bld.env['NSC_ENABLED']:
- --
- 2.19.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement