I
Ian Gibbons
Firstly what type is %x as I've not encountered it before?
Now the problem: I'm trying to alter a host masking system for ircd so
that it masks all but the isp name and location (if .uk.us etc..).
However the crc32 stuff doesnt return as a string, and because the
number of hostname fields is not static I need to build a string which
contains each hostname field hashed and joined together.
if (parc > 4) /* There are isp's like *.isp.co.uk etc out
there */
{
for (i=2; i < (parc - 2); i++)
{
hash = ((crc32(parv, strlen(parv)) + KEY2) ^ KEY1) ^
KEY3;
hash <<= 2;
hash >>= 2;
/* what goes here to make buf complete? */
}
sprintf(mask, "%s%s.%s.%s", buf, parv[parc - 3], parv[parc - 2],
parv[parc - 1]);
}
hash[0] and [1] are always the first two hostname fields, and in other
conditions are sprintf'ed into mask as %x.
Ultimately what im aiming is to have mask.mask.mydomain.co.uk,
mask.mask.mask.otherdomain.co.uk, mask.mask.mask.domain3.com etc..
Hope this makes sense
Kind Regards,
Ian
Now the problem: I'm trying to alter a host masking system for ircd so
that it masks all but the isp name and location (if .uk.us etc..).
However the crc32 stuff doesnt return as a string, and because the
number of hostname fields is not static I need to build a string which
contains each hostname field hashed and joined together.
if (parc > 4) /* There are isp's like *.isp.co.uk etc out
there */
{
for (i=2; i < (parc - 2); i++)
{
hash = ((crc32(parv, strlen(parv)) + KEY2) ^ KEY1) ^
KEY3;
hash <<= 2;
hash >>= 2;
/* what goes here to make buf complete? */
}
sprintf(mask, "%s%s.%s.%s", buf, parv[parc - 3], parv[parc - 2],
parv[parc - 1]);
}
hash[0] and [1] are always the first two hostname fields, and in other
conditions are sprintf'ed into mask as %x.
Ultimately what im aiming is to have mask.mask.mydomain.co.uk,
mask.mask.mask.otherdomain.co.uk, mask.mask.mask.domain3.com etc..
Hope this makes sense
Kind Regards,
Ian