blob: 0d5a3bc94ef83f1c9f9abd151deae7c94f53a523 [file] [log] [blame]
Radek Krejcic61f0b42017-06-07 13:21:41 +02001/**
2 * @file netconf.h
3 * @author Radek Krejci <rkrejci@cesnet.cz>
4 * @brief Main header of Python3 bindings for libnetconf2 (client-side)
5 *
6 * Copyright (c) 2017 CESNET, z.s.p.o.
7 *
8 * This source code is licensed under BSD 3-Clause License (the "License").
9 * You may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * https://opensource.org/licenses/BSD-3-Clause
13 */
14
15#ifndef PYNETCONF_H_
16#define PYNETCONF_H_
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#ifndef NC_ENABLED_SSH
23#define NC_ENABLED_SSH
24#endif
25#ifndef NC_ENABLED_TLS
26#define NC_ENABLED_TLS
27#endif
28
29#include "../src/netconf.h"
30#include "../src/log.h"
31#include "../src/messages_client.h"
32#include "../src/session_client.h"
33#include "../src/session_client_ch.h"
34
35#ifdef UNUSED
36#elif defined(__GNUC__)
37# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
38#elif defined(__LCLINT__)
39# define UNUSED(x) /*@unused@*/ x
40#elif defined(__cplusplus)
41# define UNUSED(x)
42#else
43# define UNUSED(x) x
44#endif
45
46typedef struct {
47 PyObject_HEAD
48 PyObject *username; /* username */
49 PyObject *password; /* plaintext password for authentication or unlocking a private key */
50 PyObject *pubkeys; /* public keys for the key authentication, both pubkey and privkey must be set */
51 PyObject *privkeys; /* private key for the key authentication, both pubkey and privkey must be set */
52} ncSSHObject;
53
54typedef struct {
55 PyObject_HEAD
56 PyObject *cert_file; /* path to the client certificate file */
57 PyObject *key_file; /* path to the file with the private key for the client certificate */
58 PyObject *ca_file; /* path to the file with the CA certificate(s) used to verify the server certificate */
59 PyObject *ca_dir; /* path to the directory with the CA certificate(s) used to verify the server certificate */
60 PyObject *crl_file; /* path to the file with the CRL certificate(s) used to check for revocated server certificates */
61 PyObject *crl_dir; /* path to the directory with the CRL certificate(s) used to check for revocated server certificates */
62} ncTLSObject;
63
64extern PyTypeObject ncSSHType;
65extern PyTypeObject ncTLSType;
66extern PyTypeObject ncSessionType;
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif /* PYNETCONF_H_ */