Changeset 75568 in vbox for trunk/src/VBox/NetworkServices
- Timestamp:
- Nov 19, 2018 11:52:10 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 126727
- Location:
- trunk/src/VBox/NetworkServices
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/Dhcpd/ClientId.h
r70836 r75568 35 35 ClientId() 36 36 : m_mac(), m_id() {} 37 ClientId(const RTMAC &mac , const OptClientId &id)38 : m_mac(mac ), m_id(id) {}37 ClientId(const RTMAC &macParam, const OptClientId &idParam) 38 : m_mac(macParam), m_id(idParam) {} 39 39 40 40 const RTMAC &mac() const { return m_mac; } -
trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp
r71749 r75568 589 589 /** @todo r=bird: Visual C++ 2010 does not grok this use of 'auto'. */ 590 590 // XXX: debug 591 for ( auto it: m_GlobalOptions) {592 std::shared_ptr<DhcpOption> opt(it .second);591 for (optmap_t::iterator it = m_GlobalOptions.begin(); it != m_GlobalOptions.end(); ++it) { 592 std::shared_ptr<DhcpOption> opt(it->second); 593 593 594 594 octets_t data; … … 596 596 597 597 bool space = false; 598 for ( auto c: data) {598 for (octets_t::iterator c = data.begin(); c != data.end(); ++c) { 599 599 if (space) 600 600 std::cout << " "; 601 601 else 602 602 space = true; 603 std::cout << (int) c;603 std::cout << (int)*c; 604 604 } 605 605 std::cout << std::endl; … … 854 854 optmap << new OptSubnetMask(m_IPv4Netmask); 855 855 856 for (auto optreq: reqOpts.value()) 857 { 858 std::cout << ">>> requested option " << (int)optreq << std::endl; 859 860 if (optreq == OptSubnetMask::optcode) 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) 861 862 { 862 863 std::cout << "... always supplied" << std::endl; … … 866 867 if (vmopts != NULL) 867 868 { 868 optmap_t::const_iterator it( vmopts->find( optreq) );869 optmap_t::const_iterator it( vmopts->find(*optreq) ); 869 870 if (it != vmopts->end()) 870 871 { … … 875 876 } 876 877 877 optmap_t::const_iterator it( m_GlobalOptions.find( optreq) );878 optmap_t::const_iterator it( m_GlobalOptions.find(*optreq) ); 878 879 if (it != m_GlobalOptions.end()) 879 880 { … … 890 891 if (vmopts != NULL) 891 892 { 892 for ( auto it: *vmopts) {893 std::shared_ptr<DhcpOption> opt(it .second);893 for (optmap_t::const_iterator it = vmopts->begin(); it != vmopts->end(); ++it) { 894 std::shared_ptr<DhcpOption> opt(it->second); 894 895 if (optmap.count(opt->optcode()) == 0 && opt->optcode() > 127) 895 896 { … … 900 901 } 901 902 902 for ( auto it: m_GlobalOptions) {903 std::shared_ptr<DhcpOption> opt(it .second);903 for (optmap_t::const_iterator it = m_GlobalOptions.begin(); it != m_GlobalOptions.end(); ++it) { 904 std::shared_ptr<DhcpOption> opt(it->second); 904 905 if (optmap.count(opt->optcode()) == 0 && opt->optcode() > 127) 905 906 { -
trunk/src/VBox/NetworkServices/Dhcpd/Db.cpp
r75513 r75568 291 291 */ 292 292 const xml::ElementNode *ndTime = ndLease->findChildElement("Time"); 293 if ( time == NULL)293 if (ndTime == NULL) 294 294 return NULL; 295 295 -
trunk/src/VBox/NetworkServices/Dhcpd/Db.h
r73076 r75568 51 51 Binding(const Binding &); 52 52 53 explicit Binding(RTNETADDRIPV4 addr )54 : m_addr(addr ), m_state(FREE),53 explicit Binding(RTNETADDRIPV4 addrParam) 54 : m_addr(addrParam), m_state(FREE), 55 55 m_issued(), m_secLease() {} 56 56 57 Binding(RTNETADDRIPV4 addr , const ClientId &id)58 : m_addr(addr ), m_state(FREE), m_id(id),57 Binding(RTNETADDRIPV4 addrParam, const ClientId &idParam) 58 : m_addr(addrParam), m_state(FREE), m_id(idParam), 59 59 m_issued(), m_secLease() {} 60 60 … … 70 70 TimeStamp issued() const { return m_issued; } 71 71 72 Binding &setState(State state )72 Binding &setState(State stateParam) 73 73 { 74 m_state = state ;74 m_state = stateParam; 75 75 return *this; 76 76 } … … 85 85 } 86 86 87 Binding &giveTo(const ClientId &id )87 Binding &giveTo(const ClientId &idParam) 88 88 { 89 m_id = id ;89 m_id = idParam; 90 90 m_state = FREE; 91 91 return *this; -
trunk/src/VBox/NetworkServices/Dhcpd/Defs.h
r75513 r75568 27 27 #include <vector> 28 28 29 #ifdef _MSC_VER 30 # define __func__ __FUNCTION__ 31 #endif 32 29 33 typedef std::vector<uint8_t> octets_t; 30 34 … … 32 36 33 37 class DhcpOption; 34 typedef std::map<uint8_t, std::shared_ptr<DhcpOption> > optmap_t;38 typedef std::map<uint8_t, std::shared_ptr<DhcpOption> > optmap_t; 35 39 36 40 inline bool operator==(const RTMAC &l, const RTMAC &r) -
trunk/src/VBox/NetworkServices/Dhcpd/DhcpMessage.cpp
r70836 r75568 323 323 324 324 DhcpServerMessage::DhcpServerMessage(const DhcpClientMessage &req, 325 uint8_t messageType , RTNETADDRIPV4 serverAddr)325 uint8_t messageTypeParam, RTNETADDRIPV4 serverAddr) 326 326 : DhcpMessage(), 327 327 m_optServerId(serverAddr) … … 329 329 m_dst.u = 0xffffffff; /* broadcast */ 330 330 331 m_optMessageType = OptMessageType(messageType );331 m_optMessageType = OptMessageType(messageTypeParam); 332 332 333 333 /* copy values from the request (cf. RFC2131 Table 3) */ -
trunk/src/VBox/NetworkServices/Dhcpd/DhcpOptions.cpp
r75513 r75568 36 36 optmap_t &operator<<(optmap_t &optmap, const std::shared_ptr<DhcpOption> &option) 37 37 { 38 if (option == NULL)38 if (option == nullptr) 39 39 return optmap; 40 40 -
trunk/src/VBox/NetworkServices/Dhcpd/Makefile.kmk
r75513 r75568 29 29 ifdef VBOX_WITH_HARDENING 30 30 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 37 32 else 38 33 PROGRAMS += VBoxNetDhcpd 39 34 endif 40 35 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 VBoxNetDhcpd_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBoxR3Dll,VBOXR3EXE) 44 VBoxNetDhcpd_NAME = VBoxNetDHCP 43 45 # VBoxNetDhcpd_DEFS = IPv6 44 # VBoxNet LwipNAT_DEFS.linux = WITH_VALGRIND45 VBoxNetDhcpd_DEFS.win = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP46 # VBoxNetDhcpd_DEFS.linux = WITH_VALGRIND 47 #VBoxNetDhcpd_DEFS.win = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP 46 48 47 49 # (current dir is for for lwipopts.h) 48 50 VBoxNetDhcpd_INCS += . $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_INCS)) 49 51 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)) 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)) 61 70 62 VBoxNet LwipNAT_LIBS = $(LIB_RUNTIME)71 VBoxNetDhcpd_LIBS = $(LIB_RUNTIME) 63 72 64 VBoxNet LwipNAT_LIBS.solaris += socket nsl65 VBoxNet LwipNAT_LDFLAGS.win = /SUBSYSTEM:windows73 VBoxNetDhcpd_LIBS.solaris += socket nsl 74 VBoxNetDhcpd_LDFLAGS.win = /SUBSYSTEM:windows 66 75 67 76 ifeq ($(KBUILD_TARGET),win) -
trunk/src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp
r75513 r75568 52 52 #include <memory> 53 53 54 #ifdef RT_OS_WINDOWS /* WinMain */ 55 #undef htonl 56 #undef ntohl 57 # include <iprt/win/windows.h> 58 #endif 54 59 55 60 struct delete_pbuf … … 448 453 i, cSegs, 449 454 &cbSegFrame); 450 ifInput(pvSegFrame, cbFrame);455 ifInput(pvSegFrame, (uint32_t)cbFrame); 451 456 } 452 457 } … … 738 743 739 744 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()); 744 749 if (error != ERR_OK) 745 750 return; -
trunk/src/VBox/NetworkServices/Makefile.kmk
r75513 r75568 22 22 ifdef VBOX_WITH_MAIN 23 23 # Include sub-makefiles. 24 include $(PATH_SUB_CURRENT)/DHCP/Makefile.kmk 24 ifndef VBOX_WITH_DHCPD 25 include $(PATH_SUB_CURRENT)/DHCP/Makefile.kmk 26 else 27 include $(PATH_SUB_CURRENT)/Dhcpd/Makefile.kmk 28 endif 25 29 ifdef VBOX_WITH_NAT_SERVICE 26 30 include $(PATH_SUB_CURRENT)/NAT/Makefile.kmk
Note:
See TracChangeset
for help on using the changeset viewer.