8static char fnaccept[3 + IPFMT];
9static char fnreject[4 + IPFMT];
17 fnaccept[0] = fnreject[0] =
'i';
18 fnaccept[1] = fnreject[1] =
'p';
19 fnaccept[2] = fnreject[2] =
'/';
22 if (byte_equal(
ip,12,V4mappedprefix)) {
23 fnaccept[3 + ip4_fmt(fnaccept + 3,
ip + 12)] = 0;
24 fnreject[4 + ip4_fmt(fnreject + 4,
ip + 12)] = 0;
27 fnaccept[3 + ip6_fmt(fnaccept + 3,
ip)] = 0;
28 fnreject[4 + ip6_fmt(fnreject + 4,
ip)] = 0;
35 if (!fnreject[3])
break;
36 if (stat(fnreject,&st) == 0)
return 0;
37 i = str_rchr(fnreject,sep);
38 if (i && fnreject[i] == sep)
47 if (!fnaccept[3])
return 0;
48 if (stat(fnaccept,&st) == 0)
return 1;
50 i = str_rchr(fnaccept,sep);
51 if (!fnaccept[i])
return 0;
int clientok(char ip[16])