/*
- * Copyright (c) 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "unixctl.h"
#include "util.h"
#include "vlog.h"
+#include "ovstest.h"
static void usage(void) NO_RETURN;
static void parse_options(int argc, char *argv[]);
putchar('\n');
}
- if (buf->size) {
- printf("%"PRIuSIZE" extra bytes after last record\n", buf->size);
+ if (ofpbuf_size(buf)) {
+ printf("%"PRIu32" extra bytes after last record\n", ofpbuf_size(buf));
}
}
-int
-main(int argc, char *argv[])
+static void
+test_netflow_main(int argc, char *argv[])
{
struct unixctl_server *server;
enum { MAX_RECV = 1500 };
ofpbuf_clear(&buf);
do {
- retval = read(sock, buf.data, buf.allocated);
+ retval = read(sock, ofpbuf_data(&buf), buf.allocated);
} while (retval < 0 && errno == EINTR);
if (retval > 0) {
ofpbuf_put_uninit(&buf, retval);
unixctl_server_wait(server);
poll_block();
}
-
- return 0;
}
static void
*exiting = true;
unixctl_command_reply(conn, NULL);
}
+
+OVSTEST_REGISTER("test-netflow", test_netflow_main);