Files
cryptsetup/lib/cli/libcryptsetup_cli.h
Ondrej Kozina a985c12659 WIP: Introduce libcryptsetup_cli.
Introducing new library supposed to be used in
cryptsetup tools and future cryptsetup loadable plugins

TODO:
  - distribution
  - cleanup header files
  - incorporate also plugin API?
2020-08-15 15:24:18 +02:00

62 lines
1.7 KiB
C

/*
* libcryptsetup_cli - cryptsetup command line tools library
*
* Copyright (C) 2012-2020 Red Hat, Inc. All rights reserved.
* Copyright (C) 2012-2020 Milan Broz
* Copyright (C) 2020 Ondrej Kozina
*
* This file 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 file 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 file; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _LIBCRYPTSETUP_CLI_H
#define _LIBCRYPTSETUP_CLI_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
struct crypt_cli;
struct crypt_device;
typedef enum {
CRYPT_ARG_BOOL = 0,
CRYPT_ARG_STRING,
CRYPT_ARG_INT32,
CRYPT_ARG_UINT32,
CRYPT_ARG_INT64,
CRYPT_ARG_UINT64
} crypt_arg_type_info;
int crypt_cli_get_key(const char *prompt,
char **key, size_t *key_size,
uint64_t keyfile_offset, size_t keyfile_size_max,
const char *key_file,
int timeout, int verify, int pwquality,
struct crypt_device *cd, struct crypt_cli *ctx);
bool crypt_cli_arg_set(struct crypt_cli *ctx, const char *name);
int crypt_cli_arg_value(struct crypt_cli *ctx, const char *name, void *value);
int crypt_cli_arg_type(struct crypt_cli *ctx, const char *name, crypt_arg_type_info *type);
#ifdef __cplusplus
}
#endif
#endif