\hypertarget{ng__patch_8c_source}{}\doxysection{ng\+\_\+patch.\+c}
\label{ng__patch_8c_source}\index{netgraph/ng\_patch.c@{netgraph/ng\_patch.c}}
\mbox{\hyperlink{ng__patch_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2010 Maxim Ignatenko <gelraen.ua@gmail.com>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2015 Dmitry Vagin <daemon.hammer@ya.ru>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00006}00006 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00008}00008 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00009}00009 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00010}00010 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00017}00017 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00018}00018 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00019}00019 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00020}00020 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00021}00021 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00022}00022 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00023}00023 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00024}00024 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00025}00025 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00026}00026 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00027}00027 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00028}00028 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00029}00029 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00032}\mbox{\hyperlink{ng__patch_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00032}} \mbox{\hyperlink{ng__patch_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <net/bpf.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__message_8h}{netgraph/ng\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__parse_8h}{netgraph/ng\_parse.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{netgraph_8h}{netgraph/netgraph.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__patch_8h}{netgraph/ng\_patch.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00050}00050 \textcolor{comment}{/* private data */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00051}\mbox{\hyperlink{structng__patch__priv}{00051}} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__priv}{ng\_patch\_priv}} \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00052}\mbox{\hyperlink{structng__patch__priv_afa17853af07951fafb91a31bafd99bcb}{00052}}         \mbox{\hyperlink{structng__hook}{hook\_p}}            \mbox{\hyperlink{structng__patch__priv_afa17853af07951fafb91a31bafd99bcb}{in}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00053}\mbox{\hyperlink{structng__patch__priv_ac23e4b01cc6be3afdb9ace3f2332a3ae}{00053}}         \mbox{\hyperlink{structng__hook}{hook\_p}}            \mbox{\hyperlink{structng__patch__priv_ac23e4b01cc6be3afdb9ace3f2332a3ae}{out}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00054}\mbox{\hyperlink{structng__patch__priv_ac64c3e480173e621b7da5cce8b05c892}{00054}}         uint8\_t         \mbox{\hyperlink{structng__patch__priv_ac64c3e480173e621b7da5cce8b05c892}{dlt}}; \textcolor{comment}{/* DLT\_XXX from bpf.h */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00055}\mbox{\hyperlink{structng__patch__priv_a520519d856d45a85f52b97ffbec4e1c3}{00055}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__stats}{ng\_patch\_stats}} \mbox{\hyperlink{structstats}{stats}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00056}\mbox{\hyperlink{structng__patch__priv_a92550b68449caa99a96300abfd0cc1ac}{00056}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__config}{ng\_patch\_config}} *\mbox{\hyperlink{structng__patch__priv_a92550b68449caa99a96300abfd0cc1ac}{conf}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00057}00057 \};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00059}\mbox{\hyperlink{ng__patch_8c_afc9fdcf89746a698502ff70d7fea0e81}{00059}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__priv}{ng\_patch\_priv}} *\mbox{\hyperlink{ng__patch_8c_afc9fdcf89746a698502ff70d7fea0e81}{priv\_p}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00061}00061 \textcolor{comment}{/* Netgraph methods */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00062}\mbox{\hyperlink{ng__patch_8c_a9be6b636d6b2b6312faa840a61f477ce}{00062}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_abb75b9ed2849e15851d6402d2ab5b899}{ng\_constructor\_t}} \mbox{\hyperlink{ng__patch_8c_a9be6b636d6b2b6312faa840a61f477ce}{ng\_patch\_constructor}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00063}\mbox{\hyperlink{ng__patch_8c_ae88057176860987867ca6e28a8adec8d}{00063}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a47b860e2900386e775707cc1ae661162}{ng\_rcvmsg\_t}}   \mbox{\hyperlink{ng__patch_8c_ae88057176860987867ca6e28a8adec8d}{ng\_patch\_rcvmsg}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00064}\mbox{\hyperlink{ng__patch_8c_a7972dbab268d92722c43c37773a5f89d}{00064}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aab0a679789a1af312a7f856b4668ad74}{ng\_shutdown\_t}}       \mbox{\hyperlink{ng__patch_8c_a7972dbab268d92722c43c37773a5f89d}{ng\_patch\_shutdown}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00065}\mbox{\hyperlink{ng__patch_8c_a0fb3ecd5bcbc64b9d93aebc30a73a1d1}{00065}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_afa50639df4ed6eb400f8220a890d56e6}{ng\_newhook\_t}} \mbox{\hyperlink{ng__patch_8c_a0fb3ecd5bcbc64b9d93aebc30a73a1d1}{ng\_patch\_newhook}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00066}\mbox{\hyperlink{ng__patch_8c_a67d559e35c64432c37fe7ab704a4c8a6}{00066}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}} \mbox{\hyperlink{ng__patch_8c_a67d559e35c64432c37fe7ab704a4c8a6}{ng\_patch\_rcvdata}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00067}\mbox{\hyperlink{ng__patch_8c_ac2097820d14af1693bef8013aba7dfc9}{00067}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a669e1783335f933b4a4f90f17d22f381}{ng\_disconnect\_t}}   \mbox{\hyperlink{ng__patch_8c_ac2097820d14af1693bef8013aba7dfc9}{ng\_patch\_disconnect}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00068}\mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{00068}} \textcolor{preprocessor}{\#define ERROUT(x) \{ error = (x); goto done; \}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00070}00070 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00071}\mbox{\hyperlink{ng__patch_8c_a603e5536499ad63a9e423dd71cc6fc27}{00071}} \mbox{\hyperlink{ng__patch_8c_a603e5536499ad63a9e423dd71cc6fc27}{ng\_patch\_config\_getlen}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} *\mbox{\hyperlink{ng__btsocket__rfcomm_8h_a3cce6e7fc609fa524af48647bd518f51}{type}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00072}00072     \textcolor{keyword}{const} u\_char *start, \textcolor{keyword}{const} u\_char *buf)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00073}00073 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00074}00074         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__config}{ng\_patch\_config}} *conf;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00076}00076         conf = (\textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__config}{ng\_patch\_config}} *)(buf -\/}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00077}00077             offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structng__patch__config}{ng\_patch\_config}}, \mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00079}00079         \textcolor{keywordflow}{return} (conf-\/>\mbox{\hyperlink{structng__patch__config_acd57b8e175cee02dbe09d73fc00cc351}{count}});}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00080}00080 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00082}\mbox{\hyperlink{ng__patch_8c_a2be1e2a3b6a860c9903b8c2909e58336}{00082}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__patch_8c_a2be1e2a3b6a860c9903b8c2909e58336}{ng\_patch\_op\_type\_fields}}[]}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00083}00083         = \mbox{\hyperlink{ng__patch_8h_a130180df8359dd4488ae0546c55fca20}{NG\_PATCH\_OP\_TYPE}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00084}\mbox{\hyperlink{ng__patch_8c_a7a6cab957929c52533109bd5a3001eed}{00084}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__patch_8c_a7a6cab957929c52533109bd5a3001eed}{ng\_patch\_op\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00085}00085         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00086}00086         \&\mbox{\hyperlink{ng__patch_8c_a2be1e2a3b6a860c9903b8c2909e58336}{ng\_patch\_op\_type\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00087}00087 \};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00089}\mbox{\hyperlink{ng__patch_8c_abfe34ba7500ca47324bbf51d01274b17}{00089}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__array__info}{ng\_parse\_array\_info}} \mbox{\hyperlink{ng__patch_8c_abfe34ba7500ca47324bbf51d01274b17}{ng\_patch\_ops\_array\_info}} = \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00090}00090         \&\mbox{\hyperlink{ng__patch_8c_a7a6cab957929c52533109bd5a3001eed}{ng\_patch\_op\_type}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00091}00091         \&\mbox{\hyperlink{ng__patch_8c_a603e5536499ad63a9e423dd71cc6fc27}{ng\_patch\_config\_getlen}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00092}00092 \};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00093}\mbox{\hyperlink{ng__patch_8c_aaa50844bd25c2650fe8a7b32e6059779}{00093}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__patch_8c_aaa50844bd25c2650fe8a7b32e6059779}{ng\_patch\_ops\_array\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00094}00094         \&\mbox{\hyperlink{ng__parse_8c_a979248410eaad0c3e86262fe53840012}{ng\_parse\_array\_type}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00095}00095         \&\mbox{\hyperlink{ng__patch_8c_abfe34ba7500ca47324bbf51d01274b17}{ng\_patch\_ops\_array\_info}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00096}00096 \};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00098}\mbox{\hyperlink{ng__patch_8c_aa9bd60daf3e5f8648e2bd53728117b46}{00098}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__patch_8c_aa9bd60daf3e5f8648e2bd53728117b46}{ng\_patch\_config\_type\_fields}}[]}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00099}00099         = \mbox{\hyperlink{ng__patch_8h_a7ad8b238d5c185c3b7bc91b0f89c0dfd}{NG\_PATCH\_CONFIG\_TYPE}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00100}\mbox{\hyperlink{ng__patch_8c_affc4384426eada8253268749744eaac0}{00100}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__patch_8c_affc4384426eada8253268749744eaac0}{ng\_patch\_config\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00101}00101         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00102}00102         \&\mbox{\hyperlink{ng__patch_8c_aa9bd60daf3e5f8648e2bd53728117b46}{ng\_patch\_config\_type\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00103}00103 \};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00105}\mbox{\hyperlink{ng__patch_8c_aa391ebe295546c77cf47026bd5c3923c}{00105}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__patch_8c_aa391ebe295546c77cf47026bd5c3923c}{ng\_patch\_stats\_fields}}[]}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00106}00106         = \mbox{\hyperlink{ng__patch_8h_a56eff62cc8326736d70d4a471a5a4785}{NG\_PATCH\_STATS\_TYPE}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00107}\mbox{\hyperlink{ng__patch_8c_ad86ca4f404f046c0fbf9b4c43e343b87}{00107}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__patch_8c_ad86ca4f404f046c0fbf9b4c43e343b87}{ng\_patch\_stats\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00108}00108         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00109}00109         \&\mbox{\hyperlink{ng__patch_8c_aa391ebe295546c77cf47026bd5c3923c}{ng\_patch\_stats\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00110}00110 \};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00112}\mbox{\hyperlink{ng__patch_8c_ace08927938f94d9690aa4528376c8ddd}{00112}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__cmdlist}{ng\_cmdlist}} \mbox{\hyperlink{ng__patch_8c_ace08927938f94d9690aa4528376c8ddd}{ng\_patch\_cmdlist}}[] = \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00113}00113         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00114}00114                 \mbox{\hyperlink{ng__patch_8h_aa5732722151778a3828aff33e55dc727}{NGM\_PATCH\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00115}00115                 \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aabc8b9e5f20f836ef53260a15819ffe42}{NGM\_PATCH\_GETDLT}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00116}00116                 \textcolor{stringliteral}{"{}getdlt"{}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00117}00117                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00118}00118                 \&\mbox{\hyperlink{ng__parse_8c_ad9b579abf3953b9655aec194529ddc1d}{ng\_parse\_uint8\_type}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00119}00119         \},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00120}00120         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00121}00121                 \mbox{\hyperlink{ng__patch_8h_aa5732722151778a3828aff33e55dc727}{NGM\_PATCH\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00122}00122                 \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aa9ca528b57a319bc653f17094c14a5821}{NGM\_PATCH\_SETDLT}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00123}00123                 \textcolor{stringliteral}{"{}setdlt"{}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00124}00124                 \&\mbox{\hyperlink{ng__parse_8c_ad9b579abf3953b9655aec194529ddc1d}{ng\_parse\_uint8\_type}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00125}00125                 NULL}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00126}00126         \},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00127}00127         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00128}00128                 \mbox{\hyperlink{ng__patch_8h_aa5732722151778a3828aff33e55dc727}{NGM\_PATCH\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00129}00129                 \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aad159e27b023bb48ccf9b0a9271a5bb68}{NGM\_PATCH\_GETCONFIG}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00130}00130                 \textcolor{stringliteral}{"{}getconfig"{}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00131}00131                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00132}00132                 \&\mbox{\hyperlink{ng__patch_8c_affc4384426eada8253268749744eaac0}{ng\_patch\_config\_type}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00133}00133         \},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00134}00134         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00135}00135                 \mbox{\hyperlink{ng__patch_8h_aa5732722151778a3828aff33e55dc727}{NGM\_PATCH\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00136}00136                 \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aa2b75a15385fa563a55db182fa097c43e}{NGM\_PATCH\_SETCONFIG}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00137}00137                 \textcolor{stringliteral}{"{}setconfig"{}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00138}00138                 \&\mbox{\hyperlink{ng__patch_8c_affc4384426eada8253268749744eaac0}{ng\_patch\_config\_type}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00139}00139                 NULL}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00140}00140         \},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00141}00141         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00142}00142                 \mbox{\hyperlink{ng__patch_8h_aa5732722151778a3828aff33e55dc727}{NGM\_PATCH\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00143}00143                 \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aa5ec8cffa3599ea8de74443256acb80df}{NGM\_PATCH\_GET\_STATS}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00144}00144                 \textcolor{stringliteral}{"{}getstats"{}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00145}00145                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00146}00146                 \&\mbox{\hyperlink{ng__patch_8c_ad86ca4f404f046c0fbf9b4c43e343b87}{ng\_patch\_stats\_type}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00147}00147         \},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00148}00148         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00149}00149                 \mbox{\hyperlink{ng__patch_8h_aa5732722151778a3828aff33e55dc727}{NGM\_PATCH\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00150}00150                 \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aad166f9b0f1376f30f37d2567f150b3d2}{NGM\_PATCH\_CLR\_STATS}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00151}00151                 \textcolor{stringliteral}{"{}clrstats"{}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00152}00152                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00153}00153                 NULL}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00154}00154         \},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00155}00155         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00156}00156                 \mbox{\hyperlink{ng__patch_8h_aa5732722151778a3828aff33e55dc727}{NGM\_PATCH\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00157}00157                 \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aac87c0d9611d96990b132e3783b2ac89e}{NGM\_PATCH\_GETCLR\_STATS}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00158}00158                 \textcolor{stringliteral}{"{}getclrstats"{}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00159}00159                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00160}00160                 \&\mbox{\hyperlink{ng__patch_8c_ad86ca4f404f046c0fbf9b4c43e343b87}{ng\_patch\_stats\_type}}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00161}00161         \},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00162}00162         \{ 0 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00163}00163 \};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00164}00164 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00165}\mbox{\hyperlink{ng__patch_8c_a80a131770518c7fa3758d85054006e7a}{00165}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__type}{ng\_type}} \mbox{\hyperlink{ng__patch_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}} = \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00166}00166         .\mbox{\hyperlink{structng__type_adbc1c8884ff0e625c19c4b513262fd0e}{version}} =       \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00167}00167         .name =         \mbox{\hyperlink{ng__patch_8h_abd07cb716b555af56811f8446827a3cd}{NG\_PATCH\_NODE\_TYPE}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00168}00168         .constructor =  \mbox{\hyperlink{ng__patch_8c_a9be6b636d6b2b6312faa840a61f477ce}{ng\_patch\_constructor}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00169}00169         .rcvmsg =       \mbox{\hyperlink{ng__patch_8c_ae88057176860987867ca6e28a8adec8d}{ng\_patch\_rcvmsg}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00170}00170         .shutdown =     \mbox{\hyperlink{ng__patch_8c_a7972dbab268d92722c43c37773a5f89d}{ng\_patch\_shutdown}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00171}00171         .newhook =      \mbox{\hyperlink{ng__patch_8c_a0fb3ecd5bcbc64b9d93aebc30a73a1d1}{ng\_patch\_newhook}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00172}00172         .rcvdata =      \mbox{\hyperlink{ng__patch_8c_a67d559e35c64432c37fe7ab704a4c8a6}{ng\_patch\_rcvdata}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00173}00173         .disconnect =   \mbox{\hyperlink{ng__patch_8c_ac2097820d14af1693bef8013aba7dfc9}{ng\_patch\_disconnect}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00174}00174         .cmdlist =      \mbox{\hyperlink{ng__patch_8c_ace08927938f94d9690aa4528376c8ddd}{ng\_patch\_cmdlist}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00175}00175 \};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00176}00176 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00177}\mbox{\hyperlink{ng__patch_8c_aa8351a3c9933d1a330f0b012e831ccf9}{00177}} \mbox{\hyperlink{ng__patch_8c_aa8351a3c9933d1a330f0b012e831ccf9}{NETGRAPH\_INIT}}(patch, \&\mbox{\hyperlink{ng__patch_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}});}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00179}00179 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00180}\mbox{\hyperlink{ng__patch_8c_abafbe7566cc1a855ab18e557f4432e0e}{00180}} \mbox{\hyperlink{ng__patch_8c_a9be6b636d6b2b6312faa840a61f477ce}{ng\_patch\_constructor}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00181}00181 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00182}00182         \mbox{\hyperlink{structnetflow}{priv\_p}} \mbox{\hyperlink{structprivdata}{privdata}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00184}00184         \mbox{\hyperlink{structprivdata}{privdata}} = malloc(\textcolor{keyword}{sizeof}(*\mbox{\hyperlink{structprivdata}{privdata}}), M\_NETGRAPH, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00185}00185         \mbox{\hyperlink{structprivdata}{privdata}}-\/>dlt = DLT\_RAW;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00187}00187         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, \mbox{\hyperlink{structprivdata}{privdata}});}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00188}00188 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00189}00189         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00190}00190 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00192}00192 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00193}\mbox{\hyperlink{ng__patch_8c_ab2b757727ae153868abfe65b1fbcf39e}{00193}} \mbox{\hyperlink{ng__patch_8c_a0fb3ecd5bcbc64b9d93aebc30a73a1d1}{ng\_patch\_newhook}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00194}00194 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00195}00195         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00197}00197         \textcolor{keywordflow}{if} (strncmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__patch_8h_ab55309a06f456f0c54b6b3db8b848599}{NG\_PATCH\_HOOK\_IN}}, strlen(\mbox{\hyperlink{ng__patch_8h_ab55309a06f456f0c54b6b3db8b848599}{NG\_PATCH\_HOOK\_IN}})) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00198}00198                 privp-\/>in = hook;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00199}00199         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strncmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__patch_8h_aa54190836cabd4a12f587bf38d5dd558}{NG\_PATCH\_HOOK\_OUT}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00200}00200             strlen(\mbox{\hyperlink{ng__patch_8h_aa54190836cabd4a12f587bf38d5dd558}{NG\_PATCH\_HOOK\_OUT}})) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00201}00201                 privp-\/>out = hook;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00202}00202         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00203}00203                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00204}00204 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00205}00205         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00206}00206 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00208}00208 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00209}\mbox{\hyperlink{ng__patch_8c_abfbc9f69d33ee56217ab58698858f8ab}{00209}} \mbox{\hyperlink{ng__patch_8c_ae88057176860987867ca6e28a8adec8d}{ng\_patch\_rcvmsg}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__item}{item\_p}} item, \mbox{\hyperlink{structng__hook}{hook\_p}} lasthook)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00210}00210 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00211}00211         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00212}00212         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__config}{ng\_patch\_config}} *conf, *newconf;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00213}00213         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00214}00214         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *resp = NULL;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00215}00215         \textcolor{keywordtype}{int} i, error = 0;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00217}00217         \mbox{\hyperlink{netgraph_8h_adc9a04fd174ef3c29ecae94016b84839}{NGI\_GET\_MSG}}(item, msg);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00219}00219         \textcolor{keywordflow}{if}  (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_ab59e14593b69a406ed5ca4209d489a10}{typecookie}} != \mbox{\hyperlink{ng__patch_8h_aa5732722151778a3828aff33e55dc727}{NGM\_PATCH\_COOKIE}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00220}00220                 \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00222}00222         \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00223}00223         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00224}00224                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aad159e27b023bb48ccf9b0a9271a5bb68}{NGM\_PATCH\_GETCONFIG}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00225}00225                         \textcolor{keywordflow}{if} (privp-\/>conf == NULL)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00226}00226                                 \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(0);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00228}00228                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg,}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00229}00229                             \mbox{\hyperlink{ng__patch_8h_a397c8494f7747fb9e5abe71074fadaac}{NG\_PATCH\_CONF\_SIZE}}(privp-\/>conf-\/>count), M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00231}00231                         \textcolor{keywordflow}{if} (resp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00232}00232                                 \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00234}00234                         bcopy(privp-\/>conf, resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}},}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00235}00235                             \mbox{\hyperlink{ng__patch_8h_a397c8494f7747fb9e5abe71074fadaac}{NG\_PATCH\_CONF\_SIZE}}(privp-\/>conf-\/>count));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00236}00236 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00237}00237                         conf = (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__config}{ng\_patch\_config}} *) resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00239}00239                         for (i = 0; i < conf-\/>\mbox{\hyperlink{structng__patch__config_acd57b8e175cee02dbe09d73fc00cc351}{count}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00240}00240                                 \textcolor{keywordflow}{switch} (conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_a9e0b413880267f44e16099ac88b23d31}{length}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00241}00241                                 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00242}00242                                         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00243}00243                                                 conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_ab1d7409c164e16fb596cefcd37e96a37}{v8}} = conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_a4e6813e0940e9773a9da241f78330e88}{v1}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00244}00244                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00245}00245                                         \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00246}00246                                                 conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_ab1d7409c164e16fb596cefcd37e96a37}{v8}} = conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_aeb4fb59e9a8f33a42a7204205371b566}{v2}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00247}00247                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00248}00248                                         \textcolor{keywordflow}{case} 4:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00249}00249                                                 conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_ab1d7409c164e16fb596cefcd37e96a37}{v8}} = conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_a087f1b429696184c721426d5d07b28a6}{v4}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00250}00250                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00251}00251                                         \textcolor{keywordflow}{case} 8:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00252}00252                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00253}00253                                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00254}00254                         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00256}00256                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00257}00257 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00258}00258                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aa2b75a15385fa563a55db182fa097c43e}{NGM\_PATCH\_SETCONFIG}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00259}00259                         conf = (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__config}{ng\_patch\_config}} *) msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00260}00260 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00261}00261                         if (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structng__patch__config}{ng\_patch\_config}}) ||}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00262}00262                             msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} < \mbox{\hyperlink{ng__patch_8h_a397c8494f7747fb9e5abe71074fadaac}{NG\_PATCH\_CONF\_SIZE}}(conf-\/>\mbox{\hyperlink{structng__patch__config_acd57b8e175cee02dbe09d73fc00cc351}{count}}))}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00263}00263                                 \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00265}00265                         \textcolor{keywordflow}{for} (i = 0; i < conf-\/>\mbox{\hyperlink{structng__patch__config_acd57b8e175cee02dbe09d73fc00cc351}{count}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00266}00266                                 \textcolor{keywordflow}{switch} (conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_a9e0b413880267f44e16099ac88b23d31}{length}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00267}00267                                 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00268}00268                                         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00269}00269                                                 conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_a4e6813e0940e9773a9da241f78330e88}{v1}} = (uint8\_t) conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_ab1d7409c164e16fb596cefcd37e96a37}{v8}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00270}00270                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00271}00271                                         \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00272}00272                                                 conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_aeb4fb59e9a8f33a42a7204205371b566}{v2}} = (uint16\_t) conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_ab1d7409c164e16fb596cefcd37e96a37}{v8}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00273}00273                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00274}00274                                         \textcolor{keywordflow}{case} 4:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00275}00275                                                 conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_a087f1b429696184c721426d5d07b28a6}{v4}} = (uint32\_t) conf-\/>\mbox{\hyperlink{structng__patch__config_a3643774beb666f8b5fa219f111192a69}{ops}}[i].\mbox{\hyperlink{structng__patch__op_ac1b37d538e832dfb2eb8dd52fb5bfbae}{val}}.\mbox{\hyperlink{unionng__patch__op__val_ab1d7409c164e16fb596cefcd37e96a37}{v8}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00276}00276                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00277}00277                                         \textcolor{keywordflow}{case} 8:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00278}00278                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00279}00279                                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00280}00280                                                 \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00281}00281                                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00282}00282                         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00284}00284                         conf-\/>\mbox{\hyperlink{structng__patch__config_a3008dd775a961176f03b9ffba87c0c3c}{csum\_flags}} \&= \mbox{\hyperlink{ng__patch_8h_a46cbb85e0f8491ec726c18937dd01992}{NG\_PATCH\_CSUM\_IPV4}}|\mbox{\hyperlink{ng__patch_8h_a5ede6c5d20b69627e1c8c6917bb57f9f}{NG\_PATCH\_CSUM\_IPV6}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00285}00285                         conf-\/>\mbox{\hyperlink{structng__patch__config_ae76ae5b2806fe3e9866ef816f3d13118}{relative\_offset}} = !!conf-\/>\mbox{\hyperlink{structng__patch__config_ae76ae5b2806fe3e9866ef816f3d13118}{relative\_offset}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00286}00286 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00287}00287                         newconf = malloc(\mbox{\hyperlink{ng__patch_8h_a397c8494f7747fb9e5abe71074fadaac}{NG\_PATCH\_CONF\_SIZE}}(conf-\/>\mbox{\hyperlink{structng__patch__config_acd57b8e175cee02dbe09d73fc00cc351}{count}}), M\_NETGRAPH, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00288}00288 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00289}00289                         bcopy(conf, newconf, \mbox{\hyperlink{ng__patch_8h_a397c8494f7747fb9e5abe71074fadaac}{NG\_PATCH\_CONF\_SIZE}}(conf-\/>\mbox{\hyperlink{structng__patch__config_acd57b8e175cee02dbe09d73fc00cc351}{count}}));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00290}00290 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00291}00291                         \textcolor{keywordflow}{if} (privp-\/>conf)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00292}00292                                 free(privp-\/>conf, M\_NETGRAPH);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00293}00293 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00294}00294                         privp-\/>conf = newconf;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00296}00296                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00297}00297 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00298}00298                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aa5ec8cffa3599ea8de74443256acb80df}{NGM\_PATCH\_GET\_STATS}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00299}00299                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aad166f9b0f1376f30f37d2567f150b3d2}{NGM\_PATCH\_CLR\_STATS}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00300}00300                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aac87c0d9611d96990b132e3783b2ac89e}{NGM\_PATCH\_GETCLR\_STATS}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00301}00301                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} != \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aad166f9b0f1376f30f37d2567f150b3d2}{NGM\_PATCH\_CLR\_STATS}}) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00302}00302                                 \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structng__patch__stats}{ng\_patch\_stats}}), M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00304}00304                                 \textcolor{keywordflow}{if} (resp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00305}00305                                         \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00307}00307                                 bcopy(\&(privp-\/>stats), resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structng__patch__stats}{ng\_patch\_stats}}));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00308}00308                         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00309}00309 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00310}00310                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} != \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aa5ec8cffa3599ea8de74443256acb80df}{NGM\_PATCH\_GET\_STATS}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00311}00311                                 bzero(\&(privp-\/>stats), \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structng__patch__stats}{ng\_patch\_stats}}));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00312}00312 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00313}00313                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00315}00315                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aabc8b9e5f20f836ef53260a15819ffe42}{NGM\_PATCH\_GETDLT}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00316}00316                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \textcolor{keyword}{sizeof}(uint8\_t), M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00318}00318                         \textcolor{keywordflow}{if} (resp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00319}00319                                 \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00321}00321                         *((uint8\_t *) resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}) = privp-\/>dlt;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00323}00323                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00325}00325                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_a7cc2e4244ca368f68e5746185eda6c4aa9ca528b57a319bc653f17094c14a5821}{NGM\_PATCH\_SETDLT}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00326}00326                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != \textcolor{keyword}{sizeof}(uint8\_t))}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00327}00327                                 \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00328}00328 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00329}00329                         \textcolor{keywordflow}{switch} (*(uint8\_t *) msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00330}00330                         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00331}00331                                 \textcolor{keywordflow}{case} DLT\_EN10MB:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00332}00332                                 \textcolor{keywordflow}{case} DLT\_RAW:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00333}00333                                         privp-\/>dlt = *(uint8\_t *) msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00334}00334                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00336}00336                                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00337}00337                                         \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00338}00338                         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00339}00339 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00340}00340                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00342}00342                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00343}00343                         \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00344}00344         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00346}00346 done:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00347}00347         \mbox{\hyperlink{netgraph_8h_a69db50ed7f968e936580df029ab5c5dc}{NG\_RESPOND\_MSG}}(error, node, item, resp);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00348}00348         \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00349}00349 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00350}00350         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00351}00351 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00353}00353 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00354}\mbox{\hyperlink{ng__patch_8c_a44d44fa102a7c947987fdbcc79927bf7}{00354}} \mbox{\hyperlink{ng__patch_8c_a44d44fa102a7c947987fdbcc79927bf7}{do\_patch}}(\mbox{\hyperlink{structnetflow}{priv\_p}} privp, \textcolor{keyword}{struct} mbuf *m, \textcolor{keywordtype}{int} global\_offset)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00355}00355 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00356}00356         \textcolor{keywordtype}{int} i, offset, patched = 0;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00357}00357         \textcolor{keyword}{union }\mbox{\hyperlink{unionng__patch__op__val}{ng\_patch\_op\_val}} val;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00358}00358 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00359}00359         \textcolor{keywordflow}{for} (i = 0; i < privp-\/>conf-\/>count; i++) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00360}00360                 offset = global\_offset + privp-\/>conf-\/>ops[i].offset;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00361}00361 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00362}00362                 \textcolor{keywordflow}{if} (offset + privp-\/>conf-\/>ops[i].length > m-\/>m\_pkthdr.len)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00363}00363                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00365}00365                 \textcolor{comment}{/* for "{}="{} operation we don't need to copy data from mbuf */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00366}00366                 \textcolor{keywordflow}{if} (privp-\/>conf-\/>ops[i].mode != \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a89c5928d49119441845f0b7618f141e6}{NG\_PATCH\_MODE\_SET}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00367}00367                         m\_copydata(m, offset, privp-\/>conf-\/>ops[i].length, (caddr\_t) \&val);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00369}00369                 \textcolor{keywordflow}{switch} (privp-\/>conf-\/>ops[i].length)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00370}00370                 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00371}00371                         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00372}00372                                 \textcolor{keywordflow}{switch} (privp-\/>conf-\/>ops[i].mode)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00373}00373                                 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00374}00374                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a89c5928d49119441845f0b7618f141e6}{NG\_PATCH\_MODE\_SET}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00375}00375                                                 val.v1 = privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00376}00376                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00377}00377                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603ac830b978e680ab803af35e75305c935f}{NG\_PATCH\_MODE\_ADD}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00378}00378                                                 val.v1 += privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00379}00379                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00380}00380                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603aff1dc189375303d81adee6813cecd30b}{NG\_PATCH\_MODE\_SUB}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00381}00381                                                 val.v1 -\/= privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00382}00382                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00383}00383                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a9b9791445b781669448f6a943848455e}{NG\_PATCH\_MODE\_MUL}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00384}00384                                                 val.v1 *= privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00385}00385                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00386}00386                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a2ac263365596b2bd271615c173c01cb1}{NG\_PATCH\_MODE\_DIV}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00387}00387                                                 val.v1 /= privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00388}00388                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00389}00389                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a330dac4e883139dd540a1ca1964d90b9}{NG\_PATCH\_MODE\_NEG}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00390}00390                                                 *((int8\_t *) \&val) = -\/ *((int8\_t *) \&val);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00391}00391                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00392}00392                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a2b00c18c109c6fd892cb2cecc264f894}{NG\_PATCH\_MODE\_AND}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00393}00393                                                 val.v1 \&= privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00394}00394                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00395}00395                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a95928b328ab89b4f63355c9998fa0812}{NG\_PATCH\_MODE\_OR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00396}00396                                                 val.v1 |= privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00397}00397                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00398}00398                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a6b399bf644381e416076f6d2b9d83478}{NG\_PATCH\_MODE\_XOR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00399}00399                                                 val.v1 \string^= privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00400}00400                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00401}00401                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603af01e2268d110c86f26506fb2e6f0bd63}{NG\_PATCH\_MODE\_SHL}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00402}00402                                                 val.v1 <<= privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00403}00403                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00404}00404                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603ad45ea67319663f1eec0a1808da09c16e}{NG\_PATCH\_MODE\_SHR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00405}00405                                                 val.v1 >>= privp-\/>conf-\/>ops[i].val.v1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00406}00406                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00407}00407                                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00408}00408                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00409}00409 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00410}00410                         \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00411}00411                                 val.v2 = ntohs(val.v2);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00412}00412 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00413}00413                                 \textcolor{keywordflow}{switch} (privp-\/>conf-\/>ops[i].mode)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00414}00414                                 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00415}00415                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a89c5928d49119441845f0b7618f141e6}{NG\_PATCH\_MODE\_SET}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00416}00416                                                 val.v2 = privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00417}00417                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00418}00418                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603ac830b978e680ab803af35e75305c935f}{NG\_PATCH\_MODE\_ADD}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00419}00419                                                 val.v2 += privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00420}00420                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00421}00421                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603aff1dc189375303d81adee6813cecd30b}{NG\_PATCH\_MODE\_SUB}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00422}00422                                                 val.v2 -\/= privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00423}00423                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00424}00424                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a9b9791445b781669448f6a943848455e}{NG\_PATCH\_MODE\_MUL}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00425}00425                                                 val.v2 *= privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00426}00426                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00427}00427                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a2ac263365596b2bd271615c173c01cb1}{NG\_PATCH\_MODE\_DIV}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00428}00428                                                 val.v2 /= privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00429}00429                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00430}00430                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a330dac4e883139dd540a1ca1964d90b9}{NG\_PATCH\_MODE\_NEG}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00431}00431                                                 *((int16\_t *) \&val) = -\/ *((int16\_t *) \&val);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00432}00432                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00433}00433                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a2b00c18c109c6fd892cb2cecc264f894}{NG\_PATCH\_MODE\_AND}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00434}00434                                                 val.v2 \&= privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00435}00435                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00436}00436                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a95928b328ab89b4f63355c9998fa0812}{NG\_PATCH\_MODE\_OR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00437}00437                                                 val.v2 |= privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00438}00438                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00439}00439                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a6b399bf644381e416076f6d2b9d83478}{NG\_PATCH\_MODE\_XOR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00440}00440                                                 val.v2 \string^= privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00441}00441                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00442}00442                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603af01e2268d110c86f26506fb2e6f0bd63}{NG\_PATCH\_MODE\_SHL}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00443}00443                                                 val.v2 <<= privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00444}00444                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00445}00445                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603ad45ea67319663f1eec0a1808da09c16e}{NG\_PATCH\_MODE\_SHR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00446}00446                                                 val.v2 >>= privp-\/>conf-\/>ops[i].val.v2;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00447}00447                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00448}00448                                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00449}00449 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00450}00450                                 val.v2 = htons(val.v2);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00451}00451 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00452}00452                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00453}00453 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00454}00454                         \textcolor{keywordflow}{case} 4:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00455}00455                                 val.v4 = ntohl(val.v4);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00456}00456 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00457}00457                                 \textcolor{keywordflow}{switch} (privp-\/>conf-\/>ops[i].mode)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00458}00458                                 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00459}00459                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a89c5928d49119441845f0b7618f141e6}{NG\_PATCH\_MODE\_SET}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00460}00460                                                 val.v4 = privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00461}00461                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00462}00462                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603ac830b978e680ab803af35e75305c935f}{NG\_PATCH\_MODE\_ADD}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00463}00463                                                 val.v4 += privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00464}00464                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00465}00465                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603aff1dc189375303d81adee6813cecd30b}{NG\_PATCH\_MODE\_SUB}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00466}00466                                                 val.v4 -\/= privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00467}00467                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00468}00468                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a9b9791445b781669448f6a943848455e}{NG\_PATCH\_MODE\_MUL}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00469}00469                                                 val.v4 *= privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00470}00470                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00471}00471                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a2ac263365596b2bd271615c173c01cb1}{NG\_PATCH\_MODE\_DIV}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00472}00472                                                 val.v4 /= privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00473}00473                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00474}00474                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a330dac4e883139dd540a1ca1964d90b9}{NG\_PATCH\_MODE\_NEG}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00475}00475                                                 *((int32\_t *) \&val) = -\/ *((int32\_t *) \&val);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00476}00476                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00477}00477                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a2b00c18c109c6fd892cb2cecc264f894}{NG\_PATCH\_MODE\_AND}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00478}00478                                                 val.v4 \&= privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00479}00479                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00480}00480                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a95928b328ab89b4f63355c9998fa0812}{NG\_PATCH\_MODE\_OR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00481}00481                                                 val.v4 |= privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00482}00482                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00483}00483                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a6b399bf644381e416076f6d2b9d83478}{NG\_PATCH\_MODE\_XOR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00484}00484                                                 val.v4 \string^= privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00485}00485                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00486}00486                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603af01e2268d110c86f26506fb2e6f0bd63}{NG\_PATCH\_MODE\_SHL}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00487}00487                                                 val.v4 <<= privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00488}00488                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00489}00489                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603ad45ea67319663f1eec0a1808da09c16e}{NG\_PATCH\_MODE\_SHR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00490}00490                                                 val.v4 >>= privp-\/>conf-\/>ops[i].val.v4;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00491}00491                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00492}00492                                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00494}00494                                 val.v4 = htonl(val.v4);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00496}00496                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00498}00498                         \textcolor{keywordflow}{case} 8:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00499}00499                                 val.v8 = be64toh(val.v8);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00500}00500 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00501}00501                                 \textcolor{keywordflow}{switch} (privp-\/>conf-\/>ops[i].mode)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00502}00502                                 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00503}00503                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a89c5928d49119441845f0b7618f141e6}{NG\_PATCH\_MODE\_SET}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00504}00504                                                 val.v8 = privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00505}00505                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00506}00506                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603ac830b978e680ab803af35e75305c935f}{NG\_PATCH\_MODE\_ADD}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00507}00507                                                 val.v8 += privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00508}00508                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00509}00509                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603aff1dc189375303d81adee6813cecd30b}{NG\_PATCH\_MODE\_SUB}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00510}00510                                                 val.v8 -\/= privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00511}00511                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00512}00512                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a9b9791445b781669448f6a943848455e}{NG\_PATCH\_MODE\_MUL}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00513}00513                                                 val.v8 *= privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00514}00514                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00515}00515                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a2ac263365596b2bd271615c173c01cb1}{NG\_PATCH\_MODE\_DIV}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00516}00516                                                 val.v8 /= privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00517}00517                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00518}00518                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a330dac4e883139dd540a1ca1964d90b9}{NG\_PATCH\_MODE\_NEG}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00519}00519                                                 *((int64\_t *) \&val) = -\/ *((int64\_t *) \&val);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00520}00520                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00521}00521                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a2b00c18c109c6fd892cb2cecc264f894}{NG\_PATCH\_MODE\_AND}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00522}00522                                                 val.v8 \&= privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00523}00523                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00524}00524                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a95928b328ab89b4f63355c9998fa0812}{NG\_PATCH\_MODE\_OR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00525}00525                                                 val.v8 |= privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00526}00526                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00527}00527                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603a6b399bf644381e416076f6d2b9d83478}{NG\_PATCH\_MODE\_XOR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00528}00528                                                 val.v8 \string^= privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00529}00529                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00530}00530                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603af01e2268d110c86f26506fb2e6f0bd63}{NG\_PATCH\_MODE\_SHL}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00531}00531                                                 val.v8 <<= privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00532}00532                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00533}00533                                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__patch_8h_aedcf2109f459315e1a7f2af73ec9b603ad45ea67319663f1eec0a1808da09c16e}{NG\_PATCH\_MODE\_SHR}}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00534}00534                                                 val.v8 >>= privp-\/>conf-\/>ops[i].val.v8;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00535}00535                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00536}00536                                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00537}00537 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00538}00538                                 val.v8 = htobe64(val.v8);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00539}00539 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00540}00540                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00541}00541                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00543}00543                 m\_copyback(m, offset, privp-\/>conf-\/>ops[i].length, (caddr\_t) \&val);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00544}00544                 patched = 1;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00545}00545         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00546}00546 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00547}00547         \textcolor{keywordflow}{if} (patched)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00548}00548                 privp-\/>stats.patched++;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00549}00549 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00551}00551 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00552}\mbox{\hyperlink{ng__patch_8c_af87b66350a7b6cc9b982aa79b16227d6}{00552}} \mbox{\hyperlink{ng__patch_8c_a67d559e35c64432c37fe7ab704a4c8a6}{ng\_patch\_rcvdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00553}00553 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00554}00554         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} \mbox{\hyperlink{structpriv}{priv}} = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00555}00555         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00556}00556         \mbox{\hyperlink{structng__hook}{hook\_p}} out;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00557}00557         \textcolor{keywordtype}{int} pullup\_len = 0;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00558}00558         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00559}00559 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00560}00560         \mbox{\hyperlink{structpriv}{priv}}-\/>\mbox{\hyperlink{structpriv_a0e6807613dbfcab337d6220a3cbb5c3f}{stats}}.received++;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00561}00561 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00562}00562         \mbox{\hyperlink{netgraph_8h_abbb0acb5f480576cff9901caddeef57f}{NGI\_GET\_M}}(item, m);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00563}00563 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00564}00564 \textcolor{preprocessor}{\#define PULLUP\_CHECK(mbuf, length) do \{                                 \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00565}00565 \textcolor{preprocessor}{        pullup\_len += length;                                           \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00566}00566 \textcolor{preprocessor}{        if (((mbuf)-\/>m\_pkthdr.len < pullup\_len) ||                      \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00567}00567 \textcolor{preprocessor}{            (pullup\_len > MHLEN)) \{                                     \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00568}00568 \textcolor{preprocessor}{                error = EINVAL;                                         \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00569}00569 \textcolor{preprocessor}{                goto bypass;                                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00570}00570 \textcolor{preprocessor}{        \}                                                               \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00571}00571 \textcolor{preprocessor}{        if ((mbuf)-\/>m\_len < pullup\_len \&\&                               \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00572}00572 \textcolor{preprocessor}{            (((mbuf) = m\_pullup((mbuf), pullup\_len)) == NULL)) \{        \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00573}00573 \textcolor{preprocessor}{                error = ENOBUFS;                                        \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00574}00574 \textcolor{preprocessor}{                goto drop;                                              \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00575}00575 \textcolor{preprocessor}{        \}                                                               \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00576}00576 \textcolor{preprocessor}{\} while (0)}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00577}00577 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00578}00578         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structpriv}{priv}}-\/>conf \&\& hook == \mbox{\hyperlink{structpriv}{priv}}-\/>in \&\&}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00579}00579             m \&\& (m-\/>m\_flags \& M\_PKTHDR)) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00580}00580                 m = m\_unshare(m, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00581}00581 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00582}00582                 \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00583}00583                         \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00584}00584 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00585}00585                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structpriv}{priv}}-\/>conf-\/>relative\_offset) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00586}00586                         \textcolor{keyword}{struct }ether\_header *eh;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00587}00587                         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__vlan__header}{ng\_patch\_vlan\_header}} *vh;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00588}00588                         uint16\_t \mbox{\hyperlink{structng__patch__vlan__header_a40ba6ef3d10d7947a0a2f1818d5a895c}{etype}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00589}00589 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00590}00590                         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{structpriv}{priv}}-\/>dlt)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00591}00591                         \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00592}00592                                 \textcolor{keywordflow}{case} DLT\_EN10MB:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00593}00593                                         \mbox{\hyperlink{ng__patch_8c_a8b5f2474c5f0a6ca1328ed92c68d693e}{PULLUP\_CHECK}}(m, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ether\_header));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00594}00594                                         eh = mtod(m, \textcolor{keyword}{struct} ether\_header *);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00595}00595                                         \mbox{\hyperlink{structng__patch__vlan__header_a40ba6ef3d10d7947a0a2f1818d5a895c}{etype}} = ntohs(eh-\/>ether\_type);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00596}00596 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00597}00597                                         \textcolor{keywordflow}{for} (;;) \{      \textcolor{comment}{/* QinQ support */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00598}00598                                                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{structng__patch__vlan__header_a40ba6ef3d10d7947a0a2f1818d5a895c}{etype}})}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00599}00599                                                 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00600}00600                                                         \textcolor{keywordflow}{case} 0x8100:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00601}00601                                                         \textcolor{keywordflow}{case} 0x88A8:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00602}00602                                                         \textcolor{keywordflow}{case} 0x9100:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00603}00603                                                                 \mbox{\hyperlink{ng__patch_8c_a8b5f2474c5f0a6ca1328ed92c68d693e}{PULLUP\_CHECK}}(m, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structng__patch__vlan__header}{ng\_patch\_vlan\_header}}));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00604}00604                                                                 vh = (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__patch__vlan__header}{ng\_patch\_vlan\_header}} *) mtodo(m,}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00605}00605                                                                     pullup\_len -\/ \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structng__patch__vlan__header}{ng\_patch\_vlan\_header}}));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00606}00606                                                                 \mbox{\hyperlink{structng__patch__vlan__header_a40ba6ef3d10d7947a0a2f1818d5a895c}{etype}} = ntohs(vh-\/>\mbox{\hyperlink{structng__patch__vlan__header_a40ba6ef3d10d7947a0a2f1818d5a895c}{etype}});}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00607}00607                                                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00608}00608 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00609}00609                                                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00610}00610                                                                 \textcolor{keywordflow}{goto} loopend;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00611}00611                                                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00612}00612                                         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00613}00613 loopend:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00614}00614                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00615}00615 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00616}00616                                 \textcolor{keywordflow}{case} DLT\_RAW:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00617}00617                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00618}00618 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00619}00619                                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00620}00620                                         \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00621}00621                         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00622}00622                 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00623}00623 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00624}00624                 \mbox{\hyperlink{ng__patch_8c_a44d44fa102a7c947987fdbcc79927bf7}{do\_patch}}(\mbox{\hyperlink{structpriv}{priv}}, m, pullup\_len);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00626}00626                 m-\/>m\_pkthdr.csum\_flags |= \mbox{\hyperlink{structpriv}{priv}}-\/>conf-\/>csum\_flags;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00627}00627         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00628}00628 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00629}00629 \textcolor{preprocessor}{\#undef  PULLUP\_CHECK}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00630}00630 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00631}00631 bypass:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00632}00632         out = NULL;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00633}00633 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00634}00634         \textcolor{keywordflow}{if} (hook == \mbox{\hyperlink{structpriv}{priv}}-\/>in) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00635}00635                 \textcolor{comment}{/* return frames on 'in' hook if 'out' not connected */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00636}00636                 out = \mbox{\hyperlink{structpriv}{priv}}-\/>out ? \mbox{\hyperlink{structpriv}{priv}}-\/>out : \mbox{\hyperlink{structpriv}{priv}}-\/>in;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00637}00637         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (hook == \mbox{\hyperlink{structpriv}{priv}}-\/>out \&\& \mbox{\hyperlink{structpriv}{priv}}-\/>in) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00638}00638                 \textcolor{comment}{/* pass frames on 'out' hook if 'in' connected */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00639}00639                 out = \mbox{\hyperlink{structpriv}{priv}}-\/>in;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00640}00640         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00641}00641 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00642}00642         \textcolor{keywordflow}{if} (out == NULL)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00643}00643                 \mbox{\hyperlink{ng__patch_8c_a661c316872e6e1e6a714d7fad67f366f}{ERROUT}}(0);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00644}00644 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00645}00645         \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, out, m);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00646}00646 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00647}00647         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00648}00648 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00649}00649 done:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00650}00650 drop:}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00651}00651         \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00652}00652         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00654}00654         \mbox{\hyperlink{structpriv}{priv}}-\/>\mbox{\hyperlink{structpriv_a0e6807613dbfcab337d6220a3cbb5c3f}{stats}}.dropped++;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00655}00655 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00656}00656         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00657}00657 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00658}00658 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00659}00659 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00660}\mbox{\hyperlink{ng__patch_8c_a51c65f6beb51b26cb4969829c65ac4bf}{00660}} \mbox{\hyperlink{ng__patch_8c_a7972dbab268d92722c43c37773a5f89d}{ng\_patch\_shutdown}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00661}00661 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00662}00662         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} \mbox{\hyperlink{structprivdata}{privdata}} = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00663}00663 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00664}00664         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, NULL);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00665}00665         \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(node);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00666}00666 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00667}00667         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structprivdata}{privdata}}-\/>conf != NULL)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00668}00668                 free(\mbox{\hyperlink{structprivdata}{privdata}}-\/>conf, M\_NETGRAPH);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00669}00669 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00670}00670         free(\mbox{\hyperlink{structprivdata}{privdata}}, M\_NETGRAPH);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00671}00671 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00672}00672         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00673}00673 \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00674}00674 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00675}00675 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00676}\mbox{\hyperlink{ng__patch_8c_a211e69e9dc1f8985e7abdee222e058cf}{00676}} \mbox{\hyperlink{ng__patch_8c_ac2097820d14af1693bef8013aba7dfc9}{ng\_patch\_disconnect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00677}00677 \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00678}00678         \mbox{\hyperlink{structnetflow}{priv\_p}} \mbox{\hyperlink{structpriv}{priv}};}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00679}00679 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00680}00680         \mbox{\hyperlink{structpriv}{priv}} = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00681}00681 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00682}00682         \textcolor{keywordflow}{if} (hook == \mbox{\hyperlink{structpriv}{priv}}-\/>in) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00683}00683                 \mbox{\hyperlink{structpriv}{priv}}-\/>in = NULL;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00684}00684         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00685}00685 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00686}00686         \textcolor{keywordflow}{if} (hook == \mbox{\hyperlink{structpriv}{priv}}-\/>out) \{}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00687}00687                 \mbox{\hyperlink{structpriv}{priv}}-\/>out = NULL;}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00688}00688         \}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00689}00689 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00690}00690         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_ad47e204c5b3adaddfa4bf0c380234f48}{NG\_NODE\_NUMHOOKS}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook)) == 0 \&\&}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00691}00691             \mbox{\hyperlink{netgraph_8h_a6bdd56e0f33084eeaadbe696febcbbd8}{NG\_NODE\_IS\_VALID}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook))) \textcolor{comment}{/* already shutting down? */}}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00692}00692                 \mbox{\hyperlink{netgraph_8h_a85914ce0da2b314478aaf7efcdcd3ff0}{ng\_rmnode\_self}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00694}00694         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__patch_8c_source_l00695}00695 \}}

\end{DoxyCode}
