diff --git a/dhcp_tools/detail_wnd.c b/dhcp_tools/detail_wnd.c index d141a9d..e9371b4 100644 --- a/dhcp_tools/detail_wnd.c +++ b/dhcp_tools/detail_wnd.c @@ -119,7 +119,6 @@ static void add_dhcp_tree_colums(GtkWidget *treeView) { #define ADD_SUB_OPTION(code, len, val) \ do { \ int count_flag = 0; \ - char *p; \ gtk_tree_store_append(store, &iterOpt, &iterSub); \ s = sdsempty(); \ sprintf(s, "%u", (len)); \ @@ -135,9 +134,12 @@ static void add_dhcp_tree_colums(GtkWidget *treeView) { do { \ gtk_tree_store_append(store, &iterOpt, &iterSub); \ s = sdsempty(); \ - sprintf(s, "(%u) %s", (val)[count_flag], dhcp_get_opName((val)[count_flag]));\ - gtk_tree_store_set(store, &iterOpt, 0, dhcp_get_opName(code), 1, s, -1);\ + t = sdsempty(); \ + sprintf(s, "(%u) %s", (val)[count_flag], dhcp_get_opName((val)[count_flag])); \ + sprintf(t, "%s Item", dhcp_get_opName(code)); \ + gtk_tree_store_set(store, &iterOpt, 0, t, 1, s, -1);\ sdsfree(s); \ + sdsfree(t); \ count_flag++; \ } while(count_flag != (len)); \ break; \ @@ -165,7 +167,7 @@ static void add_dhcp_tree_colums(GtkWidget *treeView) { s = sdsempty(); \ if((code) == OPT_MESSAGETYPE) { \ gtk_tree_store_set(store, &iterOpt, 0, dhcp_get_opName(code), 1, g_mess_info[(val)[0]], -1);\ - } \ + } \ sdsfree(s); \ break; \ default: \ @@ -176,7 +178,7 @@ static void add_dhcp_tree_colums(GtkWidget *treeView) { static void create_dhcp_tree_mode(PDHCP_PACKAGE p, GtkWidget *treeView) { // 填充右上侧 TreeView 协议数据 - sds s; + sds s, t; GtkTreeIter iter, iterSub, iterOpt; GtkTreeStore *store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_STRING); const char *itemTitle[] = {"Ethernet II", "802.1Q Virtual LAN", "IP Version 4", "UDP", "DHCP"}; @@ -261,15 +263,15 @@ static void create_dhcp_tree_mode(PDHCP_PACKAGE p, GtkWidget *treeView) { ADD_SUB_STRING("Relay agent IP address", inet_ntoa(*(struct in_addr*)&p->dhcp.giaddr)); s = sdsempty(); MAC_TO_STR(p->dhcp.chaddr, s); - ADD_SUB_STRING("Destination", s); + ADD_SUB_STRING("Client MAC address", s); sdsfree(s); - if(strlen(p->dhcp.sname) != 0) + if(p->dhcp.sname[0] != '\0') ADD_SUB_STRING("Server host name", p->dhcp.sname); else ADD_SUB_STRING("Server host name", "not given"); - if(strlen(p->dhcp.file) != 0) + if(p->dhcp.file[0] != '\0') ADD_SUB_STRING("Boot file name", p->dhcp.file); else ADD_SUB_STRING("Boot file name", "not given"); diff --git a/srcs/service/dhcpd/dhcp_option.c b/srcs/service/dhcpd/dhcp_option.c index 9580056..e0888eb 100644 --- a/srcs/service/dhcpd/dhcp_option.c +++ b/srcs/service/dhcpd/dhcp_option.c @@ -105,6 +105,7 @@ static const DHCP_OPTION_CFG g_opCfg[] = { {"SubnetSelectionOption", OPT_SUBNETSELECTION, 3, TRUE }, {"DomainSearch", OPT_DOMAINSEARCH, 1, TRUE }, {"SIPServersDHCPOption", OPT_SIPSERVERSDHCP, 1, TRUE }, + {"ClasslessStaticRoute", OPT_CLASSLESSSTATICROUTE, 1, TRUE }, {"CCC", OPT_CCC, 1, TRUE }, {"TFTPServerIPaddress", OPT_TFPTSERVERIPADDRESS, 3, TRUE }, {"CallServerIPaddress", OPT_CALLSERVERIPADDRESS, 3, TRUE },