]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Babel: sub-TLV 2 is Diversity, not ChanInfo
authorDenis Ovsienko <[email protected]>
Wed, 28 Aug 2013 15:55:00 +0000 (19:55 +0400)
committerDenis Ovsienko <[email protected]>
Wed, 28 Aug 2013 15:55:00 +0000 (19:55 +0400)
print-babel.c
tests/babel1v.out

index 129ace937a2f4d6dd4ccb1c6aedd43eafb0816e9..0b1fd57ee879e228ebde8e107612d2b3e0d8dc80 100644 (file)
@@ -88,10 +88,10 @@ babel_print(const u_char *cp, u_int length) {
 /* sub-TLVs */
 #define MESSAGE_SUB_PAD1 0
 #define MESSAGE_SUB_PADN 1
-#define MESSAGE_SUB_CHANINFO 2
+#define MESSAGE_SUB_DIVERSITY 2
 
-/* ChanInfo sub-TLV channel codes */
-static const struct tok chaninfo_str[] = {
+/* Diversity sub-TLV channel codes */
+static const struct tok diversity_str[] = {
     { 0,   "reserved" },
     { 255, "all"      },
     { 0, NULL }
@@ -220,7 +220,7 @@ network_address(int ae, const unsigned char *a, unsigned int len,
  *
  * o Type 0 stands for Pad1 sub-TLV with the same encoding as the Pad1 TLV.
  * o Type 1 stands for PadN sub-TLV with the same encoding as the PadN TLV.
- * o Type 2 stands for ChanInfo sub-TLV, which propagates diversity routing
+ * o Type 2 stands for Diversity sub-TLV, which propagates diversity routing
  *   data. Its body is a variable-length sequence of 8-bit unsigned integers,
  *   each representing per-hop number of interferring radio channel for the
  *   prefix. Channel 0 is invalid and must not be used in the sub-TLV, channel
@@ -228,7 +228,7 @@ network_address(int ae, const unsigned char *a, unsigned int len,
  *
  * Sub-TLV types 0 and 1 are valid for any TLV type, whether sub-TLV type 2 is
  * only valid for TLV type 8 (Update). Note that within an Update TLV a missing
- * ChanInfo sub-TLV is not the same as a ChanInfo sub-TLV with an empty body.
+ * Diversity sub-TLV is not the same as a Diversity sub-TLV with an empty body.
  * The former would mean a lack of any claims about the interference, and the
  * latter would state that interference is definitely absent. */
 static void
@@ -253,15 +253,15 @@ subtlvs_print(const u_char *cp, const u_char *ep, const uint8_t tlv_type) {
             printf(" sub-padn");
             cp += sublen;
             break;
-        case MESSAGE_SUB_CHANINFO:
-            printf(" sub-chaninfo");
+        case MESSAGE_SUB_DIVERSITY:
+            printf(" sub-diversity");
             if (sublen == 0) {
                 printf(" empty");
                 break;
             }
             sep = " ";
             while(sublen--) {
-                printf("%s%s", sep, tok2str(chaninfo_str, "%u", *cp++));
+                printf("%s%s", sep, tok2str(diversity_str, "%u", *cp++));
                 sep = "-";
             }
             if(tlv_type != MESSAGE_UPDATE)
index 709f71a5143b8dc9d23523296a9aabe65488b0a8..80877ba58600821f7a0f1bfa15c3f639f18d4e95 100644 (file)
@@ -3,12 +3,12 @@ IP6 (hlim 1, next-header UDP (17) payload length: 20) fe80::68d3:1235:d068:1f9e.
 IP6 (hlim 1, next-header UDP (17) payload length: 20) fe80::3428:af91:251:d626.6697 > ff02::1:6.6697: [udp sum ok] babel 2 (8)
        Hello seqno 40102 interval 2000
 IP6 (hlim 1, next-header UDP (17) payload length: 122) fe80::68d3:1235:d068:1f9e.6697 > ff02::1:6.6697: [udp sum ok] babel 2 (110)
-       Update/prefix/id 2001:660:3301:8063:218:84ff:fe1a:615d/128 metric 1 seqno 32272 interval 8000 sub-chaninfo 6
+       Update/prefix/id 2001:660:3301:8063:218:84ff:fe1a:615d/128 metric 1 seqno 32272 interval 8000 sub-diversity 6
        Next Hop 192.168.4.25
-       Update 192.168.4.195/32 metric 1 seqno 32272 interval 8000 sub-chaninfo 6
-       Update/prefix/id 2001:660:3301:8063:218:f3ff:fea9:914e/128 metric 0 seqno 40149 interval 8000 sub-chaninfo empty
-       Update ::/0 metric 196 seqno 40149 interval 8000 sub-chaninfo empty
-       Update 192.168.4.25/32 metric 0 seqno 40149 interval 8000 sub-chaninfo empty
+       Update 192.168.4.195/32 metric 1 seqno 32272 interval 8000 sub-diversity 6
+       Update/prefix/id 2001:660:3301:8063:218:f3ff:fea9:914e/128 metric 0 seqno 40149 interval 8000 sub-diversity empty
+       Update ::/0 metric 196 seqno 40149 interval 8000 sub-diversity empty
+       Update 192.168.4.25/32 metric 0 seqno 40149 interval 8000 sub-diversity empty
 IP6 (hlim 1, next-header UDP (17) payload length: 36) fe80::68d3:1235:d068:1f9e.6697 > ff02::1:6.6697: [udp sum ok] babel 2 (24)
        Hello seqno 8043 interval 2000
        IHU fe80::3428:af91:251:d626 txcost 96 interval 6000