diff options
Diffstat (limited to 'src/tools/irm')
-rw-r--r-- | src/tools/irm/irm_ipcp_bootstrap.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tools/irm/irm_ipcp_bootstrap.c b/src/tools/irm/irm_ipcp_bootstrap.c index 98efe16d..2508ffa3 100644 --- a/src/tools/irm/irm_ipcp_bootstrap.c +++ b/src/tools/irm/irm_ipcp_bootstrap.c @@ -45,6 +45,9 @@ #define DEFAULT_MIN_PDU_SIZE 0 #define DEFAULT_MAX_PDU_SIZE 9000 #define DEFAULT_DDNS 0 +#define DEFAULT_ADDR_AUTH FLAT_RANDOM + +#define ADDR_AUTH_FLAT "flat" static void usage(void) { @@ -64,6 +67,7 @@ static void usage(void) " [chk <add 32-bit checksum in the PCI>]\n" " [min_pdu <minimum PDU size> (default: %d)]\n" " [max_pdu <maximum PDU size> (default: %d)]\n" + " [addr_auth <address policy> (default: %s)]\n" "if TYPE == " SHIM_UDP "\n" " ip <IP address in dotted notation>\n" " [dns <DDNS IP address in dotted notation>" @@ -72,7 +76,8 @@ static void usage(void) " if_name <interface name>\n", DEFAULT_ADDR_SIZE, DEFAULT_CEP_ID_SIZE, DEFAULT_PDU_LEN_SIZE, DEFAULT_SEQ_NO_SIZE, - DEFAULT_MIN_PDU_SIZE, DEFAULT_MAX_PDU_SIZE, DEFAULT_DDNS); + DEFAULT_MIN_PDU_SIZE, DEFAULT_MAX_PDU_SIZE, + ADDR_AUTH_FLAT, DEFAULT_DDNS); } int do_bootstrap_ipcp(int argc, char ** argv) @@ -88,6 +93,7 @@ int do_bootstrap_ipcp(int argc, char ** argv) bool has_chk = false; uint32_t min_pdu_size = DEFAULT_MIN_PDU_SIZE; uint32_t max_pdu_size = DEFAULT_MAX_PDU_SIZE; + enum pol_addr_auth addr_auth_type = DEFAULT_ADDR_AUTH; uint32_t ip_addr = 0; uint32_t dns_addr = DEFAULT_DDNS; char * ipcp_type = NULL; @@ -136,6 +142,9 @@ int do_bootstrap_ipcp(int argc, char ** argv) min_pdu_size = atoi(*(argv + 1)); } else if (matches(*argv, "max_pdu") == 0) { max_pdu_size = atoi(*(argv + 1)); + } else if (matches(*argv, "addr_auth") == 0) { + if (strcmp(ADDR_AUTH_FLAT, *(argv + 1)) == 0) + addr_auth_type = FLAT_RANDOM; } else { printf("\"%s\" is unknown, try \"irm " "ipcp bootstrap\".\n", *argv); @@ -163,6 +172,7 @@ int do_bootstrap_ipcp(int argc, char ** argv) conf.has_chk = has_chk; conf.min_pdu_size = min_pdu_size; conf.max_pdu_size = max_pdu_size; + conf.addr_auth_type = addr_auth_type; } else if (strcmp(ipcp_type, SHIM_UDP) == 0) { conf.type = IPCP_SHIM_UDP; if (ip_addr == 0) { |