/*
 * vdev_globals_json.h: a virtual device manager for *nix
 * Copyright (C) 2026  Aitor <aitor@genuen.org>
 *
 * This program is dual-licensed: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 or later as
 * published by the Free Software Foundation. For the terms of this
 * license, see LICENSE.GPLv3+ or <http://www.gnu.org/licenses/>.
 *
 * You are free to use this program under the terms of the GNU General
 * Public License, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * Alternatively, you are free to use this program under the terms of the
 * Internet Software Consortium License, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE. For the terms of this license, see LICENSE.ISC or
 * <http://www.isc.org/downloads/software-support-policy/isc-license/>.
 */

#ifndef _VDEV_GLOBALS_JSON_H_
#define _VDEV_GLOBALS_JSON_H_

#include "vdev.h"

int vdev_globals_set_defaults(struct vdev_state *vdev);
int vdev_globals_load_json(struct vdev_state *vdev, char const *config_path);
void vdev_globals_free(struct vdev_state *vdev);

/* 1 if act_basename may be loaded for config_path's profile; 0 to skip.
 * No matching allowlist → allow (backward compatible). */
int vdev_globals_action_allowed(struct vdev_globals const *globals,
				char const *config_path,
				char const *act_basename);

#endif
