Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/bind9/isc
File: quota.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
[11] Fix | Delete
#ifndef ISC_QUOTA_H
[12] Fix | Delete
#define ISC_QUOTA_H 1
[13] Fix | Delete
[14] Fix | Delete
/*****
[15] Fix | Delete
***** Module Info
[16] Fix | Delete
*****/
[17] Fix | Delete
[18] Fix | Delete
/*! \file isc/quota.h
[19] Fix | Delete
*
[20] Fix | Delete
* \brief The isc_quota_t object is a simple helper object for implementing
[21] Fix | Delete
* quotas on things like the number of simultaneous connections to
[22] Fix | Delete
* a server. It keeps track of the amount of quota in use, and
[23] Fix | Delete
* encapsulates the locking necessary to allow multiple tasks to
[24] Fix | Delete
* share a quota.
[25] Fix | Delete
*/
[26] Fix | Delete
[27] Fix | Delete
/***
[28] Fix | Delete
*** Imports.
[29] Fix | Delete
***/
[30] Fix | Delete
[31] Fix | Delete
#include <isc/lang.h>
[32] Fix | Delete
#include <isc/mutex.h>
[33] Fix | Delete
#include <isc/types.h>
[34] Fix | Delete
[35] Fix | Delete
/*****
[36] Fix | Delete
***** Types.
[37] Fix | Delete
*****/
[38] Fix | Delete
[39] Fix | Delete
ISC_LANG_BEGINDECLS
[40] Fix | Delete
[41] Fix | Delete
/*% isc_quota structure */
[42] Fix | Delete
struct isc_quota {
[43] Fix | Delete
isc_mutex_t lock; /*%< Locked by lock. */
[44] Fix | Delete
int max;
[45] Fix | Delete
int used;
[46] Fix | Delete
int soft;
[47] Fix | Delete
};
[48] Fix | Delete
[49] Fix | Delete
isc_result_t
[50] Fix | Delete
isc_quota_init(isc_quota_t *quota, int max);
[51] Fix | Delete
/*%<
[52] Fix | Delete
* Initialize a quota object.
[53] Fix | Delete
*
[54] Fix | Delete
* Returns:
[55] Fix | Delete
* ISC_R_SUCCESS
[56] Fix | Delete
* Other error Lock creation failed.
[57] Fix | Delete
*/
[58] Fix | Delete
[59] Fix | Delete
void
[60] Fix | Delete
isc_quota_destroy(isc_quota_t *quota);
[61] Fix | Delete
/*%<
[62] Fix | Delete
* Destroy a quota object.
[63] Fix | Delete
*/
[64] Fix | Delete
[65] Fix | Delete
void
[66] Fix | Delete
isc_quota_soft(isc_quota_t *quota, int soft);
[67] Fix | Delete
/*%<
[68] Fix | Delete
* Set a soft quota.
[69] Fix | Delete
*/
[70] Fix | Delete
[71] Fix | Delete
void
[72] Fix | Delete
isc_quota_max(isc_quota_t *quota, int max);
[73] Fix | Delete
/*%<
[74] Fix | Delete
* Re-set a maximum quota.
[75] Fix | Delete
*/
[76] Fix | Delete
[77] Fix | Delete
isc_result_t
[78] Fix | Delete
isc_quota_reserve(isc_quota_t *quota);
[79] Fix | Delete
/*%<
[80] Fix | Delete
* Attempt to reserve one unit of 'quota'.
[81] Fix | Delete
*
[82] Fix | Delete
* Returns:
[83] Fix | Delete
* \li #ISC_R_SUCCESS Success
[84] Fix | Delete
* \li #ISC_R_SOFTQUOTA Success soft quota reached
[85] Fix | Delete
* \li #ISC_R_QUOTA Quota is full
[86] Fix | Delete
*/
[87] Fix | Delete
[88] Fix | Delete
void
[89] Fix | Delete
isc_quota_release(isc_quota_t *quota);
[90] Fix | Delete
/*%<
[91] Fix | Delete
* Release one unit of quota.
[92] Fix | Delete
*/
[93] Fix | Delete
[94] Fix | Delete
isc_result_t
[95] Fix | Delete
isc_quota_attach(isc_quota_t *quota, isc_quota_t **p);
[96] Fix | Delete
/*%<
[97] Fix | Delete
* Like isc_quota_reserve, and also attaches '*p' to the
[98] Fix | Delete
* quota if successful (ISC_R_SUCCESS or ISC_R_SOFTQUOTA).
[99] Fix | Delete
*/
[100] Fix | Delete
[101] Fix | Delete
isc_result_t
[102] Fix | Delete
isc_quota_force(isc_quota_t *quota, isc_quota_t **p);
[103] Fix | Delete
/*%<
[104] Fix | Delete
* Like isc_quota_attach, but will attach '*p' to the quota
[105] Fix | Delete
* even if the hard quota has been exceeded.
[106] Fix | Delete
*/
[107] Fix | Delete
[108] Fix | Delete
void
[109] Fix | Delete
isc_quota_detach(isc_quota_t **p);
[110] Fix | Delete
/*%<
[111] Fix | Delete
* Like isc_quota_release, and also detaches '*p' from the
[112] Fix | Delete
* quota.
[113] Fix | Delete
*/
[114] Fix | Delete
[115] Fix | Delete
unsigned int
[116] Fix | Delete
isc_quota_getused(isc_quota_t *quota);
[117] Fix | Delete
/*%<
[118] Fix | Delete
* Get the current usage of quota.
[119] Fix | Delete
*/
[120] Fix | Delete
[121] Fix | Delete
ISC_LANG_ENDDECLS
[122] Fix | Delete
[123] Fix | Delete
#endif /* ISC_QUOTA_H */
[124] Fix | Delete
[125] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function