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"
|
|
|
|
#include "virobject.h"
|
2016-02-27 11:49:12 +00:00
|
|
|
|
|
|
|
typedef struct _virSecretObj virSecretObj;
|
|
|
|
typedef virSecretObj *virSecretObjPtr;
|
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
void
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjEndAPI(virSecretObjPtr *obj);
|
2016-02-27 11:49:12 +00:00
|
|
|
|
|
|
|
typedef struct _virSecretObjList virSecretObjList;
|
|
|
|
typedef virSecretObjList *virSecretObjListPtr;
|
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
virSecretObjListPtr
|
|
|
|
virSecretObjListNew(void);
|
|
|
|
|
|
|
|
virSecretObjPtr
|
|
|
|
virSecretObjListFindByUUID(virSecretObjListPtr secrets,
|
2017-04-21 15:43:37 +00:00
|
|
|
const char *uuidstr);
|
2017-04-03 11:47:58 +00:00
|
|
|
|
|
|
|
virSecretObjPtr
|
|
|
|
virSecretObjListFindByUsage(virSecretObjListPtr secrets,
|
|
|
|
int usageType,
|
|
|
|
const char *usageID);
|
|
|
|
|
|
|
|
void
|
|
|
|
virSecretObjListRemove(virSecretObjListPtr secrets,
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjPtr obj);
|
2017-04-03 11:47:58 +00:00
|
|
|
|
|
|
|
virSecretObjPtr
|
|
|
|
virSecretObjListAdd(virSecretObjListPtr secrets,
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretDefPtr newdef,
|
2017-04-03 11:47:58 +00:00
|
|
|
const char *configDir,
|
|
|
|
virSecretDefPtr *oldDef);
|
|
|
|
|
|
|
|
typedef bool
|
|
|
|
(*virSecretObjListACLFilter)(virConnectPtr conn,
|
|
|
|
virSecretDefPtr def);
|
|
|
|
|
|
|
|
int
|
|
|
|
virSecretObjListNumOfSecrets(virSecretObjListPtr 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,
|
|
|
|
virSecretObjListPtr secretobjs,
|
|
|
|
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
|
|
|
|
virSecretObjListGetUUIDs(virSecretObjListPtr secrets,
|
|
|
|
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
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjDeleteConfig(virSecretObjPtr obj);
|
2016-02-28 15:56:17 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
void
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjDeleteData(virSecretObjPtr obj);
|
2016-03-07 23:06:57 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjSaveConfig(virSecretObjPtr obj);
|
2016-03-07 23:06:57 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjSaveData(virSecretObjPtr obj);
|
2016-03-18 14:17:25 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
virSecretDefPtr
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjGetDef(virSecretObjPtr obj);
|
2016-03-18 14:17:25 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
void
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjSetDef(virSecretObjPtr obj,
|
2017-04-03 11:47:58 +00:00
|
|
|
virSecretDefPtr def);
|
2016-03-08 00:22:04 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
unsigned char *
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjGetValue(virSecretObjPtr obj);
|
2016-03-08 00:22:04 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
int
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjSetValue(virSecretObjPtr 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
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjGetValueSize(virSecretObjPtr obj);
|
2016-03-08 00:40:58 +00:00
|
|
|
|
2017-04-03 11:47:58 +00:00
|
|
|
void
|
2017-04-01 15:46:36 +00:00
|
|
|
virSecretObjSetValueSize(virSecretObjPtr 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
|
|
|
|
virSecretLoadAllConfigs(virSecretObjListPtr secrets,
|
|
|
|
const char *configDir);
|