It looks to me like you are looking at the wrong bits. NetPacket::TCP has the following constants defined:

use constant FIN => 0x01; use constant SYN => 0x02; use constant RST => 0x04; use constant PSH => 0x08; use constant ACK => 0x10; use constant URG => 0x20; use constant ECE => 0x40; use constant CWR => 0x80;
Just to test my theory I wrote the following snippet.
#!/usr/bin/perl use strict; use warnings; use constant FIN => 0x01; use constant SYN => 0x02; use constant RST => 0x04; use constant PSH => 0x08; use constant ACK => 0x10; use constant URG => 0x20; use constant ECE => 0x40; use constant CWR => 0x80; my $helpDec = sprintf("%d", 19); # an arbitrary number that will have +the SYN bit set my $helpBin = unpack("B*", pack('C',$helpDec)); print "TCPFLAG: $helpBin\n"; print "Or: $helpDec\n"; print "TCPACK: " . substr( $helpBin, 6, 1 ) . "\n"; #TCP flag ACK print "TCPPSH: " . substr( $helpBin, 5, 1 ) . "\n"; #TCP flag PUSH (PS +H) print "TCPRST: " . substr( $helpBin, 4, 1 ) . "\n"; #TCP flag RESET (R +ST) print "TCPSYN: " . substr( $helpBin, 3, 1 ) . "\n"; #TCP flag SYN print "TCPFIN: " . substr( $helpBin, 2, 1 ) . "\n"; #TCP flag FIN print "\n"; print "TCPACK: " . ( $helpDec & ACK ? 1 : 0 ) . "\n"; #TCP flag ACK print "TCPPSH: " . ( $helpDec & PSH ? 1 : 0 ) . "\n"; #TCP flag PUSH ( +PSH) print "TCPRST: " . ( $helpDec & RST ? 1 : 0 ) . "\n"; #TCP flag RESET +(RST) print "TCPSYN: " . ( $helpDec & SYN ? 1 : 0 ) . "\n"; #TCP flag SYN print "TCPFIN: " . ( $helpDec & FIN ? 1 : 0 ) . "\n"; #TCP flag FIN __END__ TCPFLAG: 00010011 Or: 19 TCPACK: 1 TCPPSH: 0 TCPRST: 0 TCPSYN: 1 TCPFIN: 0 TCPACK: 1 TCPPSH: 0 TCPRST: 0 TCPSYN: 1 TCPFIN: 1
I hope this helps.


In reply to Re: Win32 TCP SYN messages by Mr. Muskrat
in thread Win32 TCP SYN messages by jschollen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.