Example #1
0
int resolve_host_ipv4(const char *host, struct sockaddr_in *addr)
{
	struct hostent *hostdnsentries = gethostbyname(host);

	if (hostdnsentries == NULL)
	{
		set_error(gettext("Problem resolving %s (IPv4): %s"), host, hstrerror(h_errno));

		return -1;
	}

	/* create address structure */
	addr -> sin_family = hostdnsentries -> h_addrtype;
	addr -> sin_addr = incopy(hostdnsentries -> h_addr_list[0]);

	return 0;
}
Example #2
0
TOSMWidget::TNWay::TNWay(const TNWay &src)
{
    init();
    incopy(src);
}
Example #3
0
TOSMWidget::TNWay & TOSMWidget::TNWay::operator = (const TOSMWidget::TNWay &src)
{
    incopy(src);
    return *this;
}