rofi
1.5.1
|
![]() |
Variables | |
Mode | ssh_mode |
Mode | ssh_mode |
#define | G_LOG_DOMAIN "Dialogs.Ssh" |
#define | SSH_CACHE_FILE "rofi-2.sshcache" |
#define | SSH_TOKEN_DELIM "= \t\r\n" |
static int | execshssh (const char *host) |
static void | exec_ssh (const char *host) |
static void | delete_ssh (const char *host) |
static char ** | read_known_hosts_file (char **retv, unsigned int *length) |
static char ** | read_hosts_file (char **retv, unsigned int *length) |
static void | parse_ssh_config_file (const char *filename, char ***retv, unsigned int *length, unsigned int num_favorites) |
static char ** | get_ssh (unsigned int *length) |
static int | ssh_mode_init (Mode *sw) |
static unsigned int | ssh_mode_get_num_entries (const Mode *sw) |
static void | ssh_mode_destroy (Mode *sw) |
static ModeMode | ssh_mode_result (Mode *sw, int mretv, char **input, unsigned int selected_line) |
static char * | _get_display_value (const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **attr_list, int get_entry) |
static int | ssh_token_match (const Mode *sw, rofi_int_matcher **tokens, unsigned int index) |
SSH Mode, returns a list of known SSH hosts the user can log into. It does this by parsing the SSH config file and optional the known host and host list It also keeps history of the last chosen hosts.
This mode uses the following options from the config object:
#define G_LOG_DOMAIN "Dialogs.Ssh" |
#define SSH_CACHE_FILE "rofi-2.sshcache" |
Name of the history file where previously chosen hosts are stored.
Definition at line 62 of file ssh.c.
Referenced by delete_ssh(), exec_ssh(), and get_ssh().
#define SSH_TOKEN_DELIM "= \t\r\n" |
Used in get_ssh() when splitting lines from the user's SSH config file into tokens.
Definition at line 68 of file ssh.c.
Referenced by parse_ssh_config_file().
|
static |
sw | Object handle to the SSH Mode object |
selected_line | The line to view |
state | The state of the entry [out] |
attr_list | List of extra rendering attributes to set [out] |
get_entry | Gets the string as it should be displayed and the display state. If get_entry is FALSE only the state is set. |
Definition at line 503 of file ssh.c.
References SSHModePrivateData::hosts_list, and mode_get_private_data().
|
static |
host | The host to remove from history |
Remove host from history.
Definition at line 124 of file ssh.c.
References cache_dir, history_remove(), and SSH_CACHE_FILE.
Referenced by ssh_mode_result().
|
static |
host | The host to connect too |
SSH into the selected host, if successful update history.
Definition at line 102 of file ssh.c.
References cache_dir, execshssh(), history_set(), and SSH_CACHE_FILE.
Referenced by ssh_mode_result().
|
static |
host | The host to connect too |
SSH into the selected host.
Definition at line 77 of file ssh.c.
References config, helper_execute(), helper_parse_setup(), RofiHelperExecuteContext::name, and Settings::ssh_command.
Referenced by exec_ssh().
|
static |
length | The number of found ssh hosts [out] |
Gets the list available SSH hosts.
Definition at line 366 of file ssh.c.
References cache_dir, config, history_get_list(), Settings::parse_hosts, Settings::parse_known_hosts, parse_ssh_config_file(), read_hosts_file(), read_known_hosts_file(), and SSH_CACHE_FILE.
Referenced by ssh_mode_init().
|
static |
Definition at line 260 of file ssh.c.
References rofi_expand_path(), and SSH_TOKEN_DELIM.
Referenced by get_ssh().
|
static |
|
static |
|
static |
sw | Object handle to the SSH Mode object |
Cleanup the SSH Mode. Free all allocated memory and NULL the private data pointer.
Definition at line 441 of file ssh.c.
References SSHModePrivateData::hosts_list, mode_get_private_data(), and mode_set_private_data().
Referenced by ssh_mode_result().
|
static |
sw | Object handle to the SSH Mode object |
Get the number of SSH entries.
Definition at line 431 of file ssh.c.
References SSHModePrivateData::hosts_list_length, and mode_get_private_data().
|
static |
sw | Object handle to the SSH Mode object |
Initializes the SSH Mode private data object and loads the relevant ssh information.
Definition at line 414 of file ssh.c.
References get_ssh(), mode_get_private_data(), and mode_set_private_data().
Referenced by ssh_mode_result().
|
static |
sw | Object handle to the SSH Mode object |
mretv | The menu return value. |
input | Pointer to the user input string. |
selected_line | the line selected by the user. |
Acts on the user interaction.
Definition at line 461 of file ssh.c.
References delete_ssh(), exec_ssh(), SSHModePrivateData::hosts_list, MENU_CUSTOM_INPUT, MENU_ENTRY_DELETE, MENU_LOWER_MASK, MENU_NEXT, MENU_OK, MENU_PREVIOUS, MENU_QUICK_SWITCH, MODE_EXIT, mode_get_private_data(), NEXT_DIALOG, PREVIOUS_DIALOG, RELOAD_DIALOG, ssh_mode_destroy(), and ssh_mode_init().
|
static |
sw | Object handle to the SSH Mode object |
tokens | The set of tokens to match against |
index | The index of the entry to match |
Match entry against the set of tokens.
Definition at line 518 of file ssh.c.
References helper_token_match(), SSHModePrivateData::hosts_list, and mode_get_private_data().
Mode ssh_mode |
Mode object representing the ssh dialog.
Definition at line 524 of file ssh.c.
Referenced by rofi_collect_modi().
Mode ssh_mode |
Mode object representing the ssh dialog.
Definition at line 524 of file ssh.c.
Referenced by rofi_collect_modi().