diff options
Diffstat (limited to 'src/tools/irm/irm_ipcp_bootstrap.c')
-rw-r--r-- | src/tools/irm/irm_ipcp_bootstrap.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/tools/irm/irm_ipcp_bootstrap.c b/src/tools/irm/irm_ipcp_bootstrap.c index 259b4325..7134bf64 100644 --- a/src/tools/irm/irm_ipcp_bootstrap.c +++ b/src/tools/irm/irm_ipcp_bootstrap.c @@ -73,6 +73,8 @@ #define DEFAULT_PFF PFF_SIMPLE #define DEFAULT_HASH_ALGO DIR_HASH_SHA3_256 #define DEFAULT_ETHERTYPE 0xA000 +#define DEFAULT_CLIENT_PORT 0x0000 /* random port */ +#define DEFAULT_SERVER_PORT 0x0D6B /* 3435 */ #define FLAT_RANDOM_ADDR_AUTH "flat" #define LINK_STATE_ROUTING "link_state" @@ -106,6 +108,8 @@ static void usage(void) SHA3_384 " " SHA3_512 "}\n\n" "if TYPE == " UDP "\n" " ip <IP address in dotted notation>\n" + " [cport <client port> (default: random)]\n" + " [sport <server port> (default: %d)]\n" " [dns <DDNS IP address in dotted notation>" " (default: none)]\n\n" "if TYPE == " ETH_LLC "\n" @@ -126,12 +130,13 @@ static void usage(void) "if TYPE == " RAPTOR "\n" " [hash [ALGORITHM] (default: %s)]\n" "where ALGORITHM = {" SHA3_224 " " SHA3_256 " " - SHA3_384 " " SHA3_512 "}\n" + SHA3_384 " " SHA3_512 "}\n\n" "if TYPE == " BROADCAST "\n" " [autobind]\n\n", DEFAULT_ADDR_SIZE, DEFAULT_EID_SIZE, DEFAULT_TTL, FLAT_RANDOM_ADDR_AUTH, LINK_STATE_ROUTING, SIMPLE_PFF, - SHA3_256, SHA3_256, 0xA000, SHA3_256, SHA3_256, SHA3_256); + SHA3_256, DEFAULT_SERVER_PORT, SHA3_256, 0xA000, SHA3_256, + SHA3_256, SHA3_256); } int do_bootstrap_ipcp(int argc, @@ -159,6 +164,8 @@ int do_bootstrap_ipcp(int argc, int i = 0; bool autobind = false; int cargs; + int cport = DEFAULT_CLIENT_PORT; + int sport = DEFAULT_SERVER_PORT; while (argc > 0) { cargs = 2; @@ -205,6 +212,10 @@ int do_bootstrap_ipcp(int argc, eid_size = atoi(*(argv + 1)); } else if (matches(*argv, "ttl") == 0) { max_ttl = atoi(*(argv + 1)); + } else if (matches(*argv, "cport") == 0) { + cport = atoi(*(argv + 1)); + } else if (matches(*argv, "sport") == 0) { + sport = atoi(*(argv + 1)); } else if (matches(*argv, "autobind") == 0) { autobind = true; cargs = 1; @@ -318,8 +329,10 @@ int do_bootstrap_ipcp(int argc, case IPCP_UDP: if (ip_addr == 0) goto fail_usage; - conf.ip_addr = ip_addr; + conf.ip_addr = ip_addr; conf.dns_addr = dns_addr; + conf.clt_port = cport; + conf.srv_port = sport; break; case IPCP_ETH_LLC: if (dev == NULL) |