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 ADCF346825; Thu, 29 May 2025 21:31:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A4894021E; Thu, 29 May 2025 21:31:31 +0200 (CEST) Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) by mails.dpdk.org (Postfix) with ESMTP id 3D1F340150 for ; Thu, 29 May 2025 21:31:29 +0200 (CEST) Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-525da75d902so379316e0c.3 for ; Thu, 29 May 2025 12:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1748547088; x=1749151888; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RJxjno0QjAS5cRgSJG5tq8vnwREBeZB1EnRWnE3Y8u8=; b=1eTueDAqIIj3rCUkje38zgwATqooQuFaXeat++I+ayRPBFhFx1LM5EhdwP0joCacwa l7pifIMIrVwelPDN+rt+tHp9ZB8oBzlu+eD02LZKXbYdyyppBkXd+K5UKswiwnpEBCx9 Svbjn0+c9eAiyg78BiD1LnRyXZeV0kYWOXWul6LU9NgnQzbgiWvneUBuT4qsmOhlu4YR +I+f2XoS1pu+MTZ0UQVC4hY+RxoK/njxcgKYkIJxhEFLAVGcJYI7PHwzd5rlHtO/KUma eKDoizBnF+cqA3KfNinZa/RUSijA+trjxQcchLCw5DLZaVGArSirwrDXf3le4NhriKGZ uZ9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748547088; x=1749151888; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RJxjno0QjAS5cRgSJG5tq8vnwREBeZB1EnRWnE3Y8u8=; b=quCuPsJECX+WbX7ORLYNJkKBYF6GxYRtvV6e9z6dXrvFskRImSBvZsD8gs1Xgxr4fu r19bNDbt3sNsrWxPCpLDS43aLYRn53V8JHjHzyS/fzt+p6TIalAzfdFNDk06mEPakuO+ MTLbMIxY+NisbVm44IBUibV5Y6zCpb0YoNlMBbXz9kjSrmblWg1vXlo5W+GYP+olVc7n cqnR7T7jm5TIKSYTDta+iFXKlMrl4mMAw+COBsJD8O36HkxCIYspZrMvTppUsTOFF4la +5q1wujG1Oj+rqHwsUIfeQSeX3VoUaF6JIaFwL6vnqh9YtM50/AXXKN+DlvYL2PFixlc HLWw== X-Forwarded-Encrypted: i=1; AJvYcCUsyWEX6Ksk0PsW3dqsId/yWG/6YPXzuN7rnRDqpyKMqSRz3BpvXNWnuMJyqpNqtlkbPpg=@dpdk.org X-Gm-Message-State: AOJu0YyN8f8zsaILpJsQhNjMhbbMbVdxwz6cc/Nz4jbAk9TUFm9uGMVS QdnxMbIE0wwoThdtXNqq7XimZdPgJl8aZo/dhTgnECVXae2FnINpQV77F7kYq1IYuc0gWA9/TYu WovSa1stqOdVQ+qF+MNHLWEtHsB1j1c0k+0LT9X20tA== X-Gm-Gg: ASbGnctlCalVnlco0awhqbsQnYgHinJvOY53mx52QvQ4s+Oy3Bw7jkUDod2H4xftjW+ BHUfALow+K6LC2LZWTkuP4KNAO7kWuyGS04ovKOYNejBetYZU5p8VWdadWVnESyimmodMCHmDvu ccgqJN+GXKvYdm+dXFdHBZyHujJRtlln0gmrsAZ27dqYiiKBBJzDpl23V5Sb4AlUFonS0= X-Google-Smtp-Source: AGHT+IE8VEmungjFB1ipSFRoXP3ORdqQIqJen4GvZ2W3l6gvOD/MW+33m9xrdZBbhnji7ybz0wkMUZ5emqfgj9JN9jU= X-Received: by 2002:a05:6122:790:b0:52a:7787:53d7 with SMTP id 71dfb90a1353d-5308109f849mr956271e0c.6.1748547088320; Thu, 29 May 2025 12:31:28 -0700 (PDT) MIME-Version: 1.0 References: <20250529171609.2448832-1-schneide@qti.qualcomm.com> In-Reply-To: <20250529171609.2448832-1-schneide@qti.qualcomm.com> From: Stephen Hemminger Date: Thu, 29 May 2025 12:31:17 -0700 X-Gm-Features: AX0GCFvglBc0WbJ8pAC6FPALxEphROVIgdnNKUqG4M7zNpmj0x83oYWnJ-kkNQ0 Message-ID: Subject: Re: [PATCH] pcapng: allow any protocol link type for the interface block To: Schneide Cc: Thomas Monjalon , Reshma Pattan , Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan , dev Content-Type: multipart/alternative; boundary="00000000000012a83a06364b5848" 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 --00000000000012a83a06364b5848 Content-Type: text/plain; charset="UTF-8" What other packet types would a DPDK app use. The possible type fields are quite limited see the spec. Plus it would be an ABI breakage would require versioning. On Thu, May 29, 2025, 10:16 Schneide wrote: > From: Dylan Schneider > > 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 > Cc: stephen@networkplumber.org > --- > > diff --git a/.mailmap b/.mailmap > index d9423aa..7ef0964 100644 > --- a/.mailmap > +++ b/.mailmap > @@ -388,6 +388,7 @@ > Dumitru Ceara > Duncan Bellamy > Dustin Lundquist > +Dylan Schneider > Dzmitry Sautsa > Ed Czeck > Eduard Serra > diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c > index 3d3c0db..e0e2b26 100644 > --- a/app/dumpcap/main.c > +++ b/app/dumpcap/main.c > @@ -800,8 +800,8 @@ 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 8f2cff3..bcf9972 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/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c > index 89525f1..46fab8c 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 16485b2..bed1e14 100644 > --- a/lib/pcapng/rte_pcapng.c > +++ b/lib/pcapng/rte_pcapng.c > @@ -205,7 +205,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) > { > @@ -277,7 +277,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 48f2b57..0a35ec9 100644 > --- a/lib/pcapng/rte_pcapng.h > +++ b/lib/pcapng/rte_pcapng.h > @@ -71,6 +71,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 protocol link type of the packets > * @param ifname (optional) > * Interface name to record in the file. > * If not specified, name will be constructed from port > @@ -84,7 +86,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); > > --00000000000012a83a06364b5848 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
What other packet types would a DPDK app use. The possibl= e type fields are quite limited see the spec.

Plus it would be an ABI breakage would require versioning.<= /div>

On Thu, May 29, 2025, 10:16 Schneide <schneide@qti.qualcomm.com> wro= te:
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
---

diff --git a/.mailmap b/.mailmap
index d9423aa..7ef0964 100644
--- a/.mailmap
+++ b/.mailmap
@@ -388,6 +388,7 @@
=C2=A0Dumitru Ceara <dceara@redhat.com> <dumitru.ceara@gma= il.com>
=C2=A0Duncan Bellamy <dunk@denkimushi.com>
=C2=A0Dustin Lundquist <dustin@null-ptr.net>
+Dylan Schneider <schneide@qti.qualcomm.com>
=C2=A0Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
=C2=A0Ed Czeck <ed.czeck@atomicrules.com>
=C2=A0Eduard Serra <eserra@vmware.com>
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0db..e0e2b26 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,8 +800,8 @@ static dumpcap_out_t create_output(void)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(os);

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TAILQ_FOREACH(intf,= &interfaces, next) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->= ifname,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 intf->ifdescr, intf->opts.filter) = < 0)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (rte_pcapng_add_interface(ret.pcapng, intf->port, DLT_EN10M= B,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0intf->ifname, intf->ifdescr, in= tf->opts.filter) < 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rte_exit(EXIT_FAILURE, "rte_pca= png_add_interface %u failed\n",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 intf->= ;port);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c
index 8f2cff3..bcf9972 100644
--- a/app/test/test_pcapng.c
+++ b/app/test/test_pcapng.c
@@ -345,7 +345,7 @@ test_add_interface(void)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Add interface to the file */
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_add_interface(pcapng, port_i= d,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_add_interface(pcapng, port_i= d, DLT_EN10MB,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NULL, NUL= L, NULL);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret < 0) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &qu= ot;can not add port %u\n", port_id);
@@ -353,7 +353,7 @@ test_add_interface(void)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Add interface with ifname and ifdescr */
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_add_interface(pcapng, port_i= d,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_add_interface(pcapng, port_i= d, DLT_EN10MB,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"mye= th", "Some long description", NULL);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret < 0) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &qu= ot;can not add port %u with ifname\n", port_id);
@@ -361,7 +361,7 @@ test_add_interface(void)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Add interface with filter */
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_add_interface(pcapng, port_i= d,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_add_interface(pcapng, port_i= d, DLT_EN10MB,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NULL, NUL= L, "tcp port 8080");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret < 0) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &qu= ot;can not add port %u with filter\n", port_id);
@@ -406,7 +406,7 @@ test_write_packets(void)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Add interface to the file */
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_add_interface(pcapng, port_i= d,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_add_interface(pcapng, port_i= d, DLT_EN10MB,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NULL, NUL= L, NULL);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret < 0) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &qu= ot;can not add port %u\n", port_id);
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 89525f1..46fab8c 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -117,7 +117,7 @@ graph_pcap_file_open(const char *filename)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Add the configured interfaces as possible ca= pture ports */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 RTE_ETH_FOREACH_DEV(portid) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_= add_interface(pcapng_fd, portid,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_pcapng_= add_interface(pcapng_fd, portid, DLT_EN10MB
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0NULL, NULL, NULL);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret < 0) { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 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 16485b2..bed1e14 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -205,7 +205,7 @@ pcapng_section_block(rte_pcapng_t *self,
=C2=A0/* Write an interface block for a DPDK port */
=C2=A0RTE_EXPORT_SYMBOL(rte_pcapng_add_interface)
=C2=A0int
-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,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0const char *ifname, const char *ifdescr,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0const char *filter)
=C2=A0{
@@ -277,7 +277,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t p= ort,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 hdr =3D (struct pcapng_interface_block *)buf; =C2=A0 =C2=A0 =C2=A0 =C2=A0 *hdr =3D (struct pcapng_interface_block) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .block_type =3D PCA= PNG_INTERFACE_BLOCK,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.link_type =3D 1,= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* DLT_EN10MB - Ethernet */
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.link_type =3D link= _type,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .block_length =3D l= en,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 };

diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 48f2b57..0a35ec9 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -71,6 +71,8 @@ rte_pcapng_close(rte_pcapng_t *self);
=C2=A0 *=C2=A0 The handle to the packet capture file
=C2=A0 * @param port
=C2=A0 *=C2=A0 The Ethernet port to report stats on.
+ * @param link_type
+ *=C2=A0 The protocol link type of the packets
=C2=A0 * @param ifname (optional)
=C2=A0 *=C2=A0 Interface name to record in the file.
=C2=A0 *=C2=A0 If not specified, name will be constructed from port
@@ -84,7 +86,7 @@ rte_pcapng_close(rte_pcapng_t *self);
=C2=A0 * must be added.
=C2=A0 */
=C2=A0int
-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,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0const char *ifname, const char *ifdescr,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0const char *filter);

--00000000000012a83a06364b5848--