/* inetpton(af, src, dst) ** ** This is a wrapper for inet_pton(), so we can use ipv4 addresses with an ** af of AF_INET6, and that it gets converted to ipv4 mapped ipv6. ** ** (c) 2000 Kurt Roeckx <q@ping.be>, Licensed under GNU GPL v2. */ int inetpton(int af, const char *src, void *dst) { int i; /* an empty string should listen to all */ if (af == AF_INET6 && *src && !strchr(src, ':')) { i = inet_pton(AF_INET, src, dst); /* ugly hack */ memcpy(dst + 12, dst, 4); memset(dst, 0, 10); memset(dst + 10, 0xff, 2); return i; } return inet_pton(af, src, dst); }
CESNET, z. s. p. o.
Generála Píky 26
160 00 Praha 6
Tel: +420 234 680 222
Fax: +420 224 320 269
info@cesnet.cz
Tel: +420 234 680 222
GSM: +420 602 252 531
Fax: +420 224 313 211
support@cesnet.cz