summaryrefslogtreecommitdiff
path: root/lib/include/radsec
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2010-10-03 22:51:29 +0200
committerLinus Nordberg <linus@nordu.net>2010-10-03 22:51:29 +0200
commit4d99bb55ec1368b42daccb29f0440bc166297a17 (patch)
treedff2f47b6555583c71ff38207e7efaedb9dd459e /lib/include/radsec
parent63a5bc0182881d8f806a9acdf47b708492b8a41b (diff)
WIP
Diffstat (limited to 'lib/include/radsec')
-rw-r--r--lib/include/radsec/radsec-impl.h21
-rw-r--r--lib/include/radsec/radsec.h9
2 files changed, 18 insertions, 12 deletions
diff --git a/lib/include/radsec/radsec-impl.h b/lib/include/radsec/radsec-impl.h
index c92d9e9..4f7fa2c 100644
--- a/lib/include/radsec/radsec-impl.h
+++ b/lib/include/radsec/radsec-impl.h
@@ -30,25 +30,30 @@ struct rs_error {
char buf[1024];
};
-struct rs_handle {
- struct rs_alloc_scheme alloc_scheme;
- struct rs_error *err;
- fr_randctx fr_randctx;
- /* TODO: dictionary? */
-};
-
struct rs_peer {
struct rs_connection *conn;
struct evutil_addrinfo *addr;
int fd; /* Socket. */
char is_connecting; /* FIXME: replace with a single state member */
- char is_connected; /* FIXME: replace */
+ char is_connected; /* FIXME: replace with a single state member */
char *secret;
int timeout; /* client only */
int tries; /* client only */
struct rs_peer *next;
};
+struct rs_realm {
+ char *name;
+ struct rs_peer *peers;
+};
+
+struct rs_handle {
+ struct rs_realm *realms;
+ struct rs_alloc_scheme alloc_scheme;
+ struct rs_error *err;
+ fr_randctx fr_randctx;
+};
+
struct rs_connection {
struct rs_handle *ctx;
struct event_base *evb;
diff --git a/lib/include/radsec/radsec.h b/lib/include/radsec/radsec.h
index dea4109..f92da7f 100644
--- a/lib/include/radsec/radsec.h
+++ b/lib/include/radsec/radsec.h
@@ -73,16 +73,17 @@ struct rs_conn_callbacks {
int rs_context_create(struct rs_handle **ctx, const char *dict);
void rs_context_destroy(struct rs_handle *ctx);
int rs_context_set_alloc_scheme(struct rs_handle *ctx, struct rs_alloc_scheme *scheme);
-int rs_context_config_read(struct rs_handle *ctx, const char *config_file);
+int rs_context_read_config(struct rs_handle *ctx, const char *config_file);
/* Server and client configuration. */
+int rs_server_create(struct rs_connection *conn, struct rs_peer **server, const char *config);
+int rs_server_set_address(struct rs_peer *server, const char *hostname, int port);
+int rs_server_set_secret(struct rs_peer *server, const char *secret);
void rs_server_set_timeout(struct rs_peer *server, int timeout);
void rs_server_set_tries(struct rs_peer *server, int tries);
-int rs_server_set_secret(struct rs_peer *server, const char *secret);
/* Connection. */
-int rs_conn_create(struct rs_handle *ctx, struct rs_connection **conn);
-int rs_conn_add_server(struct rs_connection *conn, struct rs_peer **server, rs_conn_type_t type, const char *hostname, int port);
+int rs_conn_create(struct rs_handle *ctx, struct rs_connection **conn, rs_conn_type_t type);
int rs_conn_add_listener(struct rs_connection *conn, rs_conn_type_t type, const char *hostname, int port);
void rs_conn_destroy(struct rs_connection *conn);
int rs_conn_set_eventbase(struct rs_connection *conn, struct event_base *eb);