2016-02-27 11:49:12 +00:00
|
|
|
/*
|
|
|
|
* virsecretobj.h: internal <secret> objects handling
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009-2010, 2013-2014, 2016 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-06-07 20:20:21 +00:00
|
|
|
#pragma once
|
2016-02-27 11:49:12 +00:00
|
|
|
|
2019-06-07 20:20:21 +00:00
|
|
|
#include "internal.h"
|
2016-02-27 11:49:12 +00:00
|
|
|
|
2019-06-07 20:20:21 +00:00
|
|
|
#include "secret_conf.h"
|
2016-02-27 11:49:12 +00:00
|
|
|
|
|
|
|
typedef struct _virSecretObj virSecretObj;
|
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjEndAPI(virSecretObj **obj);
|
2016-02-27 11:49:12 +00:00
|
|
|
|
|
|
|
typedef struct _virSecretObjList virSecretObjList;
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjList *
|
2017-04-03 11:47:58 +00:00
|
|
|
virSecretObjListNew(void);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObj *
|
|
|
|
virSecretObjListFindByUUID(virSecretObjList *secrets,
|
2017-04-21 15:43:37 +00:00
|
|
|
const char *uuidstr);
|
2017-04-03 11:47:58 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObj *
|
|
|
|
virSecretObjListFindByUsage(virSecretObjList *secrets,
|
2017-04-03 11:47:58 +00:00
|
|
|
int usageType,
|
|
|
|
const char *usageID);
|
|
|
|
|
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjListRemove(virSecretObjList *secrets,
|
|
|
|
virSecretObj *obj);
|
2017-04-03 11:47:58 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObj *
|
|
|
|
virSecretObjListAdd(virSecretObjList *secrets,
|
2021-11-23 16:03:44 +00:00
|
|
|
virSecretDef **newdef,
|
2017-04-03 11:47:58 +00:00
|
|
|
const char *configDir,
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretDef **oldDef);
|
2017-04-03 11:47:58 +00:00
|
|
|
|
|
|
|
typedef bool
|
|
|
|
(*virSecretObjListACLFilter)(virConnectPtr conn,
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretDef *def);
|
2017-04-03 11:47:58 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjListNumOfSecrets(virSecretObjList *secrets,
|
2017-08-16 13:26:41 +00:00
|
|
|
virSecretObjListACLFilter filter,
|
2017-04-03 11:47:58 +00:00
|
|
|
virConnectPtr conn);
|
2016-02-28 14:34:21 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
|
|
|
virSecretObjListExport(virConnectPtr conn,
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjList *secretobjs,
|
2017-04-03 11:47:58 +00:00
|
|
|
virSecretPtr **secrets,
|
2017-08-16 13:26:41 +00:00
|
|
|
virSecretObjListACLFilter filter,
|
2017-04-03 11:47:58 +00:00
|
|
|
unsigned int flags);
|
2016-02-28 14:34:21 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjListGetUUIDs(virSecretObjList *secrets,
|
2017-04-03 11:47:58 +00:00
|
|
|
char **uuids,
|
2017-04-19 12:34:04 +00:00
|
|
|
int maxuuids,
|
2017-08-16 13:26:41 +00:00
|
|
|
virSecretObjListACLFilter filter,
|
2017-04-03 11:47:58 +00:00
|
|
|
virConnectPtr conn);
|
2016-02-29 11:52:00 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjDeleteConfig(virSecretObj *obj);
|
2016-02-28 15:56:17 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjDeleteData(virSecretObj *obj);
|
2016-03-07 23:06:57 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjSaveConfig(virSecretObj *obj);
|
2016-03-07 23:06:57 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjSaveData(virSecretObj *obj);
|
2016-03-18 14:17:25 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretDef *
|
|
|
|
virSecretObjGetDef(virSecretObj *obj);
|
2016-03-18 14:17:25 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjSetDef(virSecretObj *obj,
|
|
|
|
virSecretDef *def);
|
2016-03-08 00:22:04 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
unsigned char *
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjGetValue(virSecretObj *obj);
|
2016-03-08 00:22:04 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjSetValue(virSecretObj *obj,
|
2017-04-03 11:47:58 +00:00
|
|
|
const unsigned char *value,
|
|
|
|
size_t value_size);
|
2016-03-08 00:40:58 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
size_t
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjGetValueSize(virSecretObj *obj);
|
2016-03-08 00:40:58 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretObjSetValueSize(virSecretObj *obj,
|
2017-04-03 11:47:58 +00:00
|
|
|
size_t value_size);
|
2016-03-08 00:40:58 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretLoadAllConfigs(virSecretObjList *secrets,
|
2017-04-03 11:47:58 +00:00
|
|
|
const char *configDir);
|