ns-allinone-2.35/ns-2.35/diffserv/dsPolicy.cc
double PolicyClassifier::getCBucket(const char*const* argv) {
  policyTableEntry *policy;
  
  policy = getPolicyTableEntry(atoi(argv[2]), atoi(argv[3]));
  if (policy == NULL) {
    printf("ERROR: cannot get bucket size; no existing policy found for Source %d-Desination %d.\n",
	   atoi(argv[2]), atoi(argv[3]));
    return(-1);
  }
  else {
    if ((policy->policer == tokenBucketPolicer) || (policy->policer == srTCMPolicer) || (policy->policer == trTCMPolicer))
      return(policy->cBucket);
    else {
      printf("ERROR: cannot get bucket size; the Source %d-Desination %d Policy does not include a Committed Bucket.\n", atoi(argv[2]), atoi(argv[3]));
      return(-1);
    }
  }
}
/*-----------------------------------------------------------------------------
Pre: The command line specifies a source and destination node for which a
  policy exists that uses a cBucket value.  That policy's cBucket parameter is
  currently valid.
Post: The policy's cBucket value is found and returned.
Returns: The value cBucket on success; or -1 on an error.
-----------------------------------------------------------------------------*/
The command line specifies a source and destination node for which a
policy exists that uses a cBucket value.  That policy's cBucket parameter is
currently valid.
Post: The policy's cBucket value is found and returned.
Returns: The value cBucket on success; or -1 on an error.
The command line specifies a source and destination node for which a policy exists that uses a cBucket value . That policy ' s cBucket parameter is currently valid . Post : The policy ' s cBucket value is found and returned . Returns : The value cBucket on success ; or - 1 on an error .
double PolicyClassifier::getCBucket(const char*const* argv) {
  policyTableEntry *policy;
  policy = getPolicyTableEntry(atoi(argv[2]), atoi(argv[3]));
  if (policy == NULL) {
    printf("ERROR: cannot get bucket size; no existing policy found for Source %d-Desination %d.\n",
	   atoi(argv[2]), atoi(argv[3]));
    return(-1);
  }
  else {
    if ((policy->policer == tokenBucketPolicer) || (policy->policer == srTCMPolicer) || (policy->policer == trTCMPolicer))
      return(policy->cBucket);
    else {
      printf("ERROR: cannot get bucket size; the Source %d-Desination %d Policy does not include a Committed Bucket.\n", atoi(argv[2]), atoi(argv[3]));
      return(-1);
    }
  }
}
double PolicyClassifier :: getCBucket ( const char * const * argv ) { policyTableEntry * policy ; policy = getPolicyTableEntry ( atoi ( argv [ 2 ] ) , atoi ( argv [ 3 ] ) ) ; if ( policy == NULL ) { printf ( " \n " , atoi ( argv [ 2 ] ) , atoi ( argv [ 3 ] ) ) ; return ( -1 ) ; } else { if ( ( policy -> policer == tokenBucketPolicer ) || ( policy -> policer == srTCMPolicer ) || ( policy -> policer == trTCMPolicer ) ) return ( policy -> cBucket ) ; else { printf ( " \n " , atoi ( argv [ 2 ] ) , atoi ( argv [ 3 ] ) ) ; return ( -1 ) ; } } }
Pre: The command line specifies a source and destination node for which a
policy exists that uses a cBucket value.
Pre : The command line specifies a source and destination node for which a policy exists that uses a cBucket value .