Changeset 49918 in vbox
- Timestamp:
- Dec 16, 2013 7:56:51 AM (11 years ago)
- Location:
- trunk/src/VBox/NetworkServices/DHCP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/DHCP/Config.cpp
r49735 r49918 773 773 RT_ZERO(opt); 774 774 775 std::vector<RawOption> extra (2);775 std::vector<RawOption> extra; 776 776 opt.u8OptId = RTNET_DHCP_OPT_MSG_TYPE; 777 777 opt.au8RawOpt[0] = RTNET_DHCP_MT_OFFER; … … 789 789 extra.push_back(opt); 790 790 791 processParameterReqList(client, pu8ReqList, cReqList );791 processParameterReqList(client, pu8ReqList, cReqList, extra); 792 792 793 793 return doReply(client, extra); … … 826 826 RT_ZERO(opt); 827 827 828 std::vector<RawOption> extra (2);828 std::vector<RawOption> extra; 829 829 opt.u8OptId = RTNET_DHCP_OPT_MSG_TYPE; 830 830 opt.au8RawOpt[0] = RTNET_DHCP_MT_ACK; … … 841 841 extra.push_back(opt); 842 842 843 processParameterReqList(client, pu8ReqList, cReqList );843 processParameterReqList(client, pu8ReqList, cReqList, extra); 844 844 845 845 return doReply(client, extra); … … 979 979 980 980 981 int NetworkManager::processParameterReqList(const Client& client, uint8_t *pu8ReqList, int cReqList) 982 { 981 int NetworkManager::processParameterReqList(const Client& client, const uint8_t *pu8ReqList, 982 int cReqList, std::vector<RawOption>& extra) 983 { 984 const Lease l = client.lease(); 985 986 const NetworkConfigEntity *pNetCfg = l.getConfig(); 987 983 988 /* request parameter list */ 984 989 RawOption opt; 985 int idxParam = 0; 986 987 uint8_t *pReqList = pu8ReqList; 988 989 const Lease const_l = client.lease(); 990 Lease l = Lease(const_l); 991 992 const NetworkConfigEntity *pNetCfg = l.getConfig(); 993 994 for (idxParam = 0; idxParam < cReqList; ++idxParam) 995 { 996 997 bool fIgnore = false; 990 bool fIgnore; 991 uint8_t u8Req; 992 for (int idxParam = 0; idxParam < cReqList; ++idxParam) 993 { 994 fIgnore = false; 998 995 RT_ZERO(opt); 999 opt.u8OptId = pReqList[idxParam];1000 1001 switch( pReqList[idxParam])996 u8Req = opt.u8OptId = pu8ReqList[idxParam]; 997 998 switch(u8Req) 1002 999 { 1003 1000 case RTNET_DHCP_OPT_SUBNET_MASK: … … 1011 1008 { 1012 1009 const Ipv4AddressContainer lst = 1013 g_ConfigurationManager->getAddressList( pReqList[idxParam]);1010 g_ConfigurationManager->getAddressList(u8Req); 1014 1011 PRTNETADDRIPV4 pAddresses = (PRTNETADDRIPV4)&opt.au8RawOpt[0]; 1015 1012 … … 1029 1026 case RTNET_DHCP_OPT_DOMAIN_NAME: 1030 1027 { 1031 std::string domainName = g_ConfigurationManager->getString( pReqList[idxParam]);1028 std::string domainName = g_ConfigurationManager->getString(u8Req); 1032 1029 if (domainName == g_ConfigurationManager->m_noString) 1033 1030 { … … 1043 1040 break; 1044 1041 default: 1045 Log(("opt: %d is ignored\n", pReqList[idxParam]));1042 Log(("opt: %d is ignored\n", u8Req)); 1046 1043 fIgnore = true; 1047 1044 break; … … 1049 1046 1050 1047 if (!fIgnore) 1051 l.options().insert(std::map<uint8_t, RawOption>::value_type(opt.u8OptId, opt));1048 extra.push_back(opt); 1052 1049 1053 1050 } … … 1220 1217 1221 1218 const MapOptionId2RawOption& Lease::options() const 1222 {1223 return m->options;1224 }1225 1226 1227 MapOptionId2RawOption& Lease::options()1228 1219 { 1229 1220 return m->options; -
trunk/src/VBox/NetworkServices/DHCP/Config.h
r49821 r49918 133 133 134 134 const MapOptionId2RawOption& options() const; 135 MapOptionId2RawOption& options();136 135 137 136 bool toXML(xml::ElementNode *) const; … … 516 515 int prepareReplyPacket4Client(const Client& client, uint32_t u32Xid); 517 516 int doReply(const Client& client, const std::vector<RawOption>& extra); 518 int processParameterReqList(const Client& client, uint8_t *pu8ReqList, int cReqList);517 int processParameterReqList(const Client& client, const uint8_t *pu8ReqList, int cReqList, std::vector<RawOption>& extra); 519 518 520 519 private:
Note:
See TracChangeset
for help on using the changeset viewer.