VirtualBox

Changeset 76190 in vbox


Ignore:
Timestamp:
Dec 12, 2018 4:58:55 PM (6 years ago)
Author:
vboxsync
Message:

Main/DHCPServer: (bugref:9288) Added --comment command line option to simplify identification of VBoxNetDHCP instanced in the process list

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/DHCPServerImpl.h

    r75819 r76190  
    5151    static const std::string kDsrKeyUpperIp;
    5252    static const std::string kDsrKeyConfig;
     53    static const std::string kDsrKeyComment;
    5354};
    5455
  • trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp

    r76132 r76190  
    4242const std::string DHCPServerRunner::kDsrKeyUpperIp = "--upper-ip";
    4343const std::string DHCPServerRunner::kDsrKeyConfig  = "--config";
     44const std::string DHCPServerRunner::kDsrKeyComment = "--comment";
    4445
    4546
     
    786787
    787788    m->dhcp.setOption(DHCPServerRunner::kDsrKeyConfig, m->tempConfigFileName);
     789    m->dhcp.setOption(DHCPServerRunner::kDsrKeyComment, m->networkName.c_str());
    788790#else /* !VBOX_WITH_DHCPD */
    789791    /* Main is needed for NATNetwork */
  • trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp

    r76007 r76190  
    454454
    455455
     456#define DHCPD_GETOPT_COMMENT 256 /* No short option for --comment */
    456457static const RTGETOPTDEF g_aOptions[] =
    457458{
    458     { "--config",       'c',    RTGETOPT_REQ_STRING },
     459    { "--config",       'c',                  RTGETOPT_REQ_STRING },
     460    { "--comment",      DHCPD_GETOPT_COMMENT, RTGETOPT_REQ_STRING }
    459461};
    460462
     
    494496
    495497                break;
     498
     499            case DHCPD_GETOPT_COMMENT: /* --comment */
     500                /* The sole purpose of this option is to allow identification of DHCP
     501                 * server instances in the process list. We ignore the required string
     502                 * argument of this option.
     503                 */
     504                continue;
    496505
    497506            case VINF_GETOPT_NOT_OPTION:
  • trunk/src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp

    r75648 r76190  
    631631    ClientId::registerFormat();
    632632
     633    /* XXX: We no longer need hardcoded and compat methods. We should remove them soon. */
    633634    if (argc < 2)
    634635        m_Config = Config::hardcoded();
    635     else if (strcmp(argv[1], "--config") == 0)
     636    else if (   strcmp(argv[1], "--config") == 0
     637             || strcmp(argv[1], "--comment") == 0)
    636638        m_Config = Config::create(argc, argv);
    637639    else
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