VirtualBox

Ignore:
Timestamp:
Jan 24, 2014 8:23:12 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91785
Message:

spaces

Location:
trunk/src/VBox/NetworkServices/DHCP
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/DHCP/ClientDataInt.h

    r49563 r50213  
    3737    }
    3838    ~ClientData(){}
    39    
     39
    4040    /* client information */
    4141    RTNETADDRIPV4 m_address;
    4242    RTNETADDRIPV4 m_network;
    4343    RTMAC m_mac;
    44    
     44
    4545    bool fHasClient;
    4646
    4747    /* Lease part */
    48     bool fHasLease; 
     48    bool fHasLease;
    4949    /** lease isn't commited */
    5050    bool fBinding;
     
    6464    NetworkConfigEntity *pCfg;
    6565};
     66
    6667#endif
  • trunk/src/VBox/NetworkServices/DHCP/Config.cpp

    r49920 r50213  
    11/* $Id$ */
     2/** @file
     3 * Configuration for DHCP.
     4 */
     5
     6/*
     7 * Copyright (C) 2013-2014 Oracle Corporation
     8 *
     9 * This file is part of VirtualBox Open Source Edition (OSE), as
     10 * available from http://www.virtualbox.org. This file is free software;
     11 * you can redistribute it and/or modify it under the terms of the GNU
     12 * General Public License (GPL) as published by the Free Software
     13 * Foundation, in version 2 as it comes in the "COPYING" file of the
     14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16 */
     17
    218
    319/**
     
    131147    bool                 fFileExists;
    132148};
    133    
     149
    134150ConfigurationManager *ConfigurationManager::getConfigurationManager()
    135151{
     
    174190{
    175191    m->m_leaseStorageFilename = leaseStorageFileName;
    176    
     192
    177193    xml::XmlFileParser parser;
    178194    xml::Document doc;
     
    208224        if (!lease->nameEquals(tagXMLLease.c_str()))
    209225            continue;
    210        
     226
    211227        ClientData *data = new ClientData();
    212228        Lease l(data);
    213         if (l.fromXML(lease)) 
     229        if (l.fromXML(lease))
    214230        {
    215231
     
    242258    if (!root)
    243259        return VERR_INTERNAL_ERROR;
    244    
     260
    245261    root->setAttribute(tagXMLLeasesAttributeVersion.c_str(), tagXMLLeasesVersion_1_0.c_str());
    246262
     
    388404        if (l != Lease::NullLease)
    389405        {
    390             /* Here we should take lease from the m_allocation which was feed with leases 
     406            /* Here we should take lease from the m_allocation which was feed with leases
    391407             *  on start
    392408             */
     
    476492    Lease l = client.lease();
    477493    AssertReturn(l != Lease::NullLease, VERR_INTERNAL_ERROR);
    478    
     494
    479495    if (l.isInBindingPhase())
    480496    {
     
    491507        return VINF_SUCCESS;
    492508    }
    493    
     509
    494510    l = Lease(client); /* re-new */
    495511    return VINF_SUCCESS;
     
    668684        RT_ZERO(BootPReplyMsg);
    669685        cbBooPReplyMsg = 0;
    670        
     686
    671687        m_OurAddress.u = 0;
    672688        m_OurNetmask.u = 0;
     
    803819
    804820    prepareReplyPacket4Client(client, u32Xid);
    805    
     821
    806822    Lease l = client.lease();
    807823    address = l.getAddress();
     
    926942    Cursor.optIPv4Addr(RTNET_DHCP_OPT_SERVER_ID, m->m_OurAddress);
    927943
    928     const Lease l = client.lease(); 
     944    const Lease l = client.lease();
    929945    const std::map<uint8_t, RawOption>& options = l.options();
    930946
    931     for(std::vector<RawOption>::const_iterator it = extra.begin(); 
     947    for(std::vector<RawOption>::const_iterator it = extra.begin();
    932948        it != extra.end(); ++it)
    933949    {
     
    938954    }
    939955
    940     for(std::map<uint8_t, RawOption>::const_iterator it = options.begin(); 
     956    for(std::map<uint8_t, RawOption>::const_iterator it = options.begin();
    941957        it != options.end(); ++it)
    942958    {
     
    953969#if 0
    954970    /** @todo need to see someone set this flag to check that it's correct. */
    955     if (!(pDhcpMsg->bp_flags & RTNET_DHCP_FLAGS_NO_BROADCAST)) 
     971    if (!(pDhcpMsg->bp_flags & RTNET_DHCP_FLAGS_NO_BROADCAST))
    956972    {
    957973        rc = VBoxNetUDPUnicast(m_pSession,
     
    970986        rc = m->m_service->hlpUDPBroadcast(RTNETIPV4_PORT_BOOTPS,               /* sender */
    971987                                           RTNETIPV4_PORT_BOOTPC,
    972                                            &m->BootPReplyMsg, 
     988                                           &m->BootPReplyMsg,
    973989                                           RTNET_DHCP_NORMAL_SIZE);
    974990
     
    979995
    980996
    981 int NetworkManager::processParameterReqList(const Client& client, const uint8_t *pu8ReqList, 
     997int NetworkManager::processParameterReqList(const Client& client, const uint8_t *pu8ReqList,
    982998                                            int cReqList, std::vector<RawOption>& extra)
    983999{
    9841000    const Lease l = client.lease();
    985    
     1001
    9861002    const NetworkConfigEntity *pNetCfg = l.getConfig();
    9871003
     
    12241240    if (!valueAddition) return false;
    12251241
    1226     xml::ElementNode *address = node->createChild(tagXMLLeaseAddress.c_str()); 
     1242    xml::ElementNode *address = node->createChild(tagXMLLeaseAddress.c_str());
    12271243    if (!address) return false;
    12281244
     
    12301246    if (!valueAddition) return false;
    12311247
    1232     xml::ElementNode *time = node->createChild(tagXMLLeaseTime.c_str()); 
     1248    xml::ElementNode *time = node->createChild(tagXMLLeaseTime.c_str());
    12331249    if (!time) return false;
    12341250
    1235     valueAddition = time->setAttribute(tagXMLTimeAttributeIssued.c_str(), 
     1251    valueAddition = time->setAttribute(tagXMLTimeAttributeIssued.c_str(),
    12361252                                       m->u64TimestampLeasingStarted);
    12371253    if (!valueAddition) return false;
    12381254
    1239     valueAddition = time->setAttribute(tagXMLTimeAttributeExpiration.c_str(), 
     1255    valueAddition = time->setAttribute(tagXMLTimeAttributeExpiration.c_str(),
    12401256                                       m->u32LeaseExpirationPeriod);
    12411257    if (!valueAddition) return false;
     
    12661282    if (!valueExists) return false;
    12671283    rc = RTNetStrToIPv4Addr(addressValue.c_str(), &m->m_address);
    1268    
     1284
    12691285    /* Time */
    12701286    const xml::ElementNode *time = node->findChildElement(tagXMLLeaseTime.c_str());
    12711287    if (!time) return false;
    12721288
    1273     valueExists = time->getAttributeValue(tagXMLTimeAttributeIssued.c_str(), 
     1289    valueExists = time->getAttributeValue(tagXMLTimeAttributeIssued.c_str(),
    12741290                                          &m->u64TimestampLeasingStarted);
    12751291    if (!valueExists) return false;
    12761292    m->fBinding = false;
    1277    
    1278     valueExists = time->getAttributeValue(tagXMLTimeAttributeExpiration.c_str(), 
     1293
     1294    valueExists = time->getAttributeValue(tagXMLTimeAttributeExpiration.c_str(),
    12791295                                          &m->u32LeaseExpirationPeriod);
    12801296    if (!valueExists) return false;
     
    12871303const Lease Lease::NullLease;
    12881304
    1289 
    12901305const Client Client::NullClient;
  • trunk/src/VBox/NetworkServices/DHCP/Config.h

    r49926 r50213  
    1717
    1818#ifndef _CONFIG_H_
    19 # define _CONFIG_H_
     19#define _CONFIG_H_
    2020
    2121#include <iprt/asm-math.h>
     
    121121    bool isInBindingPhase() const;
    122122    /* returns 0 if in binding state */
    123     uint64_t issued() const; 
     123    uint64_t issued() const;
    124124
    125125    void setExpiration(uint32_t);
  • trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp

    r49859 r50213  
    254254        case 'l':
    255255        case 'u':
    256         case 'g': 
     256        case 'g':
    257257        {
    258258            char buf[17];
     
    287287    netManager->setOurMac(getMacAddress());
    288288    netManager->setService(this);
    289    
     289
    290290    if (isMainNeeded())
    291291        rc = initWithMain();
     
    465465            case 'b':
    466466                break;
    467                    
     467
    468468        }
    469469    }
    470        
     470
    471471    ConfigurationManager *confManager = ConfigurationManager::getConfigurationManager();
    472472    AssertPtrReturn(confManager, VERR_INTERNAL_ERROR);
     
    569569
    570570        {
    571             VBoxNetALock(this);   
     571            VBoxNetALock(this);
    572572            ConfigurationManager *confManager = ConfigurationManager::getConfigurationManager();
    573573            confManager->flushAddressList(RTNET_DHCP_OPT_DNS);
     
    575575            for (AddressList::iterator it = nameservers.begin(); it != nameservers.end(); ++it)
    576576                confManager->addToAddressList(RTNET_DHCP_OPT_DNS, *it);
    577            
     577
    578578            confManager->setString(RTNET_DHCP_OPT_DOMAIN_NAME, domain);
    579579        }
    580580    }
    581    
     581
    582582    return VINF_SUCCESS;
    583583}
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