kroupouk has asked for the wisdom of the Perl Monks concerning the following question:

Venerable fellow monks, I'm trying to fidle around tcp options.
sub initial_tcp { $n = Net::RawIP->new({ ip => { saddr => $srcip, daddr => $dstip, }, tcp => { source => $src, dest => $dst, syn => 1, }, }); $n->opset(tcp =>{ #Window Scale 9 x512 type => 0x0303, data => 0x09, } ); $n->send; $n >ethnew($intf); $n->ethset(source => $smac, dest => $dmac); $n->ethsend; }
I always get the following error message
./tcp-syn.pl Useless use of numeric gt (>) in void context at ./tcp-syn.pl line 38. Can't locate auto/Net/RawIP/opset.al in @INC (@INC contains: /etc/perl + /usr/lib/perl5/vendor_perl/5.8.8/i686-linux /usr/lib/perl5/vendor_pe +rl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/ +5.8.6/i686-linux /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vend +or_perl/5.8.7/i686-linux /usr/lib/perl5/vendor_perl /usr/lib/perl5/si +te_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl +5/site_perl /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr +/local/lib/site_perl .) at ./tcp-syn.pl line 32
What do I misse here?

Replies are listed 'Best First'.
Re: RAWIP: uses of tcp options [opset]
by Anonymous Monk on Jun 22, 2009 at 08:10 UTC
      I think I've found the way of playing with tcpoptions. TCP options crafted by hand and increase the tcp header doff option. So here for 12 bytes options. It would look like this:
      $data="\x01\x01\x08\x0a\x00\x13\x7d\xae\xfb\x2a\xeb\xb4\x00\x00\x00\x0 +0"; $doff='8'; sub initial_tcp { $n = Net::RawIP->new({ ip => { saddr => $srcip, daddr => $dstip, }, tcp => { source => 80, dest => 443, syn => 1, doff => $doff, data => $data, },