The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
exfile.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17
18/**
19 * $Id: 1fe9b15623b3a66ac71fd6a70c66337a4ee1b2de $
20 *
21 * @file lib/server/exfile.h
22 * @brief API for managing concurrent file access.
23 *
24 * @copyright 2014 The FreeRADIUS server project
25 */
26RCSIDH(exfile_h, "$Id: 1fe9b15623b3a66ac71fd6a70c66337a4ee1b2de $")
27
28#include <freeradius-devel/server/request.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33/*
34 * Multiple threads logging to one or more files.
35 */
36typedef struct exfile_s exfile_t;
37
38exfile_t *exfile_init(TALLOC_CTX *ctx, uint32_t entries, fr_time_delta_t idle, bool locking);
39
42
43CC_ACQUIRE_HANDLE("exfile_fd")
44int exfile_open(exfile_t *lf, char const *filename, mode_t permissions, off_t *offset);
45
46int exfile_close(exfile_t *lf, CC_RELEASE_HANDLE("exfile_fd") int fd);
47
48#ifdef __cplusplus
49}
50#endif
#define CC_RELEASE_HANDLE(_tag)
Definition build.h:412
#define RCSIDH(h, id)
Definition build.h:484
#define CC_ACQUIRE_HANDLE(_tag)
Definition build.h:410
A section grouping multiple CONF_PAIR.
Definition cf_priv.h:101
bool locking
Definition exfile.c:55
char const * trigger_prefix
Trigger path in the global trigger section.
Definition exfile.c:57
exfile_entry_t * entries
Definition exfile.c:54
fr_pair_list_t trigger_args
Arguments to pass to trigger.
Definition exfile.c:58
int exfile_open(exfile_t *lf, char const *filename, mode_t permissions, off_t *offset)
Open a new log file, or maybe an existing one.
Definition exfile.c:506
int exfile_close(exfile_t *lf, CC_RELEASE_HANDLE("exfile_fd") int fd)
exfile_t * exfile_init(TALLOC_CTX *ctx, uint32_t entries, fr_time_delta_t idle, bool locking)
Initialize a way for multiple threads to log to one or more files.
Definition exfile.c:148
void exfile_enable_triggers(exfile_t *ef, CONF_SECTION *cs, char const *trigger_prefix, fr_pair_list_t *trigger_args)
Enable triggers for an exfiles handle.
Definition exfile.c:196
unsigned int uint32_t
unsigned int mode_t
long long int off_t
A time delta, a difference in time measured in nanoseconds.
Definition time.h:80