ds_put_format(string, "***decode error: %s***\n", ofperr_get_name(error));
}
+static void
+ofp_print_hello(struct ds *string, const struct ofp_header *oh)
+{
+ uint32_t allowed_versions;
+ bool ok;
+
+ ok = ofputil_decode_hello(oh, &allowed_versions);
+
+ ds_put_cstr(string, "\n version bitmap: ");
+ ofputil_format_version_bitmap(string, allowed_versions);
+
+ if (!ok) {
+ ds_put_cstr(string, "\n unknown data in hello:\n");
+ ds_put_hex_dump(string, oh, ntohs(oh->length), 0, true);
+ }
+}
+
static void
ofp_print_error_msg(struct ds *string, const struct ofp_header *oh)
{
ofp_header_to_string__(oh, raw, string);
switch (ofptype_from_ofpraw(raw)) {
case OFPTYPE_HELLO:
- ds_put_char(string, '\n');
- ds_put_hex_dump(string, oh + 1, ntohs(oh->length) - sizeof *oh,
- 0, true);
+ ofp_print_hello(string, oh);
break;
case OFPTYPE_ERROR: