VirtualBox

Ignore:
Timestamp:
Nov 16, 2018 11:33:38 AM (6 years ago)
Author:
vboxsync
Message:

Main/DHCPD: bugref:9288 Use new implementation of DHCP server.

Location:
trunk/src/VBox/NetworkServices/Dhcpd
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/Dhcpd/Db.cpp

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

    r70836 r75512  
    2727#include <vector>
    2828
     29#ifdef _MSC_VER
     30# define __func__ __FUNCTION__
     31#endif
     32
    2933typedef std::vector<uint8_t> octets_t;
    3034
     
    3236
    3337class DhcpOption;
    34 typedef std::map<uint8_t, std::shared_ptr<DhcpOption>> optmap_t;
     38typedef std::map<uint8_t, std::shared_ptr<DhcpOption> > optmap_t;
    3539
    3640inline bool operator==(const RTMAC &l, const RTMAC &r)
  • trunk/src/VBox/NetworkServices/Dhcpd/DhcpOptions.cpp

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

    r70836 r75512  
    2929 ifdef VBOX_WITH_HARDENING
    3030  PROGRAMS += VBoxNetDhcpdHardened
    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
     31  DLLS += VBoxNetDhcpd
    3732 else
    3833  PROGRAMS += VBoxNetDhcpd
    3934 endif
    4035
    41  VBoxNetDhcpd_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBOXMAINDLL,VBOXMAINCLIENTEXE)
    42  VBoxNetDhcpd_NAME     := VBoxNetDhcpd
     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 if1of ($(KBUILD_TARGET),win linux solaris)
     44  VBoxNetDhcpd_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBoxR3DllDhcpd,VBoxR3ExeDhcpd)
     45 else
     46  VBoxNetDhcpd_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBoxR3Dll,VBOXR3EXE)
     47 endif
     48 VBoxNetDhcpd_NAME      = VBoxNetDHCP
    4349 # VBoxNetDhcpd_DEFS      = IPv6
    44  # VBoxNetLwipNAT_DEFS.linux = WITH_VALGRIND
    45  VBoxNetDhcpd_DEFS.win  = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
     50 # VBoxNetDhcpd_DEFS.linux = WITH_VALGRIND
     51 #VBoxNetDhcpd_DEFS.win  = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
    4652
    4753 # (current dir is for for lwipopts.h)
    4854 VBoxNetDhcpd_INCS += . $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_INCS))
    4955
    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))
     56 VBoxNetDhcpd_DEFS    = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
     57 ifneq ($(KBUILD_TARGET),win)
     58  VBoxNetDhcpd_DEFS  += VBOX_WITH_XPCOM
     59  VBoxNetDhcpd_INCS  += $(VBOX_XPCOM_INCS)
     60  VBoxNetDhcpd_CXXFLAGS += -std=c++11
     61 endif
     62 VBoxNetDhcpd_SOURCES = ../../Main/glue/VBoxLogRelCreate.cpp \
     63                        ../../Main/glue/GetVBoxUserHomeDirectory.cpp \
     64                        ClientId.cpp \
     65                        Config.cpp \
     66                        DHCPD.cpp \
     67                        Db.cpp \
     68                        DhcpMessage.cpp \
     69                        DhcpOptions.cpp \
     70                        IPv4Pool.cpp \
     71                        TimeStamp.cpp \
     72                        VBoxNetDhcpd.cpp \
     73                        $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES))
    6174
    62  VBoxNetLwipNAT_LIBS = $(LIB_RUNTIME)
     75 VBoxNetDhcpd_LIBS = $(LIB_RUNTIME)
    6376
    64  VBoxNetLwipNAT_LIBS.solaris += socket nsl
    65  VBoxNetLwipNAT_LDFLAGS.win = /SUBSYSTEM:windows
     77 VBoxNetDhcpd_LIBS.solaris += socket nsl
     78 VBoxNetDhcpd_LDFLAGS.win = /SUBSYSTEM:windows
    6679
    6780 ifeq ($(KBUILD_TARGET),win)
  • trunk/src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp

    r71689 r75512  
    5252#include <memory>
    5353
     54#ifdef RT_OS_WINDOWS /* WinMain */
     55#undef htonl
     56#undef ntohl
     57# include <iprt/win/windows.h>
     58#endif
    5459
    5560struct delete_pbuf
     
    448453                                                     i, cSegs,
    449454                                                     &cbSegFrame);
    450                 ifInput(pvSegFrame, cbFrame);
     455                ifInput(pvSegFrame, (uint32_t)cbFrame);
    451456            }
    452457        }
     
    738743
    739744    unique_ptr_pbuf q ( pbuf_alloc(PBUF_RAW, (u16_t)data.size(), PBUF_RAM) );
    740     if (q == NULL)
    741         return;
    742 
    743     error = pbuf_take(q.get(), &data.front(), data.size());
     745    if (q == nullptr)
     746        return;
     747
     748    error = pbuf_take(q.get(), &data.front(), (u16_t)data.size());
    744749    if (error != ERR_OK)
    745750        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