]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: move the crt-list structures in their own .h
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 12 May 2020 12:17:23 +0000 (14:17 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 15 May 2020 12:11:54 +0000 (14:11 +0200)
Move the structure definitions specifics to the crt-list in
types/ssl_crtlist.h.

include/types/ssl_crtlist.h [new file with mode: 0644]
include/types/ssl_sock.h

diff --git a/include/types/ssl_crtlist.h b/include/types/ssl_crtlist.h
new file mode 100644 (file)
index 0000000..bcece4e
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * include/types/ssl_crtlist.h
+ * crt-list structures
+ *
+ * Copyright (C) 2020 HAProxy Technologies, William Lallemand <wlallemand@haproxy.com>
+ *
+ * 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 <common/mini-clist.h>
+
+#include <types/listener.h>
+
+/* 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 */
index efa8dfaaff8b8e009ade285471b0eba43f88ba10..1c95eb7e55e0282a194483688c77bbc0077e5191 100644 (file)
@@ -27,6 +27,8 @@
 #include <ebmbtree.h>
 #include <eb64tree.h>
 
+#include <types/ssl_crtlist.h>
+
 #include <common/hathreads.h>
 #include <common/mini-clist.h>
 #include <common/openssl-compat.h>
@@ -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