DNS services via libunbound.
More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/log.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <fcntl.h>
#include "io.h"
#include "log.h"
Go to the source code of this file.
|
static int | _unbound_request_free (unbound_request_t *ur) |
|
static int | mod_bootstrap (module_inst_ctx_t const *mctx) |
|
static int | mod_thread_detach (module_thread_inst_ctx_t const *mctx) |
|
static int | mod_thread_instantiate (module_thread_inst_ctx_t const *mctx) |
|
static xlat_action_t | xlat_unbound (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
| Perform a DNS lookup using libunbound. More...
|
|
static void | xlat_unbound_callback (void *mydata, int rcode, void *packet, int packet_len, int sec, char *why_bogus) |
| Callback called by unbound when resolution started with ub_resolve_event() completes. More...
|
|
static xlat_action_t | xlat_unbound_resume (UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in) |
|
static void | xlat_unbound_signal (xlat_ctx_t const *xctx, request_t *request, UNUSED fr_signal_t action) |
|
static void | xlat_unbound_timeout (UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void *uctx) |
| Callback from our timeout event to cancel a request. More...
|
|
DNS services via libunbound.
- Id
- 14a4371bf4a4ef91a23980d43956188a8af52813
- Copyright
- 2013 The FreeRADIUS server project
-
2013 Brian S. Julin (bjuli.nosp@m.n@cl.nosp@m.arku..nosp@m.edu)
Definition in file rlm_unbound.c.
◆ rlm_unbound_t
Definition at line 38 of file rlm_unbound.c.
Data Fields |
char const * |
filename |
Unbound configuration file. |
char const * |
hosts |
hosts file to load |
char const * |
resolvconf |
resolv.conf file to use |
uint32_t |
timeout |
|
◆ rlm_unbound_thread_t
struct rlm_unbound_thread_t |
◆ unbound_request_t
Definition at line 52 of file rlm_unbound.c.
Data Fields |
int |
async_id |
Id of async query. |
uint16_t |
count |
Number of results to return. |
int |
done |
Indicator that the callback has been called Negative values indicate errors. |
fr_event_timer_t const * |
ev |
Event for timeout. |
bool |
has_priority |
Does the returned data start with a priority field. |
fr_value_box_list_t |
list |
Where to put the parsed results. |
TALLOC_CTX * |
out_ctx |
CTX to allocate parsed results in. |
request_t * |
request |
Current request being processed. |
fr_type_t |
return_type |
Data type to parse results into. |
rlm_unbound_thread_t * |
t |
Thread running this request. |
bool |
timedout |
Request timedout. |
◆ LOG_PREFIX
◆ RCODEERROR
#define RCODEERROR |
( |
|
_code, |
|
|
|
_message |
|
) |
| |
Value: case _code: \
REDEBUG(_message, xctx->mctx->mi->name); \
goto error
◆ UB_QUERY
#define UB_QUERY |
( |
|
_record, |
|
|
|
_rrvalue, |
|
|
|
_return, |
|
|
|
_hasprio |
|
) |
| |
Value: if (strcmp(query_vb->vb_strvalue, _record) == 0) { \
ur->return_type = _return; \
ur->has_priority = _hasprio; \
ub_resolve_event(t->ev_b->ub, host_vb->vb_strvalue, _rrvalue, 1, ur, \
}
static void xlat_unbound_callback(void *mydata, int rcode, void *packet, int packet_len, int sec, char *why_bogus)
Callback called by unbound when resolution started with ub_resolve_event() completes.
◆ _unbound_request_free()
◆ mod_bootstrap()
◆ mod_thread_detach()
◆ mod_thread_instantiate()
◆ xlat_unbound_callback()
static void xlat_unbound_callback |
( |
void * |
mydata, |
|
|
int |
rcode, |
|
|
void * |
packet, |
|
|
int |
packet_len, |
|
|
int |
sec, |
|
|
char * |
why_bogus |
|
) |
| |
|
static |
Callback called by unbound when resolution started with ub_resolve_event() completes.
- Parameters
-
mydata | the request tracking structure set up before ub_resolve_event() was called |
rcode | should be the rcode from the reply packet, but appears not to be |
packet | wire format reply packet |
packet_len | length of wire format packet |
sec | DNSSEC status code |
why_bogus | String describing DNSSEC issue if sec = 1 |
rate_limited | Was the request rate limited due to unbound workload |
Definition at line 98 of file rlm_unbound.c.
◆ xlat_unbound_resume()
◆ xlat_unbound_signal()
◆ xlat_unbound_timeout()
Callback from our timeout event to cancel a request.
Definition at line 259 of file rlm_unbound.c.
◆ module_config
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
@ CONF_FLAG_FILE_INPUT
File matching value must exist, and must be readable.
static fr_time_delta_t timeout
Definition at line 70 of file rlm_unbound.c.
◆ rlm_unbound
Initial value:= {
.common = {
.name = "unbound",
.thread_inst_type = "rlm_unbound_thread_t",
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
static const conf_parser_t config[]
static int mod_bootstrap(module_inst_ctx_t const *mctx)
static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
static const conf_parser_t module_config[]
static int mod_thread_detach(module_thread_inst_ctx_t const *mctx)
Definition at line 503 of file rlm_unbound.c.
◆ xlat_unbound_args
Initial value:= {
}
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_UINT16
16 Bit unsigned integer.
#define XLAT_ARG_PARSER_TERMINATOR
Definition at line 335 of file rlm_unbound.c.