26 RCSIDH(channel_h,
"$Id: 2caa99839ef3f484e2bbcb3aec4800e2761ba1ab $")
32 #include <freeradius-devel/util/table.h>
53 #include <freeradius-devel/io/base.h>
54 #include <freeradius-devel/io/control.h>
55 #include <freeradius-devel/io/message.h>
56 #include <freeradius-devel/util/dlist.h>
57 #include <freeradius-devel/util/heap.h>
58 #include <freeradius-devel/util/log.h>
60 #include <sys/types.h>
61 #include <sys/event.h>
149 #define PRIORITY_NOW (1 << 16)
150 #define PRIORITY_HIGH (1 << 15)
151 #define PRIORITY_NORMAL (1 << 14)
152 #define PRIORITY_LOW (1 << 13)
A full channel, which consists of two ends.
fr_message_t m
the message header
int fr_channel_service_kevent(fr_channel_t *ch, fr_control_t *c, struct kevent const *kev)
void fr_channel_responder_uctx_add(fr_channel_t *ch, void *ctx)
Add responder-specific data to a channel.
void * fr_channel_requestor_uctx_get(fr_channel_t *ch)
Get network-specific data from a channel.
fr_table_num_sorted_t const channel_signals[]
@ FR_CHANNEL_DATA_READY_REQUESTOR
@ FR_CHANNEL_DATA_READY_RESPONDER
void * packet_ctx
Packet specific context for holding client information, and other proto_* specific information that n...
fr_channel_t * fr_channel_create(TALLOC_CTX *ctx, fr_control_t *frontend, fr_control_t *worker, bool same)
Create a new channel.
bool fr_channel_recv_reply(fr_channel_t *ch)
Receive a reply message from the channel.
fr_time_delta_t message_interval
Interval between messages.
int fr_channel_send_request(fr_channel_t *ch, fr_channel_data_t *cm)
Send a request message into the channel.
size_t channel_signals_len
fr_listen_t * listen
for tracking packet transport, etc.
void(* fr_channel_recv_callback_t)(void *ctx, fr_channel_t *ch, fr_channel_data_t *cd)
size_t channel_packet_priority_len
void * fr_channel_responder_uctx_get(fr_channel_t *ch)
Get responder-specific data from a channel.
uint64_t packets
Number of actual data packets.
int fr_channel_signal_responder_close(fr_channel_t *ch)
Signal a responder that the channel is closing.
uint64_t resignals
Number of signals resent.
fr_table_num_sorted_t const channel_packet_priority[]
void fr_channel_requestor_uctx_add(fr_channel_t *ch, void *ctx)
Add network-specific data to a channel.
uint64_t outstanding
Number of outstanding requests with no reply.
fr_time_t last_sent_signal
The last time when we signaled the other end.
fr_channel_event_t fr_channel_service_message(fr_time_t when, fr_channel_t **p_channel, void const *data, size_t data_size)
Service a control-plane message.
fr_time_t last_read_other
Last time we successfully read a message from the other the channel.
int fr_channel_set_recv_request(fr_channel_t *ch, void *ctx, fr_channel_recv_callback_t recv_reply))
bool fr_channel_recv_request(fr_channel_t *ch)
Receive a request message from the channel.
int fr_channel_null_reply(fr_channel_t *ch)
Don't send a reply message into the channel.
int fr_channel_set_recv_reply(fr_channel_t *ch, void *ctx, fr_channel_recv_callback_t recv_reply))
int fr_channel_responder_sleeping(fr_channel_t *ch)
Signal a channel that the responder is sleeping.
int fr_channel_send_reply(fr_channel_t *ch, fr_channel_data_t *cd)
Send a reply message into the channel.
void fr_channel_stats_log(fr_channel_t const *ch, fr_log_t const *log, char const *file, int line)
fr_time_t last_write
Last write to the channel.
uint32_t priority
Priority of this packet.
bool fr_channel_active(fr_channel_t *ch)
Check if a channel is active.
uint64_t kevents
Number of times we've looked at kevents.
int fr_channel_responder_ack_close(fr_channel_t *ch)
Acknowledge that the channel is closing.
int fr_channel_signal_open(fr_channel_t *ch)
Send a channel to a responder.
uint64_t signals
Number of kevent signals we've sent.
Channel information which is added to a message.
Statistics for the channel.
unsigned int fr_heap_index_t
An element in a lexicographically sorted array of name to num mappings.
A time delta, a difference in time measured in nanoseconds.