NAME
Net::RawIP::libpcap - An interface to libpcap in Net::RawIP(3pm)
DESCRIPTION
Function The input parameters The output parametersopen_live a network Return value is a pcap_t*device(eth0,ppp0,...); If retval less than zeroa snap length; then $err filled witha promisc - boolean; an error string.a timeout in sec;$err is an undef scalar;open_offline a filename which is filled Return value is pcap_t*with a raw output of dump; If retval less than zero$err is an unfef scalar; then $err filled withan error string.dump_open pcap_t*; Return value is a FILE*$err;lookupdev $err; Return value is a nameof first device which isfound by libpcaplookupnet a network device; a netnumber;a netnumer is undef; a netmask;a netmask is undef; If retval less than zero$err is undef; then $err filled withan error string.dispatch a scalar with pcap_t*; No output parameters.number of packets for proce-ssing;reference to the perl call-back,this callback will becalled with 3 parameters:$_[0] is fourth parameterfrom dispatch,$_[1] is a scalar with struc-ture pcap_pkthdr for a currentpacket,$_[2] is a scalar with a currentpacket;fourth parameter could bean array or a hash referenceor a pointer (FILE*) returnedby dump_open,it can be unre-ferenced in the perl call-back or be used as a perlfilehandle in that callback.loop As for dispatch. As for dispatch.dump As for a perl callback No output.but $_[0] must be a pointer(FILE*) only.compile a scalar with pcap_t*; a scalar with bpf_program.a bpf_program is undef; If retval is less than zeroa scalar with filter string; then there was a problem witha boolean value (optimize or filter grammar.not);a scalar with netmask;setfilter a scalar with pcap_t*; If retval is less than zeroa scalar with bpf_program then there was a problem whilereturned by compile. settting filter.next a scalar with pcap_t*; A scalar with next packet;a scalar with with struc- a scalar with with structureture pcap_pkthdr for a current pcap_pkthdr also will be modipacket,originally is undef. filed for an every packet andit can be accessed but for readonly.datalink a scalar with pcap_t*; Retval is the link layer type,e.g. DLT_EN10MB.snapshot a scalar with pcap_t*; Retval is the snapshot lengthspecified when open_live wascalled.is_swapped a scalar with pcap_t*; returns true if the currentsavefile uses a differentbyte order than the currentsystem.major_version a scalar with pcap_t*; returns the major numberof the version of the pcapused to write the savefile.minor_version a scalar with pcap_t*; returns the minor number of theversion of the pcap used towrite the savefile.file a scalar with pcap_t*; returns the name of thesavefile.stats a scalar with pcap_t*; If retval 0 then a scalara scalar with structure with structure pcap_stat willpcap_stat,originally undef be filled with thepacket statistics.fileno a scalar with pcap_t*; returns the file descriptornumber of the savefile.A core perl function isavailable as CORE::fileno.geterr a scalar with pcap_t*; returns the error textpertaining to the last pcaplibrary error.perror a scalar with pcap_t*; prints the text of the lasta scalar with prefix; pcap library error on stderr,prefixed by prefix.close a scalar with pcap_t*; closes the files associated withpcap_t* and deallocatesresources.A core perl function isavailable as CORE::close.dump_close a scalar with pcap_t*; closes the savefile.
AUTHOR
Sergey Kolychev <[email protected]>