void decode_tcp(char *_packet) { TCPHEADER *tcp_header = (TCPHEADER *)_packet; BYTE flags = ( ntohs(tcp_header->info_ctrl) & 0x003F ); if ( flags & 0x01 ) // FIN printf("\n FIN " ); myfile << "\n FIN " ; if ( flags & 0x02 ) // SYN printf("\n SYN " ); myfile << "\n SYN " ; if ( flags & 0x04 ) // RST printf("\n RST " ); myfile << "\n RST " ; if ( flags & 0x08 ) // PSH printf("\n PSH " ); myfile << "\n PSH " ; if ( flags & 0x10 ) // ACK printf("\n ACK " ); myfile << "\n ACK " ; if ( flags & 0x20 ); // URG printf("\n URG " ); myfile << "\n URG " ; printf("\n Sequence Number : %lu\n", ntohl(tcp_header->seq_number)); myfile << "\n Sequence Number :"<< ntohl(tcp_header->seq_number); }
if ( flags & 0x01 ) // FIN printf("\n FIN " ); myfile << "\n FIN " ;
if
do
while
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)