From ff1c6b91550d94b4cf5aa91c9a6f312b50441995 Mon Sep 17 00:00:00 2001 From: huangxin Date: Thu, 24 Nov 2022 14:30:14 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/open_dhcp/query.cpp | 57 ---------------------------------------- 1 file changed, 57 deletions(-) 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;