mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Secret manipulation libvirtd wire protocol & remote dispatcher
* qemud/remote_protocol.x: Define wire protocol for secrets public APIs * qemud/remote_protocol.h, qemud/remote_protocol.c, qemud/remote_dispatch_table.h, qemud/remote_dispatch_ret.h, qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_args.h: Re-generate from updated protocol definition * qemud/remote.c: Implement RPC dispatchers for new secrets APIs
This commit is contained in:
parent
b35f0131e6
commit
0de63c6745
203
qemud/remote.c
203
qemud/remote.c
@ -64,12 +64,14 @@ static virNetworkPtr get_nonnull_network (virConnectPtr conn, remote_nonnull_net
|
||||
static virInterfacePtr get_nonnull_interface (virConnectPtr conn, remote_nonnull_interface iface);
|
||||
static virStoragePoolPtr get_nonnull_storage_pool (virConnectPtr conn, remote_nonnull_storage_pool pool);
|
||||
static virStorageVolPtr get_nonnull_storage_vol (virConnectPtr conn, remote_nonnull_storage_vol vol);
|
||||
static virSecretPtr get_nonnull_secret (virConnectPtr conn, remote_nonnull_secret secret);
|
||||
static void make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr dom_src);
|
||||
static void make_nonnull_network (remote_nonnull_network *net_dst, virNetworkPtr net_src);
|
||||
static void make_nonnull_interface (remote_nonnull_interface *interface_dst, virInterfacePtr interface_src);
|
||||
static void make_nonnull_storage_pool (remote_nonnull_storage_pool *pool_dst, virStoragePoolPtr pool_src);
|
||||
static void make_nonnull_storage_vol (remote_nonnull_storage_vol *vol_dst, virStorageVolPtr vol_src);
|
||||
static void make_nonnull_node_device (remote_nonnull_node_device *dev_dst, virNodeDevicePtr dev_src);
|
||||
static void make_nonnull_secret (remote_nonnull_secret *secret_dst, virSecretPtr secret_src);
|
||||
|
||||
|
||||
#include "remote_dispatch_prototypes.h"
|
||||
@ -4588,6 +4590,195 @@ error:
|
||||
VIR_FREE(msg);
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNumOfSecrets (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn, remote_error *err,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_num_of_secrets_ret *ret)
|
||||
{
|
||||
ret->num = virConnectNumOfSecrets (conn);
|
||||
if (ret->num == -1) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchListSecrets (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn, remote_error *err,
|
||||
remote_list_secrets_args *args,
|
||||
remote_list_secrets_ret *ret)
|
||||
{
|
||||
if (args->maxuuids > REMOTE_SECRET_UUID_LIST_MAX) {
|
||||
remoteDispatchFormatError (err, "%s",
|
||||
_("maxuuids > REMOTE_SECRET_UUID_LIST_MAX"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (VIR_ALLOC_N (ret->uuids.uuids_val, args->maxuuids) < 0) {
|
||||
remoteDispatchOOMError (err);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret->uuids.uuids_len = virConnectListSecrets (conn, ret->uuids.uuids_val,
|
||||
args->maxuuids);
|
||||
if (ret->uuids.uuids_len == -1) {
|
||||
VIR_FREE (ret->uuids.uuids_val);
|
||||
remoteDispatchConnError (err, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchSecretDefineXml (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn, remote_error *err,
|
||||
remote_secret_define_xml_args *args,
|
||||
remote_secret_define_xml_ret *ret)
|
||||
{
|
||||
virSecretPtr secret;
|
||||
|
||||
secret = virSecretDefineXML (conn, args->xml, args->flags);
|
||||
if (secret == NULL) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
make_nonnull_secret (&ret->secret, secret);
|
||||
virSecretFree (secret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchSecretGetValue (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn, remote_error *err,
|
||||
remote_secret_get_value_args *args,
|
||||
remote_secret_get_value_ret *ret)
|
||||
{
|
||||
virSecretPtr secret;
|
||||
size_t value_size;
|
||||
unsigned char *value;
|
||||
|
||||
secret = get_nonnull_secret (conn, args->secret);
|
||||
if (secret == NULL) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = virSecretGetValue (secret, &value_size, args->flags);
|
||||
if (value == NULL) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
virSecretFree(secret);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret->value.value_len = value_size;
|
||||
ret->value.value_val = (char *)value;
|
||||
virSecretFree(secret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchSecretGetXmlDesc (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn, remote_error *err,
|
||||
remote_secret_get_xml_desc_args *args,
|
||||
remote_secret_get_xml_desc_ret *ret)
|
||||
{
|
||||
virSecretPtr secret;
|
||||
|
||||
secret = get_nonnull_secret (conn, args->secret);
|
||||
if (secret == NULL) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
return -1;
|
||||
}
|
||||
ret->xml = virSecretGetXMLDesc (secret, args->flags);
|
||||
if (ret->xml == NULL) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
virSecretFree(secret);
|
||||
return -1;
|
||||
}
|
||||
virSecretFree(secret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchSecretLookupByUuidString (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn, remote_error *err,
|
||||
remote_secret_lookup_by_uuid_string_args *args,
|
||||
remote_secret_lookup_by_uuid_string_ret *ret)
|
||||
{
|
||||
virSecretPtr secret;
|
||||
|
||||
secret = virSecretLookupByUUIDString (conn, args->uuid);
|
||||
if (secret == NULL) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
make_nonnull_secret (&ret->secret, secret);
|
||||
virSecretFree (secret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchSecretSetValue (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn, remote_error *err,
|
||||
remote_secret_set_value_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virSecretPtr secret;
|
||||
|
||||
secret = get_nonnull_secret (conn, args->secret);
|
||||
if (secret == NULL) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
return -1;
|
||||
}
|
||||
if (virSecretSetValue (secret, (const unsigned char *)args->value.value_val,
|
||||
args->value.value_len, args->flags) < 0) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
virSecretFree(secret);
|
||||
return -1;
|
||||
}
|
||||
|
||||
virSecretFree(secret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchSecretUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn, remote_error *err,
|
||||
remote_secret_undefine_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virSecretPtr secret;
|
||||
|
||||
secret = get_nonnull_secret (conn, args->secret);
|
||||
if (secret == NULL) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
return -1;
|
||||
}
|
||||
if (virSecretUndefine (secret) < 0) {
|
||||
remoteDispatchConnError (err, conn);
|
||||
virSecretFree(secret);
|
||||
return -1;
|
||||
}
|
||||
|
||||
virSecretFree(secret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*----- Helpers. -----*/
|
||||
|
||||
/* get_nonnull_domain and get_nonnull_network turn an on-wire
|
||||
@ -4634,6 +4825,12 @@ get_nonnull_storage_vol (virConnectPtr conn, remote_nonnull_storage_vol vol)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static virSecretPtr
|
||||
get_nonnull_secret (virConnectPtr conn, remote_nonnull_secret secret)
|
||||
{
|
||||
return virGetSecret (conn, secret.uuid);
|
||||
}
|
||||
|
||||
/* Make remote_nonnull_domain and remote_nonnull_network. */
|
||||
static void
|
||||
make_nonnull_domain (remote_nonnull_domain *dom_dst, virDomainPtr dom_src)
|
||||
@ -4678,3 +4875,9 @@ make_nonnull_node_device (remote_nonnull_node_device *dev_dst, virNodeDevicePtr
|
||||
{
|
||||
dev_dst->name = strdup(dev_src->name);
|
||||
}
|
||||
|
||||
static void
|
||||
make_nonnull_secret (remote_nonnull_secret *secret_dst, virSecretPtr secret_src)
|
||||
{
|
||||
secret_dst->uuid = strdup(secret_src->uuid);
|
||||
}
|
||||
|
@ -117,3 +117,10 @@
|
||||
remote_domain_xml_from_native_args val_remote_domain_xml_from_native_args;
|
||||
remote_domain_xml_to_native_args val_remote_domain_xml_to_native_args;
|
||||
remote_list_defined_interfaces_args val_remote_list_defined_interfaces_args;
|
||||
remote_list_secrets_args val_remote_list_secrets_args;
|
||||
remote_secret_lookup_by_uuid_string_args val_remote_secret_lookup_by_uuid_string_args;
|
||||
remote_secret_define_xml_args val_remote_secret_define_xml_args;
|
||||
remote_secret_get_xml_desc_args val_remote_secret_get_xml_desc_args;
|
||||
remote_secret_set_value_args val_remote_secret_set_value_args;
|
||||
remote_secret_get_value_args val_remote_secret_get_value_args;
|
||||
remote_secret_undefine_args val_remote_secret_undefine_args;
|
||||
|
@ -513,6 +513,13 @@ static int remoteDispatchListNetworks(
|
||||
remote_error *err,
|
||||
remote_list_networks_args *args,
|
||||
remote_list_networks_ret *ret);
|
||||
static int remoteDispatchListSecrets(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_error *err,
|
||||
remote_list_secrets_args *args,
|
||||
remote_list_secrets_ret *ret);
|
||||
static int remoteDispatchListStoragePools(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
@ -758,6 +765,13 @@ static int remoteDispatchNumOfNetworks(
|
||||
remote_error *err,
|
||||
void *args,
|
||||
remote_num_of_networks_ret *ret);
|
||||
static int remoteDispatchNumOfSecrets(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_error *err,
|
||||
void *args,
|
||||
remote_num_of_secrets_ret *ret);
|
||||
static int remoteDispatchNumOfStoragePools(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
@ -772,6 +786,48 @@ static int remoteDispatchOpen(
|
||||
remote_error *err,
|
||||
remote_open_args *args,
|
||||
void *ret);
|
||||
static int remoteDispatchSecretDefineXml(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_error *err,
|
||||
remote_secret_define_xml_args *args,
|
||||
remote_secret_define_xml_ret *ret);
|
||||
static int remoteDispatchSecretGetValue(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_error *err,
|
||||
remote_secret_get_value_args *args,
|
||||
remote_secret_get_value_ret *ret);
|
||||
static int remoteDispatchSecretGetXmlDesc(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_error *err,
|
||||
remote_secret_get_xml_desc_args *args,
|
||||
remote_secret_get_xml_desc_ret *ret);
|
||||
static int remoteDispatchSecretLookupByUuidString(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_error *err,
|
||||
remote_secret_lookup_by_uuid_string_args *args,
|
||||
remote_secret_lookup_by_uuid_string_ret *ret);
|
||||
static int remoteDispatchSecretSetValue(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_error *err,
|
||||
remote_secret_set_value_args *args,
|
||||
void *ret);
|
||||
static int remoteDispatchSecretUndefine(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_error *err,
|
||||
remote_secret_undefine_args *args,
|
||||
void *ret);
|
||||
static int remoteDispatchStoragePoolBuild(
|
||||
struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
|
@ -99,3 +99,9 @@
|
||||
remote_domain_xml_to_native_ret val_remote_domain_xml_to_native_ret;
|
||||
remote_num_of_defined_interfaces_ret val_remote_num_of_defined_interfaces_ret;
|
||||
remote_list_defined_interfaces_ret val_remote_list_defined_interfaces_ret;
|
||||
remote_num_of_secrets_ret val_remote_num_of_secrets_ret;
|
||||
remote_list_secrets_ret val_remote_list_secrets_ret;
|
||||
remote_secret_lookup_by_uuid_string_ret val_remote_secret_lookup_by_uuid_string_ret;
|
||||
remote_secret_define_xml_ret val_remote_secret_define_xml_ret;
|
||||
remote_secret_get_xml_desc_ret val_remote_secret_get_xml_desc_ret;
|
||||
remote_secret_get_value_ret val_remote_secret_get_value_ret;
|
||||
|
@ -697,3 +697,43 @@
|
||||
.args_filter = (xdrproc_t) xdr_remote_list_defined_interfaces_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_list_defined_interfaces_ret,
|
||||
},
|
||||
{ /* NumOfSecrets => 139 */
|
||||
.fn = (dispatch_fn) remoteDispatchNumOfSecrets,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_num_of_secrets_ret,
|
||||
},
|
||||
{ /* ListSecrets => 140 */
|
||||
.fn = (dispatch_fn) remoteDispatchListSecrets,
|
||||
.args_filter = (xdrproc_t) xdr_remote_list_secrets_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_list_secrets_ret,
|
||||
},
|
||||
{ /* SecretLookupByUuidString => 141 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretLookupByUuidString,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_lookup_by_uuid_string_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_lookup_by_uuid_string_ret,
|
||||
},
|
||||
{ /* SecretDefineXml => 142 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretDefineXml,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_define_xml_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_define_xml_ret,
|
||||
},
|
||||
{ /* SecretGetXmlDesc => 143 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretGetXmlDesc,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_get_xml_desc_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_get_xml_desc_ret,
|
||||
},
|
||||
{ /* SecretSetValue => 144 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretSetValue,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_set_value_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* SecretGetValue => 145 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretGetValue,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_get_value_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_get_value_ret,
|
||||
},
|
||||
{ /* SecretUndefine => 146 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretUndefine,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_undefine_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
|
@ -103,6 +103,15 @@ xdr_remote_nonnull_node_device (XDR *xdrs, remote_nonnull_node_device *objp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_nonnull_secret (XDR *xdrs, remote_nonnull_secret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->uuid))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_domain (XDR *xdrs, remote_domain *objp)
|
||||
{
|
||||
@ -2533,6 +2542,137 @@ xdr_remote_domain_xml_to_native_ret (XDR *xdrs, remote_domain_xml_to_native_ret
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_num_of_secrets_ret (XDR *xdrs, remote_num_of_secrets_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_int (xdrs, &objp->num))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_list_secrets_args (XDR *xdrs, remote_list_secrets_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_int (xdrs, &objp->maxuuids))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_list_secrets_ret (XDR *xdrs, remote_list_secrets_ret *objp)
|
||||
{
|
||||
char **objp_cpp0 = (char **) (void *) &objp->uuids.uuids_val;
|
||||
|
||||
if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->uuids.uuids_len, REMOTE_SECRET_UUID_LIST_MAX,
|
||||
sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_lookup_by_uuid_string_args (XDR *xdrs, remote_secret_lookup_by_uuid_string_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->uuid))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_lookup_by_uuid_string_ret (XDR *xdrs, remote_secret_lookup_by_uuid_string_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_secret (xdrs, &objp->secret))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_define_xml_args (XDR *xdrs, remote_secret_define_xml_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->xml))
|
||||
return FALSE;
|
||||
if (!xdr_u_int (xdrs, &objp->flags))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_define_xml_ret (XDR *xdrs, remote_secret_define_xml_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_secret (xdrs, &objp->secret))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_get_xml_desc_args (XDR *xdrs, remote_secret_get_xml_desc_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_secret (xdrs, &objp->secret))
|
||||
return FALSE;
|
||||
if (!xdr_u_int (xdrs, &objp->flags))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_get_xml_desc_ret (XDR *xdrs, remote_secret_get_xml_desc_ret *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_string (xdrs, &objp->xml))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_set_value_args (XDR *xdrs, remote_secret_set_value_args *objp)
|
||||
{
|
||||
char **objp_cpp0 = (char **) (void *) &objp->value.value_val;
|
||||
|
||||
if (!xdr_remote_nonnull_secret (xdrs, &objp->secret))
|
||||
return FALSE;
|
||||
if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->value.value_len, REMOTE_SECRET_VALUE_MAX))
|
||||
return FALSE;
|
||||
if (!xdr_u_int (xdrs, &objp->flags))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_get_value_args (XDR *xdrs, remote_secret_get_value_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_secret (xdrs, &objp->secret))
|
||||
return FALSE;
|
||||
if (!xdr_u_int (xdrs, &objp->flags))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_get_value_ret (XDR *xdrs, remote_secret_get_value_ret *objp)
|
||||
{
|
||||
char **objp_cpp0 = (char **) (void *) &objp->value.value_val;
|
||||
|
||||
if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->value.value_len, REMOTE_SECRET_VALUE_MAX))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_secret_undefine_args (XDR *xdrs, remote_secret_undefine_args *objp)
|
||||
{
|
||||
|
||||
if (!xdr_remote_nonnull_secret (xdrs, &objp->secret))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_remote_procedure (XDR *xdrs, remote_procedure *objp)
|
||||
{
|
||||
|
@ -43,6 +43,8 @@ typedef remote_nonnull_string *remote_string;
|
||||
#define REMOTE_SECURITY_MODEL_MAX VIR_SECURITY_MODEL_BUFLEN
|
||||
#define REMOTE_SECURITY_LABEL_MAX VIR_SECURITY_LABEL_BUFLEN
|
||||
#define REMOTE_SECURITY_DOI_MAX VIR_SECURITY_DOI_BUFLEN
|
||||
#define REMOTE_SECRET_VALUE_MAX 65536
|
||||
#define REMOTE_SECRET_UUID_LIST_MAX 16384
|
||||
|
||||
typedef char remote_uuid[VIR_UUID_BUFLEN];
|
||||
|
||||
@ -83,6 +85,11 @@ struct remote_nonnull_node_device {
|
||||
};
|
||||
typedef struct remote_nonnull_node_device remote_nonnull_node_device;
|
||||
|
||||
struct remote_nonnull_secret {
|
||||
remote_nonnull_string uuid;
|
||||
};
|
||||
typedef struct remote_nonnull_secret remote_nonnull_secret;
|
||||
|
||||
typedef remote_nonnull_domain *remote_domain;
|
||||
|
||||
typedef remote_nonnull_network *remote_network;
|
||||
@ -1427,6 +1434,85 @@ struct remote_domain_xml_to_native_ret {
|
||||
remote_nonnull_string nativeConfig;
|
||||
};
|
||||
typedef struct remote_domain_xml_to_native_ret remote_domain_xml_to_native_ret;
|
||||
|
||||
struct remote_num_of_secrets_ret {
|
||||
int num;
|
||||
};
|
||||
typedef struct remote_num_of_secrets_ret remote_num_of_secrets_ret;
|
||||
|
||||
struct remote_list_secrets_args {
|
||||
int maxuuids;
|
||||
};
|
||||
typedef struct remote_list_secrets_args remote_list_secrets_args;
|
||||
|
||||
struct remote_list_secrets_ret {
|
||||
struct {
|
||||
u_int uuids_len;
|
||||
remote_nonnull_string *uuids_val;
|
||||
} uuids;
|
||||
};
|
||||
typedef struct remote_list_secrets_ret remote_list_secrets_ret;
|
||||
|
||||
struct remote_secret_lookup_by_uuid_string_args {
|
||||
remote_nonnull_string uuid;
|
||||
};
|
||||
typedef struct remote_secret_lookup_by_uuid_string_args remote_secret_lookup_by_uuid_string_args;
|
||||
|
||||
struct remote_secret_lookup_by_uuid_string_ret {
|
||||
remote_nonnull_secret secret;
|
||||
};
|
||||
typedef struct remote_secret_lookup_by_uuid_string_ret remote_secret_lookup_by_uuid_string_ret;
|
||||
|
||||
struct remote_secret_define_xml_args {
|
||||
remote_nonnull_string xml;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct remote_secret_define_xml_args remote_secret_define_xml_args;
|
||||
|
||||
struct remote_secret_define_xml_ret {
|
||||
remote_nonnull_secret secret;
|
||||
};
|
||||
typedef struct remote_secret_define_xml_ret remote_secret_define_xml_ret;
|
||||
|
||||
struct remote_secret_get_xml_desc_args {
|
||||
remote_nonnull_secret secret;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct remote_secret_get_xml_desc_args remote_secret_get_xml_desc_args;
|
||||
|
||||
struct remote_secret_get_xml_desc_ret {
|
||||
remote_nonnull_string xml;
|
||||
};
|
||||
typedef struct remote_secret_get_xml_desc_ret remote_secret_get_xml_desc_ret;
|
||||
|
||||
struct remote_secret_set_value_args {
|
||||
remote_nonnull_secret secret;
|
||||
struct {
|
||||
u_int value_len;
|
||||
char *value_val;
|
||||
} value;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct remote_secret_set_value_args remote_secret_set_value_args;
|
||||
|
||||
struct remote_secret_get_value_args {
|
||||
remote_nonnull_secret secret;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct remote_secret_get_value_args remote_secret_get_value_args;
|
||||
|
||||
struct remote_secret_get_value_ret {
|
||||
struct {
|
||||
u_int value_len;
|
||||
char *value_val;
|
||||
} value;
|
||||
};
|
||||
typedef struct remote_secret_get_value_ret remote_secret_get_value_ret;
|
||||
|
||||
struct remote_secret_undefine_args {
|
||||
remote_nonnull_secret secret;
|
||||
};
|
||||
typedef struct remote_secret_undefine_args remote_secret_undefine_args;
|
||||
#define REMOTE_PROGRAM 0x20008086
|
||||
#define REMOTE_PROTOCOL_VERSION 1
|
||||
|
||||
@ -1569,6 +1655,14 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_XML_TO_NATIVE = 136,
|
||||
REMOTE_PROC_NUM_OF_DEFINED_INTERFACES = 137,
|
||||
REMOTE_PROC_LIST_DEFINED_INTERFACES = 138,
|
||||
REMOTE_PROC_NUM_OF_SECRETS = 139,
|
||||
REMOTE_PROC_LIST_SECRETS = 140,
|
||||
REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING = 141,
|
||||
REMOTE_PROC_SECRET_DEFINE_XML = 142,
|
||||
REMOTE_PROC_SECRET_GET_XML_DESC = 143,
|
||||
REMOTE_PROC_SECRET_SET_VALUE = 144,
|
||||
REMOTE_PROC_SECRET_GET_VALUE = 145,
|
||||
REMOTE_PROC_SECRET_UNDEFINE = 146,
|
||||
};
|
||||
typedef enum remote_procedure remote_procedure;
|
||||
|
||||
@ -1608,6 +1702,7 @@ extern bool_t xdr_remote_nonnull_interface (XDR *, remote_nonnull_interface*);
|
||||
extern bool_t xdr_remote_nonnull_storage_pool (XDR *, remote_nonnull_storage_pool*);
|
||||
extern bool_t xdr_remote_nonnull_storage_vol (XDR *, remote_nonnull_storage_vol*);
|
||||
extern bool_t xdr_remote_nonnull_node_device (XDR *, remote_nonnull_node_device*);
|
||||
extern bool_t xdr_remote_nonnull_secret (XDR *, remote_nonnull_secret*);
|
||||
extern bool_t xdr_remote_domain (XDR *, remote_domain*);
|
||||
extern bool_t xdr_remote_network (XDR *, remote_network*);
|
||||
extern bool_t xdr_remote_storage_pool (XDR *, remote_storage_pool*);
|
||||
@ -1831,6 +1926,19 @@ extern bool_t xdr_remote_domain_xml_from_native_args (XDR *, remote_domain_xml_
|
||||
extern bool_t xdr_remote_domain_xml_from_native_ret (XDR *, remote_domain_xml_from_native_ret*);
|
||||
extern bool_t xdr_remote_domain_xml_to_native_args (XDR *, remote_domain_xml_to_native_args*);
|
||||
extern bool_t xdr_remote_domain_xml_to_native_ret (XDR *, remote_domain_xml_to_native_ret*);
|
||||
extern bool_t xdr_remote_num_of_secrets_ret (XDR *, remote_num_of_secrets_ret*);
|
||||
extern bool_t xdr_remote_list_secrets_args (XDR *, remote_list_secrets_args*);
|
||||
extern bool_t xdr_remote_list_secrets_ret (XDR *, remote_list_secrets_ret*);
|
||||
extern bool_t xdr_remote_secret_lookup_by_uuid_string_args (XDR *, remote_secret_lookup_by_uuid_string_args*);
|
||||
extern bool_t xdr_remote_secret_lookup_by_uuid_string_ret (XDR *, remote_secret_lookup_by_uuid_string_ret*);
|
||||
extern bool_t xdr_remote_secret_define_xml_args (XDR *, remote_secret_define_xml_args*);
|
||||
extern bool_t xdr_remote_secret_define_xml_ret (XDR *, remote_secret_define_xml_ret*);
|
||||
extern bool_t xdr_remote_secret_get_xml_desc_args (XDR *, remote_secret_get_xml_desc_args*);
|
||||
extern bool_t xdr_remote_secret_get_xml_desc_ret (XDR *, remote_secret_get_xml_desc_ret*);
|
||||
extern bool_t xdr_remote_secret_set_value_args (XDR *, remote_secret_set_value_args*);
|
||||
extern bool_t xdr_remote_secret_get_value_args (XDR *, remote_secret_get_value_args*);
|
||||
extern bool_t xdr_remote_secret_get_value_ret (XDR *, remote_secret_get_value_ret*);
|
||||
extern bool_t xdr_remote_secret_undefine_args (XDR *, remote_secret_undefine_args*);
|
||||
extern bool_t xdr_remote_procedure (XDR *, remote_procedure*);
|
||||
extern bool_t xdr_remote_message_type (XDR *, remote_message_type*);
|
||||
extern bool_t xdr_remote_message_status (XDR *, remote_message_status*);
|
||||
@ -1846,6 +1954,7 @@ extern bool_t xdr_remote_nonnull_interface ();
|
||||
extern bool_t xdr_remote_nonnull_storage_pool ();
|
||||
extern bool_t xdr_remote_nonnull_storage_vol ();
|
||||
extern bool_t xdr_remote_nonnull_node_device ();
|
||||
extern bool_t xdr_remote_nonnull_secret ();
|
||||
extern bool_t xdr_remote_domain ();
|
||||
extern bool_t xdr_remote_network ();
|
||||
extern bool_t xdr_remote_storage_pool ();
|
||||
@ -2069,6 +2178,19 @@ extern bool_t xdr_remote_domain_xml_from_native_args ();
|
||||
extern bool_t xdr_remote_domain_xml_from_native_ret ();
|
||||
extern bool_t xdr_remote_domain_xml_to_native_args ();
|
||||
extern bool_t xdr_remote_domain_xml_to_native_ret ();
|
||||
extern bool_t xdr_remote_num_of_secrets_ret ();
|
||||
extern bool_t xdr_remote_list_secrets_args ();
|
||||
extern bool_t xdr_remote_list_secrets_ret ();
|
||||
extern bool_t xdr_remote_secret_lookup_by_uuid_string_args ();
|
||||
extern bool_t xdr_remote_secret_lookup_by_uuid_string_ret ();
|
||||
extern bool_t xdr_remote_secret_define_xml_args ();
|
||||
extern bool_t xdr_remote_secret_define_xml_ret ();
|
||||
extern bool_t xdr_remote_secret_get_xml_desc_args ();
|
||||
extern bool_t xdr_remote_secret_get_xml_desc_ret ();
|
||||
extern bool_t xdr_remote_secret_set_value_args ();
|
||||
extern bool_t xdr_remote_secret_get_value_args ();
|
||||
extern bool_t xdr_remote_secret_get_value_ret ();
|
||||
extern bool_t xdr_remote_secret_undefine_args ();
|
||||
extern bool_t xdr_remote_procedure ();
|
||||
extern bool_t xdr_remote_message_type ();
|
||||
extern bool_t xdr_remote_message_status ();
|
||||
|
@ -136,6 +136,16 @@ const REMOTE_SECURITY_LABEL_MAX = VIR_SECURITY_LABEL_BUFLEN;
|
||||
*/
|
||||
const REMOTE_SECURITY_DOI_MAX = VIR_SECURITY_DOI_BUFLEN;
|
||||
|
||||
/*
|
||||
* Maximum size of a secret value.
|
||||
*/
|
||||
const REMOTE_SECRET_VALUE_MAX = 65536;
|
||||
|
||||
/*
|
||||
* Upper limit on list of secrets.
|
||||
*/
|
||||
const REMOTE_SECRET_UUID_LIST_MAX = 16384;
|
||||
|
||||
/* UUID. VIR_UUID_BUFLEN definition comes from libvirt.h */
|
||||
typedef opaque remote_uuid[VIR_UUID_BUFLEN];
|
||||
|
||||
@ -176,6 +186,11 @@ struct remote_nonnull_node_device {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
|
||||
/* A secret which may not be null. */
|
||||
struct remote_nonnull_secret {
|
||||
remote_nonnull_string uuid;
|
||||
};
|
||||
|
||||
/* A domain or network which may be NULL. */
|
||||
typedef remote_nonnull_domain *remote_domain;
|
||||
typedef remote_nonnull_network *remote_network;
|
||||
@ -1266,6 +1281,63 @@ struct remote_domain_xml_to_native_ret {
|
||||
};
|
||||
|
||||
|
||||
struct remote_num_of_secrets_ret {
|
||||
int num;
|
||||
};
|
||||
|
||||
struct remote_list_secrets_args {
|
||||
int maxuuids;
|
||||
};
|
||||
|
||||
struct remote_list_secrets_ret {
|
||||
remote_nonnull_string uuids<REMOTE_SECRET_UUID_LIST_MAX>;
|
||||
};
|
||||
|
||||
struct remote_secret_lookup_by_uuid_string_args {
|
||||
remote_nonnull_string uuid;
|
||||
};
|
||||
|
||||
struct remote_secret_lookup_by_uuid_string_ret {
|
||||
remote_nonnull_secret secret;
|
||||
};
|
||||
|
||||
struct remote_secret_define_xml_args {
|
||||
remote_nonnull_string xml;
|
||||
unsigned flags;
|
||||
};
|
||||
|
||||
struct remote_secret_define_xml_ret {
|
||||
remote_nonnull_secret secret;
|
||||
};
|
||||
|
||||
struct remote_secret_get_xml_desc_args {
|
||||
remote_nonnull_secret secret;
|
||||
unsigned flags;
|
||||
};
|
||||
|
||||
struct remote_secret_get_xml_desc_ret {
|
||||
remote_nonnull_string xml;
|
||||
};
|
||||
|
||||
struct remote_secret_set_value_args {
|
||||
remote_nonnull_secret secret;
|
||||
opaque value<REMOTE_SECRET_VALUE_MAX>;
|
||||
unsigned flags;
|
||||
};
|
||||
|
||||
struct remote_secret_get_value_args {
|
||||
remote_nonnull_secret secret;
|
||||
unsigned flags;
|
||||
};
|
||||
|
||||
struct remote_secret_get_value_ret {
|
||||
opaque value<REMOTE_SECRET_VALUE_MAX>;
|
||||
};
|
||||
|
||||
struct remote_secret_undefine_args {
|
||||
remote_nonnull_secret secret;
|
||||
};
|
||||
|
||||
/*----- Protocol. -----*/
|
||||
|
||||
/* Define the program number, protocol version and procedure numbers here. */
|
||||
@ -1424,7 +1496,16 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_XML_TO_NATIVE = 136,
|
||||
|
||||
REMOTE_PROC_NUM_OF_DEFINED_INTERFACES = 137,
|
||||
REMOTE_PROC_LIST_DEFINED_INTERFACES = 138
|
||||
REMOTE_PROC_LIST_DEFINED_INTERFACES = 138,
|
||||
|
||||
REMOTE_PROC_NUM_OF_SECRETS = 139,
|
||||
REMOTE_PROC_LIST_SECRETS = 140,
|
||||
REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING = 141,
|
||||
REMOTE_PROC_SECRET_DEFINE_XML = 142,
|
||||
REMOTE_PROC_SECRET_GET_XML_DESC = 143,
|
||||
REMOTE_PROC_SECRET_SET_VALUE = 144,
|
||||
REMOTE_PROC_SECRET_GET_VALUE = 145,
|
||||
REMOTE_PROC_SECRET_UNDEFINE = 146
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user