xref: /openbmc/linux/net/batman-adv/translation-table.h (revision 56303d34a332be8e2f4daf7891ebc12cb7900529)
19cfc7bd6SSven Eckelmann /* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
2c6c8fea2SSven Eckelmann  *
335c133a0SAntonio Quartulli  * Marek Lindner, Simon Wunderlich, Antonio Quartulli
4c6c8fea2SSven Eckelmann  *
5c6c8fea2SSven Eckelmann  * This program is free software; you can redistribute it and/or
6c6c8fea2SSven Eckelmann  * modify it under the terms of version 2 of the GNU General Public
7c6c8fea2SSven Eckelmann  * License as published by the Free Software Foundation.
8c6c8fea2SSven Eckelmann  *
9c6c8fea2SSven Eckelmann  * This program is distributed in the hope that it will be useful, but
10c6c8fea2SSven Eckelmann  * WITHOUT ANY WARRANTY; without even the implied warranty of
11c6c8fea2SSven Eckelmann  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12c6c8fea2SSven Eckelmann  * General Public License for more details.
13c6c8fea2SSven Eckelmann  *
14c6c8fea2SSven Eckelmann  * You should have received a copy of the GNU General Public License
15c6c8fea2SSven Eckelmann  * along with this program; if not, write to the Free Software
16c6c8fea2SSven Eckelmann  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17c6c8fea2SSven Eckelmann  * 02110-1301, USA
18c6c8fea2SSven Eckelmann  */
19c6c8fea2SSven Eckelmann 
20c6c8fea2SSven Eckelmann #ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
21c6c8fea2SSven Eckelmann #define _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
22c6c8fea2SSven Eckelmann 
2308c36d3eSSven Eckelmann int batadv_tt_len(int changes_num);
24*56303d34SSven Eckelmann int batadv_tt_init(struct batadv_priv *bat_priv);
2508c36d3eSSven Eckelmann void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
26bc279080SAntonio Quartulli 			 int ifindex);
27*56303d34SSven Eckelmann void batadv_tt_local_remove(struct batadv_priv *bat_priv,
2808c36d3eSSven Eckelmann 			    const uint8_t *addr, const char *message,
2908c36d3eSSven Eckelmann 			    bool roaming);
3008c36d3eSSven Eckelmann int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset);
31*56303d34SSven Eckelmann void batadv_tt_global_add_orig(struct batadv_priv *bat_priv,
32*56303d34SSven Eckelmann 			       struct batadv_orig_node *orig_node,
33747e4221SSven Eckelmann 			       const unsigned char *tt_buff, int tt_buff_len);
34*56303d34SSven Eckelmann int batadv_tt_global_add(struct batadv_priv *bat_priv,
35*56303d34SSven Eckelmann 			 struct batadv_orig_node *orig_node,
36d4f44692SAntonio Quartulli 			 const unsigned char *addr, uint8_t flags,
37d4f44692SAntonio Quartulli 			 uint8_t ttvn);
3808c36d3eSSven Eckelmann int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset);
39*56303d34SSven Eckelmann void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
40*56303d34SSven Eckelmann 			       struct batadv_orig_node *orig_node,
4108c36d3eSSven Eckelmann 			       const char *message);
42*56303d34SSven Eckelmann struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv,
4308c36d3eSSven Eckelmann 						  const uint8_t *src,
4408c36d3eSSven Eckelmann 						  const uint8_t *addr);
45*56303d34SSven Eckelmann void batadv_tt_free(struct batadv_priv *bat_priv);
46*56303d34SSven Eckelmann bool batadv_send_tt_response(struct batadv_priv *bat_priv,
4796412690SSven Eckelmann 			     struct batadv_tt_query_packet *tt_request);
48*56303d34SSven Eckelmann bool batadv_is_my_client(struct batadv_priv *bat_priv, const uint8_t *addr);
49*56303d34SSven Eckelmann void batadv_handle_tt_response(struct batadv_priv *bat_priv,
5096412690SSven Eckelmann 			       struct batadv_tt_query_packet *tt_response);
51*56303d34SSven Eckelmann bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, uint8_t *src,
5208c36d3eSSven Eckelmann 			   uint8_t *dst);
53*56303d34SSven Eckelmann void batadv_tt_update_orig(struct batadv_priv *bat_priv,
54*56303d34SSven Eckelmann 			   struct batadv_orig_node *orig_node,
55a943cac1SMarek Lindner 			   const unsigned char *tt_buff, uint8_t tt_num_changes,
56a943cac1SMarek Lindner 			   uint8_t ttvn, uint16_t tt_crc);
57*56303d34SSven Eckelmann int batadv_tt_append_diff(struct batadv_priv *bat_priv,
58be9aa4c1SMarek Lindner 			  unsigned char **packet_buff, int *packet_buff_len,
59be9aa4c1SMarek Lindner 			  int packet_min_len);
60*56303d34SSven Eckelmann bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv,
6108c36d3eSSven Eckelmann 					uint8_t *addr);
623275e7ccSAntonio Quartulli 
63c6c8fea2SSven Eckelmann 
64c6c8fea2SSven Eckelmann #endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */
65