NSIS-ka
A free C++ implementation of NSIS protocols

Changeset 4531


Ignore:
Timestamp:
Oct 8, 2009, 5:22:51 PM (8 years ago)
Author:
stud-lenk
Message:

Prepare code for networknotification to NSLP in case a multicast peer has been added

Location:
ntlp/branches/20090723-multicast/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ntlp/branches/20090723-multicast/src/ntlp_statemodule_querier.cpp

    r4498 r4531  
    10391039      if (r_entry->get_state() == qn_established) {
    10401040        if (r_entry->is_multicast_QNode()) {
     1041          if ( r_entry->get_new_multicast_peers_added() )
     1042          {
     1043            DLog(param.name, "New multicast peers were added, notifying NSLP (not yet implemented)");
     1044            // TODO MULTICAST:
     1045            // We have to notify the NSLP about the new multicast peer.
     1046            // As commented in http://projekte.tm.uka.de/trac/NSIS/ticket/126
     1047            // we should indicate that Rerouting occurred.
     1048          }
    10411049          DLog(param.name, "This node is a multicasting QN in state ESTABLISHED. Purging unresponsive peers now.");
    10421050          r_entry->purge_multicast_peers();
  • ntlp/branches/20090723-multicast/src/routingentry.cpp

    r4521 r4531  
    135135}
    136136
     137
     138/** add a multicast peer to the routing entry
     139 *
     140 * this adds the multicast peer identified by the specified NLI to the routing entry
     141 * or marks it as having responded to the last query if it already existed.
     142 * If a new peer has been added to the list of multicast peers the flag
     143 * new_multicast_peers_added is set to true.
     144 *
     145 * @param       nli pointer to NLI identifying the multicast peer to be added
     146 */
     147
    137148void
    138149routingentry::add_multicast_peer(const nli* peer)
     
    149160    multicast_peers[*peer] = status;
    150161    DLog("MulticastQN", "Multicast peer " << peer->get_if_address() << " added");
     162    new_multicast_peers_added = true;
    151163  } else {
    152164    // this is a known multicast peer -- just re-activate it
     
    159171routingentry::expire_multicast_peers()
    160172{
     173  new_multicast_peers_added = false;
    161174  if (!is_multicast_QNode()) { ERRCLog("expire_multicast_peers()", color[red] << "Not a multicast QNode -- skipping" << color[off]); return; }
    162175  mcast_peer_list_t::iterator it;
     
    197210      DLog("purge_multicast_peers()", "Multicast peer " << erase_candidate->first.get_if_address() << " purged");
    198211      multicast_peers.erase(erase_candidate);
    199 
    200       // TODO MULTICAST:
    201       // Do we need to do a networknotification() to NSLP???
    202 
    203212    } else {
    204213      if (it->second.missed_responses != 0) {
  • ntlp/branches/20090723-multicast/src/routingentry.h

    r4520 r4531  
    154154          peer_nli(n.peer_nli ? n.peer_nli->copy() : NULL),
    155155          is_multicast_querier(n.is_multicast_querier),
     156          new_multicast_peers_added(false),     // NOTE: not a true copy
    156157          ma_reuse(false),
    157158          local_src(n.local_src ? n.local_src->copy() : NULL),
     
    329330        void set_multicast_querier(bool new_mq = true) { is_multicast_querier = is_querying_node() ? new_mq : false; }
    330331        bool is_multicast_QNode() const;
     332        bool get_new_multicast_peers_added() const { return new_multicast_peers_added; }
     333        // adds a multicast peer or marks the given multicast peer as active
    331334        void add_multicast_peer(const nli* nli);
    332335        void expire_multicast_peers();
     
    360363  // key for each multicast_peerstatus: NLI
    361364  mcast_peer_list_t multicast_peers;
     365  // set to true whenever a new multicast peer is added and
     366  // set to false whenever expire_multicast_peers() is called
     367  bool new_multicast_peers_added;
    362368
    363369  // MA re-use requested by peer (unicast only)
     
    446452    peer_nli(NULL),
    447453    is_multicast_querier(false),
     454    new_multicast_peers_added(false),
    448455    ma_reuse(false),
    449456    local_src(NULL),
Note: See TracChangeset for help on using the changeset viewer.