blob: ed8c135aec628a337ace9d95a98590daf69c069e [file] [log] [blame]
William Lallemandbe21b662020-05-12 14:17:23 +02001/*
2 * include/types/ssl_crtlist.h
3 * crt-list structures
4 *
5 * Copyright (C) 2020 HAProxy Technologies, William Lallemand <wlallemand@haproxy.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation, version 2.1
10 * exclusively.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef _TYPES_SSL_CRTLIST_H
23#define _TYPES_SSL_CRTLIST_H
24#ifdef USE_OPENSSL
25
Willy Tarreau8d2b7772020-05-27 10:58:19 +020026#include <import/ebmbtree.h>
William Lallemandc1c50b42020-05-13 08:24:41 +020027
Willy Tarreau853b2972020-05-27 18:01:47 +020028#include <haproxy/list-t.h>
William Lallemandbe21b662020-05-12 14:17:23 +020029
William Lallemandc1c50b42020-05-13 08:24:41 +020030/* forward declarations for structures below */
31struct bind_conf;
32struct ssl_bind_conf;
33struct proxy;
William Lallemandbe21b662020-05-12 14:17:23 +020034
35/* list of bind conf used by struct crtlist */
36struct bind_conf_list {
37 struct bind_conf *bind_conf;
38 struct bind_conf_list *next;
39};
40
41/* This structure is basically a crt-list or a directory */
42struct crtlist {
43 struct bind_conf_list *bind_conf; /* list of bind_conf which use this crtlist */
44 unsigned int linecount; /* number of lines */
45 struct eb_root entries;
46 struct list ord_entries; /* list to keep the line order of the crt-list file */
47 struct ebmb_node node; /* key is the filename or directory */
48};
49
50/* a file in a directory or a line in a crt-list */
51struct crtlist_entry {
52 struct ssl_bind_conf *ssl_conf; /* SSL conf in crt-list */
53 unsigned int linenum;
54 unsigned int fcount; /* filters count */
55 char **filters;
56 struct crtlist *crtlist; /* ptr to the parent crtlist */
57 struct list ckch_inst; /* list of instances of this entry, there is 1 ckch_inst per instance of the crt-list */
58 struct list by_crtlist; /* ordered entries */
59 struct list by_ckch_store; /* linked in ckch_store list of crtlist_entries */
60 struct ebpt_node node; /* key is a ptr to a ckch_store */
61};
62
63#endif /* USE_OPENSSL */
64#endif /* _TYPES_SSL_CRTLIST_H */