1238592Smm/*
2238592Smm * CDDL HEADER START
3238592Smm *
4238592Smm * The contents of this file are subject to the terms of the
5238592Smm * Common Development and Distribution License (the "License").
6238592Smm * You may not use this file except in compliance with the License.
7238592Smm *
8238592Smm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9238592Smm * or http://www.opensolaris.org/os/licensing.
10238592Smm * See the License for the specific language governing permissions
11238592Smm * and limitations under the License.
12238592Smm *
13238592Smm * When distributing Covered Code, include this CDDL HEADER in each
14238592Smm * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15238592Smm * If applicable, add the following below this CDDL HEADER, with the
16238592Smm * fields enclosed by brackets "[]" replaced with your own identifying
17238592Smm * information: Portions Copyright [yyyy] [name of copyright owner]
18238592Smm *
19238592Smm * CDDL HEADER END
20238592Smm */
21238592Smm
22238592Smm/*
23290756Smav * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
24247882Smm * Copyright (c) 2013 by Martin Matuska <mm@FreeBSD.org>. All rights reserved.
25238592Smm */
26238592Smm
27238592Smm#ifndef	_LIBZFS_CORE_H
28238592Smm#define	_LIBZFS_CORE_H
29238592Smm
30238592Smm#include <libnvpair.h>
31238592Smm#include <sys/param.h>
32238592Smm#include <sys/types.h>
33238592Smm
34238592Smm#ifdef	__cplusplus
35238592Smmextern "C" {
36238592Smm#endif
37238592Smm
38238592Smmint libzfs_core_init(void);
39238592Smmvoid libzfs_core_fini(void);
40238592Smm
41300028Savg/*
42300028Savg * NB: this type should be kept binary compatible with dmu_objset_type_t.
43300028Savg */
44300028Savgenum lzc_dataset_type {
45300028Savg	LZC_DATSET_TYPE_ZFS = 2,
46300028Savg	LZC_DATSET_TYPE_ZVOL
47300028Savg};
48300028Savg
49263407Sdelphijint lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **);
50300028Savgint lzc_create(const char *, enum lzc_dataset_type, nvlist_t *);
51263407Sdelphijint lzc_clone(const char *, const char *, nvlist_t *);
52263407Sdelphijint lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **);
53263407Sdelphijint lzc_bookmark(nvlist_t *, nvlist_t **);
54263407Sdelphijint lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **);
55263407Sdelphijint lzc_destroy_bookmarks(nvlist_t *, nvlist_t **);
56238592Smm
57263407Sdelphijint lzc_snaprange_space(const char *, const char *, uint64_t *);
58238592Smm
59263407Sdelphijint lzc_hold(nvlist_t *, int, nvlist_t **);
60263407Sdelphijint lzc_release(nvlist_t *, nvlist_t **);
61263407Sdelphijint lzc_get_holds(const char *, nvlist_t **);
62248498Smm
63268649Sdelphijenum lzc_send_flags {
64276081Sdelphij	LZC_SEND_FLAG_EMBED_DATA = 1 << 0,
65276081Sdelphij	LZC_SEND_FLAG_LARGE_BLOCK = 1 << 1
66268649Sdelphij};
67268649Sdelphij
68268649Sdelphijint lzc_send(const char *, const char *, int, enum lzc_send_flags);
69290756Smavint lzc_send_resume(const char *, const char *, int,
70290756Smav    enum lzc_send_flags, uint64_t, uint64_t);
71308764Savgint lzc_send_space(const char *, const char *, uint64_t *);
72308764Savg
73308764Savgstruct dmu_replay_record;
74308764Savg
75263407Sdelphijint lzc_receive(const char *, nvlist_t *, const char *, boolean_t, int);
76290756Smavint lzc_receive_resumable(const char *, nvlist_t *, const char *,
77290756Smav    boolean_t, int);
78308764Savgint lzc_receive_with_header(const char *, nvlist_t *, const char *, boolean_t,
79308764Savg    boolean_t, int, const struct dmu_replay_record *);
80238592Smm
81263407Sdelphijboolean_t lzc_exists(const char *);
82238592Smm
83263407Sdelphijint lzc_rollback(const char *, char *, int);
84238592Smm
85238592Smm#ifdef	__cplusplus
86238592Smm}
87238592Smm#endif
88238592Smm
89238592Smm#endif	/* _LIBZFS_CORE_H */
90