int *read_only);
int wipe_device_header(const char *device, int sectors);
-/* loopback device helpers */
-char *crypt_loop_get_device(void);
-char *crypt_loop_backing_file(const char *loop);
-int crypt_loop_device(const char *loop);
-int crypt_loop_attach(const char *loop, const char *file, int offset, int *readonly);
-
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(c, x...) logger(c, CRYPT_LOG_NORMAL, __FILE__, __LINE__, x)
*key = NULL;
if(!msg && asprintf(&prompt, _("Enter passphrase for %s: "),
- crypt_get_device_name(cd)) < 0)
+ cd->backing_file ?: cd->device) < 0)
return -ENOMEM;
if (!msg)
const char *crypt_get_device_name(struct crypt_device *cd)
{
- return cd->backing_file ?: cd->device;
+ return cd->device;
}
int crypt_get_volume_key_size(struct crypt_device *cd)
--- /dev/null
+#ifndef _UTILS_LOOP_H
+#define _UTILS_LOOP_H
+
+/* loopback device helpers */
+
+#define LOOP_DEV_MAJOR 7
+
+char *crypt_loop_get_device(void);
+char *crypt_loop_backing_file(const char *loop);
+int crypt_loop_device(const char *loop);
+int crypt_loop_attach(const char *loop, const char *file, int offset, int *readonly);
+
+#endif /* _UTILS_CRYPT_H */