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_H |
| 22 #define TCP_OPTION_H |
| 23 |
| 24 #include <stdint.h> |
| 25 #include "ns3/object.h" |
| 26 #include "ns3/buffer.h" |
| 27 |
| 28 namespace ns3 { |
| 29 |
| 30 /** |
| 31 * Base class for all kinds of TCP options |
| 32 */ |
| 33 |
| 34 class TcpOption : public Object |
| 35 { |
| 36 public: |
| 37 TcpOption (); |
| 38 virtual ~TcpOption (); |
| 39 |
| 40 static TypeId GetTypeId (void); |
| 41 virtual TypeId GetInstanceTypeId (void) const; |
| 42 |
| 43 virtual void Print (std::ostream &os) const = 0; |
| 44 virtual void Serialize (Buffer::Iterator start) const = 0; |
| 45 virtual uint32_t Deserialize (Buffer::Iterator start) = 0; |
| 46 |
| 47 virtual uint8_t GetKind (void) const = 0; // Get the `kind' (as in RFC793) of
this option |
| 48 virtual uint32_t GetSerializedSize (void) const = 0; // Get the total length o
f this option, >= 1 |
| 49 |
| 50 static Ptr<TcpOption> CreateOption (uint8_t kind); // Factory method for all o
ptions |
| 51 protected: |
| 52 }; |
| 53 |
| 54 } // namespace ns3 |
| 55 |
| 56 #endif /* TCP_OPTION */ |
OLD | NEW |