\section{src/mtp\+\_\+pcap.c File Reference} \label{mtp__pcap_8c}\index{src/mtp\+\_\+pcap.\+c@{src/mtp\+\_\+pcap.\+c}} {\ttfamily \#include $<$osmocom/mtp/mtp\+\_\+pcap.\+h$>$}\newline {\ttfamily \#include $<$sys/time.\+h$>$}\newline {\ttfamily \#include $<$unistd.\+h$>$}\newline \subsection*{Data Structures} \begin{DoxyCompactItemize} \item struct \textbf{ pcap\+\_\+hdr} \item struct \textbf{ pcaprec\+\_\+hdr} \end{DoxyCompactItemize} \subsection*{Functions} \begin{DoxyCompactItemize} \item struct \textbf{ pcap\+\_\+hdr} \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((packed)) \item int \textbf{ mtp\+\_\+pcap\+\_\+write\+\_\+header} (int fd) \item int \textbf{ mtp\+\_\+pcap\+\_\+write\+\_\+msu} (int fd, const uint8\+\_\+t $\ast$\textbf{ data}, int length) \end{DoxyCompactItemize} \subsection*{Variables} \begin{DoxyCompactItemize} \item uint32\+\_\+t \textbf{ magic\+\_\+number} \item uint16\+\_\+t \textbf{ version\+\_\+major} \item uint16\+\_\+t \textbf{ version\+\_\+minor} \item int32\+\_\+t \textbf{ thiszone} \item uint32\+\_\+t \textbf{ sigfigs} \item uint32\+\_\+t \textbf{ snaplen} \item uint32\+\_\+t \textbf{ network} \item uint32\+\_\+t \textbf{ ts\+\_\+sec} \item uint32\+\_\+t \textbf{ ts\+\_\+usec} \item uint32\+\_\+t \textbf{ incl\+\_\+len} \item uint32\+\_\+t \textbf{ orig\+\_\+len} \end{DoxyCompactItemize} \subsection{Function Documentation} \mbox{\label{mtp__pcap_8c_a65818cb5fbd175e46b033ab9743def50}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!\+\_\+\+\_\+attribute\+\_\+\+\_\+@{\+\_\+\+\_\+attribute\+\_\+\+\_\+}} \index{\+\_\+\+\_\+attribute\+\_\+\+\_\+@{\+\_\+\+\_\+attribute\+\_\+\+\_\+}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{\+\_\+\+\_\+attribute\+\_\+\+\_\+()} {\footnotesize\ttfamily struct \textbf{ pcap\+\_\+hdr} \+\_\+\+\_\+attribute\+\_\+\+\_\+ (\begin{DoxyParamCaption}\item[{(packed)}]{ }\end{DoxyParamCaption})} \mbox{\label{mtp__pcap_8c_a16c01a18801be490efe5eb7969ca45ee}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!mtp\+\_\+pcap\+\_\+write\+\_\+header@{mtp\+\_\+pcap\+\_\+write\+\_\+header}} \index{mtp\+\_\+pcap\+\_\+write\+\_\+header@{mtp\+\_\+pcap\+\_\+write\+\_\+header}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{mtp\+\_\+pcap\+\_\+write\+\_\+header()} {\footnotesize\ttfamily int mtp\+\_\+pcap\+\_\+write\+\_\+header (\begin{DoxyParamCaption}\item[{int}]{fd }\end{DoxyParamCaption})} References pcap\+\_\+hdr\+::magic\+\_\+number. \mbox{\label{mtp__pcap_8c_a72520b353fc64f15cab5dfa2c2326e00}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!mtp\+\_\+pcap\+\_\+write\+\_\+msu@{mtp\+\_\+pcap\+\_\+write\+\_\+msu}} \index{mtp\+\_\+pcap\+\_\+write\+\_\+msu@{mtp\+\_\+pcap\+\_\+write\+\_\+msu}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{mtp\+\_\+pcap\+\_\+write\+\_\+msu()} {\footnotesize\ttfamily int mtp\+\_\+pcap\+\_\+write\+\_\+msu (\begin{DoxyParamCaption}\item[{int}]{fd, }\item[{const uint8\+\_\+t $\ast$}]{data, }\item[{int}]{length }\end{DoxyParamCaption})} References pcaprec\+\_\+hdr\+::ts\+\_\+sec, and pcaprec\+\_\+hdr\+::ts\+\_\+usec. \subsection{Variable Documentation} \mbox{\label{mtp__pcap_8c_af7ebd1acc88da8d5c4018a9b96e4a231}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!incl\+\_\+len@{incl\+\_\+len}} \index{incl\+\_\+len@{incl\+\_\+len}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{incl\+\_\+len} {\footnotesize\ttfamily uint32\+\_\+t incl\+\_\+len} \mbox{\label{mtp__pcap_8c_a45eaf7e07ea0226c1328ee7d4a5f7948}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!magic\+\_\+number@{magic\+\_\+number}} \index{magic\+\_\+number@{magic\+\_\+number}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{magic\+\_\+number} {\footnotesize\ttfamily uint32\+\_\+t magic\+\_\+number} \mbox{\label{mtp__pcap_8c_ae29355b72ee4e48dcf249e0fede0155e}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!network@{network}} \index{network@{network}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{network} {\footnotesize\ttfamily uint32\+\_\+t network} \mbox{\label{mtp__pcap_8c_a6a2f0b2b8c5d6c756e4de119c5fe2fad}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!orig\+\_\+len@{orig\+\_\+len}} \index{orig\+\_\+len@{orig\+\_\+len}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{orig\+\_\+len} {\footnotesize\ttfamily uint32\+\_\+t orig\+\_\+len} \mbox{\label{mtp__pcap_8c_a73f44d04516e34b9edbbf936f10cb81d}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!sigfigs@{sigfigs}} \index{sigfigs@{sigfigs}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{sigfigs} {\footnotesize\ttfamily uint32\+\_\+t sigfigs} \mbox{\label{mtp__pcap_8c_ac2fbfe5646126df83713fb2d42428ed8}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!snaplen@{snaplen}} \index{snaplen@{snaplen}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{snaplen} {\footnotesize\ttfamily uint32\+\_\+t snaplen} \mbox{\label{mtp__pcap_8c_aeb4fa0ab3357f30ebf3be827f6757958}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!thiszone@{thiszone}} \index{thiszone@{thiszone}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{thiszone} {\footnotesize\ttfamily int32\+\_\+t thiszone} \mbox{\label{mtp__pcap_8c_ae1a4b5cc6cf9132afe4b4d20650bf61b}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!ts\+\_\+sec@{ts\+\_\+sec}} \index{ts\+\_\+sec@{ts\+\_\+sec}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{ts\+\_\+sec} {\footnotesize\ttfamily uint32\+\_\+t ts\+\_\+sec} \mbox{\label{mtp__pcap_8c_a166096819938ab066cf826f69c9b59df}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!ts\+\_\+usec@{ts\+\_\+usec}} \index{ts\+\_\+usec@{ts\+\_\+usec}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{ts\+\_\+usec} {\footnotesize\ttfamily uint32\+\_\+t ts\+\_\+usec} \mbox{\label{mtp__pcap_8c_ae45ca4ea27a897d2c46eb088e6b139f8}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!version\+\_\+major@{version\+\_\+major}} \index{version\+\_\+major@{version\+\_\+major}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{version\+\_\+major} {\footnotesize\ttfamily uint16\+\_\+t version\+\_\+major} \mbox{\label{mtp__pcap_8c_a166f22ce4b25488997425405d2a6e42d}} \index{mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}!version\+\_\+minor@{version\+\_\+minor}} \index{version\+\_\+minor@{version\+\_\+minor}!mtp\+\_\+pcap.\+c@{mtp\+\_\+pcap.\+c}} \subsubsection{version\+\_\+minor} {\footnotesize\ttfamily uint16\+\_\+t version\+\_\+minor}