return 1;
}
-
/*
* Initialize a radclient data structure and add it to
* the global linked list.
request->filter_code = vp->vp_integer;
talloc_free(vp);
}
+
+ /*
+ * xlat expansions aren't supported here
+ */
+ for (vp = fr_cursor_init(&cursor, &request->filter);
+ vp;
+ vp = fr_cursor_next(&cursor)) {
+ if (vp->type == VT_XLAT) {
+ vp->type = VT_DATA;
+ vp->vp_strvalue = vp->value.xlat;
+ }
+ }
+
+ /*
+ * This allows efficient list comparisons later
+ */
+ pairsort(&request->filter, attrtagcmp);
}
/*
*/
if (request->reply->code != request->filter_code) {
if (is_radius_code(request->packet_code)) {
- printf("Expected %s, got %s\n", fr_packet_codes[request->packet_code],
+ printf("Expected %s got %s\n", fr_packet_codes[request->filter_code],
fr_packet_codes[request->reply->code]);
} else {
- printf("Expected %u, got %i\n", request->packet_code,
+ printf("Expected %u got %i\n", request->filter_code,
request->reply->code);
}
stats.failed++;
} else if (!request->filter) {
stats.passed++;
} else {
+ pairsort(&request->reply->vps, attrtagcmp);
if (pairvalidate(request->filter, request->reply->vps)) {
- printf("Packet passed filter!\n");
+ printf("Packet passed filter\n");
stats.passed++;
} else {
- printf("Packet failed filter!\n");
+ printf("Packet failed filter\n");
stats.failed++;
}
}