| .. | .. |
|---|
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | | -/* Copyright (C) 2014-2018 B.A.T.M.A.N. contributors: |
|---|
| 2 | +/* Copyright (C) 2014-2020 B.A.T.M.A.N. contributors: |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Linus Lüssing |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of version 2 of the GNU General Public |
|---|
| 8 | | - * License as published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 11 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 13 | | - * General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | 5 | */ |
|---|
| 18 | 6 | |
|---|
| 19 | 7 | #ifndef _NET_BATMAN_ADV_MULTICAST_H_ |
|---|
| .. | .. |
|---|
| 21 | 9 | |
|---|
| 22 | 10 | #include "main.h" |
|---|
| 23 | 11 | |
|---|
| 24 | | -struct netlink_callback; |
|---|
| 25 | | -struct seq_file; |
|---|
| 26 | | -struct sk_buff; |
|---|
| 12 | +#include <linux/netlink.h> |
|---|
| 13 | +#include <linux/seq_file.h> |
|---|
| 14 | +#include <linux/skbuff.h> |
|---|
| 27 | 15 | |
|---|
| 28 | 16 | /** |
|---|
| 29 | 17 | * enum batadv_forw_mode - the way a packet should be forwarded as |
|---|
| .. | .. |
|---|
| 34 | 22 | * classic flooding) |
|---|
| 35 | 23 | */ |
|---|
| 36 | 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, |
|---|
| 37 | 32 | |
|---|
| 38 | 33 | /** |
|---|
| 39 | 34 | * @BATADV_FORW_SINGLE: forward the packet to a single node (currently |
|---|
| .. | .. |
|---|
| 49 | 44 | |
|---|
| 50 | 45 | enum batadv_forw_mode |
|---|
| 51 | 46 | batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb, |
|---|
| 52 | | - struct batadv_orig_node **mcast_single_orig); |
|---|
| 47 | + struct batadv_orig_node **mcast_single_orig, |
|---|
| 48 | + int *is_routable); |
|---|
| 53 | 49 | |
|---|
| 54 | 50 | int batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv, |
|---|
| 55 | 51 | struct sk_buff *skb, |
|---|
| 56 | 52 | unsigned short vid, |
|---|
| 57 | 53 | struct batadv_orig_node *orig_node); |
|---|
| 54 | + |
|---|
| 55 | +int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb, |
|---|
| 56 | + unsigned short vid, int is_routable); |
|---|
| 58 | 57 | |
|---|
| 59 | 58 | void batadv_mcast_init(struct batadv_priv *bat_priv); |
|---|
| 60 | 59 | |
|---|
| .. | .. |
|---|
| 73 | 72 | |
|---|
| 74 | 73 | static inline enum batadv_forw_mode |
|---|
| 75 | 74 | batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb, |
|---|
| 76 | | - struct batadv_orig_node **mcast_single_orig) |
|---|
| 75 | + struct batadv_orig_node **mcast_single_orig, |
|---|
| 76 | + int *is_routable) |
|---|
| 77 | 77 | { |
|---|
| 78 | 78 | return BATADV_FORW_ALL; |
|---|
| 79 | | -} |
|---|
| 80 | | - |
|---|
| 81 | | -static inline int batadv_mcast_init(struct batadv_priv *bat_priv) |
|---|
| 82 | | -{ |
|---|
| 83 | | - return 0; |
|---|
| 84 | 79 | } |
|---|
| 85 | 80 | |
|---|
| 86 | 81 | static inline int |
|---|
| .. | .. |
|---|
| 94 | 89 | } |
|---|
| 95 | 90 | |
|---|
| 96 | 91 | static inline int |
|---|
| 92 | +batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb, |
|---|
| 93 | + unsigned short vid, int is_routable) |
|---|
| 94 | +{ |
|---|
| 95 | + kfree_skb(skb); |
|---|
| 96 | + return NET_XMIT_DROP; |
|---|
| 97 | +} |
|---|
| 98 | + |
|---|
| 99 | +static inline int batadv_mcast_init(struct batadv_priv *bat_priv) |
|---|
| 100 | +{ |
|---|
| 101 | + return 0; |
|---|
| 102 | +} |
|---|
| 103 | + |
|---|
| 104 | +static inline int |
|---|
| 97 | 105 | batadv_mcast_mesh_info_put(struct sk_buff *msg, struct batadv_priv *bat_priv) |
|---|
| 98 | 106 | { |
|---|
| 99 | 107 | return 0; |
|---|