]>
Commit | Line | Data |
---|---|---|
9e246ac3 | 1 | /* |
d0249a4b BB |
2 | * This file is part of the ZFS Event Daemon (ZED). |
3 | * | |
9e246ac3 CD |
4 | * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). |
5 | * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. | |
1966e959 | 6 | * Refer to the OpenZFS git commit log for authoritative copyright attribution. |
492b1d2e CD |
7 | * |
8 | * The contents of this file are subject to the terms of the | |
9 | * Common Development and Distribution License Version 1.0 (CDDL-1.0). | |
10 | * You can obtain a copy of the license from the top-level file | |
11 | * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>. | |
12 | * You may not use this file except in compliance with the license. | |
9e246ac3 CD |
13 | */ |
14 | ||
15 | #ifndef ZED_CONF_H | |
16 | #define ZED_CONF_H | |
17 | ||
18 | #include <libzfs.h> | |
19 | #include <stdint.h> | |
20 | #include "zed_strings.h" | |
21 | ||
22 | struct zed_conf { | |
9e246ac3 | 23 | char *pid_file; /* abs path to pid file */ |
dcca723a | 24 | char *zedlet_dir; /* abs path to zedlet dir */ |
9e246ac3 | 25 | char *state_file; /* abs path to state file */ |
346c85b7 | 26 | |
9e246ac3 | 27 | libzfs_handle_t *zfs_hdl; /* handle to libzfs */ |
346c85b7 | 28 | zed_strings_t *zedlets; /* names of enabled zedlets */ |
bf95a000 | 29 | char *path; /* custom $PATH for zedlets to use */ |
346c85b7 AZ |
30 | |
31 | int pid_fd; /* fd to pid file for lock */ | |
32 | int state_fd; /* fd to state file */ | |
33 | int zevent_fd; /* fd for access to zevents */ | |
34 | ||
73218f41 | 35 | int16_t max_jobs; /* max zedlets to run at one time */ |
9e246ac3 | 36 | |
346c85b7 AZ |
37 | boolean_t do_force:1; /* true if force enabled */ |
38 | boolean_t do_foreground:1; /* true if run in foreground */ | |
39 | boolean_t do_memlock:1; /* true if locking memory */ | |
40 | boolean_t do_verbose:1; /* true if verbosity enabled */ | |
41 | boolean_t do_zero:1; /* true if zeroing state */ | |
42 | boolean_t do_idle:1; /* true if idle enabled */ | |
43 | }; | |
9e246ac3 | 44 | |
346c85b7 | 45 | void zed_conf_init(struct zed_conf *zcp); |
9e246ac3 CD |
46 | void zed_conf_destroy(struct zed_conf *zcp); |
47 | ||
48 | void zed_conf_parse_opts(struct zed_conf *zcp, int argc, char **argv); | |
49 | ||
9e246ac3 CD |
50 | int zed_conf_scan_dir(struct zed_conf *zcp); |
51 | ||
52 | int zed_conf_write_pid(struct zed_conf *zcp); | |
53 | ||
54 | int zed_conf_open_state(struct zed_conf *zcp); | |
9e246ac3 | 55 | int zed_conf_read_state(struct zed_conf *zcp, uint64_t *eidp, int64_t etime[]); |
9e246ac3 CD |
56 | int zed_conf_write_state(struct zed_conf *zcp, uint64_t eid, int64_t etime[]); |
57 | ||
58 | #endif /* !ZED_CONF_H */ |