added simple random input tester for packet visualisation.

Need to supplement it with a better fuzz tester.
This commit is contained in:
gardners 2012-07-16 16:28:07 +09:30
parent 7c5c6b0826
commit 5824c38a28

View File

@ -14,6 +14,26 @@ char *indent(int n)
int senderSet=0;
unsigned char senderAddress[32];
#ifdef STANDALONE
int main(int argc,char **argv)
{
int i,n;
int len;
unsigned char buff[8192];
for(n=0;n<1024;n++)
{
int i;
len=random()%8192;
for(i=0;i<len;i++) buff[i]=random()&0xff;
serval_packetvisualise(stdout,"Fuzz Test",buff,len);
}
return 0;
}
#endif
int serval_packetvisualise_renderaddress(FILE *f,unsigned char *packet,int *ofs,int senderP)
{