From 02f68ff5ccc637b2177f832a4f7ddf4f9f737d22 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 21 Jan 2024 10:59:17 +0100 Subject: include: Use common definition between lib and IRMd Some definitions/enums were different between the library and IRMd (flow_state, ipcp_state). This moves them to common ground. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- include/ouroboros/ipcp.h | 49 ++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) (limited to 'include/ouroboros/ipcp.h') diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h index a2c7720a..eb7d1670 100644 --- a/include/ouroboros/ipcp.h +++ b/include/ouroboros/ipcp.h @@ -26,17 +26,21 @@ #include #include #include +#include #define IPCP_NAME_SIZE 255 #define LAYER_NAME_SIZE 255 #define DEV_NAME_SIZE 255 -/* Unicast IPCP components. */ -#define DT_COMP "Data Transfer" -#define MGMT_COMP "Management" +enum ipcp_state { + IPCP_INIT = 0, + IPCP_BOOT, + IPCP_OPERATIONAL, + IPCP_SHUTDOWN, + IPCP_NULL +}; -/* NOTE: The IRMd uses this order to select an IPCP for flow allocation. */ -enum ipcp_type { +enum ipcp_type { /* IRMd uses order to select an IPCP for flow allocation. */ IPCP_LOCAL = 0, IPCP_UNICAST, IPCP_BROADCAST, @@ -46,6 +50,17 @@ enum ipcp_type { IPCP_INVALID }; +struct ipcp_info { + enum ipcp_type type; + pid_t pid; + char name[IPCP_NAME_SIZE + 1]; + enum ipcp_state state; +}; + +/* Unicast IPCP components. */ +#define DT_COMP "Data Transfer" +#define MGMT_COMP "Management" + /* Unicast IPCP policies */ enum pol_addr_auth { ADDR_AUTH_FLAT_RANDOM = 0, @@ -65,14 +80,6 @@ enum pol_cong_avoid { CA_INVALID }; -enum pol_dir_hash { - DIR_HASH_SHA3_224, - DIR_HASH_SHA3_256, - DIR_HASH_SHA3_384, - DIR_HASH_SHA3_512, - DIR_HASH_INVALID -}; - struct dt_config { uint8_t addr_size; uint8_t eid_size; @@ -98,16 +105,18 @@ struct udp_config { uint16_t port; }; -/* Info about the IPCP */ -struct ipcp_info { - enum ipcp_type type; - char name[IPCP_NAME_SIZE + 1]; +/* Layers */ +enum pol_dir_hash { + DIR_HASH_SHA3_224, + DIR_HASH_SHA3_256, + DIR_HASH_SHA3_384, + DIR_HASH_SHA3_512, + DIR_HASH_INVALID }; -/* Info reported back to the IRMd about the layer on enrollment */ struct layer_info { - char name[LAYER_NAME_SIZE + 1]; - int dir_hash_algo; + char name[LAYER_NAME_SIZE + 1]; + enum pol_dir_hash dir_hash_algo; }; /* Structure to configure the first IPCP */ -- cgit v1.2.3