--- zzzz-none-000/linux-4.4.271/include/linux/mroute6.h 2021-06-03 06:22:09.000000000 +0000 +++ maple-fsgw-759/linux-4.4.271/include/linux/mroute6.h 2023-12-20 10:37:36.000000000 +0000 @@ -63,8 +63,8 @@ struct mif_device { struct net_device *dev; /* Device we are using */ - unsigned long bytes_in,bytes_out; - unsigned long pkt_in,pkt_out; /* Statistics */ + unsigned long long bytes_in,bytes_out; + unsigned long long pkt_in,pkt_out; /* Statistics */ unsigned long rate_limit; /* Traffic shaping (NI) */ unsigned char threshold; /* TTL threshold */ unsigned short flags; /* Control flags */ @@ -113,10 +113,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, int nowait, 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 extern struct sock *mroute6_socket(struct net *net, struct sk_buff *skb); extern int ip6mr_sk_done(struct sock *sk);