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 8810C46825; Thu, 29 May 2025 21:57:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1076E4021E; Thu, 29 May 2025 21:57:42 +0200 (CEST) Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) by mails.dpdk.org (Postfix) with ESMTP id 1B7BB40150 for ; Thu, 29 May 2025 21:57:41 +0200 (CEST) Received: by mail-vk1-f181.google.com with SMTP id 71dfb90a1353d-5290be1aedcso1461136e0c.1 for ; Thu, 29 May 2025 12:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1748548660; x=1749153460; 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=+NcfN5QI1zAQrCBUYj7vFsr6D/kM+MAxTlYq9Nt7cQ0=; b=T9P4IG3jAOo1Q4ghgghh3Fx2LtNdl34vtwGok/DF3lQjPuhaknAvFGG6XXEUYUJwkV 7ZQ3JpPEGNoCzC/9OJ2kOI1ELocfN37OCw/5zIrlKIc5yKkpQld2fiI5gNH3TDrv05hz PAJ+1LNr6yo95LKeUTOtVp3BeHTyxfPwJmp0qFuwOPuz7juqTfet7KwApSx/hSJMEXMR ewoUC8jLN0kqvPyFmBVwdQiKlNifkqYEmgyvr8qOtrk+vLrQVjwfNrRDOF51yDpwNtCe u7a/sBz9+dTiLQ6feRICkZwFh6yr+NX9bUmxeW509BkXJSSi0qSld4Gox11Q3Ukk61Mj XHKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748548660; x=1749153460; 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=+NcfN5QI1zAQrCBUYj7vFsr6D/kM+MAxTlYq9Nt7cQ0=; b=qk+Qj0ajouW5POpgVFA8X4OMQq/m0DDK6jzxPPYmb0wKvYu+Ym3Q6TeROX4DR9tnGP TftCm2qS2zWHA7ttTMW1wv9KrFQwF/r57/7AAH/AGs9dBSxpvFc2Nmg5sjhLsHRVO80/ k+JcFBNKqeEh+6OF3J2L6X8kfNMoZNPj+awB1NiCGL9Raba4GupUBGWpNjWbzXeskv3r bzp9sjUTaVIgld6/q/230ruhVk0DX9Zjkby055sZ1DIEIJIy/RUJj1elm+3s1Hft5Ndv dtoOsJO8RmZ5wo9Os/m18axUUjnJJ0tevE0kOplbIZXdnZUmWJZW2MB7kVbe54fvUWwr phhw== X-Forwarded-Encrypted: i=1; AJvYcCWEwRDGrsLuM7KoJii6f7xXrxLE2gR94S0HY6bp4fssAm5k3vq6GpVCqlkiOFAK3sMhVCU=@dpdk.org X-Gm-Message-State: AOJu0YzUn9sCmHHnnxDntwNsinzt+FrgTUkGC2A9Z9Qdr1tIWGnQnix/ 2gjKJy/BsMfX5Mhjd3vPRpmwZl/b0qEyGRlc5ZPKl5DGxB45DXtsDHLsPp9FJbfjRST9zc1VqPx 2R1vRkpkcZMuA0hgHxHCDce0HGhBiHQNoAFuaABdaTg== X-Gm-Gg: ASbGncuFASzR4KXBbrXiChRJPngqKXUWFxmn614fXqn+I/5U1tAnFQwCiEpS8BxxH2i /t94IT/Eh60G8SzO+SP1Jopg6zNB8tFygKdtdEwJ2Pg/b3GxnalzHy4gwr7IN7xBU+Ig3/smXqD HYG+3CF2uRWBn21P0yJHeDwBPQ6RIz4tJgUSjzw+oVAg52NRk91drmQcJ80SA8Nn5Osa21pi/+3 1iAgA== X-Google-Smtp-Source: AGHT+IEX6OGPQSG4moJF+olTk2vbJg55BZ9w+4O3328s4jnUcDYpg7ndDsjO5FkRhDEeJM9A6zq6p1jHAQrLxZfdjHY= X-Received: by 2002:a05:6122:50c:b0:52d:bcd1:ab55 with SMTP id 71dfb90a1353d-530710fe00emr5670278e0c.2.1748548660276; Thu, 29 May 2025 12:57:40 -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:57:29 -0700 X-Gm-Features: AX0GCFtnPoOVnHUY0NlZcLOinTJFUZVF2qjNFidmjV9zwFklT5I235tjuW8nFbs 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="000000000000c4c22c06364bb5d0" 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 --000000000000c4c22c06364bb5d0 Content-Type: text/plain; charset="UTF-8" Full list of types is here https://www.tcpdump.org/linktypes.html 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); > > --000000000000c4c22c06364bb5d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Full list of types is here=C2=A0

On Thu, May 29, 2025, 10:16 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
---

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);

--000000000000c4c22c06364bb5d0--