double dropout;
long total_out;
long total_in;
+FILE *reference;
char *reorder_data;
size_t reorder_len;
}
return -1;
}
+ if(reference) {
+ char buf[len];
+ if(fread(buf, len, 1, reference) != 1) {
+ debug("Error reading reference\n");
+ abort();
+ }
+ if(memcmp(buf, data, len)) {
+ debug("Received data differs from reference\n");
+ abort();
+ }
+ }
return write(1, data, len);
}
if(getenv("REORDER")) reorder = atof(getenv("REORDER"));
if(getenv("REORDER_DIST")) reorder_dist = atoi(getenv("REORDER_DIST"));
+ char *reference_filename = getenv("REFERENCE");
+ if(reference_filename)
+ reference = fopen(reference_filename, "r");
+
if(dropto < dropfrom)
dropto = 1 << 30;