docs: Update documentation for spapr-vio addresses
[libvirt/ericb.git] / src / driver-secret.h
blob125238fe7b6753a6b40e4ef0890fdd5357407ecd
1 /*
2 * driver-secret.h: entry points for secret drivers
4 * Copyright (C) 2006-2014 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <http://www.gnu.org/licenses/>.
21 #pragma once
23 #ifndef __VIR_DRIVER_H_INCLUDES___
24 # error "Don't include this file directly, only use driver.h"
25 #endif
27 enum {
28 /* This getValue call is inside libvirt, override the "private" flag.
29 This flag cannot be set by outside callers. */
30 VIR_SECRET_GET_VALUE_INTERNAL_CALL = 1 << 0,
33 typedef virSecretPtr
34 (*virDrvSecretLookupByUUID)(virConnectPtr conn,
35 const unsigned char *uuid);
37 typedef virSecretPtr
38 (*virDrvSecretLookupByUsage)(virConnectPtr conn,
39 int usageType,
40 const char *usageID);
42 typedef virSecretPtr
43 (*virDrvSecretDefineXML)(virConnectPtr conn,
44 const char *xml,
45 unsigned int flags);
47 typedef char *
48 (*virDrvSecretGetXMLDesc)(virSecretPtr secret,
49 unsigned int flags);
51 typedef int
52 (*virDrvSecretSetValue)(virSecretPtr secret,
53 const unsigned char *value,
54 size_t value_size,
55 unsigned int flags);
57 typedef unsigned char *
58 (*virDrvSecretGetValue)(virSecretPtr secret,
59 size_t *value_size,
60 unsigned int flags,
61 unsigned int internalFlags);
63 typedef int
64 (*virDrvSecretUndefine)(virSecretPtr secret);
66 typedef int
67 (*virDrvConnectNumOfSecrets)(virConnectPtr conn);
69 typedef int
70 (*virDrvConnectListSecrets)(virConnectPtr conn,
71 char **uuids,
72 int maxuuids);
74 typedef int
75 (*virDrvConnectListAllSecrets)(virConnectPtr conn,
76 virSecretPtr **secrets,
77 unsigned int flags);
79 typedef int
80 (*virDrvConnectSecretEventRegisterAny)(virConnectPtr conn,
81 virSecretPtr secret,
82 int eventID,
83 virConnectSecretEventGenericCallback cb,
84 void *opaque,
85 virFreeCallback freecb);
87 typedef int
88 (*virDrvConnectSecretEventDeregisterAny)(virConnectPtr conn,
89 int callbackID);
91 typedef struct _virSecretDriver virSecretDriver;
92 typedef virSecretDriver *virSecretDriverPtr;
94 /**
95 * _virSecretDriver:
97 * Structure associated to a driver for storing secrets, defining the various
98 * entry points for it.
100 struct _virSecretDriver {
101 const char *name; /* the name of the driver */
102 virDrvConnectNumOfSecrets connectNumOfSecrets;
103 virDrvConnectListSecrets connectListSecrets;
104 virDrvConnectListAllSecrets connectListAllSecrets;
105 virDrvSecretLookupByUUID secretLookupByUUID;
106 virDrvSecretLookupByUsage secretLookupByUsage;
107 virDrvSecretDefineXML secretDefineXML;
108 virDrvSecretGetXMLDesc secretGetXMLDesc;
109 virDrvSecretSetValue secretSetValue;
110 virDrvSecretGetValue secretGetValue;
111 virDrvSecretUndefine secretUndefine;
112 virDrvConnectSecretEventRegisterAny connectSecretEventRegisterAny;
113 virDrvConnectSecretEventDeregisterAny connectSecretEventDeregisterAny;