OCT 1.增加查询地址池接口
This commit is contained in:
parent
4d848f2724
commit
8dbab1019e
|
@ -458,13 +458,16 @@ static int delete_dhcpd_rangeset(data19 *req, const char *pRequest){
|
|||
if(!deleted_flag){
|
||||
if((st_addr == cfig.dhcpRanges[m].rangeStart) && (en_addr == cfig.dhcpRanges[m].rangeEnd)){
|
||||
deleted_flag = true;
|
||||
memset(&cfig.dhcpRanges[m], 0, sizeof(struct data19));
|
||||
if(m == cfig.rangeCount-1){
|
||||
memset(&cfig.dhcpRanges[m], 0, sizeof(struct data19));
|
||||
}
|
||||
continue;
|
||||
}else if(st_addr == cfig.dhcpRanges[m].rangeStart||en_addr == cfig.dhcpRanges[m].rangeEnd){
|
||||
deleted_flag = false;
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
cfig.dhcpRanges[m].rangeSetInd = m-1;
|
||||
memcpy(&(cfig.dhcpRanges[m-1]), &(cfig.dhcpRanges[m]), sizeof(struct data19));
|
||||
}
|
||||
}
|
||||
|
@ -560,6 +563,8 @@ static int query_dhcpd_rangeset(data19 *req){
|
|||
opPointer++;
|
||||
|
||||
memcpy(op.value, opPointer, op.size);
|
||||
printf("***op->addr=%X***\n", cfig.dhcpRanges[rangeInd].options);
|
||||
printf("op.opt_code=%d\n", op.opt_code);
|
||||
if(op.opt_code == DHCP_OPTION_DNS){
|
||||
dnsSize = op.size;
|
||||
do {
|
||||
|
@ -582,6 +587,7 @@ static int query_dhcpd_rangeset(data19 *req){
|
|||
|
||||
cJSON_AddStringToObject(pRangeItem, "gateway", gateway);
|
||||
}else if(op.opt_code == DHCP_OPTION_IPADDRLEASE){
|
||||
printf("***flag!!!***\n");
|
||||
lease = fUInt(op.value);
|
||||
|
||||
cJSON_AddNumberToObject(pRangeItem, "lease", lease);
|
||||
|
|
Loading…
Reference in New Issue