]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-openflow-1.0.c
Travis: avoid useless lines from 'brew' command in the logs
[tcpdump] / print-openflow-1.0.c
index c6ba6a93e5eb5c367f3c011b62c611ad37de36eb..590caba48c4e7118f539a708f0c9dfd91884c418 100644 (file)
@@ -8,6 +8,16 @@
  *
  * [OF10] http://www.openflow.org/documents/openflow-spec-v1.0.0.pdf
  *
+ * Most functions in this file take 3 arguments into account:
+ * * cp -- the pointer to the first octet to decode
+ * * len -- the length of the current structure as declared on the wire
+ * * ep -- the pointer to the end of the captured frame
+ * They return either the pointer to the next not-yet-decoded part of the frame
+ * or the value of ep, which means the current frame processing is over as it
+ * has been fully decoded or is malformed or truncated. This way it is possible
+ * to chain and nest such functions uniformly to decode an OF1.0 message, which
+ * consists of several layers of nested structures.
+ *
  * Decoding of Ethernet frames nested in OFPT_PACKET_IN and OFPT_PACKET_OUT
  * messages is done only when the verbosity level set by command-line argument
  * is "-vvv" or higher. In that case the verbosity level is temporarily
@@ -800,6 +810,10 @@ of10_bsn_message_print(netdissect_options *ndo,
                cp += 3;
                break;
        case BSN_GET_INTERFACES_REQUEST:
+       case BSN_GET_L2_TABLE_REQUEST:
+       case BSN_BW_ENABLE_GET_REQUEST:
+       case BSN_BW_CLEAR_DATA_REQUEST:
+       case BSN_HYBRID_GET_REQUEST:
                /*
                 *  0                   1                   2                   3
                 *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
@@ -811,6 +825,24 @@ of10_bsn_message_print(netdissect_options *ndo,
                if (len != 4)
                        goto corrupt;
                break;
+       case BSN_VIRTUAL_PORT_REMOVE_REQUEST:
+               /*
+                *  0                   1                   2                   3
+                *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+                * +---------------+---------------+---------------+---------------+
+                * |                            subtype                            |
+                * +---------------+---------------+---------------+---------------+
+                * |                           vport_no                            |
+                * +---------------+---------------+---------------+---------------+
+                *
+                */
+               if (len != 8)
+                       goto corrupt;
+               /* vport_no */
+               ND_TCHECK2(*cp, 4);
+               ND_PRINT((ndo, ", vport_no %u", EXTRACT_32BITS(cp)));
+               cp += 4;
+               break;
        default:
                ND_TCHECK2(*cp, len - 4);
                cp += len - 4;