for (i = 0; i < num_trials; i++) { /* get next seq num from unreliable transport simulator */
ircvd = ut_next_index(&utc);
/* set ref to value of ircvd */
ref = ircvd;
/* estimate index based on low bits of ircvd */
delta = srtp_index_guess(&local, &est, (uint16_t)ref); #if ROC_VERBOSE
printf("ref: %lld, local: %lld, est: %lld, ircvd: %d, delta: %d\n", ref,
local, est, ircvd, delta); #endif
if (local + delta != est) {
printf(" *bad delta*: local %llu + delta %d != est %llu\n",
(unsignedlonglong)local, delta, (unsignedlonglong)est); return srtp_err_status_algo_fail;
}
/* now update local srtp_xtd_seq_num_t as necessary */ if (delta > 0)
srtp_index_advance(&local, delta);
if (ref != est) { #if ROC_VERBOSE
printf(" *bad estimate*\n"); #endif /* record failure event */
++num_bad_est;
/* reset local value to correct value */
local = ref;
}
}
failure_rate = (double)num_bad_est / num_trials; if (failure_rate > 0.01) {
printf("error: failure rate too high (%d bad estimates in %d trials)\n",
num_bad_est, num_trials); return srtp_err_status_algo_fail;
}
printf("done\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.