From patchwork Wed May 4 22:53:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1012 Return-Path: Received: from confino.investici.org (investici.nine.ch [217.150.252.179]) by open-mesh.org (Postfix) with ESMTPS id 56D66154214 for ; Thu, 5 May 2011 00:53:46 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [217.150.252.179] (confino [217.150.252.179]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 6B230C8650; Wed, 4 May 2011 22:53:40 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 confino.investici.org 6B230C8650 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1304549625; bh=JE2kSAEbmlT+RSZX7zRRDiok2qNuAnclZCUFqeAyNxo=; h=From:To:Cc:Subject:Date:Message-Id; b=pBowqDAFv0plovWlsWvGMlrLVsCd2TaqiApBZ18+utffE4tVGD5prLJhtkED0i9YN P0sbLOU9YVIt19/XinL0ebGV05tc87eb5Pd8N/VStR9Cj0DK/MDdh7ESFtw8pL9B29 NGDsozHmep6//dX9+WYWxtzT9e+S3+64m1fTeXso= From: Antonio Quartulli To: "B.A.T.M.A.N" Date: Thu, 5 May 2011 00:53:19 +0200 Message-Id: <1304549599-25241-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 Subject: [B.A.T.M.A.N.] [PATCH] batctl: rename stuff from *hna* to *tt* (translation table) X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 22:53:46 -0000 To be coherent, all the functions/variables/constats have been renamed to the TranslationTable style Signed-off-by: Antonio Quartulli --- README | 18 +++++++++--------- packet.h | 2 +- sys.c | 2 +- vis.c | 34 +++++++++++++++++----------------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README b/README index 8f22eb1..3311f05 100644 --- a/README +++ b/README @@ -312,7 +312,7 @@ Usage: batctl translocal|tl Example: $ batctl translocal -Locally retrieved addresses (from bat0) announced via HNA: +Locally retrieved addresses (from bat0) announced via TT: * d6:e0:fd:d9:00:00 batctl transglobal @@ -324,7 +324,7 @@ Usage: batctl transglobal|tg Example: -Globally announced HNAs received via the mesh (translation table): +Globally announced TT entries received via the mesh (translation table): * 16:aa:c4:a2:00:00 via fe:fe:00:00:09:01 * 5a:32:f9:df:00:00 via fe:fe:00:00:03:01 * 32:ae:5a:00:00:00 via fe:fe:00:00:04:01 @@ -356,9 +356,9 @@ display the VIS data in dot or JSON format Usage: -batctl vis dot {-h}{--no-HNA|-H} {--no-2nd|-2} {--numbers|-n} +batctl vis dot {-h}{--no-TT|-H} {--no-2nd|-2} {--numbers|-n} or -batctl vis json {-h}{--no-HNA|-H} {--no-2nd|-2} {--numbers|-n} +batctl vis json {-h}{--no-TT|-H} {--no-2nd|-2} {--numbers|-n} Example: @@ -367,19 +367,19 @@ Example: $ batctl vis_data dot digraph { "A" -> "B" [label="1.00"] - "A" -> "00:ff:f3:cc:68:ac" [label="HNA"] + "A" -> "00:ff:f3:cc:68:ac" [label="TT"] subgraph "cluster_A" { "A" [peripheries=2] } "B" -> "A" [label="1.00"] "B-if2" -> "C" [label="2.00"] - "B" -> "22:ff:f3:cc:68:ac" [label="HNA"] + "B" -> "22:ff:f3:cc:68:ac" [label="TT"] subgraph "cluster_B" { "B" [peripheries=2] "B-if2" } "C" -> "B-if2" [label="2.00"] - "C" -> "44:ff:f3:cc:68:ac" [label="HNA"] + "C" -> "44:ff:f3:cc:68:ac" [label="TT"] subgraph "cluster_C" { "C" [peripheries=2] } @@ -395,7 +395,7 @@ connection (100%), 2.0 means 50%, 3.0 means 33% and so on. A host's mac address which is currently connected to the interface of a mesh node (either the mesh node itself or hosts being bridged into the mesh) is -being displayed with an "HNA"-label. (--no-hna omits this output) +being displayed with an "TT"-label. (--no-TT omits this output) To still have the information about which interfaces belong to which mesh node a subgraph/cluster is being added. The subpgraph is being labeled with a mesh @@ -422,7 +422,7 @@ Meaning of the shapes in this image file: * Boxes: interfaces belonging to one BATMAN-node * double circled interfaces: the primary interface of a BATMAN-node (which is known to other BATMAN-nodes only, except direct neighbours) -* Ellipses with an HNA-arrow: mesh clients (this can be a BATMAN-node itself +* Ellipses with a TT-arrow: mesh clients (this can be a BATMAN-node itself with its bat0 interface or computers/devices being bridged into the mesh) * Arrows with numbers: the transmit quality (in the form 1/TQ) from one BATMAN interface to another BATMAN interface diff --git a/packet.h b/packet.h index e757187..c225c3a 100644 --- a/packet.h +++ b/packet.h @@ -61,7 +61,7 @@ struct batman_packet { uint8_t orig[6]; uint8_t prev_sender[6]; uint8_t ttl; - uint8_t num_hna; + uint8_t num_tt; uint8_t gw_flags; /* flags related to gateway class */ uint8_t align; } __packed; diff --git a/sys.c b/sys.c index 3511b40..f8fa1f2 100644 --- a/sys.c +++ b/sys.c @@ -213,7 +213,7 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) printf("[%c] %s (%d)\n", (line_ptr[0] == '1') ? 'x' : ' ', "messages related to routing / flooding / broadcasting", 1); printf("[%c] %s (%d)\n", (line_ptr[0] == '2') ? 'x' : ' ', - "messages related to route or hna added / changed / deleted", 2); + "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); diff --git a/vis.c b/vis.c index adb12d0..118c659 100644 --- a/vis.c +++ b/vis.c @@ -37,7 +37,7 @@ #define TQ_MAX_VALUE 255 typedef void (*print_tq_t) (char *orig, char *from, const long tq); -typedef void (*print_HNA_t) (char *orig, char *from); +typedef void (*print_TT_t) (char *orig, char *from); typedef void (*print_1st_t) (char *orig); typedef void (*print_2nd_t) (char *orig, char *from); typedef void (*print_header_t) (void); @@ -45,22 +45,22 @@ typedef void (*print_footer_t) (void); struct funcs { print_tq_t print_tq; - print_HNA_t print_HNA; + print_TT_t print_TT; print_1st_t print_1st; print_2nd_t print_2nd; print_header_t print_header; print_footer_t print_footer; }; -static bool with_HNA = true; +static bool with_TT = true; static bool with_2nd = true; static bool with_names = true; static void usage(void) { - printf("batctl vis_data dot {-h}{--no-HNA|-H} {--no-2nd|-2} {--numbers|-n}\n"); + printf("batctl vis_data dot {-h}{--no-TT|-H} {--no-2nd|-2} {--numbers|-n}\n"); printf("or\n"); - printf("batctl vis_data json {-h}{--no-HNA|-H} {--no-2nd|-2} {--numbers|-n}\n"); + printf("batctl vis_data json {-h}{--no-TT|-H} {--no-2nd|-2} {--numbers|-n}\n"); } static void dot_print_tq(char *orig, char *from, const long tq) @@ -75,11 +75,11 @@ static void dot_print_tq(char *orig, char *from, const long tq) int_part, frac_part); } -static void dot_print_HNA(char *orig, char *from) +static void dot_print_TT(char *orig, char *from) { printf("\t\"%s\" -> ", get_name_by_macstr(orig, (with_names ? USE_BAT_HOSTS : 0))); - printf("\"%s\" [label=\"HNA\"]\n", + printf("\"%s\" [label=\"TT\"]\n", get_name_by_macstr(from, (with_names ? USE_BAT_HOSTS : 0))); } @@ -114,7 +114,7 @@ static void dot_print_footer(void) } const struct funcs dot_funcs = { dot_print_tq, - dot_print_HNA, + dot_print_TT, dot_print_1st, dot_print_2nd, dot_print_header, @@ -133,11 +133,11 @@ static void json_print_tq(char *orig, char *from, const long tq) int_part, frac_part); } -static void json_print_HNA(char *orig, char *from) +static void json_print_TT(char *orig, char *from) { printf("{ \"router\" : \"%s\", ", get_name_by_macstr(orig, (with_names ? USE_BAT_HOSTS : 0))); - printf("\"gateway\" : \"%s\", \"label\" : \"HNA\" }\n", + printf("\"gateway\" : \"%s\", \"label\" : \"TT\" }\n", get_name_by_macstr(from, (with_names ? USE_BAT_HOSTS : 0))); } @@ -157,7 +157,7 @@ static void json_print_2nd(char *orig, char *from) } const struct funcs json_funcs = { json_print_tq, - json_print_HNA, + json_print_TT, json_print_1st, json_print_2nd, NULL, @@ -217,12 +217,12 @@ static int format(char *mesh_iface, const struct funcs *funcs) funcs->print_tq(orig, from, tq); continue; } - if (!strcmp(flag, "HNA")) { - /* We have an HNA record */ - if (!with_HNA) + if (!strcmp(flag, "TT")) { + /* We have a TT record */ + if (!with_TT) continue; from = strtok_r(NULL, " ", &component_save_ptr); - funcs->print_HNA(orig, from); + funcs->print_TT(orig, from); continue; } if (!strcmp(flag, "SEC") && with_2nd) { @@ -274,7 +274,7 @@ int vis_data(char *mesh_iface, int argc, char *argv[]) while (1) { int option_index = 0; static struct option long_options[] = { - {"no-HNA", 0, 0, 'H'}, + {"no-TT", 0, 0, 'H'}, {"no-2nd", 0, 0, '2'}, {"numbers", 0, 0, 'n'}, {0, 0, 0, 0} @@ -286,7 +286,7 @@ int vis_data(char *mesh_iface, int argc, char *argv[]) switch (c) { case 'H': - with_HNA = false; + with_TT = false; break; case '2': with_2nd = false;