--- zzzz-none-000/linux-5.4.213/include/linux/mroute6.h 2022-09-15 10:04:56.000000000 +0000 +++ miami-7690-761/linux-5.4.213/include/linux/mroute6.h 2024-05-29 11:20:02.000000000 +0000 @@ -93,10 +93,51 @@ #define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */ +#define IP6MR_MFC_EVENT_UPDATE 1 +#define IP6MR_MFC_EVENT_DELETE 2 + struct rtmsg; extern int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm, u32 portid); +/* + * Callback to registered modules in the event of updates to a multicast group + */ +typedef void (*ip6mr_mfc_event_offload_callback_t)(struct in6_addr *origin, + struct in6_addr *group, + u32 max_dest_dev, + u32 dest_dev_idx[], + uint8_t op); + +/* + * Register the callback used to inform offload modules when updates occur + * to MFC. The callback is registered by offload modules + */ +extern bool ip6mr_register_mfc_event_offload_callback( + ip6mr_mfc_event_offload_callback_t mfc_offload_cb); + +/* + * De-Register the callback used to inform offload modules when updates occur + * to MFC + */ +extern void ip6mr_unregister_mfc_event_offload_callback(void); + +/* + * Find the destination interface list given a multicast group and source + */ +extern int ip6mr_find_mfc_entry(struct net *net, struct in6_addr *origin, + struct in6_addr *group, u32 max_dst_cnt, + u32 dest_dev[]); + +/* + * Out-of-band multicast statistics update for flows that are offloaded from + * Linux + */ +extern int ip6mr_mfc_stats_update(struct net *net, struct in6_addr *origin, + struct in6_addr *group, uint64_t pkts_in, + uint64_t bytes_in, uint64_t pkts_out, + uint64_t bytes_out); + #ifdef CONFIG_IPV6_MROUTE bool mroute6_is_socket(struct net *net, struct sk_buff *skb); extern int ip6mr_sk_done(struct sock *sk);