Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /* Copyright (C) 2014-2020  B.A.T.M.A.N. contributors:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Linus Lüssing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #ifndef _NET_BATMAN_ADV_MULTICAST_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #define _NET_BATMAN_ADV_MULTICAST_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include "main.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/netlink.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/seq_file.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  * enum batadv_forw_mode - the way a packet should be forwarded as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) enum batadv_forw_mode {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	/**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	 * @BATADV_FORW_ALL: forward the packet to all nodes (currently via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	 *  classic flooding)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	BATADV_FORW_ALL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	/**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	 * @BATADV_FORW_SOME: forward the packet to some nodes (currently via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	 *  a multicast-to-unicast conversion and the BATMAN unicast routing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	 *  protocol)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	BATADV_FORW_SOME,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	/**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	 * @BATADV_FORW_SINGLE: forward the packet to a single node (currently
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	 *  via the BATMAN unicast routing protocol)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	BATADV_FORW_SINGLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	/** @BATADV_FORW_NONE: don't forward, drop it */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	BATADV_FORW_NONE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #ifdef CONFIG_BATMAN_ADV_MCAST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) enum batadv_forw_mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		       struct batadv_orig_node **mcast_single_orig,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 		       int *is_routable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) int batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 				struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 				unsigned short vid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 				struct batadv_orig_node *orig_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 			   unsigned short vid, int is_routable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) void batadv_mcast_init(struct batadv_priv *bat_priv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) int batadv_mcast_mesh_info_put(struct sk_buff *msg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 			       struct batadv_priv *bat_priv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) int batadv_mcast_flags_dump(struct sk_buff *msg, struct netlink_callback *cb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) void batadv_mcast_free(struct batadv_priv *bat_priv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) static inline enum batadv_forw_mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		       struct batadv_orig_node **mcast_single_orig,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		       int *is_routable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	return BATADV_FORW_ALL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			    struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 			    unsigned short vid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			    struct batadv_orig_node *orig_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	kfree_skb(skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	return NET_XMIT_DROP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		       unsigned short vid, int is_routable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	kfree_skb(skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	return NET_XMIT_DROP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) static inline int batadv_mcast_init(struct batadv_priv *bat_priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) batadv_mcast_mesh_info_put(struct sk_buff *msg, struct batadv_priv *bat_priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) static inline int batadv_mcast_flags_dump(struct sk_buff *msg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 					  struct netlink_callback *cb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	return -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) static inline void batadv_mcast_free(struct batadv_priv *bat_priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) static inline void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #endif /* CONFIG_BATMAN_ADV_MCAST */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #endif /* _NET_BATMAN_ADV_MULTICAST_H_ */