From: William Lallemand Date: Tue, 12 May 2020 12:17:23 +0000 (+0200) Subject: REORG: move the crt-list structures in their own .h X-Git-Tag: v2.2-dev8~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be21b663cd3c45c1039c381ed2ab0cc95612d598;p=thirdparty%2Fhaproxy.git REORG: move the crt-list structures in their own .h Move the structure definitions specifics to the crt-list in types/ssl_crtlist.h. --- diff --git a/include/types/ssl_crtlist.h b/include/types/ssl_crtlist.h new file mode 100644 index 0000000000..bcece4ecfa --- /dev/null +++ b/include/types/ssl_crtlist.h @@ -0,0 +1,59 @@ +/* + * include/types/ssl_crtlist.h + * crt-list structures + * + * Copyright (C) 2020 HAProxy Technologies, William Lallemand + * + * This 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, version 2.1 + * exclusively. + * + * This 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _TYPES_SSL_CRTLIST_H +#define _TYPES_SSL_CRTLIST_H +#ifdef USE_OPENSSL + +#include + +#include + +/* list of bind conf used by struct crtlist */ +struct bind_conf_list { + struct bind_conf *bind_conf; + struct bind_conf_list *next; +}; + +/* This structure is basically a crt-list or a directory */ +struct crtlist { + struct bind_conf_list *bind_conf; /* list of bind_conf which use this crtlist */ + unsigned int linecount; /* number of lines */ + struct eb_root entries; + struct list ord_entries; /* list to keep the line order of the crt-list file */ + struct ebmb_node node; /* key is the filename or directory */ +}; + +/* a file in a directory or a line in a crt-list */ +struct crtlist_entry { + struct ssl_bind_conf *ssl_conf; /* SSL conf in crt-list */ + unsigned int linenum; + unsigned int fcount; /* filters count */ + char **filters; + struct crtlist *crtlist; /* ptr to the parent crtlist */ + struct list ckch_inst; /* list of instances of this entry, there is 1 ckch_inst per instance of the crt-list */ + struct list by_crtlist; /* ordered entries */ + struct list by_ckch_store; /* linked in ckch_store list of crtlist_entries */ + struct ebpt_node node; /* key is a ptr to a ckch_store */ +}; + +#endif /* USE_OPENSSL */ +#endif /* _TYPES_SSL_CRTLIST_H */ diff --git a/include/types/ssl_sock.h b/include/types/ssl_sock.h index efa8dfaaff..1c95eb7e55 100644 --- a/include/types/ssl_sock.h +++ b/include/types/ssl_sock.h @@ -27,6 +27,8 @@ #include #include +#include + #include #include #include @@ -225,33 +227,6 @@ struct ckch_inst { struct list by_crtlist_entry; /* chained in crtlist_entry list of inst */ }; -/* list of bind conf used by struct crtlist */ -struct bind_conf_list { - struct bind_conf *bind_conf; - struct bind_conf_list *next; -}; - -/* This structure is basically a crt-list or a directory */ -struct crtlist { - struct bind_conf_list *bind_conf; /* list of bind_conf which use this crtlist */ - unsigned int linecount; /* number of lines */ - struct eb_root entries; - struct list ord_entries; /* list to keep the line order of the crt-list file */ - struct ebmb_node node; /* key is the filename or directory */ -}; - -/* a file in a directory or a line in a crt-list */ -struct crtlist_entry { - struct ssl_bind_conf *ssl_conf; /* SSL conf in crt-list */ - unsigned int linenum; - unsigned int fcount; /* filters count */ - char **filters; - struct crtlist *crtlist; /* ptr to the parent crtlist */ - struct list ckch_inst; /* list of instances of this entry, there is 1 ckch_inst per instance of the crt-list */ - struct list by_crtlist; /* ordered entries */ - struct list by_ckch_store; /* linked in ckch_store list of crtlist_entries */ - struct ebpt_node node; /* key is a ptr to a ckch_store */ -}; #if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL