\doxysection{oap.\+h}
\label{oap_8h_source}\index{include/osmocom/gsm/oap.h@{include/osmocom/gsm/oap.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{10 \textcolor{comment}{/*}}
\DoxyCodeLine{11 \textcolor{comment}{ * (C) 2015-\/2016 by sysmocom -\/ s.f.m.c. GmbH}}
\DoxyCodeLine{12 \textcolor{comment}{ * Author: Neels Hofmeyr}}
\DoxyCodeLine{13 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{14 \textcolor{comment}{ *}}
\DoxyCodeLine{15 \textcolor{comment}{ * SPDX-\/License-\/Identifier: GPL-\/2.0+}}
\DoxyCodeLine{16 \textcolor{comment}{ *}}
\DoxyCodeLine{17 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{18 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}}
\DoxyCodeLine{19 \textcolor{comment}{ * the Free Software Foundation; either version 2 of the License, or}}
\DoxyCodeLine{20 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{21 \textcolor{comment}{ *}}
\DoxyCodeLine{22 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{23 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{24 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{25 \textcolor{comment}{ * GNU General Public License for more details.}}
\DoxyCodeLine{26 \textcolor{comment}{ *}}
\DoxyCodeLine{27 \textcolor{comment}{ * You should have received a copy of the GNU General Public License}}
\DoxyCodeLine{28 \textcolor{comment}{ * along with this program.  If not, see <http://www.gnu.org/licenses/>.}}
\DoxyCodeLine{29 \textcolor{comment}{ *}}
\DoxyCodeLine{30 \textcolor{comment}{ */}}
\DoxyCodeLine{31 }
\DoxyCodeLine{32 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{33 }
\DoxyCodeLine{34 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{35 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{36 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_04\_08\_gprs.h>}}
\DoxyCodeLine{37 }
\DoxyCodeLine{40 \textcolor{keyword}{enum} osmo\_oap\_iei \{}
\DoxyCodeLine{41         OAP\_CAUSE\_IE                        = 0x02,}
\DoxyCodeLine{42         OAP\_RAND\_IE                  = 0x20,}
\DoxyCodeLine{43         OAP\_AUTN\_IE                  = 0x23,}
\DoxyCodeLine{44         OAP\_XRES\_IE                  = 0x24,}
\DoxyCodeLine{45         OAP\_AUTS\_IE                  = 0x25,}
\DoxyCodeLine{46         OAP\_CLIENT\_ID\_IE                = 0x30,}
\DoxyCodeLine{47 \};}
\DoxyCodeLine{48 }
\DoxyCodeLine{50 \textcolor{keyword}{enum} osmo\_oap\_message\_type \{}
\DoxyCodeLine{51         OAP\_MSGT\_REGISTER\_REQUEST      = 0b00000100,}
\DoxyCodeLine{52         OAP\_MSGT\_REGISTER\_ERROR          = 0b00000101,}
\DoxyCodeLine{53         OAP\_MSGT\_REGISTER\_RESULT        = 0b00000110,}
\DoxyCodeLine{54 }
\DoxyCodeLine{55         OAP\_MSGT\_CHALLENGE\_REQUEST    = 0b00001000,}
\DoxyCodeLine{56         OAP\_MSGT\_CHALLENGE\_ERROR        = 0b00001001,}
\DoxyCodeLine{57         OAP\_MSGT\_CHALLENGE\_RESULT      = 0b00001010,}
\DoxyCodeLine{58 }
\DoxyCodeLine{59         OAP\_MSGT\_SYNC\_REQUEST              = 0b00001100,}
\DoxyCodeLine{60         OAP\_MSGT\_SYNC\_ERROR          = 0b00001101,}
\DoxyCodeLine{61         OAP\_MSGT\_SYNC\_RESULT                = 0b00001110,}
\DoxyCodeLine{62 \};}
\DoxyCodeLine{63 }
\DoxyCodeLine{65 \textcolor{keyword}{struct }osmo\_oap\_message \{}
\DoxyCodeLine{66         \textcolor{keyword}{enum} osmo\_oap\_message\_type message\_type;}
\DoxyCodeLine{67         \textcolor{keyword}{enum} gsm48\_gmm\_cause cause;}
\DoxyCodeLine{68         uint16\_t client\_id;}
\DoxyCodeLine{69         \textcolor{keywordtype}{int} rand\_present;}
\DoxyCodeLine{70         uint8\_t rand[16];}
\DoxyCodeLine{71         \textcolor{keywordtype}{int} autn\_present;}
\DoxyCodeLine{72         uint8\_t autn[16];}
\DoxyCodeLine{73         \textcolor{keywordtype}{int} xres\_present;}
\DoxyCodeLine{74         uint8\_t xres[8];}
\DoxyCodeLine{75         \textcolor{keywordtype}{int} auts\_present;}
\DoxyCodeLine{76         uint8\_t auts[14];}
\DoxyCodeLine{77 \};}
\DoxyCodeLine{78 }
\DoxyCodeLine{79 \textcolor{keywordtype}{int} osmo\_oap\_decode(\textcolor{keyword}{struct} osmo\_oap\_message *oap\_msg, \textcolor{keyword}{const} uint8\_t *data,}
\DoxyCodeLine{80                     \textcolor{keywordtype}{size\_t} data\_len);}
\DoxyCodeLine{81 \textcolor{keywordtype}{void} osmo\_oap\_encode(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_oap\_message *oap\_msg);}
\DoxyCodeLine{82 }

\end{DoxyCode}
