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 #include "tcp-option-sack-permitted.h" |
| 22 |
| 23 namespace ns3 { |
| 24 |
| 25 NS_OBJECT_ENSURE_REGISTERED (TcpOptionSackPermitted); |
| 26 |
| 27 TcpOptionSackPermitted::TcpOptionSackPermitted () |
| 28 { |
| 29 } |
| 30 |
| 31 TcpOptionSackPermitted::~TcpOptionSackPermitted () |
| 32 { |
| 33 } |
| 34 |
| 35 TypeId |
| 36 TcpOptionSackPermitted::GetTypeId (void) |
| 37 { |
| 38 static TypeId tid = TypeId ("ns3::TcpOptionSackPermitted") |
| 39 .SetParent<TcpOption> () |
| 40 ; |
| 41 return tid; |
| 42 } |
| 43 |
| 44 TypeId |
| 45 TcpOptionSackPermitted::GetInstanceTypeId (void) const |
| 46 { |
| 47 return GetTypeId (); |
| 48 } |
| 49 |
| 50 void |
| 51 TcpOptionSackPermitted::Print (std::ostream &os) const |
| 52 { |
| 53 } |
| 54 |
| 55 uint32_t |
| 56 TcpOptionSackPermitted::GetSerializedSize (void) const |
| 57 { |
| 58 return 2; |
| 59 } |
| 60 |
| 61 void |
| 62 TcpOptionSackPermitted::Serialize (Buffer::Iterator start) const |
| 63 { |
| 64 Buffer::Iterator i = start; |
| 65 i.WriteU8 (4); // Kind |
| 66 i.WriteU8 (2); // Length |
| 67 }· |
| 68 |
| 69 uint32_t |
| 70 TcpOptionSackPermitted::Deserialize (Buffer::Iterator start) |
| 71 { |
| 72 Buffer::Iterator i = start; |
| 73 uint8_t size = i.ReadU8 (); |
| 74 NS_ASSERT (size == 2); |
| 75 return 2; |
| 76 } |
| 77 |
| 78 uint8_t |
| 79 TcpOptionSackPermitted::GetKind (void) const |
| 80 { |
| 81 return 4; |
| 82 } |
| 83 |
| 84 } // namespace ns3 |
OLD | NEW |