Click here to get back home

net::rawip source code question

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
net::rawip source code question August Reno 01-08-2006
Posted by August Reno on January 8, 2006, 9:38 pm
Please log in for more thread options


Hello!
I'm a total newbie in perl. I examined some scripts where the net::rawip
module
was used. What does the following mean ?

$s = new Net::RawIP;
$filter = "ip proto \tcp and src host $daddr and src port $dport";
$pcap = $a->pcapinit($device,$filter,1500,60);
....

So I'm trouble with the $filter line. (daddr = destination address,
dport=destination port).
Please explain this to me! Thanks in advance,
regards,
august




Posted by Jim Gibson on January 9, 2006, 11:22 am
Please log in for more thread options



> Hello!
> I'm a total newbie in perl. I examined some scripts where the net::rawip
> module

I have not used the Net::RawIP module, so can't help you with what the
lines below will actually do.

> was used. What does the following mean ?
>
> $s = new Net::RawIP;

This line results in the variable $s becoming an instance of the
Net::RawIP class.

> $filter = "ip proto \tcp and src host $daddr and src port $dport";

This assigns the string 'ip proto \tcp and src host xxx and src port
yyy' to the variable $filter. Note that the two backslashes have been
converted to a single backslash in the string, and the current values
of the variables $daddr and $dport have been interpolated into the
string. This string is used as a filter program in the line below.

> $pcap = $a->pcapinit($device,$filter,1500,60);

This is a call to the Net::RawIP::pcapinit method. The values in
$device and $filter are passed to it, as are the constants 1500 (for
packet size) and 60 (for timeout).

> ...
>
> So I'm trouble with the $filter line. (daddr = destination address,
> dport=destination port).
> Please explain this to me! Thanks in advance,

The $filter contains a filter program for the pcap library. The syntax
and meaning are determined by the pcap library, of which I have no
knowledge.

See the output from 'perldoc Net::RawIP' and 'man pcap' for more
information.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


Similar ThreadsPosted
LWP::UserAgent - determining source of response code September 15, 2004, 4:35 pm
Any interest in source code repository module/drivers modeled afterDBI? August 7, 2005, 2:50 pm
using sneeze.pl with Net-RawIP February 27, 2008, 4:56 pm
LWP POST - source page received istead of data March 3, 2005, 7:58 am
Software Development Engineers needed - open source enviro - Seattle December 10, 2004, 3:38 pm
ANNOUNCE: Code::Dumper - a ::Dumper for code. Available on CPAN November 21, 2005, 11:03 am
Please help with this code June 10, 2007, 3:40 pm
what is wrong in this code November 13, 2005, 10:40 pm
Image Magick code help November 29, 2004, 12:14 pm
Image Magick code help December 3, 2004, 6:43 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap