Nsc wrapper glue, to interface with the Ipv4 protocol underneath. More...
#include <nsc-tcp-l4-protocol.h>
Public Member Functions | |
NscTcpL4Protocol () | |
Constructor. | |
virtual | ~NscTcpL4Protocol () |
void | SetNode (Ptr< Node > node) |
void | SetNscLibrary (const std::string &lib) |
virtual int | GetProtocolNumber (void) const |
virtual int | GetVersion (void) const |
Ptr< Socket > | CreateSocket (void) |
Ipv4EndPoint * | Allocate (void) |
Ipv4EndPoint * | Allocate (Ipv4Address address) |
Ipv4EndPoint * | Allocate (uint16_t port) |
Ipv4EndPoint * | Allocate (Ipv4Address address, uint16_t port) |
Ipv4EndPoint * | Allocate (Ipv4Address localAddress, uint16_t localPort, Ipv4Address peerAddress, uint16_t peerPort) |
void | DeAllocate (Ipv4EndPoint *endPoint) |
virtual Ipv4L4Protocol::RxStatus | Receive (Ptr< Packet > p, Ipv4Address const &source, Ipv4Address const &destination, Ptr< Ipv4Interface > incomingInterface) |
Recieve a packet up the protocol stack. | |
virtual void | send_callback (const void *data, int datalen) |
virtual void | wakeup () |
virtual void | gettime (unsigned int *, unsigned int *) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Ipv4L4Protocol. | |
Static Public Attributes | |
static const uint8_t | PROT_NUMBER = 6 |
Protected Member Functions | |
virtual void | DoDispose (void) |
Private Member Functions | |
void | AddInterface (void) |
void | SoftInterrupt (void) |
Static Private Member Functions | |
static ObjectFactory | GetDefaultRttEstimatorFactory (void) |
Private Attributes | |
Ptr< Node > | m_node |
Ipv4EndPointDemux * | m_endPoints |
ObjectFactory | m_rttFactory |
INetStack * | m_nscStack |
void * | m_dlopenHandle |
Timer | m_softTimer |
Friends | |
class | NscTcpSocketImpl |
Nsc wrapper glue, to interface with the Ipv4 protocol underneath.
Definition at line 45 of file nsc-tcp-l4-protocol.h.
ns3::NscTcpL4Protocol::NscTcpL4Protocol | ( | ) |
Constructor.
Definition at line 82 of file nsc-tcp-l4-protocol.cc.
References m_dlopenHandle, and NS_LOG_LOGIC.
ns3::NscTcpL4Protocol::~NscTcpL4Protocol | ( | ) | [virtual] |
Definition at line 91 of file nsc-tcp-l4-protocol.cc.
References m_dlopenHandle, and NS_LOG_FUNCTION.
void ns3::NscTcpL4Protocol::AddInterface | ( | void | ) | [private] |
Definition at line 321 of file nsc-tcp-l4-protocol.cc.
References INetStack::add_default_gateway(), ns3::Ipv4Address::Deserialize(), INetStack::if_attach(), m_node, m_nscStack, NS_ASSERT_MSG, NS_LOG_LOGIC, ns3::Ipv4Mask::Print(), ns3::Ipv4Address::Print(), and ns3::Ipv4Address::Serialize().
Referenced by SetNode().
Ipv4EndPoint * ns3::NscTcpL4Protocol::Allocate | ( | Ipv4Address | localAddress, | |
uint16_t | localPort, | |||
Ipv4Address | peerAddress, | |||
uint16_t | peerPort | |||
) |
Definition at line 208 of file nsc-tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Ipv4EndPoint * ns3::NscTcpL4Protocol::Allocate | ( | Ipv4Address | address, | |
uint16_t | port | |||
) |
Definition at line 201 of file nsc-tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Ipv4EndPoint * ns3::NscTcpL4Protocol::Allocate | ( | uint16_t | port | ) |
Definition at line 194 of file nsc-tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Ipv4EndPoint * ns3::NscTcpL4Protocol::Allocate | ( | Ipv4Address | address | ) |
Definition at line 187 of file nsc-tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Ipv4EndPoint * ns3::NscTcpL4Protocol::Allocate | ( | void | ) |
Definition at line 180 of file nsc-tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Definition at line 167 of file nsc-tcp-l4-protocol.cc.
References ns3::ObjectFactory::Create(), m_node, m_rttFactory, and NS_LOG_FUNCTION.
void ns3::NscTcpL4Protocol::DeAllocate | ( | Ipv4EndPoint * | endPoint | ) |
Definition at line 217 of file nsc-tcp-l4-protocol.cc.
References NS_LOG_FUNCTION.
void ns3::NscTcpL4Protocol::DoDispose | ( | void | ) | [protected, virtual] |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
Reimplemented from ns3::Object.
Definition at line 154 of file nsc-tcp-l4-protocol.cc.
References m_endPoints, m_node, and NS_LOG_FUNCTION.
ObjectFactory ns3::NscTcpL4Protocol::GetDefaultRttEstimatorFactory | ( | void | ) | [static, private] |
Definition at line 55 of file nsc-tcp-l4-protocol.cc.
References ns3::RttMeanDeviation::GetTypeId(), and ns3::ObjectFactory::SetTypeId().
Referenced by GetTypeId().
int ns3::NscTcpL4Protocol::GetProtocolNumber | ( | void | ) | const [virtual] |
Implements ns3::Ipv4L4Protocol.
Definition at line 143 of file nsc-tcp-l4-protocol.cc.
References PROT_NUMBER.
void ns3::NscTcpL4Protocol::gettime | ( | unsigned int * | sec, | |
unsigned int * | usec | |||
) | [virtual] |
Implements IInterruptCallback.
Definition at line 309 of file nsc-tcp-l4-protocol.cc.
References ns3::TimeUnit< 1 >::GetMicroSeconds(), and ns3::Now().
TypeId ns3::NscTcpL4Protocol::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::Ipv4L4Protocol.
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::Ipv4L4Protocol.
Definition at line 63 of file nsc-tcp-l4-protocol.cc.
References GetDefaultRttEstimatorFactory(), m_rttFactory, and ns3::TypeId::SetParent().
int ns3::NscTcpL4Protocol::GetVersion | ( | void | ) | const [virtual] |
Definition at line 148 of file nsc-tcp-l4-protocol.cc.
Ipv4L4Protocol::RxStatus ns3::NscTcpL4Protocol::Receive | ( | Ptr< Packet > | p, | |
Ipv4Address const & | source, | |||
Ipv4Address const & | destination, | |||
Ptr< Ipv4Interface > | incomingInterface | |||
) | [virtual] |
Recieve a packet up the protocol stack.
p | The Packet to dump the contents into | |
source | The source's Ipv4Address | |
destination | The destinations Ipv4Address | |
incomingInterface | The Ipv4Interface it was received on |
Implements ns3::Ipv4L4Protocol.
Definition at line 224 of file nsc-tcp-l4-protocol.cc.
References ns3::Ipv4Header::EnableChecksum(), INetStack::if_receive_packet(), m_nscStack, NS_LOG_FUNCTION, PROT_NUMBER, ns3::Ipv4L4Protocol::RX_OK, ns3::Ipv4Header::SetDestination(), ns3::Ipv4Header::SetPayloadSize(), ns3::Ipv4Header::SetProtocol(), ns3::Ipv4Header::SetSource(), ns3::Ipv4Header::SetTtl(), and wakeup().
void ns3::NscTcpL4Protocol::send_callback | ( | const void * | data, | |
int | datalen | |||
) | [virtual] |
Implements ISendCallback.
Definition at line 264 of file nsc-tcp-l4-protocol.cc.
References INetStack::if_send_finish(), m_node, m_nscStack, NS_ASSERT, NS_ASSERT_MSG, and PROT_NUMBER.
Definition at line 107 of file nsc-tcp-l4-protocol.cc.
References AddInterface(), ns3::external_rand(), INetStack::get_hz(), INetStack::init(), m_dlopenHandle, m_node, m_nscStack, m_softTimer, ns3::MilliSeconds(), NS_ASSERT, ns3::Timer::Schedule(), ns3::Simulator::ScheduleNow(), ns3::Timer::SetDelay(), ns3::Timer::SetFunction(), and SoftInterrupt().
void ns3::NscTcpL4Protocol::SetNscLibrary | ( | const std::string & | lib | ) |
Definition at line 98 of file nsc-tcp-l4-protocol.cc.
References m_dlopenHandle, NS_ASSERT, and NS_FATAL_ERROR.
void ns3::NscTcpL4Protocol::SoftInterrupt | ( | void | ) | [private] |
Definition at line 257 of file nsc-tcp-l4-protocol.cc.
References INetStack::increment_ticks(), m_nscStack, m_softTimer, ns3::Timer::Schedule(), and INetStack::timer_interrupt().
Referenced by SetNode().
void ns3::NscTcpL4Protocol::wakeup | ( | ) | [virtual] |
Implements IInterruptCallback.
Definition at line 295 of file nsc-tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::GetAllEndPoints(), and m_endPoints.
Referenced by Receive().
friend class NscTcpSocketImpl [friend] |
Definition at line 115 of file nsc-tcp-l4-protocol.h.
void* ns3::NscTcpL4Protocol::m_dlopenHandle [private] |
Definition at line 117 of file nsc-tcp-l4-protocol.h.
Referenced by NscTcpL4Protocol(), SetNode(), SetNscLibrary(), and ~NscTcpL4Protocol().
Definition at line 109 of file nsc-tcp-l4-protocol.h.
Referenced by Allocate(), DoDispose(), and wakeup().
Ptr<Node> ns3::NscTcpL4Protocol::m_node [private] |
Definition at line 108 of file nsc-tcp-l4-protocol.h.
Referenced by AddInterface(), CreateSocket(), DoDispose(), send_callback(), and SetNode().
INetStack* ns3::NscTcpL4Protocol::m_nscStack [private] |
Definition at line 116 of file nsc-tcp-l4-protocol.h.
Referenced by AddInterface(), Receive(), send_callback(), SetNode(), and SoftInterrupt().
Definition at line 110 of file nsc-tcp-l4-protocol.h.
Referenced by CreateSocket(), and GetTypeId().
Timer ns3::NscTcpL4Protocol::m_softTimer [private] |
Definition at line 118 of file nsc-tcp-l4-protocol.h.
Referenced by SetNode(), and SoftInterrupt().
const uint8_t ns3::NscTcpL4Protocol::PROT_NUMBER = 6 [static] |
Definition at line 47 of file nsc-tcp-l4-protocol.h.
Referenced by GetProtocolNumber(), Receive(), and send_callback().