10b873931SAntonio Quartulli /* Copyright (C) 2007-2013 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); 2456303d34SSven 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); 277f91d06cSAntonio Quartulli uint16_t 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); 3156303d34SSven Eckelmann void batadv_tt_global_add_orig(struct batadv_priv *bat_priv, 3256303d34SSven Eckelmann struct batadv_orig_node *orig_node, 33747e4221SSven Eckelmann const unsigned char *tt_buff, int tt_buff_len); 3456303d34SSven Eckelmann int batadv_tt_global_add(struct batadv_priv *bat_priv, 3556303d34SSven Eckelmann struct batadv_orig_node *orig_node, 36d4ff40f6SAntonio Quartulli const unsigned char *addr, uint16_t flags, 37d4f44692SAntonio Quartulli uint8_t ttvn); 3808c36d3eSSven Eckelmann int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset); 3956303d34SSven Eckelmann void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, 4056303d34SSven Eckelmann struct batadv_orig_node *orig_node, 4108c36d3eSSven Eckelmann const char *message); 4256303d34SSven 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); 4556303d34SSven Eckelmann void batadv_tt_free(struct batadv_priv *bat_priv); 4656303d34SSven Eckelmann bool batadv_send_tt_response(struct batadv_priv *bat_priv, 4796412690SSven Eckelmann struct batadv_tt_query_packet *tt_request); 4856303d34SSven Eckelmann bool batadv_is_my_client(struct batadv_priv *bat_priv, const uint8_t *addr); 4956303d34SSven Eckelmann void batadv_handle_tt_response(struct batadv_priv *bat_priv, 5096412690SSven Eckelmann struct batadv_tt_query_packet *tt_response); 5156303d34SSven Eckelmann bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, uint8_t *src, 5208c36d3eSSven Eckelmann uint8_t *dst); 53*e1bf0c14SMarek Lindner void batadv_tt_local_commit_changes(struct batadv_priv *bat_priv); 5456303d34SSven Eckelmann bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv, 5508c36d3eSSven Eckelmann uint8_t *addr); 567c1fd91dSAntonio Quartulli bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv, 577c1fd91dSAntonio Quartulli uint8_t *addr); 5830cfd02bSAntonio Quartulli bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv, 5930cfd02bSAntonio Quartulli struct batadv_orig_node *orig_node, 6030cfd02bSAntonio Quartulli const unsigned char *addr); 61c6c8fea2SSven Eckelmann 62c6c8fea2SSven Eckelmann #endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */ 63