コード例 #1
0
 private Dictionary <int, DhcpOption> RequestedOptions(Dictionary <int, DhcpOption> optionDictionary, DhcpV4Message requestMsg)
 {
     if (optionDictionary != null && optionDictionary.Count > 0)
     {
         List <int> requestedCodes = requestMsg.GetRequestedOptionCodes();
         if (requestedCodes != null && requestedCodes.Count > 0)
         {
             Dictionary <int, DhcpOption> newOptionDictionary = new Dictionary <int, DhcpOption>();
             foreach (var req in requestedCodes)
             {
                 if (optionDictionary.ContainsKey(req))
                 {
                     newOptionDictionary[req] = optionDictionary[req];
                 }
             }
             optionDictionary = newOptionDictionary;
         }
     }
     return(optionDictionary);
 }