blob: fe1281a716859d0ecbbc4893a13849d62891d249 [file] [log] [blame]
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00001/*
Sven Eckelmann567db7b2012-01-01 00:41:38 +01002 * Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00003 *
Antonio Quartulli35c133a2012-03-14 13:03:01 +01004 * Marek Lindner, Simon Wunderlich, Antonio Quartulli
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00005 *
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, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA
19 *
20 */
21
22#ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
23#define _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
24
Sven Eckelmann08c36d32012-05-12 02:09:39 +020025int batadv_tt_len(int changes_num);
26int batadv_tt_init(struct bat_priv *bat_priv);
27void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
28 int ifindex);
29void batadv_tt_local_remove(struct bat_priv *bat_priv,
30 const uint8_t *addr, const char *message,
31 bool roaming);
32int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset);
33void batadv_tt_global_add_orig(struct bat_priv *bat_priv,
34 struct orig_node *orig_node,
35 const unsigned char *tt_buff, int tt_buff_len);
36int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
37 const unsigned char *addr, uint8_t ttvn, bool roaming,
38 bool wifi);
39int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset);
40void batadv_tt_global_del_orig(struct bat_priv *bat_priv,
41 struct orig_node *orig_node,
42 const char *message);
43struct orig_node *batadv_transtable_search(struct bat_priv *bat_priv,
44 const uint8_t *src,
45 const uint8_t *addr);
46void batadv_tt_free(struct bat_priv *bat_priv);
47bool batadv_send_tt_response(struct bat_priv *bat_priv,
48 struct tt_query_packet *tt_request);
49bool batadv_is_my_client(struct bat_priv *bat_priv, const uint8_t *addr);
50void batadv_handle_tt_response(struct bat_priv *bat_priv,
51 struct tt_query_packet *tt_response);
52bool batadv_is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src,
53 uint8_t *dst);
54void batadv_tt_update_orig(struct bat_priv *bat_priv,
55 struct orig_node *orig_node,
56 const unsigned char *tt_buff, uint8_t tt_num_changes,
57 uint8_t ttvn, uint16_t tt_crc);
Marek Lindnerbe9aa4c2012-05-07 04:22:05 +080058int batadv_tt_append_diff(struct bat_priv *bat_priv,
59 unsigned char **packet_buff, int *packet_buff_len,
60 int packet_min_len);
Sven Eckelmann08c36d32012-05-12 02:09:39 +020061bool batadv_tt_global_client_is_roaming(struct bat_priv *bat_priv,
62 uint8_t *addr);
Antonio Quartulli3275e7c2012-03-16 18:03:28 +010063
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000064
65#endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */