diff options
author | Dimitri Staessens <dimitri.staessens@ugent.be> | 2018-10-04 18:06:32 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2018-10-05 09:07:47 +0200 |
commit | b802b25ddfe6f1b6ecabe3ba70e3dac2e99e7a50 (patch) | |
tree | 94e787f0f0ca1f0254b3728b0156b2e3283d8518 /src/ipcpd/ipcp.c | |
parent | 937adca2a718b160b6d42bb8a3f28d96321fdb49 (diff) | |
download | ouroboros-b802b25ddfe6f1b6ecabe3ba70e3dac2e99e7a50.tar.gz ouroboros-b802b25ddfe6f1b6ecabe3ba70e3dac2e99e7a50.zip |
lib: Pass qosspec at flow allocation
The flow allocator now passes the full qos specification to the
endpoint, instead of just a cube. This is a more flexible
architecture, as it makes QoS cubes internal to the layers.
Adds endianness transforms for the flow allocator protocol in the
normal IPCP.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/ipcpd/ipcp.c')
-rw-r--r-- | src/ipcpd/ipcp.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 5ea54533..e415bbd9 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -20,6 +20,13 @@ * 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)) @@ -198,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; @@ -422,9 +430,10 @@ static void * mainloop(void * o) break; } + qs = msg_to_spec(msg->qosspec); fd = np1_flow_alloc(msg->pid, msg->port_id, - msg->qoscube); + qs); if (fd < 0) { log_err("Failed allocating fd on port_id %d.", msg->port_id); @@ -435,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; |