summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cleopatre/application/igmp_snoopd/src/igmp_v3.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/cleopatre/application/igmp_snoopd/src/igmp_v3.c b/cleopatre/application/igmp_snoopd/src/igmp_v3.c
index dd83147ddf..983677466b 100644
--- a/cleopatre/application/igmp_snoopd/src/igmp_v3.c
+++ b/cleopatre/application/igmp_snoopd/src/igmp_v3.c
@@ -118,6 +118,24 @@ compute_group_membership_interval (const struct v3_metrics *metrics)
}
/**
+ * Update the computed metrics.
+ *
+ * Some of the metrics are computed from the values of other metrics.
+ * This function updates these computed metrics.
+ *
+ * \param metrics The metrics.
+ */
+void
+update_computed_metrics (struct v3_metrics *metrics)
+{
+ metrics->other_querier_present_interval =
+ compute_other_querier_present_interval (metrics);
+
+ metrics->group_membership_interval =
+ compute_group_membership_interval (metrics);
+}
+
+/**
* Update some timers and timestamps in the group and member.
* They are used to keep track of (in)activity.
* \param grp The group.
@@ -205,11 +223,7 @@ init_v3 (struct v3_metrics *metrics)
metrics->robustness_variable = DEFAULT_ROBUSTNESS_VARIABLE;
metrics->query_interval = DEFAULT_QUERY_INTERVAL;
metrics->query_response_interval = DEFAULT_QUERY_RESPONSE_INTERVAL;
-
- metrics->other_querier_present_interval =
- compute_other_querier_present_interval (metrics);
- metrics->group_membership_interval =
- compute_group_membership_interval (metrics);
+ update_computed_metrics (metrics);
}
void
@@ -282,11 +296,7 @@ process_v3_query (struct context *ctx,
} /* the else case is already handled by a previous if in this function */
- ctx->metrics.other_querier_present_interval =
- compute_other_querier_present_interval (&ctx->metrics);
-
- ctx->metrics.group_membership_interval =
- compute_group_membership_interval (&ctx->metrics);
+ update_computed_metrics (&ctx->metrics);
}
/**