~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/batman-adv/multicast.h

Version: ~ [ linux-5.19-rc3 ] ~ [ linux-5.18.5 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.48 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.123 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.199 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.248 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.284 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.319 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp