* [PATCH v1] pcapng: allow any protocol link type for the interface block
@ 2025-08-27 15:38 Schneide
2025-08-27 16:06 ` Stephen Hemminger
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Schneide @ 2025-08-27 15:38 UTC (permalink / raw)
To: dev, Thomas Monjalon, Reshma Pattan, Stephen Hemminger,
Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
Cc: Dylan Schneider
From: Dylan Schneider <schneide@qti.qualcomm.com>
Allow the user to specify protocol link type when creating pcapng files.
This change is needed to specify the protocol type in the pcapng file,
DLT_EN10MB specifies ethernet packets only. This will allow dissectors
for other protocols to be used on files generated by pcapng.
Includes a breaking change to rte_pcapng_add_interface to add link_type
parameter. Existing calls to the function have been updated to pass
DLT_EN10MB for the link type argument.
Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: stephen@networkplumber.org
---
.mailmap | 1 +
app/dumpcap/main.c | 5 +++--
app/test/test_pcapng.c | 8 ++++----
doc/guides/rel_notes/release_25_11.rst | 4 ++++
lib/graph/graph_pcap.c | 2 +-
lib/pcapng/meson.build | 2 ++
lib/pcapng/rte_pcapng.c | 21 +++++++++++++++------
lib/pcapng/rte_pcapng.h | 7 ++++++-
8 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/.mailmap b/.mailmap
index 34a99f93a1..1a003778b2 100644
--- a/.mailmap
+++ b/.mailmap
@@ -402,6 +402,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
Duncan Bellamy <dunk@denkimushi.com>
Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Ed Czeck <ed.czeck@atomicrules.com>
Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0dbc66..e5ba36350b 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,9 @@ static dumpcap_out_t create_output(void)
free(os);
TAILQ_FOREACH(intf, &interfaces, next) {
- if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
- intf->ifdescr, intf->opts.filter) < 0)
+ if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
+ intf->ifname, intf->ifdescr,
+ intf->opts.filter) < 0)
rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
intf->port);
}
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff36c3..bcf99724fa 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
}
/* Add interface with ifname and ifdescr */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
"myeth", "Some long description", NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
}
/* Add interface with filter */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, "tcp port 8080");
if (ret < 0) {
fprintf(stderr, "can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
diff --git a/doc/guides/rel_notes/release_25_11.rst b/doc/guides/rel_notes/release_25_11.rst
index ccad6d89ff..b1f75a489c 100644
--- a/doc/guides/rel_notes/release_25_11.rst
+++ b/doc/guides/rel_notes/release_25_11.rst
@@ -84,6 +84,10 @@ API Changes
Also, make sure to start the actual text at the margin.
=======================================================
+* pcapng: Changed the API for adding interfaces to include a link type argument.
+ The link type was previously hardcoded to the ethernet link type in the API.
+ This argument is added to ``rte_pcapng_add_interface``.
+ These functions are versioned to retain binary compatibility until the next LTS release.
ABI Changes
-----------
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1220..08dcda0d28 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -117,7 +117,7 @@ graph_pcap_file_open(const char *filename)
/* Add the configured interfaces as possible capture ports */
RTE_ETH_FOREACH_DEV(portid) {
- ret = rte_pcapng_add_interface(pcapng_fd, portid,
+ ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build
index 4549925d41..3aa7ba5155 100644
--- a/lib/pcapng/meson.build
+++ b/lib/pcapng/meson.build
@@ -5,3 +5,5 @@ sources = files('rte_pcapng.c')
headers = files('rte_pcapng.h')
deps += ['ethdev']
+
+use_function_versioning = true
diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index 2a07b4c1f5..1ff8d14d08 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -200,11 +200,10 @@ pcapng_section_block(rte_pcapng_t *self,
}
/* Write an interface block for a DPDK port */
-RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
-int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
- const char *ifname, const char *ifdescr,
- const char *filter)
+RTE_DEFAULT_SYMBOL(27, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
{
struct pcapng_interface_block *hdr;
struct rte_eth_dev_info dev_info;
@@ -274,7 +273,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
hdr = (struct pcapng_interface_block *)buf;
*hdr = (struct pcapng_interface_block) {
.block_type = PCAPNG_INTERFACE_BLOCK,
- .link_type = 1, /* DLT_EN10MB - Ethernet */
+ .link_type = link_type,
.block_length = len,
};
@@ -319,6 +318,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
return write(self->outfd, buf, len);
}
+RTE_VERSION_SYMBOL(26, int, rte_pcapng_add_interface,
+ (rte_pcapng_t *self, uint16_t port,
+ const char *ifname, const char *ifdescr,
+ const char *filter))
+{
+ /* Call the new version with a default link_type (Ethernet) */
+ return rte_pcapng_add_interface(self, port, DLT_EN10MB,
+ ifname, ifdescr, filter);
+}
+
/*
* Write an Interface statistics block at the end of capture.
*/
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57564..1b3f9b9464 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -28,6 +28,9 @@
extern "C" {
#endif
+/* default link type for ethernet traffic */
+#define DLT_EN10MB 1
+
/* Opaque handle used for functions in this library. */
typedef struct rte_pcapng rte_pcapng_t;
@@ -71,6 +74,8 @@ rte_pcapng_close(rte_pcapng_t *self);
* The handle to the packet capture file
* @param port
* The Ethernet port to report stats on.
+ * @param link_type
+ * The link type (e.g., DLT_EN10MB).
* @param ifname (optional)
* Interface name to record in the file.
* If not specified, name will be constructed from port
@@ -84,7 +89,7 @@ rte_pcapng_close(rte_pcapng_t *self);
* must be added.
*/
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter);
--
2.27.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] pcapng: allow any protocol link type for the interface block
2025-08-27 15:38 [PATCH v1] pcapng: allow any protocol link type for the interface block Schneide
@ 2025-08-27 16:06 ` Stephen Hemminger
2025-08-27 17:21 ` Stephen Hemminger
2025-08-27 22:32 ` [PATCH v2] " Schneide
2 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2025-08-27 16:06 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Wed, 27 Aug 2025 09:38:52 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> +use_function_versioning = true
> diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
> index 2a07b4c1f5..1ff8d14d08 100644
> --- a/lib/pcapng/rte_pcapng.c
> +++ b/lib/pcapng/rte_pcapng.c
> @@ -200,11 +200,10 @@ pcapng_section_block(rte_pcapng_t *self,
> }
>
> /* Write an interface block for a DPDK port */
> -RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
> -int
> -rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> - const char *ifname, const char *ifdescr,
> - const char *filter)
> +RTE_DEFAULT_SYMBOL(27, int, rte_pcapng_add_interface,
> + (rte_pcapng_t *self, uint16_t port, uint16_t link_type,
> + const char *ifname, const char *ifdescr,
> + const char *filter))
> {
> struct pcapng_interface_block *hdr;
> struct rte_eth_dev_info dev_info;
> @@ -274,7 +273,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> hdr = (struct pcapng_interface_block *)buf;
> *hdr = (struct pcapng_interface_block) {
> .block_type = PCAPNG_INTERFACE_BLOCK,
> - .link_type = 1, /* DLT_EN10MB - Ethernet */
> + .link_type = link_type,
> .block_length = len,
> };
>
> @@ -319,6 +318,16 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
> return write(self->outfd, buf, len);
> }
>
> +RTE_VERSION_SYMBOL(26, int, rte_pcapng_add_interface,
> + (rte_pcapng_t *self, uint16_t port,
> + const char *ifname, const char *ifdescr,
> + const char *filter))
> +{
> + /* Call the new version with a default link_type (Ethernet) */
> + return rte_pcapng_add_interface(self, port, DLT_EN10MB,
> + ifname, ifdescr, filter);
> +}
> +
No symbol versioning needed for 25.11 release since it is major release.
The release note is enough.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] pcapng: allow any protocol link type for the interface block
2025-08-27 15:38 [PATCH v1] pcapng: allow any protocol link type for the interface block Schneide
2025-08-27 16:06 ` Stephen Hemminger
@ 2025-08-27 17:21 ` Stephen Hemminger
2025-08-27 22:32 ` [PATCH v2] " Schneide
2 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2025-08-27 17:21 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Wed, 27 Aug 2025 09:38:52 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
> index 48f2b57564..1b3f9b9464 100644
> --- a/lib/pcapng/rte_pcapng.h
> +++ b/lib/pcapng/rte_pcapng.h
> @@ -28,6 +28,9 @@
> extern "C" {
> #endif
>
> +/* default link type for ethernet traffic */
> +#define DLT_EN10MB 1
> +
>
It would be good idea to guard this definition with #ifdef so
that if user includes pcap.h first, there is not conflict.
#ifndef DLT_EN10MB
#define DLT_EN10MB 1 /* Ethernet (10Mb) */
#endif
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-08-27 15:38 [PATCH v1] pcapng: allow any protocol link type for the interface block Schneide
2025-08-27 16:06 ` Stephen Hemminger
2025-08-27 17:21 ` Stephen Hemminger
@ 2025-08-27 22:32 ` Schneide
2025-09-25 23:54 ` Stephen Hemminger
2025-09-26 0:04 ` Stephen Hemminger
2 siblings, 2 replies; 6+ messages in thread
From: Schneide @ 2025-08-27 22:32 UTC (permalink / raw)
To: dev, Thomas Monjalon, Reshma Pattan, Stephen Hemminger,
Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan
Cc: Dylan Schneider
From: Dylan Schneider <schneide@qti.qualcomm.com>
Allow the user to specify protocol link type when creating pcapng files.
This change is needed to specify the protocol type in the pcapng file,
DLT_EN10MB specifies ethernet packets only. This will allow dissectors
for other protocols to be used on files generated by pcapng.
Includes a breaking change to rte_pcapng_add_interface to add link_type
parameter. Existing calls to the function have been updated to pass
DLT_EN10MB for the link type argument.
Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
Cc: stephen@networkplumber.org
---
v2:
* Remove function versioning
* Define DLT_EN10MB macro only if it has not been defined
.mailmap | 1 +
app/dumpcap/main.c | 5 +++--
app/test/test_pcapng.c | 8 ++++----
doc/guides/rel_notes/release_25_11.rst | 4 ++++
lib/graph/graph_pcap.c | 2 +-
lib/pcapng/rte_pcapng.c | 4 ++--
lib/pcapng/rte_pcapng.h | 10 +++++++++-
7 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/.mailmap b/.mailmap
index 34a99f93a1..1a003778b2 100644
--- a/.mailmap
+++ b/.mailmap
@@ -402,6 +402,7 @@ Dukai Yuan <dukaix.yuan@intel.com>
Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gmail.com>
Duncan Bellamy <dunk@denkimushi.com>
Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Ed Czeck <ed.czeck@atomicrules.com>
Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0dbc66..e5ba36350b 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,9 @@ static dumpcap_out_t create_output(void)
free(os);
TAILQ_FOREACH(intf, &interfaces, next) {
- if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
- intf->ifdescr, intf->opts.filter) < 0)
+ if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10MB,
+ intf->ifname, intf->ifdescr,
+ intf->opts.filter) < 0)
rte_exit(EXIT_FAILURE, "rte_pcapng_add_interface %u failed\n",
intf->port);
}
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff36c3..bcf99724fa 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
}
/* Add interface with ifname and ifdescr */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
"myeth", "Some long description", NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
}
/* Add interface with filter */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, "tcp port 8080");
if (ret < 0) {
fprintf(stderr, "can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
}
/* Add interface to the file */
- ret = rte_pcapng_add_interface(pcapng, port_id,
+ ret = rte_pcapng_add_interface(pcapng, port_id, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "can not add port %u\n", port_id);
diff --git a/doc/guides/rel_notes/release_25_11.rst b/doc/guides/rel_notes/release_25_11.rst
index ccad6d89ff..b1f75a489c 100644
--- a/doc/guides/rel_notes/release_25_11.rst
+++ b/doc/guides/rel_notes/release_25_11.rst
@@ -84,6 +84,10 @@ API Changes
Also, make sure to start the actual text at the margin.
=======================================================
+* pcapng: Changed the API for adding interfaces to include a link type argument.
+ The link type was previously hardcoded to the ethernet link type in the API.
+ This argument is added to ``rte_pcapng_add_interface``.
+ These functions are versioned to retain binary compatibility until the next LTS release.
ABI Changes
-----------
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1220..08dcda0d28 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -117,7 +117,7 @@ graph_pcap_file_open(const char *filename)
/* Add the configured interfaces as possible capture ports */
RTE_ETH_FOREACH_DEV(portid) {
- ret = rte_pcapng_add_interface(pcapng_fd, portid,
+ ret = rte_pcapng_add_interface(pcapng_fd, portid, DLT_EN10MB,
NULL, NULL, NULL);
if (ret < 0) {
graph_err("Graph rte_pcapng_add_interface port %u failed: %d",
diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index 2a07b4c1f5..21bc94cea1 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -202,7 +202,7 @@ pcapng_section_block(rte_pcapng_t *self,
/* Write an interface block for a DPDK port */
RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter)
{
@@ -274,7 +274,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
hdr = (struct pcapng_interface_block *)buf;
*hdr = (struct pcapng_interface_block) {
.block_type = PCAPNG_INTERFACE_BLOCK,
- .link_type = 1, /* DLT_EN10MB - Ethernet */
+ .link_type = link_type,
.block_length = len,
};
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57564..c51c63fccf 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -28,6 +28,12 @@
extern "C" {
#endif
+
+/* default link type for ethernet traffic */
+#ifndef DLT_EN10MB
+#define DLT_EN10MB 1
+#endif
+
/* Opaque handle used for functions in this library. */
typedef struct rte_pcapng rte_pcapng_t;
@@ -71,6 +77,8 @@ rte_pcapng_close(rte_pcapng_t *self);
* The handle to the packet capture file
* @param port
* The Ethernet port to report stats on.
+ * @param link_type
+ * The link type (e.g., DLT_EN10MB).
* @param ifname (optional)
* Interface name to record in the file.
* If not specified, name will be constructed from port
@@ -84,7 +92,7 @@ rte_pcapng_close(rte_pcapng_t *self);
* must be added.
*/
int
-rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port,
+rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, uint16_t link_type,
const char *ifname, const char *ifdescr,
const char *filter);
--
2.27.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-08-27 22:32 ` [PATCH v2] " Schneide
@ 2025-09-25 23:54 ` Stephen Hemminger
2025-09-26 0:04 ` Stephen Hemminger
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2025-09-25 23:54 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Wed, 27 Aug 2025 16:32:15 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
> From: Dylan Schneider <schneide@qti.qualcomm.com>
>
> Allow the user to specify protocol link type when creating pcapng files.
> This change is needed to specify the protocol type in the pcapng file,
> DLT_EN10MB specifies ethernet packets only. This will allow dissectors
> for other protocols to be used on files generated by pcapng.
>
> Includes a breaking change to rte_pcapng_add_interface to add link_type
> parameter. Existing calls to the function have been updated to pass
> DLT_EN10MB for the link type argument.
>
> Fixes: d1da6d0d04c7 ("pcapng: require per-interface information")
> Signed-off-by: Dylan Schneider <schneide@qti.qualcomm.com>
> Cc: stephen@networkplumber.org
> ---
> v2:
> * Remove function versioning
> * Define DLT_EN10MB macro only if it has not been defined
>
> .mailmap | 1 +
> app/dumpcap/main.c | 5 +++--
> app/test/test_pcapng.c | 8 ++++----
> doc/guides/rel_notes/release_25_11.rst | 4 ++++
> lib/graph/graph_pcap.c | 2 +-
> lib/pcapng/rte_pcapng.c | 4 ++--
> lib/pcapng/rte_pcapng.h | 10 +++++++++-
> 7 files changed, 24 insertions(+), 10 deletions(-)
Acked-by: Stephen Hemminger <stephen@networplumber.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pcapng: allow any protocol link type for the interface block
2025-08-27 22:32 ` [PATCH v2] " Schneide
2025-09-25 23:54 ` Stephen Hemminger
@ 2025-09-26 0:04 ` Stephen Hemminger
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2025-09-26 0:04 UTC (permalink / raw)
To: Schneide
Cc: dev, Thomas Monjalon, Reshma Pattan, Jerin Jacob, Kiran Kumar K,
Nithin Dabilpuram, Zhirun Yan
On Wed, 27 Aug 2025 16:32:15 -0600
Schneide <schneide@qti.qualcomm.com> wrote:
>
> +* pcapng: Changed the API for adding interfaces to include a link type argument.
> + The link type was previously hardcoded to the ethernet link type in the API.
> + This argument is added to ``rte_pcapng_add_interface``.
> + These functions are versioned to retain binary compatibility until the next LTS release.
Since link connector is now merged, and that wording might overlap and
be confusing. Would be could to add reference to pcap-linktype.7 man
page.
Also, google search showed a related draft RFC.
https://datatracker.ietf.org/doc/draft-ietf-opsawg-pcaplinktype/
In that RFC, the defines are LINKTYPE_XXX maybe that would be better
and break the dependency on libpcap for values. That means values will
come from IANA in future.
The enum (thanks to ChatGPT) for RFC draft would be:
typedef enum pcap_linktype {
LINKTYPE_NULL = 0, /* BSD loopback encapsulation */
LINKTYPE_ETHERNET = 1, /* IEEE 802.3 Ethernet */
LINKTYPE_EXP_ETHERNET = 2, /* Xerox experimental 3Mb Ethernet */
LINKTYPE_AX25 = 3, /* AX.25 layer 2 packets */
LINKTYPE_PRONET = 4, /* Proteon PRONet Token Ring (reserved) */
LINKTYPE_CHAOS = 5, /* MIT Chaosnet (reserved) */
LINKTYPE_IEEE802_5 = 6, /* IEEE 802.5 Token Ring */
LINKTYPE_ARCNET_BSD = 7, /* ARCNET with BSD encapsulation */
LINKTYPE_SLIP = 8, /* SLIP, with a direction header */
LINKTYPE_PPP = 9, /* PPP */
LINKTYPE_FDDI = 10, /* FDDI (ANSI INCITS 239-1994) */
/* 11–49: not available for assignment (reserved) */
LINKTYPE_PPP_HDLC = 50, /* PPP in HDLC-like framing */
LINKTYPE_PPP_ETHER = 51, /* PPPoE session packets */
/* 52–98: not available for assignment */
LINKTYPE_SYMANTEC_FIREWALL = 99, /* Reserved for Symantec Enterprise Firewall */
LINKTYPE_ATM_RFC1483 = 100, /* LLC/SNAP-encapsulated ATM */
LINKTYPE_RAW = 101, /* Raw IP (starts with IP header) */
LINKTYPE_SLIP_BSDOS = 102, /* BSD/OS SLIP BPF header (reserved) */
LINKTYPE_PPP_BSDOS = 103, /* BSD/OS PPP BPF header (reserved) */
LINKTYPE_C_HDLC = 104, /* Cisco PPP with HDLC framing */
LINKTYPE_IEEE802_11 = 105, /* IEEE 802.11 wireless LAN */
LINKTYPE_ATM_CLIP = 106, /* Classical IP, no header before IP */
LINKTYPE_FRELAY = 107, /* Frame Relay LAPF */
LINKTYPE_LOOP = 108, /* OpenBSD loopback encapsulation */
LINKTYPE_ENC = 109, /* OpenBSD IPsec encapsulation (reserved) */
LINKTYPE_LANE8023 = 110, /* ATM LANE + 802.3 (reserved) */
LINKTYPE_HIPPI = 111, /* NetBSD HIPPI (reserved) */
LINKTYPE_HDLC = 112, /* NetBSD HDLC framing (reserved) */
LINKTYPE_LINUX_SLL = 113, /* Linux “cooked” capture encapsulation */
LINKTYPE_LTALK = 114, /* Apple LocalTalk */
LINKTYPE_ECONET = 115, /* Acorn Econet (reserved) */
LINKTYPE_IPFILTER = 116, /* OpenBSD ipfilter (reserved) */
LINKTYPE_PFLOG = 117, /* PF logging (reserved) */
LINKTYPE_CISCO_IOS = 118, /* Cisco internal use (reserved) */
LINKTYPE_IEEE802_11_PRISM = 119, /* 802.11 + Prism monitor header */
LINKTYPE_IEEE802_11_AIRONET = 120, /* 802.11 + Aironet metadata (reserved) */
LINKTYPE_HHDLC = 121, /* Siemens HiPath HDLC (reserved) */
LINKTYPE_IP_OVER_FC = 122, /* IP and ATM over Fibre Channel */
LINKTYPE_SUNATM = 123, /* ATM from SunATM */
LINKTYPE_RIO = 124, /* RapidIO (reserved) */
LINKTYPE_PCI_EXP = 125, /* PCI Express (reserved) */
LINKTYPE_AURORA = 126, /* Xilinx Aurora link (reserved) */
LINKTYPE_IEEE802_11_RADIOTAP = 127, /* 802.11 + Radiotap header */
LINKTYPE_TZSP = 128, /* Tazmen Sniffer Protocol (reserved) */
LINKTYPE_ARCNET_LINUX = 129, /* ARCNET, Linux encapsulation */
LINKTYPE_JUNIPER_MLPPP = 130,
LINKTYPE_JUNIPER_MLFR = 131,
LINKTYPE_JUNIPER_ES = 132,
LINKTYPE_JUNIPER_GGSN = 133,
LINKTYPE_JUNIPER_MFR = 134,
LINKTYPE_JUNIPER_ATM2 = 135,
/* … and so on, up to LINKTYPE_DECT_NR = 301 in the initial set … */
LINKTYPE_DOCSIS = 143, /* DOCSIS MAC frames */
LINKTYPE_LINUX_IRDA = 144,
LINKTYPE_IBM_SP = 145,
LINKTYPE_IBM_SN = 146,
LINKTYPE_RESERVED_01 = 147, /* deprecated private use */
LINKTYPE_RESERVED_02 = 148,
LINKTYPE_RESERVED_03 = 149,
/* ... through LINKTYPE_RESERVED_15 (i.e. up to 162) ... */
LINKTYPE_ZWAVE_TAP = 297,
LINKTYPE_SILABS_DEBUG_CHANNEL = 298,
LINKTYPE_FIRA_UCI = 299,
LINKTYPE_MDB = 300,
LINKTYPE_DECT_NR = 301,
/* Experimental / Private-Use range begins at 65001..65535 */
} LinkType;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-09-26 0:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-27 15:38 [PATCH v1] pcapng: allow any protocol link type for the interface block Schneide
2025-08-27 16:06 ` Stephen Hemminger
2025-08-27 17:21 ` Stephen Hemminger
2025-08-27 22:32 ` [PATCH v2] " Schneide
2025-09-25 23:54 ` Stephen Hemminger
2025-09-26 0:04 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).