Changeset 45116 in vbox
- Timestamp:
- Mar 21, 2013 8:08:21 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84410
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/getopt.h
r44528 r45116 70 70 * (Not a name, but 4 values in the 0..255 range with dots separating them). */ 71 71 #define RTGETOPT_REQ_IPV4ADDR 10 72 #if 073 72 /** The value must be a valid IPv4 CIDR. 74 73 * As with RTGETOPT_REQ_IPV4ADDR, no name. 75 * @todo Mix CIDR with types.h or/and net.h first and find a way to make the 76 * mask optional like with ifconfig. See RTCidrStrToIPv4. */ 74 */ 77 75 #define RTGETOPT_REQ_IPV4CIDR 11 76 #if 0 77 /* take placers */ 78 /** The value must be a valid IPv6 addr 79 * @todo: Add types and parsing routines in (iprt/net.h) 80 */ 81 #define RTGETOPT_REQ_IPV6ADDR 12 82 /** The value must be a valid IPv6 CIDR 83 * @todo: Add types and parsing routines in (iprt/net.h) 84 */ 85 #define RTGETOPT_REQ_IPV6CIDR 13 78 86 #endif 79 87 /** The value must be a valid ethernet MAC address. */ … … 164 172 /** A RTGETOPT_REQ_IPV4ADDR option argument. */ 165 173 RTNETADDRIPV4 IPv4Addr; 174 /** A RTGETOPT_REQ_IPV4CIDR option argument. */ 175 struct 176 { 177 RTNETADDRIPV4 IPv4Network; 178 RTNETADDRIPV4 IPv4Netmask; 179 } CidrIPv4; 166 180 #endif 167 181 /** A RTGETOPT_REQ_MACADDR option argument. */ -
trunk/src/VBox/Runtime/common/misc/getopt.cpp
r45115 r45116 28 28 * Header Files * 29 29 *******************************************************************************/ 30 #include <iprt/cidr.h> 30 31 #include <iprt/net.h> /* must come before getopt.h */ 31 32 #include <iprt/getopt.h> … … 410 411 break; 411 412 } 412 #if 0 /** @todo CIDR */ 413 #endif 413 414 case RTGETOPT_REQ_IPV4CIDR: 415 { 416 RTNETADDRIPV4 network; 417 RTNETADDRIPV4 netmask; 418 if (RT_FAILURE(RTCidrStrToIPv4(pszValue, &network, &netmask))) 419 return VERR_GETOPT_INVALID_ARGUMENT_FORMAT; 420 pValueUnion->CidrIPv4.IPv4Network.u = network.u; 421 pValueUnion->CidrIPv4.IPv4Netmask.u = netmask.u; 422 break; 423 } 414 424 415 425 case RTGETOPT_REQ_MACADDR:
Note:
See TracChangeset
for help on using the changeset viewer.