OCT 1. 统一日志调用函数
This commit is contained in:
parent
28d0eb893e
commit
a57cf4c5d2
|
@ -31,7 +31,7 @@ static void sendUserList(data19 *req, const char *pRequest) {
|
||||||
char logBuff[512];
|
char logBuff[512];
|
||||||
dhcpMap::iterator p;
|
dhcpMap::iterator p;
|
||||||
|
|
||||||
printf("Input: %s\n", pRequest);
|
dzlog_debug("Input: %s\n", pRequest);
|
||||||
|
|
||||||
if (pRequest == nullptr || strlen(pRequest) == 0) {
|
if (pRequest == nullptr || strlen(pRequest) == 0) {
|
||||||
sprintf(logBuff, "Requeset Json");
|
sprintf(logBuff, "Requeset Json");
|
||||||
|
@ -293,7 +293,7 @@ int getHwAddr(char *buff, char *mac) {
|
||||||
|
|
||||||
int arpSet(const char *ifname, char *ipStr, char *mac) {
|
int arpSet(const char *ifname, char *ipStr, char *mac) {
|
||||||
if (ifname == nullptr || ipStr == nullptr || mac == nullptr) {
|
if (ifname == nullptr || ipStr == nullptr || mac == nullptr) {
|
||||||
printf("para is null.\n");
|
dzlog_error("para is null.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,19 +311,19 @@ int arpSet(const char *ifname, char *ipStr, char *mac) {
|
||||||
req.arp_flags = ATF_PERM | ATF_COM;
|
req.arp_flags = ATF_PERM | ATF_COM;
|
||||||
|
|
||||||
if (getHwAddr((char *)req.arp_ha.sa_data, mac) < 0) {
|
if (getHwAddr((char *)req.arp_ha.sa_data, mac) < 0) {
|
||||||
printf("get mac error.\n");
|
dzlog_error("get mac error.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
|
sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
if (sock_fd < 0) {
|
if (sock_fd < 0) {
|
||||||
printf("get socket error.\n");
|
dzlog_error("get socket error.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ioctl(sock_fd, SIOCSARP, &req);
|
ret = ioctl(sock_fd, SIOCSARP, &req);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printf("ioctl error.\n");
|
dzlog_error("ioctl error.\n");
|
||||||
close(sock_fd);
|
close(sock_fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue