git: f0bcebe67ef6 - main - pflogd: Define structures removed in libpcap-1.10.5

From: Joseph Mingrone <jrm_at_FreeBSD.org>
Date: Sat, 14 Sep 2024 20:30:38 UTC
The branch main has been updated by jrm:

URL: https://cgit.FreeBSD.org/src/commit/?id=f0bcebe67ef6cf9f104535d6cd9f151c1b61dd6a

commit f0bcebe67ef6cf9f104535d6cd9f151c1b61dd6a
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2024-09-14 19:52:36 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2024-09-14 20:28:27 +0000

    pflogd: Define structures removed in libpcap-1.10.5
    
    In libpcap-1.10.5, two structures that we rely on, pcap_timeval and
    pcap_sf_pkthdr, were made private.
    
    https://github.com/the-tcpdump-group/libpcap/commit/c2d8cbb977963be1f6cb07863e5bb59609e87fae
    
    Temporarily define them here to fix the build.  kp and I will
    investigate a permanent solution at EuroBSDCon in Dublin.
    
    Reviewed by:    kp
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D46676
---
 contrib/pf/pflogd/pflogd.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/contrib/pf/pflogd/pflogd.h b/contrib/pf/pflogd/pflogd.h
index 596e69692614..6e6b588d24bf 100644
--- a/contrib/pf/pflogd/pflogd.h
+++ b/contrib/pf/pflogd/pflogd.h
@@ -40,6 +40,19 @@ int	priv_open_log(void);
 int	priv_move_log(void);
 pcap_t *pcap_open_live_fd(int fd, int snaplen, char *ebuf);
 
+/* XXX TODO: Investigate a permanent solution, rather than defining these two
+   structures here. */
+struct pcap_timeval {
+	bpf_u_int32 tv_sec;	/* seconds */
+	bpf_u_int32 tv_usec;	/* microseconds */
+};
+
+struct pcap_sf_pkthdr {
+	struct pcap_timeval ts;	/* time stamp */
+	bpf_u_int32 caplen;	/* length of portion present */
+	bpf_u_int32 len;	/* length of this packet (off wire) */
+};
+
 void set_pcap_filter(void);
 /* File descriptor send/recv */
 void send_fd(int, int);