diff options
Diffstat (limited to 'include')
30 files changed, 97 insertions, 75 deletions
diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt index d1a3166c..a8589da1 100644 --- a/include/ouroboros/CMakeLists.txt +++ b/include/ouroboros/CMakeLists.txt @@ -3,6 +3,7 @@ configure_file( "${CMAKE_CURRENT_BINARY_DIR}/config.h") set(HEADER_FILES + cacep.h cdap.h dev.h endian.h diff --git a/include/ouroboros/bitmap.h b/include/ouroboros/bitmap.h index d6ce623a..cb62312a 100644 --- a/include/ouroboros/bitmap.h +++ b/include/ouroboros/bitmap.h @@ -3,8 +3,8 @@ * * Bitmap implementation * - * Sander Vrijders <[email protected]> - * Francesco Salvestrini <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/cacep.h b/include/ouroboros/cacep.h index ae615e6e..950f3cf7 100644 --- a/include/ouroboros/cacep.h +++ b/include/ouroboros/cacep.h @@ -1,10 +1,10 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * The Common Application Connection Establishment Phase + * The Common Application Connection Establishment Protocol * - * Sander Vrijders <[email protected]> - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -25,23 +25,25 @@ #define OUROBOROS_CACEP_H #include <stdint.h> -#include <unistd.h> -struct cacep; - -struct cacep_info { - char * name; - uint64_t addr; +enum proto_concrete_syntax { + PROTO_GPB = 0, + PROTO_ASN_1, + PROTO_FIXED }; -struct cacep * cacep_create(int fd, - const char * name, - uint64_t address); - -int cacep_destroy(struct cacep * instance); +struct conn_info { + char ae_name[64]; + char protocol[64]; + uint32_t pref_version; + enum proto_concrete_syntax pref_syntax; + uint64_t addr; +}; -struct cacep_info * cacep_auth(struct cacep * instance); +int cacep_snd(int fd, + const struct conn_info * in); -struct cacep_info * cacep_auth_wait(struct cacep * instance); +int cacep_rcv(int fd, + struct conn_info * out); #endif /* OUROBOROS_CACEP_H */ diff --git a/include/ouroboros/cdap.h b/include/ouroboros/cdap.h index 9f6e2654..32edb51c 100644 --- a/include/ouroboros/cdap.h +++ b/include/ouroboros/cdap.h @@ -3,8 +3,8 @@ * * The Common Distributed Application Protocol * - * Sander Vrijders <[email protected]> - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -31,6 +31,7 @@ #define F_SYNC 0x0001 #define INVALID_CDAP_KEY -1 +#define CDAP_PROTO "CDAP" enum cdap_opcode { CDAP_READ = 0, @@ -45,12 +46,17 @@ struct cdap; typedef int32_t cdap_key_t; -/* Assumes flow is blocking */ -struct cdap * cdap_create(int fd); +struct cdap * cdap_create(void); int cdap_destroy(struct cdap * instance); -cdap_key_t cdap_request_send(struct cdap * instance, +int cdap_add_flow(struct cdap * instance, + int fd); + +int cdap_del_flow(struct cdap * instance, + int fd); + +cdap_key_t * cdap_request_send(struct cdap * instance, enum cdap_opcode code, const char * name, const void * data, diff --git a/include/ouroboros/crc32.h b/include/ouroboros/crc32.h index 3c7721de..dccdf7cb 100644 --- a/include/ouroboros/crc32.h +++ b/include/ouroboros/crc32.h @@ -3,7 +3,8 @@ * * 32-bit Cyclic Redundancy Check * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/dev.h b/include/ouroboros/dev.h index 1d2a2533..e92cdd1c 100644 --- a/include/ouroboros/dev.h +++ b/include/ouroboros/dev.h @@ -3,7 +3,8 @@ * * API for applications * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -27,16 +28,13 @@ #ifndef OUROBOROS_DEV_H #define OUROBOROS_DEV_H -#define UNKNOWN_AE "__UNKNOWN_AE__" - /* These calls should be removed once we write the ouroboros OS. */ int ap_init(const char * ap_name); void ap_fini(void); -/* Returns flow descriptor (> 0), client AE name and qos spec. */ -int flow_accept(char ** ae_name, - qosspec_t * spec); +/* Returns flow descriptor (> 0) and qos spec. */ +int flow_accept(qosspec_t * spec); int flow_alloc_resp(int fd, int response); @@ -46,7 +44,6 @@ int flow_alloc_resp(int fd, * On returning, spec will contain the actual supplied QoS. */ int flow_alloc(const char * dst_name, - const char * src_ae_name, qosspec_t * spec); int flow_alloc_res(int fd); diff --git a/include/ouroboros/endian.h b/include/ouroboros/endian.h index 46f384ec..d712b1b3 100644 --- a/include/ouroboros/endian.h +++ b/include/ouroboros/endian.h @@ -3,8 +3,8 @@ * * Endianness * - * Dimitri Staessens <[email protected]> - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/errno.h b/include/ouroboros/errno.h index 600f016f..d2117992 100644 --- a/include/ouroboros/errno.h +++ b/include/ouroboros/errno.h @@ -3,7 +3,8 @@ * * Ouroboros specific error numbers * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/fcntl.h b/include/ouroboros/fcntl.h index 7ee4229e..c07b7bf0 100644 --- a/include/ouroboros/fcntl.h +++ b/include/ouroboros/fcntl.h @@ -3,7 +3,8 @@ * * Flows * - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/fqueue.h b/include/ouroboros/fqueue.h index fdd2cbfb..fc7dc303 100644 --- a/include/ouroboros/fqueue.h +++ b/include/ouroboros/fqueue.h @@ -3,8 +3,8 @@ * * Flow queues * - * Dimitri Staessens <[email protected]> - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/hashtable.h b/include/ouroboros/hashtable.h index 4cb6000d..81fbcc1a 100644 --- a/include/ouroboros/hashtable.h +++ b/include/ouroboros/hashtable.h @@ -3,7 +3,8 @@ * * Hash table with integer keys with separate chaining on collisions * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/ipcp-dev.h b/include/ouroboros/ipcp-dev.h index b2d78c6e..89ef733b 100644 --- a/include/ouroboros/ipcp-dev.h +++ b/include/ouroboros/ipcp-dev.h @@ -3,8 +3,8 @@ * * Additional API for IPCPs * - * Dimitri Staessens <[email protected]> - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -31,7 +31,6 @@ int ipcp_create_r(pid_t api, int ipcp_flow_req_arr(pid_t api, char * dst_name, - char * src_ae_name, qoscube_t cube); int ipcp_flow_alloc_reply(int fd, diff --git a/include/ouroboros/irm.h b/include/ouroboros/irm.h index 07052727..9bd0c93b 100644 --- a/include/ouroboros/irm.h +++ b/include/ouroboros/irm.h @@ -3,7 +3,8 @@ * * The API to instruct the IPC Resource Manager * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/irm_config.h b/include/ouroboros/irm_config.h index 3cc59e20..3dd55823 100644 --- a/include/ouroboros/irm_config.h +++ b/include/ouroboros/irm_config.h @@ -3,7 +3,8 @@ * * Configuration information for the IPC Resource Manager * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -47,10 +48,6 @@ enum pol_gam { COMPLETE = 0 }; -enum pol_cacep { - NO_AUTH = 0 -}; - struct dif_config { char * dif_name; enum ipcp_type type; diff --git a/include/ouroboros/list.h b/include/ouroboros/list.h index 5f246775..5da93b9a 100644 --- a/include/ouroboros/list.h +++ b/include/ouroboros/list.h @@ -3,8 +3,8 @@ * * Simple doubly linked list implementation. * - * Sander Vrijders <[email protected]> - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/local-dev.h b/include/ouroboros/local-dev.h index 3c95e589..228a2a98 100644 --- a/include/ouroboros/local-dev.h +++ b/include/ouroboros/local-dev.h @@ -3,7 +3,8 @@ * * Optimized calls for the local IPCPs * - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/lockfile.h b/include/ouroboros/lockfile.h index 561e31ab..1b988092 100644 --- a/include/ouroboros/lockfile.h +++ b/include/ouroboros/lockfile.h @@ -3,7 +3,8 @@ * * Lockfile for Ouroboros * - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -28,8 +29,11 @@ struct lockfile; struct lockfile * lockfile_create(void); + struct lockfile * lockfile_open(void); + void lockfile_close(struct lockfile * lf); + void lockfile_destroy(struct lockfile * lf); pid_t lockfile_owner(struct lockfile * lf); diff --git a/include/ouroboros/logs.h b/include/ouroboros/logs.h index 9b83abd2..38b50053 100644 --- a/include/ouroboros/logs.h +++ b/include/ouroboros/logs.h @@ -3,9 +3,8 @@ * * Logging facilities * - * Sander Vrijders <[email protected]> - * Francesco Salvestrini <[email protected]> - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/np1_flow.h b/include/ouroboros/np1_flow.h index 6144ec06..a4e94b89 100644 --- a/include/ouroboros/np1_flow.h +++ b/include/ouroboros/np1_flow.h @@ -3,7 +3,8 @@ * * Adapter functions for N + 1 flow descriptors * - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/nsm.h b/include/ouroboros/nsm.h index 0bcc028a..22a2a593 100644 --- a/include/ouroboros/nsm.h +++ b/include/ouroboros/nsm.h @@ -3,7 +3,8 @@ * * The API to instruct the global Namespace Manager * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/qos.h b/include/ouroboros/qos.h index 57d0ab0e..b12fed60 100644 --- a/include/ouroboros/qos.h +++ b/include/ouroboros/qos.h @@ -3,7 +3,8 @@ * * Quality of Service specification * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/rib.h b/include/ouroboros/rib.h index 50747498..320ef860 100644 --- a/include/ouroboros/rib.h +++ b/include/ouroboros/rib.h @@ -3,8 +3,8 @@ * * Resource Information Base * - * Sander Vrijders <[email protected]> - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/rqueue.h b/include/ouroboros/rqueue.h index 7bfbfa8f..b0ec4a60 100644 --- a/include/ouroboros/rqueue.h +++ b/include/ouroboros/rqueue.h @@ -3,8 +3,8 @@ * * RIB event queues * - * Dimitri Staessens <[email protected]> - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/shared.h b/include/ouroboros/shared.h index 1f309d27..07d4be5e 100644 --- a/include/ouroboros/shared.h +++ b/include/ouroboros/shared.h @@ -3,7 +3,8 @@ * * Shared definitions between IRMd and IPCPs * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/shm_flow_set.h b/include/ouroboros/shm_flow_set.h index 95b1718e..947fe897 100644 --- a/include/ouroboros/shm_flow_set.h +++ b/include/ouroboros/shm_flow_set.h @@ -3,7 +3,8 @@ * * Management of flow_sets for fqueue * - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/shm_rbuff.h b/include/ouroboros/shm_rbuff.h index 14cfb79a..8471f47f 100644 --- a/include/ouroboros/shm_rbuff.h +++ b/include/ouroboros/shm_rbuff.h @@ -3,7 +3,8 @@ * * Ring buffer for incoming SDUs * - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -28,9 +29,11 @@ struct shm_rbuff; -struct shm_rbuff * shm_rbuff_create(pid_t api, int port_id); +struct shm_rbuff * shm_rbuff_create(pid_t api, + int port_id); -struct shm_rbuff * shm_rbuff_open(pid_t api, int port_id); +struct shm_rbuff * shm_rbuff_open(pid_t api, + int port_id); void shm_rbuff_close(struct shm_rbuff * rb); @@ -50,4 +53,6 @@ ssize_t shm_rbuff_read(struct shm_rbuff * rb); ssize_t shm_rbuff_read_b(struct shm_rbuff * rb, const struct timespec * timeout); +size_t shm_rbuff_queued(struct shm_rbuff * rb); + #endif /* OUROBOROS_SHM_RBUFF_H */ diff --git a/include/ouroboros/shm_rdrbuff.h b/include/ouroboros/shm_rdrbuff.h index 73d6bfbc..92173388 100644 --- a/include/ouroboros/shm_rdrbuff.h +++ b/include/ouroboros/shm_rdrbuff.h @@ -3,8 +3,8 @@ * * Random Deletion Ring Buffer for Data Units * - * Dimitri Staessens <[email protected]> - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h index efd4a08f..bcc60e17 100644 --- a/include/ouroboros/sockets.h +++ b/include/ouroboros/sockets.h @@ -3,7 +3,8 @@ * * The sockets layer to communicate between daemons * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/time_utils.h b/include/ouroboros/time_utils.h index f45df27f..35f2dcbb 100644 --- a/include/ouroboros/time_utils.h +++ b/include/ouroboros/time_utils.h @@ -3,7 +3,8 @@ * * Time utilities * - * Dimitri Staessens <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -97,7 +98,8 @@ int ts_to_tv(const struct timespec * src, #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) #define CLOCKS_MONO CLOCK_MONOTONIC -int clock_gettime(int clock, struct timespec * t); +int clock_gettime(int clock, + struct timespec * t); #endif #endif /* OUROBOROS_TIME_UTILS_H */ diff --git a/include/ouroboros/utils.h b/include/ouroboros/utils.h index 29fb4367..19a29097 100644 --- a/include/ouroboros/utils.h +++ b/include/ouroboros/utils.h @@ -3,7 +3,8 @@ * * Handy utilities * - * Sander Vrijders <[email protected]> + * Dimitri Staessens <[email protected]> + * Sander Vrijders <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -40,9 +41,6 @@ typedef struct { */ int n_digits(unsigned i); -/* Returns a copy of the source string */ -char * strdup(const char * src); - /* gets the application name */ char * path_strip(char * src); |