aboutsummaryrefslogtreecommitdiff
path: root/lib/libradius/radlib.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2002-05-10 02:40:23 +0000
committerBrian Somers <brian@FreeBSD.org>2002-05-10 02:40:23 +0000
commitfc3f62faaaeb10a81002d4fb74f0b7d678da8c2b (patch)
tree41b9cc12992b2dc80fec6a896e452c373504328c /lib/libradius/radlib.c
parent4c04f5d4476d50662f9e7247cdcd53f19d07e293 (diff)
downloadsrc-fc3f62faaaeb10a81002d4fb74f0b7d678da8c2b.tar.gz
src-fc3f62faaaeb10a81002d4fb74f0b7d678da8c2b.zip
Add rad_get_vendor_attr() for deciphering vendor attributes received
from the RADIUS server.
Notes
Notes: svn path=/head/; revision=96322
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 c94481e8aadc..bc3679e06674 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)
{