\doxysection{prim.\+h}
\label{prim_8h_source}\index{include/osmocom/netif/prim.h@{include/osmocom/netif/prim.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ (C)\ 2021\ by\ sysmocom\ -\/\ s.f.m.c.\ GmbH\ <info@sysmocom.de>}}
\DoxyCodeLine{00002\ \textcolor{comment}{\ *\ Author:\ Pau\ Espin\ Pedrol\ <pespin@sysmocom.de>}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ All\ Rights\ Reserved}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ This\ program\ is\ free\ software;\ you\ can\ redistribute\ it\ and/or\ modify}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ it\ under\ the\ terms\ of\ the\ GNU\ Affero\ General\ Public\ License\ as\ published\ by}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ the\ Free\ Software\ Foundation;\ either\ version\ 3\ of\ the\ License,\ or}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ (at\ your\ option)\ any\ later\ version.}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ This\ program\ is\ distributed\ in\ the\ hope\ that\ it\ will\ be\ useful,}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ but\ WITHOUT\ ANY\ WARRANTY;\ without\ even\ the\ implied\ warranty\ of}}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *\ MERCHANTABILITY\ or\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE.\ \ See\ the}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ GNU\ Affero\ General\ Public\ License\ for\ more\ details.}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ You\ should\ have\ received\ a\ copy\ of\ the\ GNU\ Affero\ General\ Public\ License}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ along\ with\ this\ program.\ \ If\ not,\ see\ <http://www.gnu.org/lienses/>.}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#include\ <osmocom/core/prim.h>}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#include\ <osmocom/core/select.h>}}
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\#include\ <osmocom/core/linuxlist.h>}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{keyword}{struct\ }osmo\_prim\_srv\_link;}
\DoxyCodeLine{00028\ \textcolor{keyword}{struct\ }osmo\_prim\_srv;}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00030\ \textcolor{keyword}{typedef}\ int\ (*osmo\_prim\_srv\_conn\_cb)(\textcolor{keyword}{struct\ }osmo\_prim\_srv\ *prim\_srv);}
\DoxyCodeLine{00032\ \textcolor{keyword}{typedef}\ int\ (*osmo\_prim\_srv\_rx\_cb)(\textcolor{keyword}{struct\ }osmo\_prim\_srv\ *prim\_srv,\ \textcolor{keyword}{struct\ }osmo\_prim\_hdr\ *oph);}
\DoxyCodeLine{00033\ }
\DoxyCodeLine{00041\ \textcolor{keyword}{typedef}\ int\ (*osmo\_prim\_srv\_rx\_sapi\_version)(\textcolor{keyword}{struct\ }osmo\_prim\_srv\ *prim\_srv,\ uint32\_t\ sapi,\ uint16\_t\ rem\_version);}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \textcolor{keyword}{struct\ }osmo\_prim\_hdr\ *osmo\_prim\_msgb\_alloc(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ sap,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ primitive,}
\DoxyCodeLine{00044\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{enum}\ osmo\_prim\_operation\ operation,\ \textcolor{keywordtype}{size\_t}\ alloc\_len);}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \textcolor{keyword}{struct\ }osmo\_prim\_srv\_link\ *osmo\_prim\_srv\_link\_alloc(\textcolor{keywordtype}{void}\ *ctx);}
\DoxyCodeLine{00047\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_free(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link);}
\DoxyCodeLine{00048\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_set\_name(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name);}
\DoxyCodeLine{00049\ \textcolor{keywordtype}{int}\ osmo\_prim\_srv\_link\_set\_addr(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *path);}
\DoxyCodeLine{00050\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *osmo\_prim\_srv\_link\_get\_addr(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link);}
\DoxyCodeLine{00051\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_set\_priv(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ \textcolor{keywordtype}{void}\ *priv);}
\DoxyCodeLine{00052\ \textcolor{keywordtype}{void}\ *osmo\_prim\_srv\_link\_get\_priv(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link);}
\DoxyCodeLine{00053\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_set\_log\_category(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ \textcolor{keywordtype}{int}\ log\_cat);}
\DoxyCodeLine{00054\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_set\_opened\_conn\_cb(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ osmo\_prim\_srv\_conn\_cb\ opened\_conn\_cb);}
\DoxyCodeLine{00055\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_set\_closed\_conn\_cb(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ osmo\_prim\_srv\_conn\_cb\ closed\_conn\_cb);}
\DoxyCodeLine{00056\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_set\_rx\_sapi\_version\_cb(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ osmo\_prim\_srv\_rx\_sapi\_version\ rx\_sapi\_version\_cb);}
\DoxyCodeLine{00057\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_set\_rx\_cb(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ osmo\_prim\_srv\_rx\_cb\ rx\_cb);}
\DoxyCodeLine{00058\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_link\_set\_rx\_msgb\_alloc\_len(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link,\ \textcolor{keywordtype}{size\_t}\ alloc\_len);}
\DoxyCodeLine{00059\ \textcolor{keywordtype}{int}\ osmo\_prim\_srv\_link\_open(\textcolor{keyword}{struct}\ osmo\_prim\_srv\_link\ *prim\_link);}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ \textcolor{keywordtype}{int}\ osmo\_prim\_srv\_send(\textcolor{keyword}{struct}\ osmo\_prim\_srv\ *prim\_srv,\ \textcolor{keyword}{struct}\ msgb\ *msg);}
\DoxyCodeLine{00062\ \textcolor{keyword}{struct\ }osmo\_prim\_srv\_link\ *osmo\_prim\_srv\_get\_link(\textcolor{keyword}{struct}\ osmo\_prim\_srv\ *prims\_srv);}
\DoxyCodeLine{00063\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_set\_name(\textcolor{keyword}{struct}\ osmo\_prim\_srv\ *prim\_srv,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name);}
\DoxyCodeLine{00064\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_set\_priv(\textcolor{keyword}{struct}\ osmo\_prim\_srv\ *prim\_srv,\ \textcolor{keywordtype}{void}\ *priv);}
\DoxyCodeLine{00065\ \textcolor{keywordtype}{void}\ *osmo\_prim\_srv\_get\_priv(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_prim\_srv\ *prim\_srv);}
\DoxyCodeLine{00066\ \textcolor{keywordtype}{void}\ osmo\_prim\_srv\_close(\textcolor{keyword}{struct}\ osmo\_prim\_srv\ *prim\_srv);}

\end{DoxyCode}
