2016-02-27 06:49:12 -05: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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIRSECRETOBJ_H__
|
|
|
|
# define __VIRSECRETOBJ_H__
|
|
|
|
|
|
|
|
# include "internal.h"
|
|
|
|
|
|
|
|
# include "secret_conf.h"
|
2016-02-25 06:30:39 -05:00
|
|
|
# include "virobject.h"
|
2016-02-27 06:49:12 -05:00
|
|
|
|
|
|
|
typedef struct _virSecretObj virSecretObj;
|
|
|
|
typedef virSecretObj *virSecretObjPtr;
|
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
void
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjEndAPI(virSecretObjPtr *obj);
|
2016-02-27 06:49:12 -05:00
|
|
|
|
|
|
|
typedef struct _virSecretObjList virSecretObjList;
|
|
|
|
typedef virSecretObjList *virSecretObjListPtr;
|
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
virSecretObjListPtr
|
|
|
|
virSecretObjListNew(void);
|
|
|
|
|
|
|
|
virSecretObjPtr
|
|
|
|
virSecretObjListFindByUUID(virSecretObjListPtr secrets,
|
2017-04-21 11:43:37 -04:00
|
|
|
const char *uuidstr);
|
2017-04-03 07:47:58 -04:00
|
|
|
|
|
|
|
virSecretObjPtr
|
|
|
|
virSecretObjListFindByUsage(virSecretObjListPtr secrets,
|
|
|
|
int usageType,
|
|
|
|
const char *usageID);
|
|
|
|
|
|
|
|
void
|
|
|
|
virSecretObjListRemove(virSecretObjListPtr secrets,
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjPtr obj);
|
2017-04-03 07:47:58 -04:00
|
|
|
|
|
|
|
virSecretObjPtr
|
|
|
|
virSecretObjListAdd(virSecretObjListPtr secrets,
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretDefPtr newdef,
|
2017-04-03 07:47:58 -04:00
|
|
|
const char *configDir,
|
|
|
|
virSecretDefPtr *oldDef);
|
|
|
|
|
|
|
|
typedef bool
|
|
|
|
(*virSecretObjListACLFilter)(virConnectPtr conn,
|
|
|
|
virSecretDefPtr def);
|
|
|
|
|
|
|
|
int
|
|
|
|
virSecretObjListNumOfSecrets(virSecretObjListPtr secrets,
|
2017-08-16 09:26:41 -04:00
|
|
|
virSecretObjListACLFilter filter,
|
2017-04-03 07:47:58 -04:00
|
|
|
virConnectPtr conn);
|
2016-02-28 09:34:21 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
int
|
|
|
|
virSecretObjListExport(virConnectPtr conn,
|
|
|
|
virSecretObjListPtr secretobjs,
|
|
|
|
virSecretPtr **secrets,
|
2017-08-16 09:26:41 -04:00
|
|
|
virSecretObjListACLFilter filter,
|
2017-04-03 07:47:58 -04:00
|
|
|
unsigned int flags);
|
2016-02-28 09:34:21 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
int
|
|
|
|
virSecretObjListGetUUIDs(virSecretObjListPtr secrets,
|
|
|
|
char **uuids,
|
2017-04-19 08:34:04 -04:00
|
|
|
int maxuuids,
|
2017-08-16 09:26:41 -04:00
|
|
|
virSecretObjListACLFilter filter,
|
2017-04-03 07:47:58 -04:00
|
|
|
virConnectPtr conn);
|
2016-02-29 06:52:00 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
int
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjDeleteConfig(virSecretObjPtr obj);
|
2016-02-28 10:56:17 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
void
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjDeleteData(virSecretObjPtr obj);
|
2016-03-07 18:06:57 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
int
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjSaveConfig(virSecretObjPtr obj);
|
2016-03-07 18:06:57 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
int
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjSaveData(virSecretObjPtr obj);
|
2016-03-18 10:17:25 -04:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
virSecretDefPtr
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjGetDef(virSecretObjPtr obj);
|
2016-03-18 10:17:25 -04:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
void
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjSetDef(virSecretObjPtr obj,
|
2017-04-03 07:47:58 -04:00
|
|
|
virSecretDefPtr def);
|
2016-03-07 19:22:04 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
unsigned char *
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjGetValue(virSecretObjPtr obj);
|
2016-03-07 19:22:04 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
int
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjSetValue(virSecretObjPtr obj,
|
2017-04-03 07:47:58 -04:00
|
|
|
const unsigned char *value,
|
|
|
|
size_t value_size);
|
2016-03-07 19:40:58 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
size_t
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjGetValueSize(virSecretObjPtr obj);
|
2016-03-07 19:40:58 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
void
|
2017-04-01 11:46:36 -04:00
|
|
|
virSecretObjSetValueSize(virSecretObjPtr obj,
|
2017-04-03 07:47:58 -04:00
|
|
|
size_t value_size);
|
2016-03-07 19:40:58 -05:00
|
|
|
|
2017-04-03 07:47:58 -04:00
|
|
|
int
|
|
|
|
virSecretLoadAllConfigs(virSecretObjListPtr secrets,
|
|
|
|
const char *configDir);
|
2016-03-07 19:40:58 -05:00
|
|
|
|
2016-02-27 06:49:12 -05:00
|
|
|
#endif /* __VIRSECRETOBJ_H__ */
|