public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: pass a 16bit long flag argument to tt_global_add()
@ 2013-04-16 18:22 Antonio Quartulli
  2013-04-16 18:22 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: move BATADV_TT_CLIENT_TEMP to higher bit Antonio Quartulli
  2013-04-18 12:38 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: pass a 16bit long flag argument to tt_global_add() Marek Lindner
  0 siblings, 2 replies; 4+ messages in thread
From: Antonio Quartulli @ 2013-04-16 18:22 UTC (permalink / raw)
  To: b.a.t.m.a.n

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

Based on top of the TVLV patches sent by Marek (but they may apply on maser as
well)

Cheers,

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

diff --git a/translation-table.c b/translation-table.c
index 5d99c64..c1a8a10 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -786,7 +786,7 @@ out:
 /* 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 597a5d6..b4b6dea 100644
--- a/translation-table.h
+++ b/translation-table.h
@@ -32,7 +32,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] 4+ messages in thread

* [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: move BATADV_TT_CLIENT_TEMP to higher bit
  2013-04-16 18:22 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: pass a 16bit long flag argument to tt_global_add() Antonio Quartulli
@ 2013-04-16 18:22 ` Antonio Quartulli
  2013-04-18 12:43   ` Marek Lindner
  2013-04-18 12:38 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: pass a 16bit long flag argument to tt_global_add() Marek Lindner
  1 sibling, 1 reply; 4+ messages in thread
From: Antonio Quartulli @ 2013-04-16 18:22 UTC (permalink / raw)
  To: b.a.t.m.a.n

Client flags from bit 0 to 7 are sent over the wire.
BATADV_TT_CLIENT_TEMP is not sent therefore it has occupy
an higher bit so to avoid wasting positions used by flags
sent within packets

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 packet.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packet.h b/packet.h
index e24daa6..5856994 100644
--- a/packet.h
+++ b/packet.h
@@ -106,10 +106,10 @@ enum batadv_tt_client_flags {
 	BATADV_TT_CLIENT_DEL     = BIT(0),
 	BATADV_TT_CLIENT_ROAM    = BIT(1),
 	BATADV_TT_CLIENT_WIFI    = BIT(2),
-	BATADV_TT_CLIENT_TEMP	 = BIT(3),
 	BATADV_TT_CLIENT_NOPURGE = BIT(8),
 	BATADV_TT_CLIENT_NEW     = BIT(9),
 	BATADV_TT_CLIENT_PENDING = BIT(10),
+	BATADV_TT_CLIENT_TEMP	 = BIT(11),
 };
 
 /* claim frame types for the bridge loop avoidance */
-- 
1.8.1.5


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

* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: pass a 16bit long flag argument to tt_global_add()
  2013-04-16 18:22 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: pass a 16bit long flag argument to tt_global_add() Antonio Quartulli
  2013-04-16 18:22 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: move BATADV_TT_CLIENT_TEMP to higher bit Antonio Quartulli
@ 2013-04-18 12:38 ` Marek Lindner
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2013-04-18 12:38 UTC (permalink / raw)
  To: b.a.t.m.a.n

On Wednesday, April 17, 2013 02:22:22 Antonio Quartulli wrote:
> @@ -786,7 +786,7 @@ out:
>  /* 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;

If you resubmit the patch with the missing kernel doc I will merge it.  :)

Cheers,
Marek

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

* Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: move BATADV_TT_CLIENT_TEMP to higher bit
  2013-04-16 18:22 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: move BATADV_TT_CLIENT_TEMP to higher bit Antonio Quartulli
@ 2013-04-18 12:43   ` Marek Lindner
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2013-04-18 12:43 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

On Wednesday, April 17, 2013 02:22:23 Antonio Quartulli wrote:
> Client flags from bit 0 to 7 are sent over the wire.
> BATADV_TT_CLIENT_TEMP is not sent therefore it has occupy
> an higher bit so to avoid wasting positions used by flags
> sent within packets
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> ---
>  packet.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Marek Lindner <lindner_marek@yahoo.de>

Cheers,
Marek

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

end of thread, other threads:[~2013-04-18 12:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-16 18:22 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: pass a 16bit long flag argument to tt_global_add() Antonio Quartulli
2013-04-16 18:22 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: move BATADV_TT_CLIENT_TEMP to higher bit Antonio Quartulli
2013-04-18 12:43   ` Marek Lindner
2013-04-18 12:38 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: pass a 16bit long flag argument to tt_global_add() Marek Lindner

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