1/*
2 * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef MC_ECM_H_
18#define MC_ECM_H_
19
20#include <linux/skbuff.h>
21#include <linux/types.h>
22
23/*
24 * Bridge destination interface list lookup for IPv4 multicast
25 * brdev	  - net_device of bridge
26 * origin	  ��� source unicast address
27 * group	  ��� multicast destination address
28 * max_dst	  - the size of the ���dst_dev��� array being passed in
29 * dst_dev	  - the array of ���ifindex��� for the destination interfaces, to be filled in by the callee
30 * Return	  - number of valid interfaces being returned in dst_dev
31 *				or negative on errors
32 */
33int mc_bridge_ipv4_get_if(struct net_device *brdev, __be32 origin, __be32 group,
34			  uint32_t max_dst, uint32_t dst_dev[]);
35
36/*
37 * Bridge snoop table update callback for IPv4
38 */
39typedef void (*mc_bridge_ipv4_update_callback_t)(struct net_device *brdev, uint32_t group);
40
41
42/*
43 * Bridge snoop table update callback registration functions
44 * Return	  - 0 on success, negative on errors
45 */
46int mc_bridge_ipv4_update_callback_register(mc_bridge_ipv4_update_callback_t snoop_event_cb);
47
48
49/*
50 * Bridge snoop table update callback deregistration functions
51 * Return	  - 0 on success, negative on errors
52 */
53int mc_bridge_ipv4_update_callback_deregister(void);
54
55/*
56 * Get the callback fuctions of IPv4
57 */
58mc_bridge_ipv4_update_callback_t mc_bridge_ipv4_update_callback_get(void);
59
60/*
61 * Bridge destination interface list lookup for IPv6 multicast
62 * brdev	  - net_device of bridge
63 * origin	  ��� source unicast address
64 * group	  ��� multicast destination address
65 * max_dst	  - the size of the ���dst_dev��� array being passed in
66 * dst_dev	  - the array of ���ifindex��� for the destination interfaces, to be filled in by the callee
67 * Return	  - number of valid interfaces being returned in dst_dev
68 *				or ngeative on errors
69 */
70int mc_bridge_ipv6_get_if(struct net_device *brdev, struct in6_addr *origin, struct in6_addr *group,
71			  uint32_t max_dst, uint32_t dst_dev[]);
72
73/*
74 * Bridge snoop table update callback for IPv4
75 */
76typedef void (*mc_bridge_ipv6_update_callback_t)(struct net_device *brdev, struct in6_addr *group);
77
78
79/*
80 * Bridge snoop table update callback registration functions
81 * Return	  - 0 on success, negative on errors
82 */
83int mc_bridge_ipv6_update_callback_register(mc_bridge_ipv6_update_callback_t snoop_event_cb);
84
85
86/*
87 * Bridge snoop table update callback deregistration functions
88 * Return	  - 0 on success, negative on errors
89 */
90int mc_bridge_ipv6_update_callback_deregister(void);
91
92
93/*
94 * Get the callback fuctions of IPv6
95 */
96mc_bridge_ipv6_update_callback_t mc_bridge_ipv6_update_callback_get(void);
97
98#endif /* MC_ECM_H_ */
99
100