+
+/*
+ * 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_pairmake(REQUEST *request, VALUE_PAIR **vps,
+ const char *attribute, const char *value,
+ int operator)
+{
+ VALUE_PAIR *vp;
+
+ request = request; /* -Wunused */
+
+ vp = pairmake(attribute, value, operator);
+ if (!vp) return NULL;
+
+ if (vps) pairadd(vps, vp);
+
+ return vp;
+}
+
+void debug_pair(VALUE_PAIR *vp)
+{
+ if (!vp || !debug_flag || !fr_log_fp) return;
+
+ fputc('\t', fr_log_fp);
+ vp_print(fr_log_fp, vp);
+ fputc('\n', fr_log_fp);
+}
+
+void debug_pair_list(VALUE_PAIR *vp)
+{
+ if (!vp || !debug_flag || !fr_log_fp) return;
+
+ while (vp) {
+ fputc('\t', fr_log_fp);
+ vp_print(fr_log_fp, vp);
+ fputc('\n', fr_log_fp);
+ vp = vp->next;
+ }
+ fflush(fr_log_fp);
+}