summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbittest.h4
-rwxr-xr-xpatgen.c7
-rwxr-xr-xpattest.c3
3 files changed, 11 insertions, 3 deletions
diff --git a/bittest.h b/bittest.h
new file mode 100755
index 0000000..ade8b1e
--- /dev/null
+++ b/bittest.h
@@ -0,0 +1,4 @@
+static int bit_next(int prev)
+{
+ return (prev + 1) % 256;
+}
diff --git a/patgen.c b/patgen.c
index bc600bf..5c360dc 100755
--- a/patgen.c
+++ b/patgen.c
@@ -9,6 +9,7 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdlib.h>
+#include "bittest.h"
/* #define BLOCK_SIZE 2048 */
#define BLOCK_SIZE 2041
@@ -60,8 +61,10 @@ int main(int argc, char *argv[])
#endif
for(;;) {
res = bs;
- for (x=0;x<bs;x++)
- outbuf[x] = c++;
+ for (x=0;x<bs;x++) {
+ outbuf[x] = c;
+ c = bit_next(c);
+ }
res = write(fd, outbuf, res);
#if 0
printf("(%d) Wrote %d bytes\n", packets++, res);
diff --git a/pattest.c b/pattest.c
index a8f060d..63fe061 100755
--- a/pattest.c
+++ b/pattest.c
@@ -9,6 +9,7 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdlib.h>
+#include "bittest.h"
#define BLOCK_SIZE 2039
@@ -72,7 +73,7 @@ int main(int argc, char *argv[])
c = outbuf[x];
bytes=0;
}
- c++;
+ c = bit_next(c);
bytes++;
}
#if 0