OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2011 Adrian Sai-wah Tam |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com> |
| 19 */ |
| 20 |
| 21 #ifndef TCP_OPTION_WINSCALE_H |
| 22 #define TCP_OPTION_WINSCALE_H |
| 23 |
| 24 #include "tcp-option.h" |
| 25 |
| 26 namespace ns3 { |
| 27 |
| 28 /** |
| 29 * \ingroup tcp |
| 30 * |
| 31 * \brief Defines the TCP option of kind 3 (window scale option) as in RFC1323 |
| 32 */ |
| 33 |
| 34 class TcpOptionWinScale : public TcpOption |
| 35 { |
| 36 public: |
| 37 TcpOptionWinScale (); |
| 38 virtual ~TcpOptionWinScale (); |
| 39 |
| 40 static TypeId GetTypeId (void); |
| 41 virtual TypeId GetInstanceTypeId (void) const; |
| 42 |
| 43 /** |
| 44 * \brief Print the option's content |
| 45 * |
| 46 * \param os the output stream |
| 47 */ |
| 48 virtual void Print (std::ostream &os) const; |
| 49 |
| 50 /** |
| 51 * \brief Write the option into a packet's byte buffer |
| 52 * |
| 53 * \param start the buffer iterator which points to where the option should be
written |
| 54 */ |
| 55 virtual void Serialize (Buffer::Iterator start) const; |
| 56 |
| 57 /** |
| 58 * \brief Re-create the option from a packet's byte buffer |
| 59 * |
| 60 * \param start the buffer iterator which points to where the option is writte
n |
| 61 * \return the option's length in bytes |
| 62 */ |
| 63 virtual uint32_t Deserialize (Buffer::Iterator start); |
| 64 |
| 65 /** |
| 66 * \return the 'kind' (which is 3) of the option |
| 67 */ |
| 68 virtual uint8_t GetKind (void) const; |
| 69 |
| 70 /** |
| 71 * \return the option's length in bytes |
| 72 */ |
| 73 virtual uint32_t GetSerializedSize (void) const; |
| 74 |
| 75 /** |
| 76 * \param scale the scale factor |
| 77 */ |
| 78 void SetScale (uint8_t scale); |
| 79 |
| 80 /** |
| 81 * \return the scale factor |
| 82 */ |
| 83 uint8_t GetScale (void) const; |
| 84 |
| 85 protected: |
| 86 uint8_t m_scale; //!< Window shift count |
| 87 }; |
| 88 |
| 89 } //namespace ns3 |
| 90 |
| 91 #endif /* TCP_OPTION_WINSCALE_H */ |
OLD | NEW |