From 4060efec26115dbb9e68da67bc482a12b4f80ea8 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Wed, 30 Aug 2017 17:11:22 +0200 Subject: lib: Add fccntl configuration command This replaces the flow_set_* commands with a single fccntl command that can configure flows and the FRCT instance. For more details, see "man 3 fccntl". --- src/tools/cbr/cbr_server.c | 4 ++-- src/tools/operf/operf_client.c | 4 ++-- src/tools/oping/oping_client.c | 4 ++-- src/tools/oping/oping_server.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/tools') diff --git a/src/tools/cbr/cbr_server.c b/src/tools/cbr/cbr_server.c index a2e930e5..b25b09e8 100644 --- a/src/tools/cbr/cbr_server.c +++ b/src/tools/cbr/cbr_server.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include @@ -84,7 +84,7 @@ static void handle_flow(int fd) alive = iv_start; ts_add(&iv_start, &intv, &iv_end); - flow_set_flags(fd, FLOW_O_NONBLOCK); + fccntl(fd, FLOWSFLAGS, FLOWFNONBLOCK); while (!stop) { clock_gettime(CLOCK_REALTIME, &now); diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c index 4ad26d13..df486380 100644 --- a/src/tools/operf/operf_client.c +++ b/src/tools/operf/operf_client.c @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include @@ -68,7 +68,7 @@ void * reader(void * o) int fd = *((int *) o); int msg_len = 0; - flow_set_timeout(fd, &timeout); + fccntl(fd, FLOWSRCVTIMEO, &timeout); while ((msg_len = flow_read(fd, buf, OPERF_BUF_SIZE)) != -ETIMEDOUT) { if (msg_len != client.size) { diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index db0ef199..ca8c0e72 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include @@ -60,7 +60,7 @@ void * reader(void * o) double ms = 0; double d = 0; - flow_set_timeout(fd, &timeout); + fccntl(fd, FLOWSRCVTIMEO, &timeout); while (client.rcvd != client.count) { msg_len = flow_read(fd, buf, OPING_BUF_SIZE); diff --git a/src/tools/oping/oping_server.c b/src/tools/oping/oping_server.c index 6a535caf..0371f90f 100644 --- a/src/tools/oping/oping_server.c +++ b/src/tools/oping/oping_server.c @@ -130,7 +130,7 @@ void * accept_thread(void * o) server.times[fd] = now; pthread_mutex_unlock(&server.lock); - flow_set_flags(fd, FLOW_O_NONBLOCK | FLOW_O_RDWR); + fccntl(fd, FLOWSFLAGS, FLOWFNONBLOCK | FLOWFRDWR); } return (void *) 0; -- cgit v1.2.3