diff options
author | Sander Vrijders <[email protected]> | 2016-05-14 18:32:49 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-05-14 18:32:49 +0200 |
commit | af1dff6fc06f55d6565589282ac4ebacc53b4d29 (patch) | |
tree | daa33b67da40cd2b7677126fa15fb996cbba25f2 /src/ipcpd | |
parent | aff55f153ddb247357f59b3740477e90eba527bd (diff) | |
download | ouroboros-af1dff6fc06f55d6565589282ac4ebacc53b4d29.tar.gz ouroboros-af1dff6fc06f55d6565589282ac4ebacc53b4d29.zip |
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.
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/flow.c | 7 | ||||
-rw-r--r-- | src/ipcpd/flow.h | 31 | ||||
-rw-r--r-- | src/ipcpd/ipcp-ops.h | 13 | ||||
-rw-r--r-- | src/ipcpd/ipcp.c | 2 | ||||
-rw-r--r-- | src/ipcpd/normal/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/ipcpd/shim-udp/main.c | 15 |
6 files changed, 30 insertions, 44 deletions
diff --git a/src/ipcpd/flow.c b/src/ipcpd/flow.c index 10280f3d..4ca61341 100644 --- a/src/ipcpd/flow.c +++ b/src/ipcpd/flow.c @@ -26,10 +26,11 @@ #define OUROBOROS_PREFIX "ipcpd/flow" #include <ouroboros/logs.h> +#include <ouroboros/flow.h> -flow_t * flow_create(int port_id) +struct flow * flow_create(int port_id) { - flow_t * flow = malloc(sizeof *flow); + struct flow * flow = malloc(sizeof *flow); if (flow == NULL) { LOG_DBGF("Could not malloc flow."); return NULL; @@ -45,7 +46,7 @@ flow_t * flow_create(int port_id) return flow; } -void flow_destroy(flow_t * flow) +void flow_destroy(struct flow * flow) { if (flow == NULL) return; diff --git a/src/ipcpd/flow.h b/src/ipcpd/flow.h index 43de5f94..6f50698e 100644 --- a/src/ipcpd/flow.h +++ b/src/ipcpd/flow.h @@ -20,32 +20,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef OUROBOROS_FLOW_H -#define OUROBOROS_FLOW_H +#ifndef OUROBOROS_IPCP_FLOW_H +#define OUROBOROS_IPCP_FLOW_H -#include <ouroboros/common.h> #include <ouroboros/list.h> +#include <ouroboros/flow.h> #include <ouroboros/shm_ap_rbuff.h> #include <pthread.h> -/* same values as fcntl.h */ -#define FLOW_O_RDONLY 00000000 -#define FLOW_O_WRONLY 00000001 -#define FLOW_O_RDWR 00000002 -#define FLOW_O_ACCMODE 00000003 - -#define FLOW_O_NONBLOCK 00004000 -#define FLOW_O_DEFAULT 00000002 - -#define FLOW_O_INVALID (FLOW_O_WRONLY | FLOW_O_RDWR) - -enum flow_state { - FLOW_NULL = 0, - FLOW_ALLOCATED, - FLOW_PENDING -}; - -typedef struct flow { +struct flow { struct list_head list; int port_id; @@ -53,9 +36,9 @@ typedef struct flow { enum flow_state state; pthread_mutex_t lock; -} flow_t; +}; -flow_t * flow_create(int port_id); -void flow_destroy(flow_t * flow); +struct flow * flow_create(int port_id); +void flow_destroy(struct flow * flow); #endif /* OUROBOROS_FLOW_H */ diff --git a/src/ipcpd/ipcp-ops.h b/src/ipcpd/ipcp-ops.h index 5e90939d..1365f9b6 100644 --- a/src/ipcpd/ipcp-ops.h +++ b/src/ipcpd/ipcp-ops.h @@ -24,7 +24,6 @@ #ifndef IPCPD_IPCP_OPS_H #define IPCPD_IPCP_OPS_H -#include <ouroboros/common.h> #include <ouroboros/dif_config.h> #include <sys/types.h> @@ -38,12 +37,12 @@ struct ipcp_ops { size_t len); int (* ipcp_name_reg)(char * name); int (* ipcp_name_unreg)(char * name); - int (* ipcp_flow_alloc)(int port_id, - pid_t n_pid, - char * dst_ap_name, - char * src_ap_name, - char * src_ae_name, - struct qos_spec * qos); + int (* ipcp_flow_alloc)(int port_id, + pid_t n_pid, + char * dst_ap_name, + char * src_ap_name, + char * src_ae_name, + enum qos_cube qos); int (* ipcp_flow_alloc_resp)(int port_id, pid_t n_pid, int response); diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 13632a80..1e122b73 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -181,7 +181,7 @@ void * ipcp_main_loop(void * o) msg->dst_name, msg->src_ap_name, msg->src_ae_name, - NULL); + msg->qos_cube); break; case IPCP_MSG_CODE__IPCP_FLOW_ALLOC_RESP: if (_ipcp->ops->ipcp_flow_alloc_resp == NULL) { diff --git a/src/ipcpd/normal/CMakeLists.txt b/src/ipcpd/normal/CMakeLists.txt index c13cbaa3..58584e20 100644 --- a/src/ipcpd/normal/CMakeLists.txt +++ b/src/ipcpd/normal/CMakeLists.txt @@ -1,5 +1,7 @@ -get_filename_component(CURRENT_SOURCE_PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) -get_filename_component(CURRENT_BINARY_PARENT_DIR ${CMAKE_CURRENT_BINARY_DIR} DIRECTORY) +get_filename_component(CURRENT_SOURCE_PARENT_DIR + ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) +get_filename_component(CURRENT_BINARY_PARENT_DIR + ${CMAKE_CURRENT_BINARY_DIR} DIRECTORY) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index 14a698ee..f9a8c42b 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -32,6 +32,7 @@ #include <ouroboros/dif_config.h> #include <ouroboros/sockets.h> #include <ouroboros/bitmap.h> +#include <ouroboros/flow.h> #include <ouroboros/dev.h> #define OUROBOROS_PREFIX "ipcpd/shim-udp" @@ -679,12 +680,12 @@ static int ipcp_udp_name_unreg(char * name) return 0; } -static int ipcp_udp_flow_alloc(int port_id, - pid_t n_pid, - char * dst_name, - char * src_ap_name, - char * src_ae_name, - struct qos_spec * qos) +static int ipcp_udp_flow_alloc(int port_id, + pid_t n_pid, + char * dst_name, + char * src_ap_name, + char * src_ae_name, + enum qos_cube qos) { struct sockaddr_in l_saddr; struct sockaddr_in r_saddr; @@ -708,7 +709,7 @@ static int ipcp_udp_flow_alloc(int port_id, return -1; } - if (qos != NULL) + if (qos != QOS_CUBE_BE) LOG_DBGF("QoS requested. UDP/IP can't do that."); fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); |