xref: /freebsd/sys/contrib/openzfs/include/libzfsbootenv.h (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
1*61145dc2SMartin Matuska // SPDX-License-Identifier: CDDL-1.0
22c48331dSMatt Macy /*
32c48331dSMatt Macy  * This file and its contents are supplied under the terms of the
42c48331dSMatt Macy  * Common Development and Distribution License ("CDDL"), version 1.0.
52c48331dSMatt Macy  * You may only use this file in accordance with the terms of version
62c48331dSMatt Macy  * 1.0 of the CDDL.
72c48331dSMatt Macy  *
82c48331dSMatt Macy  * A full copy of the text of the CDDL should have accompanied this
92c48331dSMatt Macy  * source.  A copy of the CDDL is also available via the Internet at
102c48331dSMatt Macy  * http://www.illumos.org/license/CDDL.
112c48331dSMatt Macy  */
122c48331dSMatt Macy 
132c48331dSMatt Macy /*
142c48331dSMatt Macy  * Copyright 2020 Toomas Soome <tsoome@me.com>
152c48331dSMatt Macy  */
162c48331dSMatt Macy 
172c48331dSMatt Macy #ifndef _LIBZFSBOOTENV_H
183ff01b23SMartin Matuska #define	_LIBZFSBOOTENV_H extern __attribute__((visibility("default")))
192c48331dSMatt Macy 
202c48331dSMatt Macy #ifdef __cplusplus
212c48331dSMatt Macy extern "C" {
222c48331dSMatt Macy #endif
232c48331dSMatt Macy 
242c48331dSMatt Macy typedef enum lzbe_flags {
252c48331dSMatt Macy 	lzbe_add,	/* add data to existing nvlist */
262c48331dSMatt Macy 	lzbe_replace	/* replace current nvlist */
272c48331dSMatt Macy } lzbe_flags_t;
282c48331dSMatt Macy 
293ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_nvlist_get(const char *, const char *, void **);
303ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_nvlist_set(const char *, const char *, void *);
313ff01b23SMartin Matuska _LIBZFSBOOTENV_H void lzbe_nvlist_free(void *);
323ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_add_pair(void *, const char *, const char *, void *,
333ff01b23SMartin Matuska     size_t);
343ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_remove_pair(void *, const char *);
353ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_set_boot_device(const char *, lzbe_flags_t,
363ff01b23SMartin Matuska     const char *);
373ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_get_boot_device(const char *, char **);
383ff01b23SMartin Matuska _LIBZFSBOOTENV_H int lzbe_bootenv_print(const char *, const char *, FILE *);
392c48331dSMatt Macy 
402c48331dSMatt Macy #ifdef __cplusplus
412c48331dSMatt Macy }
422c48331dSMatt Macy #endif
432c48331dSMatt Macy 
442c48331dSMatt Macy #endif /* _LIBZFSBOOTENV_H */
45