1 /* $NetBSD: bufferlist.h,v 1.1 2024/02/18 20:57:51 christos Exp $ */ 2 3 /* 4 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 5 * 6 * SPDX-License-Identifier: MPL-2.0 7 * 8 * This Source Code Form is subject to the terms of the Mozilla Public 9 * License, v. 2.0. If a copy of the MPL was not distributed with this 10 * file, you can obtain one at https://mozilla.org/MPL/2.0/. 11 * 12 * See the COPYRIGHT file distributed with this work for additional 13 * information regarding copyright ownership. 14 */ 15 16 #ifndef ISC_BUFFERLIST_H 17 #define ISC_BUFFERLIST_H 1 18 19 /***** 20 ***** Module Info 21 *****/ 22 23 /*! \file isc/bufferlist.h 24 * 25 * 26 *\brief Buffer lists have no synchronization. Clients must ensure 27 * exclusive * access. 28 * 29 * \li Reliability: 30 * No anticipated impact. 31 * 32 * \li Security: 33 * No anticipated impact. 34 * 35 * \li Standards: 36 * None. 37 */ 38 39 /*** 40 *** Imports 41 ***/ 42 43 #include <isc/lang.h> 44 #include <isc/types.h> 45 46 ISC_LANG_BEGINDECLS 47 48 /*** 49 *** Functions 50 ***/ 51 52 unsigned int 53 isc_bufferlist_usedcount(isc_bufferlist_t *bl); 54 /*!< 55 * \brief Return the length of the sum of all used regions of all buffers in 56 * the buffer list 'bl' 57 * 58 * Requires: 59 * 60 *\li 'bl' is not NULL. 61 * 62 * Returns: 63 *\li sum of all used regions' lengths. 64 */ 65 66 unsigned int 67 isc_bufferlist_availablecount(isc_bufferlist_t *bl); 68 /*!< 69 * \brief Return the length of the sum of all available regions of all buffers 70 * in the buffer list 'bl' 71 * 72 * Requires: 73 * 74 *\li 'bl' is not NULL. 75 * 76 * Returns: 77 *\li sum of all available regions' lengths. 78 */ 79 80 ISC_LANG_ENDDECLS 81 82 #endif /* ISC_BUFFERLIST_H */ 83