--- zzzz-none-000/linux-4.4.271/include/linux/mroute.h 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/include/linux/mroute.h 2023-04-19 10:22:30.000000000 +0000 @@ -53,8 +53,8 @@ struct vif_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 */ @@ -98,10 +98,48 @@ #define MFC_HASH(a,b) (((((__force u32)(__be32)a)>>24)^(((__force u32)(__be32)b)>>26))&(MFC_LINES-1)) #else #define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1)) -#endif +#endif struct rtmsg; extern int ipmr_get_route(struct net *net, struct sk_buff *skb, __be32 saddr, __be32 daddr, struct rtmsg *rtm, int nowait, u32 portid); + +#define IPMR_MFC_EVENT_UPDATE 1 +#define IPMR_MFC_EVENT_DELETE 2 + +/* + * Callback to registered modules in the event of updates to a multicast group + */ +typedef void (*ipmr_mfc_event_offload_callback_t)(__be32 origin, __be32 group, + u32 max_dest_dev, + u32 dest_dev_idx[], + u8 op); + +/* + * Register the callback used to inform offload modules when updates occur to + * MFC. The callback is registered by offload modules + */ +extern bool ipmr_register_mfc_event_offload_callback( + ipmr_mfc_event_offload_callback_t mfc_offload_cb); + +/* + * De-Register the callback used to inform offload modules when updates occur + * to MFC + */ +extern void ipmr_unregister_mfc_event_offload_callback(void); + +/* + * Find the destination interface list, given a multicast group and source + */ +extern int ipmr_find_mfc_entry(struct net *net, __be32 origin, __be32 group, + u32 max_dst_cnt, u32 dest_dev[]); + +/* + * Out-of-band multicast statistics update for flows that are offloaded from + * Linux + */ +extern int ipmr_mfc_stats_update(struct net *net, __be32 origin, __be32 group, + u64 pkts_in, u64 bytes_in, + u64 pkts_out, u64 bytes_out); #endif