iptobinstr (const int af, const void *addr, char *str)
{
int i;
-
+
switch (af)
{
case AF_INET:
{
uint32_t b = htonl (((struct in_addr *) addr)->s_addr);
-
+
str[32] = '\0';
str += 31;
for (i = 31; i >= 0; i--)
case AF_INET6:
{
struct in6_addr b = *(const struct in6_addr *) addr;
-
+
str[128] = '\0';
str += 127;
for (i = 127; i >= 0; i--)
struct in_addr a;
unsigned int len;
uint32_t t;
-
+
if (1 != inet_pton (AF_INET, netmask, &a))
return 0;
len = 32;
char *rxstr)
{
unsigned int pfxlen;
-
+
pfxlen = ipv4netmasktoprefixlen (netmask);
iptobinstr (AF_INET, ip, rxstr);
rxstr[pfxlen] = '\0';
char *
GNUNET_TUN_ipv4policy2regex (const char *policy)
{
+ // FIXME: do actual policy parsing here, see #2919
return GNUNET_strdup (policy);
}
char *
GNUNET_TUN_ipv6policy2regex (const char *policy)
{
+ // FIXME: do actual policy parsing here, see #2919
return GNUNET_strdup (policy);
}