/usr/include/ns3/nsc-tcp-l4-protocol.h is in libns3-dev 3.13+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | /* -*- 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
*/
#ifndef NSC_TCP_L4_PROTOCOL_H
#define NSC_TCP_L4_PROTOCOL_H
#include <stdint.h>
#include "ns3/packet.h"
#include "ns3/ipv4-address.h"
#include "ns3/ptr.h"
#include "ns3/object-factory.h"
#include "ns3/timer.h"
#include "ipv4-l4-protocol.h"
struct INetStack;
namespace ns3 {
class Node;
class Socket;
class Ipv4EndPointDemux;
class Ipv4Interface;
class NscTcpSocketImpl;
class Ipv4EndPoint;
class NscInterfaceImpl;
/**
* \ingroup nsctcp
*
* \brief Nsc wrapper glue, to interface with the Ipv4 protocol underneath.
*/
class NscTcpL4Protocol : public Ipv4L4Protocol {
public:
static const uint8_t PROT_NUMBER;
static TypeId GetTypeId (void);
/**
* \brief Constructor
*/
NscTcpL4Protocol ();
virtual ~NscTcpL4Protocol ();
void SetNode (Ptr<Node> node);
void SetNscLibrary (const std::string &lib);
std::string GetNscLibrary (void) const;
virtual int GetProtocolNumber (void) const;
virtual int GetVersion (void) const;
/**
* \return A smart Socket pointer to a NscTcpSocketImpl, allocated by this instance
* of the TCP protocol
*/
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);
/**
* \brief Receive a packet up the protocol stack
* \param p The Packet to dump the contents into
* \param header IPv4 Header information
* \param incomingInterface The Ipv4Interface it was received on
*/
virtual Ipv4L4Protocol::RxStatus Receive (Ptr<Packet> p,
Ipv4Header const &header,
Ptr<Ipv4Interface> incomingInterface);
// From Ipv4L4Protocol
virtual void SetDownTarget (Ipv4L4Protocol::DownTargetCallback cb);
// From Ipv4L4Protocol
virtual Ipv4L4Protocol::DownTargetCallback GetDownTarget (void) const;
protected:
virtual void DoDispose (void);
virtual void NotifyNewAggregate ();
private:
NscTcpL4Protocol (NscTcpL4Protocol const &);
NscTcpL4Protocol& operator= (NscTcpL4Protocol const &);
// NSC callbacks.
// NSC invokes these hooks to interact with the simulator.
// In any case, these methods are only to be called by NSC.
//
// send_callback is invoked by NSCs 'ethernet driver' to re-inject
// a packet (i.e. an octet soup consisting of an IP Header, TCP Header
// and user payload, if any), into ns-3.
void send_callback (const void *data, int datalen);
// This is called by the NSC stack whenever something of interest
// has happened, e.g. when data arrives on a socket, a listen socket
// has a new connection pending, etc.
void wakeup ();
// This is called by the Linux stack RNG initialization.
// Its also used by the cradle code to add a timestamp to
// printk/printf/debug output.
void gettime (unsigned int *sec, unsigned int *usec);
void AddInterface (void);
void SoftInterrupt (void);
friend class NscInterfaceImpl;
friend class NscTcpSocketImpl;
Ptr<Node> m_node;
Ipv4EndPointDemux *m_endPoints;
INetStack* m_nscStack;
NscInterfaceImpl *m_nscInterface;
void *m_dlopenHandle;
std::string m_nscLibrary;
Timer m_softTimer;
std::vector<Ptr<NscTcpSocketImpl> > m_sockets;
Ipv4L4Protocol::DownTargetCallback m_downTarget;
};
} // namespace ns3
#endif /* NSC_TCP_L4_PROTOCOL_H */
|