VirtualBox

Changeset 76061 in vbox for trunk/include


Ignore:
Timestamp:
Dec 7, 2018 3:13:22 PM (6 years ago)
Author:
vboxsync
Message:

IPRT: Add RTNetStrToIPv4Cidr() that is intended as a better API
replacement for RTCidrStrToIPv4(). Existing call sites for the latter
are not converted to the new function yet to avoid risky churn right
before the release.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r75879 r76061  
    15501550# define RTNetStrToIPv4AddrEx                           RT_MANGLER(RTNetStrToIPv4AddrEx)
    15511551# define RTNetStrToIPv4Addr                             RT_MANGLER(RTNetStrToIPv4Addr)
     1552# define RTNetStrToIPv4Cidr                             RT_MANGLER(RTNetStrToIPv4Cidr)
    15521553# define RTNetIsIPv6AddrStr                             RT_MANGLER(RTNetIsIPv6AddrStr)
    15531554# define RTNetStrIsIPv6AddrAny                          RT_MANGLER(RTNetStrIsIPv6AddrAny)
  • trunk/include/iprt/net.h

    r69105 r76061  
    102102 */
    103103RTDECL(int) RTNetStrToIPv4Addr(const char *pcszAddr, PRTNETADDRIPV4 pAddr);
     104
     105/**
     106 * Parses dotted-decimal IPv4 CIDR notation into RTNETADDRIPV4
     107 * representation and prefix length.  Missing prefix specification is
     108 * treated as exact address specification (prefix length 32).  Leading
     109 * and trailing whitespace is ignored.
     110 *
     111 * @returns VINF_SUCCESS on success, VERR_INVALID_PARAMETER on
     112 *          failure.
     113 *
     114 * @param   pcszAddr        The value to convert.
     115 * @param   pAddr           Where to store the address.
     116 * @param   piPrefix        Where to store the prefix length;
     117 */
     118RTDECL(int) RTNetStrToIPv4Cidr(const char *pcszAddr, PRTNETADDRIPV4 pAddr, int *piPrefix);
    104119
    105120/**
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