Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The results from this is as follows:#!/usr/bin/perl -w use strict; my $fname = "ip.header"; open(FILE,$fname) or die $!; binmode(FILE); #read the first 32 bits read(FILE, my $foo, 4); my $ver = unpack "b4", $foo; my $hlen = unpack "b4", $foo; my $tos = unpack "b8", $foo; my $len = unpack "n", $foo; print "Ver = $ver, hlen = $hlen, tos = $tos, len = $len\n"; close FILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IP Header
by Aristotle (Chancellor) on Nov 02, 2002 at 21:42 UTC | |
by Anonymous Monk on Nov 03, 2002 at 00:10 UTC | |
by Aristotle (Chancellor) on Nov 03, 2002 at 00:29 UTC | |
by Anonymous Monk on Nov 02, 2002 at 22:10 UTC | |
by Aristotle (Chancellor) on Nov 02, 2002 at 23:13 UTC | |
by Anonymous Monk on Nov 02, 2002 at 23:39 UTC | |
by Thelonius (Priest) on Nov 03, 2002 at 14:27 UTC | |
| |
by Aristotle (Chancellor) on Nov 02, 2002 at 23:49 UTC |