\hypertarget{ng__checksum_8h_source}{}\doxysection{ng\+\_\+checksum.\+h}
\label{ng__checksum_8h_source}\index{netgraph/ng\_checksum.h@{netgraph/ng\_checksum.h}}
\mbox{\hyperlink{ng__checksum_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2015 Dmitry Vagin <daemon.hammer@ya.ru>}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00003}00003 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00005}00005 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00006}00006 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00007}00007 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00008}00008 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00009}00009 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00010}00010 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00012}00012 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00014}00014 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00015}00015 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00016}00016 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00017}00017 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00018}00018 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00019}00019 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00020}00020 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00021}00021 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00022}00022 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00023}00023 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00024}00024 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00025}00025 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00026}00026 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00029}00029 \textcolor{preprocessor}{\#ifndef \_NETGRAPH\_NG\_CHECKSUM\_H\_}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00030}00030 \textcolor{preprocessor}{\#define \_NETGRAPH\_NG\_CHECKSUM\_H\_}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00032}00032 \textcolor{comment}{/* Node type name. */}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00033}\mbox{\hyperlink{ng__checksum_8h_a077aa83dfbe073b054398e1c5f41eebb}{00033}} \textcolor{preprocessor}{\#define NG\_CHECKSUM\_NODE\_TYPE   "{}checksum"{}}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00035}00035 \textcolor{comment}{/* Node type cookie. */}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00036}\mbox{\hyperlink{ng__checksum_8h_a65cfbb64c85e3e67fef908ff46979a66}{00036}} \textcolor{preprocessor}{\#define NGM\_CHECKSUM\_COOKIE     439419912}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00038}00038 \textcolor{comment}{/* Hook names */}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00039}\mbox{\hyperlink{ng__checksum_8h_a4c0fae970be0c575bfd2a66a7dd1e313}{00039}} \textcolor{preprocessor}{\#define NG\_CHECKSUM\_HOOK\_IN     "{}in"{}}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00040}\mbox{\hyperlink{ng__checksum_8h_a3349e755bacdd7f89d04799eecdeb255}{00040}} \textcolor{preprocessor}{\#define NG\_CHECKSUM\_HOOK\_OUT    "{}out"{}}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00042}00042 \textcolor{comment}{/* Checksum flags */}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00043}\mbox{\hyperlink{ng__checksum_8h_a5e1d02664bdf26d22ad9b462de0e9567}{00043}} \textcolor{preprocessor}{\#define NG\_CHECKSUM\_CSUM\_IPV4   (CSUM\_IP|CSUM\_TCP|CSUM\_UDP)}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00044}\mbox{\hyperlink{ng__checksum_8h_a3cc1ed7691fcb587bbb29d26c6cf5a78}{00044}} \textcolor{preprocessor}{\#define NG\_CHECKSUM\_CSUM\_IPV6   (CSUM\_TCP\_IPV6|CSUM\_UDP\_IPV6)}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00046}00046 \textcolor{comment}{/* Netgraph commands understood by this node type */}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00047}00047 \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00048}\mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a4f116b89c40df73d4fc25a153cedf2ec}{00048}}         \mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a4f116b89c40df73d4fc25a153cedf2ec}{NGM\_CHECKSUM\_GETDLT}} = 1,}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00049}\mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a5ebbc81dee7930d593e7da9f2c9ef3be}{00049}}         \mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a5ebbc81dee7930d593e7da9f2c9ef3be}{NGM\_CHECKSUM\_SETDLT}},}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00050}\mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a0dd427f948be46f16b39e53802de3e5c}{00050}}         \mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a0dd427f948be46f16b39e53802de3e5c}{NGM\_CHECKSUM\_GETCONFIG}},}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00051}\mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a1ea70e101aded5e4eaf21431431c2b1f}{00051}}         \mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a1ea70e101aded5e4eaf21431431c2b1f}{NGM\_CHECKSUM\_SETCONFIG}},}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00052}\mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a77d9b2241852e1a02af8f712bcd01510}{00052}}         \mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a77d9b2241852e1a02af8f712bcd01510}{NGM\_CHECKSUM\_GETCLR\_STATS}},}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00053}\mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a42a65beb08f1ef38d87e2aa02e79609d}{00053}}         \mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a42a65beb08f1ef38d87e2aa02e79609d}{NGM\_CHECKSUM\_GET\_STATS}},}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00054}\mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a784dd5684456265688e17fba63009c07}{00054}}         \mbox{\hyperlink{ng__checksum_8h_a4caf8d8f829279fba122163d961608a4a784dd5684456265688e17fba63009c07}{NGM\_CHECKSUM\_CLR\_STATS}},}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00055}00055 \};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00057}00057 \textcolor{comment}{/* Parsing declarations */}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00059}\mbox{\hyperlink{ng__checksum_8h_adb3e655a68ac39ce26e48a74bf8d7026}{00059}} \textcolor{preprocessor}{\#define NG\_CHECKSUM\_CONFIG\_TYPE \{                               \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00060}00060 \textcolor{preprocessor}{        \{ "{}csum\_flags"{}},         \&ng\_parse\_uint64\_type   \},      \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00061}00061         \{ "{}csum\_offload"{},       \&ng\_parse\_uint64\_type   \},      \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00062}00062         \{ NULL \}                                                \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00063}00063 \}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00065}\mbox{\hyperlink{ng__checksum_8h_a50581e147675fc0254bcb380e02be461}{00065}} \textcolor{preprocessor}{\#define NG\_CHECKSUM\_STATS\_TYPE \{                                \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00066}00066 \textcolor{preprocessor}{        \{ "{}Received"{}},           \&ng\_parse\_uint64\_type   \},      \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00067}00067         \{ "{}Processed"{},          \&ng\_parse\_uint64\_type   \},      \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00068}00068         \{ "{}Dropped"{},            \&ng\_parse\_uint64\_type   \},      \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00069}00069         \{ NULL \}                                        \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00070}00070 \}}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00072}\mbox{\hyperlink{structng__checksum__config}{00072}} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__checksum__config}{ng\_checksum\_config}} \{}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00073}\mbox{\hyperlink{structng__checksum__config_a4032737b76749f7a39e96182c03355af}{00073}}         uint64\_t        \mbox{\hyperlink{structng__checksum__config_a4032737b76749f7a39e96182c03355af}{csum\_flags}};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00074}\mbox{\hyperlink{structng__checksum__config_a1e381b3d6908d4acd2375306e298f84e}{00074}}         uint64\_t        \mbox{\hyperlink{structng__checksum__config_a1e381b3d6908d4acd2375306e298f84e}{csum\_offload}};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00075}00075 \};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00077}\mbox{\hyperlink{structng__checksum__stats}{00077}} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__checksum__stats}{ng\_checksum\_stats}} \{}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00078}\mbox{\hyperlink{structng__checksum__stats_ad1abd962c77833f02dcb4e5efdc118ca}{00078}}         uint64\_t        \mbox{\hyperlink{structng__checksum__stats_ad1abd962c77833f02dcb4e5efdc118ca}{received}};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00079}\mbox{\hyperlink{structng__checksum__stats_a0cbcf42416f5621821d6139e700d9e20}{00079}}         uint64\_t        \mbox{\hyperlink{structng__checksum__stats_a0cbcf42416f5621821d6139e700d9e20}{processed}};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00080}\mbox{\hyperlink{structng__checksum__stats_af899d41a456b37cf5920ae2d01bfe009}{00080}}         uint64\_t        \mbox{\hyperlink{structng__checksum__stats_af899d41a456b37cf5920ae2d01bfe009}{dropped}};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00081}00081 \};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00083}\mbox{\hyperlink{structng__checksum__vlan__header}{00083}} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__checksum__vlan__header}{ng\_checksum\_vlan\_header}} \{}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00084}\mbox{\hyperlink{structng__checksum__vlan__header_a3d24009a7a978061f3478c6c68623938}{00084}}         u\_int16\_t \mbox{\hyperlink{structng__checksum__vlan__header_a3d24009a7a978061f3478c6c68623938}{tag}};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00085}\mbox{\hyperlink{structng__checksum__vlan__header_ac408818506a4b6cddcddf5a239bc6cb8}{00085}}         u\_int16\_t \mbox{\hyperlink{structng__checksum__vlan__header_ac408818506a4b6cddcddf5a239bc6cb8}{etype}};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00086}00086 \};}
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{ng__checksum_8h_source_l00088}00088 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_NETGRAPH\_NG\_CHECKSUM\_H\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
