A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
tcp-option-winscale.h
Go to the documentation of this file.
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  * Documentation, test cases: Natale Patriciello <natale.patriciello@gmail.com>
20  */
21 
22 #ifndef TCP_OPTION_WINSCALE_H
23 #define TCP_OPTION_WINSCALE_H
24 
25 #include "tcp-option.h"
26 
27 namespace ns3 {
28 
49 {
50 public:
55  static TypeId GetTypeId (void);
56  virtual TypeId GetInstanceTypeId (void) const;
57 
59  virtual ~TcpOptionWinScale ();
60 
61  virtual void Print (std::ostream &os) const;
62  virtual void Serialize (Buffer::Iterator start) const;
63  virtual uint32_t Deserialize (Buffer::Iterator start);
64 
65  virtual uint8_t GetKind (void) const;
66  virtual uint32_t GetSerializedSize (void) const;
67 
72  uint8_t GetScale (void) const;
73 
81  void SetScale (uint8_t scale);
82 
83 protected:
84  uint8_t m_scale;
85 };
86 
87 } // namespace ns3
88 
89 #endif /* TCP_OPTION_WINSCALE */
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
Defines the TCP option of kind 3 (window scale option) as in RFC 1323
virtual uint8_t GetKind(void) const
Get the `kind' (as in RFC 793) of this option.
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t GetScale(void) const
Get the scale value (uint8_t)
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
void SetScale(uint8_t scale)
Set the scale option.
virtual TypeId GetInstanceTypeId(void) const
Base class for all kinds of TCP options.
Definition: tcp-option.h:34
uint8_t m_scale
Window scaling in number of bit shift.
a unique identifier for an interface.
Definition: type-id.h:49
static TypeId GetTypeId(void)
Get the type ID.
virtual void Print(std::ostream &os) const
Print the Option contents.