From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CE939A0547; Wed, 21 Apr 2021 21:34:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 576F740687; Wed, 21 Apr 2021 21:34:02 +0200 (CEST) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mails.dpdk.org (Postfix) with ESMTP id 4D45E40150 for ; Wed, 21 Apr 2021 21:34:01 +0200 (CEST) Received: by mail-lj1-f176.google.com with SMTP id z8so49014168ljm.12 for ; Wed, 21 Apr 2021 12:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DkiMNKRjoq/swg/omussptHmMMSniQ7yEnZ16imc0vY=; b=U3jL9ieefnM08rftpxvzLdTN1TTONwdAT/l1GdVMbi52WsF6BQrMAOnRvuA4fFbYq9 ahfggmzITY4iXHV+cAVfDWvk7PtKTKO642ST9D11jDZQbM7RI9HXvBve3tTh+22uz4GW RwFiNV3kEtrmyRqR8Au/eL8fuH+HTa7dhyG0CK7VIWTYkBwfnHkgMpoK1Jc1McFmPWZk OM/jDDL51p2hxAQyySArUOHdjjh5gOjPIutSYoOwooftBZkKzGW7dJJD/unXuRz+2+n5 em3wmIrv7gAcsB68PyeuOFL7NtttCbfuD0n1RtlP+a9bJGQiCZLUNw1+UdT/hgzO6n5l vuEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DkiMNKRjoq/swg/omussptHmMMSniQ7yEnZ16imc0vY=; b=RRbRwgDxrSspxcx4jD+BNGJf6Pi8QRFR5jtXjWvsTYLe5YxMHqdJ9QVnFj2f0Mb3eR cy/zXhEB86huNWQGI9ShYtYQpELIUorMj2wI2foBDw9LwWH2K3crWK8dy9nWtybsXwOl 0p43930svZTUuuUbnE56OpEgMrTYrkyORkiyfzGKhXpxX8rJA5Fi+OUdPTe2HzqUIC04 oUPQn1fhvaO96TomJubLd30wUOT79epsXT1BguOaj/vML2xKrF5ByBUGXzHOrBmOOURO ImBc2vtkGFMfIWASpweYFrSDSDazJ/KRAWLY/X99zOr4wYm5INNAZ9dI6tNsoJH0WP1D xNaQ== X-Gm-Message-State: AOAM533DT/KathcAHbEs3DohR/z0wMg+Bu9MOI1ESg3dyW3sePES7uey 6m9EPj8zHgjNW9+VQXtlcFfGO7EiL1j02w== X-Google-Smtp-Source: ABdhPJwIau5Sp5NtmzmbryYPrP19KwvcMaElllnE4QzSk3yXqdsY/DHIhUrynDHHjJ7rxE7i22n9wg== X-Received: by 2002:a2e:bc24:: with SMTP id b36mr10499985ljf.91.1619033640459; Wed, 21 Apr 2021 12:34:00 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id p11sm47588lfg.126.2021.04.21.12.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Apr 2021 12:33:59 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk Date: Wed, 21 Apr 2021 22:33:48 +0300 Message-Id: <20210421193351.1909-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20210415221055.1575-1-dmitry.kozliuk@gmail.com> References: <20210415221055.1575-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v5 0/3] net/pcap: build on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 -- 2.29.3