A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "tcp-option.h"
24 
25 namespace ns3 {
26 
30 class TcpOptionEnd : public TcpOption
31 {
32 public:
33  TcpOptionEnd ();
34  virtual ~TcpOptionEnd ();
35 
40  static TypeId GetTypeId (void);
41  virtual TypeId GetInstanceTypeId (void) const;
42 
43  virtual void Print (std::ostream &os) const;
44  virtual void Serialize (Buffer::Iterator start) const;
45  virtual uint32_t Deserialize (Buffer::Iterator start);
46 
47  virtual uint8_t GetKind (void) const;
48  virtual uint32_t GetSerializedSize (void) const;
49 
50 };
51 
55 class TcpOptionNOP : public TcpOption
56 {
57 public:
58  TcpOptionNOP ();
59  virtual ~TcpOptionNOP ();
60 
65  static TypeId GetTypeId (void);
66  virtual TypeId GetInstanceTypeId (void) const;
67 
68  virtual void Print (std::ostream &os) const;
69  virtual void Serialize (Buffer::Iterator start) const;
70  virtual uint32_t Deserialize (Buffer::Iterator start);
71 
72  virtual uint8_t GetKind (void) const;
73  virtual uint32_t GetSerializedSize (void) const;
74 };
75 
79 class TcpOptionMSS : public TcpOption
80 {
81 public:
82  TcpOptionMSS ();
83  virtual ~TcpOptionMSS ();
84 
89  static TypeId GetTypeId (void);
90  virtual TypeId GetInstanceTypeId (void) const;
91 
92  virtual void Print (std::ostream &os) const;
93  virtual void Serialize (Buffer::Iterator start) const;
94  virtual uint32_t Deserialize (Buffer::Iterator start);
95 
96  virtual uint8_t GetKind (void) const;
97  virtual uint32_t GetSerializedSize (void) const;
98 
103  uint16_t GetMSS (void) const;
108  void SetMSS (uint16_t mss);
109 
110 protected:
111  uint16_t m_mss;
112 };
113 
114 } // namespace ns3
115 
116 #endif // TCPOPTIONRFC793_H
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
void SetMSS(uint16_t mss)
Set the Maximum Segment Size stored in the Option.
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
Defines the TCP option of kind 1 (no operation) as in RFC 793
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 void Print(std::ostream &os) const
Print the Option contents.
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
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
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 TypeId GetInstanceTypeId(void) const
Defines the TCP option of kind 0 (end of option list) as in RFC 793
uint16_t m_mss
maximum segment size
static TypeId GetTypeId(void)
Get the type ID.
virtual TypeId GetInstanceTypeId(void) const
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.
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
static TypeId GetTypeId(void)
Get the type ID.
static TypeId GetTypeId(void)
Get the type ID.
Defines the TCP option of kind 2 (maximum segment size) as in RFC 793
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
Base class for all kinds of TCP options.
Definition: tcp-option.h:34
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
virtual TypeId GetInstanceTypeId(void) const
a unique identifier for an interface.
Definition: type-id.h:49
virtual void Print(std::ostream &os) const
Print the Option contents.