Pau Espin Pedrol | 8a5014b | 2023-01-19 16:54:47 +0100 | [diff] [blame] | 1 | /*! \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 | |
| 11 | struct osmo_netns_switch_state { |
| 12 | sigset_t prev_sigmask; |
| 13 | int prev_nsfd; |
| 14 | }; |
| 15 | |
| 16 | int osmo_netns_open_fd(const char *name); |
| 17 | int osmo_netns_switch_enter(int nsfd, struct osmo_netns_switch_state *state); |
| 18 | int osmo_netns_switch_exit(struct osmo_netns_switch_state *state); |
| 19 | |
| 20 | |
| 21 | #endif /* defined(__linux__) */ |
| 22 | |
| 23 | #endif /* (!EMBEDDED) */ |
| 24 | /*! @} */ |