+ }
+ }
+
+ /*For each filter spec within the filter line... */
+ for (j = 0; j <json_array_size(jfspecs); j++) {
+
+ if ((NULL == (jffield = json_object_get(json_array_get(jfspecs, j), "field"))) ||
+ (!json_is_string(jffield)) ||
+ (NULL == (jfmatch = json_object_get(json_array_get(jfspecs, j), "match"))) ||
+ (!json_is_string(jfmatch))) {
+ fprintf (stderr, "tr_cfg_parse_one_filter: Error parsing filter field and match for filter spec %d, filter line %d.\n", i, j);
+ *rc = TR_CFG_NOPARSE;
+ tr_filter_free(filt);
+ return NULL;
+ }
+
+ if (NULL == (filt->lines[i]->specs[j] = talloc(trc, TR_FSPEC))) {
+ fprintf(stderr, "tr_cfg_parse_one_filter: Out of memory.\n");
+ *rc = TR_CFG_NOMEM;
+ tr_filter_free(filt);
+ return NULL;
+ }
+
+ memset(filt->lines[i]->specs[j], 0, sizeof(TR_FSPEC));
+
+ if ((NULL == (filt->lines[i]->specs[j]->field = tr_new_name((char *)json_string_value(jffield)))) ||
+ (NULL == (filt->lines[i]->specs[j]->match = tr_new_name((char *)json_string_value(jfmatch))))) {
+ fprintf(stderr, "tr_cfg_parse_one_filter: Out of memory.\n");
+ *rc = TR_CFG_NOMEM;
+ tr_filter_free(filt);
+ return NULL;
+ }
+ }
+ }
+
+ return filt;
+}
+
+static TR_RP_CLIENT *tr_cfg_parse_one_rp_client (TR_CFG *trc, json_t *jrp, TR_CFG_RC *rc)
+{
+ TR_RP_CLIENT *rp = NULL;
+ json_t *jgns = NULL;
+ json_t *jfilt = NULL;
+ json_t *jftype = NULL;
+ int i = 0;
+
+ if ((!trc) || (!jrp) || (!rc)) {
+ fprintf(stderr, "tr_cfg_parse_one_rp_realm: Bad parameters.\n");
+ if (rc)
+ *rc = TR_CFG_BAD_PARAMS;
+ return NULL;