From 806629e64e8231d0c57a80d3b6584094cd6c89bd Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 21 Jun 2017 11:50:19 +0200 Subject: lib, ipcpd, irmd: Add full-fledged QoS This adds more Quality of Service support to Ouroboros. One part is the network specific characteristics such as bandwidth, delay, ... The other part is end-to-end QoS like reliability, window based flow control, ... --- include/ouroboros/qos.h | 17 +++++++++++++---- include/ouroboros/qoscube.h | 39 +++++++++++++++++++++++++++++++++++++++ include/ouroboros/shared.h | 35 ----------------------------------- include/ouroboros/shm_rdrbuff.h | 2 +- include/ouroboros/sockets.h | 3 +++ 5 files changed, 56 insertions(+), 40 deletions(-) create mode 100644 include/ouroboros/qoscube.h delete mode 100644 include/ouroboros/shared.h (limited to 'include') diff --git a/include/ouroboros/qos.h b/include/ouroboros/qos.h index b12fed60..78bdba45 100644 --- a/include/ouroboros/qos.h +++ b/include/ouroboros/qos.h @@ -25,13 +25,22 @@ #define OUROBOROS_QOS_H #include +#include typedef struct qos_spec { - uint32_t delay; - uint32_t jitter; + uint32_t delay; /* In ms */ + uint64_t bandwidth; /* In bits/s */ + uint8_t availability; /* Class of 9s */ + uint32_t maximum_interruption; /* In ms */ - /* FIXME: define qosspecs */ - int cube; + bool resource_control; /* Feedback from receiver */ + bool reliable; /* Reliable flow */ + bool error_check; /* Check for errors */ + bool ordered; /* Ordered delivery */ + bool partial; /* Allow partial delivery */ } qosspec_t; +int qosspec_init(qosspec_t * qs); +int qosspec_fini(qosspec_t * qs); + #endif diff --git a/include/ouroboros/qoscube.h b/include/ouroboros/qoscube.h new file mode 100644 index 00000000..5d339adb --- /dev/null +++ b/include/ouroboros/qoscube.h @@ -0,0 +1,39 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Quality of Service cubes + * + * Dimitri Staessens + * Sander Vrijders + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef OUROBOROS_QOSCUBE_H +#define OUROBOROS_QOSCUBE_H + +#include + +typedef enum qos_cube { + QOS_CUBE_BE = 0, + QOS_CUBE_VIDEO, + QOS_CUBE_VOICE, + QOS_CUBE_MAX +} qoscube_t; + +qoscube_t qos_spec_to_cube(qosspec_t qs); +qosspec_t qos_cube_to_spec(qoscube_t qc); + +#endif diff --git a/include/ouroboros/shared.h b/include/ouroboros/shared.h deleted file mode 100644 index 07d4be5e..00000000 --- a/include/ouroboros/shared.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * Shared definitions between IRMd and IPCPs - * - * Dimitri Staessens - * Sander Vrijders - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#ifndef OUROBOROS_SHARED_H -#define OUROBOROS_SHARED_H - -/* FIXME: To be decided which QoS cubes we support */ -typedef enum qos_cube { - QOS_CUBE_FRC = 0, - QOS_CUBE_BE, - QOS_CUBE_VIDEO, - QOS_CUBE_MAX -} qoscube_t; - -#endif /* OUROBOROS_SHARED_H */ diff --git a/include/ouroboros/shm_rdrbuff.h b/include/ouroboros/shm_rdrbuff.h index 13b99eef..fb12be74 100644 --- a/include/ouroboros/shm_rdrbuff.h +++ b/include/ouroboros/shm_rdrbuff.h @@ -25,7 +25,7 @@ #define OUROBOROS_SHM_RDRBUFF_H #include -#include +#include #include #include diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h index 660709bf..0d65c15d 100644 --- a/include/ouroboros/sockets.h +++ b/include/ouroboros/sockets.h @@ -30,6 +30,9 @@ typedef IpcpConfigMsg ipcp_config_msg_t; typedef DifInfoMsg dif_info_msg_t; +#include "frct_enroll.pb-c.h" +typedef FrctEnrollMsg frct_enroll_msg_t; + #include "irmd_messages.pb-c.h" typedef IrmMsg irm_msg_t; -- cgit v1.2.3