ipv4-end-point-demux: add method to fetch list of all endpoints

GetAllEndPoints() will be used by the network simulation cradle.
After a wakeup event, all sockets (Endpoints) have to be checked
for state changes.
This commit is contained in:
Florian Westphal
2008-08-29 23:07:21 +02:00
parent 90c70d1a39
commit 11c4bec9e8
2 changed files with 19 additions and 0 deletions

View File

@@ -168,6 +168,24 @@ Ipv4EndPointDemux::DeAllocate (Ipv4EndPoint *endPoint)
}
}
/*
* return list of all available Endpoints
*/
Ipv4EndPointDemux::EndPoints
Ipv4EndPointDemux::GetAllEndPoints (void)
{
NS_LOG_FUNCTION_NOARGS ();
EndPoints ret;
for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
{
Ipv4EndPoint* endP = *i;
ret.push_back(endP);
}
return ret;
}
/*
* If we have an exact match, we return it.
* Otherwise, if we find a generic match, we return it.

View File

@@ -48,6 +48,7 @@ public:
Ipv4EndPointDemux ();
~Ipv4EndPointDemux ();
EndPoints GetAllEndPoints (void);
bool LookupPortLocal (uint16_t port);
bool LookupLocal (Ipv4Address addr, uint16_t port);
EndPoints Lookup (Ipv4Address daddr,