diff options
author | Ben Pfaff <blp@ovn.org> | 2018-06-15 17:06:56 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-06-18 15:25:44 -0700 |
commit | fe2c69f49cb3cb0ab2cc2ae84b364970f5e77392 (patch) | |
tree | d2f803e322099a4d8e754b3d36ce43cc4c94007d /lib/ofp-monitor.c | |
parent | 16ee87263e31dc6520937a0dcefd676f3582d8ee (diff) | |
download | openvswitch-fe2c69f49cb3cb0ab2cc2ae84b364970f5e77392.tar.gz |
ofp-print: Move significant formatting code into more specific .c files.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'lib/ofp-monitor.c')
-rw-r--r-- | lib/ofp-monitor.c | 27 |
1 files changed, 27 insertions, 0 deletions
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 |