A Discrete-Event Network Simulator
API
tcp-option-winscale.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Adrian Sai-wah Tam
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
18  * Documentation, test cases: Natale Patriciello <natale.patriciello@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 
51 {
52  public:
57  static TypeId GetTypeId();
58  TypeId GetInstanceTypeId() const override;
59 
61  ~TcpOptionWinScale() override;
62 
63  void Print(std::ostream& os) const override;
64  void Serialize(Buffer::Iterator start) const override;
65  uint32_t Deserialize(Buffer::Iterator start) override;
66 
67  uint8_t GetKind() const override;
68  uint32_t GetSerializedSize() const override;
69 
74  uint8_t GetScale() const;
75 
83  void SetScale(uint8_t scale);
84 
85  protected:
86  uint8_t m_scale;
87 };
88 
89 } // namespace ns3
90 
91 #endif /* TCP_OPTION_WINSCALE */
iterator in a Buffer instance
Definition: buffer.h:100
Base class for all kinds of TCP options.
Definition: tcp-option.h:38
Defines the TCP option of kind 3 (window scale option) as in RFC 1323
uint8_t GetScale() const
Get the scale value (uint8_t)
uint32_t GetSerializedSize() const override
Returns number of bytes required for Option serialization.
void Serialize(Buffer::Iterator start) const override
Serialize the Option to a buffer iterator.
void Print(std::ostream &os) const override
Print the Option contents.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the Option from a buffer iterator.
void SetScale(uint8_t scale)
Set the scale option.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t m_scale
Window scaling in number of bit shift.
uint8_t GetKind() const override
Get the ‘kind’ (as in RFC 793) of this option.
static TypeId GetTypeId()
Get the type ID.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.