28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/* Default values */
#define PORT 80
#define THREAD_COUNT 5
#define BIND_ADDR "::"
#define CACHE_SIZE 8209
#define LOG_FILE "-"
/* Configuration options that work threads need to be aware of */
struct filed_options {
int vhosts_enabled;
};
/* Arguments for worker threads */
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
/* Default values */
#define PORT 80
#define THREAD_COUNT 5
#define BIND_ADDR "::"
#define CACHE_SIZE 8209
#define LOG_FILE "-"
/* Fuzzing Test Code */
#ifdef FILED_TEST_AFL
#define FILED_DONT_LOG 1
#define pthread_create(a, x, y, z) afl_pthread_create(a, x, y, z)
#define bind(x, y, z) afl_bind(x, y, z)
#define socket(x, y, z) 8193
#define listen(x, y) 0
#define accept(x, y, z) afl_accept(x, y, z)
#define close(x) { if (strcmp(#x, "random_fd") == 0) { close(x); } else { exit(0); } }
#define fclose(x) exit(0)
static int afl_accept(int x, void *addr, void *z) {
((struct sockaddr_in6 *) addr)->sin6_family = AF_INET + AF_INET6 + 1;
return(STDIN_FILENO);
x = x;
z = z;
}
static int afl_bind(int x, void *y, socklen_t z) {
return(8194);
x = x;
y = y;
z = z;
}
static int afl_pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg) {
start_routine(arg);
exit(3);
thread = thread;
attr = attr;
}
#endif
/* Configuration options that work threads need to be aware of */
struct filed_options {
int vhosts_enabled;
};
/* Arguments for worker threads */
|