VirtualBox

Ignore:
Timestamp:
Oct 7, 2013 10:00:27 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89653
Message:

NetworkServices: Whitespace (including tabs!) and svn:keywords cleanups by scm.

Location:
trunk/src/VBox/NetworkServices/NetLib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.cpp

    r47118 r48956  
    102102    m_Name                  = "VBoxNetNAT";
    103103    m_Network               = "intnet";
    104    
     104
    105105    for(unsigned int i = 0; i < RT_ELEMENTS(g_aGetOptDef); ++i)
    106106        m_vecOptionDefs.push_back(&g_aGetOptDef[i]);
     
    392392    /* Commit */
    393393    IntNetRingCommitFrame(&m_pIfBuf->Send, pHdr);
    394    
     394
    395395    LogFlowFuncLeaveRC(rc);
    396396    return rc;
     
    428428        va_list vaCopy;                 /* This dude is *very* special, thus the copy. */
    429429        va_copy(vaCopy, va);
    430         RTStrmPrintf(g_pStdErr, "%s: %s: %N\n", 
     430        RTStrmPrintf(g_pStdErr, "%s: %s: %N\n",
    431431                     RTProcShortName(),
    432432                     iMinLevel >= 2 ? "debug" : "info",
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetPortForwardString.cpp

    r48365 r48956  
    5050#define PF_STR_ADDRESS_FIELD_ENDS "]"
    5151
    52 static int netPfStrAddressParse(char *pszRaw, int cbRaw, 
     52static int netPfStrAddressParse(char *pszRaw, int cbRaw,
    5353                                char *pszAddress, int cbAddress,
    5454                                bool fEmptyAcceptable)
     
    6666        pszRaw++;
    6767        cbRaw--;
    68        
     68
    6969
    7070        /* we shouldn't face with ending here */
     
    7272
    7373        char *pszEndOfAddress = RTStrStr(pszRaw, PF_STR_ADDRESS_FIELD_ENDS);
    74        
     74
    7575        /* no pair closing sign */
    7676        AssertPtrReturn(pszEndOfAddress, VERR_INVALID_PARAMETER);
    77                        
     77
    7878        cbField = pszEndOfAddress - pszRaw;
    79        
     79
    8080        /* field should be less then the rest of the string */
    8181        AssertReturn(cbField < cbRaw, VERR_INVALID_PARAMETER);
    82        
     82
    8383        if (cbField != 0)
    8484            RTStrCopy(pszAddress, RT_MIN(cbField + 1, cbAddress), pszRaw);
     
    8989    AssertReturn(pszRaw[cbField] == PF_ADDRESS_FIELD_ENDS, -1);
    9090
    91     return cbField + 2; /* length of the field and closing braces */ 
     91    return cbField + 2; /* length of the field and closing braces */
    9292}
    9393
     
    113113        cbRest = strlen(pszRaw);
    114114
    115         Assert(cbRaw == cbRest); 
    116        
     115        Assert(cbRaw == cbRest);
     116
    117117        /* XXX: Assumption that if string is too big, it will be reported by
    118118         * RTStrToUint16.
     
    142142    if (!(u16Port = RTStrToUInt16(aszPort)))
    143143        return -1;
    144    
     144
    145145    *pu16Port = u16Port;
    146146
     
    149149
    150150
    151 static int netPfStrAddressPortPairParse(char *pszRaw, int cbRaw, 
    152                                         char *pszAddress, int cbAddress, 
     151static int netPfStrAddressPortPairParse(char *pszRaw, int cbRaw,
     152                                        char *pszAddress, int cbAddress,
    153153                                        bool fEmptyAddressAcceptable,
    154154                                        uint16_t *pu16Port)
     
    173173    if (pszRaw[0] == PF_ADDRESS_FIELD_STARTS)
    174174    {
    175         idxRaw += netPfStrAddressParse(pszRaw, 
    176                                        cbRaw - idxRaw, 
     175        idxRaw += netPfStrAddressParse(pszRaw,
     176                                       cbRaw - idxRaw,
    177177                                       pszAddress,
    178178                                       cbAddress,
     
    184184    }
    185185    else return -1;
    186                    
     186
    187187    pszRaw += idxRaw;
    188188    idxRawTotal += idxRaw;
     
    190190
    191191    AssertReturn(cbRaw > 0, VERR_INVALID_PARAMETER);
    192    
     192
    193193    idxRaw = 0;
    194194
     
    211211}
    212212
    213 /* XXX: Having fIPv6 we might emprove adress verification comparing address length 
     213/* XXX: Having fIPv6 we might emprove adress verification comparing address length
    214214 * with INET[6]_ADDRLEN
    215215 */
     
    224224    bool fTcpProto = false;
    225225
    226     char *pszRawBegin = NULL; 
     226    char *pszRawBegin = NULL;
    227227    char *pszRaw = NULL;
    228228    int idxRaw = 0;
     
    240240    pszName = &pPfr->aszPfrName[0];
    241241
    242     cbRaw = strlen(pcszStrPortForward); 
     242    cbRaw = strlen(pcszStrPortForward);
    243243
    244244    /* Minimal rule ":tcp:[]:0:[]:0" has got lenght 14 */
    245245    AssertReturn(cbRaw > 14, VERR_INVALID_PARAMETER);
    246    
     246
    247247    pszRaw = RTStrDup(pcszStrPortForward);
    248248
     
    252252
    253253    /* name */
    254     if (pszRaw[idxRaw] == PF_FIELD_SEPARATOR) 
     254    if (pszRaw[idxRaw] == PF_FIELD_SEPARATOR)
    255255        idxRaw = 1; /* begin of the next segment */
    256256    else
     
    263263        /* XXX it's unacceptable to have only name entry in PF */
    264264        AssertReturn(cbToken < cbRaw, VERR_INVALID_PARAMETER);
    265        
     265
    266266        if (   cbToken < 0
    267267            || (size_t)cbToken >= PF_NAMELEN)
    268268            goto invalid_parameter;
    269269
    270         RTStrCopy(pszName, 
    271                   RT_MIN((size_t)cbToken + 1, PF_NAMELEN), 
     270        RTStrCopy(pszName,
     271                  RT_MIN((size_t)cbToken + 1, PF_NAMELEN),
    272272                  pszRaw);
    273273        pszRaw += cbToken; /* move to separator */
    274274    }
    275    
     275
    276276    AssertReturn(pszRaw[0] == PF_FIELD_SEPARATOR, VERR_INVALID_PARAMETER);
    277277    /* protocol */
     
    279279    pszRaw++; /* skip separator */
    280280    idxRaw = 0;
    281    
     281
    282282    cbRaw--;
    283283
     
    291291    else
    292292        goto invalid_parameter;
    293                    
     293
    294294    pszRaw += idxRaw;
    295295    cbRaw -= idxRaw;
    296296    idxRaw = 0;
    297                    
    298     idxRaw = netPfStrAddressPortPairParse(pszRaw, cbRaw, 
     297
     298    idxRaw = netPfStrAddressPortPairParse(pszRaw, cbRaw,
    299299                                         pszHostAddr, INET6_ADDRSTRLEN,
    300300                                         true, &u16HostPort);
     
    309309    idxRaw = 0;
    310310
    311     idxRaw = netPfStrAddressPortPairParse(pszRaw, cbRaw, 
    312                                           pszGuestAddr, 
     311    idxRaw = netPfStrAddressPortPairParse(pszRaw, cbRaw,
     312                                          pszGuestAddr,
    313313                                          INET6_ADDRSTRLEN,
    314314                                          false,
     
    322322    pPfr->iPfrProto = proto;
    323323
    324    
     324
    325325    if (strlen(pszHostAddr))
    326326    {
     
    335335            goto invalid_parameter;
    336336    }
    337    
     337
    338338    pPfr->u16PfrHostPort = u16HostPort;
    339339
     
    341341    {
    342342        if (!fIPv6)
    343             rc = RTNetStrToIPv4Addr(pszGuestAddr, &pPfr->uPfrGuestAddr.IPv4);       
     343            rc = RTNetStrToIPv4Addr(pszGuestAddr, &pPfr->uPfrGuestAddr.IPv4);
    344344#if 0
    345345        else
     
    351351    else
    352352        goto invalid_parameter; /* guest address should be defined */
    353    
     353
    354354    pPfr->u16PfrGuestPort = u16GuestPort;
    355    
     355
    356356    Log(("name: %s\n"
    357357         "proto: %d\n"
     
    366366    RTStrFree(pszRawBegin);
    367367    return VINF_SUCCESS;
    368    
     368
    369369invalid_parameter:
    370370    RTStrFree(pszRawBegin);
  • trunk/src/VBox/NetworkServices/NetLib/VBoxPortForwardString.h

    r48363 r48956  
    2626#define PF_NAMELEN 64
    2727/*
    28  * TBD: Here is shared implementation of parsing port-forward string 
     28 * TBD: Here is shared implementation of parsing port-forward string
    2929 * of format:
    3030 *      name:[ipv4 or ipv6 address]:host-port:[ipv4 or ipv6 guest addr]:guest port
    31  * 
    32  * This code supposed to be used in NetService and Frontend and perhaps in corresponding 
     31 *
     32 * This code supposed to be used in NetService and Frontend and perhaps in corresponding
    3333 * services.
    3434 *
Note: See TracChangeset for help on using the changeset viewer.

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