123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- #ifndef DROPBEAR_RUNOPTS_H_
- #define DROPBEAR_RUNOPTS_H_
- #include "includes.h"
- #include "signkey.h"
- #include "buffer.h"
- #include "auth.h"
- #include "tcpfwd.h"
- typedef struct runopts {
- #if DROPBEAR_SVR_REMOTETCPFWD || DROPBEAR_CLI_LOCALTCPFWD \
- || DROPBEAR_CLI_REMOTETCPFWD
- int listen_fwd_all;
- #endif
- unsigned int recv_window;
- time_t keepalive_secs;
- time_t idle_timeout_secs;
- int usingsyslog;
- #ifndef DISABLE_ZLIB
-
- enum {
- DROPBEAR_COMPRESS_DELAYED,
- DROPBEAR_COMPRESS_ON,
- DROPBEAR_COMPRESS_OFF,
- } compress_mode;
- #endif
- #if DROPBEAR_USER_ALGO_LIST
- char *cipher_list;
- char *mac_list;
- #endif
- } runopts;
- extern runopts opts;
- int readhostkey(const char * filename, sign_key * hostkey,
- enum signkey_type *type);
- void load_all_hostkeys(void);
- typedef struct svr_runopts {
- char * bannerfile;
- int forkbg;
-
- char *ports[DROPBEAR_MAX_PORTS];
- unsigned int portcount;
- char *addresses[DROPBEAR_MAX_PORTS];
- int inetdmode;
-
- int reexec_child;
-
-
- #if DO_MOTD
-
- int domotd;
- #endif
- int norootlogin;
- #ifdef HAVE_GETGROUPLIST
-
- char *restrict_group;
-
- gid_t restrict_group_gid;
- #endif
- int noauthpass;
- int norootpass;
- int allowblankpass;
- unsigned int maxauthtries;
- #if DROPBEAR_SVR_REMOTETCPFWD
- int noremotetcp;
- #endif
- #if DROPBEAR_SVR_LOCALTCPFWD
- int nolocaltcp;
- #endif
- sign_key *hostkey;
- int delay_hostkey;
- char *hostkey_files[MAX_HOSTKEYS];
- int num_hostkey_files;
- buffer * banner;
- char * pidfile;
- char * forced_command;
- #if DROPBEAR_PLUGIN
- char *pubkey_plugin;
- char *pubkey_plugin_options;
- #endif
- int pass_on_env;
- } svr_runopts;
- extern svr_runopts svr_opts;
- void svr_getopts(int argc, char ** argv);
- void loadhostkeys(void);
- typedef struct cli_runopts {
- char *progname;
- char *remotehost;
- const char *remoteport;
- char *own_user;
- char *username;
- char *cmd;
- int wantpty;
- int always_accept_key;
- int no_hostkey_check;
- int no_cmd;
- int quiet;
- int backgrounded;
- int is_subsystem;
- #if DROPBEAR_CLI_PUBKEY_AUTH
- m_list *privkeys;
- #endif
- #if DROPBEAR_CLI_ANYTCPFWD
- int exit_on_fwd_failure;
- #endif
- int disable_trivial_auth;
- #if DROPBEAR_CLI_REMOTETCPFWD
- m_list * remotefwds;
- #endif
- #if DROPBEAR_CLI_LOCALTCPFWD
- m_list * localfwds;
- #endif
- #if DROPBEAR_CLI_AGENTFWD
- int agent_fwd;
- int agent_keys_loaded;
- int agent_fd;
- #endif
- #if DROPBEAR_CLI_NETCAT
- char *netcat_host;
- unsigned int netcat_port;
- #endif
- #if DROPBEAR_CLI_PROXYCMD
- char *proxycmd;
- #endif
- char *bind_address;
- char *bind_port;
- } cli_runopts;
- extern cli_runopts cli_opts;
- void cli_getopts(int argc, char ** argv);
- #if DROPBEAR_USER_ALGO_LIST
- void parse_ciphers_macs(void);
- #endif
- void print_version(void);
- void parse_recv_window(const char* recv_window_arg);
- int split_address_port(const char* spec, char **first, char ** second);
- #endif
|