Home > Archive > PERL Modules > January 2006 > net::rawip source code question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
net::rawip source code question
|
|
| August Reno 2006-01-10, 4:00 am |
| 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
| |
| Jim Gibson 2006-01-10, 4:00 am |
| In article <dprt75$4fg$1@namru.matavnet.hu>, August Reno
<a_reno@tiscali.it> wrote:
> 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
|
|
|
|
|