From bbcf82b3fcdc8240aa653252210d3005eb087d46 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Sat, 8 Feb 2020 22:00:57 +0100 Subject: conncheck: display priorities in debug by spliting their values We display 32-bit candidate priorities in hexadecimal to identify each 8-bit-aligned field more easily: type preference, local preference, and component id. We display 64-bit pair priority by splitting their local and remote part. See RFC-8445, section 5.1.2.1. "Recommended Formula", and section 6.1.2.3. "Computing Pair Priority and Ordering Pairs". --- agent/component.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'agent/component.c') diff --git a/agent/component.c b/agent/component.c index 10fb32b..43d4bdd 100644 --- a/agent/component.c +++ b/agent/component.c @@ -474,15 +474,17 @@ void nice_component_update_selected_pair (NiceAgent *agent, NiceComponent *component, const CandidatePair *pair) { NiceStream *stream; + gchar priority[NICE_CANDIDATE_PAIR_PRIORITY_MAX_SIZE]; g_assert (component); g_assert (pair); stream = agent_find_stream (agent, component->stream_id); - nice_debug ("setting SELECTED PAIR for component %u: %s:%s (prio:%" - G_GUINT64_FORMAT ").", component->id, pair->local->foundation, - pair->remote->foundation, pair->priority); + nice_candidate_pair_priority_to_string (pair->priority, priority); + nice_debug ("setting SELECTED PAIR for component %u: %s:%s (prio:%s).", + component->id, pair->local->foundation, + pair->remote->foundation, priority); if (component->selected_pair.local && component->selected_pair.local == component->turn_candidate) { -- cgit v1.2.1