A Discrete-Event Network Simulator
API
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 
41 {
42  public:
46  typedef std::list<Ipv6EndPoint*> EndPoints;
47 
51  typedef std::list<Ipv6EndPoint*>::iterator EndPointsI;
52 
55 
61  bool LookupPortLocal(uint16_t port);
62 
70  bool LookupLocal(Ptr<NetDevice> boundNetDevice, Ipv6Address addr, uint16_t port);
71 
91  uint16_t dport,
92  Ipv6Address src,
93  uint16_t sport,
94  Ptr<Ipv6Interface> incomingInterface);
95 
104  Ipv6EndPoint* SimpleLookup(Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport);
105 
111 
118 
125  Ipv6EndPoint* Allocate(Ptr<NetDevice> boundNetDevice, uint16_t port);
126 
134  Ipv6EndPoint* Allocate(Ptr<NetDevice> boundNetDevice, Ipv6Address address, uint16_t port);
135 
145  Ipv6EndPoint* Allocate(Ptr<NetDevice> boundNetDevice,
146  Ipv6Address localAddress,
147  uint16_t localPort,
148  Ipv6Address peerAddress,
149  uint16_t peerPort);
150 
155  void DeAllocate(Ipv6EndPoint* endPoint);
156 
161  EndPoints GetEndPoints() const;
162 
163  private:
168  uint16_t AllocateEphemeralPort();
169 
173  uint16_t m_ephemeral;
174 
178  uint16_t m_portFirst;
179 
183  uint16_t m_portLast;
184 
189 };
190 
191 } /* namespace ns3 */
192 
193 #endif /* IPV6_END_POINT_DEMUX_H */
Describes an IPv6 address.
Definition: ipv6-address.h:49
Demultiplexer for end points.
EndPoints Lookup(Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport, Ptr< Ipv6Interface > incomingInterface)
lookup for a match with all the parameters.
Ipv6EndPoint * Allocate()
Allocate a Ipv6EndPoint.
bool LookupLocal(Ptr< NetDevice > boundNetDevice, Ipv6Address addr, uint16_t port)
Lookup for address and port.
EndPoints m_endPoints
A list of IPv6 end points.
uint16_t m_ephemeral
The ephemeral port.
std::list< Ipv6EndPoint * >::iterator EndPointsI
Iterator to the container of the IPv6 endpoints.
EndPoints GetEndPoints() const
Get the entire list of end points registered.
Ipv6EndPoint * SimpleLookup(Ipv6Address dst, uint16_t dport, Ipv6Address src, uint16_t sport)
Simple lookup for a four-tuple match.
bool LookupPortLocal(uint16_t port)
Lookup for port local.
uint16_t AllocateEphemeralPort()
Allocate a ephemeral port.
uint16_t m_portFirst
The first ephemeral port.
uint16_t m_portLast
The last ephemeral port.
void DeAllocate(Ipv6EndPoint *endPoint)
Remove a end point.
std::list< Ipv6EndPoint * > EndPoints
Container of the IPv6 endpoints.
A representation of an IPv6 endpoint/connection.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
uint16_t port
Definition: dsdv-manet.cc:44
address
Definition: first.py:47
Every class exported by the ns3 library is enclosed in the ns3 namespace.