diff options
author | Antonio Quartulli <ordex@autistici.org> | 2013-04-18 09:13:01 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2013-05-28 20:44:55 -0400 |
commit | d4ff40f683221d46c351cd9ab61f37a6ea5d2444 (patch) | |
tree | 948643240098a2df06425b2d4b49b45c740e2f5a /net/batman-adv | |
parent | 41ab6c4891ed4cdd855ae569924acb1da424a614 (diff) |
batman-adv: pass a 16bit long flag argument to tt_global_add()
it may be the case that we want to store some local TT client flags in a global
entry, therefore the tt_global_add needs to get a proper argument for this
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/translation-table.c | 19 | ||||
-rw-r--r-- | net/batman-adv/translation-table.h | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 52808c4ae081..e272f68e1b08 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -798,10 +798,25 @@ out: | |||
798 | batadv_tt_orig_list_entry_free_ref(orig_entry); | 798 | batadv_tt_orig_list_entry_free_ref(orig_entry); |
799 | } | 799 | } |
800 | 800 | ||
801 | /* caller must hold orig_node refcount */ | 801 | /** |
802 | * batadv_tt_global_add - add a new TT global entry or update an existing one | ||
803 | * @bat_priv: the bat priv with all the soft interface information | ||
804 | * @orig_node: the originator announcing the client | ||
805 | * @tt_addr: the mac address of the non-mesh client | ||
806 | * @flags: TT flags that have to be set for this non-mesh client | ||
807 | * @ttvn: the tt version number ever announcing this non-mesh client | ||
808 | * | ||
809 | * Add a new TT global entry for the given originator. If the entry already | ||
810 | * exists add a new reference to the given originator (a global entry can have | ||
811 | * references to multiple originators) and adjust the flags attribute to reflect | ||
812 | * the function argument. | ||
813 | * If a TT local entry exists for this non-mesh client remove it. | ||
814 | * | ||
815 | * The caller must hold orig_node refcount. | ||
816 | */ | ||
802 | int batadv_tt_global_add(struct batadv_priv *bat_priv, | 817 | int batadv_tt_global_add(struct batadv_priv *bat_priv, |
803 | struct batadv_orig_node *orig_node, | 818 | struct batadv_orig_node *orig_node, |
804 | const unsigned char *tt_addr, uint8_t flags, | 819 | const unsigned char *tt_addr, uint16_t flags, |
805 | uint8_t ttvn) | 820 | uint8_t ttvn) |
806 | { | 821 | { |
807 | struct batadv_tt_global_entry *tt_global_entry; | 822 | struct batadv_tt_global_entry *tt_global_entry; |
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h index ab8e683b402f..659a3bb759ce 100644 --- a/net/batman-adv/translation-table.h +++ b/net/batman-adv/translation-table.h | |||
@@ -33,7 +33,7 @@ void batadv_tt_global_add_orig(struct batadv_priv *bat_priv, | |||
33 | const unsigned char *tt_buff, int tt_buff_len); | 33 | const unsigned char *tt_buff, int tt_buff_len); |
34 | int batadv_tt_global_add(struct batadv_priv *bat_priv, | 34 | int batadv_tt_global_add(struct batadv_priv *bat_priv, |
35 | struct batadv_orig_node *orig_node, | 35 | struct batadv_orig_node *orig_node, |
36 | const unsigned char *addr, uint8_t flags, | 36 | const unsigned char *addr, uint16_t flags, |
37 | uint8_t ttvn); | 37 | uint8_t ttvn); |
38 | int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset); | 38 | int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset); |
39 | void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, | 39 | void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, |