Loading...
Searching...
No Matches
netns.h
Go to the documentation of this file.
#pragma once
#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);
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
name
char name[32]
source file name
Definition gsmtap.h:11
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