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