VirtualBox

Changeset 38746 in vbox


Ignore:
Timestamp:
Sep 13, 2011 4:45:45 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74017
Message:

Settings: fix initialization with default values of some of the setting types (Medium, DHCPServer, ...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r37824 r38746  
    115115struct Medium
    116116{
     117    Medium()
     118        : fAutoReset(false),
     119          hdType(MediumType_Normal)
     120    {}
     121
    117122    com::Guid       uuid;
    118123    com::Utf8Str    strLocation;
     
    238243struct DHCPServer
    239244{
     245    DHCPServer()
     246        : fEnabled(false)
     247    {}
     248
    240249    com::Utf8Str    strNetworkName,
    241250                    strIPAddress,
     
    350359 struct NATRule
    351360 {
    352      NATRule(): proto(NATProtocol_TCP),
    353              u16HostPort(0),
    354              u16GuestPort(0){}
     361     NATRule()
     362         : proto(NATProtocol_TCP),
     363           u16HostPort(0),
     364           u16GuestPort(0)
     365     {}
     366
     367     bool operator==(const NATRule &r) const
     368     {
     369         return strName == r.strName
     370             && proto == r.proto
     371             && u16HostPort == r.u16HostPort
     372             && strHostIP == r.strHostIP
     373             && u16GuestPort == r.u16GuestPort
     374             && strGuestIP == r.strGuestIP;
     375     }
     376
    355377     com::Utf8Str            strName;
    356378     NATProtocol_T           proto;
     
    359381     uint16_t                u16GuestPort;
    360382     com::Utf8Str            strGuestIP;
    361     bool operator==(const NATRule &r) const
    362     {
    363         return    strName == r.strName
    364                && proto == r.proto
    365                && u16HostPort == r.u16HostPort
    366                && strHostIP == r.strHostIP
    367                && u16GuestPort == r.u16GuestPort
    368                && strGuestIP == r.strGuestIP;
    369     }
    370383 };
    371384 typedef std::list<NATRule> NATRuleList;
     
    373386 struct NAT
    374387 {
    375      NAT() : u32Mtu(0),
    376              u32SockRcv(0),
    377              u32SockSnd(0),
    378              u32TcpRcv(0),
    379              u32TcpSnd(0),
    380              fDnsPassDomain(true), /* historically this value is true */
    381              fDnsProxy(false),
    382              fDnsUseHostResolver(false),
    383              fAliasLog(false),
    384              fAliasProxyOnly(false),
    385              fAliasUseSamePorts(false)
    386     {}
    387 
    388      com::Utf8Str            strNetwork;
    389      com::Utf8Str            strBindIP;
    390      uint32_t                u32Mtu;
    391      uint32_t                u32SockRcv;
    392      uint32_t                u32SockSnd;
    393      uint32_t                u32TcpRcv;
    394      uint32_t                u32TcpSnd;
    395      com::Utf8Str            strTftpPrefix;
    396      com::Utf8Str            strTftpBootFile;
    397      com::Utf8Str            strTftpNextServer;
    398      bool                    fDnsPassDomain;
    399      bool                    fDnsProxy;
    400      bool                    fDnsUseHostResolver;
    401      bool                    fAliasLog;
    402      bool                    fAliasProxyOnly;
    403      bool                    fAliasUseSamePorts;
    404      NATRuleList             llRules;
     388     NAT()
     389         : u32Mtu(0),
     390           u32SockRcv(0),
     391           u32SockSnd(0),
     392           u32TcpRcv(0),
     393           u32TcpSnd(0),
     394           fDnsPassDomain(true), /* historically this value is true */
     395           fDnsProxy(false),
     396           fDnsUseHostResolver(false),
     397           fAliasLog(false),
     398           fAliasProxyOnly(false),
     399           fAliasUseSamePorts(false)
     400     {}
     401
    405402     bool operator==(const NAT &n) const
    406403     {
     
    423420             && llRules             == n.llRules;
    424421     }
     422
     423     com::Utf8Str            strNetwork;
     424     com::Utf8Str            strBindIP;
     425     uint32_t                u32Mtu;
     426     uint32_t                u32SockRcv;
     427     uint32_t                u32SockSnd;
     428     uint32_t                u32TcpRcv;
     429     uint32_t                u32TcpSnd;
     430     com::Utf8Str            strTftpPrefix;
     431     com::Utf8Str            strTftpBootFile;
     432     com::Utf8Str            strTftpNextServer;
     433     bool                    fDnsPassDomain;
     434     bool                    fDnsProxy;
     435     bool                    fDnsUseHostResolver;
     436     bool                    fAliasLog;
     437     bool                    fAliasProxyOnly;
     438     bool                    fAliasUseSamePorts;
     439     NATRuleList             llRules;
    425440 };
    426441/**
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