void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, int maxlen)
{
	int af = (int)((struct sockaddr_in*) &(target->addr))->sin_family;
	void* sinaddr = &((struct sockaddr_in*) &(target->addr))->sin_addr;

	if(af == AF_INET6)
		sinaddr = &((struct sockaddr_in6*)&(target->addr))->sin6_addr;
	dest[0] = 0;
	if (inet_ntop(af, sinaddr, dest, (socklen_t)maxlen) == 0)
		return;
	dest[maxlen-1] = 0;
}
void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, int maxlen)
{
	int af = (int)((struct sockaddr_in*) &(target->addr))->sin_family;
	void* sinaddr = &((struct sockaddr_in*) &(target->addr))->sin_addr;

	if(af == AF_INET6)
		sinaddr = &((struct sockaddr_in6*)&(target->addr))->sin6_addr;
	dest[0] = 0;
	if (inet_ntop(af, sinaddr, dest, (socklen_t)maxlen) == 0)
		return;
	dest[maxlen-1] = 0;
}