예제 #1
0
파일: test_rpctools.c 프로젝트: ic-hep/emi3
void init() {
    create_ipv4("10.10.5.1", 2048, (struct sockaddr_in * ) &ipv4a);
    create_ipv4("10.10.5.1", 2049, (struct sockaddr_in * ) &ipv4b);
    create_ipv4("10.10.5.2", 2048, (struct sockaddr_in * ) &ipv4c);

#ifdef _USE_TIRPC
    create_ipv6("2001::1", 2048, (struct sockaddr_in6 *) &ipv6a);
    create_ipv6("2001::1", 2049, (struct sockaddr_in6 *) &ipv6b);
    create_ipv6("2001::f:1", 2048, (struct sockaddr_in6 *) &ipv6c);
#endif    
}
예제 #2
0
void init()
{
    nfs_set_ip_name_param_default();
    nfs_Init_ip_name(nfs_param.ip_name_param);

    create_ipv4("127.0.0.1", 2048, (struct sockaddr_in * ) &ipv4a);
    //    create_ipv4("10.10.5.1", 2049, (struct sockaddr_in * ) &ipv4b);
    create_ipv4("127.0.0.2", 2048, (struct sockaddr_in * ) &ipv4c);

#ifdef _USE_TIRPC
    create_ipv6("::1", 2048, (struct sockaddr_in6 *) &ipv6a);
    // create_ipv6("2001::1", 2049, (struct sockaddr_in6 *) &ipv6b);
    create_ipv6("fe00::0", 2048, (struct sockaddr_in6 *) &ipv6c);
#endif    

}
예제 #3
0
c_ip46_addr::c_ip46_addr(const std::string &ip_addr, int port) {
	// ports-TODO(r) also parse the port here
	// TODO parsing ipv6
	if (is_ipv4(ip_addr)) {
		(*this) = create_ipv4(ip_addr, port);
	} else {
		(*this) = create_ipv6(ip_addr, port);
	}
	_info("Parsing ip46 from string ["<<ip_addr<<":" << port << "] created: " << (*this));
}