dcmqrscp默认只支持hostname
简单的修改了一下就可以支持IP了
dul.cc
receiveTransportConnectionTCP
OFString client_dns_name;
char client_ip_address[20];
sprintf(client_ip_address, "%-d.%-d.%-d.%-d", // this code is ugly but thread safe
((int) from.sa_data[2]) & 0xff,
((int) from.sa_data[3]) & 0xff,
((int) from.sa_data[4]) & 0xff,
((int) from.sa_data[5]) & 0xff);
if (! dcmDisableGethostbyaddr.get()) remote = gethostbyaddr(&from.sa_data[2], 4, 2);
//@20190617 to supported IP
//if (remote == NULL)
{
// reverse DNS lookup disabled or host not found, use numerical address
OFStandard::strlcpy(params->callingPresentationAddress, client_ip_address,
sizeof(params->callingPresentationAddress));
OFStandard::strlcpy((*association)->remoteNode, client_ip_address, sizeof((*association)->remoteNode));
}
//else
//{
// client_dns_name = remote->h_name;
// char node[128];
// if ((*network)->options & DUL_FULLDOMAINNAME)
// OFStandard::strlcpy(node, remote->h_name, sizeof(node));
// else {
// if (sscanf(remote->h_name, "%[^.]", node) != 1)
// node[0] = '\0';
// }
// OFStandard::strlcpy((*association)->remoteNode, node, sizeof((*association)->remoteNode));
// OFStandard::strlcpy(params->callingPresentationAddress, node, sizeof(params->callingPresentationAddress));
//}