src/internet/model/nsc-tcp-l4-protocol.h
author Peter D. Barnes, Jr. <barnes26@llnl.gov>
Fri, 26 Sep 2014 15:51:00 -0700
changeset 10968 2d29fee2b7b8
parent 10440 1e48ff9185f1
permissions -rw-r--r--
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7256
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     2
/*
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     3
 * This program is free software; you can redistribute it and/or modify
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     4
 * it under the terms of the GNU General Public License version 2 as
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     5
 * published by the Free Software Foundation;
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     6
 *
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     7
 * This program is distributed in the hope that it will be useful,
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    10
 * GNU General Public License for more details.
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    11
 *
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    12
 * You should have received a copy of the GNU General Public License
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    13
 * along with this program; if not, write to the Free Software
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    14
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    15
 */
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    16
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    17
#ifndef NSC_TCP_L4_PROTOCOL_H
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    18
#define NSC_TCP_L4_PROTOCOL_H
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    19
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    20
#include <stdint.h>
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    21
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    22
#include "ns3/packet.h"
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    23
#include "ns3/ipv4-address.h"
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    24
#include "ns3/ptr.h"
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    25
#include "ns3/object-factory.h"
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
    26
#include "ns3/timer.h"
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    27
#include "ip-l4-protocol.h"
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    28
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
    29
struct INetStack;
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    30
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    31
namespace ns3 {
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    32
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    33
class Node;
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    34
class Socket;
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
    35
class Ipv4EndPointDemux;
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
    36
class Ipv4Interface;
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
    37
class NscTcpSocketImpl;
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
    38
class Ipv4EndPoint;
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
    39
class NscInterfaceImpl;
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
    40
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    41
/**
3691
372f4475dc47 Doxygen for internet-stack
Tom Henderson <tomh@tomh.org>
parents: 3635
diff changeset
    42
 * \ingroup nsctcp
372f4475dc47 Doxygen for internet-stack
Tom Henderson <tomh@tomh.org>
parents: 3635
diff changeset
    43
 * 
372f4475dc47 Doxygen for internet-stack
Tom Henderson <tomh@tomh.org>
parents: 3635
diff changeset
    44
 * \brief Nsc wrapper glue, to interface with the Ipv4 protocol underneath.
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    45
 */
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
    46
class NscTcpL4Protocol : public IpL4Protocol {
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    47
public:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    48
  static const uint8_t PROT_NUMBER; //!< protocol number (0x6)
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    49
  /**
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    50
   * \brief Get the type ID.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    51
   * \return the object TypeId
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    52
   */
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    53
  static TypeId GetTypeId (void);
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    54
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    55
  NscTcpL4Protocol ();
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    56
  virtual ~NscTcpL4Protocol ();
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    57
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    58
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    59
   * Set node associated with this stack
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    60
   * \param node the node
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    61
   */
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    62
  void SetNode (Ptr<Node> node);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    63
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    64
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    65
   * Set the NSC library to be used
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    66
   * \param lib the library path
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    67
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4283
diff changeset
    68
  void SetNscLibrary (const std::string &lib);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    69
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    70
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    71
   * Get the NSC library being used
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    72
   * \returns the library path
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    73
   */
4472
e20a31541404 src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents: 4283
diff changeset
    74
  std::string GetNscLibrary (void) const;
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    75
  virtual int GetProtocolNumber (void) const;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    76
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    77
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    78
   * Get the NSC version
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    79
   * \returns the NSC version
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    80
   */
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    81
  virtual int GetVersion (void) const;
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    82
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    83
  /**
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    84
   * \return A smart Socket pointer to a NscTcpSocketImpl, allocated by this instance
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    85
   * of the TCP protocol
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    86
   */
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    87
  Ptr<Socket> CreateSocket (void);
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    88
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    89
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    90
   * \brief Allocate an IPv4 Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    91
   * \return the Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    92
   */
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    93
  Ipv4EndPoint *Allocate (void);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    94
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    95
   * \brief Allocate an IPv4 Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    96
   * \param address address to use
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    97
   * \return the Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
    98
   */
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    99
  Ipv4EndPoint *Allocate (Ipv4Address address);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   100
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   101
   * \brief Allocate an IPv4 Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   102
   * \param port port to use
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   103
   * \return the Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   104
   */
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   105
  Ipv4EndPoint *Allocate (uint16_t port);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   106
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   107
   * \brief Allocate an IPv4 Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   108
   * \param address address to use
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   109
   * \param port port to use
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   110
   * \return the Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   111
   */
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   112
  Ipv4EndPoint *Allocate (Ipv4Address address, uint16_t port);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   113
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   114
   * \brief Allocate an IPv4 Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   115
   * \param localAddress local address to use
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   116
   * \param localPort local port to use
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   117
   * \param peerAddress remote address to use
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   118
   * \param peerPort remote port to use
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   119
   * \return the Endpoint
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   120
   */
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   121
  Ipv4EndPoint *Allocate (Ipv4Address localAddress, uint16_t localPort,
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   122
                          Ipv4Address peerAddress, uint16_t peerPort);
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   123
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   124
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   125
  /**
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   126
   * \brief Remove an IPv4 Endpoint.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   127
   * \param endPoint the end point to remove
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   128
   */
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   129
  void DeAllocate (Ipv4EndPoint *endPoint);
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   130
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   131
  virtual IpL4Protocol::RxStatus Receive (Ptr<Packet> p,
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   132
                                          Ipv4Header const &header,
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   133
                                          Ptr<Ipv4Interface> incomingInterface);
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   134
  virtual IpL4Protocol::RxStatus Receive (Ptr<Packet> p,
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   135
                                          Ipv6Header const &header,
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   136
                                          Ptr<Ipv6Interface> interface);
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   137
7717
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   138
  // From IpL4Protocol
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   139
  virtual void SetDownTarget (IpL4Protocol::DownTargetCallback cb);
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   140
  virtual void SetDownTarget6 (IpL4Protocol::DownTargetCallback6 cb);
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   141
  // From IpL4Protocol
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   142
  virtual IpL4Protocol::DownTargetCallback GetDownTarget (void) const;
cfa1741013dd Add support for IPv6 transport protocols
Ken Renard <kdrenard2@gmail.com>
parents: 7386
diff changeset
   143
  virtual IpL4Protocol::DownTargetCallback6 GetDownTarget6 (void) const;
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   144
protected:
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   145
  virtual void DoDispose (void);
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   146
  virtual void NotifyNewAggregate ();
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   147
private:
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   148
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   149
   * \brief Copy constructor
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   150
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   151
   * Defined and not implemented to avoid misuse
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   152
   */
4741
ae4aa2deec45 Make some copy-constructors private, remove not implemented method declarations, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 4740
diff changeset
   153
  NscTcpL4Protocol (NscTcpL4Protocol const &);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   154
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   155
   * \brief Copy constructor
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   156
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   157
   * Defined and not implemented to avoid misuse
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   158
   * \returns
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   159
   */
4741
ae4aa2deec45 Make some copy-constructors private, remove not implemented method declarations, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 4740
diff changeset
   160
  NscTcpL4Protocol& operator= (NscTcpL4Protocol const &);
ae4aa2deec45 Make some copy-constructors private, remove not implemented method declarations, to make Python bindings work.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 4740
diff changeset
   161
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   162
  // NSC callbacks.
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   163
  // NSC invokes these hooks to interact with the simulator.
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   164
  // In any case, these methods are only to be called by NSC.
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   165
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   166
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   167
   * \brief Invoked by NSCs 'ethernet driver' to re-inject a packet into ns-3.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   168
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   169
   * A packet is an octet soup consisting of an IP Header, TCP Header
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   170
   * and user payload, if any
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   171
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   172
   * \param data the data
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   173
   * \param datalen the data length
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   174
   */
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 6834
diff changeset
   175
  void send_callback (const void *data, int datalen);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   176
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   177
   * \brief Called by the NSC stack whenever something of interest has happened
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   178
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   179
   * Examples: when data arrives on a socket, a listen socket
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   180
   * has a new connection pending, etc.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   181
   */
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 6834
diff changeset
   182
  void wakeup ();
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   183
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   184
   * \brief Called by the Linux stack RNG initialization
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   185
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   186
   * Its also used by the cradle code to add a timestamp to
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   187
   * printk/printf/debug output.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   188
   * \param sec seconds
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   189
   * \param usec microseconds
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   190
   */
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 6834
diff changeset
   191
  void gettime (unsigned int *sec, unsigned int *usec);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   192
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   193
   * \brief Add an interface
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   194
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   195
   * Actually NSC only supports one interface per node (\bugid{1398})
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   196
   */
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   197
  void AddInterface (void);
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   198
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   199
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   200
   * \brief Provide a "soft" interrupt to NSC
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   201
   */
4740
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   202
  void SoftInterrupt (void);
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   203
  friend class NscInterfaceImpl;
34acfd7ad508 export headers from internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4472
diff changeset
   204
  friend class NscTcpSocketImpl;
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   205
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   206
  Ptr<Node> m_node; //!< the node this stack is associated with
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   207
  Ipv4EndPointDemux *m_endPoints; //!< A list of IPv4 end points.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   208
  INetStack* m_nscStack; //!< the NSC stack.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   209
  NscInterfaceImpl *m_nscInterface; //!< the NSC Interface.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   210
  void *m_dlopenHandle; //!< dynamic library handle.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   211
  std::string m_nscLibrary; //!< path to the NSC library.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   212
  Timer m_softTimer; //!< Soft interrupt timer
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   213
  std::vector<Ptr<NscTcpSocketImpl> > m_sockets; //!< list of sockets
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 9146
diff changeset
   214
  IpL4Protocol::DownTargetCallback m_downTarget; //!< Callback to send packets over IPv4
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   215
};
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   216
7386
2310ed220a61 standardize ns-3 namespace declaration format
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   217
} // namespace ns3
3578
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   218
e6374560e19e nsc: core files.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   219
#endif /* NSC_TCP_L4_PROTOCOL_H */