src/internet/model/tcp-socket.h
author Peter D. Barnes, Jr. <barnes26@llnl.gov>
Thu, 02 Oct 2014 21:17:48 -0700
changeset 10978 754c8256c35c
parent 10855 7ef081ddfc7f
child 11514 4e819d766ce2
permissions -rw-r--r--
TracedValue callback function signatures.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     2
/*
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     3
 * Copyright (c) 2006 Georgia Tech Research Corporation
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     4
 *               2007 INRIA
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     5
 *
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     7
 * it under the terms of the GNU General Public License version 2 as
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     8
 * published by the Free Software Foundation;
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     9
 *
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    13
 * GNU General Public License for more details.
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    14
 *
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    18
 *
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    19
 * Authors: George F. Riley<riley@ece.gatech.edu>
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    20
 *          Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    21
 */
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    22
7353
09fccf6195ea bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents: 7176
diff changeset
    23
#ifndef TCP_SOCKET_H
09fccf6195ea bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents: 7176
diff changeset
    24
#define TCP_SOCKET_H
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    25
6823
a27f86fb4e55 Merge node and common modules into new network module
Tom Henderson <tomh@tomh.org>
parents: 6694
diff changeset
    26
#include "ns3/socket.h"
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    27
#include "ns3/traced-callback.h"
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    28
#include "ns3/callback.h"
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    29
#include "ns3/ptr.h"
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    30
#include "ns3/object.h"
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
    31
#include "ns3/nstime.h"
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    32
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    33
namespace ns3 {
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    34
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    35
class Node;
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    36
class Packet;
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    37
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    38
/**
10978
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    39
 * \ingroup tcp
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    40
 * \brief Names of the 11 TCP states
10978
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    41
 *
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    42
 * \todo This should be a member of TcpSocket.
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    43
 */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    44
typedef enum {
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    45
  CLOSED,       // 0
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    46
  LISTEN,       // 1
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    47
  SYN_SENT,     // 2
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    48
  SYN_RCVD,     // 3
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    49
  ESTABLISHED,  // 4
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    50
  CLOSE_WAIT,   // 5
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    51
  LAST_ACK,     // 6
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    52
  FIN_WAIT_1,   // 7
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    53
  FIN_WAIT_2,   // 8
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    54
  CLOSING,      // 9
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    55
  TIME_WAIT,   // 10
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    56
  LAST_STATE
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    57
} TcpStates_t;
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    58
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    59
/**
10978
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    60
 * \ingroup tcp
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    61
 * TracedValue Callback signature for TcpStates_t
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    62
 *
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    63
 * \param [in] oldValue original value of the traced variable
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    64
 * \param [in] newValue new value of the traced variable
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    65
 */
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    66
typedef void (* TcpStatesTracedValueCallback)(const TcpStates_t oldValue,
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    67
                                              const TcpStates_t newValue);
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    68
754c8256c35c TracedValue callback function signatures.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10855
diff changeset
    69
/**
3183
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 3136
diff changeset
    70
 * \ingroup socket
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 3136
diff changeset
    71
 *
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    72
 * \brief (abstract) base class of all TcpSockets
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    73
 *
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    74
 * This class exists solely for hosting TcpSocket attributes that can
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    75
 * be reused across different implementations.
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    76
 */
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    77
class TcpSocket : public Socket
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    78
{
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    79
public:
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    80
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    81
   * Get the type ID.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    82
   * \brief Get the type ID.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    83
   * \return the object TypeId
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    84
   */
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    85
  static TypeId GetTypeId (void);
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    86
 
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    87
  TcpSocket (void);
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    88
  virtual ~TcpSocket (void);
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    89
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    90
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    91
   * \brief Literal names of TCP states for use in log messages
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    92
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    93
  static const char* const TcpStateName[LAST_STATE];
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
    94
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
    95
private:
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    96
  // Indirect the attribute setting and getting through private virtual methods
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    97
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    98
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
    99
   * \brief Set the send buffer size.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   100
   * \param size the buffer size (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   101
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   102
  virtual void SetSndBufSize (uint32_t size) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   103
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   104
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   105
   * \brief Get the send buffer size.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   106
   * \returns the buffer size (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   107
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   108
  virtual uint32_t GetSndBufSize (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   109
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   110
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   111
   * \brief Set the receive buffer size.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   112
   * \param size the buffer size (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   113
   */
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   114
  virtual void SetRcvBufSize (uint32_t size) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   115
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   116
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   117
   * \brief Get the receive buffer size.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   118
   * \returns the buffer size (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   119
   */
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   120
  virtual uint32_t GetRcvBufSize (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   121
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   122
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   123
   * \brief Set the segment size.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   124
   * \param size the segment size (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   125
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   126
  virtual void SetSegSize (uint32_t size) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   127
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   128
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   129
   * \brief Get the segment size.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   130
   * \returns the segment size (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   131
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   132
  virtual uint32_t GetSegSize (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   133
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   134
  /**
10855
7ef081ddfc7f Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
   135
   * \brief Set the initial Slow Start Threshold.
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   136
   * \param threshold the Slow Start Threshold (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   137
   */
10855
7ef081ddfc7f Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
   138
  virtual void SetInitialSSThresh (uint32_t threshold) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   139
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   140
  /**
10855
7ef081ddfc7f Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
   141
   * \brief Get the initial Slow Start Threshold.
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   142
   * \returns the Slow Start Threshold (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   143
   */
10855
7ef081ddfc7f Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 10405
diff changeset
   144
  virtual uint32_t GetInitialSSThresh (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   145
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   146
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   147
   * \brief Set the initial Congestion Window.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   148
   * \param cwnd the initial congestion window (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   149
   */
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   150
  virtual void SetInitialCwnd (uint32_t cwnd) = 0;
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   151
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   152
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   153
   * \brief Get the initial Congestion Window.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   154
   * \returns the initial congestion window (in bytes)
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   155
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   156
  virtual uint32_t GetInitialCwnd (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   157
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   158
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   159
   * \brief Set the connection timeout.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   160
   * \param timeout the connection timeout
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   161
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   162
  virtual void SetConnTimeout (Time timeout) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   163
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   164
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   165
   * \brief Get the connection timeout.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   166
   * \returns the connection timeout
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   167
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   168
  virtual Time GetConnTimeout (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   169
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   170
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   171
   * \brief Set the number of connection retries before giving up.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   172
   * \param count the number of connection retries
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   173
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   174
  virtual void SetConnCount (uint32_t count) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   175
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   176
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   177
   * \brief Get the number of connection retries before giving up.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   178
   * \returns the number of connection retries
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   179
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   180
  virtual uint32_t GetConnCount (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   181
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   182
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   183
   * \brief Set the time to delay an ACK.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   184
   * \param timeout the time to delay an ACK
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   185
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   186
  virtual void SetDelAckTimeout (Time timeout) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   187
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   188
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   189
   * \brief Get the time to delay an ACK.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   190
   * \returns the time to delay an ACK
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   191
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   192
  virtual Time GetDelAckTimeout (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   193
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   194
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   195
   * \brief Set the number of packet to fire an ACK before delay timeout.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   196
   * \param count the umber of packet to fire an ACK before delay timeout
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   197
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   198
  virtual void SetDelAckMaxCount (uint32_t count) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   199
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   200
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   201
   * \brief Get the number of packet to fire an ACK before delay timeout.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   202
   * \returns the number of packet to fire an ACK before delay timeout
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   203
   */
3136
a59b9ce95b6b Move Tcp attributes from factory to TcpSocket
Tom Henderson <tomh@tomh.org>
parents: 3135
diff changeset
   204
  virtual uint32_t GetDelAckMaxCount (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   205
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   206
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   207
   * \brief Enable/Disable Nagle's algorithm.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   208
   * \param noDelay true to DISABLE Nagle's algorithm
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   209
   */
7619
b4dee6307aa7 Nagle's algorithm in TCP (closes bug 1039)
Adrian S Tam <adrian.sw.tam@gmail.com>
parents: 7386
diff changeset
   210
  virtual void SetTcpNoDelay (bool noDelay) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   211
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   212
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   213
   * \brief Check if Nagle's algorithm is enabled or not.
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   214
   * \returns true if Nagle's algorithm is DISABLED
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   215
   */
7619
b4dee6307aa7 Nagle's algorithm in TCP (closes bug 1039)
Adrian S Tam <adrian.sw.tam@gmail.com>
parents: 7386
diff changeset
   216
  virtual bool GetTcpNoDelay (void) const = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   217
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   218
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   219
   * \brief Set the timout for persistent connection
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   220
   *
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   221
   * When the timout expires, send 1-byte data to probe for the window
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   222
   * size at the receiver when the local knowledge tells that the
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   223
   * receiver has zero window size
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   224
   *
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   225
   * \param timeout the persistent timout
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   226
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
   227
  virtual void SetPersistTimeout (Time timeout) = 0;
10405
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   228
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   229
  /**
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   230
   * \brief Get the timout for persistent connection
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   231
   *
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   232
   * When the timout expires, send 1-byte data to probe for the window
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   233
   * size at the receiver when the local knowledge tells that the
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   234
   * receiver has zero window size
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   235
   *
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   236
   * \returns the persistent timout
45c8fceae24e Doxygen fixes to Topology-read, Ipv6, and tcp-socket
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7619
diff changeset
   237
   */
6694
a814f37d15bf merge new TCP code
Josh Pelkey <jpelkey@gatech.edu>
parents: 3644
diff changeset
   238
  virtual Time GetPersistTimeout (void) const = 0;
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   239
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   240
};
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   241
7386
2310ed220a61 standardize ns-3 namespace declaration format
Vedran Miletić <rivanvx@gmail.com>
parents: 7353
diff changeset
   242
} // namespace ns3
3135
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   243
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   244
#endif /* TCP_SOCKET_H */
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   245
2ae291cb16ae Add missing files
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   246