rofi 1.7.5
|
Variables | |
Mode | ssh_mode |
Mode | ssh_mode |
#define | G_LOG_DOMAIN "Modes.Ssh" |
#define | SSH_CACHE_FILE "rofi-2.sshcache" |
#define | SSH_TOKEN_DELIM "= \t\r\n" |
typedef struct _SshEntry | SshEntry |
static int | execshssh (const SshEntry *entry) |
static void | exec_ssh (const SshEntry *entry) |
static void | delete_ssh (const char *host) |
static SshEntry * | read_known_hosts_file (const char *path, SshEntry *retv, unsigned int *length) |
static SshEntry * | read_hosts_file (SshEntry *retv, unsigned int *length) |
static void | add_known_hosts_file (SSHModePrivateData *pd, const char *token) |
static void | parse_ssh_config_file (SSHModePrivateData *pd, const char *filename, SshEntry **retv, unsigned int *length, unsigned int num_favorites) |
static SshEntry * | get_ssh (SSHModePrivateData *pd, 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 SSH_CACHE_FILE "rofi-2.sshcache" |
Name of the history file where previously chosen hosts are stored.
Definition at line 82 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 88 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 614 of file ssh.c.
References _SshEntry::hostname, SSHModePrivateData::hosts_list, and mode_get_private_data().
|
static |
Definition at line 331 of file ssh.c.
References SSHModePrivateData::user_known_hosts.
Referenced by parse_ssh_config_file().
|
static |
host | The host to remove from history |
Remove host from history.
Definition at line 154 of file ssh.c.
References cache_dir, history_remove(), and SSH_CACHE_FILE.
Referenced by ssh_mode_result().
|
static |
entry | The host to connect too |
SSH into the selected host, if successful update history.
Definition at line 126 of file ssh.c.
References cache_dir, execshssh(), history_set(), _SshEntry::hostname, _SshEntry::port, and SSH_CACHE_FILE.
Referenced by ssh_mode_result().
|
static |
entry | The host to connect too |
SSH into the selected host.
Definition at line 97 of file ssh.c.
References config, helper_execute(), helper_parse_setup(), _SshEntry::hostname, RofiHelperExecuteContext::name, _SshEntry::port, and Settings::ssh_command.
Referenced by exec_ssh().
|
static |
pd | The plugin data handle |
length | The number of found ssh hosts [out] |
Gets the list available SSH hosts.
Definition at line 456 of file ssh.c.
References cache_dir, config, history_get_list(), _SshEntry::hostname, Settings::parse_hosts, Settings::parse_known_hosts, parse_ssh_config_file(), _SshEntry::port, read_hosts_file(), read_known_hosts_file(), rofi_expand_path(), SSH_CACHE_FILE, and SSHModePrivateData::user_known_hosts.
Referenced by ssh_mode_init().
|
static |
Definition at line 342 of file ssh.c.
References add_known_hosts_file(), parse_ssh_config_file(), rofi_expand_path(), and SSH_TOKEN_DELIM.
Referenced by get_ssh(), and parse_ssh_config_file().
retv | The list of hosts to update. |
length | The length of the list retv [in][out] |
Read /etc/hosts
and appends them to the list retv
Definition at line 266 of file ssh.c.
References _SshEntry::hostname, and _SshEntry::port.
Referenced by get_ssh().
|
static |
path | Path of the known host file. |
retv | list of hosts |
length | pointer to length of list [in][out] |
Read 'known_hosts' file when entries are not hashed.
Definition at line 172 of file ssh.c.
References _SshEntry::hostname, and _SshEntry::port.
Referenced by get_ssh().
|
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 556 of file ssh.c.
References _SshEntry::hostname, SSHModePrivateData::hosts_list, SSHModePrivateData::hosts_list_length, mode_get_private_data(), mode_set_private_data(), and SSHModePrivateData::user_known_hosts.
Referenced by ssh_mode_result().
|
static |
sw | Object handle to the SSH Mode object |
Get the number of SSH entries.
Definition at line 545 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 529 of file ssh.c.
References get_ssh(), SSHModePrivateData::hosts_list, SSHModePrivateData::hosts_list_length, 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 579 of file ssh.c.
References delete_ssh(), exec_ssh(), _SshEntry::hostname, SSHModePrivateData::hosts_list, MENU_CUSTOM_COMMAND, MENU_CUSTOM_INPUT, MENU_ENTRY_DELETE, MENU_LOWER_MASK, MENU_OK, MODE_EXIT, mode_get_private_data(), 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 631 of file ssh.c.
References helper_token_match(), _SshEntry::hostname, SSHModePrivateData::hosts_list, and mode_get_private_data().
|
extern |
Mode object representing the ssh mode.
Definition at line 637 of file ssh.c.
Referenced by rofi_collect_modes().
Mode ssh_mode |
Mode object representing the ssh mode.
Definition at line 637 of file ssh.c.
Referenced by rofi_collect_modes().