- printf("HEADER:\n");
- printf("\topcode = %s", opcodes[hp->opcode]);
- printf(", id = %d", ntohs(hp->id));
- printf(", rcode = %s\n", rcodes[hp->rcode]);
- printf("\theader flags: ");
+ fprintf(file,"HEADER:\n");
+ fprintf(file,"\topcode = %s", opcodes[hp->opcode]);
+ fprintf(file,", id = %d", ntohs(hp->id));
+ fprintf(file,", rcode = %s\n", rcodes[hp->rcode]);
+ fprintf(file,"\theader flags: ");