1 /* g130syshelp.h - Global definitions for G13-SYSHELP.
2 * Copyright (C) 2015 Werner Koch
4 * This file is part of GnuPG.
6 * GnuPG is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * GnuPG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
23 #include "g13-common.h"
27 typedef struct tab_item_s *tab_item_t;
32 char *label; /* Optional malloced label for that entry. */
33 char *mountpoint; /* NULL or a malloced mountpoint. */
34 char blockdev[1]; /* String with the name of the block device. If
35 it starts with a slash is is a regular device
36 name, otherwise it is a PARTUUID. */
41 /* Forward declaration for an object defined in g13-sh-cmd.c. */
42 struct server_local_s;
44 /* Session control object. This object is passed down to most
45 functions. The default values for it are set by
46 g13_syshelp_init_default_ctrl(). */
47 struct server_control_s
49 int no_server; /* We are not running under server control */
50 int status_fd; /* Only for non-server mode */
51 struct server_local_s *server_local;
54 uid_t uid; /* UID of the client calling use. */
56 tab_item_t tab;/* Linked list with the g13tab items for this user. */
59 /* Flag indicating that we should fail all commands. */
62 /* Type of the current container. See the CONTTYPE_ constants. */
65 /* A pointer into client.tab with the selected tab line or NULL. */
70 /*-- g13-syshelp.c --*/
71 void g13_syshelp_init_default_ctrl (struct server_control_s *ctrl);
72 void g13_syshelp_i_know_what_i_am_doing (void);
75 gpg_error_t syshelp_server (ctrl_t ctrl);
76 gpg_error_t sh_encrypt_keyblob (ctrl_t ctrl,
77 const void *keyblob, size_t keybloblen,
78 char **r_enckeyblob, size_t *r_enckeybloblen);
80 /*-- sh-blockdev.c --*/
81 gpg_error_t sh_blockdev_getsz (const char *name, unsigned long long *r_nblocks);
82 gpg_error_t sh_is_empty_partition (const char *name);
84 /*-- sh-dmcrypt.c --*/
85 gpg_error_t sh_dmcrypt_create_container (ctrl_t ctrl, const char *devname,
87 gpg_error_t sh_dmcrypt_mount_container (ctrl_t ctrl, const char *devname,
89 gpg_error_t sh_dmcrypt_umount_container (ctrl_t ctrl, const char *devname);
90 gpg_error_t sh_dmcrypt_suspend_container (ctrl_t ctrl, const char *devname);
91 gpg_error_t sh_dmcrypt_resume_container (ctrl_t ctrl, const char *devname,
96 #endif /*G13_SYSHELP_H*/