int radius_callback_compare(REQUEST *req, VALUE_PAIR *request,
VALUE_PAIR *check, VALUE_PAIR *check_pairs,
VALUE_PAIR **reply_pairs);
+VALUE_PAIR *radius_paircreate(REQUEST *request, VALUE_PAIR **vps,
+ int attribute, int type);
/* xlat.c */
typedef int (*RADIUS_ESCAPE_STRING)(char *out, int outlen, const char *in);
RCSID("$Id$")
#include <freeradius-devel/radiusd.h>
+#include <freeradius-devel/rad_assert.h>
#ifdef HAVE_REGEX_H
# include <regex.h>
}
} /* loop over the 'from' list */
}
+
+/*
+ * Create a pair, and add it to a particular list of VPs
+ *
+ * Note that this function ALWAYS returns. If we're OOM, then
+ * it causes the server to exit!
+ */
+VALUE_PAIR *radius_paircreate(REQUEST *request, VALUE_PAIR **vps,
+ int attribute, int type)
+{
+ VALUE_PAIR *vp;
+
+ request = request; /* -Wunused */
+
+ vp = paircreate(attribute, type);
+ if (!vp) {
+ radlog(L_ERR, "No memory!");
+ rad_assert("No memory" == NULL);
+ _exit(1);
+ }
+
+ pairadd(vps, vp);
+
+ return vp;
+}