@@ -47,6 +47,11 @@ static void print_usage(const char *argv0) {
47
47
"specified\n" );
48
48
printf ("--vmnet-interface-id=UUID vmnet interface ID (default: "
49
49
"random)\n" );
50
+ printf ("--vmnet-nat66-prefix=PREFIX:: The IPv6 prefix to use with "
51
+ "shared mode.\n" );
52
+ printf (" The prefix must be a ULA i.e. "
53
+ "start with fd00::/8.\n" );
54
+ printf (" (default: random)\n" );
50
55
printf ("-p, --pidfile=PIDFILE save pid to PIDFILE\n" );
51
56
printf ("-h, --help display this help and exit\n" );
52
57
printf ("-v, --version display version information and "
@@ -64,6 +69,7 @@ static void print_version() { puts(VERSION); }
64
69
#define CLI_OPTIONS_ID_VMNET_DHCP_END -46
65
70
#define CLI_OPTIONS_ID_VMNET_MASK -47
66
71
#define CLI_OPTIONS_ID_VMNET_INTERFACE_ID -48
72
+ #define CLI_OPTIONS_ID_VMNET_NAT66_PREFIX -50
67
73
struct cli_options * cli_options_parse (int argc , char * argv []) {
68
74
struct cli_options * res = malloc (sizeof (* res ));
69
75
if (res == NULL ) {
@@ -82,6 +88,8 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
82
88
{"vmnet-mask" , required_argument , NULL , CLI_OPTIONS_ID_VMNET_MASK },
83
89
{"vmnet-interface-id" , required_argument , NULL ,
84
90
CLI_OPTIONS_ID_VMNET_INTERFACE_ID },
91
+ {"vmnet-nat66-prefix" , required_argument , NULL ,
92
+ CLI_OPTIONS_ID_VMNET_NAT66_PREFIX },
85
93
{"pidfile" , required_argument , NULL , 'p' },
86
94
{"help" , no_argument , NULL , 'h' },
87
95
{"version" , no_argument , NULL , 'v' },
@@ -123,6 +131,9 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
123
131
goto error ;
124
132
}
125
133
break ;
134
+ case CLI_OPTIONS_ID_VMNET_NAT66_PREFIX :
135
+ res -> vmnet_nat66_prefix = strdup (optarg );
136
+ break ;
126
137
case 'p' :
127
138
res -> pidfile = strdup (optarg );
128
139
break ;
@@ -238,6 +249,8 @@ void cli_options_destroy(struct cli_options *x) {
238
249
free (x -> vmnet_dhcp_end );
239
250
if (x -> vmnet_mask != NULL )
240
251
free (x -> vmnet_mask );
252
+ if (x -> vmnet_nat66_prefix != NULL )
253
+ free (x -> vmnet_nat66_prefix );
241
254
if (x -> pidfile != NULL )
242
255
free (x -> pidfile );
243
256
free (x );
0 commit comments