VirtualBox

Ignore:
Timestamp:
Nov 19, 2018 12:04:20 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126728
Message:

Rolled back r126727.

Location:
trunk/src/VBox/NetworkServices/Dhcpd
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/Dhcpd/ClientId.h

    r75568 r75569  
    3535    ClientId()
    3636      : m_mac(), m_id() {}
    37     ClientId(const RTMAC &macParam, const OptClientId &idParam)
    38       : m_mac(macParam), m_id(idParam) {}
     37    ClientId(const RTMAC &mac, const OptClientId &id)
     38      : m_mac(mac), m_id(id) {}
    3939
    4040    const RTMAC &mac() const { return m_mac; }
  • trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp

    r75568 r75569  
    589589    /** @todo r=bird: Visual C++ 2010 does not grok this use of 'auto'. */
    590590    // XXX: debug
    591     for (optmap_t::iterator it = m_GlobalOptions.begin(); it != m_GlobalOptions.end(); ++it) {
    592         std::shared_ptr<DhcpOption> opt(it->second);
     591    for (auto it: m_GlobalOptions) {
     592        std::shared_ptr<DhcpOption> opt(it.second);
    593593
    594594        octets_t data;
     
    596596
    597597        bool space = false;
    598         for (octets_t::iterator c = data.begin(); c != data.end(); ++c) {
     598        for (auto c: data) {
    599599            if (space)
    600600                std::cout << " ";
    601601            else
    602602                space = true;
    603             std::cout << (int)*c;
     603            std::cout << (int)c;
    604604        }
    605605        std::cout << std::endl;
     
    854854    optmap << new OptSubnetMask(m_IPv4Netmask);
    855855
    856     const OptParameterRequest::value_t& reqValue = reqOpts.value();
    857     for (octets_t::const_iterator optreq = reqValue.begin(); optreq != reqValue.end(); ++optreq)
    858     {
    859         std::cout << ">>> requested option " << (int)*optreq << std::endl;
    860 
    861         if (*optreq == OptSubnetMask::optcode)
     856    for (auto optreq: reqOpts.value())
     857    {
     858        std::cout << ">>> requested option " << (int)optreq << std::endl;
     859
     860        if (optreq == OptSubnetMask::optcode)
    862861        {
    863862            std::cout << "... always supplied" << std::endl;
     
    867866        if (vmopts != NULL)
    868867        {
    869             optmap_t::const_iterator it( vmopts->find(*optreq) );
     868            optmap_t::const_iterator it( vmopts->find(optreq) );
    870869            if (it != vmopts->end())
    871870            {
     
    876875        }
    877876
    878         optmap_t::const_iterator it( m_GlobalOptions.find(*optreq) );
     877        optmap_t::const_iterator it( m_GlobalOptions.find(optreq) );
    879878        if (it != m_GlobalOptions.end())
    880879        {
     
    891890    if (vmopts != NULL)
    892891    {
    893         for (optmap_t::const_iterator it = vmopts->begin(); it != vmopts->end(); ++it) {
    894             std::shared_ptr<DhcpOption> opt(it->second);
     892        for (auto it: *vmopts) {
     893            std::shared_ptr<DhcpOption> opt(it.second);
    895894            if (optmap.count(opt->optcode()) == 0 && opt->optcode() > 127)
    896895            {
     
    901900    }
    902901
    903     for (optmap_t::const_iterator it = m_GlobalOptions.begin(); it != m_GlobalOptions.end(); ++it) {
    904         std::shared_ptr<DhcpOption> opt(it->second);
     902    for (auto it: m_GlobalOptions) {
     903        std::shared_ptr<DhcpOption> opt(it.second);
    905904        if (optmap.count(opt->optcode()) == 0 && opt->optcode() > 127)
    906905        {
  • trunk/src/VBox/NetworkServices/Dhcpd/Db.cpp

    r75568 r75569  
    291291     */
    292292    const xml::ElementNode *ndTime = ndLease->findChildElement("Time");
    293     if (ndTime == NULL)
     293    if (time == NULL)
    294294        return NULL;
    295295
  • trunk/src/VBox/NetworkServices/Dhcpd/Db.h

    r75568 r75569  
    5151    Binding(const Binding &);
    5252
    53     explicit Binding(RTNETADDRIPV4 addrParam)
    54       : m_addr(addrParam), m_state(FREE),
     53    explicit Binding(RTNETADDRIPV4 addr)
     54      : m_addr(addr), m_state(FREE),
    5555        m_issued(), m_secLease() {}
    5656
    57     Binding(RTNETADDRIPV4 addrParam, const ClientId &idParam)
    58       : m_addr(addrParam), m_state(FREE), m_id(idParam),
     57    Binding(RTNETADDRIPV4 addr, const ClientId &id)
     58      : m_addr(addr), m_state(FREE), m_id(id),
    5959        m_issued(), m_secLease() {}
    6060
     
    7070    TimeStamp issued() const { return m_issued; }
    7171
    72     Binding &setState(State stateParam)
     72    Binding &setState(State state)
    7373    {
    74         m_state = stateParam;
     74        m_state = state;
    7575        return *this;
    7676    }
     
    8585    }
    8686
    87     Binding &giveTo(const ClientId &idParam)
     87    Binding &giveTo(const ClientId &id)
    8888    {
    89         m_id = idParam;
     89        m_id = id;
    9090        m_state = FREE;
    9191        return *this;
  • trunk/src/VBox/NetworkServices/Dhcpd/Defs.h

    r75568 r75569  
    2727#include <vector>
    2828
    29 #ifdef _MSC_VER
    30 # define __func__ __FUNCTION__
    31 #endif
    32 
    3329typedef std::vector<uint8_t> octets_t;
    3430
     
    3632
    3733class DhcpOption;
    38 typedef std::map<uint8_t, std::shared_ptr<DhcpOption> > optmap_t;
     34typedef std::map<uint8_t, std::shared_ptr<DhcpOption>> optmap_t;
    3935
    4036inline bool operator==(const RTMAC &l, const RTMAC &r)
     
    4945
    5046#if 1
    51 #define LogDHCP(args) LogRel(args)
     47#define LogDHCP LogRel
    5248#else
    5349#define LogDHCP(args) RTPrintf args
  • trunk/src/VBox/NetworkServices/Dhcpd/DhcpMessage.cpp

    r75568 r75569  
    323323
    324324DhcpServerMessage::DhcpServerMessage(const DhcpClientMessage &req,
    325                                      uint8_t messageTypeParam, RTNETADDRIPV4 serverAddr)
     325                                     uint8_t messageType, RTNETADDRIPV4 serverAddr)
    326326  : DhcpMessage(),
    327327    m_optServerId(serverAddr)
     
    329329    m_dst.u = 0xffffffff;       /* broadcast */
    330330
    331     m_optMessageType = OptMessageType(messageTypeParam);
     331    m_optMessageType = OptMessageType(messageType);
    332332
    333333    /* copy values from the request (cf. RFC2131 Table 3) */
  • trunk/src/VBox/NetworkServices/Dhcpd/DhcpOptions.cpp

    r75568 r75569  
    3636optmap_t &operator<<(optmap_t &optmap, const std::shared_ptr<DhcpOption> &option)
    3737{
    38     if (option == nullptr)
     38    if (option == NULL)
    3939        return optmap;
    4040
  • trunk/src/VBox/NetworkServices/Dhcpd/Makefile.kmk

    r75568 r75569  
    2929 ifdef VBOX_WITH_HARDENING
    3030  PROGRAMS += VBoxNetDhcpdHardened
    31   DLLS += VBoxNetDhcpd
     31  VBoxNetDhcpdHardened_TEMPLATE = VBOXR3HARDENEDEXE
     32  VBoxNetDhcpdHardened_NAME     = VBoxNetDhcpd
     33  VBoxNetDhcpdHardened_DEFS     = SERVICE_NAME=\"VBoxNetDhcpd\"
     34  VBoxNetDhcpdHardened_SOURCES  = VBoxNetDhcpdHardened.cpp
     35  VBoxNetDhcpdHardened_SOURCES.win = $(VBoxNetLwipNAT_0_OUTDIR)/VBoxNetDhcpd-icon.rc
     36  VBoxNetDhcpdHardened_LDFLAGS.win = /SUBSYSTEM:windows
    3237 else
    3338  PROGRAMS += VBoxNetDhcpd
    3439 endif
    3540
    36  VBoxNetDhcpdHardened_TEMPLATE = VBOXR3HARDENEDEXE
    37  VBoxNetDhcpdHardened_NAME     = VBoxNetDHCP
    38  VBoxNetDhcpdHardened_DEFS     = SERVICE_NAME=\"VBoxNetDhcpd\"
    39  VBoxNetDhcpdHardened_SOURCES  = VBoxNetDhcpdHardened.cpp
    40  VBoxNetDhcpdHardened_SOURCES.win = $(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc
    41  VBoxNetDhcpdHardened_LDFLAGS.win = /SUBSYSTEM:windows
    42 
    43  VBoxNetDhcpd_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBoxR3Dll,VBOXR3EXE)
    44  VBoxNetDhcpd_NAME      = VBoxNetDHCP
     41 VBoxNetDhcpd_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBOXMAINDLL,VBOXMAINCLIENTEXE)
     42 VBoxNetDhcpd_NAME     := VBoxNetDhcpd
    4543 # VBoxNetDhcpd_DEFS      = IPv6
    46  # VBoxNetDhcpd_DEFS.linux = WITH_VALGRIND
    47  #VBoxNetDhcpd_DEFS.win  = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
     44 # VBoxNetLwipNAT_DEFS.linux = WITH_VALGRIND
     45 VBoxNetDhcpd_DEFS.win  = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
    4846
    4947 # (current dir is for for lwipopts.h)
    5048 VBoxNetDhcpd_INCS += . $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_INCS))
    5149
    52  VBoxNetDhcpd_DEFS    = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
    53  ifneq ($(KBUILD_TARGET),win)
    54   VBoxNetDhcpd_DEFS     += VBOX_WITH_XPCOM
    55   VBoxNetDhcpd_INCS     += $(VBOX_XPCOM_INCS)
    56   VBoxNetDhcpd_CXXFLAGS += $(VBOX_GCC_std)
    57  endif
    58  VBoxNetDhcpd_SOURCES = ../../Main/glue/VBoxLogRelCreate.cpp \
    59                         ../../Main/glue/GetVBoxUserHomeDirectory.cpp \
    60                         ClientId.cpp \
    61                         Config.cpp \
    62                         DHCPD.cpp \
    63                         Db.cpp \
    64                         DhcpMessage.cpp \
    65                         DhcpOptions.cpp \
    66                         IPv4Pool.cpp \
    67                         TimeStamp.cpp \
    68                         VBoxNetDhcpd.cpp \
    69                         $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES))
     50 VBoxNetDhcpd_SOURCES  =
     51 VBoxNetDhcpd_SOURCES += ClientId.cpp
     52 VBoxNetDhcpd_SOURCES += Config.cpp
     53 VBoxNetDhcpd_SOURCES += DHCPD.cpp
     54 VBoxNetDhcpd_SOURCES += Db.cpp
     55 VBoxNetDhcpd_SOURCES += DhcpMessage.cpp
     56 VBoxNetDhcpd_SOURCES += DhcpOptions.cpp
     57 VBoxNetDhcpd_SOURCES += IPv4Pool.cpp
     58 VBoxNetDhcpd_SOURCES += TimeStamp.cpp
     59 VBoxNetDhcpd_SOURCES += VBoxNetDhcpd.cpp
     60 VBoxNetDhcpd_SOURCES += $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES))
    7061
    71  VBoxNetDhcpd_LIBS = $(LIB_RUNTIME)
     62 VBoxNetLwipNAT_LIBS = $(LIB_RUNTIME)
    7263
    73  VBoxNetDhcpd_LIBS.solaris += socket nsl
    74  VBoxNetDhcpd_LDFLAGS.win = /SUBSYSTEM:windows
     64 VBoxNetLwipNAT_LIBS.solaris += socket nsl
     65 VBoxNetLwipNAT_LDFLAGS.win = /SUBSYSTEM:windows
    7566
    7667 ifeq ($(KBUILD_TARGET),win)
  • trunk/src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp

    r75568 r75569  
    5252#include <memory>
    5353
    54 #ifdef RT_OS_WINDOWS /* WinMain */
    55 #undef htonl
    56 #undef ntohl
    57 # include <iprt/win/windows.h>
    58 #endif
    5954
    6055struct delete_pbuf
     
    453448                                                     i, cSegs,
    454449                                                     &cbSegFrame);
    455                 ifInput(pvSegFrame, (uint32_t)cbFrame);
     450                ifInput(pvSegFrame, cbFrame);
    456451            }
    457452        }
     
    743738
    744739    unique_ptr_pbuf q ( pbuf_alloc(PBUF_RAW, (u16_t)data.size(), PBUF_RAM) );
    745     if (q == nullptr)
    746         return;
    747 
    748     error = pbuf_take(q.get(), &data.front(), (u16_t)data.size());
     740    if (q == NULL)
     741        return;
     742
     743    error = pbuf_take(q.get(), &data.front(), data.size());
    749744    if (error != ERR_OK)
    750745        return;
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