usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / dropbear / runopts.h
blob83b586179197494994ea71ee80f77bf211dad8a6
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
51 } runopts;
53 extern runopts opts;
55 int readhostkey(const char * filename, sign_key * hostkey, int *type);
57 typedef struct svr_runopts {
59 char * rsakeyfile;
60 char * dsskeyfile;
61 char * bannerfile;
63 int forkbg;
64 int usingsyslog;
66 /* ports is an array of the portcount listening ports */
67 char *ports[DROPBEAR_MAX_PORTS];
68 unsigned int portcount;
69 char *addresses[DROPBEAR_MAX_PORTS];
71 int inetdmode;
73 /* Flags indicating whether to use ipv4 and ipv6 */
74 /* not used yet
75 int ipv4;
76 int ipv6;
79 #ifdef DO_MOTD
80 /* whether to print the MOTD */
81 int domotd;
82 #endif
84 int norootlogin;
86 int noauthpass;
87 int norootpass;
89 #ifdef ENABLE_SVR_REMOTETCPFWD
90 int noremotetcp;
91 #endif
92 #ifdef ENABLE_SVR_LOCALTCPFWD
93 int nolocaltcp;
94 #endif
96 sign_key *hostkey;
97 buffer * banner;
98 char * pidfile;
100 } svr_runopts;
102 extern svr_runopts svr_opts;
104 void svr_getopts(int argc, char ** argv);
105 void loadhostkeys();
107 typedef struct cli_runopts {
109 char *progname;
110 char *remotehost;
111 char *remoteport;
113 char *own_user;
114 char *username;
116 char *cmd;
117 int wantpty;
118 int always_accept_key;
119 int no_cmd;
120 int backgrounded;
121 int is_subsystem;
122 #ifdef ENABLE_CLI_PUBKEY_AUTH
123 m_list *privkeys; /* Keys to use for public-key auth */
124 #endif
125 #ifdef ENABLE_CLI_REMOTETCPFWD
126 m_list * remotefwds;
127 #endif
128 #ifdef ENABLE_CLI_LOCALTCPFWD
129 m_list * localfwds;
130 #endif
131 #ifdef ENABLE_CLI_AGENTFWD
132 int agent_fwd;
133 int agent_keys_loaded; /* whether pubkeys has been populated with a
134 list of keys held by the agent */
135 int agent_fd; /* The agent fd is only set during authentication. Forwarded
136 agent sessions have their own file descriptors */
137 #endif
139 #ifdef ENABLE_CLI_NETCAT
140 char *netcat_host;
141 unsigned int netcat_port;
142 #endif
143 #ifdef ENABLE_CLI_PROXYCMD
144 char *proxycmd;
145 #endif
146 } cli_runopts;
148 extern cli_runopts cli_opts;
149 void cli_getopts(int argc, char ** argv);
151 #endif /* _RUNOPTS_H_ */