summaryrefslogtreecommitdiffstats
path: root/tests/helpers/c/prng.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
commite2bbf175a2184bd76f6c54ccf8456babeb1a46fc (patch)
treef0b76550d6e6f500ada964a3a4ee933a45e5a6f1 /tests/helpers/c/prng.h
parentInitial commit. (diff)
downloadfrr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.tar.xz
frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.zip
Adding upstream version 9.1.upstream/9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/helpers/c/prng.h')
-rw-r--r--tests/helpers/c/prng.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/helpers/c/prng.h b/tests/helpers/c/prng.h
new file mode 100644
index 0000000..6b10bde
--- /dev/null
+++ b/tests/helpers/c/prng.h
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Very simple prng to allow for randomized tests with reproducable
+ * results.
+ *
+ * Copyright (C) 2012 by Open Source Routing.
+ * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This file is part of Quagga
+ */
+#ifndef _PRNG_H
+#define _PRNG_H
+
+struct prng;
+
+struct prng *prng_new(unsigned long long seed);
+int prng_rand(struct prng *);
+const char *prng_fuzz(struct prng *, const char *string, const char *charset,
+ unsigned int operations);
+void prng_free(struct prng *);
+
+#endif