Skip to content

net/pcap: build on Windows

Dmitry Kozlyuk dpdk-dev 5 versions – Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 1 replyApplied
  2. v43 patches 5 repliesSuperseded
  3. v33 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v26 patches29 repliesApplied
v16 patches3 repliesSuperseded

Changes in v5 from the cover letter

* Add timespec_get() shim for FreeBSD < 12.2 (CI, Thomas).

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/3eal: add timespec_get shimlib/eal/freebsd/include/rte_os_shim.h lib/eal/windows/include/rte_os_shim.h+49 -00 replies
2/3net/pcap: move OS-dependent code to separate filesdrivers/net/pcap/meson.build drivers/net/pcap/pcap_ethdev.c drivers/net/pcap/pcap_osdep.h +2 more+136 -870 replies
3/3net/pcap: build on Windowsconfig/meson.build doc/guides/rel_notes/release_21_05.rst drivers/net/pcap/meson.build +3 more+138 -140 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJie ZhouNick ConnollyFerruh YigitTyler Retzlaff
1/3A-b A-b
2/3R-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v5 thread

Cover letter [dpdk-dev] [PATCH v5 0/3] net/pcap: build on Windows

Most modern and actively maintained distribution of libpcap for Windows is Npcap [1]. It currently doesn't provide a pkg-config file [2]. By default it is installed to C:\Program Files\Npcap and can be located using standard environment variables [3]:

    $env:C_INCLUDE_PATH += ";C:\Program Files\Npcap"
    $env:LIBRARY_PATH += ";C:\Program Files\Npcap\Lib\x64"     # MinGW
    $env:LINK += ' /LIBPATH:"C:\Program Files\Npcap\Lib\x64"'  # Clang

The following libpcap.pc also works if placed in PKG_CONFIG_PATH:

    prefix="C:/Program Files/Npcap"
    Name: libpcap
    Version: 1.10
    Description: Platform-independent network traffic capture library
    Cflags: -I${prefix}/Include
    Libs: -L${prefix}/Lib/x64 -lwpcap

Example of collecting packets from an interface to a file:

    .\build\examples\dpdk-skeleton.exe `
        --vdev "eth_pcap0,iface=\Device\NPF_{DDD48985-A77C-4FC9-AF48-61E547C8797E}" `
        --vdev "eth_pcap1,tx_pcap=capture.pcap"

Interface name can be obtained as follows, with Wireshark installed:

& "C:\Program Files\Wireshark\tshark.exe" -D

[1]: https://nmap.org/npcap
[2]: https://github.com/nmap/npcap/issues/299
[3]: https://mesonbuild.com/Reference-manual.html#compiler-object

v5:
* Add timespec_get() shim for FreeBSD < 12.2 (CI, Thomas).

Dmitry Kozlyuk (3):
eal: add timespec_get shim
net/pcap: move OS-dependent code to separate files net/pcap: build on Windows

 config/meson.build                            |   9 +-
 doc/guides/rel_notes/release_21_05.rst        |   4 +
 drivers/net/pcap/meson.build                  |  16 +--
 .../pcap/{rte_eth_pcap.c => pcap_ethdev.c}    | 109 +++-------------
 drivers/net/pcap/pcap_osdep.h                 |  18 +++
 drivers/net/pcap/pcap_osdep_freebsd.c         |  59 +++++++++
 drivers/net/pcap/pcap_osdep_linux.c           |  42 +++++++
 drivers/net/pcap/pcap_osdep_windows.c         | 118 ++++++++++++++++++
 lib/eal/freebsd/include/rte_os_shim.h         |  17 +++
 lib/eal/windows/include/rte_os_shim.h         |  32 +++++
 10 files changed, 323 insertions(+), 101 deletions(-)
 rename drivers/net/pcap/{rte_eth_pcap.c => pcap_ethdev.c} (95%)
 create mode 100644 drivers/net/pcap/pcap_osdep.h
 create mode 100644 drivers/net/pcap/pcap_osdep_freebsd.c
 create mode 100644 drivers/net/pcap/pcap_osdep_linux.c
 create mode 100644 drivers/net/pcap/pcap_osdep_windows.c
Signature · 1 line
2.29.3