Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Commits on Apr 5, 2015
Commits on Feb 25, 2015
  1. Update gitignore

Commits on Feb 23, 2015
  1. Compile on Solaris

    Solaris using DLPI requires the interface is in promiscuous mode.
Commits on Aug 6, 2014
  1. Fix overflow in device name if argument is NULL

    If the device name was an empty binary, a terminating NULL byte would
    be written to[-1].
Commits on May 29, 2014
  1. Bump version for monitor mode

Commits on May 22, 2014
Commits on May 8, 2014
  1. Bump version

  2. Add typespecs

Commits on May 7, 2014
  1. Allow setting the pcap buffer size

    To avoid dropping packets, allow setting the PCAP buffer size.
    reported-by: Андрей Аленин
  2. pcap_stat{} -> ewpcap_stat{}

  3. ewpcap: add stats/1

    Retrieve statistics about packet capture using pcap_stats(3PCAP).
  4. Fix compile error, formatting

  5. ewpcap: return error if open/0,2 fails in lookup

    If open/2 is called with an empty interface and a suitable interface
    can't be found, return the error instead of crashing.
  6. makefile: add dialyzer target

  7. Copyright heartbeat

  8. README cleanup

Commits on Nov 15, 2013
Commits on Apr 8, 2013
  1. Copyright heartbeat

Commits on Apr 7, 2013
  1. Update rebar URL

Commits on Apr 6, 2013
  1. Fix segfault from cleanup

    The pcap handle and NIF environment are freed in the resource cleanup
    handler. When ewpcap_loop exits, it attempts to free the environments
    which may be already freed by the cleanup handler.
  2. Fix segfault from pcap_geterr

    The pcap handle may have been closed by another thread when pcap_loop
    returns. pcap_geterr(3PCAP) will return an invalid pointer causing
    a segfault.
    Also remove the comment in the case statement checking the return
    value of pcap_loop. According to the documentation for pcap_breakloop,
    pcap_loop may return a positive number:
          Note also that, in a multi-threaded application, if one thread
          is blocked in pcap_dispatch(), pcap_loop(), pcap_next(),
          or  pcap_next_ex(), a  call to pcap_breakloop() in a different
          thread will not unblock that thread; you will need to use whatever
          mechanism the OS provides for breaking a thread out of blocking
          calls in order to unblock the thread, such as thread cancellation
          in systems that support POSIX threads.
          pcap_breakloop() does not guarantee that no further packets will
          be processed by pcap_dispatch() or pcap_loop() after it is called;
          at most one more packet might be processed.
Commits on Oct 9, 2012
  1. Fix rebar compilation on Unix

    Other Unix'es like Solaris will need to be added to the pattern match
    in rebar.config.
  2. Zero all the things!

Commits on Sep 13, 2012
  1. Reverse the order of the interfaces

    Return the interfaces in the same order as pcap. Also mimics the order
    returned by inet:getifaddrs.
Commits on Aug 23, 2012
  1. Test for sniffing packets

    Export pcap_lookup().
  2. getifaddrs: add test on Unix

  3. Mention getifaddrs/0

  4. Begin receiving packets upon opening the device

    Simplify the interface by immediately receiving packets when the device
    is opened. By default, all packets are sniffed. A filter can be applied
    when the device is opened or changed later using filter/3.
    Remove the loop/1 function. This also prevents multiple threads being
    spawned to handle the same pcap descriptor.
  5. Change rebar.config and add macros for Windows

    Juraj Hlista authored
    Add a macro to make it possible to compile on Windows. /wd4127 in rebar.config turns off "conditional expression is constant" warnings in MAKE_ADDR macro.
Commits on Aug 22, 2012
  1. Merge pull request #4 from jur0/windows_port

    Windows port
  2. Merge pull request #3 from jur0/windows_howto

    names of network interfaces
  3. Retrieve a list of interfaces

    Add a function to retrieve a list of device names, similar to
    inet:getifaddrs/0, that can be passed to pcap_open_live().
        "There aren't names of network interfaces such as eth0 on
        Windows. Even names of the interfaces that the ipconfig command
        returns don't work with winpcap. The Winpcap uses its own identifiers,
        such as: \Device\NPF_{884C434-0B54-5454-6556-543DCDDFB4343D}."
    reported-by: Juraj Hlista
  4. corrected DWIN32 in rebar.config

    Juraj Hlista authored
  5. attempt to port ewpcap to Windows

    Juraj Hlista authored
Something went wrong with that request. Please try again.