0001
0002
0003
0004
0005
0006
0007 #ifndef _NET_BATMAN_ADV_SEND_H_
0008 #define _NET_BATMAN_ADV_SEND_H_
0009
0010 #include "main.h"
0011
0012 #include <linux/compiler.h>
0013 #include <linux/skbuff.h>
0014 #include <linux/spinlock.h>
0015 #include <linux/types.h>
0016 #include <uapi/linux/batadv_packet.h>
0017
0018 void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet,
0019 bool dropped);
0020 struct batadv_forw_packet *
0021 batadv_forw_packet_alloc(struct batadv_hard_iface *if_incoming,
0022 struct batadv_hard_iface *if_outgoing,
0023 atomic_t *queue_left,
0024 struct batadv_priv *bat_priv,
0025 struct sk_buff *skb);
0026 bool batadv_forw_packet_steal(struct batadv_forw_packet *packet, spinlock_t *l);
0027 void batadv_forw_packet_ogmv1_queue(struct batadv_priv *bat_priv,
0028 struct batadv_forw_packet *forw_packet,
0029 unsigned long send_time);
0030 bool batadv_forw_packet_is_rebroadcast(struct batadv_forw_packet *forw_packet);
0031
0032 int batadv_send_skb_to_orig(struct sk_buff *skb,
0033 struct batadv_orig_node *orig_node,
0034 struct batadv_hard_iface *recv_if);
0035 int batadv_send_skb_packet(struct sk_buff *skb,
0036 struct batadv_hard_iface *hard_iface,
0037 const u8 *dst_addr);
0038 int batadv_send_broadcast_skb(struct sk_buff *skb,
0039 struct batadv_hard_iface *hard_iface);
0040 int batadv_send_unicast_skb(struct sk_buff *skb,
0041 struct batadv_neigh_node *neigh_node);
0042 int batadv_forw_bcast_packet(struct batadv_priv *bat_priv,
0043 struct sk_buff *skb,
0044 unsigned long delay,
0045 bool own_packet);
0046 void batadv_send_bcast_packet(struct batadv_priv *bat_priv,
0047 struct sk_buff *skb,
0048 unsigned long delay,
0049 bool own_packet);
0050 void
0051 batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
0052 const struct batadv_hard_iface *hard_iface);
0053 bool batadv_send_skb_prepare_unicast_4addr(struct batadv_priv *bat_priv,
0054 struct sk_buff *skb,
0055 struct batadv_orig_node *orig_node,
0056 int packet_subtype);
0057 int batadv_send_skb_unicast(struct batadv_priv *bat_priv,
0058 struct sk_buff *skb, int packet_type,
0059 int packet_subtype,
0060 struct batadv_orig_node *orig_node,
0061 unsigned short vid);
0062 int batadv_send_skb_via_tt_generic(struct batadv_priv *bat_priv,
0063 struct sk_buff *skb, int packet_type,
0064 int packet_subtype, u8 *dst_hint,
0065 unsigned short vid);
0066 int batadv_send_skb_via_gw(struct batadv_priv *bat_priv, struct sk_buff *skb,
0067 unsigned short vid);
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 static inline int batadv_send_skb_via_tt(struct batadv_priv *bat_priv,
0083 struct sk_buff *skb, u8 *dst_hint,
0084 unsigned short vid)
0085 {
0086 return batadv_send_skb_via_tt_generic(bat_priv, skb, BATADV_UNICAST, 0,
0087 dst_hint, vid);
0088 }
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105 static inline int batadv_send_skb_via_tt_4addr(struct batadv_priv *bat_priv,
0106 struct sk_buff *skb,
0107 int packet_subtype,
0108 u8 *dst_hint,
0109 unsigned short vid)
0110 {
0111 return batadv_send_skb_via_tt_generic(bat_priv, skb,
0112 BATADV_UNICAST_4ADDR,
0113 packet_subtype, dst_hint, vid);
0114 }
0115
0116 #endif