Left: | ||
Right: |
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 | |
trucanh524
2014/08/07 10:35:14
I think that an Ascii art for the option structure
| |
21 #ifndef TCP_OPTION_SACK_H | |
22 #define TCP_OPTION_SACK_H | |
23 | |
24 #include "tcp-option.h" | |
25 #include "ns3/sequence-number.h" | |
26 | |
27 namespace ns3 { | |
28 | |
29 /** | |
30 * Defines the TCP option of kind 5 (Selective Acknowledgement) as in RFC2018 | |
Tommaso Pecorella
2014/08/17 10:38:13
\RFC{2018} (it adds automatically an hyperlink)
A
| |
31 */ | |
32 | |
33 class TcpOptionSack : public TcpOption | |
34 { | |
35 public: | |
36 TcpOptionSack (); | |
37 virtual ~TcpOptionSack (); | |
38 | |
39 typedef std::pair<SequenceNumber32, SequenceNumber32> SackBlock; | |
Tommaso Pecorella
2014/08/17 10:38:13
Why use SequenceNumber and not "simply" uint32_t ?
| |
40 typedef std::list<SackBlock> ScoreBoard; | |
41 | |
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 void AddSack (SackBlock s); | |
53 uint32_t SackCount (void) const; | |
54 | |
55 void ClearSack (void); | |
56 SackBlock GetSack (int offset); | |
57 protected: | |
58 ScoreBoard m_sb; | |
59 }; | |
60 | |
61 } // namespace ns3 | |
62 | |
63 #endif /* TCP_OPTION_SACK_H */ | |
OLD | NEW |