diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/irm/irm_ipcp_bootstrap.c | 55 | ||||
-rw-r--r-- | src/tools/irm/irm_ipcp_connect.c | 4 | ||||
-rw-r--r-- | src/tools/irm/irm_ipcp_disconnect.c | 4 | ||||
-rw-r--r-- | src/tools/irm/irm_ipcp_enroll.c | 23 | ||||
-rw-r--r-- | src/tools/irm/irm_register.c | 12 | ||||
-rw-r--r-- | src/tools/irm/irm_unregister.c | 14 |
6 files changed, 57 insertions, 55 deletions
diff --git a/src/tools/irm/irm_ipcp_bootstrap.c b/src/tools/irm/irm_ipcp_bootstrap.c index 2acb6516..3cad072a 100644 --- a/src/tools/irm/irm_ipcp_bootstrap.c +++ b/src/tools/irm/irm_ipcp_bootstrap.c @@ -62,8 +62,9 @@ #define SHA3_512 "SHA3_512" #define DEFAULT_ADDR_SIZE 4 -#define DEFAULT_FD_SIZE 2 +#define DEFAULT_EID_SIZE 2 #define DEFAULT_DDNS 0 +#define DEFAULT_TTL 60 #define DEFAULT_ADDR_AUTH ADDR_AUTH_FLAT_RANDOM #define DEFAULT_ROUTING ROUTING_LINK_STATE #define DEFAULT_PFF PFF_SIMPLE @@ -76,7 +77,7 @@ static void usage(void) { - /* FIXME: Add ipcp_config stuff */ + /* FIXME: Add ipcp_config stuff. */ printf("Usage: irm ipcp bootstrap\n" " name <ipcp name>\n" " layer <layer name>\n" @@ -85,8 +86,8 @@ static void usage(void) UDP " " ETH_LLC " " RAPTOR "},\n\n" "if TYPE == " NORMAL "\n" " [addr <address size> (default: %d)]\n" - " [fd <fd size> (default: %d)]\n" - " [ttl (add time to live value in the PCI)]\n" + " [eid <eid size> (default: %d)]\n" + " [ttl (max time-to-live value, default: %d)]\n" " [addr_auth <ADDRESS_POLICY> (default: %s)]\n" " [routing <ROUTING_POLICY> (default: %s)]\n" " [pff [PFF_POLICY] (default: %s)]\n" @@ -115,9 +116,9 @@ static void usage(void) " [hash [ALGORITHM] (default: %s)]\n" "where ALGORITHM = {" SHA3_224 " " SHA3_256 " " SHA3_384 " " SHA3_512 "}\n\n", - DEFAULT_ADDR_SIZE, DEFAULT_FD_SIZE, FLAT_RANDOM_ADDR_AUTH, - LINK_STATE_ROUTING, SIMPLE_PFF, SHA3_256, SHA3_256, SHA3_256, - SHA3_256); + DEFAULT_ADDR_SIZE, DEFAULT_EID_SIZE, DEFAULT_TTL, + FLAT_RANDOM_ADDR_AUTH, LINK_STATE_ROUTING, SIMPLE_PFF, + SHA3_256, SHA3_256, SHA3_256, SHA3_256); } int do_bootstrap_ipcp(int argc, @@ -127,8 +128,8 @@ int do_bootstrap_ipcp(int argc, pid_t pid; struct ipcp_config conf; uint8_t addr_size = DEFAULT_ADDR_SIZE; - uint8_t fd_size = DEFAULT_FD_SIZE; - bool has_ttl = false; + uint8_t eid_size = DEFAULT_EID_SIZE; + uint8_t max_ttl = DEFAULT_TTL; enum pol_addr_auth addr_auth_type = DEFAULT_ADDR_AUTH; enum pol_routing routing_type = DEFAULT_ROUTING; enum pol_pff pff_type = DEFAULT_PFF; @@ -136,7 +137,7 @@ int do_bootstrap_ipcp(int argc, uint32_t ip_addr = 0; uint32_t dns_addr = DEFAULT_DDNS; char * ipcp_type = NULL; - char * dif_name = NULL; + char * layer_name = NULL; char * if_name = NULL; pid_t * pids = NULL; ssize_t len = 0; @@ -149,7 +150,7 @@ int do_bootstrap_ipcp(int argc, if (matches(*argv, "type") == 0) { ipcp_type = *(argv + 1); } else if (matches(*argv, "layer") == 0) { - dif_name = *(argv + 1); + layer_name = *(argv + 1); } else if (matches(*argv, "name") == 0) { name = *(argv + 1); } else if (matches(*argv, "hash") == 0) { @@ -173,11 +174,10 @@ int do_bootstrap_ipcp(int argc, if_name = *(argv + 1); } else if (matches(*argv, "addr") == 0) { addr_size = atoi(*(argv + 1)); - } else if (matches(*argv, "fd") == 0) { - fd_size = atoi(*(argv + 1)); + } else if (matches(*argv, "eid") == 0) { + eid_size = atoi(*(argv + 1)); } else if (matches(*argv, "ttl") == 0) { - has_ttl = true; - cargs = 1; + max_ttl = atoi(*(argv + 1)); } else if (matches(*argv, "autobind") == 0) { autobind = true; cargs = 1; @@ -210,23 +210,23 @@ int do_bootstrap_ipcp(int argc, argv += cargs; } - if (name == NULL || dif_name == NULL || ipcp_type == NULL) { + if (name == NULL || layer_name == NULL || ipcp_type == NULL) { usage(); return -1; } - strcpy(conf.dif_info.dif_name, dif_name); + strcpy(conf.layer_info.layer_name, layer_name); if (strcmp(ipcp_type, UDP) != 0) - conf.dif_info.dir_hash_algo = hash_algo; + conf.layer_info.dir_hash_algo = hash_algo; if (strcmp(ipcp_type, NORMAL) == 0) { - conf.type = IPCP_NORMAL; - conf.addr_size = addr_size; - conf.fd_size = fd_size; - conf.has_ttl = has_ttl; + conf.type = IPCP_NORMAL; + conf.addr_size = addr_size; + conf.eid_size = eid_size; + conf.max_ttl = max_ttl; conf.addr_auth_type = addr_auth_type; - conf.routing_type = routing_type; - conf.pff_type = pff_type; + conf.routing_type = routing_type; + conf.pff_type = pff_type; } else if (strcmp(ipcp_type, UDP) == 0) { conf.type = IPCP_UDP; if (ip_addr == 0) { @@ -271,8 +271,9 @@ int do_bootstrap_ipcp(int argc, return -1; } - if (autobind && irm_bind_process(pids[i], dif_name)) { - printf("Failed to bind %d to %s.\n", pids[i], dif_name); + if (autobind && irm_bind_process(pids[i], layer_name)) { + printf("Failed to bind %d to %s.\n", + pids[i], layer_name); irm_unbind_process(pids[i], name); free(pids); return -1; @@ -281,7 +282,7 @@ int do_bootstrap_ipcp(int argc, if (irm_bootstrap_ipcp(pids[i], &conf)) { if (autobind) { irm_unbind_process(pids[i], name); - irm_unbind_process(pids[i], dif_name); + irm_unbind_process(pids[i], layer_name); } free(pids); return -1; diff --git a/src/tools/irm/irm_ipcp_connect.c b/src/tools/irm/irm_ipcp_connect.c index d58adb56..b9cad57d 100644 --- a/src/tools/irm/irm_ipcp_connect.c +++ b/src/tools/irm/irm_ipcp_connect.c @@ -93,10 +93,10 @@ int do_connect_ipcp(int argc, return -1; if (!strcmp(comp_name, DT)) - comp_name = DT_AE; + comp_name = DT_COMP; if (!strcmp(comp_name , MGMT)) - comp_name = MGMT_AE; + comp_name = MGMT_COMP; if (irm_connect_ipcp(pids[0], dst_name, comp_name)) { free(pids); diff --git a/src/tools/irm/irm_ipcp_disconnect.c b/src/tools/irm/irm_ipcp_disconnect.c index 64ca1ea8..8b5eb596 100644 --- a/src/tools/irm/irm_ipcp_disconnect.c +++ b/src/tools/irm/irm_ipcp_disconnect.c @@ -93,10 +93,10 @@ int do_disconnect_ipcp(int argc, return -1; if (!strcmp(comp_name, DT)) - comp_name = DT_AE; + comp_name = DT_COMP; if (!strcmp(comp_name , MGMT)) - comp_name = MGMT_AE; + comp_name = MGMT_COMP; if (irm_disconnect_ipcp(pids[0], dst_name, comp_name)) { free(pids); diff --git a/src/tools/irm/irm_ipcp_enroll.c b/src/tools/irm/irm_ipcp_enroll.c index e827dcf0..8b897096 100644 --- a/src/tools/irm/irm_ipcp_enroll.c +++ b/src/tools/irm/irm_ipcp_enroll.c @@ -54,13 +54,13 @@ static void usage(void) int do_enroll_ipcp(int argc, char ** argv) { - char * name = NULL; - char * dif_name = NULL; - pid_t * pids = NULL; + char * name = NULL; + char * layer_name = NULL; + pid_t * pids = NULL; pid_t pid; - ssize_t len = 0; - int i = 0; - bool autobind = false; + ssize_t len = 0; + int i = 0; + bool autobind = false; int cargs; while (argc > 0) { @@ -68,7 +68,7 @@ int do_enroll_ipcp(int argc, char ** argv) if (matches(*argv, "name") == 0) { name = *(argv + 1); } else if (matches(*argv, "layer") == 0) { - dif_name = *(argv + 1); + layer_name = *(argv + 1); } else if (matches(*argv, "autobind") == 0) { autobind = true; cargs = 1; @@ -82,7 +82,7 @@ int do_enroll_ipcp(int argc, char ** argv) argv += cargs; } - if (dif_name == NULL || name == NULL) { + if (layer_name == NULL || name == NULL) { usage(); return -1; } @@ -101,15 +101,16 @@ int do_enroll_ipcp(int argc, char ** argv) return -1; } - if (irm_enroll_ipcp(pids[i], dif_name)) { + if (irm_enroll_ipcp(pids[i], layer_name)) { if (autobind) irm_unbind_process(pids[i], name); free(pids); return -1; } - if (autobind && irm_bind_process(pids[i], dif_name)) { - printf("Failed to bind %d to %s.\n", pids[i], dif_name); + if (autobind && irm_bind_process(pids[i], layer_name)) { + printf("Failed to bind %d to %s.\n", + pids[i], layer_name); free(pids); return -1; } diff --git a/src/tools/irm/irm_register.c b/src/tools/irm/irm_register.c index f75220be..574c2224 100644 --- a/src/tools/irm/irm_register.c +++ b/src/tools/irm/irm_register.c @@ -59,15 +59,15 @@ static void usage(void) int do_register(int argc, char ** argv) { char * name = NULL; - char * difs[MAX_LAYERS]; - size_t difs_len = 0; + char * layers[MAX_LAYERS]; + size_t layers_len = 0; while (argc > 0) { if (matches(*argv, "name") == 0) { name = *(argv + 1); } else if (matches(*argv, "layer") == 0) { - difs[difs_len++] = *(argv + 1); - if (difs_len > MAX_LAYERS) { + layers[layers_len++] = *(argv + 1); + if (layers_len > MAX_LAYERS) { printf("Too many layers specified\n"); return -1; } @@ -81,10 +81,10 @@ int do_register(int argc, char ** argv) argv += 2; } - if (difs_len < 1 || name == NULL) { + if (layers_len < 1 || name == NULL) { usage(); return -1; } - return irm_reg(name, difs, difs_len); + return irm_reg(name, layers, layers_len); } diff --git a/src/tools/irm/irm_unregister.c b/src/tools/irm/irm_unregister.c index b6b3e242..3b161169 100644 --- a/src/tools/irm/irm_unregister.c +++ b/src/tools/irm/irm_unregister.c @@ -58,17 +58,17 @@ static void usage(void) int do_unregister(int argc, char ** argv) { - char * difs[MAX_LAYERS]; - size_t difs_len = 0; + char * layers[MAX_LAYERS]; + size_t layers_len = 0; char * name = NULL; while (argc > 0) { if (matches(*argv, "name") == 0) { name = *(argv + 1); } else if (matches(*argv, "layer") == 0) { - difs[difs_len++] = *(argv + 1); - if (difs_len > MAX_LAYERS) { - printf("Too many difs specified\n"); + layers[layers_len++] = *(argv + 1); + if (layers_len > MAX_LAYERS) { + printf("Too many layers specified\n"); return -1; } } else { @@ -81,10 +81,10 @@ int do_unregister(int argc, char ** argv) argv += 2; } - if (difs_len == 0 || name == NULL) { + if (layers_len == 0 || name == NULL) { usage(); return -1; } - return irm_unreg(name, difs, difs_len); + return irm_unreg(name, layers, layers_len); } |