diff options
Diffstat (limited to 'lib/include')
-rw-r--r-- | lib/include/radsec/radsec-impl.h | 16 | ||||
-rw-r--r-- | lib/include/radsec/radsec.h | 24 |
2 files changed, 30 insertions, 10 deletions
diff --git a/lib/include/radsec/radsec-impl.h b/lib/include/radsec/radsec-impl.h index 3c1c53c..f8891ee 100644 --- a/lib/include/radsec/radsec-impl.h +++ b/lib/include/radsec/radsec-impl.h @@ -35,7 +35,8 @@ struct rs_error { char buf[1024]; }; -struct rs_peer { /* Config object for a connection. */ +/** Configuration object for a connection. */ +struct rs_peer { struct rs_connection *conn; struct rs_realm *realm; struct evutil_addrinfo *addr; @@ -43,7 +44,8 @@ struct rs_peer { /* Config object for a connection. */ struct rs_peer *next; }; -struct rs_realm { /* Config object for a RADIUS realm. */ +/** Configuration object for a RADIUS realm. */ +struct rs_realm { char *name; enum rs_conn_type type; int timeout; @@ -56,12 +58,18 @@ struct rs_realm { /* Config object for a RADIUS realm. */ struct rs_realm *next; }; -struct rs_context { +/** Top configuration object. */ +struct rs_config { + char *dictionary; struct rs_realm *realms; + cfg_t *cfg; +}; + +struct rs_context { + struct rs_config *config; struct rs_alloc_scheme alloc_scheme; struct rs_error *err; fr_randctx fr_randctx; - cfg_t *cfg; }; struct rs_connection { diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h index 6b0a69c..a35077c 100644 --- a/lib/include/radsec/radsec.h +++ b/lib/include/radsec/radsec.h @@ -91,18 +91,30 @@ struct rs_conn_callbacks { that the context must not be freed before all other libradsec objects have been freed. - \a ctx Address of pointer to a struct rs_context. This is the output. + \a ctx Address of pointer to a struct rs_context. This is the + output of this function. - \a dict Name of a FreeRADIUS dictionary. - - \return RSE_OK (0) on success, RSE_NOMEM on out of memory or - RSE_FR on FreeRADIUS initialization error. */ -int rs_context_create(struct rs_context **ctx, const char *dict); + \return RSE_OK (0) on success or RSE_NOMEM on out of memory. */ +int rs_context_create(struct rs_context **ctx); /** Free a context. Note that the context must not be freed before 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 |