summaryrefslogtreecommitdiffstats
path: root/cmd/zed/agents/zfs_agents.h
blob: 3c9af54c926c4b421209701ed75e4438c84600b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License Version 1.0 (CDDL-1.0).
 * You can obtain a copy of the license from the top-level file
 * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
 * You may not use this file except in compliance with the license.
 *
 * CDDL HEADER END
 */

/*
 * Copyright (c) 2016, Intel Corporation.
 */

#ifndef	ZFS_AGENTS_H
#define	ZFS_AGENTS_H

#include <libzfs.h>
#include <libnvpair.h>


#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Agent abstraction presented to ZED
 */
extern void zfs_agent_init(libzfs_handle_t *);
extern void zfs_agent_fini(void);
extern void zfs_agent_post_event(const char *, const char *, nvlist_t *);

/*
 * ZFS Sysevent Linkable Module (SLM)
 */
extern int zfs_slm_init(void);
extern void zfs_slm_fini(void);
extern void zfs_slm_event(const char *, const char *, nvlist_t *);

/*
 * In ZED context, all the FMA agents run in the same thread
 * and do not require a unique libzfs instance.
 */
extern libzfs_handle_t *__libzfs_init(void);
extern void __libzfs_fini(libzfs_handle_t *);

#ifdef	__cplusplus
}
#endif

#endif	/* !ZFS_AGENTS_H */