blob: 659a3bb759ce87087c4d5697239f4724c815971c [file] [log] [blame]
Antonio Quartulli0b873932013-01-04 03:05:31 +01001/* Copyright (C) 2007-2013 B.A.T.M.A.N. contributors:
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00002 *
Antonio Quartulli35c133a2012-03-14 13:03:01 +01003 * Marek Lindner, Simon Wunderlich, Antonio Quartulli
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00004 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000018 */
19
20#ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
21#define _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
22
Sven Eckelmann08c36d32012-05-12 02:09:39 +020023int batadv_tt_len(int changes_num);
Sven Eckelmann56303d32012-06-05 22:31:31 +020024int batadv_tt_init(struct batadv_priv *bat_priv);
Sven Eckelmann08c36d32012-05-12 02:09:39 +020025void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
26 int ifindex);
Antonio Quartulli7f91d062012-08-27 11:44:43 +020027uint16_t batadv_tt_local_remove(struct batadv_priv *bat_priv,
28 const uint8_t *addr, const char *message,
29 bool roaming);
Sven Eckelmann08c36d32012-05-12 02:09:39 +020030int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset);
Sven Eckelmann56303d32012-06-05 22:31:31 +020031void batadv_tt_global_add_orig(struct batadv_priv *bat_priv,
32 struct batadv_orig_node *orig_node,
Sven Eckelmann08c36d32012-05-12 02:09:39 +020033 const unsigned char *tt_buff, int tt_buff_len);
Sven Eckelmann56303d32012-06-05 22:31:31 +020034int batadv_tt_global_add(struct batadv_priv *bat_priv,
35 struct batadv_orig_node *orig_node,
Antonio Quartullid4ff40f2013-04-18 15:13:01 +020036 const unsigned char *addr, uint16_t flags,
Antonio Quartullid4f44692012-05-25 00:00:54 +020037 uint8_t ttvn);
Sven Eckelmann08c36d32012-05-12 02:09:39 +020038int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset);
Sven Eckelmann56303d32012-06-05 22:31:31 +020039void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
40 struct batadv_orig_node *orig_node,
Sven Eckelmann08c36d32012-05-12 02:09:39 +020041 const char *message);
Sven Eckelmann56303d32012-06-05 22:31:31 +020042struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv,
43 const uint8_t *src,
44 const uint8_t *addr);
45void batadv_tt_free(struct batadv_priv *bat_priv);
46bool batadv_send_tt_response(struct batadv_priv *bat_priv,
Sven Eckelmann96412692012-06-05 22:31:30 +020047 struct batadv_tt_query_packet *tt_request);
Sven Eckelmann56303d32012-06-05 22:31:31 +020048bool batadv_is_my_client(struct batadv_priv *bat_priv, const uint8_t *addr);
49void batadv_handle_tt_response(struct batadv_priv *bat_priv,
Sven Eckelmann96412692012-06-05 22:31:30 +020050 struct batadv_tt_query_packet *tt_response);
Sven Eckelmann56303d32012-06-05 22:31:31 +020051bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, uint8_t *src,
Sven Eckelmann08c36d32012-05-12 02:09:39 +020052 uint8_t *dst);
Sven Eckelmann56303d32012-06-05 22:31:31 +020053void batadv_tt_update_orig(struct batadv_priv *bat_priv,
54 struct batadv_orig_node *orig_node,
Sven Eckelmann08c36d32012-05-12 02:09:39 +020055 const unsigned char *tt_buff, uint8_t tt_num_changes,
56 uint8_t ttvn, uint16_t tt_crc);
Sven Eckelmann56303d32012-06-05 22:31:31 +020057int batadv_tt_append_diff(struct batadv_priv *bat_priv,
Marek Lindnerbe9aa4c2012-05-07 04:22:05 +080058 unsigned char **packet_buff, int *packet_buff_len,
59 int packet_min_len);
Sven Eckelmann56303d32012-06-05 22:31:31 +020060bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv,
Sven Eckelmann08c36d32012-05-12 02:09:39 +020061 uint8_t *addr);
Antonio Quartulli7c1fd912012-09-23 22:38:34 +020062bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv,
63 uint8_t *addr);
Antonio Quartulli30cfd022012-07-05 23:38:29 +020064bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv,
65 struct batadv_orig_node *orig_node,
66 const unsigned char *addr);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000067
68#endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */