コード例 #1
0
ファイル: http_class.c プロジェクト: flowsha/cdma
http_client::http_client(const char *host, unsigned short int port = 80)
{
    http_socket = 0;
    is_print = true;
    is_connected = false;
    delay_time = 200;
    strcpy(http_host, hosttoip(host));
    http_port = port;
}
コード例 #2
0
ファイル: datalink.c プロジェクト: ginggs/maemo-tcptraceroute
char *finddev(u_long with_src)
{
	struct interface_entry *p;
	char *device = NULL;

	debug("entering finddev()\n");

	/* First, see if we're trying to trace to ourself */
	for (p = interfaces; p; p = p->next)
		if (p->addr == dst_ip)
		{
			debug("Destination matches local address of interface %s;\n\tattempting to find loopback interface, o_nofilter set\n", p->name);
			with_src = hosttoip("127.0.0.1", LIBNET_DONT_RESOLVE);
			o_nofilter = 1;
		}

	for (p = interfaces; p; p = p->next)
		if (p->addr == with_src)
			device = p->name;
	
	debug("finddev() returning %s\n", device);
	return device;
}