Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: NetPacket::TCP output

by Benedict (Initiate)
on Oct 06, 2001 at 20:49 UTC ( #117224=note: print w/replies, xml ) Need Help??


in reply to Re: NetPacket::TCP output
in thread NetPacket::TCP output

Ah, I'm fairly familiar with the flags and what they mean, ACK, SYN, RST, etc. My problem is that the output from NetPacket::TCP for the flags does not seem to be in the form, ACK, etc., but is somekind of numerical encoding. For instance, to test what the output was like, I captured one packet and printed out the flags, and what I got was "24". I don't know how to interpret that.

Benedict

Replies are listed 'Best First'.
Re: Re: Re: NetPacket::TCP output
by Benedict (Initiate) on Oct 07, 2001 at 00:08 UTC

    There are six flags. Perhaps 2, for instance, is SYN, and 4 is ACK?

    Benedict

      Nope, that explanation doesn't work. Help?

      Benedict

        I can't take credit for this, I copied from someone elses code.
        sub parse_tcp_flags { my $flagword = shift(@_); my %flags = ("FIN"=>0,"SYN"=>0,"RST"=>0,"PSH"=>0,"ACK"=>0,"URG"=>0) +; $flags{FIN} = ($flagword & 0x01)? 1: 0; $flags{SYN} = ($flagword & 0x02)? 1: 0; $flags{RST} = ($flagword & 0x04)? 1: 0; $flags{PSH} = ($flagword & 0x08)? 1: 0; $flags{ACK} = ($flagword & 0x10)? 1: 0; $flags{URG} = ($flagword & 0x20)? 1: 0; return \%flags; }
        Pass this function the flags from parse_tcp_flags

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://117224]
help
Chatterbox?
[Marshall]: I also looked into PerlApp from Active State, but they don't sell their Dev Kit independent of a very expensive ($1,200) per year license anymore.
[Corion]: I would assume that the PE format hasn't changed that much since the days of yore, but it seems that I would be wrong in that assumption
[Marshall]: When I bought my copy 15+ years ago, it was just a couple hundred bucks.
[Marshall]: I looked at MS specs for PE format and I didn't see any changes in last decade, but evidenly that would be wrong.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2016-12-08 18:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (144 votes). Check out past polls.