A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
internet
model
ipv4-end-point-demux.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2005 INRIA
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
21
#ifndef IPV4_END_POINT_DEMUX_H
22
#define IPV4_END_POINT_DEMUX_H
23
24
#include <stdint.h>
25
#include <list>
26
#include "ns3/ipv4-address.h"
27
#include "
ipv4-interface.h
"
28
29
namespace
ns3
{
30
31
class
Ipv4EndPoint;
32
45
class
Ipv4EndPointDemux
{
46
public
:
50
typedef
std::list<Ipv4EndPoint *>
EndPoints
;
51
55
typedef
std::list<Ipv4EndPoint *>::iterator
EndPointsI
;
56
57
Ipv4EndPointDemux
();
58
~Ipv4EndPointDemux
();
59
64
EndPoints
GetAllEndPoints
(
void
);
65
71
bool
LookupPortLocal
(uint16_t
port
);
72
80
bool
LookupLocal
(
Ptr<NetDevice>
boundNetDevice,
Ipv4Address
addr, uint16_t
port
);
81
100
EndPoints
Lookup
(
Ipv4Address
daddr,
101
uint16_t dport,
102
Ipv4Address
saddr,
103
uint16_t sport,
104
Ptr<Ipv4Interface>
incomingInterface);
105
114
Ipv4EndPoint
*
SimpleLookup
(
Ipv4Address
daddr,
115
uint16_t dport,
116
Ipv4Address
saddr,
117
uint16_t sport);
118
123
Ipv4EndPoint
*
Allocate
(
void
);
124
130
Ipv4EndPoint
*
Allocate
(
Ipv4Address
address
);
131
138
Ipv4EndPoint
*
Allocate
(
Ptr<NetDevice>
boundNetDevice, uint16_t
port
);
139
147
Ipv4EndPoint
*
Allocate
(
Ptr<NetDevice>
boundNetDevice,
Ipv4Address
address
, uint16_t
port
);
148
158
Ipv4EndPoint
*
Allocate
(
Ptr<NetDevice>
boundNetDevice,
159
Ipv4Address
localAddress, uint16_t localPort,
160
Ipv4Address
peerAddress, uint16_t peerPort);
161
166
void
DeAllocate
(
Ipv4EndPoint
*endPoint);
167
168
private
:
169
174
uint16_t
AllocateEphemeralPort
(
void
);
175
179
uint16_t
m_ephemeral
;
180
184
uint16_t
m_portLast
;
185
189
uint16_t
m_portFirst
;
190
194
EndPoints
m_endPoints
;
195
};
196
197
}
// namespace ns3
198
199
#endif
/* IPV4_END_POINTS_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::Ipv4EndPointDemux::GetAllEndPoints
EndPoints GetAllEndPoints(void)
Get the entire list of end points registered.
Definition:
ipv4-end-point-demux.cc:179
ns3::Ipv4EndPointDemux::m_ephemeral
uint16_t m_ephemeral
The ephemeral port.
Definition:
ipv4-end-point-demux.h:179
ns3::Ipv4EndPointDemux::LookupPortLocal
bool LookupPortLocal(uint16_t port)
Lookup for port local.
Definition:
ipv4-end-point-demux.cc:49
ns3::Ipv4EndPointDemux::m_portFirst
uint16_t m_portFirst
The first ephemeral port.
Definition:
ipv4-end-point-demux.h:189
ipv4-interface.h
port
uint16_t port
Definition:
dsdv-manet.cc:45
ns3::Ipv4EndPointDemux
Demultiplexes packets to various transport layer endpoints.
Definition:
ipv4-end-point-demux.h:45
ns3::Ipv4EndPointDemux::LookupLocal
bool LookupLocal(Ptr< NetDevice > boundNetDevice, Ipv4Address addr, uint16_t port)
Lookup for address and port.
Definition:
ipv4-end-point-demux.cc:63
ns3::Ipv4EndPointDemux::m_portLast
uint16_t m_portLast
The last ephemeral port.
Definition:
ipv4-end-point-demux.h:184
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
first.address
address
Definition:
first.py:37
ns3::Ipv4EndPointDemux::SimpleLookup
Ipv4EndPoint * SimpleLookup(Ipv4Address daddr, uint16_t dport, Ipv4Address saddr, uint16_t sport)
simple lookup for a match with all the parameters.
Definition:
ipv4-end-point-demux.cc:339
ns3::Ipv4EndPointDemux::Lookup
EndPoints Lookup(Ipv4Address daddr, uint16_t dport, Ipv4Address saddr, uint16_t sport, Ptr< Ipv4Interface > incomingInterface)
lookup for a match with all the parameters.
Definition:
ipv4-end-point-demux.cc:199
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:40
ns3::Ipv4EndPointDemux::EndPoints
std::list< Ipv4EndPoint * > EndPoints
Container of the IPv4 endpoints.
Definition:
ipv4-end-point-demux.h:50
ns3::Ipv4EndPointDemux::EndPointsI
std::list< Ipv4EndPoint * >::iterator EndPointsI
Iterator to the container of the IPv4 endpoints.
Definition:
ipv4-end-point-demux.h:55
ns3::Ipv4EndPointDemux::DeAllocate
void DeAllocate(Ipv4EndPoint *endPoint)
Remove a end point.
Definition:
ipv4-end-point-demux.cc:161
ns3::Ipv4EndPointDemux::m_endPoints
EndPoints m_endPoints
A list of IPv4 end points.
Definition:
ipv4-end-point-demux.h:194
ns3::Ipv4EndPointDemux::Ipv4EndPointDemux
Ipv4EndPointDemux()
Definition:
ipv4-end-point-demux.cc:31
ns3::Ipv4EndPointDemux::AllocateEphemeralPort
uint16_t AllocateEphemeralPort(void)
Allocate an ephemeral port.
Definition:
ipv4-end-point-demux.cc:381
ns3::Ipv4EndPoint
A representation of an internet endpoint/connection.
Definition:
ipv4-end-point.h:49
ns3::Ipv4EndPointDemux::~Ipv4EndPointDemux
~Ipv4EndPointDemux()
Definition:
ipv4-end-point-demux.cc:37
ns3::Ipv4EndPointDemux::Allocate
Ipv4EndPoint * Allocate(void)
Allocate a Ipv4EndPoint.
Definition:
ipv4-end-point-demux.cc:79
Generated on Wed Nov 7 2018 10:01:54 for ns-3 by
1.8.14