aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/bind_config.h
blob: 7ee19b87364c0c2fc33050a3277f73a1360a2a82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * bind_config.h - Parse the SSH server configuration file
 *
 * This file is part of the SSH Library
 *
 * Copyright (c) 2019 by Red Hat, Inc.
 *
 * Author: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
 *
 * The SSH Library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or (at your
 * option) any later version.
 *
 * The SSH Library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with the SSH Library; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA.
 */

#ifndef BIND_CONFIG_H_
#define BIND_CONFIG_H_

#include "libssh/server.h"

enum ssh_bind_config_opcode_e {
    /* Known but not allowed in Match block */
    BIND_CFG_NOT_ALLOWED_IN_MATCH = -4,
    /* Unknown opcode */
    BIND_CFG_UNKNOWN = -3,
    /* Known and not applicable to libssh */
    BIND_CFG_NA = -2,
    /* Known but not supported by current libssh version */
    BIND_CFG_UNSUPPORTED = -1,
    BIND_CFG_INCLUDE,
    BIND_CFG_HOSTKEY,
    BIND_CFG_LISTENADDRESS,
    BIND_CFG_PORT,
    BIND_CFG_LOGLEVEL,
    BIND_CFG_CIPHERS,
    BIND_CFG_MACS,
    BIND_CFG_KEXALGORITHMS,
    BIND_CFG_MATCH,
    BIND_CFG_PUBKEY_ACCEPTED_KEY_TYPES,
    BIND_CFG_HOSTKEY_ALGORITHMS,

    BIND_CFG_MAX /* Keep this one last in the list */
};

/* @brief Parse configuration file and set the options to the given ssh_bind
 *
 * @params[in] sshbind   The ssh_bind context to be configured
 * @params[in] filename  The path to the configuration file
 *
 * @returns    0 on successful parsing the configuration file, -1 on error
 */
int ssh_bind_config_parse_file(ssh_bind sshbind, const char *filename);

/* @brief Parse configuration string and set the options to the given bind session
 *
 * @params[in] bind      The ssh bind session
 * @params[in] input     Null terminated string containing the configuration
 *
 * @returns    SSH_OK on successful parsing the configuration string,
 *             SSH_ERROR on error
 */
int ssh_bind_config_parse_string(ssh_bind bind, const char *input);

#endif /* BIND_CONFIG_H_ */