示例#1
0
void
cip_net_indexer_init(void)
{
    /* XXXDPW */
    inXaddr_pton("255.255.255.0", &v4mask);
#if USE_IPV6
    inXaddr_pton("ffff:ffff:ffff:ffff:ffff:ffff:0000:0000", &v6mask);
#endif
}
示例#2
0
int
ip_local_address(const char *presentation)
{
    struct _foo *n = xcalloc(1, sizeof(*n));
    if (NULL == n)
	return 0;
    if (inXaddr_pton(presentation, &n->addr) != 1) {
	fprintf(stderr, "yucky IP address %s\n", presentation);
	xfree(n);
	return 0;
    }
    n->next = local_addrs;
    local_addrs = n;
    return 1;
}