summaryrefslogtreecommitdiff
path: root/net/bridge/br_private_mcast_eht.h
blob: bba507c9acb09d1fe10e3477fbf096e57dbdab04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* SPDX-License-Identifier: GPL-2.0-or-later
 * Copyright (c) 2020, Nikolay Aleksandrov <nikolay@nvidia.com>
 */
#ifndef _BR_PRIVATE_MCAST_EHT_H_
#define _BR_PRIVATE_MCAST_EHT_H_

union net_bridge_eht_addr {
	__be32				ip4;
#if IS_ENABLED(CONFIG_IPV6)
	struct in6_addr			ip6;
#endif
};

/* single host's list of set entries and filter_mode */
struct net_bridge_group_eht_host {
	struct rb_node			rb_node;

	union net_bridge_eht_addr	h_addr;
	struct hlist_head		set_entries;
	unsigned int			num_entries;
	unsigned char			filter_mode;
	struct net_bridge_port_group	*pg;
};

/* (host, src entry) added to a per-src set and host's list */
struct net_bridge_group_eht_set_entry {
	struct rb_node			rb_node;
	struct hlist_node		host_list;

	union net_bridge_eht_addr	h_addr;
	struct timer_list		timer;
	struct net_bridge		*br;
	struct net_bridge_group_eht_set	*eht_set;
	struct net_bridge_group_eht_host *h_parent;
	struct net_bridge_mcast_gc	mcast_gc;
};

/* per-src set */
struct net_bridge_group_eht_set {
	struct rb_node			rb_node;

	union net_bridge_eht_addr	src_addr;
	struct rb_root			entry_tree;
	struct timer_list		timer;
	struct net_bridge_port_group	*pg;
	struct net_bridge		*br;
	struct net_bridge_mcast_gc	mcast_gc;
};

void br_multicast_eht_clean_sets(struct net_bridge_port_group *pg);

#endif /* _BR_PRIVATE_MCAST_EHT_H_ */