Changeset 79563 in vbox for trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp
- Timestamp:
- Jul 6, 2019 1:22:56 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp
r79553 r79563 88 88 * @returns IPRT status code. 89 89 */ 90 int Config::i_init() 90 int Config::i_init() RT_NOEXCEPT 91 91 { 92 92 return i_homeInit(); … … 100 100 * @todo Too many init functions? 101 101 */ 102 int Config::i_homeInit() 102 int Config::i_homeInit() RT_NOEXCEPT 103 103 { 104 104 char szHome[RTPATH_MAX]; … … 121 121 * @returns Config instance on success, NULL on failure. 122 122 */ 123 /*static*/ Config *Config::i_createInstanceAndCallInit() 123 /*static*/ Config *Config::i_createInstanceAndCallInit() RT_NOEXCEPT 124 124 { 125 125 Config *pConfig; … … 161 161 * Interal worker for i_setNetwork() that sets m_strBaseName to sanitized the 162 162 * version of m_strNetwork suitable for use as a path component. 163 * 164 * @throws std::bad_alloc 163 165 */ 164 166 void Config::i_sanitizeBaseName() … … 196 198 * @todo make the log file directly configurable? 197 199 */ 198 int Config::i_logInit() 200 int Config::i_logInit() RT_NOEXCEPT 199 201 { 200 202 if (m_strHome.isEmpty() || m_strBaseName.isEmpty()) … … 241 243 * Post process and validate the configuration after it has been loaded. 242 244 */ 243 int Config::i_complete() 245 int Config::i_complete() RT_NOEXCEPT 244 246 { 245 247 if (m_strNetwork.isEmpty()) … … 336 338 337 339 338 /*static*/ Config *Config::hardcoded() 340 /*static*/ Config *Config::hardcoded() RT_NOEXCEPT 339 341 { 340 342 std::unique_ptr<Config> config(i_createInstanceAndCallInit()); … … 378 380 379 381 380 382 /** 383 * Old VBoxNetDHCP style command line parsing. 384 * 385 * @throws std::bad_alloc 386 */ 381 387 /*static*/ Config *Config::compat(int argc, char **argv) 382 388 { … … 519 525 520 526 521 Config *Config::create(int argc, char **argv) 522 { 523 #define DHCPD_GETOPT_COMMENT 256 /* No short option for --comment */ 527 Config *Config::create(int argc, char **argv) RT_NOEXCEPT 528 { 524 529 static const RTGETOPTDEF s_aOptions[] = 525 530 { 526 { "--config", 'c', 527 { "--comment", DHCPD_GETOPT_COMMENT, RTGETOPT_REQ_STRING }531 { "--config", 'c', RTGETOPT_REQ_STRING }, 532 { "--comment", '#', RTGETOPT_REQ_STRING } 528 533 }; 529 534 … … 556 561 break; 557 562 558 case DHCPD_GETOPT_COMMENT: /* --comment */563 case '#': /* --comment */ 559 564 /* The sole purpose of this option is to allow identification of DHCP 560 565 * server instances in the process list. We ignore the required string … … 589 594 * @note The release log has is not operational when this method is called. 590 595 */ 591 Config *Config::i_read(const char *pszFileName) 596 Config *Config::i_read(const char *pszFileName) RT_NOEXCEPT 592 597 { 593 598 if (pszFileName == NULL || pszFileName[0] == '\0') … … 635 640 return NULL; 636 641 } 642 catch (std::bad_alloc &) 643 { 644 LogFunc(("std::bad_alloc\n")); 645 RTMsgError("std::bad_alloc reading config\n"); 646 return NULL; 647 } 637 648 catch (...) 638 649 { … … 650 661 * below it. 651 662 * 652 * @throws stuff. 663 * @param pElmRoot The root element. 664 * @throws std::bad_alloc, ConfigFileError 653 665 */ 654 666 void Config::i_parseConfig(const xml::ElementNode *pElmRoot) … … 694 706 * 695 707 * @param pElmServer The DHCPServer element. 696 * @throws ConfigFileError708 * @throws std::bad_alloc, ConfigFileError 697 709 */ 698 710 void Config::i_parseServer(const xml::ElementNode *pElmServer) … … 767 779 * 768 780 * @param pElmServer The <Options> element. 769 * @throws ConfigFileError781 * @throws std::bad_alloc, ConfigFileError 770 782 */ 771 783 void Config::i_parseGlobalOptions(const xml::ElementNode *options) … … 792 804 * 793 805 * @param pElmServer The <Config> element. 794 * @throws ConfigFileError806 * @throws std::bad_alloc, ConfigFileError 795 807 */ 796 808 void Config::i_parseVMConfig(const xml::ElementNode *pElmConfig) … … 841 853 * @param pElmServer The <Option> element. 842 854 * @param optmap The option map to add the option to. 843 * @throws ConfigFileError855 * @throws std::bad_alloc, ConfigFileError 844 856 */ 845 857 void Config::i_parseOption(const xml::ElementNode *pElmOption, optmap_t &optmap) … … 946 958 * @param idVendorClass The vendor class ID. 947 959 * @param idUserClass The user class ID. 960 * 961 * @throws std::bad_alloc 948 962 */ 949 963 optmap_t &Config::getOptions(optmap_t &a_rRetOpts, const OptParameterRequest &reqOpts, const ClientId &id,
Note:
See TracChangeset
for help on using the changeset viewer.