15da73dabSGonglei /*
25da73dabSGonglei  * QEMU Crypto Device Common Vhost User Implement
35da73dabSGonglei  *
45da73dabSGonglei  * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
55da73dabSGonglei  *
65da73dabSGonglei  * Authors:
75da73dabSGonglei  *    Gonglei <arei.gonglei@huawei.com>
85da73dabSGonglei  *
95da73dabSGonglei  * This library is free software; you can redistribute it and/or
105da73dabSGonglei  * modify it under the terms of the GNU Lesser General Public
115da73dabSGonglei  * License as published by the Free Software Foundation; either
12*0dda001bSChetan Pant  * version 2.1 of the License, or (at your option) any later version.
135da73dabSGonglei  *
145da73dabSGonglei  * This library is distributed in the hope that it will be useful,
155da73dabSGonglei  * but WITHOUT ANY WARRANTY; without even the implied warranty of
165da73dabSGonglei  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
175da73dabSGonglei  * Lesser General Public License for more details.
185da73dabSGonglei  *
195da73dabSGonglei  * You should have received a copy of the GNU Lesser General Public
205da73dabSGonglei  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
215da73dabSGonglei  *
225da73dabSGonglei  */
23ec150c7eSMarkus Armbruster 
245da73dabSGonglei #ifndef CRYPTODEV_VHOST_USER_H
255da73dabSGonglei #define CRYPTODEV_VHOST_USER_H
265da73dabSGonglei 
27ec150c7eSMarkus Armbruster #include "sysemu/cryptodev-vhost.h"
28ec150c7eSMarkus Armbruster 
290a9b9be9SGonglei #define VHOST_USER_MAX_AUTH_KEY_LEN    512
300a9b9be9SGonglei #define VHOST_USER_MAX_CIPHER_KEY_LEN  64
310a9b9be9SGonglei 
325da73dabSGonglei 
335da73dabSGonglei /**
345da73dabSGonglei  * cryptodev_vhost_user_get_vhost:
355da73dabSGonglei  * @cc: the client object for each queue
365da73dabSGonglei  * @b: the cryptodev backend common vhost object
375da73dabSGonglei  * @queue: the queue index
385da73dabSGonglei  *
395da73dabSGonglei  * Gets a new cryptodev backend common vhost object based on
405da73dabSGonglei  * @b and @queue
415da73dabSGonglei  *
425da73dabSGonglei  * Returns: the cryptodev backend common vhost object
435da73dabSGonglei  */
445da73dabSGonglei CryptoDevBackendVhost *
455da73dabSGonglei cryptodev_vhost_user_get_vhost(
465da73dabSGonglei                          CryptoDevBackendClient *cc,
475da73dabSGonglei                          CryptoDevBackend *b,
485da73dabSGonglei                          uint16_t queue);
495da73dabSGonglei 
505da73dabSGonglei #endif /* CRYPTODEV_VHOST_USER_H */
51