version 1.33, 2000/04/12 07:45:44 |
version 1.34, 2000/04/14 10:30:33 |
|
|
/* |
/* |
* |
* |
* servconf.c |
* servconf.c |
* |
* |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* |
* |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* All rights reserved |
* All rights reserved |
* |
* |
* Created: Mon Aug 21 15:48:58 1995 ylo |
* Created: Mon Aug 21 15:48:58 1995 ylo |
* |
* |
*/ |
*/ |
|
|
#include "includes.h" |
#include "includes.h" |
|
|
|
|
/* Initializes the server options to their default values. */ |
/* Initializes the server options to their default values. */ |
|
|
void |
void |
initialize_server_options(ServerOptions *options) |
initialize_server_options(ServerOptions *options) |
{ |
{ |
memset(options, 0, sizeof(*options)); |
memset(options, 0, sizeof(*options)); |
|
|
options->protocol = SSH_PROTO_UNKNOWN; |
options->protocol = SSH_PROTO_UNKNOWN; |
} |
} |
|
|
void |
void |
fill_default_server_options(ServerOptions *options) |
fill_default_server_options(ServerOptions *options) |
{ |
{ |
if (options->num_ports == 0) |
if (options->num_ports == 0) |
|
|
* returns if the token is not known. |
* returns if the token is not known. |
*/ |
*/ |
|
|
static ServerOpCodes |
static ServerOpCodes |
parse_token(const char *cp, const char *filename, |
parse_token(const char *cp, const char *filename, |
int linenum) |
int linenum) |
{ |
{ |
|
|
/* |
/* |
* add listen address |
* add listen address |
*/ |
*/ |
void |
void |
add_listen_addr(ServerOptions *options, char *addr) |
add_listen_addr(ServerOptions *options, char *addr) |
{ |
{ |
extern int IPv4or6; |
extern int IPv4or6; |
|
|
|
|
/* Reads the server configuration file. */ |
/* Reads the server configuration file. */ |
|
|
void |
void |
read_server_config(ServerOptions *options, const char *filename) |
read_server_config(ServerOptions *options, const char *filename) |
{ |
{ |
FILE *f; |
FILE *f; |
|
|
"ListenAdress.\n", filename, linenum); |
"ListenAdress.\n", filename, linenum); |
if (options->num_ports >= MAX_PORTS) |
if (options->num_ports >= MAX_PORTS) |
fatal("%s line %d: too many ports.\n", |
fatal("%s line %d: too many ports.\n", |
filename, linenum); |
filename, linenum); |
cp = strtok(NULL, WHITESPACE); |
cp = strtok(NULL, WHITESPACE); |
if (!cp) |
if (!cp) |
fatal("%s line %d: missing port number.\n", |
fatal("%s line %d: missing port number.\n", |