VirtualBox

Changeset 45122 in vbox


Ignore:
Timestamp:
Mar 21, 2013 10:11:34 AM (12 years ago)
Author:
vboxsync
Message:

IPRT/net: moved RTNetStrToIPv4Addr to netaddrstr2.cpp

Location:
trunk/src/VBox/Runtime
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r45110 r45122  
    341341        common/misc/uri.cpp \
    342342        common/net/netaddrstr.cpp \
     343        common/net/netaddrstr2.cpp \
    343344        common/path/rtPathRootSpecLen.cpp \
    344345        common/path/rtPathVolumeSpecLen.cpp \
  • trunk/src/VBox/Runtime/common/net/netaddrstr.cpp

    r45120 r45122  
    12841284}
    12851285RT_EXPORT_SYMBOL(RTNetIsIPv4AddrStr);
    1286 
    1287 
    1288 /** @todo r=bird: move to separate file, netaddrstr2.cpp without the contrib
    1289  *        statement in the header. This is our code. */
    1290 RTDECL(int) RTNetStrToIPv4Addr(const char *pszAddr, PRTNETADDRIPV4 pAddr)
    1291 {
    1292     char *pszNext;
    1293     AssertPtrReturn(pszAddr, VERR_INVALID_PARAMETER);
    1294     AssertPtrReturn(pAddr, VERR_INVALID_PARAMETER);
    1295 
    1296     int rc = RTStrToUInt8Ex(RTStrStripL(pszAddr), &pszNext, 10, &pAddr->au8[0]);
    1297     if (rc != VINF_SUCCESS && rc != VWRN_TRAILING_CHARS)
    1298         return VERR_INVALID_PARAMETER;
    1299     if (*pszNext++ != '.')
    1300         return VERR_INVALID_PARAMETER;
    1301 
    1302     rc = RTStrToUInt8Ex(pszNext, &pszNext, 10, &pAddr->au8[1]);
    1303     if (rc != VINF_SUCCESS && rc != VWRN_TRAILING_CHARS)
    1304         return VERR_INVALID_PARAMETER;
    1305     if (*pszNext++ != '.')
    1306         return VERR_INVALID_PARAMETER;
    1307 
    1308     rc = RTStrToUInt8Ex(pszNext, &pszNext, 10, &pAddr->au8[2]);
    1309     if (rc != VINF_SUCCESS && rc != VWRN_TRAILING_CHARS)
    1310         return VERR_INVALID_PARAMETER;
    1311     if (*pszNext++ != '.')
    1312         return VERR_INVALID_PARAMETER;
    1313 
    1314     rc = RTStrToUInt8Ex(pszNext, &pszNext, 10, &pAddr->au8[3]);
    1315     if (rc != VINF_SUCCESS && rc != VWRN_TRAILING_SPACES)
    1316         return VERR_INVALID_PARAMETER;
    1317     pszNext = RTStrStripL(pszNext);
    1318     if (*pszNext)
    1319         return VERR_INVALID_PARAMETER;
    1320 
    1321     return VINF_SUCCESS;
    1322 }
    1323 RT_EXPORT_SYMBOL(RTNetStrToIPv4Addr);
    1324 
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