/usr/include/ns3.26/ns3/tcp-tx-buffer.h is in libns3-dev 3.26+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 132 133 134 135 136 137 138 139 140 141 142 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2010 Adrian Sai-wah Tam
*
* 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: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
*/
#ifndef TCP_TX_BUFFER_H
#define TCP_TX_BUFFER_H
#include <list>
#include "ns3/traced-value.h"
#include "ns3/trace-source-accessor.h"
#include "ns3/object.h"
#include "ns3/sequence-number.h"
#include "ns3/ptr.h"
namespace ns3 {
class Packet;
/**
* \ingroup tcp
*
* \brief class for keeping the data sent by the application to the TCP socket, i.e.
* the sending buffer.
*/
class TcpTxBuffer : public Object
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
/**
* \brief Constructor
* \param n initial Sequence number to be transmitted
*/
TcpTxBuffer (uint32_t n = 0);
virtual ~TcpTxBuffer (void);
// Accessors
/**
* Returns the first byte's sequence number
* \returns the first byte's sequence number
*/
SequenceNumber32 HeadSequence (void) const;
/**
* Returns the last byte's sequence number + 1
* \returns the last byte's sequence number + 1
*/
SequenceNumber32 TailSequence (void) const;
/**
* Returns total number of bytes in this Tx buffer
* \returns total number of bytes in this Tx buffer
*/
uint32_t Size (void) const;
/**
* Returns the Tx window size
* \returns the Tx window size (in bytes)
*/
uint32_t MaxBufferSize (void) const;
/**
* Set the Tx window size
* \param n Tx window size (in bytes)
*/
void SetMaxBufferSize (uint32_t n);
/**
* Returns the available capacity in this Tx window
* \returns available capacity in this Tx window
*/
uint32_t Available (void) const;
/**
* Append a data packet to the end of the buffer
*
* \param p The packet to be appended to the Tx buffer
* \return Boolean to indicate success
*/
bool Add (Ptr<Packet> p);
/**
* Returns the number of bytes from the buffer in the range [seq, tailSequence)
* \param seq initial sequence number
* \returns the number of bytes from the buffer in the range
*/
uint32_t SizeFromSequence (const SequenceNumber32& seq) const;
/**
* Copy data of size numBytes into a packet, data from the range [seq, seq+numBytes)
* \param numBytes number of bytes to copy
* \param seq start sequence number to extract
* \returns a packet
*/
Ptr<Packet> CopyFromSequence (uint32_t numBytes, const SequenceNumber32& seq);
/**
* Set the m_firstByteSeq to seq. Supposed to be called only when the
* connection is just set up and we did not send any data out yet.
* \param seq The sequence number of the head byte
*/
void SetHeadSequence (const SequenceNumber32& seq);
/**
* Discard data up to but not including this sequence number.
*
* \param seq The sequence number of the head byte
*/
void DiscardUpTo (const SequenceNumber32& seq);
private:
/// container for data stored in the buffer
typedef std::list<Ptr<Packet> >::iterator BufIterator;
TracedValue<SequenceNumber32> m_firstByteSeq; //!< Sequence number of the first byte in data (SND.UNA)
uint32_t m_size; //!< Number of data bytes
uint32_t m_maxBuffer; //!< Max number of data bytes in buffer (SND.WND)
std::list<Ptr<Packet> > m_data; //!< Corresponding data (may be null)
};
} // namepsace ns3
#endif /* TCP_TX_BUFFER_H */
|