A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
ipv6-end-point-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: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
7
*/
8
9
#ifndef IPV6_END_POINT_DEMUX_H
10
#define IPV6_END_POINT_DEMUX_H
11
12
#include "
ipv6-interface.h
"
13
14
#include "ns3/ipv6-address.h"
15
16
#include <list>
17
#include <stdint.h>
18
19
namespace
ns3
20
{
21
22
class
Ipv6EndPoint;
23
24
/**
25
* \ingroup ipv6
26
*
27
* \brief Demultiplexer for end points.
28
*/
29
class
Ipv6EndPointDemux
30
{
31
public
:
32
/**
33
* \brief Container of the IPv6 endpoints.
34
*/
35
typedef
std::list<Ipv6EndPoint*>
EndPoints
;
36
37
/**
38
* \brief Iterator to the container of the IPv6 endpoints.
39
*/
40
typedef
std::list<Ipv6EndPoint*>::iterator
EndPointsI
;
41
42
Ipv6EndPointDemux
();
43
~Ipv6EndPointDemux
();
44
45
/**
46
* \brief Lookup for port local.
47
* \param port port to test
48
* \return true if a port local is in EndPoints, false otherwise
49
*/
50
bool
LookupPortLocal
(uint16_t
port
);
51
52
/**
53
* \brief Lookup for address and port.
54
* \param boundNetDevice Bound NetDevice (if any)
55
* \param addr address to test
56
* \param port port to test
57
* \return true if there is a match in EndPoints, false otherwise
58
*/
59
bool
LookupLocal
(
Ptr<NetDevice>
boundNetDevice,
Ipv6Address
addr, uint16_t
port
);
60
61
/**
62
* \brief lookup for a match with all the parameters.
63
*
64
* The function will return a list of most-matching EndPoints, in this order:
65
* -# Full match
66
* -# All but local address
67
* -# Only local port and local address match
68
* -# Only local port match
69
*
70
* EndPoint with disabled Rx are skipped.
71
*
72
* \param dst destination address to test
73
* \param dport destination port to test
74
* \param src source address to test
75
* \param sport source port to test
76
* \param incomingInterface the incoming interface
77
* \return list of IPv6EndPoints (could be 0 element)
78
*/
79
EndPoints
Lookup
(
Ipv6Address
dst,
80
uint16_t dport,
81
Ipv6Address
src,
82
uint16_t sport,
83
Ptr<Ipv6Interface>
incomingInterface);
84
85
/**
86
* \brief Simple lookup for a four-tuple match.
87
* \param dst destination address to test
88
* \param dport destination port to test
89
* \param src source address to test
90
* \param sport source port to test
91
* \return match or 0 if not found
92
*/
93
Ipv6EndPoint
*
SimpleLookup
(
Ipv6Address
dst, uint16_t dport,
Ipv6Address
src, uint16_t sport);
94
95
/**
96
* \brief Allocate a Ipv6EndPoint.
97
* \return an empty Ipv6EndPoint instance
98
*/
99
Ipv6EndPoint
*
Allocate
();
100
101
/**
102
* \brief Allocate a Ipv6EndPoint.
103
* \param address IPv6 address
104
* \return an Ipv6EndPoint instance
105
*/
106
Ipv6EndPoint
*
Allocate
(
Ipv6Address
address);
107
108
/**
109
* \brief Allocate a Ipv6EndPoint.
110
* \param boundNetDevice Bound NetDevice (if any)
111
* \param port local port
112
* \return an Ipv6EndPoint instance
113
*/
114
Ipv6EndPoint
*
Allocate
(
Ptr<NetDevice>
boundNetDevice, uint16_t
port
);
115
116
/**
117
* \brief Allocate a Ipv6EndPoint.
118
* \param boundNetDevice Bound NetDevice (if any)
119
* \param address local address
120
* \param port local port
121
* \return an Ipv6EndPoint instance
122
*/
123
Ipv6EndPoint
*
Allocate
(
Ptr<NetDevice>
boundNetDevice,
Ipv6Address
address, uint16_t
port
);
124
125
/**
126
* \brief Allocate a Ipv6EndPoint.
127
* \param boundNetDevice Bound NetDevice (if any)
128
* \param localAddress local address
129
* \param localPort local port
130
* \param peerAddress peer address
131
* \param peerPort peer port
132
* \return an Ipv6EndPoint instance
133
*/
134
Ipv6EndPoint
*
Allocate
(
Ptr<NetDevice>
boundNetDevice,
135
Ipv6Address
localAddress,
136
uint16_t localPort,
137
Ipv6Address
peerAddress,
138
uint16_t peerPort);
139
140
/**
141
* \brief Remove a end point.
142
* \param endPoint the end point to remove
143
*/
144
void
DeAllocate
(
Ipv6EndPoint
* endPoint);
145
146
/**
147
* \brief Get the entire list of end points registered.
148
* \return list of Ipv6EndPoint
149
*/
150
EndPoints
GetEndPoints
()
const
;
151
152
private
:
153
/**
154
* \brief Allocate a ephemeral port.
155
* \return a port
156
*/
157
uint16_t
AllocateEphemeralPort
();
158
159
/**
160
* \brief The ephemeral port.
161
*/
162
uint16_t
m_ephemeral
;
163
164
/**
165
* \brief The first ephemeral port.
166
*/
167
uint16_t
m_portFirst
;
168
169
/**
170
* \brief The last ephemeral port.
171
*/
172
uint16_t
m_portLast
;
173
174
/**
175
* \brief A list of IPv6 end points.
176
*/
177
EndPoints
m_endPoints
;
178
};
179
180
}
/* namespace ns3 */
181
182
#endif
/* IPV6_END_POINT_DEMUX_H */
ns3::Ipv6Address
Describes an IPv6 address.
Definition
ipv6-address.h:38
ns3::Ipv6EndPointDemux
Demultiplexer for end points.
Definition
ipv6-end-point-demux.h:30
ns3::Ipv6EndPointDemux::Lookup
EndPoints Lookup(Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport, Ptr< Ipv6Interface > incomingInterface)
lookup for a match with all the parameters.
Definition
ipv6-end-point-demux.cc:171
ns3::Ipv6EndPointDemux::~Ipv6EndPointDemux
~Ipv6EndPointDemux()
Definition
ipv6-end-point-demux.cc:28
ns3::Ipv6EndPointDemux::Ipv6EndPointDemux
Ipv6EndPointDemux()
Definition
ipv6-end-point-demux.cc:20
ns3::Ipv6EndPointDemux::Allocate
Ipv6EndPoint * Allocate()
Allocate a Ipv6EndPoint.
Definition
ipv6-end-point-demux.cc:69
ns3::Ipv6EndPointDemux::LookupLocal
bool LookupLocal(Ptr< NetDevice > boundNetDevice, Ipv6Address addr, uint16_t port)
Lookup for address and port.
Definition
ipv6-end-point-demux.cc:54
ns3::Ipv6EndPointDemux::m_endPoints
EndPoints m_endPoints
A list of IPv6 end points.
Definition
ipv6-end-point-demux.h:177
ns3::Ipv6EndPointDemux::m_ephemeral
uint16_t m_ephemeral
The ephemeral port.
Definition
ipv6-end-point-demux.h:162
ns3::Ipv6EndPointDemux::EndPointsI
std::list< Ipv6EndPoint * >::iterator EndPointsI
Iterator to the container of the IPv6 endpoints.
Definition
ipv6-end-point-demux.h:40
ns3::Ipv6EndPointDemux::GetEndPoints
EndPoints GetEndPoints() const
Get the entire list of end points registered.
Definition
ipv6-end-point-demux.cc:363
ns3::Ipv6EndPointDemux::SimpleLookup
Ipv6EndPoint * SimpleLookup(Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport)
Simple lookup for a four-tuple match.
Definition
ipv6-end-point-demux.cc:300
ns3::Ipv6EndPointDemux::LookupPortLocal
bool LookupPortLocal(uint16_t port)
Lookup for port local.
Definition
ipv6-end-point-demux.cc:40
ns3::Ipv6EndPointDemux::AllocateEphemeralPort
uint16_t AllocateEphemeralPort()
Allocate a ephemeral port.
Definition
ipv6-end-point-demux.cc:341
ns3::Ipv6EndPointDemux::m_portFirst
uint16_t m_portFirst
The first ephemeral port.
Definition
ipv6-end-point-demux.h:167
ns3::Ipv6EndPointDemux::m_portLast
uint16_t m_portLast
The last ephemeral port.
Definition
ipv6-end-point-demux.h:172
ns3::Ipv6EndPointDemux::DeAllocate
void DeAllocate(Ipv6EndPoint *endPoint)
Remove a end point.
Definition
ipv6-end-point-demux.cc:151
ns3::Ipv6EndPointDemux::EndPoints
std::list< Ipv6EndPoint * > EndPoints
Container of the IPv6 endpoints.
Definition
ipv6-end-point-demux.h:35
ns3::Ipv6EndPoint
A representation of an IPv6 endpoint/connection.
Definition
ipv6-end-point.h:40
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
port
uint16_t port
Definition
dsdv-manet.cc:33
ipv6-interface.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
model
ipv6-end-point-demux.h
Generated on Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0