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 AE106A0546; Sun, 14 Feb 2021 02:20:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 171211CC344; Sun, 14 Feb 2021 02:20:26 +0100 (CET) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by mails.dpdk.org (Postfix) with ESMTP id 00B58406A2 for ; Sun, 14 Feb 2021 02:20:23 +0100 (CET) Received: by mail-lj1-f179.google.com with SMTP id a22so3619823ljp.10 for ; Sat, 13 Feb 2021 17:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JCP/xJdDb9w+z3R7gHVg8FED4FrJg+/QqtnPYvbR/YU=; b=HcPdYZlzJ9bfXe9RENt9WkeuL6K+AX/LLyJQvfqvCnVYIOwZohMMM1GefIG/H5L6n7 yDr6yoKQqEY+Kkh8cI3A5ns/GlUJSi0NikdPbXbHo+OcWpsraQEA0GE4AUWikl5wD6s4 ykqZciXcwIy2AVSFqL8RWzFExScASeaADx5xN6rRdYbo50vlyuucehurqHdLQMV4uKWV K+JLKzDl+S5A0tnGexhROjL66Yyx1/0NdjBC6uARrilBhHu3ltP1tXHF8gswirviW6E/ lLdzhOWUk61p6xFLd42R4uKzXJ1fNgogs3Uq8Cw/gsAoC6uQe+SecZqMXteYfEywAhwn bMYQ== 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:mime-version :content-transfer-encoding; bh=JCP/xJdDb9w+z3R7gHVg8FED4FrJg+/QqtnPYvbR/YU=; b=RkR3KRCONlgc+MgFzmXWJYr30BDI8X/FrZNxEMp+TUrjutUwAWCZejGAhJj4dVB8RQ RDXY76guqlBQpxmqrE7X1ddSWBb6grC9ZLA92j09DU02034pSxpQ72gjiyEoFNbo7L6x kgnLg6O6gl2rQ2sA5OuG9DDLCEAkf89OLSpscKp4/Wkt+SVyuMbK48h8IUVS5Z9Eo54u vIbtBGxa1YtPp4Q7ghg4iKs6h5coVLKcbJ3rSYmduRAV6H2zqO3cblcos3oToSnWIEy+ 0x7L4V0VLcJbjkLIOdFo64PwxKvfOsbd7lPvQGJfVre6hfFF7nI88teKjbkMeczpfhlB liwA== X-Gm-Message-State: AOAM530GIavOtL7Jrmv7PqViN0Zu18Err7gHCFIsKrcugQBNdy+auFBE OMc0v3o6q8a1x4AuoWfiDmeOCY2lxcogGg== X-Google-Smtp-Source: ABdhPJwRHvC7VK1P3uzUqTaozS0ZK3CO9LDEm5Adxf/KZT4wKXtO+8dljOcKsErvYYFZ6gOysLAYuQ== X-Received: by 2002:a05:651c:1284:: with SMTP id 4mr5623638ljc.279.1613265623286; Sat, 13 Feb 2021 17:20:23 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id h11sm2237648lfd.243.2021.02.13.17.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Feb 2021 17:20:22 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Tyler Retzlaff , Mike Wells , Dmitry Kozlyuk Date: Sun, 14 Feb 2021 04:20:07 +0300 Message-Id: <20210214012013.23165-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 0/6] 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 (https://nmap.org/npcap). It is free (as in "free beer") and open-source, but Npcap redistribution with commercial products may be limited by its license. Npcap can be installed anywhere, so a new Meson option is provided to find it: meson -Dpcap_sdk=C:\Npcap -Dexamples=skeleton build 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" Implementation in "pcap_osdep_windows.c" does some guesswork to convert between variants of an interface name. Microsoft experts and interested users, please take a look and/or give it a try in your environment. There are no release notes for 21.05 yet, will send update after they appear. Dmitry Kozlyuk (6): eal: add internal API for current time net/pcap: fix format string net/pcap: move OS-dependent code to separate files net/pcap: add libpcap wrappers config: discover libpcap on Windows net/pcap: build on Windows config/meson.build | 21 +- drivers/net/pcap/meson.build | 17 +- .../pcap/{rte_eth_pcap.c => pcap_ethdev.c} | 251 ++++++------------ drivers/net/pcap/pcap_osdep.c | 122 +++++++++ drivers/net/pcap/pcap_osdep.h | 72 +++++ 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/librte_eal/include/rte_time.h | 17 ++ lib/librte_eal/rte_eal_exports.def | 1 + lib/librte_eal/unix/eal_unix_timer.c | 13 + lib/librte_eal/version.map | 1 + lib/librte_eal/windows/eal_timer.c | 20 +- meson_options.txt | 6 +- 14 files changed, 584 insertions(+), 176 deletions(-) rename drivers/net/pcap/{rte_eth_pcap.c => pcap_ethdev.c} (88%) create mode 100644 drivers/net/pcap/pcap_osdep.c 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.2