Module Name: src Committed By: christos Date: Sun Jan 26 16:30:19 UTC 2025
Added Files: src/external/mpl/bind/dist/bin/tests/system/cpu: prereq.sh setup.sh tests.sh src/external/mpl/bind/dist/bin/tests/system/cpu/ns1: named.conf.in src/external/mpl/bind/dist/lib/isc/include/isc: entropy.h queue.h xml.h src/external/mpl/bind/include/dns: probes.h src/external/mpl/bind/include/ns: pfilter.h probes.h src/external/mpl/bind/lib/libns: pfilter.c Log Message: new files. To generate a diff of this commit: cvs rdiff -u -r0 -r1.3 \ src/external/mpl/bind/dist/bin/tests/system/cpu/prereq.sh \ src/external/mpl/bind/dist/bin/tests/system/cpu/setup.sh \ src/external/mpl/bind/dist/bin/tests/system/cpu/tests.sh cvs rdiff -u -r0 -r1.3 \ src/external/mpl/bind/dist/bin/tests/system/cpu/ns1/named.conf.in cvs rdiff -u -r0 -r1.4 \ src/external/mpl/bind/dist/lib/isc/include/isc/entropy.h \ src/external/mpl/bind/dist/lib/isc/include/isc/xml.h cvs rdiff -u -r0 -r1.7 src/external/mpl/bind/dist/lib/isc/include/isc/queue.h cvs rdiff -u -r0 -r1.1 src/external/mpl/bind/include/dns/probes.h cvs rdiff -u -r0 -r1.1 src/external/mpl/bind/include/ns/pfilter.h \ src/external/mpl/bind/include/ns/probes.h cvs rdiff -u -r0 -r1.1 src/external/mpl/bind/lib/libns/pfilter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Added files: Index: src/external/mpl/bind/dist/bin/tests/system/cpu/prereq.sh diff -u /dev/null src/external/mpl/bind/dist/bin/tests/system/cpu/prereq.sh:1.3 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/dist/bin/tests/system/cpu/prereq.sh Sun Jan 26 11:30:18 2025 @@ -0,0 +1,21 @@ +#!/bin/sh + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +. ../conf.sh + +command -v cpuset >/dev/null || command -v numactl >/dev/null || command -v taskset >/dev/null || { + echo_i "This test requires cpuset, numactl, or taskset." >&2 + exit 255 +} + +exit 0 Index: src/external/mpl/bind/dist/bin/tests/system/cpu/setup.sh diff -u /dev/null src/external/mpl/bind/dist/bin/tests/system/cpu/setup.sh:1.3 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/dist/bin/tests/system/cpu/setup.sh Sun Jan 26 11:30:18 2025 @@ -0,0 +1,19 @@ +#!/bin/sh -e + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# shellcheck source=conf.sh +. ../conf.sh + +set -e + +copy_setports ns1/named.conf.in ns1/named.conf Index: src/external/mpl/bind/dist/bin/tests/system/cpu/tests.sh diff -u /dev/null src/external/mpl/bind/dist/bin/tests/system/cpu/tests.sh:1.3 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/dist/bin/tests/system/cpu/tests.sh Sun Jan 26 11:30:18 2025 @@ -0,0 +1,65 @@ +#!/bin/sh + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# shellcheck source=conf.sh +. ../conf.sh + +status=0 +n=0 + +CPUSET=$(command -v cpuset) +NUMACTL=$(command -v numactl) +TASKSET=$(command -v taskset) + +cpulist() ( + if [ -n "$CPUSET" ]; then + cpuset -g | head -1 | sed -e "s/.*: //" | tr -s ', ' '\n' + elif [ -n "$NUMACTL" ]; then + numactl --show | sed -ne 's/^physcpubind: //p' | tr -s ' ' '\n' + elif [ -n "$TASKSET" ]; then + # shellcheck disable=SC2046 + seq $(taskset -c -p $$ | sed -e 's/.*: //' | tr -s ' -' ' ') + else + echo 0 + fi +) + +cpulimit() ( + set -x + min_cpu="${1}" + shift + max_cpu="${1}" + shift + + if [ -n "$CPUSET" ]; then + cpuset -l "${min_cpu}-${max_cpu}" "$@" 2>&1 + elif [ -n "$NUMACTL" ]; then + numactl --physcpubind="${min_cpu}-${max_cpu}" "$@" 2>&1 + elif [ -n "$TASKSET" ]; then + taskset -c "${min_cpu}-${max_cpu}" "$@" 2>&1 + fi +) + +ret=0 +for cpu in $(cpulist); do + n=$((n + 1)) + echo_i "testing that limiting CPU sets to 0-${cpu} works ($n)" + cpulimit 0 "$cpu" "$NAMED" -g >named.run.$n 2>&1 || true + ncpus=$(sed -ne 's/.*found \([0-9]*\) CPU.*\([0-9]*\) worker thread.*/\1/p' named.run.$n) + [ "$ncpus" -eq "$((cpu + 1))" ] || ret=1 +done +test "$ret" -eq 0 || echo_i "failed" +status=$((status + ret)) + +echo_i "exit status: $status" +[ $status -eq 0 ] || exit 1 Index: src/external/mpl/bind/dist/bin/tests/system/cpu/ns1/named.conf.in diff -u /dev/null src/external/mpl/bind/dist/bin/tests/system/cpu/ns1/named.conf.in:1.3 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/dist/bin/tests/system/cpu/ns1/named.conf.in Sun Jan 26 11:30:18 2025 @@ -0,0 +1,20 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + query-source address 10.53.0.1; + port @PORT@; + pid-file "named.pid"; + listen-on { 10.53.0.1; }; + listen-on-v6 { none; }; +}; Index: src/external/mpl/bind/dist/lib/isc/include/isc/entropy.h diff -u /dev/null src/external/mpl/bind/dist/lib/isc/include/isc/entropy.h:1.4 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/dist/lib/isc/include/isc/entropy.h Sun Jan 26 11:30:19 2025 @@ -0,0 +1,37 @@ +/* $NetBSD: entropy.h,v 1.4 2025/01/26 16:30:19 christos Exp $ */ + +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#pragma once + +#include <stdlib.h> + +#include <isc/lang.h> + +/*! \file isc/entropy.h + * \brief Implements wrapper around CSPRNG cryptographic library calls + * for getting cryptographically secure pseudo-random numbers. + * + * Uses synchronous version of uv_random(). + */ + +ISC_LANG_BEGINDECLS + +void +isc_entropy_get(void *buf, size_t buflen); +/*!< + * \brief Get cryptographically-secure pseudo-random data. + */ + +ISC_LANG_ENDDECLS Index: src/external/mpl/bind/dist/lib/isc/include/isc/xml.h diff -u /dev/null src/external/mpl/bind/dist/lib/isc/include/isc/xml.h:1.4 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/dist/lib/isc/include/isc/xml.h Sun Jan 26 11:30:19 2025 @@ -0,0 +1,27 @@ +/* $NetBSD: xml.h,v 1.4 2025/01/26 16:30:19 christos Exp $ */ + +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#pragma once + +#include <stdbool.h> + +void +isc__xml_initialize(void); + +void +isc__xml_shutdown(void); + +void +isc__xml_setdestroycheck(bool check); Index: src/external/mpl/bind/dist/lib/isc/include/isc/queue.h diff -u /dev/null src/external/mpl/bind/dist/lib/isc/include/isc/queue.h:1.7 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/dist/lib/isc/include/isc/queue.h Sun Jan 26 11:30:19 2025 @@ -0,0 +1,105 @@ +/* $NetBSD: queue.h,v 1.7 2025/01/26 16:30:19 christos Exp $ */ + +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#include <isc/os.h> +#include <isc/urcu.h> + +STATIC_ASSERT(sizeof(struct __cds_wfcq_head) <= ISC_OS_CACHELINE_SIZE, + "size of struct __cds_wfcq_head must be smaller than " + "ISC_OS_CACHELINE_SIZE"); + +typedef struct isc_queue { + struct __cds_wfcq_head head; + uint8_t __padding[ISC_OS_CACHELINE_SIZE - + sizeof(struct __cds_wfcq_head)]; + struct cds_wfcq_tail tail; +} isc_queue_t; + +typedef struct cds_wfcq_node isc_queue_node_t; + +static inline void +isc_queue_node_init(isc_queue_node_t *node) { + cds_wfcq_node_init(node); +} + +static inline void +isc_queue_init(isc_queue_t *queue) { + __cds_wfcq_init(&(queue)->head, &(queue)->tail); +} + +static inline void +isc_queue_destroy(isc_queue_t *queue) { + UNUSED(queue); +} + +static inline bool +isc_queue_empty(isc_queue_t *queue) { + return cds_wfcq_empty(&(queue)->head, &(queue)->tail); +} + +static inline bool +isc_queue_enqueue(isc_queue_t *queue, isc_queue_node_t *node) { + return cds_wfcq_enqueue(&(queue)->head, &(queue)->tail, node); +} + +#define isc_queue_enqueue_entry(queue, entry, member) \ + cds_wfcq_enqueue(&(queue)->head, &(queue)->tail, &((entry)->member)) + +static inline isc_queue_node_t * +isc_queue_dequeue(isc_queue_t *queue) { + return __cds_wfcq_dequeue_nonblocking(&(queue)->head, &(queue)->tail); +} + +#define isc_queue_entry(ptr, type, member) \ + caa_container_of_check_null(ptr, type, member) + +#define isc_queue_dequeue_entry(queue, type, member) \ + isc_queue_entry(isc_queue_dequeue(queue), type, member) + +static inline bool +isc_queue_splice(isc_queue_t *dest, isc_queue_t *src) { + enum cds_wfcq_ret ret = __cds_wfcq_splice_blocking( + &dest->head, &dest->tail, &src->head, &src->tail); + INSIST(ret != CDS_WFCQ_RET_WOULDBLOCK && + ret != CDS_WFCQ_RET_DEST_NON_EMPTY); + + return ret != CDS_WFCQ_RET_SRC_EMPTY; +} + +#define isc_queue_first_entry(queue, type, member) \ + isc_queue_entry( \ + __cds_wfcq_first_blocking(&(queue)->head, &(queue)->tail), \ + type, member) + +#define isc_queue_next_entry(queue, node, type, member) \ + isc_queue_entry(__cds_wfcq_next_blocking(&(queue)->head, \ + &(queue)->tail, node), \ + type, member) + +#define isc_queue_for_each_entry(queue, pos, member) \ + for (pos = isc_queue_first_entry(queue, __typeof__(*pos), member); \ + pos != NULL; \ + pos = isc_queue_next_entry(queue, &(pos)->member, \ + __typeof__(*pos), member)) + +#define isc_queue_for_each_entry_safe(queue, pos, next, member) \ + for (pos = isc_queue_first_entry(queue, __typeof__(*pos), member), \ + next = (pos ? isc_queue_next_entry(queue, &(pos)->member, \ + __typeof__(*pos), member) \ + : NULL); \ + pos != NULL; pos = next, \ + next = (pos ? isc_queue_next_entry(queue, &(pos)->member, \ + __typeof__(*pos), member) \ + : NULL)) Index: src/external/mpl/bind/include/dns/probes.h diff -u /dev/null src/external/mpl/bind/include/dns/probes.h:1.1 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/include/dns/probes.h Sun Jan 26 11:30:19 2025 @@ -0,0 +1,285 @@ +/* + * Generated by dtrace(1M). + */ + +#ifndef _PROBES_H +#define _PROBES_H + +#include <unistd.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#include <sys/sdt.h> + +#if defined(DTRACE) && _DTRACE_VERSION + +#define LIBDNS_XFRIN_AXFR_FINALIZE_BEGIN(arg0, arg1) \ + __dtrace_libdns___xfrin_axfr_finalize_begin(arg0, arg1) +#ifndef __sparc +#define LIBDNS_XFRIN_AXFR_FINALIZE_BEGIN_ENABLED() \ + __dtraceenabled_libdns___xfrin_axfr_finalize_begin() +#else +#define LIBDNS_XFRIN_AXFR_FINALIZE_BEGIN_ENABLED() \ + __dtraceenabled_libdns___xfrin_axfr_finalize_begin(0) +#endif +#define LIBDNS_XFRIN_AXFR_FINALIZE_END(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_axfr_finalize_end(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_AXFR_FINALIZE_END_ENABLED() \ + __dtraceenabled_libdns___xfrin_axfr_finalize_end() +#else +#define LIBDNS_XFRIN_AXFR_FINALIZE_END_ENABLED() \ + __dtraceenabled_libdns___xfrin_axfr_finalize_end(0) +#endif +#define LIBDNS_XFRIN_CONNECTED(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_connected(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_CONNECTED_ENABLED() \ + __dtraceenabled_libdns___xfrin_connected() +#else +#define LIBDNS_XFRIN_CONNECTED_ENABLED() \ + __dtraceenabled_libdns___xfrin_connected(0) +#endif +#define LIBDNS_XFRIN_DONE_CALLBACK_BEGIN(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_done_callback_begin(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_DONE_CALLBACK_BEGIN_ENABLED() \ + __dtraceenabled_libdns___xfrin_done_callback_begin() +#else +#define LIBDNS_XFRIN_DONE_CALLBACK_BEGIN_ENABLED() \ + __dtraceenabled_libdns___xfrin_done_callback_begin(0) +#endif +#define LIBDNS_XFRIN_DONE_CALLBACK_END(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_done_callback_end(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_DONE_CALLBACK_END_ENABLED() \ + __dtraceenabled_libdns___xfrin_done_callback_end() +#else +#define LIBDNS_XFRIN_DONE_CALLBACK_END_ENABLED() \ + __dtraceenabled_libdns___xfrin_done_callback_end(0) +#endif +#define LIBDNS_XFRIN_READ(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_read(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_READ_ENABLED() \ + __dtraceenabled_libdns___xfrin_read() +#else +#define LIBDNS_XFRIN_READ_ENABLED() \ + __dtraceenabled_libdns___xfrin_read(0) +#endif +#define LIBDNS_XFRIN_RECV_ANSWER(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_recv_answer(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_RECV_ANSWER_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_answer() +#else +#define LIBDNS_XFRIN_RECV_ANSWER_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_answer(0) +#endif +#define LIBDNS_XFRIN_RECV_DONE(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_recv_done(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_RECV_DONE_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_done() +#else +#define LIBDNS_XFRIN_RECV_DONE_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_done(0) +#endif +#define LIBDNS_XFRIN_RECV_PARSED(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_recv_parsed(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_RECV_PARSED_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_parsed() +#else +#define LIBDNS_XFRIN_RECV_PARSED_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_parsed(0) +#endif +#define LIBDNS_XFRIN_RECV_QUESTION(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_recv_question(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_RECV_QUESTION_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_question() +#else +#define LIBDNS_XFRIN_RECV_QUESTION_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_question(0) +#endif +#define LIBDNS_XFRIN_RECV_SEND_REQUEST(arg0, arg1) \ + __dtrace_libdns___xfrin_recv_send_request(arg0, arg1) +#ifndef __sparc +#define LIBDNS_XFRIN_RECV_SEND_REQUEST_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_send_request() +#else +#define LIBDNS_XFRIN_RECV_SEND_REQUEST_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_send_request(0) +#endif +#define LIBDNS_XFRIN_RECV_START(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_recv_start(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_RECV_START_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_start() +#else +#define LIBDNS_XFRIN_RECV_START_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_start(0) +#endif +#define LIBDNS_XFRIN_RECV_TRY_AXFR(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_recv_try_axfr(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_RECV_TRY_AXFR_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_try_axfr() +#else +#define LIBDNS_XFRIN_RECV_TRY_AXFR_ENABLED() \ + __dtraceenabled_libdns___xfrin_recv_try_axfr(0) +#endif +#define LIBDNS_XFRIN_SENT(arg0, arg1, arg2) \ + __dtrace_libdns___xfrin_sent(arg0, arg1, arg2) +#ifndef __sparc +#define LIBDNS_XFRIN_SENT_ENABLED() \ + __dtraceenabled_libdns___xfrin_sent() +#else +#define LIBDNS_XFRIN_SENT_ENABLED() \ + __dtraceenabled_libdns___xfrin_sent(0) +#endif +#define LIBDNS_XFRIN_START(arg0, arg1) \ + __dtrace_libdns___xfrin_start(arg0, arg1) +#ifndef __sparc +#define LIBDNS_XFRIN_START_ENABLED() \ + __dtraceenabled_libdns___xfrin_start() +#else +#define LIBDNS_XFRIN_START_ENABLED() \ + __dtraceenabled_libdns___xfrin_start(0) +#endif + + +extern void __dtrace_libdns___xfrin_axfr_finalize_begin(void *, char *); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_axfr_finalize_begin(void); +#else +extern int __dtraceenabled_libdns___xfrin_axfr_finalize_begin(long); +#endif +extern void __dtrace_libdns___xfrin_axfr_finalize_end(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_axfr_finalize_end(void); +#else +extern int __dtraceenabled_libdns___xfrin_axfr_finalize_end(long); +#endif +extern void __dtrace_libdns___xfrin_connected(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_connected(void); +#else +extern int __dtraceenabled_libdns___xfrin_connected(long); +#endif +extern void __dtrace_libdns___xfrin_done_callback_begin(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_done_callback_begin(void); +#else +extern int __dtraceenabled_libdns___xfrin_done_callback_begin(long); +#endif +extern void __dtrace_libdns___xfrin_done_callback_end(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_done_callback_end(void); +#else +extern int __dtraceenabled_libdns___xfrin_done_callback_end(long); +#endif +extern void __dtrace_libdns___xfrin_read(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_read(void); +#else +extern int __dtraceenabled_libdns___xfrin_read(long); +#endif +extern void __dtrace_libdns___xfrin_recv_answer(void *, char *, void *); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_recv_answer(void); +#else +extern int __dtraceenabled_libdns___xfrin_recv_answer(long); +#endif +extern void __dtrace_libdns___xfrin_recv_done(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_recv_done(void); +#else +extern int __dtraceenabled_libdns___xfrin_recv_done(long); +#endif +extern void __dtrace_libdns___xfrin_recv_parsed(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_recv_parsed(void); +#else +extern int __dtraceenabled_libdns___xfrin_recv_parsed(long); +#endif +extern void __dtrace_libdns___xfrin_recv_question(void *, char *, void *); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_recv_question(void); +#else +extern int __dtraceenabled_libdns___xfrin_recv_question(long); +#endif +extern void __dtrace_libdns___xfrin_recv_send_request(void *, char *); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_recv_send_request(void); +#else +extern int __dtraceenabled_libdns___xfrin_recv_send_request(long); +#endif +extern void __dtrace_libdns___xfrin_recv_start(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_recv_start(void); +#else +extern int __dtraceenabled_libdns___xfrin_recv_start(long); +#endif +extern void __dtrace_libdns___xfrin_recv_try_axfr(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_recv_try_axfr(void); +#else +extern int __dtraceenabled_libdns___xfrin_recv_try_axfr(long); +#endif +extern void __dtrace_libdns___xfrin_sent(void *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_sent(void); +#else +extern int __dtraceenabled_libdns___xfrin_sent(long); +#endif +extern void __dtrace_libdns___xfrin_start(void *, char *); +#ifndef __sparc +extern int __dtraceenabled_libdns___xfrin_start(void); +#else +extern int __dtraceenabled_libdns___xfrin_start(long); +#endif + +#else + +#define LIBDNS_XFRIN_AXFR_FINALIZE_BEGIN(arg0, arg1) +#define LIBDNS_XFRIN_AXFR_FINALIZE_BEGIN_ENABLED() (0) +#define LIBDNS_XFRIN_AXFR_FINALIZE_END(arg0, arg1, arg2) +#define LIBDNS_XFRIN_AXFR_FINALIZE_END_ENABLED() (0) +#define LIBDNS_XFRIN_CONNECTED(arg0, arg1, arg2) +#define LIBDNS_XFRIN_CONNECTED_ENABLED() (0) +#define LIBDNS_XFRIN_DONE_CALLBACK_BEGIN(arg0, arg1, arg2) +#define LIBDNS_XFRIN_DONE_CALLBACK_BEGIN_ENABLED() (0) +#define LIBDNS_XFRIN_DONE_CALLBACK_END(arg0, arg1, arg2) +#define LIBDNS_XFRIN_DONE_CALLBACK_END_ENABLED() (0) +#define LIBDNS_XFRIN_READ(arg0, arg1, arg2) +#define LIBDNS_XFRIN_READ_ENABLED() (0) +#define LIBDNS_XFRIN_RECV_ANSWER(arg0, arg1, arg2) +#define LIBDNS_XFRIN_RECV_ANSWER_ENABLED() (0) +#define LIBDNS_XFRIN_RECV_DONE(arg0, arg1, arg2) +#define LIBDNS_XFRIN_RECV_DONE_ENABLED() (0) +#define LIBDNS_XFRIN_RECV_PARSED(arg0, arg1, arg2) +#define LIBDNS_XFRIN_RECV_PARSED_ENABLED() (0) +#define LIBDNS_XFRIN_RECV_QUESTION(arg0, arg1, arg2) +#define LIBDNS_XFRIN_RECV_QUESTION_ENABLED() (0) +#define LIBDNS_XFRIN_RECV_SEND_REQUEST(arg0, arg1) +#define LIBDNS_XFRIN_RECV_SEND_REQUEST_ENABLED() (0) +#define LIBDNS_XFRIN_RECV_START(arg0, arg1, arg2) +#define LIBDNS_XFRIN_RECV_START_ENABLED() (0) +#define LIBDNS_XFRIN_RECV_TRY_AXFR(arg0, arg1, arg2) +#define LIBDNS_XFRIN_RECV_TRY_AXFR_ENABLED() (0) +#define LIBDNS_XFRIN_SENT(arg0, arg1, arg2) +#define LIBDNS_XFRIN_SENT_ENABLED() (0) +#define LIBDNS_XFRIN_START(arg0, arg1) +#define LIBDNS_XFRIN_START_ENABLED() (0) + + +#ifdef __cplusplus +} +#endif +#endif + +#endif /* _PROBES_H */ Index: src/external/mpl/bind/include/ns/pfilter.h diff -u /dev/null src/external/mpl/bind/include/ns/pfilter.h:1.1 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/include/ns/pfilter.h Sun Jan 26 11:30:19 2025 @@ -0,0 +1,2 @@ +void pfilter_enable(void); +void pfilter_notify(isc_result_t, ns_client_t *, const char *); Index: src/external/mpl/bind/include/ns/probes.h diff -u /dev/null src/external/mpl/bind/include/ns/probes.h:1.1 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/include/ns/probes.h Sun Jan 26 11:30:19 2025 @@ -0,0 +1,48 @@ +/* + * Generated by dtrace(1M). + */ + +#ifndef _PROBES_H +#define _PROBES_H + +#include <unistd.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#include <sys/sdt.h> + +#if defined(DTRACE) && _DTRACE_VERSION + +#define LIBNS_RRL_DROP(arg0, arg1, arg2, arg3) \ + __dtrace_libns___rrl_drop(arg0, arg1, arg2, arg3) +#ifndef __sparc +#define LIBNS_RRL_DROP_ENABLED() \ + __dtraceenabled_libns___rrl_drop() +#else +#define LIBNS_RRL_DROP_ENABLED() \ + __dtraceenabled_libns___rrl_drop(0) +#endif + + +extern void __dtrace_libns___rrl_drop(char *, char *, char *, int); +#ifndef __sparc +extern int __dtraceenabled_libns___rrl_drop(void); +#else +extern int __dtraceenabled_libns___rrl_drop(long); +#endif + +#else + +#define LIBNS_RRL_DROP(arg0, arg1, arg2, arg3) +#define LIBNS_RRL_DROP_ENABLED() (0) + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _PROBES_H */ Index: src/external/mpl/bind/lib/libns/pfilter.c diff -u /dev/null src/external/mpl/bind/lib/libns/pfilter.c:1.1 --- /dev/null Sun Jan 26 11:30:19 2025 +++ src/external/mpl/bind/lib/libns/pfilter.c Sun Jan 26 11:30:19 2025 @@ -0,0 +1,43 @@ + +#include <isc/util.h> +#include <ns/types.h> +#include <ns/client.h> + +#include <blocklist.h> + +#include <ns/pfilter.h> + +static struct blocklist *blstate; +static int blenable; + +void +pfilter_enable(void) { + blenable = 1; +} + +#define TCP_CLIENT(c) (((c)->attributes & NS_CLIENTATTR_TCP) != 0) + +void +pfilter_notify(isc_result_t res, ns_client_t *client, const char *msg) +{ + int fd; + + if (!blenable) + return; + + if (blstate == NULL) + blstate = blocklist_open(); + + if (blstate == NULL) + return; + + if (!TCP_CLIENT(client) && !client->peeraddr_valid) + return; + + if ((fd = isc_nmhandle_getfd(client->handle)) == -1) + return; + + blocklist_sa_r(blstate, + res != ISC_R_SUCCESS, fd, + &client->peeraddr.type.sa, client->peeraddr.length, msg); +}