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.
--- a/src/internet-stack/ipv4-end-point-demux.cc Fri Aug 29 14:56:24 2008 +0100
+++ b/src/internet-stack/ipv4-end-point-demux.cc Fri Aug 29 23:07:21 2008 +0200
@@ -169,6 +169,24 @@
}
/*
+ * 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.
* Otherwise, we return 0.
--- a/src/internet-stack/ipv4-end-point-demux.h Fri Aug 29 14:56:24 2008 +0100
+++ b/src/internet-stack/ipv4-end-point-demux.h Fri Aug 29 23:07:21 2008 +0200
@@ -48,6 +48,7 @@
Ipv4EndPointDemux ();
~Ipv4EndPointDemux ();
+ EndPoints GetAllEndPoints (void);
bool LookupPortLocal (uint16_t port);
bool LookupLocal (Ipv4Address addr, uint16_t port);
EndPoints Lookup (Ipv4Address daddr,