From f6b898da88e06399aedbfec87296602aef5c09c2 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 29 Aug 2017 14:30:35 +0200 Subject: dev: Revise fqueue API and add man pages --- src/ipcpd/shim-udp/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/ipcpd/shim-udp') diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index b6f516bd..a94472b2 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -79,7 +79,7 @@ struct { struct sockaddr_in s_saddr; int s_fd; - flow_set_t * np1_flows; + fset_t * np1_flows; fqueue_t * fq; fd_set flow_fd_s; /* bidir mappings of (n - 1) file descriptor to (n) flow descriptor */ @@ -110,20 +110,20 @@ static int udp_data_init(void) FD_ZERO(&udp_data.flow_fd_s); - udp_data.np1_flows = flow_set_create(); + udp_data.np1_flows = fset_create(); if (udp_data.np1_flows == NULL) return -ENOMEM; udp_data.fq = fqueue_create(); if (udp_data.fq == NULL) { - flow_set_destroy(udp_data.np1_flows); + fset_destroy(udp_data.np1_flows); return -ENOMEM; } udp_data.shim_data = shim_data_create(); if (udp_data.shim_data == NULL) { fqueue_destroy(udp_data.fq); - flow_set_destroy(udp_data.np1_flows); + fset_destroy(udp_data.np1_flows); return -ENOMEM; } @@ -136,7 +136,7 @@ static int udp_data_init(void) static void udp_data_fini(void) { - flow_set_destroy(udp_data.np1_flows); + fset_destroy(udp_data.np1_flows); fqueue_destroy(udp_data.fq); shim_data_destroy(udp_data.shim_data); @@ -518,7 +518,7 @@ static void * ipcp_udp_sdu_loop(void * o) (void) o; while (ipcp_get_state() == IPCP_OPERATIONAL) { - flow_event_wait(udp_data.np1_flows, udp_data.fq, &timeout); + fevent(udp_data.np1_flows, udp_data.fq, &timeout); while ((fd = fqueue_next(udp_data.fq)) >= 0) { if (ipcp_flow_read(fd, &sdb)) { log_err("Bad read from fd %d.", fd); @@ -962,7 +962,7 @@ static int ipcp_udp_flow_alloc(int fd, udp_data.fd_to_uf[fd].skfd = skfd; udp_data.uf_to_fd[skfd] = fd; - flow_set_add(udp_data.np1_flows, fd); + fset_add(udp_data.np1_flows, fd); pthread_rwlock_unlock(&udp_data.flows_lock); @@ -1038,7 +1038,7 @@ static int ipcp_udp_flow_alloc_resp(int fd, set_fd(skfd); - flow_set_add(udp_data.np1_flows, fd); + fset_add(udp_data.np1_flows, fd); pthread_rwlock_unlock(&udp_data.flows_lock); @@ -1064,7 +1064,7 @@ static int ipcp_udp_flow_dealloc(int fd) pthread_rwlock_wrlock(&udp_data.flows_lock); - flow_set_del(udp_data.np1_flows, fd); + fset_del(udp_data.np1_flows, fd); skfd = udp_data.fd_to_uf[fd].skfd; -- cgit v1.2.3