www.usr.com/support/gpl/USR9107_release.1.4.tar.gz
[bcm963xx.git] / userapps / opensource / sshd / runopts.h
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:
13  * 
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  * 
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. */
24
25 #ifndef _RUNOPTS_H_
26 #define _RUNOPTS_H_
27
28 #include "includes.h"
29 #include "signkey.h"
30 #include "buffer.h"
31 #include "auth.h"
32 #include "tcpfwd.h"
33
34 typedef struct runopts {
35
36         int nolocaltcp;
37         int noremotetcp;
38
39 } runopts;
40
41 extern runopts opts;
42
43 int readhostkey(const char * filename, sign_key * hostkey, int *type);
44
45 typedef struct svr_runopts {
46
47         char * rsakeyfile;
48         char * dsskeyfile;
49         char * bannerfile;
50
51         int forkbg;
52         int usingsyslog;
53
54         /* ports is an array of the portcount listening ports */
55         char *ports[DROPBEAR_MAX_PORTS];
56         unsigned int portcount;
57
58         int inetdmode;
59
60         /* Flags indicating whether to use ipv4 and ipv6 */
61         /* not used yet
62         int ipv4;
63         int ipv6;
64         */
65
66 #ifdef DO_MOTD
67         /* whether to print the MOTD */
68         int domotd;
69 #endif
70
71         int norootlogin;
72
73         int noauthpass;
74         int norootpass;
75
76         sign_key *hostkey;
77         buffer * banner;
78
79 } svr_runopts;
80
81 extern svr_runopts svr_opts;
82
83 void svr_getopts(int argc, char ** argv);
84 void loadhostkeys();
85
86 /* Uncompleted XXX matt */
87 typedef struct cli_runopts {
88
89         char *progname;
90         char *remotehost;
91         char *remoteport;
92
93         char *username;
94
95         char *cmd;
96         int wantpty;
97 #ifdef ENABLE_CLI_PUBKEY_AUTH
98         struct SignKeyList *privkeys; /* Keys to use for public-key auth */
99 #endif
100 #ifdef ENABLE_CLI_REMOTETCPFWD
101         struct TCPFwdList * remotefwds;
102 #endif
103 #ifdef ENABLE_CLI_LOCALTCPFWD
104         struct TCPFwdList * localfwds;
105 #endif
106         /* XXX TODO */
107
108 } cli_runopts;
109
110 extern cli_runopts cli_opts;
111 void cli_getopts(int argc, char ** argv);
112
113 #endif /* _RUNOPTS_H_ */