/haveged-1.4/src/haveged.h
C Header | 61 lines | 33 code | 1 blank | 27 comment | 0 complexity | 667453cc0524f04c5042345c8d486a87 MD5 | raw file
Possible License(s): GPL-3.0
1/**
2 ** Simple entropy harvester based upon the havege RNG
3 **
4 ** Copyright 2009-2012 Gary Wuertz gary@issiweb.com
5 **
6 ** This program is free software: you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation, either version 3 of the License, or
9 ** (at your option) any later version.
10 **
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU General Public License for more details.
15 **
16 ** You should have received a copy of the GNU General Public License
17 ** along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef HAVEGED_H
20#define HAVEGED_H
21/**
22 * Settings - default values declared in haveged.c
23 */
24struct pparams {
25 char *daemon; /* Daemon name - default is "haveged" */
26 unsigned int setup; /* setup options */
27 unsigned int ncores; /* number of cores to use */
28 unsigned int buffersz; /* size of collection buffer (kb) */
29 unsigned int detached; /* non-zero of daemonized */
30 unsigned int foreground; /* non-zero if running in foreground */
31 unsigned int run_level; /* type of run 0=daemon,1=setup,2=pip,sample kb */
32 unsigned int d_cache; /* size of data cache (kb) */
33 unsigned int i_cache; /* size of instruction cache (kb) */
34 unsigned int low_water; /* write threshold to set - 0 for none */
35 char *os_rel; /* path to operating sytem release */
36 char *pid_file; /* name of pid file */
37 char *poolsize; /* path to poolsize */
38 char *random_device; /* path to random device */
39 char *sample_in; /* input path for injection diagnostic */
40 char *sample_out; /* path to sample file */
41 unsigned int verbose; /* Output level for log or stdout */
42 char *version; /* Our version */
43 char *watermark; /* path to write_wakeup_threshold */
44 };
45/**
46 * Buffer size used when not running as daemon
47 */
48#define APP_BUFF_SIZE 1024
49/**
50 * Setup options (for app)
51 */
52#define RUN_AS_APP 0x01
53#define RANGE_SPEC 0x02
54#define USE_STDOUT 0x04
55#define CAPTURE 0x08
56#define INJECT 0x10
57#define RUN_IN_FG 0x20
58#define SET_LWM 0x40
59#define MULTI_CORE 0x80
60
61#endif