blob: 5bbf224299ad17e3eb85837d7c4e7e1078c47905 [file] [log] [blame]
Pau Espin Pedrol8a5014b2023-01-19 16:54:47 +01001/*! \file netns.h
2 * Network namespace convenience functions. */
3
4#pragma once
5#if (!EMBEDDED)
6
7#if defined(__linux__)
8
9#include <signal.h>
10
11struct osmo_netns_switch_state {
12 sigset_t prev_sigmask;
13 int prev_nsfd;
14};
15
16int osmo_netns_open_fd(const char *name);
17int osmo_netns_switch_enter(int nsfd, struct osmo_netns_switch_state *state);
18int osmo_netns_switch_exit(struct osmo_netns_switch_state *state);
19
20
21#endif /* defined(__linux__) */
22
23#endif /* (!EMBEDDED) */
24/*! @} */