haproxy/include/common/namespace.h
Willy Tarreau 8d2b777fe3 REORG: ebtree: move the include files from ebtree to include/import/
This is where other imported components are located. All files which
used to directly include ebtree were touched to update their include
path so that "import/" is now prefixed before the ebtree-related files.

The ebtree.h file was slightly adjusted to read compiler.h from the
common/ subdirectory (this is the only change).

A build issue was encountered when eb32sctree.h is loaded before
eb32tree.h because only the former checks for the latter before
defining type u32. This was addressed by adding the reverse ifdef
in eb32tree.h.

No further cleanup was done yet in order to keep changes minimal.
2020-06-11 09:31:11 +02:00

34 lines
682 B
C

#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 */