summaryrefslogtreecommitdiff
path: root/src/ipcpd/local/main.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-02-07 20:45:14 +0100
committerdimitri staessens <[email protected]>2017-02-07 21:00:45 +0100
commitbfb86b66c8e7d9d8dc45d9075a4db6d10931dccf (patch)
tree022fbb7b2a54ba72affa12938b3bf79abc648b41 /src/ipcpd/local/main.c
parent1bf2dd6aef3af6c81794c0551278373e44310b5c (diff)
downloadouroboros-bfb86b66c8e7d9d8dc45d9075a4db6d10931dccf.tar.gz
ouroboros-bfb86b66c8e7d9d8dc45d9075a4db6d10931dccf.zip
ipcpd: Refactor ipcpi struct
The ipcp-ops header was removed and merged into ipcp.h. The common components dif_name and ipcp_type have been moved to the main ipcp struct. After this move, ipcp_data only contained shim information, so it was renamed to shim_data. The ipcp_init() function checks the type and will only include the shim_data if the type is not an IPCP_NORMAL. All ipcps have been adapted to this change in API.
Diffstat (limited to 'src/ipcpd/local/main.c')
-rw-r--r--src/ipcpd/local/main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c
index c2b22732..2cba053a 100644
--- a/src/ipcpd/local/main.c
+++ b/src/ipcpd/local/main.c
@@ -115,7 +115,9 @@ static void * ipcp_local_sdu_loop(void * o)
return (void *) 0;
}
-void ipcp_sig_handler(int sig, siginfo_t * info, void * c)
+void ipcp_sig_handler(int sig,
+ siginfo_t * info,
+ void * c)
{
(void) c;
@@ -176,7 +178,7 @@ static int ipcp_local_name_reg(char * name)
pthread_rwlock_rdlock(&ipcpi.state_lock);
- if (ipcp_data_reg_add_entry(ipcpi.data, name_dup)) {
+ if (shim_data_reg_add_entry(ipcpi.shim_data, name_dup)) {
pthread_rwlock_unlock(&ipcpi.state_lock);
LOG_DBG("Failed to add %s to local registry.", name);
free(name_dup);
@@ -194,7 +196,7 @@ static int ipcp_local_name_unreg(char * name)
{
pthread_rwlock_rdlock(&ipcpi.state_lock);
- ipcp_data_reg_del_entry(ipcpi.data, name);
+ shim_data_reg_del_entry(ipcpi.shim_data, name);
pthread_rwlock_unlock(&ipcpi.state_lock);
@@ -209,7 +211,7 @@ static int ipcp_local_name_query(char * name)
pthread_rwlock_rdlock(&ipcpi.state_lock);
- ret = (ipcp_data_reg_has(ipcpi.data, name) ? 0 : -1);
+ ret = (shim_data_reg_has(ipcpi.shim_data, name) ? 0 : -1);
pthread_rwlock_unlock(&ipcpi.state_lock);
@@ -253,7 +255,8 @@ static int ipcp_local_flow_alloc(int fd,
return 0;
}
-static int ipcp_local_flow_alloc_resp(int fd, int response)
+static int ipcp_local_flow_alloc_resp(int fd,
+ int response)
{
int out_fd = -1;
int ret = -1;
@@ -325,7 +328,8 @@ static struct ipcp_ops local_ops = {
.ipcp_flow_dealloc = ipcp_local_flow_dealloc
};
-int main(int argc, char * argv[])
+int main(int argc,
+ char * argv[])
{
struct sigaction sig_act;
sigset_t sigset;