summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-10-06 18:06:47 +0200
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-10-06 18:06:47 +0200
commit0b2e5c5410580c755cef02114e51f15b19cfaffa (patch)
tree63d684e6057c9caa43739b599d54a72f9959d4f8 /src/ipcpd/ipcp.c
parentbfc29ca20406ccd69363b0f9796987534318e7ae (diff)
parentd9ad3852613cda026d4520b5c608ada7433dd7d9 (diff)
downloadouroboros-0b2e5c5410580c755cef02114e51f15b19cfaffa.tar.gz
ouroboros-0b2e5c5410580c755cef02114e51f15b19cfaffa.zip
Merge branch 'testing' into be
Diffstat (limited to 'src/ipcpd/ipcp.c')
-rw-r--r--src/ipcpd/ipcp.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c
index 0b5ddf11..f8df5640 100644
--- a/src/ipcpd/ipcp.c
+++ b/src/ipcpd/ipcp.c
@@ -20,13 +20,24 @@
* Foundation, Inc., http://www.fsf.org/about/contact/.
*/
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
+#define _POSIX_C_SOURCE 200112L
+#define __XSI_VISIBLE 500
+#endif
+
#if defined(__linux__) && !defined(DISABLE_CORE_LOCK)
#define _GNU_SOURCE
#define NPROC (sysconf(_SC_NPROCESSORS_ONLN))
#endif
+#if defined(__linux__) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE
+#else
#define _POSIX_C_SOURCE 200112L
#define __XSI_VISIBLE 500
+#endif
#include "config.h"
@@ -194,6 +205,7 @@ static void * mainloop(void * o)
layer_info_msg_t layer_info = LAYER_INFO_MSG__INIT;
int fd = -1;
struct cmd * cmd;
+ qosspec_t qs;
ret_msg.code = IPCP_MSG_CODE__IPCP_REPLY;
@@ -418,12 +430,13 @@ static void * mainloop(void * o)
break;
}
+ qs = msg_to_spec(msg->qosspec);
fd = np1_flow_alloc(msg->pid,
- msg->port_id,
- msg->qoscube);
+ msg->flow_id,
+ qs);
if (fd < 0) {
- log_err("Failed allocating fd on port_id %d.",
- msg->port_id);
+ log_err("Failed allocating fd on flow_id %d.",
+ msg->flow_id);
ret_msg.result = -1;
break;
}
@@ -431,7 +444,7 @@ static void * mainloop(void * o)
ret_msg.result =
ipcpi.ops->ipcp_flow_alloc(fd,
msg->hash.data,
- msg->qoscube);
+ qs);
break;
case IPCP_MSG_CODE__IPCP_FLOW_ALLOC_RESP:
ret_msg.has_result = true;
@@ -448,10 +461,10 @@ static void * mainloop(void * o)
}
if (!msg->response) {
- fd = np1_flow_resp(msg->port_id);
+ fd = np1_flow_resp(msg->flow_id);
if (fd < 0) {
log_warn("Port_id %d is not known.",
- msg->port_id);
+ msg->flow_id);
ret_msg.result = -1;
break;
}
@@ -475,10 +488,10 @@ static void * mainloop(void * o)
break;
}
- fd = np1_flow_dealloc(msg->port_id);
+ fd = np1_flow_dealloc(msg->flow_id);
if (fd < 0) {
- log_warn("Could not deallocate port_id %d.",
- msg->port_id);
+ log_warn("Could not deallocate flow_id %d.",
+ msg->flow_id);
ret_msg.result = -1;
break;
}