aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/main.h')
-rw-r--r--net/batman-adv/main.h62
1 files changed, 50 insertions, 12 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 24675523930f..d7dfafe45f29 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -20,8 +20,8 @@
20#ifndef _NET_BATMAN_ADV_MAIN_H_ 20#ifndef _NET_BATMAN_ADV_MAIN_H_
21#define _NET_BATMAN_ADV_MAIN_H_ 21#define _NET_BATMAN_ADV_MAIN_H_
22 22
23#define BATADV_DRIVER_AUTHOR "Marek Lindner <lindner_marek@yahoo.de>, " \ 23#define BATADV_DRIVER_AUTHOR "Marek Lindner <mareklindner@neomailbox.ch>, " \
24 "Simon Wunderlich <siwu@hrz.tu-chemnitz.de>" 24 "Simon Wunderlich <sw@simonwunderlich.de>"
25#define BATADV_DRIVER_DESC "B.A.T.M.A.N. advanced" 25#define BATADV_DRIVER_DESC "B.A.T.M.A.N. advanced"
26#define BATADV_DRIVER_DEVICE "batman-adv" 26#define BATADV_DRIVER_DEVICE "batman-adv"
27 27
@@ -86,8 +86,6 @@
86/* numbers of originator to contact for any PUT/GET DHT operation */ 86/* numbers of originator to contact for any PUT/GET DHT operation */
87#define BATADV_DAT_CANDIDATES_NUM 3 87#define BATADV_DAT_CANDIDATES_NUM 3
88 88
89#define BATADV_VIS_INTERVAL 5000 /* 5 seconds */
90
91/* how much worse secondary interfaces may be to be considered as bonding 89/* how much worse secondary interfaces may be to be considered as bonding
92 * candidates 90 * candidates
93 */ 91 */
@@ -133,6 +131,15 @@ enum batadv_uev_type {
133 131
134#define BATADV_GW_THRESHOLD 50 132#define BATADV_GW_THRESHOLD 50
135 133
134/* Number of fragment chains for each orig_node */
135#define BATADV_FRAG_BUFFER_COUNT 8
136/* Maximum number of fragments for one packet */
137#define BATADV_FRAG_MAX_FRAGMENTS 16
138/* Maxumim size of each fragment */
139#define BATADV_FRAG_MAX_FRAG_SIZE 1400
140/* Time to keep fragments while waiting for rest of the fragments */
141#define BATADV_FRAG_TIMEOUT 10000
142
136#define BATADV_DAT_CANDIDATE_NOT_FOUND 0 143#define BATADV_DAT_CANDIDATE_NOT_FOUND 0
137#define BATADV_DAT_CANDIDATE_ORIG 1 144#define BATADV_DAT_CANDIDATE_ORIG 1
138 145
@@ -160,15 +167,9 @@ enum batadv_uev_type {
160#include <net/rtnetlink.h> 167#include <net/rtnetlink.h>
161#include <linux/jiffies.h> 168#include <linux/jiffies.h>
162#include <linux/seq_file.h> 169#include <linux/seq_file.h>
163#include "types.h" 170#include <linux/if_vlan.h>
164 171
165/** 172#include "types.h"
166 * batadv_vlan_flags - flags for the four MSB of any vlan ID field
167 * @BATADV_VLAN_HAS_TAG: whether the field contains a valid vlan tag or not
168 */
169enum batadv_vlan_flags {
170 BATADV_VLAN_HAS_TAG = BIT(15),
171};
172 173
173#define BATADV_PRINT_VID(vid) (vid & BATADV_VLAN_HAS_TAG ? \ 174#define BATADV_PRINT_VID(vid) (vid & BATADV_VLAN_HAS_TAG ? \
174 (int)(vid & VLAN_VID_MASK) : -1) 175 (int)(vid & VLAN_VID_MASK) : -1)
@@ -184,6 +185,7 @@ void batadv_mesh_free(struct net_device *soft_iface);
184int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr); 185int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr);
185struct batadv_hard_iface * 186struct batadv_hard_iface *
186batadv_seq_print_text_primary_if_get(struct seq_file *seq); 187batadv_seq_print_text_primary_if_get(struct seq_file *seq);
188int batadv_max_header_len(void);
187void batadv_skb_set_priority(struct sk_buff *skb, int offset); 189void batadv_skb_set_priority(struct sk_buff *skb, int offset);
188int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev, 190int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
189 struct packet_type *ptype, 191 struct packet_type *ptype,
@@ -326,4 +328,40 @@ static inline uint64_t batadv_sum_counter(struct batadv_priv *bat_priv,
326 */ 328 */
327#define BATADV_SKB_CB(__skb) ((struct batadv_skb_cb *)&((__skb)->cb[0])) 329#define BATADV_SKB_CB(__skb) ((struct batadv_skb_cb *)&((__skb)->cb[0]))
328 330
331void batadv_tvlv_container_register(struct batadv_priv *bat_priv,
332 uint8_t type, uint8_t version,
333 void *tvlv_value, uint16_t tvlv_value_len);
334uint16_t batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv,
335 unsigned char **packet_buff,
336 int *packet_buff_len,
337 int packet_min_len);
338void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv,
339 struct batadv_ogm_packet *batadv_ogm_packet,
340 struct batadv_orig_node *orig_node);
341void batadv_tvlv_container_unregister(struct batadv_priv *bat_priv,
342 uint8_t type, uint8_t version);
343
344void batadv_tvlv_handler_register(struct batadv_priv *bat_priv,
345 void (*optr)(struct batadv_priv *bat_priv,
346 struct batadv_orig_node *orig,
347 uint8_t flags,
348 void *tvlv_value,
349 uint16_t tvlv_value_len),
350 int (*uptr)(struct batadv_priv *bat_priv,
351 uint8_t *src, uint8_t *dst,
352 void *tvlv_value,
353 uint16_t tvlv_value_len),
354 uint8_t type, uint8_t version, uint8_t flags);
355void batadv_tvlv_handler_unregister(struct batadv_priv *bat_priv,
356 uint8_t type, uint8_t version);
357int batadv_tvlv_containers_process(struct batadv_priv *bat_priv,
358 bool ogm_source,
359 struct batadv_orig_node *orig_node,
360 uint8_t *src, uint8_t *dst,
361 void *tvlv_buff, uint16_t tvlv_buff_len);
362void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, uint8_t *src,
363 uint8_t *dst, uint8_t type, uint8_t version,
364 void *tvlv_value, uint16_t tvlv_value_len);
365unsigned short batadv_get_vid(struct sk_buff *skb, size_t header_len);
366
329#endif /* _NET_BATMAN_ADV_MAIN_H_ */ 367#endif /* _NET_BATMAN_ADV_MAIN_H_ */