{
struct rs_peer *server;
- if (rs_context_init_freeradius_dict (h, "/usr/share/freeradius/dictionary"))
- goto cleanup;
if (rs_conn_create (h, &conn, NULL))
goto cleanup;
rs_conn_set_type (conn, RS_CONN_TYPE_UDP);
#else /* defined (USE_CONFIG_FILE) */
if (rs_context_read_config (h, av1))
goto cleanup;
- if (rs_context_init_freeradius_dict (h, NULL))
- goto cleanup;
if (rs_conn_create (h, &conn, av2))
goto cleanup;
#endif /* defined (USE_CONFIG_FILE) */
all other libradsec objects have been freed. */
void rs_context_destroy(struct rs_context *ctx);
-/** Initialize FreeRADIUS dictionary needed for creating packets.
-
- \a ctx Context.
-
- \a dict Optional string with full path to FreeRADIUS dictionary.
- If \a dict is NULL the path to the dictionary file is taken from
- the "dictionary" configuration directive. Note that the
- configuration file must be read prior to using this option (see \a
- rs_context_read_config).
-
- \return RSE_OK (0) on success, RSE_NOMEM on memory allocation
- error and RSE_FR on FreeRADIUS error. */
-int rs_context_init_freeradius_dict(struct rs_context *ctx, const char *dict);
-
/** Set allocation scheme to use. \a scheme is the allocation scheme
to use, see \a rs_alloc_scheme. \return On success, RSE_OK (0) is
returned. On error, !0 is returned and a struct \a rs_error is
return RSE_OK;
}
-/** Initialize freeradius dictionary. */
-int
-rs_context_init_freeradius_dict (struct rs_context *ctx, const char *dict)
-{
- int r = RSE_OK;
- size_t dictlen;
- char *dir = NULL;
- char *fn = NULL;
-
- if (dict == NULL)
- if (ctx->config != NULL && ctx->config->dictionary)
- dict = ctx->config->dictionary;
-
- dictlen = strlen (dict);
- dir = rs_calloc (ctx, 1, dictlen + 1);
- fn = rs_calloc (ctx, 1, dictlen + 1);
- if (dir == NULL || fn == NULL)
- {
- r = rs_err_ctx_push_fl (ctx, RSE_NOMEM, __FILE__, __LINE__, NULL);
- goto out;
- }
- strncpy (dir, dict, dictlen);
- strncpy (fn, dict, dictlen);
-
- out:
- if (dir)
- rs_free (ctx, dir);
- if (fn)
- rs_free (ctx, fn);
- return r;
-}
-
struct rs_error *
rs_resolv (struct evutil_addrinfo **addr,
rs_conn_type_t type,
rs_conn_set_type
rs_context_create
rs_context_destroy
-rs_context_init_freeradius_dict
rs_context_read_config
rs_context_set_alloc_scheme
rs_dump_packet