control-plane signaling
More...
#include <freeradius-devel/io/atomic_queue.h>
#include <freeradius-devel/io/ring_buffer.h>
#include <freeradius-devel/util/time.h>
#include <freeradius-devel/util/event.h>
#include <sys/types.h>
Go to the source code of this file.
|
int | fr_control_callback_add (fr_control_t *c, uint32_t id, void *ctx, fr_control_callback_t callback)) |
| Register a callback for an ID. More...
|
|
int | fr_control_callback_delete (fr_control_t *c, uint32_t id) |
| Delete a callback for an ID. More...
|
|
fr_control_t * | fr_control_create (TALLOC_CTX *ctx, fr_event_list_t *el, fr_atomic_queue_t *aq)) |
| Create a control-plane signaling path. More...
|
|
int | fr_control_gc (fr_control_t *c, fr_ring_buffer_t *rb) |
|
ssize_t | fr_control_message_pop (fr_atomic_queue_t *aq, uint32_t *p_id, void *data, size_t data_size) |
| Pop control-plane message. More...
|
|
int | fr_control_message_push (fr_control_t *c, fr_ring_buffer_t *rb, uint32_t id, void *data, size_t data_size) |
| Push a control-plane message. More...
|
|
int | fr_control_message_send (fr_control_t *c, fr_ring_buffer_t *rb, uint32_t id, void *data, size_t data_size) |
| Send a control-plane message. More...
|
|
int | fr_control_same_thread (fr_control_t *c) |
|
control-plane signaling
- Id
- c82782bbbfad0f10cf1b9db838006f90bb8cc4c3
- Copyright
- 2016 Alan DeKok (aland.nosp@m.@fre.nosp@m.eradi.nosp@m.us.o.nosp@m.rg)
Definition in file control.h.
◆ FR_CONTROL_ID_CHANNEL
#define FR_CONTROL_ID_CHANNEL (1) |
◆ FR_CONTROL_ID_DIRECTORY
#define FR_CONTROL_ID_DIRECTORY (4) |
◆ FR_CONTROL_ID_INJECT
#define FR_CONTROL_ID_INJECT (5) |
◆ FR_CONTROL_ID_LISTEN
#define FR_CONTROL_ID_LISTEN (2) |
◆ FR_CONTROL_ID_LISTEN_DEAD
#define FR_CONTROL_ID_LISTEN_DEAD (6) |
◆ FR_CONTROL_ID_WORKER
#define FR_CONTROL_ID_WORKER (3) |
◆ FR_CONTROL_MAX_MESSAGES
#define FR_CONTROL_MAX_MESSAGES (1024) |
◆ FR_CONTROL_MAX_SIZE
#define FR_CONTROL_MAX_SIZE (64) |
◆ fr_control_callback_t
typedef void(* fr_control_callback_t) (void *ctx, void const *data, size_t data_size, fr_time_t now) |
◆ fr_control_t
A one-way control plane signal.
Multiple-producer, single consumer.
Definition at line 1 of file control.h.
◆ fr_control_callback_add()
Register a callback for an ID.
- Parameters
-
[in] | c | the control structure |
[in] | id | the ident of this message. |
[in] | ctx | the context for the callback |
[in] | callback | the callback function |
- Returns
-
Definition at line 417 of file control.c.
◆ fr_control_callback_delete()
Delete a callback for an ID.
- Parameters
-
[in] | c | the control structure |
[in] | id | the ident of this message. |
- Returns
-
Definition at line 454 of file control.c.
◆ fr_control_create()
Create a control-plane signaling path.
- Parameters
-
[in] | ctx | the talloc context |
[in] | el | the event list for the control socket |
[in] | aq | the atomic queue where we will be pushing message data |
- Returns
- NULL on error
- fr_control_t on success
Definition at line 149 of file control.c.
◆ fr_control_gc()
◆ fr_control_message_pop()
Pop control-plane message.
This function is called ONLY from the receiving thread.
- Parameters
-
[in] | aq | the recipients atomic queue for control-plane messages |
[out] | p_id | the ident of this message. |
[in,out] | data | where the data is stored |
[in] | data_size | the size of the buffer where we store the data. |
- Returns
- <0 the size of the data we need to read the next message
- 0 this kevent is not for us.
- >0 the amount of data we've read
Definition at line 377 of file control.c.
◆ fr_control_message_push()
Push a control-plane message.
This function is called ONLY from the originating thread.
- Parameters
-
[in] | c | the control structure |
[in] | rb | the callers ring buffer for message allocation. |
[in] | id | the ident of this message. |
[in] | data | the data to write to the control plane |
[in] | data_size | the size of the data to write to the control plane. |
- Returns
- -2 on ring buffer full
- <0 on error
- 0 on success
Definition at line 298 of file control.c.
◆ fr_control_message_send()
Send a control-plane message.
This function is called ONLY from the originating thread.
- Parameters
-
[in] | c | the control structure |
[in] | rb | the callers ring buffer for message allocation. |
[in] | id | the ident of this message. |
[in] | data | the data to write to the control plane |
[in] | data_size | the size of the data to write to the control plane. |
- Returns
-
Definition at line 343 of file control.c.
◆ fr_control_same_thread()