[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tcpdump-workers
Subject:    Re: [tcpdump-workers] pcap_compile_nopcap() not in man pages
From:       Guy Harris via tcpdump-workers <tcpdump-workers () lists ! tcpdump ! org>
Date:       2020-08-12 19:59:35
Message-ID: mailman.49.1597261138.29104.tcpdump-workers () lists ! tcpdump ! org
[Download RAW message or body]

Return-Path: <gharris@sonic.net>
Received: from localhost (localhost [127.0.0.1])
	by tuna.sandelman.ca (Postfix) with ESMTP id 344E23897D
	for <tcpdump-workers@lists.tcpdump.org>; Wed, 12 Aug 2020 15:38:56 -0400 (EDT)
Received: from tuna.sandelman.ca ([127.0.0.1])
	by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id 3szWEgQINjs3 for <tcpdump-workers@lists.tcpdump.org>;
	Wed, 12 Aug 2020 15:38:53 -0400 (EDT)
Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by tuna.sandelman.ca (Postfix) with ESMTPS id 255193897E
	for <tcpdump-workers@lists.tcpdump.org>; Wed, 12 Aug 2020 15:38:53 -0400 (EDT)
Received: from [192.168.42.85] (173-228-4-241.dsl.dynamic.fusionbroadband.com \
[173.228.4.241])  (authenticated bits=0)
	by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id 07CJxZ94022167
	(version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT);
	Wed, 12 Aug 2020 12:59:36 -0700
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
Subject: Re: [tcpdump-workers] pcap_compile_nopcap() not in man pages
From: Guy Harris <gharris@sonic.net>
In-Reply-To: <mailman.21.1597257892.29104.tcpdump-workers@lists.tcpdump.org>
Date: Wed, 12 Aug 2020 12:59:35 -0700
Cc: tcpdump-workers@lists.tcpdump.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <920E678F-721A-40FC-B764-BAA2165D0398@sonic.net>
References: <mailman.21.1597257892.29104.tcpdump-workers@lists.tcpdump.org>
To: Denis Ovsienko <denis@ovsienko.info>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
X-Sonic-CAuth: UmFuZG9tSVaa2jEyp5Zd+MjY44cxi/vyNfc7pwk3W/nC4nEhg/ToIuHeJ5j7uhsUPgwTFrpizNr7fxU/KIi4HDpGjBxmMyJI
                
X-Sonic-ID: C;FqGgWNbc6hGfOLFOqzpn/A== M;iC/wWNbc6hGfOLFOqzpn/A==
X-Sonic-Spam-Details: 0.0/5.0 by cerberusd

(Your first attempt seems to have worked - finally.  Perhaps Michael =
cleared the backlog?)

On Aug 10, 2020, at 4:24 AM, Denis Ovsienko via tcpdump-workers =
<tcpdump-workers@lists.tcpdump.org> wrote:

> It turns out, pcap_compile_nopcap() has been a part of the libpcap API
> since version 0.5 (June 2000), but it is not even mentioned anywhere =
in
> the man pages. The existing pcap_compile.3pcap man page seems to be =
the
> best place to add this information, since the two functions are
> similar. Would it be the right thing to do?

The problem with pcap_compile_nopcap() is that it provides no way to =
return an error message if it fails, unlike pcap_open_dead() combined =
with pcap_compile(), where you can use pcap_geterr() before closing the =
pcap_t.

An additional problem is that NetBSD fixed this by adding an =
error-buffer pointer argument, but that meant that NetBSD's =
pcap_compile_nopcap() was unfixably incompatible with the one in other =
OSes.  They've shifted to the compatible API, at the cost of not being =
able to get an error string.

So, for now, my inclination is to 1) deprecate pcap_compile_nopcap() =
(complete with marking it as deprecated, so code that uses it gets a =
compile-time warning on compilers where the deprecation macro is =
supported) and 2) not document it.=


[Attachment #3 (text/plain)]

_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic