summaryrefslogtreecommitdiff
path: root/include/ouroboros/ipcp.h
diff options
context:
space:
mode:
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 */