\doxysection{include/osmocom/core/crc16.h File Reference}
\label{crc16_8h}\index{include/osmocom/core/crc16.h@{include/osmocom/core/crc16.h}}


This was copied from the linux kernel and adjusted for our types.  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$sys/types.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
uint16\+\_\+t \textbf{ osmo\+\_\+crc16} (uint16\+\_\+t crc, uint8\+\_\+t const $\ast$\textbf{ buffer}, size\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em Compute 16bit CCITT polynome 0x8408 (x$^\wedge$0 + x$^\wedge$5 + x$^\wedge$12) over given buffer. \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ osmo\+\_\+crc16\+\_\+byte} (uint16\+\_\+t crc, const uint8\+\_\+t \textbf{ data})
\begin{DoxyCompactList}\small\item\em CRC-\/16 polynome 0x8005 (x$^\wedge$16 + x$^\wedge$15 + x$^\wedge$2 + 1) \end{DoxyCompactList}\item 
uint16\+\_\+t \textbf{ osmo\+\_\+crc16\+\_\+ccitt} (uint16\+\_\+t crc, uint8\+\_\+t const $\ast$\textbf{ buffer}, size\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em Compute 16bit CCITT polynome 0x8408 (x$^\wedge$0 + x$^\wedge$5 + x$^\wedge$12) over given buffer. \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ osmo\+\_\+crc16\+\_\+ccitt\+\_\+byte} (uint16\+\_\+t crc, const uint8\+\_\+t \textbf{ data})
\begin{DoxyCompactList}\small\item\em CCITT polynome 0x8408 (x$^\wedge$0 + x$^\wedge$5 + x$^\wedge$12) \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
uint16\+\_\+t const \textbf{ osmo\+\_\+crc16\+\_\+table} [256]
\begin{DoxyCompactList}\small\item\em CRC table for the CRC-\/16. \end{DoxyCompactList}\item 
uint16\+\_\+t const \textbf{ osmo\+\_\+crc16\+\_\+ccitt\+\_\+table} [256]
\begin{DoxyCompactList}\small\item\em CRC table for the CCITT CRC-\/6. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This was copied from the linux kernel and adjusted for our types. 

