aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-04-05 10:24:56 -0700
committerBen Pfaff <blp@nicira.com>2012-04-18 20:28:40 -0700
commit7393104d1a31b5b256e491ec689cc7358f101280 (patch)
treea78bf7ee5c63349a93dec42319a1b8ef3d048061 /tests
parentb99d3ceeedd2c5533c13f9794616fc6d9c49c0de (diff)
dpif: Include TCP flags in "ovs-dpctl dump-flows" output.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-netflow.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/tests/test-netflow.c b/tests/test-netflow.c
index 7d028874..5f30c636 100644
--- a/tests/test-netflow.c
+++ b/tests/test-netflow.c
@@ -24,6 +24,7 @@
#include "command-line.h"
#include "daemon.h"
+#include "dynamic-string.h"
#include "netflow.h"
#include "ofpbuf.h"
#include "packets.h"
@@ -87,31 +88,10 @@ print_netflow(struct ofpbuf *buf)
printf(", TCP %"PRIu16" > %"PRIu16,
ntohs(rec->src_port), ntohs(rec->dst_port));
if (rec->tcp_flags) {
- putchar(' ');
- if (rec->tcp_flags & TCP_SYN) {
- putchar('S');
- }
- if (rec->tcp_flags & TCP_FIN) {
- putchar('F');
- }
- if (rec->tcp_flags & TCP_PSH) {
- putchar('P');
- }
- if (rec->tcp_flags & TCP_RST) {
- putchar('R');
- }
- if (rec->tcp_flags & TCP_URG) {
- putchar('U');
- }
- if (rec->tcp_flags & TCP_ACK) {
- putchar('.');
- }
- if (rec->tcp_flags & 0x40) {
- printf("[40]");
- }
- if (rec->tcp_flags & 0x80) {
- printf("[80]");
- }
+ struct ds s = DS_EMPTY_INITIALIZER;
+ packet_format_tcp_flags(&s, rec->tcp_flags);
+ printf(" %s", ds_cstr(&s));
+ ds_destroy(&s);
}
break;