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

\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{comment}{/* (C) 2021 by sysmocom -\/ s.f.m.c. GmbH <info@sysmocom.de>}}
\DoxyCodeLine{2 \textcolor{comment}{ * Author: Pau Espin Pedrol <pespin@sysmocom.de>}}
\DoxyCodeLine{3 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{4 \textcolor{comment}{ *}}
\DoxyCodeLine{5 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{6 \textcolor{comment}{ * it under the terms of the GNU Affero General Public License as published by}}
\DoxyCodeLine{7 \textcolor{comment}{ * the Free Software Foundation; either version 3 of the License, or}}
\DoxyCodeLine{8 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{9 \textcolor{comment}{ *}}
\DoxyCodeLine{10 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{11 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{12 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{13 \textcolor{comment}{ * GNU Affero General Public License for more details.}}
\DoxyCodeLine{14 \textcolor{comment}{ *}}
\DoxyCodeLine{15 \textcolor{comment}{ * You should have received a copy of the GNU Affero General Public License}}
\DoxyCodeLine{16 \textcolor{comment}{ * along with this program.  If not, see <http://www.gnu.org/lienses/>.}}
\DoxyCodeLine{17 \textcolor{comment}{ *}}
\DoxyCodeLine{18 \textcolor{comment}{ */}}
\DoxyCodeLine{19 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{20 }
\DoxyCodeLine{21 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{22 }
\DoxyCodeLine{23 \textcolor{preprocessor}{\#include <osmocom/core/prim.h>}}
\DoxyCodeLine{24 \textcolor{preprocessor}{\#include <osmocom/core/select.h>}}
\DoxyCodeLine{25 \textcolor{preprocessor}{\#include <osmocom/core/linuxlist.h>}}
\DoxyCodeLine{26 }
\DoxyCodeLine{27 \textcolor{keyword}{struct }osmo\_prim\_srv\_link;}
\DoxyCodeLine{28 \textcolor{keyword}{struct }osmo\_prim\_srv;}
\DoxyCodeLine{29 }
\DoxyCodeLine{30 \textcolor{keyword}{typedef} int (*osmo\_prim\_srv\_conn\_cb)(\textcolor{keyword}{struct }osmo\_prim\_srv *prim\_srv);}
\DoxyCodeLine{32 \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{33 }
\DoxyCodeLine{41 \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{42 }
\DoxyCodeLine{43 \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{44                                           \textcolor{keyword}{enum} osmo\_prim\_operation operation, \textcolor{keywordtype}{size\_t} alloc\_len);}
\DoxyCodeLine{45 }
\DoxyCodeLine{46 \textcolor{keyword}{struct }osmo\_prim\_srv\_link *osmo\_prim\_srv\_link\_alloc(\textcolor{keywordtype}{void} *ctx);}
\DoxyCodeLine{47 \textcolor{keywordtype}{void} osmo\_prim\_srv\_link\_free(\textcolor{keyword}{struct} osmo\_prim\_srv\_link *prim\_link);}
\DoxyCodeLine{48 \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{49 \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{50 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_prim\_srv\_link\_get\_addr(\textcolor{keyword}{struct} osmo\_prim\_srv\_link *prim\_link);}
\DoxyCodeLine{51 \textcolor{keywordtype}{void} osmo\_prim\_srv\_link\_set\_priv(\textcolor{keyword}{struct} osmo\_prim\_srv\_link *prim\_link, \textcolor{keywordtype}{void} *priv);}
\DoxyCodeLine{52 \textcolor{keywordtype}{void} *osmo\_prim\_srv\_link\_get\_priv(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_prim\_srv\_link *prim\_link);}
\DoxyCodeLine{53 \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{54 \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{55 \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{56 \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{57 \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{58 \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{59 \textcolor{keywordtype}{int} osmo\_prim\_srv\_link\_open(\textcolor{keyword}{struct} osmo\_prim\_srv\_link *prim\_link);}
\DoxyCodeLine{60 }
\DoxyCodeLine{61 \textcolor{keywordtype}{int} osmo\_prim\_srv\_send(\textcolor{keyword}{struct} osmo\_prim\_srv *prim\_srv, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{62 \textcolor{keyword}{struct }osmo\_prim\_srv\_link *osmo\_prim\_srv\_get\_link(\textcolor{keyword}{struct} osmo\_prim\_srv *prims\_srv);}
\DoxyCodeLine{63 \textcolor{keywordtype}{void} osmo\_prim\_srv\_set\_name(\textcolor{keyword}{struct} osmo\_prim\_srv *prim\_srv, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{64 \textcolor{keywordtype}{void} osmo\_prim\_srv\_set\_priv(\textcolor{keyword}{struct} osmo\_prim\_srv *prim\_srv, \textcolor{keywordtype}{void} *priv);}
\DoxyCodeLine{65 \textcolor{keywordtype}{void} *osmo\_prim\_srv\_get\_priv(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_prim\_srv *prim\_srv);}
\DoxyCodeLine{66 \textcolor{keywordtype}{void} osmo\_prim\_srv\_close(\textcolor{keyword}{struct} osmo\_prim\_srv *prim\_srv);}

\end{DoxyCode}
