readconf.h revision 124211
1261057Smav/*	$OpenBSD: readconf.h,v 1.55 2003/09/01 18:15:50 markus Exp $	*/
2261057Smav
3261057Smav/*
4261057Smav * Author: Tatu Ylonen <ylo@cs.hut.fi>
5261057Smav * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6261057Smav *                    All rights reserved
7261057Smav * Functions for reading the configuration file.
8261057Smav *
9261057Smav * As far as I am concerned, the code I have written for this software
10261057Smav * can be used freely for any purpose.  Any derived versions of this
11261057Smav * software must be clearly marked as such, and if the derived work is
12261057Smav * incompatible with the protocol description in the RFC file, it must be
13261057Smav * called by a name other than "ssh" or "Secure Shell".
14261057Smav */
1526219Swpaul
16261057Smav#ifndef READCONF_H
17261057Smav#define READCONF_H
18261057Smav
19261057Smav#include "key.h"
20261057Smav
21261057Smav/* Data structure for representing a forwarding request. */
22261057Smav
23261057Smavtypedef struct {
24261057Smav	u_short	  port;		/* Port to forward. */
25261057Smav	char	 *host;		/* Host to connect. */
26261057Smav	u_short	  host_port;	/* Port to connect on host. */
2726219Swpaul}       Forward;
2826219Swpaul/* Data structure for representing option data. */
2926219Swpaul
3026219Swpaultypedef struct {
3126219Swpaul	int     forward_agent;	/* Forward authentication agent. */
3226219Swpaul	int     forward_x11;	/* Forward X11 display. */
3392990Sobrien	char   *xauth_location;	/* Location for xauth program */
3492990Sobrien	int     gateway_ports;	/* Allow remote connects to forwarded ports. */
3574712Sobrien	int     use_privileged_port;	/* Don't use privileged port if false. */
3626219Swpaul	int     rhosts_rsa_authentication;	/* Try rhosts with RSA
3726219Swpaul						 * authentication. */
3826219Swpaul	int     rsa_authentication;	/* Try RSA authentication. */
3926219Swpaul	int     pubkey_authentication;	/* Try ssh2 pubkey authentication. */
4026219Swpaul	int     hostbased_authentication;	/* ssh2's rhosts_rsa */
4126219Swpaul	int     challenge_response_authentication;
4226219Swpaul					/* Try S/Key or TIS, authentication. */
4326219Swpaul	int     gss_authentication;	/* Try GSS authentication */
4426219Swpaul	int     gss_deleg_creds;	/* Delegate GSS credentials */
4575094Siedowse	int     password_authentication;	/* Try password
4674462Salfred						 * authentication. */
4726219Swpaul	int     kbd_interactive_authentication; /* Try keyboard-interactive auth. */
4826219Swpaul	char	*kbd_interactive_devices; /* Keyboard-interactive auth devices. */
4926219Swpaul	int     batch_mode;	/* Batch mode: do not ask for passwords. */
5026219Swpaul	int     check_host_ip;	/* Also keep track of keys for IP address */
5126219Swpaul	int     strict_host_key_checking;	/* Strict host key checking. */
5226219Swpaul	int     compression;	/* Compress packets in both directions. */
5326219Swpaul	int     compression_level;	/* Compression level 1 (fast) to 9
5426219Swpaul					 * (best). */
5526219Swpaul	int     keepalives;	/* Set SO_KEEPALIVE. */
5674462Salfred	LogLevel log_level;	/* Level for logging. */
5726219Swpaul
5826219Swpaul	int     port;		/* Port to connect. */
5926219Swpaul	int     address_family;
6026219Swpaul	int     connection_attempts;	/* Max attempts (seconds) before
6126219Swpaul					 * giving up */
6271579Sdeischen	int     connection_timeout;	/* Max time (seconds) before
63156090Sdeischen				 	 * aborting connection attempt */
6426219Swpaul	int     number_of_password_prompts;	/* Max number of password
6526219Swpaul						 * prompts. */
6626219Swpaul	int     cipher;		/* Cipher to use. */
6726219Swpaul	char   *ciphers;	/* SSH2 ciphers in order of preference. */
6826219Swpaul	char   *macs;		/* SSH2 macs in order of preference. */
6926219Swpaul	char   *hostkeyalgorithms;	/* SSH2 server key types in order of preference. */
7026219Swpaul	int	protocol;	/* Protocol in order of preference. */
7126219Swpaul	char   *hostname;	/* Real host to connect. */
7226219Swpaul	char   *host_key_alias;	/* hostname alias for .ssh/known_hosts */
7326219Swpaul	char   *proxy_command;	/* Proxy command for connecting the host. */
7426219Swpaul	char   *user;		/* User to log in as. */
7526219Swpaul	int     escape_char;	/* Escape character; -2 = none */
7626219Swpaul
7726219Swpaul	char   *system_hostfile;/* Path for /etc/ssh/ssh_known_hosts. */
7826219Swpaul	char   *user_hostfile;	/* Path for $HOME/.ssh/known_hosts. */
7926219Swpaul	char   *system_hostfile2;
8026219Swpaul	char   *user_hostfile2;
8126219Swpaul	char   *preferred_authentications;
8226219Swpaul	char   *bind_address;	/* local socket address for connection to sshd */
8326219Swpaul	char   *smartcard_device; /* Smartcard reader device */
8426219Swpaul	int	verify_host_key_dns;	/* Verify host key using DNS */
8526219Swpaul
8626219Swpaul	int     num_identity_files;	/* Number of files for RSA/DSA identities. */
8726219Swpaul	char   *identity_files[SSH_MAX_IDENTITY_FILES];
8895658Sdes	Key    *identity_keys[SSH_MAX_IDENTITY_FILES];
8926219Swpaul
9026219Swpaul	/* Local TCP/IP forward requests. */
9126219Swpaul	int     num_local_forwards;
9226219Swpaul	Forward local_forwards[SSH_MAX_FORWARDS_PER_DIRECTION];
9326219Swpaul
9426219Swpaul	/* Remote TCP/IP forward requests. */
9526219Swpaul	int     num_remote_forwards;
9699998Salfred	Forward remote_forwards[SSH_MAX_FORWARDS_PER_DIRECTION];
9799998Salfred	int	clear_forwardings;
9895658Sdes
9926219Swpaul	int	enable_ssh_keysign;
10026219Swpaul	int	rekey_limit;
10126219Swpaul	int	no_host_authentication_for_localhost;
10226219Swpaul}       Options;
10326219Swpaul
10426219Swpaul
10526219Swpaulvoid     initialize_options(Options *);
10626219Swpaulvoid     fill_default_options(Options *);
10726219Swpaulint	 read_config_file(const char *, const char *, Options *);
10826219Swpaul
10926219Swpaulint
11026219Swpaulprocess_config_line(Options *, const char *, char *, const char *, int, int *);
11126219Swpaul
11226219Swpaulvoid	 add_local_forward(Options *, u_short, const char *, u_short);
11326219Swpaulvoid	 add_remote_forward(Options *, u_short, const char *, u_short);
11426219Swpaul
11526219Swpaul#endif				/* READCONF_H */
11626219Swpaul