diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ouroboros/endian.h | 5 | ||||
-rw-r--r-- | include/ouroboros/fccntl.h | 5 | ||||
-rw-r--r-- | include/ouroboros/ipcp-dev.h | 3 | ||||
-rw-r--r-- | include/ouroboros/ipcp.h | 4 | ||||
-rw-r--r-- | include/ouroboros/np1_flow.h | 10 | ||||
-rw-r--r-- | include/ouroboros/qos.h | 22 | ||||
-rw-r--r-- | include/ouroboros/shm_flow_set.h | 8 | ||||
-rw-r--r-- | include/ouroboros/shm_rbuff.h | 6 | ||||
-rw-r--r-- | include/ouroboros/shm_rdrbuff.h | 1 | ||||
-rw-r--r-- | include/ouroboros/sockets.h.in | 11 |
10 files changed, 40 insertions, 35 deletions
diff --git a/include/ouroboros/endian.h b/include/ouroboros/endian.h index f29b6749..04c2246a 100644 --- a/include/ouroboros/endian.h +++ b/include/ouroboros/endian.h @@ -23,9 +23,12 @@ #ifndef OUROBOROS_ENDIAN_H #define OUROBOROS_ENDIAN_H + #if defined(__linux__) || defined(__CYGWIN__) || \ (defined(__MACH__) && !defined(__APPLE__)) -#define _DEFAULT_SOURCE +#ifndef _DEFAULT_SOURCE +#error You must define _DEFAULT_SOURCE before including this file +#endif #include <endian.h> #elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) #include <sys/endian.h> diff --git a/include/ouroboros/fccntl.h b/include/ouroboros/fccntl.h index bc7c7206..b11c14db 100644 --- a/include/ouroboros/fccntl.h +++ b/include/ouroboros/fccntl.h @@ -47,8 +47,6 @@ /* FRCT flags */ #define FRCTFRESCNTRL 00000001 /* Feedback from receiver */ #define FRCTFRTX 00000002 /* Reliable flow */ -#define FRCTFERRCHCK 00000004 /* Check for errors */ -#define FRCTFPARTIAL 00000010 /* Allow partial delivery */ /* Flow operations */ #define FLOWSRCVTIMEO 00000001 /* Set read timeout */ @@ -62,8 +60,7 @@ #define FLOWGTXQLEN 00000011 /* Get queue length on tx */ /* FRCT operations */ -#define FRCTSFLAGS 00001000 /* Set flags for FRCT */ -#define FRCTGFLAGS 00001001 /* Get flags for FRCT */ +#define FRCTGFLAGS 00001000 /* Get flags for FRCT */ __BEGIN_DECLS diff --git a/include/ouroboros/ipcp-dev.h b/include/ouroboros/ipcp-dev.h index 9a33c25a..4f8b5da8 100644 --- a/include/ouroboros/ipcp-dev.h +++ b/include/ouroboros/ipcp-dev.h @@ -21,6 +21,7 @@ */ #include <ouroboros/shm_rdrbuff.h> +#include <ouroboros/qoscube.h> #ifndef OUROBOROS_IPCP_DEV_H #define OUROBOROS_IPCP_DEV_H @@ -31,7 +32,7 @@ int ipcp_create_r(pid_t pid, int ipcp_flow_req_arr(pid_t pid, const uint8_t * dst, size_t len, - qoscube_t cube); + qosspec_t qs); int ipcp_flow_alloc_reply(int fd, int response); diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h index c7013f08..e423a015 100644 --- a/include/ouroboros/ipcp.h +++ b/include/ouroboros/ipcp.h @@ -27,7 +27,7 @@ #include <unistd.h> #include <stdbool.h> -#define LAYER_NAME_SIZE 256 +#define LAYER_NAME_SIZE 255 /* * NOTE: the IRMd uses this order to select an IPCP @@ -67,7 +67,7 @@ enum pol_dir_hash { /* Info reported back to the IRMd about the layer on enrollment */ struct layer_info { - char layer_name[LAYER_NAME_SIZE]; + char layer_name[LAYER_NAME_SIZE + 1]; int dir_hash_algo; }; diff --git a/include/ouroboros/np1_flow.h b/include/ouroboros/np1_flow.h index 789e82df..3f80161a 100644 --- a/include/ouroboros/np1_flow.h +++ b/include/ouroboros/np1_flow.h @@ -23,16 +23,16 @@ #ifndef OUROBOROS_NP1_FLOW_H #define OUROBOROS_NP1_FLOW_H -#include <ouroboros/qoscube.h> +#include <ouroboros/qos.h> #include <unistd.h> int np1_flow_alloc(pid_t n_pid, - int port_id, - qoscube_t qc); + int flow_id, + qosspec_t qs); -int np1_flow_resp(int port_id); +int np1_flow_resp(int flow_id); -int np1_flow_dealloc(int port_id); +int np1_flow_dealloc(int flow_id); #endif /* OUROBOROS_NP1_FLOW_H */ diff --git a/include/ouroboros/qos.h b/include/ouroboros/qos.h index 011828d7..2b93f1d0 100644 --- a/include/ouroboros/qos.h +++ b/include/ouroboros/qos.h @@ -27,26 +27,20 @@ #include <stdbool.h> typedef struct qos_spec { - uint32_t delay; /* In ms */ - uint64_t bandwidth; /* In bits/s */ - uint8_t availability; /* Class of 9s */ - uint32_t loss; /* Packet loss */ - uint8_t in_order; /* In-order delivery, enables FRCT */ - uint32_t maximum_interruption; /* In ms */ + uint32_t delay; /* In ms */ + uint64_t bandwidth; /* In bits/s */ + uint8_t availability; /* Class of 9s */ + uint32_t loss; /* Packet loss */ + uint32_t ber; /* Bit error rate, errors per billion bits */ + uint8_t in_order; /* In-order delivery, enables FRCT */ + uint32_t max_gap; /* In ms */ } qosspec_t; qosspec_t qos_raw; +qosspec_t qos_raw_no_errors; qosspec_t qos_best_effort; qosspec_t qos_video; qosspec_t qos_voice; qosspec_t qos_data; -__BEGIN_DECLS - -int qosspec_init(qosspec_t * qs); - -int qosspec_fini(qosspec_t * qs); - -__END_DECLS - #endif /* OUROBOROS_QOS_H */ diff --git a/include/ouroboros/shm_flow_set.h b/include/ouroboros/shm_flow_set.h index ebf63af5..45d372a0 100644 --- a/include/ouroboros/shm_flow_set.h +++ b/include/ouroboros/shm_flow_set.h @@ -42,18 +42,18 @@ void shm_flow_set_zero(struct shm_flow_set * shm_set, int shm_flow_set_add(struct shm_flow_set * shm_set, size_t idx, - int port_id); + int flow_id); int shm_flow_set_has(struct shm_flow_set * shm_set, size_t idx, - int port_id); + int flow_id); void shm_flow_set_del(struct shm_flow_set * shm_set, size_t idx, - int port_id); + int flow_id); void shm_flow_set_notify(struct shm_flow_set * set, - int port_id, + int flow_id, int event); ssize_t shm_flow_set_wait(const struct shm_flow_set * shm_set, diff --git a/include/ouroboros/shm_rbuff.h b/include/ouroboros/shm_rbuff.h index b2e27c7b..447e081e 100644 --- a/include/ouroboros/shm_rbuff.h +++ b/include/ouroboros/shm_rbuff.h @@ -1,7 +1,7 @@ /* * Ouroboros - Copyright (C) 2016 - 2018 * - * Ring buffer for incoming SDUs + * Ring buffer for incoming packets * * Dimitri Staessens <dimitri.staessens@ugent.be> * Sander Vrijders <sander.vrijders@ugent.be> @@ -35,10 +35,10 @@ struct shm_rbuff; struct shm_rbuff * shm_rbuff_create(pid_t pid, - int port_id); + int flow_id); struct shm_rbuff * shm_rbuff_open(pid_t pid, - int port_id); + int flow_id); void shm_rbuff_close(struct shm_rbuff * rb); diff --git a/include/ouroboros/shm_rdrbuff.h b/include/ouroboros/shm_rdrbuff.h index 277609c5..49551497 100644 --- a/include/ouroboros/shm_rdrbuff.h +++ b/include/ouroboros/shm_rdrbuff.h @@ -24,7 +24,6 @@ #define OUROBOROS_SHM_RDRBUFF_H #include <ouroboros/shm_du_buff.h> -#include <ouroboros/qoscube.h> #include <ouroboros/time_utils.h> #include <stdint.h> diff --git a/include/ouroboros/sockets.h.in b/include/ouroboros/sockets.h.in index 4557a9ef..368923db 100644 --- a/include/ouroboros/sockets.h.in +++ b/include/ouroboros/sockets.h.in @@ -23,6 +23,8 @@ #ifndef OUROBOROS_SOCKETS_H #define OUROBOROS_SOCKETS_H +#include <ouroboros/qos.h> + #include <sys/types.h> #include "ipcp_config.pb-c.h" @@ -36,6 +38,9 @@ typedef IpcpInfoMsg ipcp_info_msg_t; #include "ipcpd_messages.pb-c.h" typedef IpcpMsg ipcp_msg_t; +#include "qosspec.pb-c.h" +typedef QosspecMsg qosspec_msg_t; + #define SOCK_PATH "/var/run/ouroboros/" #define SOCK_PATH_SUFFIX ".sock" @@ -53,4 +58,10 @@ int client_socket_open(char * file_name); irm_msg_t * send_recv_irm_msg(irm_msg_t * msg); + +/* qos message conversion needed in different components */ +qosspec_msg_t spec_to_msg(qosspec_t * qs); + +qosspec_t msg_to_spec(qosspec_msg_t * msg); + #endif |