diff options
author | Linus Nordberg <linus@nordu.net> | 2010-09-27 21:44:18 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2010-09-27 21:44:18 +0200 |
commit | 18eee144feb5d61d904274dca0886923b98a9482 (patch) | |
tree | 5c82a9edaaf015a9632354bcc6a96c2f376bd205 /lib/attr.c | |
parent | aa354bb116fb38c9b049070dea4752afe9a3ea34 (diff) |
WIP
Diffstat (limited to 'lib/attr.c')
-rw-r--r-- | lib/attr.c | 28 |
1 files changed, 28 insertions, 0 deletions
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 <freeradius/libradius.h> +#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); +} |