Changeset 17864 in vbox
- Timestamp:
- Mar 13, 2009 11:04:21 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 44415
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
r17812 r17864 396 396 std::string m_Name; 397 397 std::string m_Network; 398 std::string m_TrunkName; 399 INTNETTRUNKTYPE m_enmTrunkType; 398 400 RTMAC m_MacAddress; 399 401 RTNETADDRIPV4 m_Ipv4Address; … … 510 512 m_Name = "VBoxNetDhcp"; 511 513 m_Network = "VBoxNetDhcp"; 514 m_TrunkName = ""; 515 m_enmTrunkType = kIntNetTrunkType_WhateverNone; 512 516 m_MacAddress.au8[0] = 0x08; 513 517 m_MacAddress.au8[1] = 0x00; … … 689 693 { "--name", 'N', RTGETOPT_REQ_STRING }, 690 694 { "--network", 'n', RTGETOPT_REQ_STRING }, 695 { "--trunk-name", 't', RTGETOPT_REQ_STRING }, 696 { "--trunk-type", 'T', RTGETOPT_REQ_STRING }, 691 697 { "--mac-address", 'a', RTGETOPT_REQ_MACADDR }, 692 698 { "--ip-address", 'i', RTGETOPT_REQ_IPV4ADDR }, … … 722 728 case 'n': 723 729 m_Network = Val.psz; 730 break; 731 case 't': 732 m_TrunkName = Val.psz; 733 break; 734 case 'T': 735 if (!strcmp(Val.psz, "whatever")) 736 m_enmTrunkType = kIntNetTrunkType_WhateverNone; 737 else if (!strcmp(Val.psz, "netflt")) 738 m_enmTrunkType = kIntNetTrunkType_NetFlt; 739 else if (!strcmp(Val.psz, "netadp")) 740 m_enmTrunkType = kIntNetTrunkType_NetAdp; 741 else if (!strcmp(Val.psz, "srvnat")) 742 m_enmTrunkType = kIntNetTrunkType_SrvNat; 743 else 744 { 745 RTStrmPrintf(g_pStdErr, "Invalid trunk type '%s'\n", Val.psz); 746 return 1; 747 } 724 748 break; 725 749 case 'a': … … 794 818 "All rights reserved\n" 795 819 "\n" 796 "Usage:\n" 797 " TODO\n", 820 "Usage: VBoxNetDHCP <options>\n" 821 "\n" 822 "Options:\n" 798 823 VBOX_VERSION_STRING); 824 for (size_t i = 0; i < RT_ELEMENTS(s_aOptionDefs); i++) 825 RTPrintf(" -%c, %s\n", s_aOptionDefs[i].iShort, s_aOptionDefs[i].pszLong); 799 826 return 1; 800 827 … … 855 882 OpenReq.pSession = m_pSession; 856 883 strncpy(OpenReq.szNetwork, m_Network.c_str(), sizeof(OpenReq.szNetwork)); 857 OpenReq.szTrunk[0] = '\0'; 858 OpenReq.enmTrunkType = kIntNetTrunkType_WhateverNone; 884 OpenReq.szNetwork[sizeof(OpenReq.szNetwork) - 1] = '\0'; 885 strncpy(OpenReq.szTrunk, m_TrunkName.c_str(), sizeof(OpenReq.szTrunk)); 886 OpenReq.szTrunk[sizeof(OpenReq.szTrunk) - 1] = '\0'; 887 OpenReq.enmTrunkType = m_enmTrunkType; 859 888 OpenReq.fFlags = 0; /** @todo check this */ 860 889 OpenReq.cbSend = m_cbSendBuf;
Note:
See TracChangeset
for help on using the changeset viewer.