X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcryptsetup.h;h=784c521b7c50ebde0086169192069b638899971f;hb=ab0f7346bca4a654a0dff747b5322db846a0eeb3;hp=72f0497c67b65a53d41c26753b2bc609be8f7bc3;hpb=c878e56237b67a98b7b213fcdbce841c4b1914ad;p=platform%2Fupstream%2Fcryptsetup.git diff --git a/src/cryptsetup.h b/src/cryptsetup.h index 72f0497..784c521 100644 --- a/src/cryptsetup.h +++ b/src/cryptsetup.h @@ -1,51 +1,41 @@ +/* + * cryptsetup - setup cryptographic volumes for dm-crypt + * + * Copyright (C) 2004, Christophe Saout + * Copyright (C) 2004-2007, Clemens Fruhwirth + * Copyright (C) 2009-2012, Red Hat, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef CRYPTSETUP_H #define CRYPTSETUP_H -#ifdef HAVE_CONFIG_H -# include -#endif - -#if HAVE_LOCALE_H -# include -#endif -#if !HAVE_SETLOCALE -# define setlocale(Category, Locale) do { } while (0) -#endif - -#ifdef ENABLE_NLS -# include -# define _(Text) gettext (Text) -#else -# undef bindtextdomain -# define bindtextdomain(Domain, Directory) do { } while (0) -# undef textdomain -# define textdomain(Domain) do { } while (0) -# undef dcgettext -# define dcgettext(Domainname, Text, Category) Text -# define _(Text) Text -#endif -#define N_(Text) (Text) +#include -#define DEFAULT_CIPHER "aes" -#define DEFAULT_LUKS_CIPHER "aes-cbc-essiv:sha256" -#define DEFAULT_HASH "ripemd160" -#define DEFAULT_LUKS_HASH "sha1" -#define DEFAULT_KEY_SIZE 256 -#define DEFAULT_LUKS_KEY_SIZE 128 +#include "lib/nls.h" +#include "lib/utils_crypt.h" +#include "lib/utils_loop.h" +#include "lib/utils_fips.h" -#define MAX_CIPHER_LEN 32 +#include "libcryptsetup.h" -/* Helper funcions provided by internal libcryptsetup objects */ -void set_default_log(void (*log)(int class, char *msg)); -void logger(struct crypt_device *cd, int class, const char *file, int line, const char *format, ...); -#define log_dbg(x...) logger(NULL, CRYPT_LOG_DEBUG, __FILE__, __LINE__, x) -#define log_std(x...) logger(NULL, CRYPT_LOG_NORMAL, __FILE__, __LINE__, x) -#define log_err(x...) logger(NULL, CRYPT_LOG_ERROR, __FILE__, __LINE__, x) +#define DEFAULT_CIPHER(type) (DEFAULT_##type##_CIPHER "-" DEFAULT_##type##_MODE) -extern int memlock_inc(struct crypt_device *ctx); -extern int memlock_dec(struct crypt_device *ctx); -extern int dm_init(struct crypt_device *context, int check_kernel); -extern void dm_exit(void); -extern int parse_into_name_and_mode(const char *nameAndMode, char *name, char *mode); +#define log_dbg(x...) clogger(NULL, CRYPT_LOG_DEBUG, __FILE__, __LINE__, x) +#define log_std(x...) clogger(NULL, CRYPT_LOG_NORMAL, __FILE__, __LINE__, x) +#define log_verbose(x...) clogger(NULL, CRYPT_LOG_VERBOSE, __FILE__, __LINE__, x) +#define log_err(x...) clogger(NULL, CRYPT_LOG_ERROR, __FILE__, __LINE__, x) #endif /* CRYPTSETUP_H */