dfuzzer
rand.h
Go to the documentation of this file.
1 
2 /*
3  * dfuzzer - tool for fuzz testing processes communicating through D-Bus.
4  *
5  * Copyright(C) 2013, Red Hat, Inc., Matus Marhefka <mmarhefk@redhat.com>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #ifndef RAND_H
21 #define RAND_H
22 
24 #define MINLEN 512
25 
27 #define MAX_BUF_LEN 50000
28 
30 #define MAXLEN 256
31 
33 #define MAXSIG 255
34 
37 #define MAX_FUZZ_COUNTER 1000
38 
39 
45 void df_rand_init(const long buf_size);
46 
50 guint8 df_rand_guint8(void);
51 
55 gboolean df_rand_gboolean(void);
56 
60 gint16 df_rand_gint16(void);
61 
65 guint16 df_rand_guint16(void);
66 
70 gint32 df_rand_gint32(void);
71 
75 guint32 df_rand_guint32(void);
76 
80 gint64 df_rand_gint64(void);
81 
85 guint64 df_rand_guint64(void);
86 
91 inline double drand(void);
92 
96 gdouble df_rand_gdouble(void);
97 
105 int df_rand_continue(const int fuzz_on_str_len);
106 
119 int df_rand_string(gchar **buf);
120 
132 int df_rand_dbus_objpath_string(gchar **buf);
133 
146 int df_rand_dbus_signature_string(gchar **buf);
147 
155 int df_rand_GVariant(GVariant **var);
156 
160 int df_rand_unixFD(void);
161 
162 #endif
guint32 df_rand_guint32(void)
Definition: rand.c:256
int df_rand_continue(const int fuzz_on_str_len)
Definition: rand.c:395
guint8 df_rand_guint8(void)
Definition: rand.c:122
int df_rand_dbus_signature_string(gchar **buf)
Definition: rand.c:546
int df_rand_dbus_objpath_string(gchar **buf)
Definition: rand.c:483
double drand(void)
Definition: rand.c:348
int df_rand_string(gchar **buf)
Definition: rand.c:447
int df_rand_unixFD(void)
Definition: rand.c:618
gint64 df_rand_gint64(void)
Definition: rand.c:285
gint16 df_rand_gint16(void)
Definition: rand.c:161
gdouble df_rand_gdouble(void)
Definition: rand.c:356
int df_rand_GVariant(GVariant **var)
Definition: rand.c:583
gboolean df_rand_gboolean(void)
Definition: rand.c:151
void df_rand_init(const long buf_size)
Definition: rand.c:94
guint64 df_rand_guint64(void)
Definition: rand.c:318
gint32 df_rand_gint32(void)
Definition: rand.c:223
guint16 df_rand_guint16(void)
Definition: rand.c:194