const struct tok *table = (vendor & 0xff000000) == 0 ? oui_values : onf_exp_str;
return tok2str(table, "unknown", vendor);
}
static void
of_header_print(netdissect_options *ndo, const uint8_t version, const uint8_t type,
const struct tok *table = (vendor & 0xff000000) == 0 ? oui_values : onf_exp_str;
return tok2str(table, "unknown", vendor);
}
static void
of_header_print(netdissect_options *ndo, const uint8_t version, const uint8_t type,
ND_PRINT((ndo, "\n\tversion unknown (0x%02x), type 0x%02x, length %u, xid 0x%08x",
version, type, length, xid));
}
/* Print a single OpenFlow message. */
static const u_char *
ND_PRINT((ndo, "\n\tversion unknown (0x%02x), type 0x%02x, length %u, xid 0x%08x",
version, type, length, xid));
}
/* Print a single OpenFlow message. */
static const u_char *
cp += 4;
/* Message length includes the header length and a message always includes
* the basic header. A message length underrun fails decoding of the rest of
cp += 4;
/* Message length includes the header length and a message always includes
* the basic header. A message length underrun fails decoding of the rest of
* segment. */
if (length < OF_HEADER_LEN) {
of_header_print(ndo, version, type, length, xid);
* segment. */
if (length < OF_HEADER_LEN) {
of_header_print(ndo, version, type, length, xid);
}
/* Decode known protocol versions further without printing the header (the
* type decoding is version-specific. */
}
/* Decode known protocol versions further without printing the header (the
* type decoding is version-specific. */
return of10_header_body_print(ndo, cp, ep, type, length, xid);
default:
of_header_print(ndo, version, type, length, xid);
return of10_header_body_print(ndo, cp, ep, type, length, xid);
default:
of_header_print(ndo, version, type, length, xid);
-corrupt: /* fail current packet */
- ND_PRINT((ndo, "%s", cstr));
- ND_TCHECK2(*cp, ep - cp);
+invalid: /* fail current packet */
+ ND_PRINT((ndo, "%s", istr));
+ ND_TCHECK_LEN(cp, ep - cp);
/* Print a TCP segment worth of OpenFlow messages presuming the segment begins
* on a message boundary. */
void
/* Print a TCP segment worth of OpenFlow messages presuming the segment begins
* on a message boundary. */
void
const u_char *ep = cp + len;
ND_PRINT((ndo, ": OpenFlow"));
const u_char *ep = cp + len;
ND_PRINT((ndo, ": OpenFlow"));