The type was moved out as it's used by standard.h for netns_entry.
Instead of just being a forward declaration when not used, it's an
empty struct, which makes gdb happier (the resulting stripped executable
is the same).
+++ /dev/null
-#ifndef _NAMESPACE_H
-#define _NAMESPACE_H
-
-#include <stdlib.h>
-#include <import/ebistree.h>
-
-#ifdef USE_NS
-
-struct netns_entry
-{
- struct ebpt_node node;
- size_t name_len;
- int fd;
-};
-
-int my_socketat(const struct netns_entry *ns, int domain, int type, int protocol);
-struct netns_entry* netns_store_insert(const char *ns_name);
-const struct netns_entry* netns_store_lookup(const char *ns_name, size_t ns_name_len);
-
-int netns_init(void);
-
-#else /* no namespace support */
-
-struct netns_entry;
-
-static inline int my_socketat(const struct netns_entry *ns, int domain, int type, int protocol)
-{
- return socket(domain, type, protocol);
-}
-
-#endif /* USE_NS */
-
-#endif /* _NAMESPACE_H */
#include <haproxy/api.h>
#include <haproxy/intops.h>
#include <haproxy/chunk.h>
-#include <common/namespace.h>
+#include <haproxy/namespace-t.h>
#include <import/eb32tree.h>
#include <import/eb32sctree.h>
#include <types/protocol.h>
--- /dev/null
+/*
+ * include/haproxy/namespace-t.h
+ * Linux network namespaces types definitions
+ *
+ * Copyright (C) 2014 Tamas Kovacs, Sarkozi Laszlo, Krisztian Kovacs
+ * Copyright (C) 2015-2020 Willy Tarreau
+ *
+ * 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_NAMESPACE_T_H
+#define _HAPROXY_NAMESPACE_T_H
+
+#include <stddef.h>
+#include <import/ebpttree.h>
+
+/* the struct is just empty if namespaces are not supported */
+struct netns_entry
+{
+#ifdef USE_NS
+ struct ebpt_node node;
+ size_t name_len;
+ int fd;
+#endif
+};
+
+#endif /* _HAPROXY_NAMESPACE_T_H */
--- /dev/null
+/*
+ * include/haproxy/namespace.h
+ * Linux network namespaces management
+ *
+ * Copyright (C) 2014 Tamas Kovacs, Sarkozi Laszlo, Krisztian Kovacs
+ * Copyright (C) 2015-2020 Willy Tarreau
+ *
+ * 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_NAMESPACE_H
+#define _HAPROXY_NAMESPACE_H
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <haproxy/namespace-t.h>
+#include <import/ebistree.h>
+
+#ifdef USE_NS
+
+int my_socketat(const struct netns_entry *ns, int domain, int type, int protocol);
+struct netns_entry* netns_store_insert(const char *ns_name);
+const struct netns_entry* netns_store_lookup(const char *ns_name, size_t ns_name_len);
+int netns_init(void);
+
+#else /* no namespace support */
+
+static inline int my_socketat(const struct netns_entry *ns, int domain, int type, int protocol)
+{
+ return socket(domain, type, protocol);
+}
+
+#endif /* USE_NS */
+
+#endif /* _HAPROXY_NAMESPACE_H */
#include <common/htx.h>
#include <common/ticks.h>
#include <haproxy/time.h>
-#include <common/namespace.h>
+#include <haproxy/namespace.h>
#include <types/global.h>
#include <common/standard.h>
#include <haproxy/time.h>
#include <common/uri_auth.h>
-#include <common/namespace.h>
+#include <haproxy/namespace.h>
#include <haproxy/thread.h>
#include <types/capture.h>
#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/namespace.h>
+#include <haproxy/namespace.h>
#include <haproxy/hash.h>
#include <haproxy/net_helper.h>
#include <common/cfgparse.h>
#include <haproxy/errors.h>
#include <common/htx.h>
-#include <common/namespace.h>
+#include <haproxy/namespace.h>
#include <common/standard.h>
#include <types/filters.h>
#include <haproxy/errors.h>
#include <haproxy/pool.h>
#include <haproxy/list.h>
-#include <common/namespace.h>
+#include <haproxy/namespace.h>
#include <haproxy/net_helper.h>
#include <haproxy/openssl-compat.h>
#include <common/regex.h>
#include <string.h>
#include <haproxy/api.h>
-#include <common/namespace.h>
+#include <haproxy/namespace.h>
#include <haproxy/hash.h>
#include <haproxy/errors.h>
#include <proto/log.h>
#include <haproxy/errors.h>
#include <haproxy/list.h>
#include <common/standard.h>
-#include <common/namespace.h>
+#include <haproxy/namespace.h>
#include <types/action.h>
#include <types/connection.h>
#include <common/cfgparse.h>
#include <haproxy/errors.h>
-#include <common/namespace.h>
+#include <haproxy/namespace.h>
#include <haproxy/time.h>
#include <types/applet.h>
#include <haproxy/api.h>
#include <haproxy/chunk.h>
+#include <haproxy/namespace.h>
#include <common/standard.h>
#include <types/global.h>
#include <proto/applet.h>