public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCHv2] batman-adv: pass a 16bit long flag argument to tt_global_add()
@ 2013-04-18 12:57 Antonio Quartulli
  0 siblings, 0 replies; 3+ messages in thread
From: Antonio Quartulli @ 2013-04-18 12:57 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

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>
---

v2:
- added kernel doc



 translation-table.c | 19 +++++++++++++++++--
 translation-table.h |  2 +-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index 52808c4..bbda424 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -798,10 +798,25 @@ out:
 		batadv_tt_orig_list_entry_free_ref(orig_entry);
 }
 
-/* caller must hold orig_node refcount */
+/**
+ * batadv_tt_global_add - add a new TT global entry or update it
+ * @bat_priv: the bat priv with all the soft interface information
+ * @orig_node: the originator announcing the client
+ * @tt_addr: the MAC address of the client
+ * @flags: TT flags that have to be set for this client
+ * @ttvn: the first originator's TT version number having this client
+ *
+ * Add a new TT global entry for the given originator. If the entry already
+ * exists add a new reference to the given originator (a global entry can have
+ * references to multiple originators) and adjust the flags attribute to reflect
+ * the function argument.
+ * If a TT local entry exists for this client remove it.
+ *
+ * The caller must hold orig_node refcount.
+ */
 int batadv_tt_global_add(struct batadv_priv *bat_priv,
 			 struct batadv_orig_node *orig_node,
-			 const unsigned char *tt_addr, uint8_t flags,
+			 const unsigned char *tt_addr, uint16_t flags,
 			 uint8_t ttvn)
 {
 	struct batadv_tt_global_entry *tt_global_entry;
diff --git a/translation-table.h b/translation-table.h
index ab8e683..659a3bb 100644
--- a/translation-table.h
+++ b/translation-table.h
@@ -33,7 +33,7 @@ void batadv_tt_global_add_orig(struct batadv_priv *bat_priv,
 			       const unsigned char *tt_buff, int tt_buff_len);
 int batadv_tt_global_add(struct batadv_priv *bat_priv,
 			 struct batadv_orig_node *orig_node,
-			 const unsigned char *addr, uint8_t flags,
+			 const unsigned char *addr, uint16_t flags,
 			 uint8_t ttvn);
 int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset);
 void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [B.A.T.M.A.N.] [PATCHv2] batman-adv: pass a 16bit long flag argument to tt_global_add()
@ 2013-04-18 13:13 Antonio Quartulli
  2013-04-19 10:15 ` Marek Lindner
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Quartulli @ 2013-04-18 13:13 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

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>
---

v2:
- add tt_global_add() kernel doc

 translation-table.c | 19 +++++++++++++++++--
 translation-table.h |  2 +-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index 52808c4..bbda424 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -798,10 +798,25 @@ out:
 		batadv_tt_orig_list_entry_free_ref(orig_entry);
 }
 
-/* caller must hold orig_node refcount */
+/**
+ * batadv_tt_global_add - add a new TT global entry or update it
+ * @bat_priv: the bat priv with all the soft interface information
+ * @orig_node: the originator announcing the client
+ * @tt_addr: the MAC address of the client
+ * @flags: TT flags that have to be set for this client
+ * @ttvn: the first originator's TT version number having this client
+ *
+ * Add a new TT global entry for the given originator. If the entry already
+ * exists add a new reference to the given originator (a global entry can have
+ * references to multiple originators) and adjust the flags attribute to reflect
+ * the function argument.
+ * If a TT local entry exists for this client remove it.
+ *
+ * The caller must hold orig_node refcount.
+ */
 int batadv_tt_global_add(struct batadv_priv *bat_priv,
 			 struct batadv_orig_node *orig_node,
-			 const unsigned char *tt_addr, uint8_t flags,
+			 const unsigned char *tt_addr, uint16_t flags,
 			 uint8_t ttvn)
 {
 	struct batadv_tt_global_entry *tt_global_entry;
diff --git a/translation-table.h b/translation-table.h
index ab8e683..659a3bb 100644
--- a/translation-table.h
+++ b/translation-table.h
@@ -33,7 +33,7 @@ void batadv_tt_global_add_orig(struct batadv_priv *bat_priv,
 			       const unsigned char *tt_buff, int tt_buff_len);
 int batadv_tt_global_add(struct batadv_priv *bat_priv,
 			 struct batadv_orig_node *orig_node,
-			 const unsigned char *addr, uint8_t flags,
+			 const unsigned char *addr, uint16_t flags,
 			 uint8_t ttvn);
 int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset);
 void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: pass a 16bit long flag argument to tt_global_add()
  2013-04-18 13:13 [B.A.T.M.A.N.] [PATCHv2] batman-adv: pass a 16bit long flag argument to tt_global_add() Antonio Quartulli
@ 2013-04-19 10:15 ` Marek Lindner
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Lindner @ 2013-04-19 10:15 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

On Thursday, April 18, 2013 21:13:01 Antonio Quartulli wrote:
> 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>
> ---
> 
> v2:
> - add tt_global_add() kernel doc
> 
>  translation-table.c | 19 +++++++++++++++++--
>  translation-table.h |  2 +-
>  2 files changed, 18 insertions(+), 3 deletions(-)

Applied with minor rewording in revision 0ff0af1.

Cheers,
Marek

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-19 10:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-18 13:13 [B.A.T.M.A.N.] [PATCHv2] batman-adv: pass a 16bit long flag argument to tt_global_add() Antonio Quartulli
2013-04-19 10:15 ` Marek Lindner
  -- strict thread matches above, loose matches on Subject: below --
2013-04-18 12:57 Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox