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 
235 {
236 public:
240  static const uint8_t OPT_NUMBER = 43;
241 
246  static TypeId GetTypeId ();
247 
252 
257 
262  virtual uint8_t GetOptionNumber () const;
263 
274  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
275 };
276 
277 } /* namespace ns3 */
278 
279 #endif /* IPV6_OPTION_H */
280 
Doxygen introspection did not find any typical Config paths.
Definition: ipv6-header.h:33
Ipv6OptionRouterAlert()
Constructor.
Definition: ipv6-option.cc:206
virtual ~Ipv6Option()
Destructor.
Definition: ipv6-option.cc:47
Doxygen introspection did not find any typical Config paths.
Definition: ipv6-option.h:94
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:152
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:107
Ipv6OptionPadn()
Constructor.
Definition: ipv6-option.cc:116
static const uint8_t OPT_NUMBER
Router alert option number.
Definition: ipv6-option.h:240
static const uint8_t OPT_NUMBER
Pad1 option number.
Definition: ipv6-option.h:100
Ipv6OptionJumbogram()
Constructor.
Definition: ipv6-option.cc:161
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:35
Ipv6OptionPad1()
Constructor.
Definition: ipv6-option.cc:71
~Ipv6OptionPad1()
Destructor.
Definition: ipv6-option.cc:76
virtual uint8_t GetOptionNumber() const
Get the option number.
Definition: ipv6-option.cc:81
virtual uint8_t Process(Ptr< Packet > packet, uint8_t offset, Ipv6Header const &ipv6Header, bool &isDropped)
Process method Called from Ipv6L3Protocol::Receive.
Definition: ipv6-option.cc:178
void SetNode(Ptr< Node > node)
Set the node.
Definition: ipv6-option.cc:52
~Ipv6OptionRouterAlert()
Destructor.
Definition: ipv6-option.cc:211
static const uint8_t OPT_NUMBER
PadN option number.
Definition: ipv6-option.h:147
virtual uint8_t Process(Ptr< Packet > packet, uint8_t offset, Ipv6Header const &ipv6Header, bool &isDropped)
Process method.
Definition: ipv6-option.cc:88
virtual uint8_t GetOptionNumber() const =0
Get the option number.
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:197
Doxygen introspection did not find any typical Config paths.
Definition: ipv6-option.h:141
~Ipv6OptionPadn()
Destructor.
Definition: ipv6-option.cc:121
Doxygen introspection did not find any typical Config paths.
Definition: ipv6-option.h:234
virtual uint8_t GetOptionNumber() const
Get the option number.
Definition: ipv6-option.cc:126
~Ipv6OptionJumbogram()
Destructor.
Definition: ipv6-option.cc:166
virtual uint8_t GetOptionNumber() const
Get the option number.
Definition: ipv6-option.cc:216
virtual uint8_t GetOptionNumber() const
Get the option number.
Definition: ipv6-option.cc:171
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:62
static const uint8_t OPT_NUMBER
Jumbogram option number.
Definition: ipv6-option.h:194
Ptr< Node > m_node
The node.
Definition: ipv6-option.h:87
virtual uint8_t Process(Ptr< Packet > packet, uint8_t offset, Ipv6Header const &ipv6Header, bool &isDropped)=0
Process method.
a base class which provides memory management and object aggregation
Definition: object.h:63
virtual uint8_t Process(Ptr< Packet > packet, uint8_t offset, Ipv6Header const &ipv6Header, bool &isDropped)
Process method.
Definition: ipv6-option.cc:223
Doxygen introspection did not find any typical Config paths.
Definition: ipv6-option.h:188
Doxygen introspection did not find any typical Config paths.
Definition: ipv6-option.h:45
a unique identifier for an interface.
Definition: type-id.h:49
virtual uint8_t Process(Ptr< Packet > packet, uint8_t offset, Ipv6Header const &ipv6Header, bool &isDropped)
Process method.
Definition: ipv6-option.cc:133