ns-allinone-2.35/ns-2.35/diffserv/dsPolicy.cc
policyTableEntry* PolicyClassifier::getPolicyTableEntry(nsaddr_t source, nsaddr_t dest) {
  for (int i = 0; i <= policyTableSize; i++) {
    if ((policyTable[i].sourceNode == source) || (policyTable[i].sourceNode == ANY_HOST)) {
      if ((policyTable[i].destNode == dest) || (policyTable[i].destNode == ANY_HOST))
	return(&policyTable[i]);
    }
  }
  
  // !!! Could make a default code point for undefined flows:
  printf("ERROR: No Policy Table entry found for Source %d-Destination %d.\n", source, dest);
  printPolicyTable();
  return(NULL);
}
/*-----------------------------------------------------------------------------
policyTableEntry* PolicyClassifier::getPolicyTableEntry(long source, long dest)
Pre: policyTable holds exactly one entry for the specified source-dest pair.
Post: Finds the policyTable array that matches the specified source-dest pair.
Returns: On success, returns a pointer to the corresponding policyTableEntry;
  on failure, returns NULL.
Note: the source-destination pair could be one-any or any-any (xuanc)
-----------------------------------------------------------------------------*/
policyTableEntry* PolicyClassifier::getPolicyTableEntry(long source, long dest)
Pre: policyTable holds exactly one entry for the specified source-dest pair.
Post: Finds the policyTable array that matches the specified source-dest pair.
Returns: On success, returns a pointer to the corresponding policyTableEntry;
on failure, returns NULL.
Note: the source-destination pair could be one-any or any-any (xuanc)
policyTableEntry * PolicyClassifier :: getPolicyTableEntry ( long source long dest ) Pre : policyTable holds exactly one entry for the specified source - dest pair . Post : Finds the policyTable array that matches the specified source - dest pair . Returns : On success returns a pointer to the corresponding policyTableEntry ; on failure returns NULL . Note : the source - destination pair could be one - any or any - any ( xuanc )
policyTableEntry* PolicyClassifier::getPolicyTableEntry(nsaddr_t source, nsaddr_t dest) {
  for (int i = 0; i <= policyTableSize; i++) {
    if ((policyTable[i].sourceNode == source) || (policyTable[i].sourceNode == ANY_HOST)) {
      if ((policyTable[i].destNode == dest) || (policyTable[i].destNode == ANY_HOST))
	return(&policyTable[i]);
    }
  }
  printf("ERROR: No Policy Table entry found for Source %d-Destination %d.\n", source, dest);
  printPolicyTable();
  return(NULL);
}
policyTableEntry * PolicyClassifier :: getPolicyTableEntry ( nsaddr_t source , nsaddr_t dest ) { for ( int i = 0 ; i <= policyTableSize ; i ++ ) { if ( ( policyTable [ i ] . sourceNode == source ) || ( policyTable [ i ] . sourceNode == ANY_HOST ) ) { if ( ( policyTable [ i ] . destNode == dest ) || ( policyTable [ i ] . destNode == ANY_HOST ) ) return ( & policyTable [ i ] ) ; } } printf ( " \n " , source , dest ) ; printPolicyTable ( ) ; return ( NULL ) ; }
policyTableEntry* PolicyClassifier::getPolicyTableEntry(long source, long dest)
Pre: policyTable holds exactly one entry for the specified source-dest pair.
policyTableEntry * PolicyClassifier :: getPolicyTableEntry ( long source long dest ) Pre : policyTable holds exactly one entry for the specified source - dest pair .
// !!! Could make a default code point for undefined flows: