A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv6-option.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007-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, MA02111-1307USA
17  *
18  * Author: David Gross <gdavid.devel@gmail.com>
19  */
20 
21 #ifndef IPV6_OPTION_H
22 #define IPV6_OPTION_H
23 
24 #include <map>
25 
26 #include "ns3/object.h"
27 #include "ns3/node.h"
28 #include "ns3/ptr.h"
29 #include "ipv6-interface.h"
30 #include "ns3/ipv6-header.h"
31 #include "ns3/buffer.h"
32 #include "ns3/packet.h"
33 #include "ns3/ipv6-address.h"
34 
35 namespace ns3
36 {
37 
45 class Ipv6Option : public Object
46 {
47 public:
52  static TypeId GetTypeId ();
53 
57  virtual ~Ipv6Option ();
58 
63  void SetNode (Ptr<Node> node);
64 
69  virtual uint8_t GetOptionNumber () const = 0;
70 
81  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped) = 0;
82 
83 private:
88 };
89 
94 class Ipv6OptionPad1 : public Ipv6Option
95 {
96 public:
100  static const uint8_t OPT_NUMBER = 0;
101 
106  static TypeId GetTypeId ();
107 
111  Ipv6OptionPad1 ();
112 
116  ~Ipv6OptionPad1 ();
117 
122  virtual uint8_t GetOptionNumber () const;
123 
134  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
135 };
136 
142 {
143 public:
147  static const uint8_t OPT_NUMBER = 60;
148 
153  static TypeId GetTypeId ();
154 
158  Ipv6OptionPadn ();
159 
163  ~Ipv6OptionPadn ();
164 
169  virtual uint8_t GetOptionNumber () const;
170 
181  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
182 };
183 
189 {
190 public:
194  static const uint8_t OPT_NUMBER = 44;
195 
200  static TypeId GetTypeId ();
201 
206 
211 
216  virtual uint8_t GetOptionNumber () const;
217 
227  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
228 
229 private:
233  uint32_t m_length;
234 };
235 
241 {
242 public:
246  static const uint8_t OPT_NUMBER = 43;
247 
252  static TypeId GetTypeId ();
253 
258 
263 
268  virtual uint8_t GetOptionNumber () const;
269 
280  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
281 };
282 
283 } /* namespace ns3 */
284 
285 #endif /* IPV6_OPTION_H */
286