2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 * @brief Structures, prototypes and global variables for the FreeRADIUS server.
24 * @copyright 1999-2000,2002-2008 The FreeRADIUS server project
27 #include <freeradius-devel/ident.h>
28 RCSIDH(radiusd_h, "$Id$")
30 #include <freeradius-devel/libradius.h>
31 #include <freeradius-devel/radpaths.h>
32 #include <freeradius-devel/conf.h>
33 #include <freeradius-devel/conffile.h>
34 #include <freeradius-devel/event.h>
35 #include <freeradius-devel/connection.h>
37 typedef struct request REQUEST;
44 #define REQUEST_MAGIC (0xdeadbeef)
48 * WITH_VMPS is handled by src/include/features.h
55 #include <freeradius-devel/tls.h>
58 #include <freeradius-devel/stats.h>
59 #include <freeradius-devel/realms.h>
61 #ifdef WITH_COMMAND_SOCKET
62 #define PW_RADMIN_PORT 18120
72 typedef struct request_data_t request_data_t;
74 typedef struct radclient {
76 fr_ipaddr_t src_ipaddr;
81 int message_authenticator;
86 int number; /* internal use only */
87 const CONF_SECTION *cs;
90 #ifdef WITH_ACCOUNTING
101 fr_socket_limit_t limit;
104 #ifdef WITH_DYNAMIC_CLIENTS
106 int dynamic; /* was dynamically defined */
108 time_t last_new_client;
115 home_server *coa_server;
116 home_pool_t *coa_pool;
121 * Types of listeners.
123 * Ordered by priority!
125 typedef enum RAD_LISTEN_TYPE {
131 #ifdef WITH_ACCOUNTING
143 #ifdef WITH_COMMAND_SOCKET
154 * For listening on multiple IP's and ports.
156 typedef struct rad_listen_t rad_listen_t;
157 typedef void (*radlog_func_t)(int, int, REQUEST *, const char *, ...);
159 typedef void (*fr_request_process_t)(REQUEST *, int);
161 * Function handler for requests.
163 typedef int (*RAD_REQUEST_FUNP)(REQUEST *);
165 #define REQUEST_DATA_REGEX (0xadbeef00)
166 #define REQUEST_MAX_REGEX (8)
170 uint32_t magic; //!< Magic number used to
171 //!< detect memory corruption,
172 //!< or request structs that
173 //!< have not been properly
176 RADIUS_PACKET *packet; //!< Incoming request.
178 RADIUS_PACKET *proxy; //!< Outgoing request.
180 RADIUS_PACKET *reply; //!< Outgoing response.
182 RADIUS_PACKET *proxy_reply; //!< Incoming response.
184 VALUE_PAIR *config_items; //!< VALUE_PAIR s used to set
185 //!< per request parameters for
186 //!< modules and the server
187 //!< core at runtime.
188 VALUE_PAIR *username; //!< Cached username VALUE_PAIR.
189 VALUE_PAIR *password; //!< Cached password VALUE_PAIR.
191 fr_request_process_t process; //!< The function to call to
192 //!< move the request through
193 //!< the state machine.
195 RAD_REQUEST_FUNP handle; //!< The function to call to
196 //!< move the request through
197 //!< the various server
198 //!< configuration sections.
200 struct main_config_t *root; //!< Pointer to the main config
201 //!< hack to try and deal with
204 request_data_t *data; //!< Request metadata.
206 RADCLIENT *client; //!< The client that originally
207 //!< sent us the request.
209 #ifdef HAVE_PTHREAD_H
210 pthread_t child_pid; //!< Current thread handling
213 time_t timestamp; //!< When the request was
215 unsigned int number; //!< Monotonically increasing
216 //!< request number. Reset on
219 rad_listen_t *listener; //!< The listener that received
222 rad_listen_t *proxy_listener;//!< Listener for outgoing
227 int simul_max; //!< Maximum number of
228 //!< concurrent sessions for
230 #ifdef WITH_SESSION_MGMT
231 int simul_count; //!< The current number of
232 //!< sessions for this user.
233 int simul_mpp; //!< WEIRD: 1 is false,
237 int options; //!< Request options, currently
238 //!< just holds the debug level
239 //!< for the request.
241 const char *module; //!< Module the request is
242 //!< currently being processed
244 const char *component; //!< Section the request is
251 RAD_LISTEN_TYPE priority;
260 home_server *home_server;
261 home_pool_t *home_pool; /* for dynamic failover */
263 struct timeval proxy_retransmit;
265 int num_proxied_requests;
266 int num_proxied_responses;
271 radlog_func_t radlog; //!< Function to call to output
272 //!< log messages about this
275 REQUEST *coa; //!< CoA request originated
276 //!< by this request.
277 int num_coa_requests;//!< Counter for number of
278 //!< requests sent including
281 }; /* REQUEST typedef */
283 #define RAD_REQUEST_OPTION_NONE (0)
284 #define RAD_REQUEST_OPTION_DEBUG (1)
285 #define RAD_REQUEST_OPTION_DEBUG2 (2)
286 #define RAD_REQUEST_OPTION_DEBUG3 (3)
287 #define RAD_REQUEST_OPTION_DEBUG4 (4)
289 #define REQUEST_ACTIVE (1)
290 #define REQUEST_STOP_PROCESSING (2)
291 #define REQUEST_COUNTED (3)
293 #define REQUEST_QUEUED (1)
294 #define REQUEST_RUNNING (2)
295 #define REQUEST_PROXIED (3)
296 #define REQUEST_REJECT_DELAY (4)
297 #define REQUEST_CLEANUP_DELAY (5)
298 #define REQUEST_DONE (6)
300 typedef struct radclient_list RADCLIENT_LIST;
302 typedef enum pair_lists {
303 PAIR_LIST_UNKNOWN = 0,
308 PAIR_LIST_PROXY_REQUEST,
309 PAIR_LIST_PROXY_REPLY,
319 extern const FR_NAME_NUMBER pair_lists[];
321 typedef enum requests {
325 REQUEST_PARENT /* For future use */
328 extern const FR_NAME_NUMBER request_refs[];
330 typedef struct pair_list {
336 struct pair_list *next;
337 struct pair_list *lastdefault;
340 typedef int (*rad_listen_recv_t)(rad_listen_t *);
341 typedef int (*rad_listen_send_t)(rad_listen_t *, REQUEST *);
342 typedef int (*rad_listen_print_t)(const rad_listen_t *, char *, size_t);
343 typedef int (*rad_listen_encode_t)(rad_listen_t *, REQUEST *);
344 typedef int (*rad_listen_decode_t)(rad_listen_t *, REQUEST *);
346 struct rad_listen_t {
347 struct rad_listen_t *next; /* should be rbtree stuff */
350 * For normal sockets.
352 RAD_LISTEN_TYPE type;
361 fr_tls_server_conf_t *tls;
364 rad_listen_recv_t recv;
365 rad_listen_send_t send;
366 rad_listen_encode_t encode;
367 rad_listen_decode_t decode;
368 rad_listen_print_t print;
370 const CONF_SECTION *cs;
379 * This shouldn't really be exposed...
381 typedef struct listen_socket_t {
383 * For normal sockets.
385 fr_ipaddr_t my_ipaddr;
388 const char *interface;
397 /* for outgoing sockets */
399 fr_ipaddr_t other_ipaddr;
405 /* for a proxy connecting to home servers */
410 fr_socket_limit_t limit;
412 struct listen_socket_t *parent;
415 RADIUS_PACKET *packet; /* for reading partial packets */
420 REQUEST *request; /* horrible hacks */
422 pthread_mutex_t mutex;
426 RADCLIENT_LIST *clients;
429 #define RAD_LISTEN_STATUS_INIT (0)
430 #define RAD_LISTEN_STATUS_KNOWN (1)
431 #define RAD_LISTEN_STATUS_REMOVE_FD (2)
432 #define RAD_LISTEN_STATUS_CLOSED (3)
433 #define RAD_LISTEN_STATUS_FINISH (4)
435 typedef enum radlog_dest_t {
444 typedef struct main_config_t {
445 struct main_config *next;
447 fr_ipaddr_t myip; /* from the command-line only */
448 int port; /* from the command-line only */
450 int log_auth_badpass;
451 int log_auth_goodpass;
452 int allow_core_dumps;
459 int max_request_time;
462 #ifdef DELETE_BLOCKED_REQUESTS
463 int kill_unresponsive_children;
467 const char *pid_file;
468 rad_listen_t *listen;
471 radlog_dest_t radlog_dest;
472 CONF_SECTION *config;
474 const char *auth_badpass_msg;
475 const char *auth_goodpass_msg;
476 int colourise; //!< Messages output to stderr and
477 //!< stdout may be formatted using
478 //!< VT100 escape sequences.
481 /* DEBUG is defined below */
482 #define DEBUG3 if (debug_flag > 2) log_debug
483 #define DEBUG4 if (debug_flag > 3) log_debug
486 #define RDEBUG(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 1, request, fmt, ## __VA_ARGS__)
487 #define RDEBUGW(fmt, ...) if(request && request->radlog) request->radlog(L_DBG_WARN, 1, request, fmt, ## __VA_ARGS__)
488 #define RDEBUGE(fmt, ...) if(request && request->radlog) request->radlog(L_DBG_ERR, 1, request, fmt, ## __VA_ARGS__)
490 #define RDEBUG2(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 2, request, fmt, ## __VA_ARGS__)
491 #define RDEBUG2W(fmt, ...) if(request && request->radlog) request->radlog(L_DBG_WARN, 2, request, fmt, ## __VA_ARGS__)
492 #define RDEBUG2E(fmt, ...) if(request && request->radlog) request->radlog(L_DBG_ERR, 2, request, fmt, ## __VA_ARGS__)
494 #define RDEBUG3(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 3, request, fmt, ## __VA_ARGS__)
495 #define RDEBUG4(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 4, request, fmt, ## __VA_ARGS__)
497 #define DEBUG(...) if (debug_flag) radlog(L_DBG, ## __VA_ARGS__)
498 #define DEBUGW(...) if (debug_flag) radlog(L_DBG_WARN, ## __VA_ARGS__)
499 #define DEBUGE(...) if (debug_flag) radlog(L_DBG_ERR, ## __VA_ARGS__)
501 #define DEBUG2 if (debug_flag > 1) log_debug
502 #define DEBUG2W(...) if (debug_flag > 1) radlog(L_DBG_WARN, ## __VA_ARGS__)
505 #define DEBUG if (debug_flag) log_debug
506 #define DEBUG2 if (debug_flag > 1) log_debug
509 #define RDEBUG2 DEBUG2
510 #define RDEBUG3 DEBUG3
511 #define RDEBUG4 DEBUG4
514 void log_talloc(const char *message);
515 void log_talloc_report(TALLOC_CTX *ctx);
517 #define SECONDS_PER_DAY 86400
518 #define MAX_REQUEST_TIME 30
519 #define CLEANUP_DELAY 5
520 #define MAX_REQUESTS 256
521 #define RETRY_DELAY 5
522 #define RETRY_COUNT 3
523 #define DEAD_TIME 120
532 #define L_DBG_WARN 17
534 #define L_DBG_WARN2 19
535 #define L_DBG_ERR2 20
538 /* for paircompare_register */
539 typedef int (*RAD_COMPARE_FUNC)(void *instance, REQUEST *,VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR **);
541 typedef enum request_fail {
542 REQUEST_FAIL_UNKNOWN = 0,
543 REQUEST_FAIL_NO_THREADS, //!< No threads to handle it.
544 REQUEST_FAIL_DECODE, //!< Rad_decode didn't like it.
545 REQUEST_FAIL_PROXY, //!< Call to proxy modules failed.
546 REQUEST_FAIL_PROXY_SEND, //!< Proxy_send didn't like it.
547 REQUEST_FAIL_NO_RESPONSE, //!< We weren't told to respond,
549 REQUEST_FAIL_HOME_SERVER, //!< The home server didn't respond.
550 REQUEST_FAIL_HOME_SERVER2, //!< Another case of the above.
551 REQUEST_FAIL_HOME_SERVER3, //!< Another case of the above.
552 REQUEST_FAIL_NORMAL_REJECT, //!< Authentication failure.
553 REQUEST_FAIL_SERVER_TIMEOUT //!< The server took too long to
554 //!< process the request.
560 * We really shouldn't have this many.
562 extern const char *progname;
563 extern int debug_flag;
564 extern const char *radacct_dir;
565 extern const char *radlog_dir;
566 extern const char *radlib_dir;
567 extern char *radius_dir;
568 extern const char *radius_libdir;
569 extern uint32_t expiration_seconds;
570 extern int log_stripped_names;
571 extern int log_auth_detail;
572 extern const char *radiusd_version;
573 void radius_signal_self(int flag);
575 #define RADIUS_SIGNAL_SELF_NONE (0)
576 #define RADIUS_SIGNAL_SELF_HUP (1 << 0)
577 #define RADIUS_SIGNAL_SELF_TERM (1 << 1)
578 #define RADIUS_SIGNAL_SELF_EXIT (1 << 2)
579 #define RADIUS_SIGNAL_SELF_DETAIL (1 << 3)
580 #define RADIUS_SIGNAL_SELF_NEW_FD (1 << 4)
581 #define RADIUS_SIGNAL_SELF_MAX (1 << 5)
585 * Function prototypes.
589 int rad_accounting(REQUEST *);
592 int rad_check_ts(uint32_t nasaddr, unsigned int port, const char *user,
593 const char *sessionid);
594 int session_zap(REQUEST *request, uint32_t nasaddr,
595 unsigned int port, const char *user,
596 const char *sessionid, uint32_t cliaddr,
597 char proto,int session_time);
601 void debug_pair(VALUE_PAIR *);
602 void debug_pair_list(VALUE_PAIR *);
603 void rdebug_pair_list(int, REQUEST *, VALUE_PAIR *);
604 int log_err (char *);
607 void (*reset_signal(int signo, void (*func)(int)))(int);
608 void request_free(REQUEST **request);
609 int rad_mkdir(char *directory, mode_t mode);
610 int rad_checkfilename(const char *filename);
611 void *rad_malloc(size_t size); /* calls exit(1) on error! */
612 void *rad_calloc(size_t size); /* calls exit(1) on error! */
613 void rad_const_free(const void *ptr);
614 void rad_cfree(const void *ptr);
615 REQUEST *request_alloc(void);
616 REQUEST *request_alloc_fake(REQUEST *oldreq);
617 REQUEST *request_alloc_coa(REQUEST *request);
618 int request_data_add(REQUEST *request,
619 void *unique_ptr, int unique_int,
620 void *opaque, void (*free_opaque)(void *));
621 void *request_data_get(REQUEST *request,
622 void *unique_ptr, int unique_int);
623 void *request_data_reference(REQUEST *request,
624 void *unique_ptr, int unique_int);
625 int rad_copy_string(char *dst, const char *src);
626 int rad_copy_variable(char *dst, const char *from);
627 int rad_pps(int *past, int *present, time_t *then,
628 struct timeval *now);
629 int rad_expand_xlat(REQUEST *request, const char *cmd,
630 int max_argc, const char *argv[], int can_fail,
631 size_t argv_buflen, char *argv_buf);
634 RADCLIENT_LIST *clients_init(CONF_SECTION *cs);
635 void clients_free(RADCLIENT_LIST *clients);
636 RADCLIENT_LIST *clients_parse_section(CONF_SECTION *section);
637 void client_free(RADCLIENT *client);
638 int client_add(RADCLIENT_LIST *clients, RADCLIENT *client);
639 #ifdef WITH_DYNAMIC_CLIENTS
640 void client_delete(RADCLIENT_LIST *clients, RADCLIENT *client);
641 RADCLIENT *client_create(RADCLIENT_LIST *clients, REQUEST *request);
643 RADCLIENT *client_find(const RADCLIENT_LIST *clients,
644 const fr_ipaddr_t *ipaddr, int proto);
646 RADCLIENT *client_findbynumber(const RADCLIENT_LIST *clients,
648 RADCLIENT *client_find_old(const fr_ipaddr_t *ipaddr);
649 int client_validate(RADCLIENT_LIST *clients, RADCLIENT *master,
651 RADCLIENT *client_read(const char *filename, int in_server, int flag);
655 int pairlist_read(const char *file, PAIR_LIST **list, int complain);
656 void pairlist_free(PAIR_LIST **);
659 int ssl_check_version(void);
660 const char *ssl_version(void);
664 int vradlog(int, const char *, va_list ap);
665 int radlog(int, const char *, ...)
667 __attribute__ ((format (printf, 2, 3)))
670 int log_debug(const char *, ...)
672 __attribute__ ((format (printf, 1, 2)))
675 void vp_listdebug(VALUE_PAIR *vp);
676 void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ...)
678 __attribute__ ((format (printf, 4, 5)))
683 char *auth_name(char *buf, size_t buflen, REQUEST *request, int do_cli);
684 int rad_authenticate (REQUEST *);
685 int rad_postauth(REQUEST *);
686 int rad_virtual_server(REQUEST *);
689 pid_t radius_start_program(const char *cmd, REQUEST *request,
693 VALUE_PAIR *input_pairs,
695 int radius_readfrom_program(int fd, pid_t pid, int timeout, char *answer, int left);
696 int radius_exec_program(const char *, REQUEST *, int,
697 char *user_msg, int msg_len,
698 VALUE_PAIR *input_pairs,
699 VALUE_PAIR **output_pairs,
701 void exec_trigger(REQUEST *request, CONF_SECTION *cs, const char *name, int quench);
704 int timestr_match(char *, time_t);
707 int paircompare_register(unsigned int attr, int otherattr,
708 RAD_COMPARE_FUNC func,
710 void paircompare_unregister(unsigned int attr, RAD_COMPARE_FUNC func);
711 int paircompare(REQUEST *request, VALUE_PAIR *req_list,
712 VALUE_PAIR *check, VALUE_PAIR **rep_list);
713 int radius_xlat_do(REQUEST *request, VALUE_PAIR *vp);
714 void radius_xlat_move(REQUEST *, VALUE_PAIR **to, VALUE_PAIR **from);
715 int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp);
716 int radius_callback_compare(REQUEST *req, VALUE_PAIR *request,
717 VALUE_PAIR *check, VALUE_PAIR *check_pairs,
718 VALUE_PAIR **reply_pairs);
719 int radius_find_compare(unsigned int attribute);
720 VALUE_PAIR *radius_paircreate(REQUEST *request, VALUE_PAIR **vps,
721 unsigned int attribute, unsigned int vendor);
722 VALUE_PAIR *radius_pairmake(REQUEST *request, VALUE_PAIR **vps,
723 const char *attribute, const char *value,
727 typedef size_t (*RADIUS_ESCAPE_STRING)(REQUEST *, char *out, size_t outlen, const char *in, void *arg);
729 size_t radius_xlat(char * out, int outlen, const char *fmt,
730 REQUEST * request, RADIUS_ESCAPE_STRING func, void *funcarg);
731 typedef size_t (*RAD_XLAT_FUNC)(void *instance, REQUEST *, const char *, char *, size_t);
732 int xlat_register(const char *module, RAD_XLAT_FUNC func,
734 void xlat_unregister(const char *module, RAD_XLAT_FUNC func,
736 void xlat_free(void);
739 extern int thread_pool_init(CONF_SECTION *cs, int *spawn_flag);
740 extern void thread_pool_stop(void);
741 extern int thread_pool_addrequest(REQUEST *, RAD_REQUEST_FUNP);
742 extern pid_t rad_fork(void);
743 extern pid_t rad_waitpid(pid_t pid, int *status);
744 extern int total_active_threads(void);
745 extern void thread_pool_lock(void);
746 extern void thread_pool_unlock(void);
747 extern void thread_pool_queue_stats(int array[RAD_LISTEN_MAX], int pps[2]);
749 #ifndef HAVE_PTHREAD_H
750 #define rad_fork(n) fork()
751 #define rad_waitpid(a,b) waitpid(a,b, 0)
755 /* Define a global config structure */
756 extern struct main_config_t mainconfig;
758 int read_mainconfig(int reload);
759 int free_mainconfig(void);
760 void hup_mainconfig(void);
761 void hup_logfile(void);
762 void fr_suid_down(void);
763 void fr_suid_up(void);
764 void fr_suid_down_permanent(void);
767 void listen_free(rad_listen_t **head);
768 int listen_init(CONF_SECTION *cs, rad_listen_t **head, int spawn_flag);
769 int proxy_new_listener(home_server *home, int src_port);
770 RADCLIENT *client_listener_find(rad_listen_t *listener,
771 const fr_ipaddr_t *ipaddr, int src_port);
774 RADCLIENT_LIST *listener_find_client_list(const fr_ipaddr_t *ipaddr,
777 rad_listen_t *listener_find_byipaddr(const fr_ipaddr_t *ipaddr, int port,
779 int rad_status_server(REQUEST *request);
782 int radius_event_init(CONF_SECTION *cs, int spawn_flag);
783 void radius_event_free(void);
784 int radius_event_process(void);
785 int event_new_fd(rad_listen_t *listener);
786 void revive_home_server(void *ctx);
787 void mark_home_server_dead(home_server *home, struct timeval *when);
790 int radius_evaluate_condition(REQUEST *request, int modreturn, int depth,
791 const char **ptr, int evaluate_it, int *presult);
792 int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs,
793 VALUE_PAIR *input_vps, const char *name);
794 void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from);
796 VALUE_PAIR **radius_list(REQUEST *request, pair_lists_t list);
797 pair_lists_t radius_list_name(const char **name, pair_lists_t unknown);
798 int radius_request(REQUEST **request, request_refs_t name);
799 request_refs_t radius_request_name(const char **name, request_refs_t unknown);
802 typedef enum vpt_type {
803 VPT_TYPE_UNKNOWN = 0,
804 VPT_TYPE_LITERAL, //!< Is a literal string.
805 VPT_TYPE_XLAT, //!< Needs to be expanded.
806 VPT_TYPE_ATTR, //!< Is an attribute.
807 VPT_TYPE_LIST, //!< Is a list.
808 VPT_TYPE_EXEC //!< Needs to be executed.
811 extern const FR_NAME_NUMBER vpt_types[];
813 /** A pre-parsed template attribute
815 * Value pair template, used when processing various mappings sections
816 * to create a real valuepair later.
818 * @see value_pair_map_t
820 typedef struct value_pair_tmpl_t {
821 const char *name; //!< Original attribute ref string, or
822 //!< where this refers to a none FR
823 //!< attribute, just the string id for
826 request_refs_t request; //!< Request to search or insert in.
827 pair_lists_t list; //!< List to search or insert in.
829 const DICT_ATTR *da; //!< Resolved dictionary attribute.
830 vpt_type_t type; //!< What type of value tmpl refers to.
835 * Value pair maps contain a pair of templates, that describe a src attribute
836 * or value, and a destination attribute.
838 * Neither src or dst need to be an FR attribute, and their type can be inferred
839 * from whether map->da is NULL (not FR).
841 * @see value_pair_tmpl_t
843 typedef struct value_pair_map {
844 value_pair_tmpl_t *dst; //!< Typically describes the attribute
845 //!< to add or modify.
846 value_pair_tmpl_t *src; //!< Typically describes a value or a
847 //!< src attribute to copy.
849 FR_TOKEN op; //!< The operator that controls
850 //!< insertion of the dst attribute.
852 CONF_ITEM *ci; //!< Config item that the map was
853 //!< created from. Mainly used for
854 //!< logging validation errors.
856 struct value_pair_map *next; //!< The next valuepair map.
859 typedef VALUE_PAIR *(*radius_tmpl_getvalue_t)(REQUEST *request,
860 const value_pair_map_t *map,
862 void radius_tmplfree(value_pair_tmpl_t **tmpl);
863 int radius_parse_attr(const char *name, value_pair_tmpl_t *vpt,
864 request_refs_t request_def,
865 pair_lists_t list_def);
866 value_pair_tmpl_t *radius_attr2tmpl(const char *name,
867 request_refs_t request_def,
868 pair_lists_t list_def);
870 value_pair_tmpl_t *radius_str2tmpl(const char *name, FR_TOKEN type);
871 int radius_attrmap(CONF_SECTION *cs, value_pair_map_t **head,
872 pair_lists_t dst_list_def, pair_lists_t src_list_def,
874 value_pair_map_t *radius_cp2map(CONF_PAIR *cp,
875 request_refs_t dst_request_def,
876 pair_lists_t dst_list_def,
877 request_refs_t src_request_def,
878 pair_lists_t src_list_def);
880 int radius_map2request(REQUEST *request, const value_pair_map_t *map,
881 const char *src, radius_tmpl_getvalue_t func, void *ctx);
882 void radius_mapfree(value_pair_map_t **map);
884 int radius_get_vp(REQUEST *request, const char *name, VALUE_PAIR **vp_p);
888 * For run-time patching of which function handles which socket.
890 int dual_tls_recv(rad_listen_t *listener);
891 int dual_tls_send(rad_listen_t *listener, REQUEST *request);
892 int proxy_tls_recv(rad_listen_t *listener);
893 int proxy_tls_send(rad_listen_t *listener, REQUEST *request);