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