aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/netns.h
blob: 5bbf224299ad17e3eb85837d7c4e7e1078c47905 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*! \file netns.h
 *  Network namespace convenience functions. */

#pragma once
#if (!EMBEDDED)

#if defined(__linux__)

#include <signal.h>

struct osmo_netns_switch_state {
	sigset_t prev_sigmask;
	int prev_nsfd;
};

int osmo_netns_open_fd(const char *name);
int osmo_netns_switch_enter(int nsfd, struct osmo_netns_switch_state *state);
int osmo_netns_switch_exit(struct osmo_netns_switch_state *state);


#endif /* defined(__linux__) */

#endif /* (!EMBEDDED) */
/*! @} */