The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
log.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: 2aed20f8305084395e316ccd319a841ca261ac9e $
20  *
21  * @brief Function prototypes and datatypes for the REST (HTTP) transport.
22  * @file rlm_unbound/log.h
23  *
24  * @copyright 2019 The FreeRADIUS server project
25  * @copyright 2019 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
26  */
27 RCSIDH(rlm_unbound_log_h, "$Id: 2aed20f8305084395e316ccd319a841ca261ac9e $")
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <freeradius-devel/server/request.h>
34 
36 DIAG_OFF(documentation)
37 #include <unbound.h>
38 DIAG_ON(documentation)
40 
41 /** Logging state
42  *
43  */
44 typedef struct {
45  request_t *request; //!< Request we're logging to.
46  FILE *stream; //!< Stream we use to interface with the
47  ///< FreeRADIUS logging functions.
49 
50 int unbound_log_to_request(unbound_log_t *u_log, struct ub_ctx *ub, request_t *request);
51 
52 int unbound_log_to_global(unbound_log_t *u_log, struct ub_ctx *ub);
53 
54 int unbound_log_init(TALLOC_CTX *ctx, unbound_log_t **u_log_out, struct ub_ctx *ub);
55 
56 #ifdef __cplusplus
57 }
58 #endif
#define DIAG_UNKNOWN_PRAGMAS
Definition: build.h:417
#define DIAG_ON(_x)
Definition: build.h:419
#define RCSIDH(h, id)
Definition: build.h:445
#define DIAG_OFF(_x)
Definition: build.h:418
request_t * request
Request we're logging to.
Definition: log.h:45
int unbound_log_to_global(unbound_log_t *u_log, struct ub_ctx *ub)
Switch thread-specific libunbound output to the global log.
Definition: log.c:114
FILE * stream
Stream we use to interface with the FreeRADIUS logging functions.
Definition: log.h:46
int unbound_log_to_request(unbound_log_t *u_log, struct ub_ctx *ub, request_t *request)
Switch thread-specific libunbound output to the request log destination(s)
Definition: log.c:102
int unbound_log_init(TALLOC_CTX *ctx, unbound_log_t **u_log_out, struct ub_ctx *ub)
Setup an unbound context for log, and initialise a u_log struct.
Definition: log.c:129
Logging state.
Definition: log.h:44