23 RCSID(
"$Id: d5708ca45ee5709c3a47f5f2b1e748ff0a875a86 $")
25 #include <freeradius-devel/libradius.h>
27 #include <freeradius-devel/conf.h>
28 #include <freeradius-devel/modpriv.h>
29 #include <freeradius-devel/modcall.h>
39 #include <freeradius-devel/log.h>
53 return waitpid(pid, status, 0);
83 fprintf(stderr,
"usage: map_unit [OPTS] filename ...\n");
84 fprintf(stderr,
" -d <raddb> Set user dictionary directory (defaults to " RADDBDIR
").\n");
85 fprintf(stderr,
" -D <dictdir> Set main dictionary directory (defaults to " DICTDIR
").\n");
86 fprintf(stderr,
" -O <output_dir> Set output directory\n");
87 fprintf(stderr,
" -x Debugging mode.\n");
88 fprintf(stderr,
" -M Show program version information.\n");
96 char const *name1, *name2;
101 memset(&main_config, 0,
sizeof(main_config));
105 fprintf(stderr,
"map_unit: Failed parsing %s\n",
115 talloc_free(main_config.
config);
123 if (rcode < 0)
return -1;
138 printf(
"%s {\n", name1);
140 printf(
"%s %s {\n", name1, name2);
143 for (map = head; map != NULL; map = map->
next) {
149 talloc_free(main_config.
config);
153 int main(
int argc,
char *argv[])
168 while ((c = getopt(argc, argv,
"d:D:xMh")) != EOF)
switch (c) {
186 argc -= (optind - 1);
187 argv += (optind - 1);
219 if (rcode < 0) rcode = 1;
size_t map_snprint(char *out, size_t outlen, vp_map_t const *map)
Print a map to a string.
static char const * dict_dir
module_instance_t * module_instantiate(UNUSED CONF_SECTION *modules, UNUSED char const *askedname)
static char const * radius_dir
Path to raddb directory.
Main server configuration.
The module is OK, continue.
int fr_dict_read(fr_dict_t *dict, char const *dir, char const *filename)
int cf_file_read(CONF_SECTION *cs, char const *file)
#define rad_waitpid(a, b)
int fr_log_talloc_report(TALLOC_CTX *ctx)
Generate a talloc memory report for a context and print to stderr/stdout.
struct vp_map * next
The next valuepair map.
int fr_fault_setup(char const *cmd, char const *program)
Registers signal handlers to execute panic_action on fatal signal.
int map_afrom_cs(vp_map_t **out, CONF_SECTION *cs, pair_lists_t dst_list_def, pair_lists_t src_list_def, map_validate_t validate, void *ctx, unsigned int max) CC_HINT(nonnull(1
Vendors and attribute names.
int fr_check_lib_magic(uint64_t magic)
Check if the application linking to the library has the correct magic number.
static int comp(void const *a, void const *b)
module_instance_t * module_instantiate_method(UNUSED CONF_SECTION *modules, UNUSED char const *name, UNUSED rlm_components_t *method)
void void fr_perror(char const *,...) CC_HINT(format(printf
Attributes in incoming or internally proxied request.
#define RADIUS_DICTIONARY
void void cf_log_err_cs(CONF_SECTION const *cs, char const *fmt,...) CC_HINT(format(printf
enum rlm_rcodes rlm_rcode_t
Return codes indicating the result of the module call.
CONF_SECTION * cf_section_sub_find(CONF_SECTION const *, char const *name)
Find a sub-section in a section.
static int process_file(char const *filename)
char const * cf_section_name1(CONF_SECTION const *cs)
int main(int argc, char *argv[])
CONF_SECTION * config
Root of the server config.
int modcall_fixup_update(vp_map_t *map, void *ctx)
log_lvl_t rad_debug_lvl
Global debugging level.
enum rlm_components rlm_components_t
The different section components of the server.
CONF_SECTION * cf_section_alloc(CONF_SECTION *parent, char const *name1, char const *name2)
Allocate a CONF_SECTION.
char const * get_radius_dir(void)
Get the global radius config directory.
static void NEVER_RETURNS usage(void)
main_config_t main_config
Main server configuration.
int fr_dict_init(TALLOC_CTX *ctx, fr_dict_t **out, char const *dir, char const *fn, char const *name)
(re)initialize a protocol dictionary
rlm_rcode_t indexed_modcall(UNUSED rlm_components_t comp, UNUSED int idx, UNUSED REQUEST *request)
char const * cf_section_name2(CONF_SECTION const *cs)
#define RADIUSD_MAGIC_NUMBER