From fe2c69f49cb3cb0ab2cc2ae84b364970f5e77392 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 15 Jun 2018 17:06:56 -0700 Subject: ofp-print: Move significant formatting code into more specific .c files. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- lib/ofp-monitor.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'lib/ofp-monitor.c') diff --git a/lib/ofp-monitor.c b/lib/ofp-monitor.c index 3d117cae8..3e02834a2 100644 --- a/lib/ofp-monitor.c +++ b/lib/ofp-monitor.c @@ -880,6 +880,33 @@ ofputil_decode_requestforward(const struct ofp_header *outer, return 0; } +void +ofputil_format_requestforward(struct ds *string, + enum ofp_version ofp_version, + const struct ofputil_requestforward *rf, + const struct ofputil_port_map *port_map, + const struct ofputil_table_map *table_map) +{ + ds_put_cstr(string, " reason="); + + switch (rf->reason) { + case OFPRFR_GROUP_MOD: + ds_put_cstr(string, "group_mod"); + ofputil_group_mod_format__(string, ofp_version, rf->group_mod, + port_map, table_map); + break; + + case OFPRFR_METER_MOD: + ds_put_cstr(string, "meter_mod"); + ofputil_format_meter_mod(string, rf->meter_mod); + break; + + case OFPRFR_N_REASONS: + OVS_NOT_REACHED(); + } +} + + /* Frees the content of 'rf', which should have been initialized through a * successful call to ofputil_decode_requestforward(). */ void -- cgit v1.2.1