summaryrefslogtreecommitdiffstats
path: root/lib/libradius/radlib.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2002-05-10 02:40:23 +0000
committerbrian <brian@FreeBSD.org>2002-05-10 02:40:23 +0000
commit4d8198d74c4130fe8170db7d51dc0674790e0336 (patch)
tree41b9cc12992b2dc80fec6a896e452c373504328c /lib/libradius/radlib.c
parentddf552e1ed4f89696a2a8ad954a3918a9f2f8b94 (diff)
downloadFreeBSD-src-4d8198d74c4130fe8170db7d51dc0674790e0336.zip
FreeBSD-src-4d8198d74c4130fe8170db7d51dc0674790e0336.tar.gz
Add rad_get_vendor_attr() for deciphering vendor attributes received
from the RADIUS server.
Diffstat (limited to 'lib/libradius/radlib.c')
-rw-r--r--lib/libradius/radlib.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c
index c94481e..bc3679e 100644
--- a/lib/libradius/radlib.c
+++ b/lib/libradius/radlib.c
@@ -866,6 +866,19 @@ split(char *str, char *fields[], int maxfields, char *msg, size_t msglen)
}
int
+rad_get_vendor_attr(u_int32_t *vendor, const void **data, size_t *len)
+{
+ struct vendor_attribute *attr;
+
+ attr = (struct vendor_attribute *)*data;
+ *vendor = ntohl(attr->vendor_value);
+ *data = attr->attrib_data;
+ *len = attr->attrib_len - 2;
+
+ return (attr->attrib_type);
+}
+
+int
rad_put_vendor_addr(struct rad_handle *h, int vendor, int type,
struct in_addr addr)
{
OpenPOWER on IntegriCloud