source: zzuf/trunk/src/opts.c @ 1858

Last change on this file since 1858 was 1858, checked in by Sam Hocevar, 13 years ago
  • Network destination port choosing with -p/--ports.
  • Renamed -p/--pick into -l/--list to avoid conflicts.
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1/*
2 *  zzuf - general purpose fuzzer
3 *  Copyright (c) 2002, 2007 Sam Hocevar <sam@zoy.org>
4 *                All Rights Reserved
5 *
6 *  $Id: opts.c 1858 2007-11-02 22:45:54Z sam $
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
34void _zz_opts_init(struct opts *opts)
35{
36    opts->fuzzing = opts->bytes = opts->list = opts->ports = NULL;
37    opts->protect = opts->refuse = NULL;
38    opts->seed = DEFAULT_SEED;
39    opts->endseed = DEFAULT_SEED + 1;
40    opts->minratio = opts->maxratio = DEFAULT_RATIO;
41    opts->quiet = 0;
42    opts->maxbytes = -1;
43    opts->md5 = 0;
44    opts->checkexit = 0;
45    opts->verbose = 0;
46    opts->maxmem = -1;
47    opts->maxtime = -1;
48    opts->maxcpu = -1;
49    opts->delay = 0;
50    opts->lastlaunch = 0;
51
52    opts->newargv = NULL;
53    opts->maxchild = 1;
54    opts->nchild = 0;
55    opts->maxcrashes = 1;
56    opts->crashes = 0;
57    opts->child = NULL;
58}
59
60void _zz_opts_fini(struct opts *opts)
61{
62    if(opts->child)
63        free(opts->child);
64    if(opts->newargv)
65        free(opts->newargv);
66}
67
Note: See TracBrowser for help on using the repository browser.