From 3a321cc77e0f6d29167a925dd706fc36e5aa7cdd Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 27 Aug 2023 17:59:20 +0200 Subject: lib: Move protobuf definitions to pb/ directory This moves the protobuf definition in the library to a pb/ directory. Also renames the protobuf files and does a quick review of the #define guards in the include library to specify _LIB_ for internal/non-public library headers. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- include/ouroboros/bitmap.h | 6 +++--- include/ouroboros/crc32.h | 6 +++--- include/ouroboros/endian.h | 7 +++---- include/ouroboros/ipcp-dev.h | 6 +++--- include/ouroboros/local-dev.h | 6 +++--- include/ouroboros/lockfile.h | 6 +++--- include/ouroboros/logs.h | 6 +++--- include/ouroboros/np1_flow.h | 6 +++--- include/ouroboros/protobuf.h | 12 ++++++------ include/ouroboros/pthread.h | 6 +++--- include/ouroboros/qoscube.h | 6 +++--- include/ouroboros/random.h | 6 +++--- include/ouroboros/serdes-oep.h | 1 - include/ouroboros/shm_du_buff.h | 6 +++--- include/ouroboros/shm_flow_set.h | 6 +++--- include/ouroboros/shm_rbuff.h | 6 +++--- include/ouroboros/shm_rdrbuff.h | 6 +++--- include/ouroboros/sockets.h.in | 8 ++++---- include/ouroboros/time_utils.h | 6 +++--- include/ouroboros/utils.h | 6 +++--- 20 files changed, 61 insertions(+), 63 deletions(-) (limited to 'include/ouroboros') diff --git a/include/ouroboros/bitmap.h b/include/ouroboros/bitmap.h index 0bbd510c..9c395811 100644 --- a/include/ouroboros/bitmap.h +++ b/include/ouroboros/bitmap.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_BITMAP_H -#define OUROBOROS_BITMAP_H +#ifndef OUROBOROS_LIB_BITMAP_H +#define OUROBOROS_LIB_BITMAP_H #include #include @@ -45,4 +45,4 @@ bool bmp_is_id_valid(struct bmp * bmp, bool bmp_is_id_used(struct bmp * bmp, ssize_t id); -#endif /* OUROBOROS_BITMAP_H */ +#endif /* OUROBOROS_LIB_BITMAP_H */ diff --git a/include/ouroboros/crc32.h b/include/ouroboros/crc32.h index 1c053834..b7fb9deb 100644 --- a/include/ouroboros/crc32.h +++ b/include/ouroboros/crc32.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_CRC32_H -#define OUROBOROS_CRC32_H +#ifndef OUROBOROS_LIB_CRC32_H +#define OUROBOROS_LIB_CRC32_H #include #include @@ -32,4 +32,4 @@ void crc32(uint32_t * crc, const void * buf, size_t len); -#endif /* OUROBOROS_CRC32_H */ +#endif /* OUROBOROS_LIB_CRC32_H */ diff --git a/include/ouroboros/endian.h b/include/ouroboros/endian.h index 667ccb07..d4fb767a 100644 --- a/include/ouroboros/endian.h +++ b/include/ouroboros/endian.h @@ -20,9 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_ENDIAN_H -#define OUROBOROS_ENDIAN_H - +#ifndef OUROBOROS_LIB_ENDIAN_H +#define OUROBOROS_LIB_ENDIAN_H #if defined(__linux__) || defined(__CYGWIN__) || \ (defined(__MACH__) && !defined(__APPLE__)) @@ -73,4 +72,4 @@ #define hton16(x) htobe16(x) #define ntoh16(x) betoh16(x) -#endif /* OUROBOROS_ENDIAN_H */ +#endif /* OUROBOROS_LIB_ENDIAN_H */ diff --git a/include/ouroboros/ipcp-dev.h b/include/ouroboros/ipcp-dev.h index d332a2e0..f07d609b 100644 --- a/include/ouroboros/ipcp-dev.h +++ b/include/ouroboros/ipcp-dev.h @@ -23,8 +23,8 @@ #include #include -#ifndef OUROBOROS_IPCP_DEV_H -#define OUROBOROS_IPCP_DEV_H +#ifndef OUROBOROS_LIB_IPCP_DEV_H +#define OUROBOROS_LIB_IPCP_DEV_H int ipcp_create_r(int result); @@ -65,4 +65,4 @@ int ipcp_sdb_reserve(struct shm_du_buff ** sdb, void ipcp_sdb_release(struct shm_du_buff * sdb); -#endif /* OUROBOROS_IPCP_DEV_H */ +#endif /* OUROBOROS_LIB_IPCP_DEV_H */ diff --git a/include/ouroboros/local-dev.h b/include/ouroboros/local-dev.h index ca3d9b10..c79a13a3 100644 --- a/include/ouroboros/local-dev.h +++ b/include/ouroboros/local-dev.h @@ -20,12 +20,12 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_LOCAL_DEV_H -#define OUROBOROS_LOCAL_DEV_H +#ifndef OUROBOROS_LIB_LOCAL_DEV_H +#define OUROBOROS_LIB_LOCAL_DEV_H ssize_t local_flow_read(int fd); int local_flow_write(int fd, size_t idx); -#endif /* OUROBOROS_LOCAL_DEV_H */ +#endif /* OUROBOROS_LIB_LOCAL_DEV_H */ diff --git a/include/ouroboros/lockfile.h b/include/ouroboros/lockfile.h index e09a8bf2..7652d6cc 100644 --- a/include/ouroboros/lockfile.h +++ b/include/ouroboros/lockfile.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_LOCKFILE_H -#define OUROBOROS_LOCKFILE_H +#ifndef OUROBOROS_LIB_LOCKFILE_H +#define OUROBOROS_LIB_LOCKFILE_H #include @@ -37,4 +37,4 @@ void lockfile_destroy(struct lockfile * lf); pid_t lockfile_owner(struct lockfile * lf); -#endif /* OUROBOROS_LOCKFILE_H */ +#endif /* OUROBOROS_LIB_LOCKFILE_H */ diff --git a/include/ouroboros/logs.h b/include/ouroboros/logs.h index 479cae4a..331f38a9 100644 --- a/include/ouroboros/logs.h +++ b/include/ouroboros/logs.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_LOGS_H -#define OUROBOROS_LOGS_H +#ifndef OUROBOROS_LIB_LOGS_H +#define OUROBOROS_LIB_LOGS_H #ifndef OUROBOROS_PREFIX #error You must define OUROBOROS_PREFIX before including this file @@ -103,4 +103,4 @@ void log_fini(void); #define log_dbg_id(...) do { } while (0) #endif -#endif /* OUROBOROS_LOGS_H */ +#endif /* OUROBOROS_LIB_LOGS_H */ diff --git a/include/ouroboros/np1_flow.h b/include/ouroboros/np1_flow.h index a613441d..65606fca 100644 --- a/include/ouroboros/np1_flow.h +++ b/include/ouroboros/np1_flow.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_NP1_FLOW_H -#define OUROBOROS_NP1_FLOW_H +#ifndef OUROBOROS_LIB_NP1_FLOW_H +#define OUROBOROS_LIB_NP1_FLOW_H #include @@ -47,4 +47,4 @@ static const qosspec_t qos_np1 = { .timeout = 0 }; -#endif /* OUROBOROS_NP1_FLOW_H */ +#endif /* OUROBOROS_LIB_NP1_FLOW_H */ diff --git a/include/ouroboros/protobuf.h b/include/ouroboros/protobuf.h index bb802148..c20ad8ca 100644 --- a/include/ouroboros/protobuf.h +++ b/include/ouroboros/protobuf.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_PROTOBUF_H -#define OUROBOROS_PROTOBUF_H +#ifndef OUROBOROS_LIB_PROTOBUF_H +#define OUROBOROS_LIB_PROTOBUF_H #include #include @@ -35,14 +35,14 @@ typedef EthConfigMsg eth_config_msg_t; typedef UdpConfigMsg udp_config_msg_t; typedef UniConfigMsg uni_config_msg_t; -#include "ipcpd_messages.pb-c.h" +#include "ipcp.pb-c.h" typedef IpcpMsg ipcp_msg_t; -#include "irmd_messages.pb-c.h" +#include "irm.pb-c.h" typedef IpcpInfoMsg ipcp_info_msg_t; typedef NameInfoMsg name_info_msg_t; -#include "qosspec.pb-c.h" +#include "qos.pb-c.h" typedef QosspecMsg qosspec_msg_t; #include "enroll.pb-c.h" @@ -96,4 +96,4 @@ enroll_ack_msg_t * enroll_ack_s_to_msg(const struct enroll_ack * s); struct enroll_ack enroll_ack_msg_to_s(const enroll_ack_msg_t * msg); -#endif /* OUROBOROS_PROTOBUF_H */ \ No newline at end of file +#endif /* OUROBOROS_LIB_PROTOBUF_H */ \ No newline at end of file diff --git a/include/ouroboros/pthread.h b/include/ouroboros/pthread.h index b7516373..917c078b 100644 --- a/include/ouroboros/pthread.h +++ b/include/ouroboros/pthread.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_PTHREAD_H -#define OUROBOROS_PTHREAD_H +#ifndef OUROBOROS_LIB_PTHREAD_H +#define OUROBOROS_LIB_PTHREAD_H #include @@ -36,4 +36,4 @@ static void __attribute__((unused)) __cleanup_mutex_unlock(void * mutex) pthread_mutex_unlock((pthread_mutex_t *) mutex); } -#endif /* OUROBOROS_PTHREAD_H */ +#endif /* OUROBOROS_LIB_PTHREAD_H */ diff --git a/include/ouroboros/qoscube.h b/include/ouroboros/qoscube.h index 93c0480c..76de7d02 100644 --- a/include/ouroboros/qoscube.h +++ b/include/ouroboros/qoscube.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_QOSCUBE_H -#define OUROBOROS_QOSCUBE_H +#ifndef OUROBOROS_LIB_QOSCUBE_H +#define OUROBOROS_LIB_QOSCUBE_H #include @@ -35,4 +35,4 @@ typedef enum qos_cube { qoscube_t qos_spec_to_cube(qosspec_t qs); qosspec_t qos_cube_to_spec(qoscube_t qc); -#endif +#endif /* OUROBOROS_LIB_QOSCUBE_H */ diff --git a/include/ouroboros/random.h b/include/ouroboros/random.h index bf962271..fd74f9be 100644 --- a/include/ouroboros/random.h +++ b/include/ouroboros/random.h @@ -20,12 +20,12 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_RANDOM_H -#define OUROBOROS_RANDOM_H +#ifndef OUROBOROS_LIB_RANDOM_H +#define OUROBOROS_LIB_RANDOM_H #include int random_buffer(void * buf, size_t len); -#endif /* OUROBOROS_RANDOM_H */ +#endif /* OUROBOROS_LIB_RANDOM_H */ diff --git a/include/ouroboros/serdes-oep.h b/include/ouroboros/serdes-oep.h index 4409b047..e36b8fe5 100644 --- a/include/ouroboros/serdes-oep.h +++ b/include/ouroboros/serdes-oep.h @@ -49,7 +49,6 @@ struct enroll_ack { int result; }; - ssize_t enroll_req_ser(const struct enroll_req * req, buffer_t buf); diff --git a/include/ouroboros/shm_du_buff.h b/include/ouroboros/shm_du_buff.h index 000a6e46..33676a3c 100644 --- a/include/ouroboros/shm_du_buff.h +++ b/include/ouroboros/shm_du_buff.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_SHM_DU_BUFF_H -#define OUROBOROS_SHM_DU_BUFF_H +#ifndef OUROBOROS_LIB_SHM_DU_BUFF_H +#define OUROBOROS_LIB_SHM_DU_BUFF_H #include #include @@ -55,4 +55,4 @@ int shm_du_buff_wait_ack(struct shm_du_buff * sdb); int shm_du_buff_ack(struct shm_du_buff * sdb); -#endif /* OUROBOROS_SHM_DU_BUFF_H */ +#endif /* OUROBOROS_LIB_SHM_DU_BUFF_H */ diff --git a/include/ouroboros/shm_flow_set.h b/include/ouroboros/shm_flow_set.h index 946678f3..7b133c4e 100644 --- a/include/ouroboros/shm_flow_set.h +++ b/include/ouroboros/shm_flow_set.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_SHM_FLOW_SET_H -#define OUROBOROS_SHM_FLOW_SET_H +#ifndef OUROBOROS_LIB_SHM_FLOW_SET_H +#define OUROBOROS_LIB_SHM_FLOW_SET_H #include @@ -66,4 +66,4 @@ ssize_t shm_flow_set_wait(const struct shm_flow_set * shm_set, struct portevent * fqueue, const struct timespec * abstime); -#endif /* OUROBOROS_SHM_FLOW_SET_H */ +#endif /* OUROBOROS_LIB_SHM_FLOW_SET_H */ diff --git a/include/ouroboros/shm_rbuff.h b/include/ouroboros/shm_rbuff.h index 331d76fe..cb39babb 100644 --- a/include/ouroboros/shm_rbuff.h +++ b/include/ouroboros/shm_rbuff.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_SHM_RBUFF_H -#define OUROBOROS_SHM_RBUFF_H +#ifndef OUROBOROS_LIB_SHM_RBUFF_H +#define OUROBOROS_LIB_SHM_RBUFF_H #include #include @@ -66,4 +66,4 @@ ssize_t shm_rbuff_read_b(struct shm_rbuff * rb, size_t shm_rbuff_queued(struct shm_rbuff * rb); -#endif /* OUROBOROS_SHM_RBUFF_H */ +#endif /* OUROBOROS_LIB_SHM_RBUFF_H */ diff --git a/include/ouroboros/shm_rdrbuff.h b/include/ouroboros/shm_rdrbuff.h index 91516cfd..8cd737f5 100644 --- a/include/ouroboros/shm_rdrbuff.h +++ b/include/ouroboros/shm_rdrbuff.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_SHM_RDRBUFF_H -#define OUROBOROS_SHM_RDRBUFF_H +#ifndef OUROBOROS_LIB_SHM_RDRBUFF_H +#define OUROBOROS_LIB_SHM_RDRBUFF_H #include #include @@ -64,4 +64,4 @@ struct shm_du_buff * shm_rdrbuff_get(struct shm_rdrbuff * rdrb, int shm_rdrbuff_remove(struct shm_rdrbuff * rdrb, size_t idx); -#endif /* OUROBOROS_SHM_RDRBUFF_H */ +#endif /* OUROBOROS_LIB_SHM_RDRBUFF_H */ diff --git a/include/ouroboros/sockets.h.in b/include/ouroboros/sockets.h.in index 8d4c2f48..2dd3becf 100644 --- a/include/ouroboros/sockets.h.in +++ b/include/ouroboros/sockets.h.in @@ -20,12 +20,12 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_SOCKETS_H -#define OUROBOROS_SOCKETS_H +#ifndef OUROBOROS_LIB_SOCKETS_H +#define OUROBOROS_LIB_SOCKETS_H #include -#include "irmd_messages.pb-c.h" +#include "irm.pb-c.h" typedef IrmMsg irm_msg_t; #define SOCK_PATH "/var/run/ouroboros/" @@ -49,4 +49,4 @@ irm_msg_t * send_recv_irm_msg(irm_msg_t * msg); /* cleanup socket when cancelling thread */ void __cleanup_close_ptr(void * o); -#endif +#endif /* OUROBOROS_LIB_SOCKETS_H */ diff --git a/include/ouroboros/time_utils.h b/include/ouroboros/time_utils.h index bd49e9d1..5b8583ef 100644 --- a/include/ouroboros/time_utils.h +++ b/include/ouroboros/time_utils.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_TIME_UTILS_H -#define OUROBOROS_TIME_UTILS_H +#ifndef OUROBOROS_LIB_TIME_UTILS_H +#define OUROBOROS_LIB_TIME_UTILS_H #ifdef MILLION #undef MILLION @@ -118,4 +118,4 @@ (tv)->tv_usec = (ts)->tv_nsec / 1000L; \ } while (0); -#endif /* OUROBOROS_TIME_UTILS_H */ +#endif /* OUROBOROS_LIB_TIME_UTILS_H */ diff --git a/include/ouroboros/utils.h b/include/ouroboros/utils.h index be345c19..9ee81c92 100644 --- a/include/ouroboros/utils.h +++ b/include/ouroboros/utils.h @@ -20,8 +20,8 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#ifndef OUROBOROS_UTILS_H -#define OUROBOROS_UTILS_H +#ifndef OUROBOROS_LIB_UTILS_H +#define OUROBOROS_LIB_UTILS_H #include #include @@ -57,4 +57,4 @@ char * path_strip(const char * src); free(ptr); \ } while (0); -#endif /* OUROBOROS_UTILS_H */ +#endif /* OUROBOROS_LIB_UTILS_H */ -- cgit v1.2.3