summaryrefslogtreecommitdiff
path: root/lib/examples
diff options
context:
space:
mode:
Diffstat (limited to 'lib/examples')
-rw-r--r--lib/examples/client-blocking.c10
-rw-r--r--lib/examples/client.conf2
2 files changed, 3 insertions, 9 deletions
diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c
index f26cd6c..7d3869a 100644
--- a/lib/examples/client-blocking.c
+++ b/lib/examples/client-blocking.c
@@ -6,8 +6,8 @@
#include <stdlib.h>
#include <assert.h>
#include <event2/event.h>
-#include <freeradius/libradius.h>
#include <radsec/radsec.h>
+#include <radsec/radsec-impl.h>
#include <radsec/request.h>
#include "err.h"
#include "debug.h" /* For rs_dump_packet(). */
@@ -37,8 +37,6 @@ blocking_client (const char *config_fn, const char *configuration,
{
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);
@@ -54,8 +52,6 @@ blocking_client (const char *config_fn, const char *configuration,
#else /* defined (USE_CONFIG_FILE) */
if (rs_context_read_config (h, config_fn))
goto cleanup;
- if (rs_context_init_freeradius_dict (h, NULL))
- goto cleanup;
if (rs_conn_create (h, &conn, configuration))
goto cleanup;
#endif /* defined (USE_CONFIG_FILE) */
@@ -80,10 +76,10 @@ blocking_client (const char *config_fn, const char *configuration,
if (resp)
{
rs_dump_packet (resp);
- if (rs_packet_frpkt (resp)->code == PW_AUTHENTICATION_ACK)
+ if (rs_packet_code (resp) == PW_ACCESS_ACCEPT)
printf ("Good auth.\n");
else
- printf ("Bad auth: %d\n", rs_packet_frpkt (resp)->code);
+ printf ("Bad auth: %d\n", rs_packet_code (resp));
}
else
fprintf (stderr, "%s: no response\n", __func__);
diff --git a/lib/examples/client.conf b/lib/examples/client.conf
index cedd259..bf57434 100644
--- a/lib/examples/client.conf
+++ b/lib/examples/client.conf
@@ -1,5 +1,3 @@
-dictionary = "/home/linus/usr/moonshot/share/freeradius/dictionary"
-
realm blocking-udp {
type = "UDP"
timeout = 2