openssl: update to 1.0.2d
[tomato.git] / release / src / router / dropbear / runopts.h
blob87567164a60a4af3821aa7324f426650a5aa70f3
1 /*
2 * Dropbear - a SSH2 server
3 *
4 * Copyright (c) 2002,2003 Matt Johnston
5 * All rights reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE. */
25 #ifndef _RUNOPTS_H_
26 #define _RUNOPTS_H_
28 #include "includes.h"
29 #include "signkey.h"
30 #include "buffer.h"
31 #include "auth.h"
32 #include "tcpfwd.h"
34 typedef struct runopts {
36 #if defined(ENABLE_SVR_REMOTETCPFWD) || defined(ENABLE_CLI_LOCALTCPFWD)
37 int listen_fwd_all;
38 #endif
39 unsigned int recv_window;
40 time_t keepalive_secs; /* Time between sending keepalives. 0 is off */
41 time_t idle_timeout_secs; /* Exit if no traffic is sent/received in this time */
43 #ifndef DISABLE_ZLIB
44 /* TODO: add a commandline flag. Currently this is on by default if compression
45 * is compiled in, but disabled for a client's non-final multihop stages. (The
46 * intermediate stages are compressed streams, so are uncompressible. */
47 enum {
48 DROPBEAR_COMPRESS_DELAYED, /* Server only */
49 DROPBEAR_COMPRESS_ON,
50 DROPBEAR_COMPRESS_OFF,
51 } compress_mode;
52 #endif
54 #ifdef ENABLE_USER_ALGO_LIST
55 char *cipher_list;
56 char *mac_list;
57 #endif
59 } runopts;
61 extern runopts opts;
63 int readhostkey(const char * filename, sign_key * hostkey,
64 enum signkey_type *type);
65 void load_all_hostkeys();
67 typedef struct svr_runopts {
69 char * bannerfile;
71 int forkbg;
72 int usingsyslog;
74 /* ports is an array of the portcount listening ports */
75 char *ports[DROPBEAR_MAX_PORTS];
76 unsigned int portcount;
77 char *addresses[DROPBEAR_MAX_PORTS];
79 int inetdmode;
81 /* Flags indicating whether to use ipv4 and ipv6 */
82 /* not used yet
83 int ipv4;
84 int ipv6;
87 #ifdef DO_MOTD
88 /* whether to print the MOTD */
89 int domotd;
90 #endif
92 int norootlogin;
94 int noauthpass;
95 int norootpass;
96 int allowblankpass;
98 #ifdef ENABLE_SVR_REMOTETCPFWD
99 int noremotetcp;
100 #endif
101 #ifdef ENABLE_SVR_LOCALTCPFWD
102 int nolocaltcp;
103 #endif
105 sign_key *hostkey;
107 int delay_hostkey;
109 char *hostkey_files[MAX_HOSTKEYS];
110 int num_hostkey_files;
112 buffer * banner;
113 char * pidfile;
115 } svr_runopts;
117 extern svr_runopts svr_opts;
119 void svr_getopts(int argc, char ** argv);
120 void loadhostkeys();
122 typedef struct cli_runopts {
124 char *progname;
125 char *remotehost;
126 char *remoteport;
128 char *own_user;
129 char *username;
131 char *cmd;
132 int wantpty;
133 int always_accept_key;
134 int no_hostkey_check;
135 int no_cmd;
136 int backgrounded;
137 int is_subsystem;
138 #ifdef ENABLE_CLI_PUBKEY_AUTH
139 m_list *privkeys; /* Keys to use for public-key auth */
140 #endif
141 #ifdef ENABLE_CLI_REMOTETCPFWD
142 m_list * remotefwds;
143 #endif
144 #ifdef ENABLE_CLI_LOCALTCPFWD
145 m_list * localfwds;
146 #endif
147 #ifdef ENABLE_CLI_AGENTFWD
148 int agent_fwd;
149 int agent_keys_loaded; /* whether pubkeys has been populated with a
150 list of keys held by the agent */
151 int agent_fd; /* The agent fd is only set during authentication. Forwarded
152 agent sessions have their own file descriptors */
153 #endif
155 #ifdef ENABLE_CLI_NETCAT
156 char *netcat_host;
157 unsigned int netcat_port;
158 #endif
159 #ifdef ENABLE_CLI_PROXYCMD
160 char *proxycmd;
161 #endif
162 } cli_runopts;
164 extern cli_runopts cli_opts;
165 void cli_getopts(int argc, char ** argv);
167 #ifdef ENABLE_USER_ALGO_LIST
168 void parse_ciphers_macs();
169 #endif
171 void print_version(void);
173 #endif /* _RUNOPTS_H_ */