Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

UPDATE: This works for Net::Pcap 0.16 on MSWin32. If using Net::Pcap 0.17, see Re^5: Net::Pcap installation help (and not with the library)


There are bugs in the Net::Pcap code that have not been patched that affect Windows installations. You can see this by looking at the bug report here https://rt.cpan.org/Public/Bug/Display.html?id=53292. Our own Corion fixed it and provided patches.

I've gotten Net::Pcap to build successfully on Windows XP / Strawberry 5.10, 5.12, 5.14 and also Windows 7 x64 / Strawberry 5.14, 5.16. I've used the following process:


References

https://rt.cpan.org/Public/Bug/Display.html?id=53292
http://perlmonks.org/?node_id=894897
http://perlmonks.org/?node_id=896237

--Net::Pcap

  1. Get Net::Pcap from CPAN - download .tar.gz file, not with CPAN client.
  2. Get patches: https://rt.cpan.org/Ticket/Display.html?id=53292
  3. Edit patch files to remove the email headers.
  4. Copy *.patch files into the Net-Pcap directory.
  5. Apply patch files in order (0002, 0003, 0004, 0005) with:
      patch -p1 < FILENAME.patch
    

    NOTE: May have to 'unix2dos' the patch files if they don't work!

--WinPcap

  1. Make sure WinPcap is installed - if not, install it
  2. Unzip WinPcap Developers Pack http://www.winpcap.org/devel.htm in same parent directory Net::Pcap was unzipped in, e.g.,:
      tmp\Net-Pcap-0.16\..
      tmp\WpdPack\..
    
  3. IF on x64 platform, check on the existence of the x64 libraries:
      dir WpdPack\lib\x64\*.a
    
  4. They may not exist. If not, built them:
      pexports \Windows\system32\wpcap.dll > wpcap.def
      dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libwpcap.a --input-def wpcap.def
    
      pexports \Windows\system32\Packet.dll > Packet.def
      dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libpacket.a --input-def Packet.def
    
      move libwpcap.a WpdPack\lib\x64
      move libpacket.a WpdPack\lib\x64
    
  5. Start the build process:
    perl Makefile.PL INC=-IC:/Users/VinsWorldcom/tmp/WpdPack/Include "LI +BS=-LC:/Users/VinsWorldcom/tmp/WpdPack/Lib/x64 -lwpcap" dmake dmake test

Test by creating test.pl:

use Net::Pcap qw(:functions); @devs = pcap_findalldevs(\%devinfo, \$err); for my $dev (@devs) { print "$dev : $devinfo{$dev}\n" }

Run:

perl -Mblib test.pl

If successful output of adapters, install with:

dmake install

In reply to Re: Net::Pcap installation help (and not with the library) by VinsWorldcom
in thread Net::Pcap installation help (and not with the library) by binarygrrl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-18 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found