From f6abc2e6a02557e82ad0d1e5440653bb8884ecc8 Mon Sep 17 00:00:00 2001 From: Patrice Buriez Date: Wed, 25 Oct 2017 20:30:34 +0200 Subject: Merge changes from PROX-v041 Change-Id: Ie6d4e7ce22c27967117a446626f5923643397812 Signed-off-by: Patrice Buriez --- VNFs/DPPD-PROX/input.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'VNFs/DPPD-PROX/input.c') diff --git a/VNFs/DPPD-PROX/input.c b/VNFs/DPPD-PROX/input.c index bb956bcd..5eb5e4ce 100644 --- a/VNFs/DPPD-PROX/input.c +++ b/VNFs/DPPD-PROX/input.c @@ -74,6 +74,33 @@ static int tsc_diff_to_tv(uint64_t beg, uint64_t end, struct timeval *tv) return 0; } +void input_proc(void) +{ + struct timeval tv; + fd_set in_fd; + int ret = 1; + + tv.tv_sec = 0; + tv.tv_usec = 0; + while (ret != 0) { + FD_ZERO(&in_fd); + + for (int i = 0; i < n_inputs; ++i) { + FD_SET(inputs[i]->fd, &in_fd); + } + + ret = select(max_input_fd + 1, &in_fd, NULL, NULL, &tv); + + if (ret > 0) { + for (int i = 0; i < n_inputs; ++i) { + if (FD_ISSET(inputs[i]->fd, &in_fd)) { + inputs[i]->proc_input(inputs[i]); + } + } + } + } +} + void input_proc_until(uint64_t deadline) { struct timeval tv; -- cgit 1.2.3-korg