A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ipv6-extension-demux.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_DEMUX_H
10#define IPV6_EXTENSION_DEMUX_H
11
12#include "ns3/object.h"
13#include "ns3/ptr.h"
14
15#include <list>
16
17namespace ns3
18{
19
20class Ipv6Extension;
21class Node;
22
23/**
24 * @ingroup ipv6HeaderExt
25 *
26 * @brief Demultiplexes IPv6 extensions.
27 */
29{
30 public:
31 /**
32 * @brief The interface ID.
33 * @return type ID
34 */
35 static TypeId GetTypeId();
36
37 /**
38 * @brief Constructor.
39 */
41
42 /**
43 * @brief Destructor.
44 */
45 ~Ipv6ExtensionDemux() override;
46
47 /**
48 * @brief Set the node.
49 * @param node the node to set
50 */
51 void SetNode(Ptr<Node> node);
52
53 /**
54 * @brief Insert a new IPv6 Extension.
55 * @param extension the extension to insert
56 */
57 void Insert(Ptr<Ipv6Extension> extension);
58
59 /**
60 * @brief Get the extension corresponding to extensionNumber.
61 * @param extensionNumber extension number of the extension to retrieve
62 * @return a matching IPv6 extension
63 */
64 Ptr<Ipv6Extension> GetExtension(uint8_t extensionNumber);
65
66 /**
67 * @brief Remove an extension from this demux.
68 * @param extension pointer on the extension to remove
69 */
70 void Remove(Ptr<Ipv6Extension> extension);
71
72 /**
73 * Assigns stream numbers to the registered extensions of this IPv6 demux object
74 *
75 * @param stream the first stream number to assign
76 * @returns the number of assigned streams
77 */
78 int64_t AssignStreams(int64_t stream);
79
80 protected:
81 /**
82 * @brief Dispose object.
83 */
84 void DoDispose() override;
85
86 private:
87 /**
88 * @brief Container of the IPv6 Extensions.
89 */
90 typedef std::list<Ptr<Ipv6Extension>> Ipv6ExtensionList_t;
91
92 /**
93 * @brief List of IPv6 Extensions supported.
94 */
96
97 /**
98 * @brief The node.
99 */
101};
102
103} /* namespace ns3 */
104
105#endif /* IPV6_EXTENSION_DEMUX_H */
Ipv6ExtensionList_t m_extensions
List of IPv6 Extensions supported.
void SetNode(Ptr< Node > node)
Set the node.
void DoDispose() override
Dispose object.
std::list< Ptr< Ipv6Extension > > Ipv6ExtensionList_t
Container of the IPv6 Extensions.
int64_t AssignStreams(int64_t stream)
Assigns stream numbers to the registered extensions of this IPv6 demux object.
static TypeId GetTypeId()
The interface ID.
~Ipv6ExtensionDemux() override
Destructor.
Ptr< Node > m_node
The node.
void Remove(Ptr< Ipv6Extension > extension)
Remove an extension from this demux.
Ptr< Ipv6Extension > GetExtension(uint8_t extensionNumber)
Get the extension corresponding to extensionNumber.
void Insert(Ptr< Ipv6Extension > extension)
Insert a new IPv6 Extension.
IPv6 Extension base If you want to implement a new IPv6 extension, all you have to do is implement a ...
A network Node.
Definition node.h:46
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
a unique identifier for an interface.
Definition type-id.h:50
Every class exported by the ns3 library is enclosed in the ns3 namespace.