source: trunk/third/ssh/readconf.h @ 11534

Revision 11534, 5.6 KB checked in by danw, 27 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r11533, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2
3readconf.h
4
5Author: Tatu Ylonen <ylo@cs.hut.fi>
6
7Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8                   All rights reserved
9
10Created: Sat Apr 22 00:25:29 1995 ylo
11
12Functions for reading the configuration file.
13
14*/
15
16/*
17 * $Id: readconf.h,v 1.1.1.3 1998-05-13 19:11:37 danw Exp $
18 * $Log: not supported by cvs2svn $
19 * Revision 1.9  1998/04/30 01:55:19  kivinen
20 *      Added PasswordPromptLogin and PasswordPromptHost options, so
21 *      now the password prompt is configurable.
22 *
23 * Revision 1.8  1998/03/27 16:59:43  kivinen
24 *      Added GatewayPorts option.
25 *
26 * Revision 1.7  1998/01/02 06:20:12  kivinen
27 *      Added xauthlocation option.
28 *
29 * Revision 1.6  1997/04/23 00:01:35  kivinen
30 *      Added number_of_password_prompts and clear_all_forwardings
31 *      fields.
32 *
33 * Revision 1.5  1997/04/17 04:20:37  kivinen
34 *      Updated strict_host_key_checking comment.
35 *
36 * Revision 1.4  1997/03/27 03:10:27  kivinen
37 *      Added kerberos patches from Glenn Machin.
38 *
39 * Revision 1.3  1997/03/26 05:34:49  kivinen
40 *      Added UsePriviledgedPort option.
41 *
42 * Revision 1.2  1997/03/19 17:54:45  kivinen
43 *      Added TIS authentication code from Andre April
44 *      <Andre.April@cediti.be>.
45 *
46 * Revision 1.1.1.1  1996/02/18 21:38:10  ylo
47 *      Imported ssh-1.2.13.
48 *
49 * Revision 1.4  1995/09/24  23:59:57  ylo
50 *      Added connection_attempts.
51 *
52 * Revision 1.3  1995/07/27  00:39:10  ylo
53 *      Added GlobalKnownHostsFile and UserKnownHostsFile.
54 *
55 * Revision 1.2  1995/07/13  01:30:46  ylo
56 *      Removed "Last modified" header.
57 *      Added cvs log.
58 *
59 * $Endlog$
60 */
61
62#ifndef READCONF_H
63#define READCONF_H
64
65/* Data structure for representing a forwarding request. */
66
67typedef struct
68{
69  int port;             /* Port to forward. */
70  char *host;           /* Host to connect. */
71  int host_port;        /* Port to connect on host. */
72} Forward;
73
74/* Data structure for representing option data. */
75
76typedef struct
77{
78  int forward_agent;            /* Forward authentication agent. */
79  int forward_x11;              /* Forward X11 display. */
80  int rhosts_authentication;    /* Try rhosts authentication. */
81  int rhosts_rsa_authentication;/* Try rhosts with RSA authentication. */
82  int rsa_authentication;       /* Try RSA authentication. */
83  int kerberos_authentication;  /* Try Kerberos authentication. */
84  int kerberos_tgt_passing;     /* Try Kerberos tgt passing. */
85  int tis_authentication;       /* Try TIS authsrv authentication. */
86  int password_authentication;  /* Try password authentication. */
87  int fallback_to_rsh;          /* Use rsh if cannot connect with ssh. */
88  int use_rsh;                  /* Always use rsh (don\'t try ssh). */
89  int batch_mode;               /* Batch mode: do not ask for passwords. */
90  int strict_host_key_checking; /* Strict host key checking 0 = no, 1 = yes,
91                                   2 = ask. */
92  int compression;              /* Compress packets in both directions. */
93  int compression_level;        /* Compression level 1 (fast) to 9 (best). */
94  int keepalives;               /* Set SO_KEEPALIVE. */
95  int use_priviledged_port;     /* Use priviledged port */
96
97  int port;                     /* Port to connect. */
98  int connection_attempts;      /* Max attempts (seconds) before giving up */
99  int number_of_password_prompts; /* Max number of password prompts */
100  int password_prompt_login;    /* Show remote login at password prompt */
101  int password_prompt_host;     /* Show remote host at password prompt */
102  int cipher;                   /* Cipher to use. */
103  char *hostname;               /* Real host to connect. */
104  char *proxy_command;          /* Proxy command for connecting the host. */
105  char *user;                   /* User to log in as. */
106  int no_user_given;            /* True if no user name given */
107  int escape_char;              /* Escape character; -2 = none */
108
109  char *system_hostfile;        /* Path for /etc/ssh_known_hosts. */
110  char *user_hostfile;          /* Path for $HOME/.ssh/known_hosts. */
111
112  int num_identity_files;       /* Number of files for RSA identities. */
113  char *identity_files[SSH_MAX_IDENTITY_FILES];
114
115  int clear_all_forwardings;    /* Clear all forwardings (scp etc). */
116
117  /* Local TCP/IP forward requests. */
118  int num_local_forwards;
119  Forward local_forwards[SSH_MAX_FORWARDS_PER_DIRECTION];
120
121  /* Remote TCP/IP forward requests. */
122  int num_remote_forwards;
123  Forward remote_forwards[SSH_MAX_FORWARDS_PER_DIRECTION];
124  char *xauth_path;
125  int gateway_ports;
126} Options;
127
128
129/* Initializes options to special values that indicate that they have not
130   yet been set.  Read_config_file will only set options with this value.
131   Options are processed in the following order: command line, user config
132   file, system config file.  Last, fill_default_options is called. */
133void initialize_options(Options *options);
134
135/* Called after processing other sources of option data, this fills those
136   options for which no value has been specified with their default values. */
137void fill_default_options(Options *options);
138
139/* Processes a single option line as used in the configuration files.
140   This only sets those values that have not already been set. */
141void process_config_line(Options *options, const char *host,
142                         char *line, const char *filename, int linenum,
143                         int *activep);
144
145/* Reads the config file and modifies the options accordingly.  Options should
146   already be initialized before this call.  This never returns if there
147   is an error.  If the file does not exist, this returns immediately.
148   All I/O will be done with the given uid via userfile. */
149void read_config_file(uid_t uid, const char *filename, const char *host,
150                      Options *options);
151
152/* Adds a local TCP/IP port forward to options.  Never returns if there
153   is an error. */
154void add_local_forward(Options *options, int port, const char *host,
155                       int host_port);
156
157/* Adds a remote TCP/IP port forward to options.  Never returns if there
158   is an error. */
159void add_remote_forward(Options *options, int port, const char *host,
160                        int host_port);
161
162
163#endif /* READCONF_H */
Note: See TracBrowser for help on using the repository browser.