batman-adv: unify flags for tt_change/tt_local_entry/tt_global_entry

The tt_local_entry structure now has a 'flags' field. This helps to
unify the flags format to all the client related structures (tt_global_entry
and tt_change). The 'never_purge' field is now encoded in the 'flags' one.
To optimise the usage of this field, its length has been increased to 16bit
in order to use the eight leading bits (from 0 to 7) to store flags that
have to be sent on the wire, while the eight ending ones are used for local
computation only.

Moreover 'enum tt_change_flags' is now called 'enum tt_client_flags' and the
defined values apply to the tt_local_entry, tt_global_entry and the tt_change
'flags' field.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
This commit is contained in:
Antonio Quartulli
2011-06-17 16:11:27 +02:00
committed by Marek Lindner
父節點 43676ab590
當前提交 5fbc1598c2
共有 4 個文件被更改,包括 16 次插入15 次删除

查看文件

@@ -78,10 +78,13 @@ enum tt_query_flags {
TT_FULL_TABLE = 1 << 2
};
/* TT_CHANGE flags */
enum tt_change_flags {
TT_CHANGE_DEL = 0x01,
TT_CLIENT_ROAM = 0x02
/* TT_CLIENT flags.
* Flags from 1 to 1 << 7 are sent on the wire, while flags from 1 << 8 to
* 1 << 15 are used for local computation only */
enum tt_client_flags {
TT_CLIENT_DEL = 1 << 0,
TT_CLIENT_ROAM = 1 << 1,
TT_CLIENT_NOPURGE = 1 << 8
};
struct batman_packet {