\doxysection{src/core/netns.c File Reference}
\label{netns_8c}\index{src/core/netns.c@{src/core/netns.c}}
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$stdlib.\+h$>$}\newline
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$signal.\+h$>$}\newline
{\ttfamily \#include $<$sys/types.\+h$>$}\newline
{\ttfamily \#include $<$sys/stat.\+h$>$}\newline
{\ttfamily \#include $<$fcntl.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/netns.\+h$>$}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ \+\_\+\+GNU\+\_\+\+SOURCE}
\item 
\#define \textbf{ NETNS\+\_\+\+PREFIX\+\_\+\+PATH}~\char`\"{}/var/run/netns\char`\"{}
\item 
\#define \textbf{ NETNS\+\_\+\+CURRENT\+\_\+\+PATH}~\char`\"{}/proc/self/ns/\textbf{ net}\char`\"{}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ osmo\+\_\+netns\+\_\+switch\+\_\+enter} (int nsfd, struct \textbf{ osmo\+\_\+netns\+\_\+switch\+\_\+state} $\ast$state)
\begin{DoxyCompactList}\small\item\em switch to a (non-\/default) namespace, store existing signal mask in oldmask. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+netns\+\_\+switch\+\_\+exit} (struct \textbf{ osmo\+\_\+netns\+\_\+switch\+\_\+state} $\ast$state)
\begin{DoxyCompactList}\small\item\em switch back to the previous namespace, restoring signal mask. \end{DoxyCompactList}\item 
static int \textbf{ create\+\_\+netns} (const char $\ast$\textbf{ name})
\item 
int \textbf{ osmo\+\_\+netns\+\_\+open\+\_\+fd} (const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Open a file descriptor for the network namespace with provided name. \end{DoxyCompactList}\end{DoxyCompactItemize}
