1RawIP::libpcap(3) User Contributed Perl Documentation RawIP::libpcap(3)
2
3
4
6 Net::RawIP::libpcap - An interface to libpcap in Net::RawIP(3pm)
7
9 Function The input parameters The output parameters
10
11 open_live a network Return value is a pcap_t*
12 device(eth0,ppp0,...); If retval less than zero
13 a snap length; then $err filled with
14 a promisc - boolean; an error string.
15 a timeout in sec;
16 $err is an undef scalar;
17
18 open_offline a filename which is filled Return value is pcap_t*
19 with a raw output of dump; If retval less than zero
20 $err is an unfef scalar; then $err filled with
21 an error string.
22
23 dump_open pcap_t*; Return value is a FILE*
24 $err;
25
26 lookupdev $err; Return value is a name
27 of first device which is
28 found by libpcap
29
30 lookupnet a network device; a netnumber;
31 a netnumer is undef; a netmask;
32 a netmask is undef; If retval less than zero
33 $err is undef; then $err filled with
34 an error string.
35
36 dispatch a scalar with pcap_t*; No output parameters.
37 number of packets for proce-
38 ssing;
39 reference to the perl call-
40 back,this callback will be
41 called with 3 parameters:
42 $_[0] is fourth parameter
43 from dispatch,
44 $_[1] is a scalar with struc-
45 ture pcap_pkthdr for a current
46 packet,
47 $_[2] is a scalar with a current
48 packet;
49 fourth parameter could be
50 an array or a hash reference
51 or a pointer (FILE*) returned
52 by dump_open,it can be unre-
53 ferenced in the perl call-
54 back or be used as a perl
55 filehandle in that callback.
56
57 loop As for dispatch. As for dispatch.
58
59 dump As for a perl callback No output.
60 but $_[0] must be a pointer
61 (FILE*) only.
62
63 compile a scalar with pcap_t*; a scalar with bpf_program.
64 a bpf_program is undef; If retval is less than zero
65 a scalar with filter string; then there was a problem with
66 a boolean value (optimize or filter grammar.
67 not);
68 a scalar with netmask;
69
70 setfilter a scalar with pcap_t*; If retval is less than zero
71 a scalar with bpf_program then there was a problem while
72 returned by compile. settting filter.
73
74 next a scalar with pcap_t*; A scalar with next packet;
75 a scalar with with struc- a scalar with with structure
76 ture pcap_pkthdr for a current pcap_pkthdr also will be modi
77 packet,originally is undef. filed for an every packet and
78 it can be accessed but for read
79 only.
80
81 datalink a scalar with pcap_t*; Retval is the link layer type,
82 e.g. DLT_EN10MB.
83
84 snapshot a scalar with pcap_t*; Retval is the snapshot length
85 specified when open_live was
86 called.
87
88 is_swapped a scalar with pcap_t*; returns true if the current
89 savefile uses a different
90 byte order than the current
91 system.
92
93 major_version a scalar with pcap_t*; returns the major number
94 of the version of the pcap
95 used to write the savefile.
96
97 minor_version a scalar with pcap_t*; returns the minor number of the
98 version of the pcap used to
99 write the savefile.
100
101 file a scalar with pcap_t*; returns the name of the
102 savefile.
103
104 stats a scalar with pcap_t*; If retval 0 then a scalar
105 a scalar with structure with structure pcap_stat will
106 pcap_stat,originally undef be filled with the
107 packet statistics.
108
109 fileno a scalar with pcap_t*; returns the file descriptor
110 number of the savefile.
111 A core perl function is
112 available as CORE::fileno.
113
114 geterr a scalar with pcap_t*; returns the error text
115 pertaining to the last pcap
116 library error.
117
118 perror a scalar with pcap_t*; prints the text of the last
119 a scalar with prefix; pcap library error on stderr,
120 prefixed by prefix.
121
122 close a scalar with pcap_t*; closes the files associated with
123 pcap_t* and deallocates
124 resources.
125 A core perl function is
126 available as CORE::close.
127
128 dump_close a scalar with pcap_t*; closes the savefile.
129
131 Sergey Kolychev <ksv@al.lg.ua>
132
134 Net::RawIP(3pm),pcap(3).
135
136
137
138perl v5.12.0 2007-04-03 RawIP::libpcap(3)