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.h72
1 files changed, 67 insertions, 5 deletions
diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h
index 49deeffd..c4d596b2 100644
--- a/include/ouroboros/ipcp.h
+++ b/include/ouroboros/ipcp.h
@@ -28,6 +28,11 @@
#include <stdbool.h>
#define LAYER_NAME_SIZE 255
+#define DEV_NAME_SIZE 255
+
+/* Unicast IPCP components. */
+#define DT_COMP "Data Transfer"
+#define MGMT_COMP "Management"
/* NOTE: The IRMd uses this order to select an IPCP for flow allocation. */
enum ipcp_type {
@@ -42,25 +47,29 @@ enum ipcp_type {
/* Unicast IPCP policies */
enum pol_addr_auth {
- ADDR_AUTH_FLAT_RANDOM = 0
+ ADDR_AUTH_FLAT_RANDOM = 0,
+ ADDR_AUTH_INVALID
};
enum pol_routing {
ROUTING_LINK_STATE = 0,
ROUTING_LINK_STATE_LFA,
- ROUTING_LINK_STATE_ECMP
+ ROUTING_LINK_STATE_ECMP,
+ ROUTING_INVALID
};
enum pol_cong_avoid {
CA_NONE = 0,
- CA_MB_ECN
+ CA_MB_ECN,
+ CA_INVALID
};
enum pol_dir_hash {
DIR_HASH_SHA3_224,
DIR_HASH_SHA3_256,
DIR_HASH_SHA3_384,
- DIR_HASH_SHA3_512
+ DIR_HASH_SHA3_512,
+ DIR_HASH_INVALID
};
struct dt_config {
@@ -78,7 +87,7 @@ struct uni_config {
};
struct eth_config {
- char * dev;
+ char dev[DEV_NAME_SIZE + 1];
uint16_t ethertype; /* DIX only*/
};
@@ -106,4 +115,57 @@ struct ipcp_config {
};
};
+/* default configurations */
+static const struct ipcp_config local_default_conf = {
+ .type = IPCP_LOCAL,
+ .layer_info = {
+ .dir_hash_algo = DIR_HASH_SHA3_256
+ }
+};
+
+static const struct ipcp_config eth_dix_default_conf = {
+ .type = IPCP_ETH_DIX,
+ .layer_info = {
+ .dir_hash_algo = DIR_HASH_SHA3_256
+ },
+ .eth = {
+ .ethertype=0xA000,
+ }
+};
+
+static const struct ipcp_config eth_llc_default_conf = {
+ .type = IPCP_ETH_LLC,
+ .layer_info = {
+ .dir_hash_algo = DIR_HASH_SHA3_256
+ }
+};
+
+static const struct ipcp_config udp_default_conf = {
+ .type = IPCP_UDP,
+ .udp = {
+ .port = 3435
+ }
+};
+
+static const struct ipcp_config uni_default_conf = {
+ .type = IPCP_UNICAST,
+ .layer_info = {
+ .dir_hash_algo = DIR_HASH_SHA3_256
+ },
+ .unicast = {
+ .dt = {
+ .addr_size = 4,
+ .eid_size = 8,
+ .max_ttl = 6,
+ .routing_type = ROUTING_LINK_STATE
+ },
+ .addr_auth_type = ADDR_AUTH_FLAT_RANDOM,
+ .cong_avoid = CA_MB_ECN
+ }
+};
+
+static const struct ipcp_config bc_default_conf = {
+ .type = IPCP_BROADCAST
+};
+
#endif /* OUROBOROS_IPCP_H */