From af1dff6fc06f55d6565589282ac4ebacc53b4d29 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Sat, 14 May 2016 18:32:49 +0200 Subject: lib, ipcpd, irmd: Add QoS cube definition This adds the QoS cube definition, which is an enum to select which QoS is needed in the IPCP. An application has to use the qos_spec in qos.h to define what it needs. The IRMd will map this unto a qos cube definition. Some headers are now also no longer installed on the system, since they are only to be used within the irmd and ipcps. --- include/ouroboros/CMakeLists.txt | 12 +----------- include/ouroboros/common.h | 11 ++++------- include/ouroboros/dev.h | 9 ++++++--- include/ouroboros/flow.h | 4 ++-- include/ouroboros/ipcp.h | 22 +++++++++++----------- include/ouroboros/qos.h | 35 +++++++++++++++++++++++++++++++++++ 6 files changed, 59 insertions(+), 34 deletions(-) create mode 100644 include/ouroboros/qos.h (limited to 'include') diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt index a42c65fd..5ce99c4c 100644 --- a/include/ouroboros/CMakeLists.txt +++ b/include/ouroboros/CMakeLists.txt @@ -3,23 +3,13 @@ configure_file( "${CMAKE_CURRENT_BINARY_DIR}/config.h") set(HEADER_FILES - bitmap.h cdap.h - common.h da.h dev.h dif_config.h - du_buff.h flow.h - instance_name.h - ipcp.h irm.h - list.h - logs.h - shm_ap_rbuff.h - shm_du_map.h - sockets.h - utils.h + qos.h ) install(FILES ${HEADER_FILES} "${CMAKE_CURRENT_BINARY_DIR}/config.h" diff --git a/include/ouroboros/common.h b/include/ouroboros/common.h index 971a382a..f2c8a9ec 100644 --- a/include/ouroboros/common.h +++ b/include/ouroboros/common.h @@ -33,13 +33,10 @@ typedef struct { size_t size; } buffer_t; -/* FIXME: may need revision */ -struct qos_spec { - char * qos_name; - char * dif_name; - - uint32_t delay; - uint32_t jitter; +/* FIXME: To be decided which QoS cubes we support */ +enum qos_cube { + QOS_CUBE_BE = 0, + QOS_CUBE_VIDEO }; #endif /* OUROBOROS_COMMON_H */ diff --git a/include/ouroboros/dev.h b/include/ouroboros/dev.h index d8e65144..506fa789 100644 --- a/include/ouroboros/dev.h +++ b/include/ouroboros/dev.h @@ -20,12 +20,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef OUROBOROS_DEV_H -#define OUROBOROS_DEV_H +#include +#include -#include +#include #include +#ifndef OUROBOROS_DEV_H +#define OUROBOROS_DEV_H + #define UNKNOWN_AP "__UNKNOWN_AP__" #define UNKNOWN_AE "__UNKNOWN_AE__" diff --git a/include/ouroboros/flow.h b/include/ouroboros/flow.h index 380c671b..aa377034 100644 --- a/include/ouroboros/flow.h +++ b/include/ouroboros/flow.h @@ -39,8 +39,8 @@ enum flow_state { FLOW_NULL = 0, - FLOW_ALLOCATED, - FLOW_PENDING + FLOW_PENDING, + FLOW_ALLOCATED }; #endif /* OUROBOROS_FLOW_H */ diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h index 63e19e9d..08bee33e 100644 --- a/include/ouroboros/ipcp.h +++ b/include/ouroboros/ipcp.h @@ -20,16 +20,16 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef OUROBOROS_IPCP_H -#define OUROBOROS_IPCP_H - -#include #include #include #include +#include #include +#ifndef OUROBOROS_IPCP_H +#define OUROBOROS_IPCP_H + struct ipcp; /* Returns the process id */ @@ -59,13 +59,13 @@ int ipcp_name_reg(pid_t pid, int ipcp_name_unreg(pid_t pid, char * name); -int ipcp_flow_alloc(pid_t pid, - int port_id, - pid_t n_pid, - char * dst_name, - char * src_ap_name, - char * src_ae_name, - struct qos_spec * qos); +int ipcp_flow_alloc(pid_t pid, + int port_id, + pid_t n_pid, + char * dst_name, + char * src_ap_name, + char * src_ae_name, + enum qos_cube qos); int ipcp_flow_alloc_resp(pid_t pid, int port_id, pid_t n_pid, diff --git a/include/ouroboros/qos.h b/include/ouroboros/qos.h new file mode 100644 index 00000000..c87b7c69 --- /dev/null +++ b/include/ouroboros/qos.h @@ -0,0 +1,35 @@ +/* + * Ouroboros - Copyright (C) 2016 + * + * Quality of Service specification + * + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef OUROBOROS_QOS_H +#define OUROBOROS_QOS_H + +/* FIXME: may need revision */ +struct qos_spec { + char * qos_name; + char * dif_name; + + uint32_t delay; + uint32_t jitter; +}; + +#endif -- cgit v1.2.3 From 8f1e46eab45ba0f497f05d6fe18fb83d8590b3e9 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Sat, 14 May 2016 18:57:24 +0200 Subject: lib: Fix header inclusion This fixes wrong header inclusion that would make programs which are not developed within ouroboros fail upon compilation, since they would not find certain headers on their system. --- include/ouroboros/CMakeLists.txt | 4 ++-- include/ouroboros/cdap.h | 37 ++++++++++++++++++------------------- include/ouroboros/da.h | 4 ++-- include/ouroboros/dif_config.h | 4 ++-- include/ouroboros/instance_name.h | 4 +++- src/ipcpd/ipcp-ops.h | 1 + 6 files changed, 28 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt index 5ce99c4c..6e49ee04 100644 --- a/include/ouroboros/CMakeLists.txt +++ b/include/ouroboros/CMakeLists.txt @@ -8,9 +8,9 @@ set(HEADER_FILES dev.h dif_config.h flow.h + instance_name.h irm.h qos.h ) -install(FILES ${HEADER_FILES} "${CMAKE_CURRENT_BINARY_DIR}/config.h" - DESTINATION include/ouroboros) +install(FILES ${HEADER_FILES} DESTINATION include/ouroboros) diff --git a/include/ouroboros/cdap.h b/include/ouroboros/cdap.h index f1abeff5..72788ad6 100644 --- a/include/ouroboros/cdap.h +++ b/include/ouroboros/cdap.h @@ -23,81 +23,80 @@ #ifndef OUROBOROS_CDAP_H #define OUROBOROS_CDAP_H -#include "common.h" #include struct cdap; struct cdap_ops { /* Sender related callbacks */ - int (* handle_connect_r)(port_id_t id, + int (* handle_connect_r)(int fd, int invoke_id, int result); - int (* handle_release_r)(port_id_t id, + int (* handle_release_r)(int fd, int invoke_id, int result); - int (* handle_read_r)(port_id_t id, + int (* handle_read_r)(int fd, int invoke_id, int result, char * reason, char * obj_val, bool complete); - int (* handle_cancelread_r)(port_id_t id, + int (* handle_cancelread_r)(int fd, int invoke_id, int result); - int (* handle_write_r)(port_id_t id, + int (* handle_write_r)(int fd, int invoke_id, int result, char * reason, char * obj_val); - int (* handle_create_r)(port_id_t id, + int (* handle_create_r)(int fd, int invoke_id, int result); - int (* handle_delete_r)(port_id_t id, + int (* handle_delete_r)(int fd, int invoke_id, int result); - int (* handle_start_r)(port_id_t id, + int (* handle_start_r)(int fd, int invoke_id, int result); - int (* handle_stop_r)(port_id_t id, + int (* handle_stop_r)(int fd, int invoke_id, int result); /* Receiver related callbacks */ - int (* handle_connect)(port_id_t id, + int (* handle_connect)(int fd, int invoke_id, rina_name_t src, rina_name_t dst, char * auth_mech, char * auth_val); - int (* handle_release)(port_id_t id, + int (* handle_release)(int fd, int invoke_id); - int (* handle_cancelread)(port_id_t id, + int (* handle_cancelread)(int fd, int invoke_id); - int (* handle_write)(port_id_t id, + int (* handle_write)(int fd, int invoke_id, char * obj_name, char * obj_val); - int (* handle_create)(port_id_t id, + int (* handle_create)(int fd, int invoke_id, char * obj_class, char * obj_name, char * obj_val); - int (* handle_delete)(port_id_t id, + int (* handle_delete)(int fd, int invoke_id, char * obj_name); - int (* handle_start)(port_id_t id, + int (* handle_start)(int fd, int invoke_id, char * obj_name, char * obj_val); - int (* handle_stop)(port_id_t id, + int (* handle_stop)(int fd, int invoke_id, char * obj_name, char * obj_val); }; struct cdap * cdap_create(struct cdap_ops ops, - port_id_t id); + int fd); int cdap_destroy(struct cdap * instance); /* Sender related functions */ diff --git a/include/ouroboros/da.h b/include/ouroboros/da.h index 9ecd4bd8..406be7a8 100644 --- a/include/ouroboros/da.h +++ b/include/ouroboros/da.h @@ -23,8 +23,8 @@ #ifndef OUROBOROS_DA_H #define OUROBOROS_DA_H -#include "common.h" -#include "instance_name.h" +#include +#include char * da_resolve_daf(char * daf_name); /* diff --git a/include/ouroboros/dif_config.h b/include/ouroboros/dif_config.h index 5d489b0c..d76d4f68 100644 --- a/include/ouroboros/dif_config.h +++ b/include/ouroboros/dif_config.h @@ -20,8 +20,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include +#include +#include #ifndef OUROBOROS_DIF_CONFIG_H #define OUROBOROS_DIF_CONFIG_H diff --git a/include/ouroboros/instance_name.h b/include/ouroboros/instance_name.h index 351b222f..92681504 100644 --- a/include/ouroboros/instance_name.h +++ b/include/ouroboros/instance_name.h @@ -22,7 +22,9 @@ #ifndef INSTANCE_NAME_H #define INSTANCE_NAME_H -#include "common.h" +#include +#include +#include typedef struct { char * name; diff --git a/src/ipcpd/ipcp-ops.h b/src/ipcpd/ipcp-ops.h index 1365f9b6..a766c3ae 100644 --- a/src/ipcpd/ipcp-ops.h +++ b/src/ipcpd/ipcp-ops.h @@ -25,6 +25,7 @@ #define IPCPD_IPCP_OPS_H #include +#include #include struct ipcp_ops { -- cgit v1.2.3