The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Functions
log.c File Reference

Provides interface between libunbound and the FreeRADIUS event loop. More...

#include <freeradius-devel/util/syserror.h>
#include "log.h"
+ Include dependency graph for log.c:

Go to the source code of this file.

Macros

#define LOG_PREFIX   "unbound"
 

Functions

static int _unbound_log_free (unbound_log_t *u_log)
 
static ssize_t _unbound_log_write (void *cookie, char const *buf, size_t size)
 Write libunbound output to the server or request log. More...
 
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. More...
 
static int unbound_log_lvl_set (struct ub_ctx *ub, fr_log_lvl_t lvl)
 Set the debug level for a ub_ctx from the request or global debug level. More...
 
int unbound_log_to_global (unbound_log_t *u_log, struct ub_ctx *ub)
 Switch thread-specific libunbound output to the global log. More...
 
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) More...
 

Detailed Description

Provides interface between libunbound and the FreeRADIUS event loop.

Id
43a2fa5c1478a22af7386fe691d4a5f177de3ff1

Definition in file log.c.

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   "unbound"

Definition at line 27 of file log.c.

Function Documentation

◆ _unbound_log_free()

static int _unbound_log_free ( unbound_log_t u_log)
static

Definition at line 120 of file log.c.

+ Here is the caller graph for this function:

◆ _unbound_log_write()

static ssize_t _unbound_log_write ( void *  cookie,
char const *  buf,
size_t  size 
)
static

Write libunbound output to the server or request log.

Parameters
[in]cookieThe current thread.
[in]bufLog message from unbound.
[in]sizeLength of log message.

Definition at line 38 of file log.c.

+ Here is the caller graph for this function:

◆ unbound_log_init()

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 at line 129 of file log.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unbound_log_lvl_set()

static int unbound_log_lvl_set ( struct ub_ctx *  ub,
fr_log_lvl_t  lvl 
)
static

Set the debug level for a ub_ctx from the request or global debug level.

Parameters
[in]ubUnbound context to set log level for.
[in]lvlTo set.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 60 of file log.c.

+ Here is the caller graph for this function:

◆ unbound_log_to_global()

int unbound_log_to_global ( unbound_log_t u_log,
struct ub_ctx *  ub 
)

Switch thread-specific libunbound output to the global log.

Must be called before a function that previously called unbound_log_to_request yields, or can no longer be certain that the request_t * set in t->request is still valid.

Definition at line 114 of file log.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unbound_log_to_request()

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 at line 102 of file log.c.

+ Here is the call graph for this function: