diff options
author | dimitri staessens <[email protected]> | 2016-11-01 11:17:40 +0000 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-11-01 11:17:40 +0000 |
commit | 0a9f1f2936381dfe350c1846b3bafc306590a88f (patch) | |
tree | e077cc1012baa343a73e84816ede6e5dd1e94c38 /src/tools/irm/irm_ipcp_bootstrap.c | |
parent | 409cf34d132c71910d7b9d452f54ae49154946f9 (diff) | |
parent | 2d88fdaaa018d607eca5ce057dfbdf41beb6125b (diff) | |
download | ouroboros-0a9f1f2936381dfe350c1846b3bafc306590a88f.tar.gz ouroboros-0a9f1f2936381dfe350c1846b3bafc306590a88f.zip |
Merged in sandervrijders/ouroboros/be-addr-auth (pull request #296)
ipcpd: normal: Add policy for obtaining a flat address
Diffstat (limited to 'src/tools/irm/irm_ipcp_bootstrap.c')
-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) { |