A Discrete-Event Network Simulator
API
tcp-option-rfc793.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  */
20 #ifndef TCPOPTIONRFC793_H
21 #define TCPOPTIONRFC793_H
22 
23 #include "ns3/tcp-option.h"
24 
25 namespace ns3 {
26 
32 class TcpOptionEnd : public TcpOption
33 {
34 public:
35  TcpOptionEnd ();
36  virtual ~TcpOptionEnd ();
37 
42  static TypeId GetTypeId (void);
43  virtual TypeId GetInstanceTypeId (void) const;
44 
45  virtual void Print (std::ostream &os) const;
46  virtual void Serialize (Buffer::Iterator start) const;
47  virtual uint32_t Deserialize (Buffer::Iterator start);
48 
49  virtual uint8_t GetKind (void) const;
50  virtual uint32_t GetSerializedSize (void) const;
51 
52 };
53 
57 class TcpOptionNOP : public TcpOption
58 {
59 public:
60  TcpOptionNOP ();
61  virtual ~TcpOptionNOP ();
62 
67  static TypeId GetTypeId (void);
68  virtual TypeId GetInstanceTypeId (void) const;
69 
70  virtual void Print (std::ostream &os) const;
71  virtual void Serialize (Buffer::Iterator start) const;
72  virtual uint32_t Deserialize (Buffer::Iterator start);
73 
74  virtual uint8_t GetKind (void) const;
75  virtual uint32_t GetSerializedSize (void) const;
76 };
77 
81 class TcpOptionMSS : public TcpOption
82 {
83 public:
84  TcpOptionMSS ();
85  virtual ~TcpOptionMSS ();
86 
91  static TypeId GetTypeId (void);
92  virtual TypeId GetInstanceTypeId (void) const;
93 
94  virtual void Print (std::ostream &os) const;
95  virtual void Serialize (Buffer::Iterator start) const;
96  virtual uint32_t Deserialize (Buffer::Iterator start);
97 
98  virtual uint8_t GetKind (void) const;
99  virtual uint32_t GetSerializedSize (void) const;
100 
105  uint16_t GetMSS (void) const;
110  void SetMSS (uint16_t mss);
111 
112 protected:
113  uint16_t m_mss;
114 };
115 
116 } // namespace ns3
117 
118 #endif // TCPOPTIONRFC793_H
iterator in a Buffer instance
Definition: buffer.h:99
Defines the TCP option of kind 0 (end of option list) as in RFC 793
virtual void Print(std::ostream &os) const
Print the Option contents.
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
virtual uint8_t GetKind(void) const
Get the ‘kind’ (as in RFC 793) of this option.
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Base class for all kinds of TCP options.
Definition: tcp-option.h:37
Defines the TCP option of kind 2 (maximum segment size) as in RFC 793
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint16_t m_mss
maximum segment size
void SetMSS(uint16_t mss)
Set the Maximum Segment Size stored in the Option.
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
uint16_t GetMSS(void) const
Get the Maximum Segment Size stored in the Option.
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
virtual void Print(std::ostream &os) const
Print the Option contents.
virtual uint8_t GetKind(void) const
Get the ‘kind’ (as in RFC 793) of this option.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
Defines the TCP option of kind 1 (no operation) as in RFC 793
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
virtual uint8_t GetKind(void) const
Get the ‘kind’ (as in RFC 793) of this option.
static TypeId GetTypeId(void)
Get the type ID.
virtual void Print(std::ostream &os) const
Print the Option contents.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
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.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1853