| Revision 3635,
1.6 KB
checked in by sam, 4 years ago
(diff) |
|
Allow remote network host filtering, courtesy of Corentin Delorme.
|
-
Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | * zzuf - general purpose fuzzer |
|---|
| 3 | * Copyright (c) 2002, 2007-2009 Sam Hocevar <sam@hocevar.net> |
|---|
| 4 | * All Rights Reserved |
|---|
| 5 | * |
|---|
| 6 | * $Id$ |
|---|
| 7 | * |
|---|
| 8 | * This program is free software. It comes without any warranty, to |
|---|
| 9 | * the extent permitted by applicable law. You can redistribute it |
|---|
| 10 | * and/or modify it under the terms of the Do What The Fuck You Want |
|---|
| 11 | * To Public License, Version 2, as published by Sam Hocevar. See |
|---|
| 12 | * http://sam.zoy.org/wtfpl/COPYING for more details. |
|---|
| 13 | */ |
|---|
| 14 | |
|---|
| 15 | /* |
|---|
| 16 | * opts.c: configuration handling |
|---|
| 17 | */ |
|---|
| 18 | |
|---|
| 19 | #include "config.h" |
|---|
| 20 | |
|---|
| 21 | #if defined HAVE_STDINT_H |
|---|
| 22 | # include <stdint.h> |
|---|
| 23 | #elif defined HAVE_INTTYPES_H |
|---|
| 24 | # include <inttypes.h> |
|---|
| 25 | #endif |
|---|
| 26 | |
|---|
| 27 | #include <sys/types.h> |
|---|
| 28 | #include <stdio.h> |
|---|
| 29 | #include <stdlib.h> |
|---|
| 30 | |
|---|
| 31 | #include "libzzuf.h" |
|---|
| 32 | #include "opts.h" |
|---|
| 33 | |
|---|
| 34 | void _zz_opts_init(struct opts *opts) |
|---|
| 35 | { |
|---|
| 36 | opts->fuzzing = opts->bytes = opts->list = opts->ports = NULL; |
|---|
| 37 | opts->allow = opts->deny = NULL; |
|---|
| 38 | opts->protect = opts->refuse = NULL; |
|---|
| 39 | opts->seed = DEFAULT_SEED; |
|---|
| 40 | opts->endseed = DEFAULT_SEED + 1; |
|---|
| 41 | opts->minratio = opts->maxratio = DEFAULT_RATIO; |
|---|
| 42 | opts->quiet = 0; |
|---|
| 43 | opts->maxbytes = -1; |
|---|
| 44 | opts->md5 = 0; |
|---|
| 45 | opts->checkexit = 0; |
|---|
| 46 | opts->verbose = 0; |
|---|
| 47 | opts->maxmem = DEFAULT_MEM; |
|---|
| 48 | opts->maxtime = -1; |
|---|
| 49 | opts->maxcpu = -1; |
|---|
| 50 | opts->delay = 0; |
|---|
| 51 | opts->lastlaunch = 0; |
|---|
| 52 | |
|---|
| 53 | opts->newargv = NULL; |
|---|
| 54 | opts->maxchild = 1; |
|---|
| 55 | opts->nchild = 0; |
|---|
| 56 | opts->maxcrashes = 1; |
|---|
| 57 | opts->crashes = 0; |
|---|
| 58 | opts->child = NULL; |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | void _zz_opts_fini(struct opts *opts) |
|---|
| 62 | { |
|---|
| 63 | if(opts->child) |
|---|
| 64 | free(opts->child); |
|---|
| 65 | if(opts->newargv) |
|---|
| 66 | free(opts->newargv); |
|---|
| 67 | } |
|---|
| 68 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.