\doxysection{gsm0480.\+h}
\label{gsm0480_8h_source}\index{include/osmocom/gsm/gsm0480.h@{include/osmocom/gsm/gsm0480.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{4 }
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <osmocom/core/defs.h>}}
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_04\_08.h>}}
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_04\_80.h>}}
\DoxyCodeLine{9 }
\DoxyCodeLine{10 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string gsm0480\_comp\_type\_names[];}
\DoxyCodeLine{11 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *gsm0480\_comp\_type\_name(uint8\_t comp\_type) \{}
\DoxyCodeLine{12         \textcolor{keywordflow}{return} get\_value\_string(gsm0480\_comp\_type\_names, comp\_type);}
\DoxyCodeLine{13 \}}
\DoxyCodeLine{14 }
\DoxyCodeLine{15 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string gsm0480\_op\_code\_names[];}
\DoxyCodeLine{16 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *gsm0480\_op\_code\_name(uint8\_t op\_code) \{}
\DoxyCodeLine{17         \textcolor{keywordflow}{return} get\_value\_string(gsm0480\_op\_code\_names, op\_code);}
\DoxyCodeLine{18 \}}
\DoxyCodeLine{19 }
\DoxyCodeLine{25 \textcolor{preprocessor}{\#define GSM0480\_USSD\_OCTET\_STRING\_LEN   160}}
\DoxyCodeLine{26 }
\DoxyCodeLine{33 \textcolor{preprocessor}{\#define GSM0480\_USSD\_7BIT\_STRING\_LEN    182}}
\DoxyCodeLine{34 }
\DoxyCodeLine{40 \textcolor{preprocessor}{\#define MAX\_LEN\_USSD\_STRING             31}}
\DoxyCodeLine{41 }
\DoxyCodeLine{42 \textcolor{comment}{/* deprecated */}}
\DoxyCodeLine{43 \textcolor{keyword}{struct }ussd\_request \{}
\DoxyCodeLine{44         \textcolor{keywordtype}{char} text[MAX\_LEN\_USSD\_STRING + 1];}
\DoxyCodeLine{45         uint8\_t transaction\_id;}
\DoxyCodeLine{46         uint8\_t invoke\_id;}
\DoxyCodeLine{47 \};}
\DoxyCodeLine{48 }
\DoxyCodeLine{49 \textcolor{comment}{/* deprecated */}}
\DoxyCodeLine{50 \textcolor{keywordtype}{int} gsm0480\_decode\_ussd\_request(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm48\_hdr *hdr, uint16\_t len,}
\DoxyCodeLine{51                                 \textcolor{keyword}{struct} ussd\_request *request) OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use gsm0480\_decode\_ss\_request() instead"{}});}
\DoxyCodeLine{52 }
\DoxyCodeLine{57 \textcolor{keyword}{struct }ss\_request \{}
\DoxyCodeLine{62         uint8\_t opcode;}
\DoxyCodeLine{68         uint8\_t ss\_code;}
\DoxyCodeLine{69 }
\DoxyCodeLine{77         uint8\_t ussd\_text[GSM0480\_USSD\_OCTET\_STRING\_LEN];}
\DoxyCodeLine{78 }
\DoxyCodeLine{87         uint8\_t ussd\_data[GSM0480\_USSD\_OCTET\_STRING\_LEN];}
\DoxyCodeLine{88         uint8\_t ussd\_data\_len; \textcolor{comment}{/* Length in bytes */}}
\DoxyCodeLine{89         uint8\_t ussd\_data\_dcs; \textcolor{comment}{/* Data Coding Scheme */}}
\DoxyCodeLine{90 }
\DoxyCodeLine{95         uint8\_t transaction\_id;}
\DoxyCodeLine{101         uint8\_t invoke\_id;}
\DoxyCodeLine{102 \};}
\DoxyCodeLine{103 }
\DoxyCodeLine{104 \textcolor{keywordtype}{int} gsm0480\_extract\_ie\_by\_tag(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm48\_hdr *hdr, uint16\_t msg\_len,}
\DoxyCodeLine{105                               uint8\_t **ie, uint16\_t *ie\_len, uint8\_t ie\_tag);}
\DoxyCodeLine{106 \textcolor{keywordtype}{int} gsm0480\_parse\_facility\_ie(\textcolor{keyword}{const} uint8\_t *facility\_ie, uint16\_t length,}
\DoxyCodeLine{107                               \textcolor{keyword}{struct} ss\_request *req);}
\DoxyCodeLine{108 \textcolor{keywordtype}{int} gsm0480\_decode\_ss\_request(\textcolor{keyword}{const} \textcolor{keyword}{struct} gsm48\_hdr *hdr, uint16\_t len,}
\DoxyCodeLine{109                                 \textcolor{keyword}{struct} ss\_request *request);}
\DoxyCodeLine{110 }
\DoxyCodeLine{111 \textcolor{keyword}{struct }msgb *gsm0480\_msgb\_alloc\_name(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{112 \textcolor{keyword}{struct }msgb *gsm0480\_gen\_ussd\_resp\_7bit(uint8\_t invoke\_id, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *text);}
\DoxyCodeLine{113 \textcolor{keyword}{struct }msgb *gsm0480\_gen\_return\_error(uint8\_t invoke\_id, uint8\_t error\_code);}
\DoxyCodeLine{114 \textcolor{keyword}{struct }msgb *gsm0480\_gen\_reject(\textcolor{keywordtype}{int} invoke\_id, uint8\_t problem\_tag, uint8\_t problem\_code);}
\DoxyCodeLine{115 }
\DoxyCodeLine{116 \textcolor{keyword}{struct }msgb *gsm0480\_create\_ussd\_resp(uint8\_t invoke\_id, uint8\_t trans\_id, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *text);}
\DoxyCodeLine{117 \textcolor{keyword}{struct }msgb *gsm0480\_create\_unstructuredSS\_Notify(\textcolor{keywordtype}{int} alertPattern, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *text);}
\DoxyCodeLine{118 \textcolor{keyword}{struct }msgb *gsm0480\_create\_notifySS(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *text);}
\DoxyCodeLine{119 \textcolor{keyword}{struct }msgb *gsm0480\_create\_ussd\_notify(\textcolor{keywordtype}{int} level, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *text);}
\DoxyCodeLine{120 \textcolor{keyword}{struct }msgb *gsm0480\_create\_ussd\_release\_complete(\textcolor{keywordtype}{void})}
\DoxyCodeLine{121         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use gsm0480\_create\_release\_complete() instead."{}});}
\DoxyCodeLine{122 \textcolor{keyword}{struct }msgb *gsm0480\_create\_release\_complete(uint8\_t trans\_id);}
\DoxyCodeLine{123 }
\DoxyCodeLine{124 \textcolor{keywordtype}{int} gsm0480\_wrap\_invoke(\textcolor{keyword}{struct} msgb *msg, \textcolor{keywordtype}{int} op, \textcolor{keywordtype}{int} link\_id);}
\DoxyCodeLine{125 \textcolor{keywordtype}{int} gsm0480\_wrap\_facility(\textcolor{keyword}{struct} msgb *msg);}

\end{DoxyCode}
