A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv6-option-header.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008-2009 Strasbourg University
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: David Gross <gdavid.devel@gmail.com>
19  */
20 
21 #ifndef IPV6_OPTION_HEADER_H
22 #define IPV6_OPTION_HEADER_H
23 
24 #include <ostream>
25 
26 #include "ns3/header.h"
27 
28 namespace ns3
29 {
30 
35 class Ipv6OptionHeader : public Header
36 {
37 public:
38 
46  struct Alignment
47  {
48  uint8_t factor;
49  uint8_t offset;
50  };
51 
56  static TypeId GetTypeId ();
57 
62  virtual TypeId GetInstanceTypeId () const;
63 
68 
72  virtual ~Ipv6OptionHeader ();
73 
78  void SetType (uint8_t type);
79 
84  uint8_t GetType () const;
85 
90  void SetLength (uint8_t length);
91 
96  uint8_t GetLength () const;
97 
103  virtual void Print (std::ostream &os) const;
104 
109  virtual uint32_t GetSerializedSize () const;
110 
115  virtual void Serialize (Buffer::Iterator start) const;
116 
122  virtual uint32_t Deserialize (Buffer::Iterator start);
123 
131  virtual Alignment GetAlignment () const;
132 
133 private:
137  uint8_t m_type;
138 
142  uint8_t m_length;
143 
148 };
149 
155 {
156 public:
161  static TypeId GetTypeId ();
162 
167  virtual TypeId GetInstanceTypeId () const;
168 
173 
177  virtual ~Ipv6OptionPad1Header ();
178 
184  virtual void Print (std::ostream &os) const;
185 
190  virtual uint32_t GetSerializedSize () const;
191 
196  virtual void Serialize (Buffer::Iterator start) const;
197 
203  virtual uint32_t Deserialize (Buffer::Iterator start);
204 };
205 
211 {
212 public:
217  static TypeId GetTypeId ();
218 
223  virtual TypeId GetInstanceTypeId () const;
224 
229  Ipv6OptionPadnHeader (uint32_t pad = 2);
230 
234  virtual ~Ipv6OptionPadnHeader ();
235 
241  virtual void Print (std::ostream &os) const;
242 
247  virtual uint32_t GetSerializedSize () const;
248 
253  virtual void Serialize (Buffer::Iterator start) const;
254 
260  virtual uint32_t Deserialize (Buffer::Iterator start);
261 };
262 
268 {
269 public:
274  static TypeId GetTypeId ();
275 
280  virtual TypeId GetInstanceTypeId () const;
281 
286 
290  virtual ~Ipv6OptionJumbogramHeader ();
291 
296  void SetDataLength (uint32_t dataLength);
297 
302  uint32_t GetDataLength () const;
303 
309  virtual void Print (std::ostream &os) const;
310 
315  virtual uint32_t GetSerializedSize () const;
316 
321  virtual void Serialize (Buffer::Iterator start) const;
322 
328  virtual uint32_t Deserialize (Buffer::Iterator start);
329 
334  virtual Alignment GetAlignment () const;
335 
336 private:
340  uint32_t m_dataLength;
341 };
342 
348 {
349 public:
354  static TypeId GetTypeId ();
355 
360  virtual TypeId GetInstanceTypeId () const;
361 
366 
370  virtual ~Ipv6OptionRouterAlertHeader ();
371 
375  void SetValue (uint16_t value);
376 
381  uint16_t GetValue () const;
382 
388  virtual void Print (std::ostream &os) const;
389 
394  virtual uint32_t GetSerializedSize () const;
395 
400  virtual void Serialize (Buffer::Iterator start) const;
401 
407  virtual uint32_t Deserialize (Buffer::Iterator start);
408 
413  virtual Alignment GetAlignment () const;
414 
415 private:
419  uint16_t m_value;
420 };
421 
422 } // namespace ns3
423 
424 #endif /* IPV6_OPTION_HEADER_H */
425