19f6446c7SSven Eckelmann /* Copyright (C) 2007-2015 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 15ebf38fb7SAntonio Quartulli * along with this program; if not, see <http://www.gnu.org/licenses/>. 16c6c8fea2SSven Eckelmann */ 17c6c8fea2SSven Eckelmann 18c6c8fea2SSven Eckelmann #ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ 19c6c8fea2SSven Eckelmann #define _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ 20c6c8fea2SSven Eckelmann 21*1e2c2a4fSSven Eckelmann #include "main.h" 22*1e2c2a4fSSven Eckelmann 23*1e2c2a4fSSven Eckelmann #include <linux/types.h> 24*1e2c2a4fSSven Eckelmann 25*1e2c2a4fSSven Eckelmann struct batadv_orig_node; 26*1e2c2a4fSSven Eckelmann struct batadv_priv; 27*1e2c2a4fSSven Eckelmann struct net_device; 28*1e2c2a4fSSven Eckelmann struct seq_file; 29*1e2c2a4fSSven Eckelmann 3056303d34SSven Eckelmann int batadv_tt_init(struct batadv_priv *bat_priv); 31a19d3d85SMarek Lindner bool batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, 329464d071SAntonio Quartulli unsigned short vid, int ifindex, uint32_t mark); 337f91d06cSAntonio Quartulli uint16_t batadv_tt_local_remove(struct batadv_priv *bat_priv, 34c018ad3dSAntonio Quartulli const uint8_t *addr, unsigned short vid, 35c018ad3dSAntonio Quartulli const char *message, bool roaming); 3608c36d3eSSven Eckelmann int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset); 3708c36d3eSSven Eckelmann int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset); 3856303d34SSven Eckelmann void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, 3956303d34SSven Eckelmann struct batadv_orig_node *orig_node, 4095fb130dSAntonio Quartulli int32_t match_vid, const char *message); 411d8ab8d3SLinus Lüssing int batadv_tt_global_hash_count(struct batadv_priv *bat_priv, 421d8ab8d3SLinus Lüssing const uint8_t *addr, unsigned short vid); 4356303d34SSven Eckelmann struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv, 4408c36d3eSSven Eckelmann const uint8_t *src, 45c018ad3dSAntonio Quartulli const uint8_t *addr, 46c018ad3dSAntonio Quartulli unsigned short vid); 4756303d34SSven Eckelmann void batadv_tt_free(struct batadv_priv *bat_priv); 48c018ad3dSAntonio Quartulli bool batadv_is_my_client(struct batadv_priv *bat_priv, const uint8_t *addr, 49c018ad3dSAntonio Quartulli unsigned short vid); 5056303d34SSven Eckelmann bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, uint8_t *src, 51b8cbd81dSAntonio Quartulli uint8_t *dst, unsigned short vid); 52e1bf0c14SMarek Lindner void batadv_tt_local_commit_changes(struct batadv_priv *bat_priv); 5356303d34SSven Eckelmann bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv, 54c018ad3dSAntonio Quartulli uint8_t *addr, unsigned short vid); 557c1fd91dSAntonio Quartulli bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv, 56c018ad3dSAntonio Quartulli uint8_t *addr, unsigned short vid); 57a19d3d85SMarek Lindner void batadv_tt_local_resize_to_mtu(struct net_device *soft_iface); 5830cfd02bSAntonio Quartulli bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv, 5930cfd02bSAntonio Quartulli struct batadv_orig_node *orig_node, 60c018ad3dSAntonio Quartulli const unsigned char *addr, 61c018ad3dSAntonio Quartulli unsigned short vid); 6242cb0befSAntonio Quartulli bool batadv_tt_global_is_isolated(struct batadv_priv *bat_priv, 6342cb0befSAntonio Quartulli const uint8_t *addr, unsigned short vid); 64c6c8fea2SSven Eckelmann 65c6c8fea2SSven Eckelmann #endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */ 66