]> The Tcpdump Group git mirrors - tcpdump/commitdiff
added decoding of RPL DAO and DAOACK sub-options
authorMichael Richardson <[email protected]>
Sat, 4 Jan 2014 15:56:41 +0000 (10:56 -0500)
committerMichael Richardson <[email protected]>
Sat, 4 Jan 2014 15:56:41 +0000 (10:56 -0500)
print-icmp6.c
tests/19-pickdag.out
tests/19-pickdagvvv.out

index b240c7bd329f4b552fc7b900df0ba5eabe9f7bf2..c4f99878d6bbc00578587effc7ba033cab83c313 100644 (file)
@@ -741,6 +741,7 @@ rpl_dao_print(netdissect_options *ndo,
               const u_char *bp, u_int length)
 {
         struct nd_rpl_dao *dao = (struct nd_rpl_dao *)bp;
+        u_char *dao_end = (u_char *)&dao[1];
         char dagid_str[65];
 
         ND_TCHECK(*dao);
@@ -749,6 +750,7 @@ rpl_dao_print(netdissect_options *ndo,
         if(RPL_DAO_D(dao->rpl_flags)) {
                 ND_TTEST2(dao->rpl_dagid, 16);
                 rpl_format_dagid(dagid_str, dao->rpl_dagid);
+                dao_end += DAGID_LEN;
         }
 
         ND_PRINT((ndo, " [dagid:%s,seq:%u,instance:%u]",
@@ -756,7 +758,10 @@ rpl_dao_print(netdissect_options *ndo,
                   dao->rpl_daoseq,
                   dao->rpl_instanceid));
 
-        /* need to print the DAO TARGET options */
+        if(ndo->ndo_vflag > 1) {
+                struct rpl_dio_genoption *opt = (struct rpl_dio_genoption *)dao_end;
+                rpl_dio_printopt(ndo, opt, length);
+        }
        return;
 
 trunc:
@@ -770,6 +775,7 @@ rpl_daoack_print(netdissect_options *ndo,
               const u_char *bp, u_int length)
 {
         struct nd_rpl_daoack *daoack = (struct nd_rpl_daoack *)bp;
+        u_char *daoack_end = (u_char *)&daoack[1];
         char dagid_str[65];
 
         ND_TCHECK(*daoack);
@@ -778,6 +784,7 @@ rpl_daoack_print(netdissect_options *ndo,
         if(RPL_DAOACK_D(daoack->rpl_flags)) {
                 ND_TTEST2(daoack->rpl_dagid, 16);
                 rpl_format_dagid(dagid_str, daoack->rpl_dagid);
+                daoack_end += DAGID_LEN;
         }
 
         ND_PRINT((ndo, " [dagid:%s,seq:%u,instance:%u,status:%u]",
@@ -785,6 +792,12 @@ rpl_daoack_print(netdissect_options *ndo,
                   daoack->rpl_daoseq,
                   daoack->rpl_instanceid,
                   daoack->rpl_status));
+
+        /* no officially defined options for DAOACK, but print anyway, we find*/
+        if(ndo->ndo_vflag > 1) {
+                struct rpl_dio_genoption *opt = (struct rpl_dio_genoption *)daoack_end;
+                rpl_dio_printopt(ndo, opt, length);
+        }
        return;
 
 trunc:
index 56e5efc82f91f76e8b00e812327318bd683cae55..0a81604a9426b54fdc59d220837972b4cd416cb4 100644 (file)
@@ -1,2 +1,2 @@
 IP6 (hlim 64, next-header ICMPv6 (58) payload length: 48) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)DODAG Information Object [dagid:T10x0,seq:10,instance:42,rank:768,grounded,mop:storing,prf:0] opt:destprefix len:15  opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0
-IP6 (hlim 64, next-header ICMPv6 (58) payload length: 56) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:T10x0,seq:10,instance:42]
+IP6 (hlim 64, next-header ICMPv6 (58) payload length: 56) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:T10x0,seq:10,instance:42] opt:rpltarget len:25  opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0
index 6716187f321a29079f45371c1f187a92758cba52..fc6cbd467a6d8ed1eb639d5bacd05b6352847ec1 100644 (file)
@@ -1,2 +1,2 @@
 IP6 (hlim 64, next-header ICMPv6 (58) payload length: 48) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)DODAG Information Object [dagid:T10x0,seq:10,instance:42,rank:768,grounded,mop:storing,prf:0] opt:destprefix len:15  0x0000:  3000 0000 0000 2001 0db8 0001 00 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0
-IP6 (hlim 64, next-header ICMPv6 (58) payload length: 56) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:T10x0,seq:10,instance:42]
+IP6 (hlim 64, next-header ICMPv6 (58) payload length: 56) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:T10x0,seq:10,instance:42] opt:rpltarget len:25  0x0000:  0080 2001 0db8 0001 0000 0216 3eff fe11 0x0010:  3424 0000 0000 00 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0