A Discrete-Event Network Simulator
API
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 
46 class Ipv6Option : public Object
47 {
48 public:
53  static TypeId GetTypeId ();
54 
58  virtual ~Ipv6Option ();
59 
64  void SetNode (Ptr<Node> node);
65 
70  virtual uint8_t GetOptionNumber () const = 0;
71 
82  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped) = 0;
83 
84 private:
89 };
90 
96 class Ipv6OptionPad1 : public Ipv6Option
97 {
98 public:
102  static const uint8_t OPT_NUMBER = 0;
103 
108  static TypeId GetTypeId ();
109 
113  Ipv6OptionPad1 ();
114 
118  ~Ipv6OptionPad1 ();
119 
124  virtual uint8_t GetOptionNumber () const;
125 
136  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
137 };
138 
145 {
146 public:
150  static const uint8_t OPT_NUMBER = 60;
151 
156  static TypeId GetTypeId ();
157 
161  Ipv6OptionPadn ();
162 
166  ~Ipv6OptionPadn ();
167 
172  virtual uint8_t GetOptionNumber () const;
173 
184  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
185 };
186 
193 {
194 public:
198  static const uint8_t OPT_NUMBER = 44;
199 
204  static TypeId GetTypeId ();
205 
210 
215 
220  virtual uint8_t GetOptionNumber () const;
221 
231  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
232 };
233 
240 {
241 public:
245  static const uint8_t OPT_NUMBER = 43;
246 
251  static TypeId GetTypeId ();
252 
257 
262 
267  virtual uint8_t GetOptionNumber () const;
268 
279  virtual uint8_t Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped);
280 };
281 
282 } /* namespace ns3 */
283 
284 #endif /* IPV6_OPTION_H */
285 
virtual uint8_t GetOptionNumber() const
Get the option number.
Definition: ipv6-option.cc:81
Packet header for IPv6.
Definition: ipv6-header.h:34
Ipv6OptionRouterAlert()
Constructor.
Definition: ipv6-option.cc:206
virtual ~Ipv6Option()
Destructor.
Definition: ipv6-option.cc:47
IPv6 Option Pad1.
Definition: ipv6-option.h:96
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:151
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:106
Ipv6OptionPadn()
Constructor.
Definition: ipv6-option.cc:116
static const uint8_t OPT_NUMBER
Router alert option number.
Definition: ipv6-option.h:245
virtual uint8_t GetOptionNumber() const
Get the option number.
Definition: ipv6-option.cc:216
static const uint8_t OPT_NUMBER
Pad1 option number.
Definition: ipv6-option.h:102
Ipv6OptionJumbogram()
Constructor.
Definition: ipv6-option.cc:161
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:34
Ipv6OptionPad1()
Constructor.
Definition: ipv6-option.cc:71
~Ipv6OptionPad1()
Destructor.
Definition: ipv6-option.cc:76
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
virtual uint8_t GetOptionNumber() const
Get the option number.
Definition: ipv6-option.cc:171
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:150
virtual uint8_t Process(Ptr< Packet > packet, uint8_t offset, Ipv6Header const &ipv6Header, bool &isDropped)
Process method.
Definition: ipv6-option.cc:88
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual uint8_t GetOptionNumber() const =0
Get the option number.
virtual uint8_t GetOptionNumber() const
Get the option number.
Definition: ipv6-option.cc:126
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:196
IPv6 Option Padn.
Definition: ipv6-option.h:144
~Ipv6OptionPadn()
Destructor.
Definition: ipv6-option.cc:121
IPv6 Option Router Alert.
Definition: ipv6-option.h:239
~Ipv6OptionJumbogram()
Destructor.
Definition: ipv6-option.cc:166
static TypeId GetTypeId()
Get the type identificator.
Definition: ipv6-option.cc:61
static const uint8_t OPT_NUMBER
Jumbogram option number.
Definition: ipv6-option.h:198
Ptr< Node > m_node
The node.
Definition: ipv6-option.h:88
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:87
virtual uint8_t Process(Ptr< Packet > packet, uint8_t offset, Ipv6Header const &ipv6Header, bool &isDropped)
Process method.
Definition: ipv6-option.cc:223
IPv6 Option Jumbogram.
Definition: ipv6-option.h:192
IPv6 Option base.
Definition: ipv6-option.h:46
a unique identifier for an interface.
Definition: type-id.h:58
virtual uint8_t Process(Ptr< Packet > packet, uint8_t offset, Ipv6Header const &ipv6Header, bool &isDropped)
Process method.
Definition: ipv6-option.cc:133