\doxysection{time\+\_\+cc.\+h}
\label{time__cc_8h_source}\index{include/osmocom/core/time\_cc.h@{include/osmocom/core/time\_cc.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{4 \textcolor{comment}{/* Copyright (C) 2021 by sysmocom -\/ s.f.m.c. GmbH <info@sysmocom.de>}}
\DoxyCodeLine{5 \textcolor{comment}{ *}}
\DoxyCodeLine{6 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{7 \textcolor{comment}{ *}}
\DoxyCodeLine{8 \textcolor{comment}{ * Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>}}
\DoxyCodeLine{9 \textcolor{comment}{ *}}
\DoxyCodeLine{10 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{11 \textcolor{comment}{ * it under the terms of the GNU Affero General Public License as published by}}
\DoxyCodeLine{12 \textcolor{comment}{ * the Free Software Foundation; either version 3 of the License, or}}
\DoxyCodeLine{13 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{14 \textcolor{comment}{ *}}
\DoxyCodeLine{15 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{16 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{17 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{18 \textcolor{comment}{ * GNU Affero General Public License for more details.}}
\DoxyCodeLine{19 \textcolor{comment}{ *}}
\DoxyCodeLine{20 \textcolor{comment}{ * You should have received a copy of the GNU Affero General Public License}}
\DoxyCodeLine{21 \textcolor{comment}{ * along with this program.  If not, see <http://www.gnu.org/licenses/>.}}
\DoxyCodeLine{22 \textcolor{comment}{ *}}
\DoxyCodeLine{23 \textcolor{comment}{ */}}
\DoxyCodeLine{24 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{25 }
\DoxyCodeLine{26 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 \textcolor{preprocessor}{\#include <osmocom/core/timer.h>}}
\DoxyCodeLine{29 }
\DoxyCodeLine{35 \textcolor{keyword}{struct }osmo\_tdef;}
\DoxyCodeLine{36 \textcolor{keyword}{struct }rate\_ctr;}
\DoxyCodeLine{37 }
\DoxyCodeLine{105 \textcolor{keyword}{struct }osmo\_time\_cc\_cfg \{}
\DoxyCodeLine{108         uint64\_t gran\_usec;}
\DoxyCodeLine{111         uint64\_t round\_threshold\_usec;}
\DoxyCodeLine{113         uint64\_t forget\_sum\_usec;}
\DoxyCodeLine{115         \textcolor{keyword}{struct }rate\_ctr *rate\_ctr;}
\DoxyCodeLine{116 }
\DoxyCodeLine{118         \textcolor{keywordtype}{int} T\_gran;}
\DoxyCodeLine{120         \textcolor{keywordtype}{int} T\_round\_threshold;}
\DoxyCodeLine{122         \textcolor{keywordtype}{int} T\_forget\_sum;}
\DoxyCodeLine{124         \textcolor{keyword}{struct }osmo\_tdef *T\_defs;}
\DoxyCodeLine{125 \};}
\DoxyCodeLine{126 }
\DoxyCodeLine{158 \textcolor{keyword}{struct }osmo\_time\_cc \{}
\DoxyCodeLine{159         \textcolor{keyword}{struct }osmo\_time\_cc\_cfg cfg;}
\DoxyCodeLine{160 }
\DoxyCodeLine{161         \textcolor{keywordtype}{bool} flag\_state;}
\DoxyCodeLine{162 }
\DoxyCodeLine{165         uint64\_t total\_sum;}
\DoxyCodeLine{166 }
\DoxyCodeLine{167         \textcolor{keyword}{struct }osmo\_timer\_list timer;}
\DoxyCodeLine{168 }
\DoxyCodeLine{170         uint64\_t start\_time;}
\DoxyCodeLine{173         uint64\_t last\_counted\_time;}
\DoxyCodeLine{174 }
\DoxyCodeLine{177         uint64\_t sum;}
\DoxyCodeLine{180         uint64\_t reported\_sum;}
\DoxyCodeLine{181 \};}
\DoxyCodeLine{182 }
\DoxyCodeLine{183 \textcolor{keywordtype}{void} osmo\_time\_cc\_init(\textcolor{keyword}{struct} osmo\_time\_cc *tc);}
\DoxyCodeLine{184 \textcolor{keywordtype}{void} osmo\_time\_cc\_set\_flag(\textcolor{keyword}{struct} osmo\_time\_cc *tc, \textcolor{keywordtype}{bool} flag);}
\DoxyCodeLine{185 \textcolor{keywordtype}{void} osmo\_time\_cc\_cleanup(\textcolor{keyword}{struct} osmo\_time\_cc *tc);}
\DoxyCodeLine{186 }

\end{DoxyCode}
