Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Comment on

( #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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (14)
    As of 2014-12-18 12:50 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (51 votes), past polls