The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
io.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: bbfb49ac3b53f07e1fe596628b468cea3b9e5699 $
20 *
21 * @brief Function prototypes and datatypes for the REST (HTTP) transport.
22 * @file rlm_unbound/io.h
23 *
24 * @copyright 2019 The FreeRADIUS server project
25 * @copyright 2019 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
26 */
27RCSIDH(rlm_unbound_io_h, "$Id: bbfb49ac3b53f07e1fe596628b468cea3b9e5699 $")
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33DIAG_OFF_OPTIONAL(documentation)
34#include <unbound.h>
35#include <unbound-event.h>
36DIAG_ON_OPTIONAL(documentation)
37
38/** Wrapper around our event loop specifying callbacks for creating new event handles
39 *
40 * This stores libunbound specific information in addition to the el for the current
41 * worker thread. It's passed into the 'new_event' callback when a new event handle
42 * is created. So we use it to pass in the el, and any other useful information.
43 *
44 * Lifetime should be bound to the thread instance.
45 */
46typedef struct {
47 struct ub_event_base base; //!< Interface structure for libunbound.
48 ///< MUST BE LISTED FIRST.
49 struct ub_ctx *ub; //!< Unbound ctx instantiated from this event base.
50
51 fr_event_list_t *el; //!< Event loop events should be inserted into.
53
54int unbound_io_init(TALLOC_CTX *ctx, unbound_io_event_base_t **ev_b_out, fr_event_list_t *el);
55
56#ifdef __cplusplus
57}
58#endif
#define DIAG_OFF_OPTIONAL(_x)
Definition build.h:577
#define RCSIDH(h, id)
Definition build.h:604
#define DIAG_ON_OPTIONAL(_x)
Definition build.h:578
Stores all information relating to an event list.
Definition event.c:375
struct ub_ctx * ub
Unbound ctx instantiated from this event base.
Definition io.h:49
int unbound_io_init(TALLOC_CTX *ctx, unbound_io_event_base_t **ev_b_out, fr_event_list_t *el)
Alloc a new event base, and unbound ctx initialised from that event base.
Definition io.c:469
fr_event_list_t * el
Event loop events should be inserted into.
Definition io.h:51
Wrapper around our event loop specifying callbacks for creating new event handles.
Definition io.h:46
static fr_event_list_t * el