batctl; branch, master, updated. v2011.1.0-25-g2499494
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 24994940e1e8770530c63751a99b4dd82390f1e4
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Tue May 10 19:17:59 2011 +0200
batctl: added loglevel support for DBG_TT
DBG_TT log level has been added to batman-adv to collect all the
messages related to Translation Table operations. This patch makes batctl
able to select such level.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/sys.c b/sys.c
index f8fa1f2..dbf5383 100644
--- a/sys.c
+++ b/sys.c
@@ -182,6 +182,7 @@ static void log_level_usage(void)
int handle_loglevel(char *mesh_iface, int argc, char **argv)
{
int optchar, res;
+ int log_level;
char *path_buff;
while ((optchar = getopt(argc, argv, "h")) != -1) {
@@ -208,14 +209,16 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
if (res != EXIT_SUCCESS)
goto out;
- printf("[%c] %s (%d)\n", (line_ptr[0] == '0') ? 'x' : ' ',
+ log_level = strtol(line_ptr, (char **) NULL, 10);
+
+ printf("[%c] %s (%d)\n", (!log_level) ? 'x' : ' ',
"all debug output disabled", 0);
- printf("[%c] %s (%d)\n", (line_ptr[0] == '1') ? 'x' : ' ',
+ printf("[%c] %s (%d)\n", (log_level & 1) ? 'x' : ' ',
"messages related to routing / flooding / broadcasting", 1);
- printf("[%c] %s (%d)\n", (line_ptr[0] == '2') ? 'x' : ' ',
- "messages related to route or tt entry added / changed / deleted", 2);
- printf("[%c] %s (%d)\n", (line_ptr[0] == '3') ? 'x' : ' ',
- "all debug messages", 3);
+ printf("[%c] %s (%d)\n", (log_level & 2) ? 'x' : ' ',
+ "messages related to route added / changed / deleted", 2);
+ printf("[%c] %s (%d)\n", (log_level & 4) ? 'x' : ' ',
+ "messages related to translation table operations", 4);
out:
if (errno == ENOENT)
--
batctl
11 years, 8 months
batctl; branch, master, updated. v2011.1.0-24-gc6ed60c
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit c6ed60c0f6fd9ba1a61693b4ddf2988487a21fcb
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Sun May 29 18:34:27 2011 +0200
batctl: tcpdump - add option to select all packet types except specified
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/tcpdump.c b/tcpdump.c
index 6f1adc1..3e68844 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -51,8 +51,9 @@ if ((size_t)(buff_len) < (check_len)) { \
return; \
}
-static unsigned short dump_level = DUMP_TYPE_BATOGM | DUMP_TYPE_BATICMP | DUMP_TYPE_BATUCAST |
+static unsigned short dump_level_all = DUMP_TYPE_BATOGM | DUMP_TYPE_BATICMP | DUMP_TYPE_BATUCAST |
DUMP_TYPE_BATBCAST | DUMP_TYPE_BATVIS | DUMP_TYPE_BATFRAG | DUMP_TYPE_BATTT | DUMP_TYPE_NONBAT;
+static unsigned short dump_level;
static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed);
@@ -63,6 +64,8 @@ static void tcpdump_usage(void)
printf(" \t -h print this help\n");
printf(" \t -n don't convert addresses to bat-host names\n");
printf(" \t -p dump specific packet type\n");
+ printf(" \t -x dump all packet types except specified\n");
+ printf("packet types:\n");
printf(" \t\t%3d - batman ogm packets\n", DUMP_TYPE_BATOGM);
printf(" \t\t%3d - batman icmp packets\n", DUMP_TYPE_BATICMP);
printf(" \t\t%3d - batman unicast packets\n", DUMP_TYPE_BATUCAST);
@@ -621,7 +624,9 @@ int tcpdump(int argc, char **argv)
unsigned char packet_buff[2000];
int monitor_header_len = -1;
- while ((optchar = getopt(argc, argv, "hnp:")) != -1) {
+ dump_level = dump_level_all;
+
+ while ((optchar = getopt(argc, argv, "hnp:x:")) != -1) {
switch (optchar) {
case 'h':
tcpdump_usage();
@@ -632,10 +637,16 @@ int tcpdump(int argc, char **argv)
break;
case 'p':
tmp = strtol(optarg, NULL , 10);
- if ((tmp > 0) && (tmp <= dump_level))
+ if ((tmp > 0) && (tmp <= dump_level_all))
dump_level = tmp;
found_args += ((*((char*)(optarg - 1)) == optchar ) ? 1 : 2);
break;
+ case 'x':
+ tmp = strtol(optarg, NULL , 10);
+ if ((tmp > 0) && (tmp <= dump_level_all))
+ dump_level &= ~tmp;
+ found_args += ((*((char*)(optarg - 1)) == optchar ) ? 1 : 2);
+ break;
default:
tcpdump_usage();
return EXIT_FAILURE;
--
batctl
11 years, 8 months
batctl; branch, master, updated. v2011.1.0-23-ge177d6e
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit e177d6e710bf42825f16772e6b3329caf0945b3f
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Sun May 29 18:11:26 2011 +0200
batctl: tcpdump - add support for tt request / roaming advertisement packets
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
Acked-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/tcpdump.c b/tcpdump.c
index a715e27..6f1adc1 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -52,7 +52,7 @@ if ((size_t)(buff_len) < (check_len)) { \
}
static unsigned short dump_level = DUMP_TYPE_BATOGM | DUMP_TYPE_BATICMP | DUMP_TYPE_BATUCAST |
- DUMP_TYPE_BATBCAST | DUMP_TYPE_BATVIS | DUMP_TYPE_BATFRAG | DUMP_TYPE_NONBAT;
+ DUMP_TYPE_BATBCAST | DUMP_TYPE_BATVIS | DUMP_TYPE_BATFRAG | DUMP_TYPE_BATTT | DUMP_TYPE_NONBAT;
static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed);
@@ -63,14 +63,15 @@ static void tcpdump_usage(void)
printf(" \t -h print this help\n");
printf(" \t -n don't convert addresses to bat-host names\n");
printf(" \t -p dump specific packet type\n");
- printf(" \t\t%d - batman ogm packets\n", DUMP_TYPE_BATOGM);
- printf(" \t\t%d - batman icmp packets\n", DUMP_TYPE_BATICMP);
- printf(" \t\t%d - batman unicast packets\n", DUMP_TYPE_BATUCAST);
- printf(" \t\t%d - batman broadcast packets\n", DUMP_TYPE_BATBCAST);
- printf(" \t\t%d - batman vis packets\n", DUMP_TYPE_BATVIS);
- printf(" \t\t%d - batman fragmented packets\n", DUMP_TYPE_BATFRAG);
- printf(" \t\t%d - non batman packets\n", DUMP_TYPE_NONBAT);
- printf(" \t\t%d - batman ogm & non batman packets\n", DUMP_TYPE_BATOGM | DUMP_TYPE_NONBAT);
+ printf(" \t\t%3d - batman ogm packets\n", DUMP_TYPE_BATOGM);
+ printf(" \t\t%3d - batman icmp packets\n", DUMP_TYPE_BATICMP);
+ printf(" \t\t%3d - batman unicast packets\n", DUMP_TYPE_BATUCAST);
+ printf(" \t\t%3d - batman broadcast packets\n", DUMP_TYPE_BATBCAST);
+ printf(" \t\t%3d - batman vis packets\n", DUMP_TYPE_BATVIS);
+ printf(" \t\t%3d - batman fragmented packets\n", DUMP_TYPE_BATFRAG);
+ printf(" \t\t%3d - batman tt / roaming packets\n", DUMP_TYPE_BATTT);
+ printf(" \t\t%3d - non batman packets\n", DUMP_TYPE_NONBAT);
+ printf(" \t\t%3d - batman ogm & non batman packets\n", DUMP_TYPE_BATOGM | DUMP_TYPE_NONBAT);
}
static int print_time(void)
@@ -247,6 +248,58 @@ static void dump_vlan(unsigned char *packet_buff, ssize_t buff_len, int read_opt
parse_eth_hdr(packet_buff + 4, buff_len - 4, read_opt, time_printed);
}
+static void dump_batman_tt(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed)
+{
+ struct ether_header *ether_header;
+ struct tt_query_packet *tt_query_packet;
+
+ LEN_CHECK((size_t)buff_len - sizeof(struct ether_header), sizeof(struct tt_query_packet), "BAT TT");
+
+ ether_header = (struct ether_header *)packet_buff;
+ tt_query_packet = (struct tt_query_packet *)(packet_buff + sizeof(struct ether_header));
+
+ if (!time_printed)
+ print_time();
+
+ printf("BAT %s > ",
+ get_name_by_macaddr((struct ether_addr *)tt_query_packet->src, read_opt));
+
+ printf("%s: TT %s, ttvn %d, %s %d, ttl %2d, v %d, flags [%c%c%c], length %zu\n",
+ get_name_by_macaddr((struct ether_addr *)tt_query_packet->dst, read_opt),
+ tt_query_packet->flags & TT_RESPONSE ? "response" : "request",
+ tt_query_packet->ttvn, tt_query_packet->flags & TT_RESPONSE ? "entries" : "crc",
+ ntohs(tt_query_packet->tt_data), tt_query_packet->ttl, tt_query_packet->version,
+ (tt_query_packet->flags & TT_REQUEST ? 'Q' : '.'),
+ (tt_query_packet->flags & TT_RESPONSE ? 'P' : '.'),
+ (tt_query_packet->flags & TT_FULL_TABLE ? 'F' : '.'),
+ (size_t)buff_len - sizeof(struct ether_header));
+}
+
+static void dump_batman_roam(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed)
+{
+ struct ether_header *ether_header;
+ struct roam_adv_packet *roam_adv_packet;
+
+ LEN_CHECK((size_t)buff_len - sizeof(struct ether_header), sizeof(struct roam_adv_packet), "BAT ROAM");
+
+ ether_header = (struct ether_header *)packet_buff;
+ roam_adv_packet = (struct roam_adv_packet *)(packet_buff + sizeof(struct ether_header));
+
+ if (!time_printed)
+ print_time();
+
+ printf("BAT %s > ",
+ get_name_by_macaddr((struct ether_addr *)roam_adv_packet->src, read_opt));
+
+ printf("%s: ROAM, ",
+ get_name_by_macaddr((struct ether_addr *)roam_adv_packet->dst, read_opt));
+
+ printf("client %s, ttl %2d, v %d, length %zu\n",
+ get_name_by_macaddr((struct ether_addr *)roam_adv_packet->client, read_opt),
+ roam_adv_packet->ttl, roam_adv_packet->version,
+ (size_t)buff_len - sizeof(struct ether_header));
+}
+
static void dump_batman_ogm(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed)
{
struct ether_header *ether_header;
@@ -263,9 +316,9 @@ static void dump_batman_ogm(unsigned char *packet_buff, ssize_t buff_len, int re
printf("BAT %s: ",
get_name_by_macaddr((struct ether_addr *)batman_packet->orig, read_opt));
- printf("OGM via neigh %s, seq %u, tq %3d, ttl %2d, v %d, flags [%c%c%c%c], length %zu\n",
+ printf("OGM via neigh %s, seq %u, tq %3d, ttvn %d, ttl %2d, v %d, flags [%c%c%c%c], length %zu\n",
get_name_by_macaddr((struct ether_addr *)ether_header->ether_shost, read_opt),
- ntohl(batman_packet->seqno), batman_packet->tq,
+ ntohl(batman_packet->seqno), batman_packet->tq, batman_packet->ttvn,
batman_packet->ttl, batman_packet->version,
(batman_packet->flags & DIRECTLINK ? 'D' : '.'),
(batman_packet->flags & VIS_SERVER ? 'V' : '.'),
@@ -334,9 +387,9 @@ static void dump_batman_ucast(unsigned char *packet_buff, ssize_t buff_len, int
printf("BAT %s > ",
get_name_by_macaddr((struct ether_addr *)ether_header->ether_shost, read_opt));
- printf("%s: UCAST, ttl %hhu, ",
+ printf("%s: UCAST, ttvn %d, ttl %hhu, ",
get_name_by_macaddr((struct ether_addr *)unicast_packet->dest, read_opt),
- unicast_packet->ttl);
+ unicast_packet->ttvn, unicast_packet->ttl);
parse_eth_hdr(packet_buff + ETH_HLEN + sizeof(struct unicast_packet),
buff_len - ETH_HLEN - sizeof(struct unicast_packet),
@@ -385,9 +438,9 @@ static void dump_batman_frag(unsigned char *packet_buff, ssize_t buff_len, int r
printf("BAT %s > ",
get_name_by_macaddr((struct ether_addr *)unicast_frag_packet->orig, read_opt));
- printf("%s: FRAG, seq %hu, ttl %hhu, flags [%c%c], ",
+ printf("%s: FRAG, seq %hu, ttvn %d, ttl %hhu, flags [%c%c], ",
get_name_by_macaddr((struct ether_addr *)unicast_frag_packet->dest, read_opt),
- ntohs(unicast_frag_packet->seqno), unicast_frag_packet->ttl,
+ ntohs(unicast_frag_packet->seqno), unicast_frag_packet->ttvn, unicast_frag_packet->ttl,
(unicast_frag_packet->flags & UNI_FRAG_HEAD ? 'H' : '.'),
(unicast_frag_packet->flags & UNI_FRAG_LARGETAIL ? 'L' : '.'));
@@ -447,6 +500,14 @@ static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read
if (dump_level & DUMP_TYPE_BATFRAG)
dump_batman_frag(packet_buff, buff_len, read_opt, time_printed);
break;
+ case BAT_TT_QUERY:
+ if (dump_level & DUMP_TYPE_BATTT)
+ dump_batman_tt(packet_buff, buff_len, read_opt, time_printed);
+ break;
+ case BAT_ROAM_ADV:
+ if (dump_level & DUMP_TYPE_BATTT)
+ dump_batman_roam(packet_buff, buff_len, read_opt, time_printed);
+ break;
default:
printf("Warning - packet contains unknown batman packet type: 0x%02x\n", batman_packet->packet_type);
break;
diff --git a/tcpdump.h b/tcpdump.h
index 4364be1..925b116 100644
--- a/tcpdump.h
+++ b/tcpdump.h
@@ -37,7 +37,8 @@
#define DUMP_TYPE_BATBCAST 8
#define DUMP_TYPE_BATVIS 16
#define DUMP_TYPE_BATFRAG 32
-#define DUMP_TYPE_NONBAT 64
+#define DUMP_TYPE_BATTT 64
+#define DUMP_TYPE_NONBAT 128
#define IEEE80211_FCTL_FTYPE 0x0c00
#define IEEE80211_FCTL_TODS 0x0001
--
batctl
11 years, 8 months
linux integration; annotated tag, v3.0-rc1, created. v3.0-rc1
by postmaster@open-mesh.org
The annotated tag, v3.0-rc1 has been created
at 2a23a510142a1ab597f0214e4fadb3c7350bbb8d (tag)
tagging 55922c9d1b84b89cb946c777fddccb3247e7df2c (commit)
replaces v2.6.39
tagged by Linus Torvalds
on Sun May 29 17:45:31 2011 -0700
- Shortlog ------------------------------------------------------------
Linux 3.0-rc1
Version numbers? We can increment them!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
iEYEABECAAYFAk3i6MYACgkQF3YsRnbiHLunGwCfXfMDDvDv025tyC368DQm1sIL
LQUAoIZGzaBGvHijM+KutlYhWI1lbnx7
=pnaH
-----END PGP SIGNATURE-----
Andrew Lunn (1):
batman-adv: Set the txqueuelen to zero when creating soft interface
Antonio Quartulli (4):
batman-adv: orig_hash_find() manages rcu_lock/unlock internally
batman-adv: Move definition of atomic_dec_not_zero() into main.h
batman-adv: fix gw_node_update() and gw_election()
batman-adv: rename everything from *hna* into *tt* (translation table)
Daniele Furlan (1):
batman-adv: remove duplicate code from function is_bidirectional_neigh()
David Decotigny (1):
ethtool: cosmetic: Use ethtool ethtool_cmd_speed API
David S. Miller (4):
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
Linus Lüssing (5):
batman-adv: Move bonding / iface alternating router search to own functions
batman-adv: Make gateway_get_selected type safe
batman-adv: Simplify gw_check_election(), use gw_get_selected()
batman-adv: Make orig_node->router an rcu protected pointer
batman-adv: Protect global TQ window with a spinlock
Linus Torvalds (1):
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
Marek Lindner (6):
batman-adv: concentrate all curr_gw related rcu operations in select/deselect functions
batman-adv: Make bat_priv->primary_if an rcu protected pointer
batman-adv: remove misplaced comment
batman-adv: multi vlan support for bridge loop detection
batman-adv: Fix refcount imbalance in find_router
batman-adv: reset broadcast flood protection on error
Michał Mirosław (1):
net: batman-adv: remove rx_csum ethtool_ops
Paul E. McKenney (3):
batman,rcu: convert call_rcu(gw_node_free_rcu) to kfree_rcu
batman,rcu: convert call_rcu(neigh_node_free_rcu) to kfree()
batman,rcu: convert call_rcu(softif_neigh_free_rcu) to kfree_rcu
Simon Wunderlich (1):
batman-adv: protect softif_neigh by rcu
Sven Eckelmann (4):
batman-adv: Remove unnecessary hardif_list_lock
batman-adv: Avoid deadlock between rtnl_lock and s_active
batman-adv: Remove multiline comments from line ending
batman-adv: Add missing hardif_free_ref in forw_packet_free
-----------------------------------------------------------------------
--
linux integration
11 years, 8 months
batman-adv; branch, master, updated. v2011.1.0-134-g7fbf38e
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 7fbf38e0e7087fe2b10b40c506e34280bb2bc5c3
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun May 29 20:54:31 2011 +0200
batman-adv: send_*_tt_response() has to initialise the ttl field
send_*_tt_response() didn't properly initialise the ttl field of the
tt_response message.
This error was introduced with: cea194d90b11aff7fc289149e4c7f305fad3535a
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/translation-table.c b/translation-table.c
index f0d8857..f04ab9b 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1132,6 +1132,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
tt_response->packet_type = BAT_TT_QUERY;
tt_response->version = COMPAT_VERSION;
+ tt_response->ttl = TTL;
memcpy(tt_response->src, req_dst_orig_node->orig, ETH_ALEN);
memcpy(tt_response->dst, tt_request->src, ETH_ALEN);
tt_response->tt_data = htons(tt_tot);
@@ -1280,6 +1281,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
tt_response->packet_type = BAT_TT_QUERY;
tt_response->version = COMPAT_VERSION;
+ tt_response->ttl = TTL;
memcpy(tt_response->src, primary_if->net_dev->dev_addr, ETH_ALEN);
memcpy(tt_response->dst, tt_request->src, ETH_ALEN);
tt_response->tt_data = htons(tt_tot);
--
batman-adv
11 years, 8 months
batman-adv; branch, master, updated. v2011.1.0-133-g405ca1d
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 405ca1d5a1f38c7eda65a23208b27b69503a6868
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun May 29 15:05:34 2011 +0200
batman-adv: correct kobject_set_name() arguments
Compiling against kernel version <2.6.25 was failing due to wrong
parameters.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
diff --git a/compat.h b/compat.h
index 6842a26..0f0e66e 100644
--- a/compat.h
+++ b/compat.h
@@ -131,7 +131,7 @@ static inline struct kobject *kobject_create_and_add(const char *name,
if (!kobj)
return NULL;
- kobject_set_name(kobj, name);
+ kobject_set_name(kobj, "%s", name);
kobj->ktype = &ktype_bat_wrapper;
kobj->kset = NULL;
kobj->parent = parent;
--
batman-adv
11 years, 8 months
batman-adv; branch, master, updated. v2011.1.0-132-ga726fda
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit a726fdad131019166a46bace12da4653c1a592b3
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun May 29 00:26:17 2011 +0200
batman-adv: correct !x & y in !(x & y)
This error was introduced with: 4dea0274b8edeab50bfeb6685ef33362e3ec9299
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Acked-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/translation-table.c b/translation-table.c
index 464569e..f0d8857 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -724,7 +724,7 @@ static void tt_global_roam_purge(struct bat_priv *bat_priv)
spin_lock_bh(list_lock);
hlist_for_each_entry_safe(tt_global_entry, node, node_tmp,
head, hash_entry) {
- if (!tt_global_entry->flags & TT_GLOBAL_ROAM)
+ if (!(tt_global_entry->flags & TT_GLOBAL_ROAM))
continue;
if (!is_out_of_time(tt_global_entry->roam_at,
TT_GLOBAL_ROAM_TIMEOUT * 1000))
--
batman-adv
11 years, 8 months
batctl; branch, master, updated. v2011.1.0-22-g3e4acf0
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit ee319368e5d6385458345731e519640889c177c4
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sat May 28 14:51:06 2011 +0200
batctl: Unify the first 3 bytes in each packet
The amount of duplicated code in the receive and routing code can be
reduced when all headers provide the packet type, version and ttl in the
same first bytes.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/packet.h b/packet.h
index eda9965..f4052f2 100644
--- a/packet.h
+++ b/packet.h
@@ -32,7 +32,7 @@
#define BAT_UNICAST_FRAG 0x06
/* this file is included by batctl which needs these defines */
-#define COMPAT_VERSION 12
+#define COMPAT_VERSION 14
#define DIRECTLINK 0x40
#define VIS_SERVER 0x20
#define PRIMARIES_FIRST_HOP 0x10
@@ -55,15 +55,15 @@
struct batman_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
+ uint8_t ttl;
uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
- uint8_t tq;
uint32_t seqno;
uint8_t orig[6];
uint8_t prev_sender[6];
- uint8_t ttl;
- uint8_t num_tt;
uint8_t gw_flags; /* flags related to gateway class */
- uint8_t align;
+ uint8_t tq;
+ uint8_t num_tt;
+ uint8_t reserved;
} __packed;
#define BAT_PACKET_LEN sizeof(struct batman_packet)
@@ -71,12 +71,13 @@ struct batman_packet {
struct icmp_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
- uint8_t msg_type; /* see ICMP message types above */
uint8_t ttl;
+ uint8_t msg_type; /* see ICMP message types above */
uint8_t dst[6];
uint8_t orig[6];
uint16_t seqno;
uint8_t uid;
+ uint8_t reserved;
} __packed;
#define BAT_RR_LEN 16
@@ -86,8 +87,8 @@ struct icmp_packet {
struct icmp_packet_rr {
uint8_t packet_type;
uint8_t version; /* batman version field */
- uint8_t msg_type; /* see ICMP message types above */
uint8_t ttl;
+ uint8_t msg_type; /* see ICMP message types above */
uint8_t dst[6];
uint8_t orig[6];
uint16_t seqno;
@@ -99,16 +100,19 @@ struct icmp_packet_rr {
struct unicast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
- uint8_t dest[6];
uint8_t ttl;
+ uint8_t reserved;
+ uint8_t dest[6];
} __packed;
struct unicast_frag_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
- uint8_t dest[6];
uint8_t ttl;
+ uint8_t reserved;
+ uint8_t dest[6];
uint8_t flags;
+ uint8_t align;
uint8_t orig[6];
uint16_t seqno;
} __packed;
@@ -116,18 +120,20 @@ struct unicast_frag_packet {
struct bcast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
- uint8_t orig[6];
uint8_t ttl;
+ uint8_t reserved;
uint32_t seqno;
+ uint8_t orig[6];
} __packed;
struct vis_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
+ uint8_t ttl; /* TTL */
uint8_t vis_type; /* which type of vis-participant sent this? */
- uint8_t entries; /* number of entries behind this struct */
uint32_t seqno; /* sequence number */
- uint8_t ttl; /* TTL */
+ uint8_t entries; /* number of entries behind this struct */
+ uint8_t reserved;
uint8_t vis_orig[6]; /* originator that announces its neighbors */
uint8_t target_orig[6]; /* who should receive this packet */
uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
--
batctl
11 years, 8 months
batctl; branch, master, updated. v2011.1.0-22-g3e4acf0
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 3e4acf0985eb97a8248726613f629cacbfe6d8d5
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed Apr 27 14:27:57 2011 +0200
batctl: improved roaming mechanism
Exploting the new announcement implementation, it has been possible to
improve the roaming mechanism and reduce the number of packet drops.
For details, please visit:
http://www.open-mesh.org/wiki/batman-adv/Roaming-improvements
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Acked-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/packet.h b/packet.h
index 49500a9..ae212c7 100644
--- a/packet.h
+++ b/packet.h
@@ -31,6 +31,7 @@
#define BAT_VIS 0x05
#define BAT_UNICAST_FRAG 0x06
#define BAT_TT_QUERY 0x07
+#define BAT_ROAM_ADV 0x08
/* this file is included by batctl which needs these defines */
#define COMPAT_VERSION 14
@@ -169,4 +170,14 @@ struct tt_query_packet {
uint16_t tt_data;
} __packed;
+struct roam_adv_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t reserved;
+ uint8_t dst[ETH_ALEN];
+ uint8_t src[ETH_ALEN];
+ uint8_t client[ETH_ALEN];
+} __packed;
+
#endif /* _NET_BATMAN_ADV_PACKET_H_ */
--
batctl
11 years, 8 months
batctl; branch, master, updated. v2011.1.0-22-g3e4acf0
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 6229a68792c0ae1522b2aff999f72243d8689445
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed Apr 27 14:27:44 2011 +0200
batctl: improved client announcement mechanism
The old HNA mechanism has been totally rewritten from scratch.
The new mechanism consists in announcing local translation-table changes
only, reducing the protocol overhead.
For details, please visit:
http://www.open-mesh.org/wiki/batman-adv/Client-announcement
Moreover:
- COMPAT_VERSION has been increased to 14
- batman-adv now depends on module "crc16" for tt crc computation
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Acked-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/packet.h b/packet.h
index f4052f2..49500a9 100644
--- a/packet.h
+++ b/packet.h
@@ -30,6 +30,7 @@
#define BAT_BCAST 0x04
#define BAT_VIS 0x05
#define BAT_UNICAST_FRAG 0x06
+#define BAT_TT_QUERY 0x07
/* this file is included by batctl which needs these defines */
#define COMPAT_VERSION 14
@@ -52,6 +53,11 @@
#define UNI_FRAG_HEAD 0x01
#define UNI_FRAG_LARGETAIL 0x02
+/* TT flags */
+#define TT_RESPONSE 0x01
+#define TT_REQUEST 0x02
+#define TT_FULL_TABLE 0x04
+
struct batman_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
@@ -62,8 +68,9 @@ struct batman_packet {
uint8_t prev_sender[6];
uint8_t gw_flags; /* flags related to gateway class */
uint8_t tq;
- uint8_t num_tt;
- uint8_t reserved;
+ uint8_t tt_num_changes;
+ uint8_t ttvn; /* translation table version number */
+ uint16_t tt_crc;
} __packed;
#define BAT_PACKET_LEN sizeof(struct batman_packet)
@@ -101,7 +108,7 @@ struct unicast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t ttl;
- uint8_t reserved;
+ uint8_t ttvn; /* destination translation table version number */
uint8_t dest[6];
} __packed;
@@ -109,7 +116,7 @@ struct unicast_frag_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
uint8_t ttl;
- uint8_t reserved;
+ uint8_t ttvn; /* destination translation table version number */
uint8_t dest[6];
uint8_t flags;
uint8_t align;
@@ -139,4 +146,27 @@ struct vis_packet {
uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
} __packed;
+struct tt_query_packet {
+ uint8_t packet_type;
+ uint8_t version; /* batman version field */
+ uint8_t ttl;
+ /* the flag field is a combination of:
+ * - TT_REQUEST or TT_RESPONSE
+ * - TT_FULL_TABLE */
+ uint8_t flags;
+ uint8_t dst[ETH_ALEN];
+ uint8_t src[ETH_ALEN];
+ /* the ttvn field is:
+ * if TT_REQUEST: ttvn that triggered the
+ * request
+ * if TT_RESPONSE: new ttvn for the src
+ * orig_node */
+ uint8_t ttvn;
+ /* tt_data field is:
+ * if TT_REQUEST: crc associated with the
+ * ttvn
+ * if TT_RESPONSE: table_size */
+ uint16_t tt_data;
+} __packed;
+
#endif /* _NET_BATMAN_ADV_PACKET_H_ */
--
batctl
11 years, 8 months