A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ipv6-extension.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007-2009 Strasbourg University
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: David Gross <gdavid.devel@gmail.com>
18 */
19
20#ifndef IPV6_EXTENSION_H
21#define IPV6_EXTENSION_H
22
24#include "ipv6-header.h"
25#include "ipv6-interface.h"
26#include "ipv6-l3-protocol.h"
27
28#include "ns3/buffer.h"
29#include "ns3/ipv6-address.h"
30#include "ns3/node.h"
31#include "ns3/object.h"
32#include "ns3/packet.h"
33#include "ns3/ptr.h"
34#include "ns3/random-variable-stream.h"
35#include "ns3/traced-callback.h"
36
37#include <list>
38#include <map>
39#include <tuple>
40
41namespace ns3
42{
43
44/**
45 * \ingroup ipv6
46 * \defgroup ipv6HeaderExt IPV6 Header extension system.
47 */
48
49/**
50 * \ingroup ipv6HeaderExt
51 *
52 * \brief IPv6 Extension base
53 * If you want to implement a new IPv6 extension, all you have to do is
54 * implement a subclass of this class and add it to an Ipv6ExtensionDemux.
55 */
56class Ipv6Extension : public Object
57{
58 public:
59 /**
60 * \brief Get the type identificator.
61 * \return type identificator
62 */
63 static TypeId GetTypeId();
64
65 /**
66 * \brief Constructor.
67 */
69
70 /**
71 * \brief Destructor.
72 */
73 ~Ipv6Extension() override;
74
75 /**
76 * \brief Set the node.
77 * \param node the node to set
78 */
79 void SetNode(Ptr<Node> node);
80
81 /**
82 * \brief Get the node.
83 * \return the node
84 */
85 Ptr<Node> GetNode() const;
86
87 /**
88 * \brief Get the extension number.
89 * \return extension number
90 */
91 virtual uint8_t GetExtensionNumber() const = 0;
92
93 /**
94 * \brief Process method
95 * Called from Ipv6L3Protocol::Receive.
96 *
97 * \param packet the packet
98 * \param offset the offset of the extension to process
99 * \param ipv6Header the IPv6 header of packet received
100 * \param dst destination address of the packet received (i.e. us)
101 * \param nextHeader the next header
102 * \param stopProcessing true if the packet must not be further processed
103 * \param isDropped true if the packet must be dropped
104 * \param dropReason dropping reason
105 * \return the size processed
106 */
107 virtual uint8_t Process(Ptr<Packet>& packet,
108 uint8_t offset,
109 const Ipv6Header& ipv6Header,
110 Ipv6Address dst,
111 uint8_t* nextHeader,
112 bool& stopProcessing,
113 bool& isDropped,
114 Ipv6L3Protocol::DropReason& dropReason) = 0;
115
116 /**
117 * \brief Process options
118 * Called by implementing classes to process the options
119 *
120 * \param packet the packet
121 * \param offset the offset of the first option to process
122 * \param length the total length of all options (as specified in the extension header)
123 * \param ipv6Header the IPv6 header of packet received
124 * \param dst destination address of the packet received (i.e. us)
125 * \param nextHeader the next header
126 * \param stopProcessing true if the packet must not be further processed
127 * \param isDropped true if the packet must be dropped
128 * \param dropReason dropping reason
129 * \return the size processed
130 */
131 virtual uint8_t ProcessOptions(Ptr<Packet>& packet,
132 uint8_t offset,
133 uint8_t length,
134 const Ipv6Header& ipv6Header,
135 Ipv6Address dst,
136 uint8_t* nextHeader,
137 bool& stopProcessing,
138 bool& isDropped,
139 Ipv6L3Protocol::DropReason& dropReason);
140
141 /**
142 * Assign a fixed random variable stream number to the random variables
143 * used by this model. Return the number of streams (possibly zero) that
144 * have been assigned.
145 *
146 * \param stream first stream index to use
147 * \return the number of stream indices assigned by this model
148 */
149 int64_t AssignStreams(int64_t stream);
150
151 protected:
152 /**
153 * \brief Provides uniform random variables.
154 */
156
157 private:
158 /**
159 * \brief The node.
160 */
162};
163
164/**
165 * \ingroup ipv6HeaderExt
166 *
167 * \brief IPv6 Extension "Hop By Hop"
168 */
170{
171 public:
172 /**
173 * \brief Hop-by-hop extension number.
174 */
175 static const uint8_t EXT_NUMBER = 0;
176
177 /**
178 * \brief Get the type identificator.
179 * \return type identificator
180 */
181 static TypeId GetTypeId();
182
183 /**
184 * \brief Constructor.
185 */
187
188 /**
189 * \brief Destructor.
190 */
191 ~Ipv6ExtensionHopByHop() override;
192
193 /**
194 * \brief Get the extension number.
195 * \return extension number
196 */
197 uint8_t GetExtensionNumber() const override;
198
199 uint8_t Process(Ptr<Packet>& packet,
200 uint8_t offset,
201 const Ipv6Header& ipv6Header,
202 Ipv6Address dst,
203 uint8_t* nextHeader,
204 bool& stopProcessing,
205 bool& isDropped,
206 Ipv6L3Protocol::DropReason& dropReason) override;
207};
208
209/**
210 * \ingroup ipv6HeaderExt
211 *
212 * \brief IPv6 Extension Destination
213 */
215{
216 public:
217 /**
218 * \brief Destination extension number.
219 */
220 static const uint8_t EXT_NUMBER = 60;
221
222 /**
223 * \brief Get the type identificator.
224 * \return type identificator
225 */
226 static TypeId GetTypeId();
227
228 /**
229 * \brief Constructor.
230 */
232
233 /**
234 * \brief Destructor.
235 */
236 ~Ipv6ExtensionDestination() override;
237
238 /**
239 * \brief Get the extension number.
240 * \return extension number
241 */
242 uint8_t GetExtensionNumber() const override;
243
244 uint8_t Process(Ptr<Packet>& packet,
245 uint8_t offset,
246 const Ipv6Header& ipv6Header,
247 Ipv6Address dst,
248 uint8_t* nextHeader,
249 bool& stopProcessing,
250 bool& isDropped,
251 Ipv6L3Protocol::DropReason& dropReason) override;
252};
253
254/**
255 * \ingroup ipv6HeaderExt
256 *
257 * \brief IPv6 Extension Fragment
258 */
260{
261 public:
262 /**
263 * \brief Fragmentation extension number.
264 */
265 static const uint8_t EXT_NUMBER = 44;
266
267 /**
268 * \brief Get the type identificator.
269 * \return type identificator
270 */
271 static TypeId GetTypeId();
272
273 /**
274 * \brief Constructor.
275 */
277
278 /**
279 * \brief Destructor.
280 */
281 ~Ipv6ExtensionFragment() override;
282
283 /**
284 * \brief Get the extension number.
285 * \return extension number
286 */
287 uint8_t GetExtensionNumber() const override;
288
289 uint8_t Process(Ptr<Packet>& packet,
290 uint8_t offset,
291 const Ipv6Header& ipv6Header,
292 Ipv6Address dst,
293 uint8_t* nextHeader,
294 bool& stopProcessing,
295 bool& isDropped,
296 Ipv6L3Protocol::DropReason& dropReason) override;
297
298 /**
299 * \brief Pair of a packet and an Ipv6 header.
300 */
301 typedef std::pair<Ptr<Packet>, Ipv6Header> Ipv6PayloadHeaderPair;
302
303 /**
304 * \brief Fragment a packet.
305 *
306 * \param packet the packet.
307 * \param ipv6Header the IPv6 header.
308 * \param fragmentSize the maximal size of the fragment (unfragmentable part + fragmentation
309 * header + fragmentable part).
310 * \param listFragments the list of fragments.
311 */
312 void GetFragments(Ptr<Packet> packet,
313 Ipv6Header ipv6Header,
314 uint32_t fragmentSize,
315 std::list<Ipv6PayloadHeaderPair>& listFragments);
316
317 protected:
318 /**
319 * \brief Dispose this object.
320 */
321 void DoDispose() override;
322
323 private:
324 /**
325 * Key identifying a fragmented packet
326 */
327 typedef std::pair<Ipv6Address, uint32_t> FragmentKey_t;
328
329 /**
330 * Container for fragment timeouts.
331 */
332 typedef std::list<std::tuple<Time, FragmentKey_t, Ipv6Header>> FragmentsTimeoutsList_t;
333 /**
334 * Container Iterator for fragment timeouts.
335 */
336 typedef std::list<std::tuple<Time, FragmentKey_t, Ipv6Header>>::iterator
338
339 /**
340 * \ingroup ipv6HeaderExt
341 *
342 * \brief This class stores the fragments of a packet waiting to be rebuilt.
343 */
344 class Fragments : public SimpleRefCount<Fragments>
345 {
346 public:
347 /**
348 * \brief Constructor.
349 */
350 Fragments();
351
352 /**
353 * \brief Destructor.
354 */
355 ~Fragments();
356
357 /**
358 * \brief Add a fragment.
359 * \param fragment the fragment
360 * \param fragmentOffset the offset of the fragment
361 * \param moreFragment the bit "More Fragment"
362 */
363 void AddFragment(Ptr<Packet> fragment, uint16_t fragmentOffset, bool moreFragment);
364
365 /**
366 * \brief Set the unfragmentable part of the packet.
367 * \param unfragmentablePart the unfragmentable part
368 */
369 void SetUnfragmentablePart(Ptr<Packet> unfragmentablePart);
370
371 /**
372 * \brief If all fragments have been added.
373 * \returns true if the packet is entire
374 */
375 bool IsEntire() const;
376
377 /**
378 * \brief Get the entire packet.
379 * \return the entire packet
380 */
381 Ptr<Packet> GetPacket() const;
382
383 /**
384 * \brief Get the packet parts so far received.
385 * \return the partial packet
386 */
388
389 /**
390 * \brief Set the Timeout iterator.
391 * \param iter The iterator.
392 */
394
395 /**
396 * \brief Get the Timeout iterator.
397 * \returns The iterator.
398 */
400
401 private:
402 /**
403 * \brief If other fragments will be sent.
404 */
406
407 /**
408 * \brief The current fragments.
409 */
410 std::list<std::pair<Ptr<Packet>, uint16_t>> m_packetFragments;
411
412 /**
413 * \brief The unfragmentable part.
414 */
416
417 /**
418 * \brief Timeout iterator to "event" handler
419 */
421 };
422
423 /**
424 * \brief Process the timeout for packet fragments
425 * \param key representing the packet fragments
426 * \param ipHeader the IP header of the original packet
427 */
429
430 /**
431 * \brief Get the packet parts so far received.
432 * \return the partial packet
433 */
435
436 /**
437 * \brief Set the Timeout EventId.
438 * \param event The event.
439 */
441
442 /**
443 * \brief Cancel the timeout event
444 */
446
447 /**
448 * \brief Container for the packet fragments.
449 */
450 typedef std::map<FragmentKey_t, Ptr<Fragments>> MapFragments_t;
451
452 /**
453 * \brief The hash of fragmented packets.
454 */
456
457 /**
458 * \brief Set a new timeout "event" for a fragmented packet
459 * \param key the fragment identification
460 * \param ipHeader the IPv6 header of the fragmented packet
461 * \return an iterator to the inserted "event"
462 */
464
465 /**
466 * \brief Handles a fragmented packet timeout
467 */
468 void HandleTimeout();
469
470 FragmentsTimeoutsList_t m_timeoutEventList; //!< Timeout "events" container
471 EventId m_timeoutEvent; //!< Event for the next scheduled timeout
472 Time m_fragmentExpirationTimeout; //!< Expiration timeout
473};
474
475/**
476 * \ingroup ipv6HeaderExt
477 *
478 * \brief IPv6 Extension Routing.
479 *
480 * If you want to implement a new IPv6 routing extension, all you have to do is
481 * implement a subclass of this class and add it to an Ipv6ExtensionRoutingDemux.
482 */
484{
485 public:
486 /**
487 * \brief Routing extension number.
488 */
489 static const uint8_t EXT_NUMBER = 43;
490
491 /**
492 * \brief Get the type identificator.
493 * \return type identificator
494 */
495 static TypeId GetTypeId();
496
497 /**
498 * \brief Constructor.
499 */
501
502 /**
503 * \brief Destructor.
504 */
505 ~Ipv6ExtensionRouting() override;
506
507 /**
508 * \brief Get the extension number.
509 * \return extension number
510 */
511 uint8_t GetExtensionNumber() const override;
512
513 /**
514 * \brief Get the type of routing.
515 * \return type of routing
516 */
517 virtual uint8_t GetTypeRouting() const;
518
519 /**
520 * \brief Get a pointer to a new routing extension header.
521 * The ownership is transferred to the caller.
522 * \return a pointer to a new routing extension header.
523 */
525
526 uint8_t Process(Ptr<Packet>& packet,
527 uint8_t offset,
528 const Ipv6Header& ipv6Header,
529 Ipv6Address dst,
530 uint8_t* nextHeader,
531 bool& stopProcessing,
532 bool& isDropped,
533 Ipv6L3Protocol::DropReason& dropReason) override;
534};
535
536/**
537 * \ingroup ipv6HeaderExt
538 *
539 * \brief IPv6 Extension Routing Demux.
540 */
542{
543 public:
544 /**
545 * \brief The interface ID.
546 * \return type ID
547 */
548 static TypeId GetTypeId();
549
550 /**
551 * \brief Constructor.
552 */
554
555 /**
556 * \brief Destructor.
557 */
559
560 /**
561 * \brief Set the node.
562 * \param node the node to set
563 */
564 void SetNode(Ptr<Node> node);
565
566 /**
567 * \brief Insert a new IPv6 Routing Extension.
568 * \param extensionRouting the routing extension to insert
569 */
570 void Insert(Ptr<Ipv6ExtensionRouting> extensionRouting);
571
572 /**
573 * \brief Get the routing extension corresponding to typeRouting.
574 * \param typeRouting the number of the routing extension to retrieve
575 * \return a matching IPv6 routing extension
576 */
578
579 /**
580 * \brief Get a pointer to a new routing extension header corresponding
581 * to typeRouting. The ownership is transferred to the caller.
582 * \param typeRouting the number of the routing extension to retrieve
583 * \return a pointer to a new routing extension header matching IPv6 routing extension
584 */
586
587 /**
588 * \brief Remove a routing extension from this demux.
589 * \param extensionRouting pointer on the extension to remove
590 */
591 void Remove(Ptr<Ipv6ExtensionRouting> extensionRouting);
592
593 protected:
594 /**
595 * \brief Dispose this object.
596 */
597 void DoDispose() override;
598
599 private:
600 /**
601 * \brief Container for the extension routing.
602 */
603 typedef std::list<Ptr<Ipv6ExtensionRouting>> Ipv6ExtensionRoutingList_t;
604
605 /**
606 * \brief List of IPv6 Routing Extensions supported.
607 */
609
610 /**
611 * \brief The node.
612 */
614};
615
616/**
617 * \ingroup ipv6HeaderExt
618 *
619 * \brief IPv6 Extension Loose Routing
620 */
622{
623 public:
624 /**
625 * \brief Routing type.
626 */
627 static const uint8_t TYPE_ROUTING = 0;
628
629 /**
630 * \brief Get the type identificator.
631 * \return type identificator
632 */
633 static TypeId GetTypeId();
634
635 /**
636 * \brief Constructor.
637 */
639
640 /**
641 * \brief Destructor.
642 */
644
645 /**
646 * \brief Get the type of routing.
647 * \return type of routing
648 */
649 uint8_t GetTypeRouting() const override;
650
652
653 uint8_t Process(Ptr<Packet>& packet,
654 uint8_t offset,
655 const Ipv6Header& ipv6Header,
656 Ipv6Address dst,
657 uint8_t* nextHeader,
658 bool& stopProcessing,
659 bool& isDropped,
660 Ipv6L3Protocol::DropReason& dropReason) override;
661};
662
663/**
664 * \ingroup ipv6HeaderExt
665 *
666 * \brief IPv6 Extension ESP (Encapsulating Security Payload)
667 */
669{
670 public:
671 /**
672 * \brief ESP extension number.
673 */
674 static const uint8_t EXT_NUMBER = 50;
675
676 /**
677 * \brief Get the type identificator.
678 * \return type identificator
679 */
680 static TypeId GetTypeId();
681
682 /**
683 * \brief Constructor.
684 */
686
687 /**
688 * \brief Destructor.
689 */
690 ~Ipv6ExtensionESP() override;
691
692 /**
693 * \brief Get the extension number.
694 * \return extension number
695 */
696 uint8_t GetExtensionNumber() const override;
697
698 uint8_t Process(Ptr<Packet>& packet,
699 uint8_t offset,
700 const Ipv6Header& ipv6Header,
701 Ipv6Address dst,
702 uint8_t* nextHeader,
703 bool& stopProcessing,
704 bool& isDropped,
705 Ipv6L3Protocol::DropReason& dropReason) override;
706};
707
708/**
709 * \ingroup ipv6HeaderExt
710 *
711 * \brief IPv6 Extension AH (Authentication Header)
712 */
714{
715 public:
716 /**
717 * \brief AH extension number.
718 */
719 static const uint8_t EXT_NUMBER = 51;
720
721 /**
722 * \brief Get the type identificator.
723 * \return type identificator
724 */
725 static TypeId GetTypeId();
726
727 /**
728 * \brief Constructor.
729 */
731
732 /**
733 * \brief Destructor.
734 */
735 ~Ipv6ExtensionAH() override;
736
737 /**
738 * \brief Get the extension number.
739 * \return extension number
740 */
741 uint8_t GetExtensionNumber() const override;
742
743 uint8_t Process(Ptr<Packet>& packet,
744 uint8_t offset,
745 const Ipv6Header& ipv6Header,
746 Ipv6Address dst,
747 uint8_t* nextHeader,
748 bool& stopProcessing,
749 bool& isDropped,
750 Ipv6L3Protocol::DropReason& dropReason) override;
751};
752
753} /* namespace ns3 */
754
755#endif /* IPV6_EXTENSION_H */
An identifier for simulation events.
Definition: event-id.h:55
Describes an IPv6 address.
Definition: ipv6-address.h:49
IPv6 Extension AH (Authentication Header)
~Ipv6ExtensionAH() override
Destructor.
uint8_t Process(Ptr< Packet > &packet, uint8_t offset, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason) override
Process method Called from Ipv6L3Protocol::Receive.
static TypeId GetTypeId()
Get the type identificator.
uint8_t GetExtensionNumber() const override
Get the extension number.
Ipv6ExtensionAH()
Constructor.
static const uint8_t EXT_NUMBER
AH extension number.
IPv6 Extension Destination.
uint8_t GetExtensionNumber() const override
Get the extension number.
static const uint8_t EXT_NUMBER
Destination extension number.
static TypeId GetTypeId()
Get the type identificator.
~Ipv6ExtensionDestination() override
Destructor.
uint8_t Process(Ptr< Packet > &packet, uint8_t offset, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason) override
Process method Called from Ipv6L3Protocol::Receive.
IPv6 Extension ESP (Encapsulating Security Payload)
~Ipv6ExtensionESP() override
Destructor.
Ipv6ExtensionESP()
Constructor.
uint8_t Process(Ptr< Packet > &packet, uint8_t offset, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason) override
Process method Called from Ipv6L3Protocol::Receive.
uint8_t GetExtensionNumber() const override
Get the extension number.
static const uint8_t EXT_NUMBER
ESP extension number.
static TypeId GetTypeId()
Get the type identificator.
This class stores the fragments of a packet waiting to be rebuilt.
Ptr< Packet > GetPartialPacket() const
Get the packet parts so far received.
Ptr< Packet > GetPacket() const
Get the entire packet.
std::list< std::pair< Ptr< Packet >, uint16_t > > m_packetFragments
The current fragments.
void AddFragment(Ptr< Packet > fragment, uint16_t fragmentOffset, bool moreFragment)
Add a fragment.
void SetTimeoutIter(FragmentsTimeoutsListI_t iter)
Set the Timeout iterator.
bool m_moreFragment
If other fragments will be sent.
Ptr< Packet > m_unfragmentable
The unfragmentable part.
FragmentsTimeoutsListI_t m_timeoutIter
Timeout iterator to "event" handler.
void SetUnfragmentablePart(Ptr< Packet > unfragmentablePart)
Set the unfragmentable part of the packet.
bool IsEntire() const
If all fragments have been added.
FragmentsTimeoutsListI_t GetTimeoutIter()
Get the Timeout iterator.
IPv6 Extension Fragment.
Time m_fragmentExpirationTimeout
Expiration timeout.
void HandleTimeout()
Handles a fragmented packet timeout.
Ptr< Packet > GetPartialPacket() const
Get the packet parts so far received.
Ipv6ExtensionFragment()
Constructor.
static TypeId GetTypeId()
Get the type identificator.
std::pair< Ptr< Packet >, Ipv6Header > Ipv6PayloadHeaderPair
Pair of a packet and an Ipv6 header.
void GetFragments(Ptr< Packet > packet, Ipv6Header ipv6Header, uint32_t fragmentSize, std::list< Ipv6PayloadHeaderPair > &listFragments)
Fragment a packet.
std::pair< Ipv6Address, uint32_t > FragmentKey_t
Key identifying a fragmented packet.
EventId m_timeoutEvent
Event for the next scheduled timeout.
std::map< FragmentKey_t, Ptr< Fragments > > MapFragments_t
Container for the packet fragments.
MapFragments_t m_fragments
The hash of fragmented packets.
void DoDispose() override
Dispose this object.
void SetTimeoutEventId(EventId event)
Set the Timeout EventId.
uint8_t Process(Ptr< Packet > &packet, uint8_t offset, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason) override
Process method Called from Ipv6L3Protocol::Receive.
std::list< std::tuple< Time, FragmentKey_t, Ipv6Header > >::iterator FragmentsTimeoutsListI_t
Container Iterator for fragment timeouts.
~Ipv6ExtensionFragment() override
Destructor.
FragmentsTimeoutsList_t m_timeoutEventList
Timeout "events" container.
void HandleFragmentsTimeout(FragmentKey_t key, Ipv6Header ipHeader)
Process the timeout for packet fragments.
FragmentsTimeoutsListI_t SetTimeout(FragmentKey_t key, Ipv6Header ipHeader)
Set a new timeout "event" for a fragmented packet.
uint8_t GetExtensionNumber() const override
Get the extension number.
std::list< std::tuple< Time, FragmentKey_t, Ipv6Header > > FragmentsTimeoutsList_t
Container for fragment timeouts.
static const uint8_t EXT_NUMBER
Fragmentation extension number.
void CancelTimeout()
Cancel the timeout event.
IPv6 Extension "Hop By Hop".
static TypeId GetTypeId()
Get the type identificator.
~Ipv6ExtensionHopByHop() override
Destructor.
Ipv6ExtensionHopByHop()
Constructor.
uint8_t Process(Ptr< Packet > &packet, uint8_t offset, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason) override
Process method Called from Ipv6L3Protocol::Receive.
static const uint8_t EXT_NUMBER
Hop-by-hop extension number.
uint8_t GetExtensionNumber() const override
Get the extension number.
IPv6 Extension base If you want to implement a new IPv6 extension, all you have to do is implement a ...
Ptr< Node > GetNode() const
Get the node.
virtual uint8_t ProcessOptions(Ptr< Packet > &packet, uint8_t offset, uint8_t length, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason)
Process options Called by implementing classes to process the options.
virtual uint8_t GetExtensionNumber() const =0
Get the extension number.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< Node > m_node
The node.
void SetNode(Ptr< Node > node)
Set the node.
virtual uint8_t Process(Ptr< Packet > &packet, uint8_t offset, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason)=0
Process method Called from Ipv6L3Protocol::Receive.
Ptr< UniformRandomVariable > m_uvar
Provides uniform random variables.
~Ipv6Extension() override
Destructor.
Ipv6Extension()
Constructor.
static TypeId GetTypeId()
Get the type identificator.
IPv6 Extension Loose Routing.
static TypeId GetTypeId()
Get the type identificator.
~Ipv6ExtensionLooseRouting() override
Destructor.
uint8_t Process(Ptr< Packet > &packet, uint8_t offset, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason) override
Process method Called from Ipv6L3Protocol::Receive.
uint8_t GetTypeRouting() const override
Get the type of routing.
Ipv6ExtensionRoutingHeader * GetExtensionRoutingHeaderPtr() override
Get a pointer to a new routing extension header.
static const uint8_t TYPE_ROUTING
Routing type.
IPv6 Extension Routing Demux.
void DoDispose() override
Dispose this object.
std::list< Ptr< Ipv6ExtensionRouting > > Ipv6ExtensionRoutingList_t
Container for the extension routing.
void Insert(Ptr< Ipv6ExtensionRouting > extensionRouting)
Insert a new IPv6 Routing Extension.
static TypeId GetTypeId()
The interface ID.
void SetNode(Ptr< Node > node)
Set the node.
Ptr< Ipv6ExtensionRouting > GetExtensionRouting(uint8_t typeRouting)
Get the routing extension corresponding to typeRouting.
void Remove(Ptr< Ipv6ExtensionRouting > extensionRouting)
Remove a routing extension from this demux.
Ptr< Node > m_node
The node.
Ipv6ExtensionRoutingList_t m_extensionsRouting
List of IPv6 Routing Extensions supported.
Ipv6ExtensionRoutingHeader * GetExtensionRoutingHeaderPtr(uint8_t typeRouting)
Get a pointer to a new routing extension header corresponding to typeRouting.
~Ipv6ExtensionRoutingDemux() override
Destructor.
Header of IPv6 Extension Routing.
IPv6 Extension Routing.
uint8_t GetExtensionNumber() const override
Get the extension number.
static const uint8_t EXT_NUMBER
Routing extension number.
Ipv6ExtensionRouting()
Constructor.
~Ipv6ExtensionRouting() override
Destructor.
virtual Ipv6ExtensionRoutingHeader * GetExtensionRoutingHeaderPtr()
Get a pointer to a new routing extension header.
static TypeId GetTypeId()
Get the type identificator.
virtual uint8_t GetTypeRouting() const
Get the type of routing.
uint8_t Process(Ptr< Packet > &packet, uint8_t offset, const Ipv6Header &ipv6Header, Ipv6Address dst, uint8_t *nextHeader, bool &stopProcessing, bool &isDropped, Ipv6L3Protocol::DropReason &dropReason) override
Process method Called from Ipv6L3Protocol::Receive.
Packet header for IPv6.
Definition: ipv6-header.h:35
DropReason
Reason why a packet has been dropped.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
A template-based reference counting class.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.