in reply to Re^2: TCP States ( NetPacket::TCP module )
in thread TCP States ( NetPacket::TCP module )

You can binary AND them with the constants provided by the module to test for a single flag. The following will give you a comma-separated list of flags for a single packet.

my %tcp_flags=(FIN => FIN, SYN => SYN, RST => RST, PSH => PSH, ACK => ACK, URG => URG, ECE => ECE, CWR => CWR); my $cur_flags=$tcp_obj->{flags}; my @set_flags = grep { $cur_flags & $tcp_flags{$_} } keys %tcp_flags; print join(",",@set_flags)."\n";

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan

Replies are listed 'Best First'.
Re^4: TCP States ( NetPacket::TCP module )
by swaroop (Beadle) on Dec 26, 2005 at 03:23 UTC
    Thanks, its working fine.