The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
listen.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#include <freeradius-devel/io/base.h>
18#include <freeradius-devel/io/application.h>
19#include <freeradius-devel/server/time_tracking.h>
20
21/** Describes a path data takes to/from the wire to/from fr_pair_ts
22 *
23 */
24typedef struct fr_listen fr_listen_t;
25struct fr_listen {
26 fr_rb_node_t virtual_server_node; //!< Entry into the virtual server's tree of listeners.
27
28 int fd; //!< file descriptor for this socket - set by open
29 char const *name; //!< printable name for this socket - set by open
30 fr_dict_t const *dict; //!< dictionary for this listener
31
32 fr_app_io_t const *app_io; //!< I/O path functions.
33 void const *app_io_instance; //!< I/O path configuration context.
34 void *thread_instance; //!< thread / socket context
35
36 fr_socket_t *app_io_addr; //!< for tracking duplicate sockets
37
38 fr_app_t const *app;
39 void const *app_instance;
40
41 CONF_SECTION *server_cs; //!< CONF_SECTION of the server
42
43 bool connected; //!< is this for a connected socket?
44 bool track_duplicates; //!< do we track duplicate packets?
45 bool no_write_callback; //!< sometimes we don't need to do writes
46 bool non_socket_listener; //!< special internal listener that does not use sockets.
47 bool needs_full_setup; //!< Set to true to avoid the short cut when adding the listener.
48 ///< Added for rlm_detail which requires inst->parent->sc to be
49 ///< populated when event_list_set callback is run which doesn't
50 ///< happen if the short cut is taken.
51
52 size_t default_message_size; //!< copied from app_io, but may be changed
53 size_t num_messages; //!< for the message ring buffer
54};
55
56/**
57 * Minimal data structure to use the new code.
58 */
59struct fr_async_s {
62
65
66 fr_dlist_t entry; //!< in the list of requests associated with this channel
67
69 fr_listen_t *listen; //!< How we received this request,
70 //!< and how we'll send the reply.
71 uint32_t priority; //!< higher == higher priority
72
73 uint32_t sequence; //!< higher == higher priority, too
74};
75
Public structure describing an I/O path for a protocol.
Definition app_io.h:33
Describes a new application (protocol)
Definition application.h:71
A section grouping multiple CONF_PAIR.
Definition cf_priv.h:101
A full channel, which consists of two ends.
Definition channel.c:144
Entry in a doubly linked list.
Definition dlist.h:41
fr_rb_node_t virtual_server_node
Entry into the virtual server's tree of listeners.
Definition listen.h:26
fr_time_t recv_time
Definition listen.h:60
fr_channel_t * channel
Definition listen.h:64
size_t num_messages
for the message ring buffer
Definition listen.h:53
fr_listen_t * listen
How we received this request, and how we'll send the reply.
Definition listen.h:69
bool non_socket_listener
special internal listener that does not use sockets.
Definition listen.h:46
char const * name
printable name for this socket - set by open
Definition listen.h:29
uint32_t sequence
higher == higher priority, too
Definition listen.h:73
fr_dlist_t entry
in the list of requests associated with this channel
Definition listen.h:66
bool track_duplicates
do we track duplicate packets?
Definition listen.h:44
fr_socket_t * app_io_addr
for tracking duplicate sockets
Definition listen.h:36
void const * app_instance
Definition listen.h:39
size_t default_message_size
copied from app_io, but may be changed
Definition listen.h:52
fr_time_tracking_t tracking
Definition listen.h:63
bool connected
is this for a connected socket?
Definition listen.h:43
fr_app_t const * app
Definition listen.h:38
void const * app_io_instance
I/O path configuration context.
Definition listen.h:33
void * packet_ctx
Definition listen.h:68
int fr_io_listen_free(fr_listen_t *li)
Definition master.c:3060
uint32_t priority
higher == higher priority
Definition listen.h:71
CONF_SECTION * server_cs
CONF_SECTION of the server.
Definition listen.h:41
void * thread_instance
thread / socket context
Definition listen.h:34
bool no_write_callback
sometimes we don't need to do writes
Definition listen.h:45
int fd
file descriptor for this socket - set by open
Definition listen.h:28
fr_dict_t const * dict
dictionary for this listener
Definition listen.h:30
bool needs_full_setup
Set to true to avoid the short cut when adding the listener.
Definition listen.h:47
fr_app_io_t const * app_io
I/O path functions.
Definition listen.h:32
fr_event_list_t * el
Definition listen.h:61
Minimal data structure to use the new code.
Definition listen.h:59
Stores all information relating to an event list.
Definition event.c:377
unsigned int uint32_t
"server local" time.
Definition time.h:69
Holds information necessary for binding or connecting to a socket.
Definition socket.h:63