aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius/radius.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-19 14:13:06 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-19 14:13:06 (GMT)
commitd04a96b0d64c0bf6a1ab7527c24e2c8359349313 (patch)
treef84c7875a0876b44e633c4fa0f8e730a2c6ce179 /src/radius/radius.c
parenta9f92c487f4f7ca10a139e62b013c14407e0e0fd (diff)
downloadhostap-d04a96b0d64c0bf6a1ab7527c24e2c8359349313.zip
hostap-d04a96b0d64c0bf6a1ab7527c24e2c8359349313.tar.gz
hostap-d04a96b0d64c0bf6a1ab7527c24e2c8359349313.tar.bz2
Add documentation for RADIUS code and some minor cleanup
Diffstat (limited to 'src/radius/radius.c')
-rw-r--r--src/radius/radius.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/radius/radius.c b/src/radius/radius.c
index 75c2677..c3ce86d 100644
--- a/src/radius/radius.c
+++ b/src/radius/radius.c
@@ -1,6 +1,6 @@
/*
- * hostapd / RADIUS message processing
- * Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi>
+ * RADIUS message processing
+ * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -12,12 +12,15 @@
* See README and COPYING for more details.
*/
-#include "includes.h"
+#include "utils/includes.h"
-#include "common.h"
-#include "radius.h"
+#include "utils/common.h"
#include "crypto/md5.h"
#include "crypto/crypto.h"
+#include "radius.h"
+
+
+static int radius_msg_initialize(struct radius_msg *msg, size_t init_len);
static struct radius_attr_hdr *
@@ -27,6 +30,13 @@ radius_get_attr_hdr(struct radius_msg *msg, int idx)
}
+static void radius_msg_set_hdr(struct radius_msg *msg, u8 code, u8 identifier)
+{
+ msg->hdr->code = code;
+ msg->hdr->identifier = identifier;
+}
+
+
struct radius_msg *radius_msg_new(u8 code, u8 identifier)
{
struct radius_msg *msg;
@@ -46,7 +56,7 @@ struct radius_msg *radius_msg_new(u8 code, u8 identifier)
}
-int radius_msg_initialize(struct radius_msg *msg, size_t init_len)
+static int radius_msg_initialize(struct radius_msg *msg, size_t init_len)
{
if (msg == NULL || init_len < sizeof(struct radius_hdr))
return -1;
@@ -76,13 +86,6 @@ int radius_msg_initialize(struct radius_msg *msg, size_t init_len)
}
-void radius_msg_set_hdr(struct radius_msg *msg, u8 code, u8 identifier)
-{
- msg->hdr->code = code;
- msg->hdr->identifier = identifier;
-}
-
-
void radius_msg_free(struct radius_msg *msg)
{
os_free(msg->buf);