]> git.proxmox.com Git - mirror_ovs.git/blame - lib/stream-ssl.h
cirrus: Use FreeBSD 12.2.
[mirror_ovs.git] / lib / stream-ssl.h
CommitLineData
9467fe62 1/*
e0edde6f 2 * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
9467fe62
BP
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef STREAM_SSL_H
17#define STREAM_SSL_H 1
18
19#include <stdbool.h>
20
9467fe62
BP
21bool stream_ssl_is_configured(void);
22void stream_ssl_set_private_key_file(const char *file_name);
23void stream_ssl_set_certificate_file(const char *file_name);
24void stream_ssl_set_ca_cert_file(const char *file_name, bool bootstrap);
bf8f2167 25void stream_ssl_set_peer_ca_cert_file(const char *file_name);
6f1e91b1
BP
26void stream_ssl_set_key_and_cert(const char *private_key_file,
27 const char *certificate_file);
e18a1d08
ER
28void stream_ssl_set_protocols(const char *arg);
29void stream_ssl_set_ciphers(const char *arg);
30
31#define SSL_OPTION_ENUMS \
32 OPT_SSL_PROTOCOLS, \
33 OPT_SSL_CIPHERS
6f1e91b1 34
bf8f2167 35#define STREAM_SSL_LONG_OPTIONS \
e3c17733
BP
36 {"private-key", required_argument, NULL, 'p'}, \
37 {"certificate", required_argument, NULL, 'c'}, \
e18a1d08
ER
38 {"ca-cert", required_argument, NULL, 'C'}, \
39 {"ssl-protocols", required_argument, NULL, OPT_SSL_PROTOCOLS}, \
40 {"ssl-ciphers", required_argument, NULL, OPT_SSL_CIPHERS}
9467fe62
BP
41
42#define STREAM_SSL_OPTION_HANDLERS \
43 case 'p': \
44 stream_ssl_set_private_key_file(optarg); \
45 break; \
46 \
47 case 'c': \
48 stream_ssl_set_certificate_file(optarg); \
49 break; \
50 \
51 case 'C': \
52 stream_ssl_set_ca_cert_file(optarg, false); \
e18a1d08
ER
53 break; \
54 \
55 case OPT_SSL_PROTOCOLS: \
56 stream_ssl_set_protocols(optarg); \
57 break; \
58 \
59 case OPT_SSL_CIPHERS: \
60 stream_ssl_set_ciphers(optarg); \
7e5f6b1e
BP
61 break;
62
63#define STREAM_SSL_CASES \
64 case 'p': case 'c': case 'C': case OPT_SSL_PROTOCOLS: case OPT_SSL_CIPHERS:
9467fe62
BP
65
66#endif /* stream-ssl.h */