]> git.proxmox.com Git - mirror_frr.git/blame - pimd/pim_igmp_stats.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / pimd / pim_igmp_stats.c
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
21313cbf
MS
2/*
3 * PIM for FRRouting
4 * Copyright (C) 2018 Mladen Sablic
21313cbf
MS
5 */
6
b45ac5f5
DL
7#ifdef HAVE_CONFIG_H
8#include "config.h"
9#endif
10
21313cbf
MS
11#include "pim_igmp_stats.h"
12
13void igmp_stats_init(struct igmp_stats *stats)
14{
15 memset(stats, 0, sizeof(struct igmp_stats));
16}
17
18void igmp_stats_add(struct igmp_stats *a, struct igmp_stats *b)
19{
20 if (!a || !b)
21 return;
22
23 a->query_v1 += b->query_v1;
24 a->query_v2 += b->query_v2;
25 a->query_v3 += b->query_v3;
26 a->report_v1 += b->report_v1;
27 a->report_v2 += b->report_v2;
28 a->report_v3 += b->report_v3;
29 a->leave_v2 += b->leave_v2;
30 a->mtrace_rsp += b->mtrace_rsp;
31 a->mtrace_req += b->mtrace_req;
32 a->unsupported += b->unsupported;
3e5d8665 33 a->peak_groups += b->peak_groups;
1e02f2f9
DA
34 a->total_groups += b->total_groups;
35 a->total_source_groups += b->total_source_groups;
f2058cb4
DA
36 a->joins_sent += b->joins_sent;
37 a->joins_failed += b->joins_failed;
278912ea
DA
38 a->general_queries_sent += b->general_queries_sent;
39 a->group_queries_sent += b->group_queries_sent;
ca3e7807
DA
40 a->total_recv_messages += b->query_v1 + b->query_v2 + b->query_v3 +
41 b->report_v1 + b->report_v2 + b->report_v3 +
42 b->leave_v2 + b->mtrace_rsp + b->mtrace_req;
21313cbf 43}