Can you explain how this ip_to_string function works?
Posted
by user198729
on Stack Overflow
See other posts from Stack Overflow
or by user198729
Published on 2010-05-05T15:49:24Z
Indexed on
2010/05/05
16:08 UTC
Read the original article
Hit count: 102
#define IPTOSBUFFERS 12
char *iptos(u_long in)
{
static char output[IPTOSBUFFERS][3*4+3+1];
static short which;
u_char *p;
p = (u_char *)∈
which = (which + 1 == IPTOSBUFFERS ? 0 : which + 1);
_snprintf_s(output[which], sizeof(output[which]), sizeof(output[which]),"%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
return output[which];
}
Is there something I'm missing to understand it?
© Stack Overflow or respective owner