#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,
/* 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);
}
corrupt: /* fail current packet */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp, ep - cp);
return ep;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}