summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2019-03-03 19:08:48 +0100
committerSander Vrijders <sander@ouroboros.rocks>2019-03-04 08:57:57 +0100
commite87f2b683446fe424dc5e8fed60456240e080562 (patch)
treef61d89c35ded13d743e207b31ce68546ca53d9e1 /src/lib
parente00c9b13acad23e14df9d5cf4c7868dfd6e1bc55 (diff)
downloadouroboros-e87f2b683446fe424dc5e8fed60456240e080562.tar.gz
ouroboros-e87f2b683446fe424dc5e8fed60456240e080562.zip
ipcpd: Refactor create_r and flow_req_arr
The API calls for the IPCP to inform the IRMd of IPCP creation and incoming flow request had the pid_t in the call. This pid_t is removed and the getpid() call is now placed inside the function. Also refactors the cleanup for the main() functions of some of the lower IPCPs. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dev.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 297c85f7..10b34e4e 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -1262,8 +1262,7 @@ int np1_flow_resp(int flow_id)
return fd;
}
-int ipcp_create_r(pid_t pid,
- int result)
+int ipcp_create_r(int result)
{
irm_msg_t msg = IRM_MSG__INIT;
irm_msg_t * recv_msg;
@@ -1271,7 +1270,7 @@ int ipcp_create_r(pid_t pid,
msg.code = IRM_MSG_CODE__IPCP_CREATE_R;
msg.has_pid = true;
- msg.pid = pid;
+ msg.pid = getpid();
msg.has_result = true;
msg.result = result;
@@ -1290,8 +1289,7 @@ int ipcp_create_r(pid_t pid,
return ret;
}
-int ipcp_flow_req_arr(pid_t pid,
- const uint8_t * dst,
+int ipcp_flow_req_arr(const uint8_t * dst,
size_t len,
qosspec_t qs)
{
@@ -1304,7 +1302,7 @@ int ipcp_flow_req_arr(pid_t pid,
msg.code = IRM_MSG_CODE__IPCP_FLOW_REQ_ARR;
msg.has_pid = true;
- msg.pid = pid;
+ msg.pid = getpid();
msg.has_hash = true;
msg.hash.len = len;
msg.hash.data = (uint8_t *) dst;