Login | Register

HI:

Original code can not print out all of the header fields in encode_allow.c.I modified this bug, please review.

int print_encoded_allow(FILE *fp,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix) {

   unsigned int i,j=0,body;

   memcpy(&body,payload,4);
   body=ntohl(body);
   fprintf(fp,"%sMETHODS=",prefix);
   if(body==0)
      fprintf(fp,"UNKNOWN");
   for(i=0;i<32;j=(0x01<<i),i++)
   {
      if((body & j) &&i <14 )
	  {
		  fprintf(fp,"%s,",mismetodos[i]);
	  }
   }
   fprintf(fp,"\n");
   return 1;

}


Page last modified on December 17, 2014, at 11:20 AM