summaryrefslogtreecommitdiff
path: root/include/ouroboros/ipcp.h
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2024-01-21 10:59:17 +0100
committerSander Vrijders <sander@ouroboros.rocks>2024-01-31 10:27:56 +0100
commit02f68ff5ccc637b2177f832a4f7ddf4f9f737d22 (patch)
treeeeef68d751d4feb0c95b3831b3e325d45ca9bc9b /include/ouroboros/ipcp.h
parent396c311842ae7d138c13a6d054e1978d95af4c63 (diff)
downloadouroboros-02f68ff5ccc637b2177f832a4f7ddf4f9f737d22.tar.gz
ouroboros-02f68ff5ccc637b2177f832a4f7ddf4f9f737d22.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'include/ouroboros/ipcp.h')
-rw-r--r--include/ouroboros/ipcp.h49
1 files changed, 29 insertions, 20 deletions
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 <stdint.h>
#include <unistd.h>
#include <stdbool.h>
+#include <sys/types.h>
#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 */