git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto: Inline trivial functions.
[sliver-openvswitch.git]
/
tests
/
test-sflow.c
diff --git
a/tests/test-sflow.c
b/tests/test-sflow.c
index
deebd82
..
a028ac7
100644
(file)
--- a/
tests/test-sflow.c
+++ b/
tests/test-sflow.c
@@
-17,6
+17,7
@@
#include <config.h>
#include <config.h>
+#include <arpa/inet.h>
#include <errno.h>
#include <getopt.h>
#include <signal.h>
#include <errno.h>
#include <getopt.h>
#include <signal.h>
@@
-35,6
+36,7
@@
#include "unixctl.h"
#include "util.h"
#include "vlog.h"
#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[]);
static void usage(void) NO_RETURN;
static void parse_options(int argc, char *argv[]);
@@
-468,13
+470,13
@@
static void
print_sflow(struct ofpbuf *buf)
{
char *dgram_buf;
print_sflow(struct ofpbuf *buf)
{
char *dgram_buf;
- int dgram_len =
buf->size
;
+ int dgram_len =
ofpbuf_size(buf)
;
struct sflow_xdr xdrDatagram;
struct sflow_xdr *x = &xdrDatagram;
memset(x, 0, sizeof *x);
if (SFLOWXDR_try(x)) {
struct sflow_xdr xdrDatagram;
struct sflow_xdr *x = &xdrDatagram;
memset(x, 0, sizeof *x);
if (SFLOWXDR_try(x)) {
- SFLOWXDR_assert(x, (dgram_buf = ofpbuf_try_pull(buf,
buf->size
)));
+ SFLOWXDR_assert(x, (dgram_buf = ofpbuf_try_pull(buf,
ofpbuf_size(buf)
)));
sflowxdr_init(x, dgram_buf, dgram_len);
SFLOWXDR_assert(x, dgram_len >= SFLOW_MIN_LEN);
process_datagram(x);
sflowxdr_init(x, dgram_buf, dgram_len);
SFLOWXDR_assert(x, dgram_len >= SFLOW_MIN_LEN);
process_datagram(x);
@@
-484,8
+486,8
@@
print_sflow(struct ofpbuf *buf)
}
}
}
}
-int
-main(int argc, char *argv[])
+static void
+
test_sflow_
main(int argc, char *argv[])
{
struct unixctl_server *server;
enum { MAX_RECV = 1500 };
{
struct unixctl_server *server;
enum { MAX_RECV = 1500 };
@@
-529,7
+531,7
@@
main(int argc, char *argv[])
ofpbuf_clear(&buf);
do {
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);
} while (retval < 0 && errno == EINTR);
if (retval > 0) {
ofpbuf_put_uninit(&buf, retval);
@@
-545,8
+547,6
@@
main(int argc, char *argv[])
unixctl_server_wait(server);
poll_block();
}
unixctl_server_wait(server);
poll_block();
}
-
- return 0;
}
static void
}
static void
@@
-612,3
+612,5
@@
test_sflow_exit(struct unixctl_conn *conn,
*exiting = true;
unixctl_command_reply(conn, NULL);
}
*exiting = true;
unixctl_command_reply(conn, NULL);
}
+
+OVSTEST_REGISTER("test-sflow", test_sflow_main);