X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-print.c;h=fe852b4ee172344f8246755b7a2829bafc4dbedd;hb=fd19297bb3d61789aa2a8871e3316b2a4e3e34c3;hp=23110920b88cb84d6fe8973a43a9ee3dce4e943f;hpb=75a75043564dc9b002fffa6c6ad71e0d4d5c892e;p=sliver-openvswitch.git diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 23110920b..fe852b4ee 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -140,7 +140,7 @@ ofp_print_packet_in(struct ds *string, const struct ofp_packet_in *op, struct ofpbuf packet; ofpbuf_use_const(&packet, op->data, data_len); - flow_extract(&packet, 0, ntohs(op->in_port), &flow); + flow_extract(&packet, 0, 0, ntohs(op->in_port), &flow); flow_format(string, &flow); ds_put_char(string, '\n'); } @@ -338,6 +338,10 @@ ofp_print_action(struct ds *s, const union ofp_action *a, learn_format((const struct nx_action_learn *) a, s); break; + case OFPUTIL_NXAST_EXIT: + ds_put_cstr(s, "exit"); + break; + default: break; } @@ -604,21 +608,9 @@ ofp_print_switch_config(struct ds *string, const struct ofp_switch_config *osc) flags = ntohs(osc->flags); - ds_put_cstr(string, " frags="); - switch (flags & OFPC_FRAG_MASK) { - case OFPC_FRAG_NORMAL: - ds_put_cstr(string, "normal"); - flags &= ~OFPC_FRAG_MASK; - break; - case OFPC_FRAG_DROP: - ds_put_cstr(string, "drop"); - flags &= ~OFPC_FRAG_MASK; - break; - case OFPC_FRAG_REASM: - ds_put_cstr(string, "reassemble"); - flags &= ~OFPC_FRAG_MASK; - break; - } + ds_put_format(string, " frags=%s", ofputil_frag_handling_to_string(flags)); + flags &= ~OFPC_FRAG_MASK; + if (flags) { ds_put_format(string, " ***unknown flags 0x%04"PRIx16"***", flags); } @@ -739,9 +731,9 @@ ofp_match_to_string(const struct ofp_match *om, int verbosity) "%u", om->nw_tos); if (om->nw_proto == IPPROTO_ICMP) { print_wild(&f, "icmp_type=", w & OFPFW_ICMP_TYPE, verbosity, - "%d", ntohs(om->icmp_type)); + "%d", ntohs(om->tp_src)); print_wild(&f, "icmp_code=", w & OFPFW_ICMP_CODE, verbosity, - "%d", ntohs(om->icmp_code)); + "%d", ntohs(om->tp_dst)); } else { print_wild(&f, "tp_src=", w & OFPFW_TP_SRC, verbosity, "%d", ntohs(om->tp_src)); @@ -947,15 +939,11 @@ ofp_print_error_msg(struct ds *string, const struct ofp_error_msg *oem) ds_put_printable(string, payload, payload_len); break; - case OFPET_BAD_REQUEST: + default: s = ofp_to_string(payload, payload_len, 1); ds_put_cstr(string, s); free(s); break; - - default: - ds_put_hex_dump(string, payload, payload_len, 0, true); - break; } } @@ -1053,7 +1041,9 @@ ofp_print_flow_stats_reply(struct ds *string, const struct ofp_header *oh) } cls_rule_format(&fs.rule, string); - ds_put_char(string, ' '); + if (string->string[string->length - 1] != ' ') { + ds_put_char(string, ' '); + } ofp_print_actions(string, fs.actions, fs.n_actions); } }