Radek Krejci | c61f0b4 | 2017-06-07 13:21:41 +0200 | [diff] [blame] | 1 | /** |
| 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 |
| 19 | extern "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 | |
| 46 | typedef 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 */ |
Radek Krejci | b20999f | 2017-06-21 13:47:11 +0200 | [diff] [blame] | 52 | |
| 53 | PyObject *clb_password; /* callback for SSH password authentication */ |
| 54 | PyObject *clb_password_data; /* private data for the SSH password authentication callback */ |
| 55 | PyObject *clb_interactive; /* callback for SSH keyboard-interactive authentication */ |
| 56 | PyObject *clb_interactive_data; /* private data for the SSH keyboard-interactive authentication callback */ |
Radek Krejci | c61f0b4 | 2017-06-07 13:21:41 +0200 | [diff] [blame] | 57 | } ncSSHObject; |
| 58 | |
| 59 | typedef struct { |
| 60 | PyObject_HEAD |
| 61 | PyObject *cert_file; /* path to the client certificate file */ |
| 62 | PyObject *key_file; /* path to the file with the private key for the client certificate */ |
| 63 | PyObject *ca_file; /* path to the file with the CA certificate(s) used to verify the server certificate */ |
| 64 | PyObject *ca_dir; /* path to the directory with the CA certificate(s) used to verify the server certificate */ |
| 65 | PyObject *crl_file; /* path to the file with the CRL certificate(s) used to check for revocated server certificates */ |
| 66 | PyObject *crl_dir; /* path to the directory with the CRL certificate(s) used to check for revocated server certificates */ |
| 67 | } ncTLSObject; |
| 68 | |
| 69 | extern PyTypeObject ncSSHType; |
| 70 | extern PyTypeObject ncTLSType; |
| 71 | extern PyTypeObject ncSessionType; |
| 72 | |
| 73 | #ifdef __cplusplus |
| 74 | } |
| 75 | #endif |
| 76 | |
| 77 | #endif /* PYNETCONF_H_ */ |