summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.h
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-05-14 16:39:27 +0200
committerdimitri staessens <[email protected]>2016-05-14 21:34:04 +0200
commit037fec33cda726d0078e23798f462ad273153dd5 (patch)
tree25c9ef679a0aaa93e5f01f2a68512d8eaf76f3e7 /src/ipcpd/ipcp.h
parentc56a4ed3b865b4b240c6f01809c935b7b86d160b (diff)
downloadouroboros-037fec33cda726d0078e23798f462ad273153dd5.tar.gz
ouroboros-037fec33cda726d0078e23798f462ad273153dd5.zip
ipcpd: shim-udp: complete locking
Added necessary locks for the shim-udp. This PR also improves thread management, the main thread now starts a mainloop thread, which spawns sdu handler threads when it the IPCP is enrolled. If the IPCP exits the enrolled state, the sdu loop is cancelled.
Diffstat (limited to 'src/ipcpd/ipcp.h')
-rw-r--r--src/ipcpd/ipcp.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h
index 393af994..c9002d4d 100644
--- a/src/ipcpd/ipcp.h
+++ b/src/ipcpd/ipcp.h
@@ -23,6 +23,8 @@
#ifndef IPCPD_IPCP_H
#define IPCPD_IPCP_H
+#include <ouroboros/rw_lock.h>
+
#include "ipcp-ops.h"
#include "ipcp-data.h"
@@ -38,11 +40,13 @@ enum ipcp_state {
struct ipcp {
struct ipcp_data * data;
struct ipcp_ops * ops;
+ int irmd_fd;
enum ipcp_state state;
- int irmd_fd;
+ rw_lock_t state_lock;
};
+struct ipcp * ipcp_instance_create();
void * ipcp_main_loop(void * o);
void * ipcp_sdu_loop(void * o);
int ipcp_arg_check(int argc, char * argv[]);