Changeset 93278 in vbox
- Timestamp:
- Jan 17, 2022 3:51:51 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageNATNetwork.cpp
r93115 r93278 181 181 int dhcp = -1; 182 182 int ipv6 = -1; 183 int ipv6_default = -1; 183 184 184 185 VPF2DELETE vPfName2Delete; … … 190 191 LONG loopback6Offset = 0; /* ignore me */ 191 192 192 #define NATNET_CMD_OPT_IPV6_PREFIX (256 + '6') 193 enum 194 { 195 kNATNetworkIota = 1000, 196 kNATNetwork_IPv6Default, 197 kNATNetwork_IPv6Prefix, 198 }; 199 193 200 static const RTGETOPTDEF g_aNATNetworkIPOptions[] = 194 201 { … … 198 205 { "--dhcp", 'h', RTGETOPT_REQ_BOOL }, 199 206 { "--ipv6", '6', RTGETOPT_REQ_BOOL }, /* old name */ 207 { "--ipv6-default", kNATNetwork_IPv6Default, RTGETOPT_REQ_BOOL }, 200 208 { "--ipv6-enable", '6', RTGETOPT_REQ_BOOL }, /* new name */ 201 { "--ipv6-prefix", NATNET_CMD_OPT_IPV6_PREFIX,RTGETOPT_REQ_STRING },209 { "--ipv6-prefix", kNATNetwork_IPv6Prefix, RTGETOPT_REQ_STRING }, 202 210 { "--enable", 'e', RTGETOPT_REQ_NOTHING }, 203 211 { "--disable", 'd', RTGETOPT_REQ_NOTHING }, … … 254 262 break; 255 263 256 case NATNET_CMD_OPT_IPV6_PREFIX:264 case kNATNetwork_IPv6Prefix: 257 265 if (pPrefixIPv6) 258 266 return errorSyntax(USAGE_NATNETWORK, Nat::tr("You can specify --ipv6-prefix only once.")); 259 267 pPrefixIPv6 = ValueUnion.psz; 268 break; 269 270 case kNATNetwork_IPv6Default: // XXX: uwe 271 if (ipv6_default != -1) 272 return errorSyntax(USAGE_NATNETWORK, Nat::tr("You can specify --ipv6-default only once.")); 273 ipv6_default = ValueUnion.f; 260 274 break; 261 275 … … 417 431 { 418 432 CHECK_ERROR(net, COMSETTER(IPv6Enabled)(TRUE)); 433 if (FAILED(rc)) 434 return errorArgument(Nat::tr("Failed to set configuration")); 435 } 436 437 if (ipv6_default != -1) 438 { 439 BOOL fIPv6Default = RT_BOOL(ipv6_default); 440 CHECK_ERROR(net, COMSETTER(AdvertiseDefaultIPv6RouteEnabled)(fIPv6Default)); 419 441 if (FAILED(rc)) 420 442 return errorArgument(Nat::tr("Failed to set configuration"));
Note:
See TracChangeset
for help on using the changeset viewer.