libosmocore 1.13.1.1-afb4 Osmocom core library

netns.h
Go to the documentation of this file.
1
4#pragma once
5
6#include <signal.h>
7
8 struct osmo_netns_switch_state {
9 sigset_t prev_sigmask;
10 int prev_nsfd;
11};
12
13 int osmo_netns_open_fd(const char *name);
14 int osmo_netns_switch_enter(int nsfd, struct osmo_netns_switch_state *state);
15 int osmo_netns_switch_exit(struct osmo_netns_switch_state *state);
16
name
const char * name
osmo_netns_switch_enter
int osmo_netns_switch_enter(int nsfd, struct osmo_netns_switch_state *state)
switch to a (non-default) namespace, store existing signal mask in oldmask.
Definition: netns.c:80
osmo_netns_switch_exit
int osmo_netns_switch_exit(struct osmo_netns_switch_state *state)
switch back to the previous namespace, restoring signal mask.
Definition: netns.c:110
osmo_netns_open_fd
int osmo_netns_open_fd(const char *name)
Open a file descriptor for the network namespace with provided name.
Definition: netns.c:206
signal.h
osmo_netns_switch_state
Definition: netns.h:8
osmo_netns_switch_state::prev_nsfd
int prev_nsfd
Definition: netns.h:10
osmo_netns_switch_state::prev_sigmask
sigset_t prev_sigmask
Definition: netns.h:9