#include <unistd.h>
#include <common/chunk.h>
#include <common/hpack-dec.h>
-#include <common/mini-clist.h>
#define MAX_RQ_SIZE 65536
#define MAX_HDR_NUM 1000
#include <event2/event_struct.h>
#include <event2/thread.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/chunk.h>
#include <proto/spoe.h>
#include <event2/event_struct.h>
#include <event2/thread.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/chunk.h>
#include <proto/spoe.h>
#include <common/buffer.h>
#include <common/htx.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <types/global.h>
#define _COMMON_CFGPARSE_H
#include <haproxy/api.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <proto/log.h>
#include <proto/proxy.h>
#include <unistd.h>
#include <haproxy/api.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/hathreads.h>
/* On architectures supporting threads and double-word CAS, we can implement
--- /dev/null
+/*
+ * include/haproxy/list-t.h
+ * Circular list manipulation types definitions
+ *
+ * Copyright (C) 2002-2020 Willy Tarreau - w@1wt.eu
+ *
+ * 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 _HAPROXY_LIST_T_H
+#define _HAPROXY_LIST_T_H
+
+
+/* these are circular or bidirectionnal lists only. Each list pointer points to
+ * another list pointer in a structure, and not the structure itself. The
+ * pointer to the next element MUST be the first one so that the list is easily
+ * cast as a single linked list or pointer.
+ */
+struct list {
+ struct list *n; /* next */
+ struct list *p; /* prev */
+};
+
+/* This is similar to struct list, but we want to be sure the compiler will
+ * yell at you if you use macroes for one when you're using the other. You have
+ * to expicitely cast if that's really what you want to do.
+ */
+struct mt_list {
+ struct mt_list *next;
+ struct mt_list *prev;
+};
+
+
+/* a back-ref is a pointer to a target list entry. It is used to detect when an
+ * element being deleted is currently being tracked by another user. The best
+ * example is a user dumping the session table. The table does not fit in the
+ * output buffer so we have to set a mark on a session and go on later. But if
+ * that marked session gets deleted, we don't want the user's pointer to go in
+ * the wild. So we can simply link this user's request to the list of this
+ * session's users, and put a pointer to the list element in ref, that will be
+ * used as the mark for next iteration.
+ */
+struct bref {
+ struct list users;
+ struct list *ref; /* pointer to the target's list entry */
+};
+
+/* a word list is a generic list with a pointer to a string in each element. */
+struct wordlist {
+ struct list list;
+ char *s;
+};
+
+/* this is the same as above with an additional pointer to a condition. */
+struct cond_wordlist {
+ struct list list;
+ void *cond;
+ char *s;
+};
+
+#endif /* _HAPROXY_LIST_T_H */
/*
- * include/common/mini-clist.h
- * Circular list manipulation macros and structures.
+ * include/haproxy/list.h
+ * Circular list manipulation macros and functions.
*
- * Copyright (C) 2002-2014 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2002-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _COMMON_MINI_CLIST_H
-#define _COMMON_MINI_CLIST_H
+#ifndef _HAPROXY_LIST_H
+#define _HAPROXY_LIST_H
-
-/* these are circular or bidirectionnal lists only. Each list pointer points to
- * another list pointer in a structure, and not the structure itself. The
- * pointer to the next element MUST be the first one so that the list is easily
- * cast as a single linked list or pointer.
- */
-struct list {
- struct list *n; /* next */
- struct list *p; /* prev */
-};
-
-/* This is similar to struct list, but we want to be sure the compiler will
- * yell at you if you use macroes for one when you're using the other. You have
- * to expicitely cast if that's really what you want to do.
- */
-struct mt_list {
- struct mt_list *next;
- struct mt_list *prev;
-};
-
-
-/* a back-ref is a pointer to a target list entry. It is used to detect when an
- * element being deleted is currently being tracked by another user. The best
- * example is a user dumping the session table. The table does not fit in the
- * output buffer so we have to set a mark on a session and go on later. But if
- * that marked session gets deleted, we don't want the user's pointer to go in
- * the wild. So we can simply link this user's request to the list of this
- * session's users, and put a pointer to the list element in ref, that will be
- * used as the mark for next iteration.
- */
-struct bref {
- struct list users;
- struct list *ref; /* pointer to the target's list entry */
-};
-
-/* a word list is a generic list with a pointer to a string in each element. */
-struct wordlist {
- struct list list;
- char *s;
-};
-
-/* this is the same as above with an additional pointer to a condition. */
-struct cond_wordlist {
- struct list list;
- void *cond;
- char *s;
-};
+#include <haproxy/api.h>
+#include <haproxy/list-t.h>
+#include <common/hathreads.h>
/* First undefine some macros which happen to also be defined on OpenBSD,
* in sys/queue.h, used by sys/event.h
&item->member != (list_head); \
item = back, back = LIST_ELEM(back->member.p, typeof(back), member))
-#include <haproxy/api.h>
-#include <common/hathreads.h>
-#define MT_LIST_BUSY ((struct mt_list *)1)
/*
* Locked version of list manipulation macros.
* It is OK to use those concurrently from multiple threads, as long as the
* list is only used with the locked variants.
*/
+#define MT_LIST_BUSY ((struct mt_list *)1)
/*
* Add an item at the beginning of a list.
}
-#endif /* _COMMON_MINI_CLIST_H */
+#endif /* _HAPROXY_LIST_H */
#include <haproxy/api.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <types/applet.h>
#include <proto/task.h>
#define _PROTO_HTTP_RULES_H
#include <haproxy/api.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <types/action.h>
#include <types/proxy.h>
#include <haproxy/api.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
#include <types/proxy.h>
#include <types/queue.h>
#ifndef SHCTX_H
#define SHCTX_H
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <types/shctx.h>
#include <inttypes.h>
#ifndef _PROTO_SINK_H
#define _PROTO_SINK_H
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/sink.h>
extern struct list sink_list;
#include <haproxy/api.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/ticks.h>
#include <common/hathreads.h>
#include <haproxy/api.h>
#include <common/buffer.h>
#include <import/ist.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <types/log.h>
#include <types/sink.h>
#include <types/trace.h>
#define _TYPES_ACL_H
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/arg.h>
#include <types/auth.h>
#include <netinet/in.h>
#include <common/chunk.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/vars.h>
#include <types/protocol_buffers.h>
#define _TYPES_AUTH_H
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/auth.h>
#include <common/standard.h>
#include <import/ist.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/regex.h>
#include <haproxy/buf-t.h>
#ifndef _TYPES_CLI_H
#define _TYPES_CLI_H
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/applet.h>
/* Access level for a stats socket */
#include <import/eb32tree.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/hathreads.h>
#include <types/connection.h>
#include <haproxy/api-t.h>
#include <import/ist.h>
#include <common/fcgi.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/regex.h>
#include <import/ebistree.h>
#define _TYPES_FILTERS_H
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
struct http_msg;
struct proxy;
#include <haproxy/openssl-compat.h>
#endif
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/hathreads.h>
#include <types/obj_type.h>
#include <netinet/in.h>
#include <haproxy/api-t.h>
#include <common/hathreads.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/ring.h>
#define NB_LOG_FACILITIES 24
#define _TYPES_PATTERN_H
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/regex.h>
#include <types/sample.h>
#include <arpa/inet.h>
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/regex.h>
#include <import/eb32tree.h>
#include <sys/socket.h>
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <import/eb32tree.h>
/* some pointer types referenced below */
#include <haproxy/api-t.h>
#include <common/chunk.h>
#include <common/http.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/regex.h>
#include <common/hathreads.h>
#define _TYPES_QUEUE_H
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/hathreads.h>
#include <types/server.h>
#include <haproxy/buf-t.h>
#include <common/http.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
struct arg;
#include <arpa/inet.h>
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/api.h>
#include <common/hathreads.h>
#include <haproxy/openssl-compat.h>
#include <arpa/inet.h>
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/obj_type.h>
#include <types/proxy.h>
#include <signal.h>
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/standard.h>
/* flags for -> flags */
#include <sys/time.h>
#include <common/buffer.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/hathreads.h>
#include <types/filters.h>
#define _TYPES_SSL_CKCH_H
#ifdef USE_OPENSSL
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <haproxy/openssl-compat.h>
/* This is used to preload the certificate, private key
#include <import/ebmbtree.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
/* forward declarations for structures below */
struct bind_conf;
#include <common/buffer.h>
#include <common/hathreads.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <haproxy/openssl-compat.h>
/* ***** READ THIS before adding code here! *****
#include <arpa/inet.h>
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/channel.h>
#include <types/filters.h>
#include <sys/time.h>
#include <haproxy/api-t.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <import/eb32sctree.h>
#include <import/eb32tree.h>
#include <haproxy/api-t.h>
#include <common/buffer.h>
#include <import/ist.h>
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <types/sink.h>
/* the macros below define an optional type for each of the 4 args passed to
#ifndef _TYPES_VARS_H
#define _TYPES_VARS_H
-#include <common/mini-clist.h>
+#include <haproxy/list-t.h>
#include <common/hathreads.h>
#include <types/sample.h>
#include <string.h>
#include <haproxy/api.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/uri_auth.h>
#include <haproxy/api.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <proto/action.h>
#include <stdlib.h>
#include <haproxy/api.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <proto/applet.h>
#include <proto/channel.h>
#include <proto/stream.h>
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/chunk.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/time.h>
#include <common/hathreads.h>
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/ticks.h>
#include <common/time.h>
#include <common/buffer.h>
#include <common/cfgparse.h>
#include <common/htx.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <types/compression.h>
#include <common/chunk.h>
#include <haproxy/errors.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/namespace.h>
#include <common/net_helper.h>
#include <haproxy/openssl-compat.h>
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <haproxy/errors.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/time.h>
#include <common/cfgparse.h>
#include <common/hathreads.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <types/activity.h>
#include <common/h1.h>
#include <common/htx.h>
#include <import/ist.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/net_helper.h>
#include <types/proxy.h>
#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <haproxy/version.h>
#include <types/cli.h>
#include <haproxy/api.h>
#include <haproxy/errors.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/time.h>
#include <haproxy/version.h>
#include <haproxy/api.h>
#include <haproxy/errors.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/namespace.h>
#include <haproxy/api.h>
#include <haproxy/errors.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/time.h>
#include <haproxy/version.h>
#include <haproxy/api.h>
#include <haproxy/errors.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <proto/protocol.h>
#include <arpa/inet.h>
#include <import/ebmbtree.h>
#include <types/global.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include "proto/shctx.h"
#if !defined (USE_PRIVATE_CACHE)
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <import/ist.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/time.h>
#include <proto/cli.h>
#include <proto/log.h>
#include <common/http.h>
#include <common/htx.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/ticks.h>
#include <common/time.h>
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/net_helper.h>
#include <common/standard.h>
#include <common/time.h>
#include <haproxy/api.h>
#include <common/memory.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/time.h>
#include <import/eb32sctree.h>
*/
#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <common/standard.h>
#include <common/ticks.h>
#include <common/time.h>
#include <haproxy/api.h>
#include <common/buffer.h>
#include <import/ist.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <proto/cli.h>
#include <proto/log.h>
#include <proto/sink.h>
#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/http.h>
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
#include <types/vars.h>
#include <stdio.h>
#include <stdlib.h>
#define USE_THREAD
-#include <common/mini-clist.h>
+#include <haproxy/list.h>
/* Stress test the mt_lists.
* Compile from the haproxy directory with :