diff --git a/srcs/open_dhcp/query.cpp b/srcs/open_dhcp/query.cpp index 15cbd8b..6a3dd3e 100644 --- a/srcs/open_dhcp/query.cpp +++ b/srcs/open_dhcp/query.cpp @@ -222,63 +222,6 @@ static void add_options(OBJ_DHCP_RNG pRange, data20 *optionData) { VALUE_TO_DHCP_TLV(buff, value, DHCP_OPTION_ROUTER); } -#if 0 - for (int i = 0; i < 3; i++) { - char buff[1024]; - MYBYTE hoption[256]; - - if (strlen(pRange.subnet) != 0 && !map_Flag[0]) { - map_Flag[0] = true; - opTag = DHCP_OPTION_NETMASK; - strcpy(value, pRange.subnet); - } else if (strlen(pRange.dnsSvr) != 0 && !map_Flag[1]) { - map_Flag[1] = true; - opTag = DHCP_OPTION_DNS; - strcpy(value, pRange.dnsSvr); - } else if (strlen(pRange.gateway) != 0 && !map_Flag[2]) { - map_Flag[2] = true; - opTag = DHCP_OPTION_ROUTER; - strcpy(value, pRange.gateway); - } else { - continue; - } - - - int numbytes = myTokenize(buff, value, "/,.", true); - if (numbytes > 255) { - break; - } else { - char *ptr = buff; - valSize = 0; - for (; *ptr; ptr = myGetToken(ptr, 1)) { - if (isInt(ptr)) { - hoption[valSize] = STR2INT(ptr); - valSize++; - } else { - break; - } - } - - memcpy(value, hoption, valSize); - } - - if (opTag == DHCP_OPTION_NETMASK && map_Flag[0]) { - optionData->mask = (*((MYDWORD *)value)); - } - - if (buffSize > valSize + 2) { - *dp = opTag; - dp++; - *dp = valSize; - dp++; - memcpy(dp, value, valSize); - dp += valSize; - buffSize -= (valSize + 2); - } - - } -#endif - //lease if (pRange.lease != 0) { MYDWORD j;