xref: /freebsd/sys/contrib/openzfs/include/libzfsbootenv.h (revision 3ff01b231dfa83d518854c63e7c9cd1debd1139e)
12c48331dSMatt Macy /*
22c48331dSMatt Macy  * This file and its contents are supplied under the terms of the
32c48331dSMatt Macy  * Common Development and Distribution License ("CDDL"), version 1.0.
42c48331dSMatt Macy  * You may only use this file in accordance with the terms of version
52c48331dSMatt Macy  * 1.0 of the CDDL.
62c48331dSMatt Macy  *
72c48331dSMatt Macy  * A full copy of the text of the CDDL should have accompanied this
82c48331dSMatt Macy  * source.  A copy of the CDDL is also available via the Internet at
92c48331dSMatt Macy  * http://www.illumos.org/license/CDDL.
102c48331dSMatt Macy  */
112c48331dSMatt Macy 
122c48331dSMatt Macy /*
132c48331dSMatt Macy  * Copyright 2020 Toomas Soome <tsoome@me.com>
142c48331dSMatt Macy  */
152c48331dSMatt Macy 
162c48331dSMatt Macy #ifndef _LIBZFSBOOTENV_H
17*3ff01b23SMartin Matuska #define	_LIBZFSBOOTENV_H extern __attribute__((visibility("default")))
182c48331dSMatt Macy 
192c48331dSMatt Macy #ifdef __cplusplus
202c48331dSMatt Macy extern "C" {
212c48331dSMatt Macy #endif
222c48331dSMatt Macy 
232c48331dSMatt Macy typedef enum lzbe_flags {
242c48331dSMatt Macy 	lzbe_add,	/* add data to existing nvlist */
252c48331dSMatt Macy 	lzbe_replace	/* replace current nvlist */
262c48331dSMatt Macy } lzbe_flags_t;
272c48331dSMatt Macy 
28*3ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_nvlist_get(const char *, const char *, void **);
29*3ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_nvlist_set(const char *, const char *, void *);
30*3ff01b23SMartin Matuska _LIBZFSBOOTENV_H void lzbe_nvlist_free(void *);
31*3ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_add_pair(void *, const char *, const char *, void *,
32*3ff01b23SMartin Matuska     size_t);
33*3ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_remove_pair(void *, const char *);
34*3ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_set_boot_device(const char *, lzbe_flags_t,
35*3ff01b23SMartin Matuska     const char *);
36*3ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_get_boot_device(const char *, char **);
37*3ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_bootenv_print(const char *, const char *, FILE *);
382c48331dSMatt Macy 
392c48331dSMatt Macy #ifdef __cplusplus
402c48331dSMatt Macy }
412c48331dSMatt Macy #endif
422c48331dSMatt Macy 
432c48331dSMatt Macy #endif /* _LIBZFSBOOTENV_H */
44