]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-openflow.c
VRRP: top off the previous change
[tcpdump] / print-openflow.c
index 9da3597fca7be26a6bfee9ef80f0a3007d499481..d37f7ba34d5668fa6a32d1a4fb80f498a34e530f 100644 (file)
 
 #include "interface.h"
 #include "extract.h"
+#include "openflow.h"
 
-#define OF_HEADER_LEN 8
+static const char tstr[] = " [|openflow]";
+static const char cstr[] = " (corrupt)";
+
+#define OF_VER_1_0    0x01
 
 static void
 of_header_print(const uint8_t version, const uint8_t type,
@@ -85,6 +89,8 @@ of_header_body_print(const u_char *cp, const u_char *ep) {
        /* Decode known protocol versions further without printing the header (the
         * type decoding is version-specific. */
        switch (version) {
+       case OF_VER_1_0:
+               return of10_header_body_print(cp, ep, type, length, xid);
        default:
                of_header_print(version, type, length, xid);
                TCHECK2(*cp, length - OF_HEADER_LEN);
@@ -92,11 +98,11 @@ of_header_body_print(const u_char *cp, const u_char *ep) {
        }
 
 corrupt: /* fail current packet */
-       printf(" (corrupt)");
+       printf("%s", cstr);
        TCHECK2(*cp, ep - cp);
        return ep;
 trunc:
-       printf(" [|openflow]");
+       printf("%s", tstr);
        return ep;
 }