VirtualBox

Ignore:
Timestamp:
Mar 21, 2013 8:08:21 AM (12 years ago)
Author:
vboxsync
Message:

patch getopt-cidr.patch from xTracker/5894 with applied recommendations from comment 91.

introduces RTGETOPT_REQ_IPV4CIDR in getop.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/getopt.cpp

    r45115 r45116  
    2828*   Header Files                                                               *
    2929*******************************************************************************/
     30#include <iprt/cidr.h>
    3031#include <iprt/net.h>                   /* must come before getopt.h */
    3132#include <iprt/getopt.h>
     
    410411            break;
    411412        }
    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        }
    414424
    415425        case RTGETOPT_REQ_MACADDR:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette