#ifndef SERVCONF_H
#define SERVCONF_H
#define MAX_PORTS 256
#define MAX_ALLOW_USERS 256
#define MAX_DENY_USERS 256
#define MAX_ALLOW_GROUPS 256
#define MAX_DENY_GROUPS 256
#define MAX_SUBSYSTEMS 256
#define MAX_HOSTKEYS 256
#define MAX_HOSTCERTS 256
#define MAX_ACCEPT_ENV 256
#define MAX_MATCH_GROUPS 256
#define MAX_AUTHKEYS_FILES 256
#define PERMIT_NOT_SET -1
#define PERMIT_NO 0
#define PERMIT_FORCED_ONLY 1
#define PERMIT_NO_PASSWD 2
#define PERMIT_YES 3
#define PRIVSEP_OFF 0
#define PRIVSEP_ON 1
#define PRIVSEP_SANDBOX 2
#define DEFAULT_AUTH_FAIL_MAX 6
#define DEFAULT_SESSIONS_MAX 10
#define INTERNAL_SFTP_NAME "internal-sftp"
typedef struct {
u_int num_ports;
u_int ports_from_cmdline;
int ports[MAX_PORTS];
char *listen_addr;
struct addrinfo *listen_addrs;
int address_family;
char *host_key_files[MAX_HOSTKEYS];
int num_host_key_files;
char *host_cert_files[MAX_HOSTCERTS];
int num_host_cert_files;
char *pid_file;
int server_key_bits;
int login_grace_time;
int key_regeneration_time;
int permit_root_login;
int ignore_rhosts;
int ignore_user_known_hosts;
int print_motd;
int print_lastlog;
int x11_forwarding;
int x11_display_offset;
int x11_use_localhost;
char *xauth_location;
int strict_modes;
int tcp_keep_alive;
int ip_qos_interactive;
int ip_qos_bulk;
char *ciphers;
char *macs;
char *kex_algorithms;
int protocol;
int gateway_ports;
SyslogFacility log_facility;
LogLevel log_level;
int rhosts_rsa_authentication;
int hostbased_authentication;
int hostbased_uses_name_from_packet_only;
int rsa_authentication;
int pubkey_authentication;
int kerberos_authentication;
int kerberos_or_local_passwd;
int kerberos_ticket_cleanup;
int kerberos_get_afs_token;
int gss_authentication;
int gss_keyex;
int gss_cleanup_creds;
int gss_strict_acceptor;
int gss_store_rekey;
int password_authentication;
int kbd_interactive_authentication;
int challenge_response_authentication;
int zero_knowledge_password_authentication;
int permit_empty_passwd;
int permit_user_env;
int use_login;
int compression;
int allow_tcp_forwarding;
int allow_agent_forwarding;
u_int num_allow_users;
char *allow_users[MAX_ALLOW_USERS];
u_int num_deny_users;
char *deny_users[MAX_DENY_USERS];
u_int num_allow_groups;
char *allow_groups[MAX_ALLOW_GROUPS];
u_int num_deny_groups;
char *deny_groups[MAX_DENY_GROUPS];
u_int num_subsystems;
char *subsystem_name[MAX_SUBSYSTEMS];
char *subsystem_command[MAX_SUBSYSTEMS];
char *subsystem_args[MAX_SUBSYSTEMS];
u_int num_accept_env;
char *accept_env[MAX_ACCEPT_ENV];
int max_startups_begin;
int max_startups_rate;
int max_startups;
int max_authtries;
int max_sessions;
char *banner;
int use_dns;
int client_alive_interval;
int client_alive_count_max;
u_int num_authkeys_files;
char *authorized_keys_files[MAX_AUTHKEYS_FILES];
char *adm_forced_command;
int use_pam;
int permit_tun;
int num_permitted_opens;
char *chroot_directory;
char *revoked_keys_file;
char *trusted_user_ca_keys;
char *authorized_principals_file;
} ServerOptions;
#define COPY_MATCH_STRING_OPTS() do { \
M_CP_STROPT(banner); \
M_CP_STROPT(trusted_user_ca_keys); \
M_CP_STROPT(revoked_keys_file); \
M_CP_STROPT(authorized_principals_file); \
M_CP_STRARRAYOPT(authorized_keys_files, num_authkeys_files); \
} while (0)
void initialize_server_options(ServerOptions *);
void fill_default_server_options(ServerOptions *);
int process_server_config_line(ServerOptions *, char *, const char *, int,
int *, const char *, const char *, const char *);
void load_server_config(const char *, Buffer *);
void parse_server_config(ServerOptions *, const char *, Buffer *,
const char *, const char *, const char *);
void parse_server_match_config(ServerOptions *, const char *, const char *,
const char *);
void copy_set_server_options(ServerOptions *, ServerOptions *, int);
void dump_config(ServerOptions *);
char *derelativise_path(const char *);
#endif