From 18eee144feb5d61d904274dca0886923b98a9482 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 27 Sep 2010 21:44:18 +0200 Subject: WIP --- lib/attr.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/attr.c (limited to 'lib/attr.c') diff --git a/lib/attr.c b/lib/attr.c new file mode 100644 index 0000000..bf5e105 --- /dev/null +++ b/lib/attr.c @@ -0,0 +1,28 @@ +#include +#include "libradsec.h" +#include "libradsec-impl.h" + +fixme +attr_create(fixme) +{ + + printf ("creating value pairs\n"); + /* User-Name. */ + vp = pairmake ("User-Name", USER_NAME, 0); + if (!vp) { + fr_perror ("pairmake"); + return -1; + } + + /* User-Password. */ + { + size_t pwlen = sizeof(USER_PW); + strncpy (user_pw, USER_PW, sizeof(user_pw)); + rad_pwencode(user_pw, &pwlen, SECRET, reqauth); + } + pairadd (&vp, pairmake ("User-Password", user_pw, 0)); + pkt->vps = vp; + + printf ("attributes:\n"); + vp_printlist (stdout, vp); +} -- cgit v1.1