libssh 0.12.1 The SSH library

Loading...
Searching...
No Matches
bind_config.h
1/*
2 * bind_config.h - Parse the SSH server configuration file
3 *
4 * This file is part of the SSH Library
5 *
6 * Copyright (c) 2019 by Red Hat, Inc.
7 *
8 * Author: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
9 *
10 * The SSH Library is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or (at your
13 * option) any later version.
14 *
15 * The SSH Library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with the SSH Library; see the file COPYING. If not, write to
22 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23 * MA 02111-1307, USA.
24 */
25
26#ifndef BIND_CONFIG_H_
27#define BIND_CONFIG_H_
28
29#include "libssh/server.h"
30
31#ifdef __cplusplus
32 extern "C" {
33#endif
34
35 enum ssh_bind_config_opcode_e {
36 /* Known but not allowed in Match block */
37 BIND_CFG_NOT_ALLOWED_IN_MATCH = -4,
38 /* Unknown opcode */
39 BIND_CFG_UNKNOWN = -3,
40 /* Known and not applicable to libssh */
41 BIND_CFG_NA = -2,
42 /* Known but not supported by current libssh version */
43 BIND_CFG_UNSUPPORTED = -1,
44 BIND_CFG_INCLUDE,
45 BIND_CFG_HOSTKEY,
46 BIND_CFG_LISTENADDRESS,
47 BIND_CFG_PORT,
48 BIND_CFG_LOGLEVEL,
49 BIND_CFG_CIPHERS,
50 BIND_CFG_MACS,
51 BIND_CFG_KEXALGORITHMS,
52 BIND_CFG_MATCH,
53 BIND_CFG_PUBKEY_ACCEPTED_KEY_TYPES,
54 BIND_CFG_HOSTKEY_ALGORITHMS,
55 BIND_CFG_REQUIRED_RSA_SIZE,
56
57 BIND_CFG_MAX /* Keep this one last in the list */
58};
59
60/* @brief Parse configuration file and set the options to the given ssh_bind
61 *
62 * @params[in] sshbind The ssh_bind context to be configured
63 * @params[in] filename The path to the configuration file
64 *
65 * @returns 0 on successful parsing the configuration file, -1 on error
66 */
67 int ssh_bind_config_parse_file(ssh_bind sshbind, const char *filename);
68
69/* @brief Parse configuration string and set the options to the given bind session
70 *
71 * @params[in] bind The ssh bind session
72 * @params[in] input Null terminated string containing the configuration
73 *
74 * @returns SSH_OK on successful parsing the configuration string,
75 * SSH_ERROR on error
76 */
77 int ssh_bind_config_parse_string(ssh_bind bind, const char *input);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* BIND_CONFIG_H_ */