ipv4-end-point-demux: add method to fetch list of all endpoints
authorFlorian Westphal <fw@strlen.de>
Fri Aug 29 23:07:21 2008 +0200 (17 months ago)
changeset 35984631eaaf84c4
parent 3586 728eb3f583b3
child 3599 e6374560e19e
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.
src/internet-stack/ipv4-end-point-demux.cc
src/internet-stack/ipv4-end-point-demux.h
     1.1 --- a/src/internet-stack/ipv4-end-point-demux.cc	Fri Aug 29 14:56:24 2008 +0100
     1.2 +++ b/src/internet-stack/ipv4-end-point-demux.cc	Fri Aug 29 23:07:21 2008 +0200
     1.3 @@ -169,6 +169,24 @@
     1.4  }
     1.5  
     1.6  /*
     1.7 + * return list of all available Endpoints
     1.8 + */
     1.9 +Ipv4EndPointDemux::EndPoints
    1.10 +Ipv4EndPointDemux::GetAllEndPoints (void)
    1.11 +{
    1.12 +  NS_LOG_FUNCTION_NOARGS ();
    1.13 +  EndPoints ret;
    1.14 +
    1.15 +  for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
    1.16 +   {
    1.17 +      Ipv4EndPoint* endP = *i;
    1.18 +      ret.push_back(endP);
    1.19 +    }
    1.20 +  return ret;
    1.21 +}
    1.22 +
    1.23 +
    1.24 +/*
    1.25   * If we have an exact match, we return it.
    1.26   * Otherwise, if we find a generic match, we return it.
    1.27   * Otherwise, we return 0.
     2.1 --- a/src/internet-stack/ipv4-end-point-demux.h	Fri Aug 29 14:56:24 2008 +0100
     2.2 +++ b/src/internet-stack/ipv4-end-point-demux.h	Fri Aug 29 23:07:21 2008 +0200
     2.3 @@ -48,6 +48,7 @@
     2.4    Ipv4EndPointDemux ();
     2.5    ~Ipv4EndPointDemux ();
     2.6  
     2.7 +  EndPoints GetAllEndPoints (void);
     2.8    bool LookupPortLocal (uint16_t port);
     2.9    bool LookupLocal (Ipv4Address addr, uint16_t port);
    2.10    EndPoints Lookup (Ipv4Address daddr,