00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef IPV4_END_POINT_DEMUX_H
00022 #define IPV4_END_POINT_DEMUX_H
00023
00024 #include <stdint.h>
00025 #include <list>
00026 #include "ns3/ipv4-address.h"
00027 #include "ipv4-interface.h"
00028
00029 namespace ns3 {
00030
00031 class Ipv4EndPoint;
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 class Ipv4EndPointDemux {
00044 public:
00045 typedef std::list<Ipv4EndPoint *> EndPoints;
00046 typedef std::list<Ipv4EndPoint *>::iterator EndPointsI;
00047
00048 Ipv4EndPointDemux ();
00049 ~Ipv4EndPointDemux ();
00050
00051 EndPoints GetAllEndPoints (void);
00052 bool LookupPortLocal (uint16_t port);
00053 bool LookupLocal (Ipv4Address addr, uint16_t port);
00054 EndPoints Lookup (Ipv4Address daddr,
00055 uint16_t dport,
00056 Ipv4Address saddr,
00057 uint16_t sport,
00058 Ptr<Ipv4Interface> incomingInterface);
00059
00060 Ipv4EndPoint *SimpleLookup (Ipv4Address daddr,
00061 uint16_t dport,
00062 Ipv4Address saddr,
00063 uint16_t sport);
00064
00065 Ipv4EndPoint *Allocate (void);
00066 Ipv4EndPoint *Allocate (Ipv4Address address);
00067 Ipv4EndPoint *Allocate (uint16_t port);
00068 Ipv4EndPoint *Allocate (Ipv4Address address, uint16_t port);
00069 Ipv4EndPoint *Allocate (Ipv4Address localAddress,
00070 uint16_t localPort,
00071 Ipv4Address peerAddress,
00072 uint16_t peerPort);
00073
00074 void DeAllocate (Ipv4EndPoint *endPoint);
00075
00076 private:
00077 uint16_t AllocateEphemeralPort (void);
00078
00079 uint16_t m_ephemeral;
00080 EndPoints m_endPoints;
00081 };
00082
00083 }
00084
00085 #endif