dropbar: Update to version 2013.60.1.
[tomato.git] / release / src / router / dropbear / runopts.h
blob0dc308843f4545e39aaceda243412f572bc6c958
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;
41 time_t idle_timeout_secs;
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 int enable_compress;
48 #endif
50 #ifdef ENABLE_USER_ALGO_LIST
51 char *cipher_list;
52 char *mac_list;
53 #endif
55 } runopts;
57 extern runopts opts;
59 int readhostkey(const char * filename, sign_key * hostkey, int *type);
61 typedef struct svr_runopts {
63 char * rsakeyfile;
64 char * dsskeyfile;
65 char * bannerfile;
67 int forkbg;
68 int usingsyslog;
70 /* ports is an array of the portcount listening ports */
71 char *ports[DROPBEAR_MAX_PORTS];
72 unsigned int portcount;
73 char *addresses[DROPBEAR_MAX_PORTS];
75 int inetdmode;
77 /* Flags indicating whether to use ipv4 and ipv6 */
78 /* not used yet
79 int ipv4;
80 int ipv6;
83 #ifdef DO_MOTD
84 /* whether to print the MOTD */
85 int domotd;
86 #endif
88 int norootlogin;
90 int noauthpass;
91 int norootpass;
92 int allowblankpass;
94 #ifdef ENABLE_SVR_REMOTETCPFWD
95 int noremotetcp;
96 #endif
97 #ifdef ENABLE_SVR_LOCALTCPFWD
98 int nolocaltcp;
99 #endif
101 sign_key *hostkey;
102 buffer * banner;
103 char * pidfile;
105 } svr_runopts;
107 extern svr_runopts svr_opts;
109 void svr_getopts(int argc, char ** argv);
110 void loadhostkeys();
112 typedef struct cli_runopts {
114 char *progname;
115 char *remotehost;
116 char *remoteport;
118 char *own_user;
119 char *username;
121 char *cmd;
122 int wantpty;
123 int always_accept_key;
124 int no_hostkey_check;
125 int no_cmd;
126 int backgrounded;
127 int is_subsystem;
128 #ifdef ENABLE_CLI_PUBKEY_AUTH
129 m_list *privkeys; /* Keys to use for public-key auth */
130 #endif
131 #ifdef ENABLE_CLI_REMOTETCPFWD
132 m_list * remotefwds;
133 #endif
134 #ifdef ENABLE_CLI_LOCALTCPFWD
135 m_list * localfwds;
136 #endif
137 #ifdef ENABLE_CLI_AGENTFWD
138 int agent_fwd;
139 int agent_keys_loaded; /* whether pubkeys has been populated with a
140 list of keys held by the agent */
141 int agent_fd; /* The agent fd is only set during authentication. Forwarded
142 agent sessions have their own file descriptors */
143 #endif
145 #ifdef ENABLE_CLI_NETCAT
146 char *netcat_host;
147 unsigned int netcat_port;
148 #endif
149 #ifdef ENABLE_CLI_PROXYCMD
150 char *proxycmd;
151 #endif
152 } cli_runopts;
154 extern cli_runopts cli_opts;
155 void cli_getopts(int argc, char ** argv);
157 #ifdef ENABLE_USER_ALGO_LIST
158 void parse_ciphers_macs();
159 #endif
161 #endif /* _RUNOPTS_H_ */