\hypertarget{ng__vlan__rotate_8c_source}{}\doxysection{ng\+\_\+vlan\+\_\+rotate.\+c}
\label{ng__vlan__rotate_8c_source}\index{netgraph/ng\_vlan\_rotate.c@{netgraph/ng\_vlan\_rotate.c}}
\mbox{\hyperlink{ng__vlan__rotate_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00002}00002 \textcolor{comment}{ * Spdx-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2019-\/2021 IKS Service GmbH}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00006}00006 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00007}00007 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00008}00008 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00009}00009 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00011}00011 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00013}00013 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00014}00014 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00015}00015 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00016}00016 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00017}00017 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00018}00018 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00019}00019 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00020}00020 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00021}00021 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00022}00022 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00023}00023 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00024}00024 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00025}00025 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00026}00026 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00027}00027 \textcolor{comment}{ * Author: Lutz Donnerhacke <lutz@donnerhacke.de>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00028}00028 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00029}00029 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00030}00030 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/ctype.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/syslog.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/counter.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__message_8h}{netgraph/ng\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__parse_8h}{netgraph/ng\_parse.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__vlan__rotate_8h}{netgraph/ng\_vlan\_rotate.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{netgraph_8h}{netgraph/netgraph.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00050}00050 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00051}00051 \textcolor{comment}{ * This section contains the netgraph method declarations for the}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00052}00052 \textcolor{comment}{ * sample node. These methods define the netgraph 'type'.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00053}00053 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00055}\mbox{\hyperlink{ng__vlan__rotate_8c_a0a89d75cbf52d825f399a083220d0a0c}{00055}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_abb75b9ed2849e15851d6402d2ab5b899}{ng\_constructor\_t}} \mbox{\hyperlink{ng__vlan__rotate_8c_a0a89d75cbf52d825f399a083220d0a0c}{ng\_vlanrotate\_constructor}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00056}\mbox{\hyperlink{ng__vlan__rotate_8c_a1c2f959d5e71ec3ab38dd76c9e8552c7}{00056}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a47b860e2900386e775707cc1ae661162}{ng\_rcvmsg\_t}} \mbox{\hyperlink{ng__vlan__rotate_8c_a1c2f959d5e71ec3ab38dd76c9e8552c7}{ng\_vlanrotate\_rcvmsg}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00057}\mbox{\hyperlink{ng__vlan__rotate_8c_a12910a15d0bdb967de109c5df752737b}{00057}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aab0a679789a1af312a7f856b4668ad74}{ng\_shutdown\_t}} \mbox{\hyperlink{ng__vlan__rotate_8c_a12910a15d0bdb967de109c5df752737b}{ng\_vlanrotate\_shutdown}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00058}\mbox{\hyperlink{ng__vlan__rotate_8c_a80e5eba15b37268f4abb9fd1cce14968}{00058}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_afa50639df4ed6eb400f8220a890d56e6}{ng\_newhook\_t}} \mbox{\hyperlink{ng__vlan__rotate_8c_a80e5eba15b37268f4abb9fd1cce14968}{ng\_vlanrotate\_newhook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00059}\mbox{\hyperlink{ng__vlan__rotate_8c_a53d573b84a34d51eab22cc3c20e3b225}{00059}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}} \mbox{\hyperlink{ng__vlan__rotate_8c_a53d573b84a34d51eab22cc3c20e3b225}{ng\_vlanrotate\_rcvdata}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00060}\mbox{\hyperlink{ng__vlan__rotate_8c_afee9589ccada109b2a1b641e6d518b85}{00060}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a669e1783335f933b4a4f90f17d22f381}{ng\_disconnect\_t}} \mbox{\hyperlink{ng__vlan__rotate_8c_afee9589ccada109b2a1b641e6d518b85}{ng\_vlanrotate\_disconnect}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00062}00062 \textcolor{comment}{/* Parse type for struct ng\_vlanrotate\_conf */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00063}\mbox{\hyperlink{ng__vlan__rotate_8c_aba893402a35b575f2e40211a086a9724}{00063}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__vlan__rotate_8c_aba893402a35b575f2e40211a086a9724}{ng\_vlanrotate\_conf\_fields}}[] = \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00064}00064         \{\textcolor{stringliteral}{"{}rot"{}}, \&\mbox{\hyperlink{ng__parse_8c_a819676cfdd299c1393586f63f529a867}{ng\_parse\_int8\_type}}\},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00065}00065         \{\textcolor{stringliteral}{"{}min"{}}, \&\mbox{\hyperlink{ng__parse_8c_ad9b579abf3953b9655aec194529ddc1d}{ng\_parse\_uint8\_type}}\},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00066}00066         \{\textcolor{stringliteral}{"{}max"{}}, \&\mbox{\hyperlink{ng__parse_8c_ad9b579abf3953b9655aec194529ddc1d}{ng\_parse\_uint8\_type}}\},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00067}00067         \{NULL\}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00068}00068 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00069}\mbox{\hyperlink{ng__vlan__rotate_8c_a90fff93b9d14fcd3e01d4d37bd964b14}{00069}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__vlan__rotate_8c_a90fff93b9d14fcd3e01d4d37bd964b14}{ng\_vlanrotate\_conf\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00070}00070         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00071}00071         \&\mbox{\hyperlink{ng__vlan__rotate_8c_aba893402a35b575f2e40211a086a9724}{ng\_vlanrotate\_conf\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00072}00072 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00074}00074 \textcolor{comment}{/* Parse type for struct ng\_vlanrotate\_stat */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00075}\mbox{\hyperlink{ng__vlan__rotate_8c_a12764622753929a4510d312d8a1ba608}{00075}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__fixedarray__info}{ng\_parse\_fixedarray\_info}} \mbox{\hyperlink{ng__vlan__rotate_8c_a12764622753929a4510d312d8a1ba608}{ng\_vlanrotate\_stat\_hist\_info}} = \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00076}00076         \&\mbox{\hyperlink{ng__parse_8c_a2efc35331c0407f6367763b8bb9fda94}{ng\_parse\_uint64\_type}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00077}00077         \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00078}00078 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00079}\mbox{\hyperlink{ng__vlan__rotate_8c_a9ce76b0b926337c5975d529c36ae8d36}{00079}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__vlan__rotate_8c_a9ce76b0b926337c5975d529c36ae8d36}{ng\_vlanrotate\_stat\_hist}} = \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00080}00080         \&\mbox{\hyperlink{ng__parse_8c_a752f8efa9316ec01f55c30403511e6e9}{ng\_parse\_fixedarray\_type}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00081}00081         \&\mbox{\hyperlink{ng__vlan__rotate_8c_a12764622753929a4510d312d8a1ba608}{ng\_vlanrotate\_stat\_hist\_info}}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00082}00082 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00083}\mbox{\hyperlink{ng__vlan__rotate_8c_a91dfd201699600a1c752a985133bd2f2}{00083}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__vlan__rotate_8c_a91dfd201699600a1c752a985133bd2f2}{ng\_vlanrotate\_stat\_fields}}[] = \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00084}00084         \{\textcolor{stringliteral}{"{}drops"{}}, \&\mbox{\hyperlink{ng__parse_8c_a2efc35331c0407f6367763b8bb9fda94}{ng\_parse\_uint64\_type}}\},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00085}00085         \{\textcolor{stringliteral}{"{}excessive"{}}, \&\mbox{\hyperlink{ng__parse_8c_a2efc35331c0407f6367763b8bb9fda94}{ng\_parse\_uint64\_type}}\},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00086}00086         \{\textcolor{stringliteral}{"{}incomplete"{}}, \&\mbox{\hyperlink{ng__parse_8c_a2efc35331c0407f6367763b8bb9fda94}{ng\_parse\_uint64\_type}}\},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00087}00087         \{\textcolor{stringliteral}{"{}histogram"{}}, \&\mbox{\hyperlink{ng__vlan__rotate_8c_a9ce76b0b926337c5975d529c36ae8d36}{ng\_vlanrotate\_stat\_hist}}\},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00088}00088         \{NULL\}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00089}00089 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00090}\mbox{\hyperlink{ng__vlan__rotate_8c_a22b24bd67b29f8e9d734144b8886cc66}{00090}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__vlan__rotate_8c_a22b24bd67b29f8e9d734144b8886cc66}{ng\_vlanrotate\_stat\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00091}00091         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00092}00092         \&\mbox{\hyperlink{ng__vlan__rotate_8c_a91dfd201699600a1c752a985133bd2f2}{ng\_vlanrotate\_stat\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00093}00093 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00096}00096 \textcolor{comment}{/* List of commands and how to convert arguments to/from ASCII */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00097}\mbox{\hyperlink{ng__vlan__rotate_8c_a7385fbd5700924cdebb378f05bf123fb}{00097}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__cmdlist}{ng\_cmdlist}} \mbox{\hyperlink{ng__vlan__rotate_8c_a7385fbd5700924cdebb378f05bf123fb}{ng\_vlanrotate\_cmdlist}}[] = \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00098}00098         \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00099}00099                 \mbox{\hyperlink{ng__vlan__rotate_8h_a1358fc8e78aa25c0acee70cea6a70252}{NGM\_VLANROTATE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00100}00100                 \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a21d438c67b628e0b3a95560630042d65}{NGM\_VLANROTATE\_GET\_CONF}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00101}00101                 \textcolor{stringliteral}{"{}getconf"{}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00102}00102                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00103}00103                 \&\mbox{\hyperlink{ng__vlan__rotate_8c_a90fff93b9d14fcd3e01d4d37bd964b14}{ng\_vlanrotate\_conf\_type}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00104}00104         \},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00105}00105         \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00106}00106                 \mbox{\hyperlink{ng__vlan__rotate_8h_a1358fc8e78aa25c0acee70cea6a70252}{NGM\_VLANROTATE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00107}00107                 \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90ade55809c6dd2c306145efa91ccce59a8}{NGM\_VLANROTATE\_SET\_CONF}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00108}00108                 \textcolor{stringliteral}{"{}setconf"{}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00109}00109                 \&\mbox{\hyperlink{ng__vlan__rotate_8c_a90fff93b9d14fcd3e01d4d37bd964b14}{ng\_vlanrotate\_conf\_type}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00110}00110                 NULL}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00111}00111         \},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00112}00112         \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00113}00113                 \mbox{\hyperlink{ng__vlan__rotate_8h_a1358fc8e78aa25c0acee70cea6a70252}{NGM\_VLANROTATE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00114}00114                 \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a63d65d0a02391f1029fd90434cffe957}{NGM\_VLANROTATE\_GET\_STAT}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00115}00115                 \textcolor{stringliteral}{"{}getstat"{}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00116}00116                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00117}00117                 \&\mbox{\hyperlink{ng__vlan__rotate_8c_a22b24bd67b29f8e9d734144b8886cc66}{ng\_vlanrotate\_stat\_type}}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00118}00118         \},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00119}00119         \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00120}00120                 \mbox{\hyperlink{ng__vlan__rotate_8h_a1358fc8e78aa25c0acee70cea6a70252}{NGM\_VLANROTATE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00121}00121                 \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a7f4166437329b34055eb9826dfc7a9f2}{NGM\_VLANROTATE\_CLR\_STAT}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00122}00122                 \textcolor{stringliteral}{"{}clrstat"{}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00123}00123                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00124}00124                 \&\mbox{\hyperlink{ng__vlan__rotate_8c_a22b24bd67b29f8e9d734144b8886cc66}{ng\_vlanrotate\_stat\_type}}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00125}00125         \},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00126}00126         \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00127}00127                 \mbox{\hyperlink{ng__vlan__rotate_8h_a1358fc8e78aa25c0acee70cea6a70252}{NGM\_VLANROTATE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00128}00128                 \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a76b4e86809355dc1180bee3e540ba947}{NGM\_VLANROTATE\_GETCLR\_STAT}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00129}00129                 \textcolor{stringliteral}{"{}getclrstat"{}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00130}00130                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00131}00131                 \&\mbox{\hyperlink{ng__vlan__rotate_8c_a22b24bd67b29f8e9d734144b8886cc66}{ng\_vlanrotate\_stat\_type}}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00132}00132         \},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00133}00133         \{0\}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00134}00134 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00136}00136 \textcolor{comment}{/* Netgraph node type descriptor */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00137}\mbox{\hyperlink{ng__vlan__rotate_8c_a80a131770518c7fa3758d85054006e7a}{00137}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__type}{ng\_type}} \mbox{\hyperlink{ng__vlan__rotate_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}} = \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00138}00138         .\mbox{\hyperlink{structng__type_adbc1c8884ff0e625c19c4b513262fd0e}{version}} = \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00139}00139         .name = \mbox{\hyperlink{ng__vlan__rotate_8h_ab8b8347bc35d38d4c897b93e814bb17b}{NG\_VLANROTATE\_NODE\_TYPE}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00140}00140         .constructor = \mbox{\hyperlink{ng__vlan__rotate_8c_a0a89d75cbf52d825f399a083220d0a0c}{ng\_vlanrotate\_constructor}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00141}00141         .rcvmsg = \mbox{\hyperlink{ng__vlan__rotate_8c_a1c2f959d5e71ec3ab38dd76c9e8552c7}{ng\_vlanrotate\_rcvmsg}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00142}00142         .shutdown = \mbox{\hyperlink{ng__vlan__rotate_8c_a12910a15d0bdb967de109c5df752737b}{ng\_vlanrotate\_shutdown}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00143}00143         .newhook = \mbox{\hyperlink{ng__vlan__rotate_8c_a80e5eba15b37268f4abb9fd1cce14968}{ng\_vlanrotate\_newhook}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00144}00144         .rcvdata = \mbox{\hyperlink{ng__vlan__rotate_8c_a53d573b84a34d51eab22cc3c20e3b225}{ng\_vlanrotate\_rcvdata}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00145}00145         .disconnect = \mbox{\hyperlink{ng__vlan__rotate_8c_afee9589ccada109b2a1b641e6d518b85}{ng\_vlanrotate\_disconnect}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00146}00146         .cmdlist = \mbox{\hyperlink{ng__vlan__rotate_8c_a7385fbd5700924cdebb378f05bf123fb}{ng\_vlanrotate\_cmdlist}},}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00147}00147 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00148}\mbox{\hyperlink{ng__vlan__rotate_8c_a35f2faed31c68a1597ccb3babab6d697}{00148}} \mbox{\hyperlink{ng__vlan__rotate_8c_a35f2faed31c68a1597ccb3babab6d697}{NETGRAPH\_INIT}}(\mbox{\hyperlink{structvlanrotate}{vlanrotate}}, \&\mbox{\hyperlink{ng__vlan__rotate_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00150}\mbox{\hyperlink{structng__vlanrotate__kernel__stats}{00150}} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__vlanrotate__kernel__stats}{ng\_vlanrotate\_kernel\_stats}} \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00151}\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ace04e61eedc764a8512c6faa608f35b3}{00151}}         counter\_u64\_t   \mbox{\hyperlink{structng__vlanrotate__kernel__stats_ace04e61eedc764a8512c6faa608f35b3}{drops}}, \mbox{\hyperlink{structng__vlanrotate__kernel__stats_a7c63b4696d2af7fa776bbbe3b79b9a16}{excessive}}, \mbox{\hyperlink{structng__vlanrotate__kernel__stats_aab0c6df43e3eef1c66ba7ba7ba689c31}{incomplete}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00152}\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ac31bf52d9e3bb559aa336d074269698a}{00152}}         counter\_u64\_t   \mbox{\hyperlink{structng__vlanrotate__kernel__stats_ac31bf52d9e3bb559aa336d074269698a}{histogram}}[\mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}}];}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00153}00153 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00155}00155 \textcolor{comment}{/* Information we store for each node */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00156}\mbox{\hyperlink{structvlanrotate}{00156}} \textcolor{keyword}{struct }\mbox{\hyperlink{structvlanrotate}{vlanrotate}} \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00157}\mbox{\hyperlink{structvlanrotate_a1d92c5c5dd2652ab4bc4c4ac9aa97b9f}{00157}}         \mbox{\hyperlink{structng__hook}{hook\_p}}            \mbox{\hyperlink{structvlanrotate_a1d92c5c5dd2652ab4bc4c4ac9aa97b9f}{original\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00158}\mbox{\hyperlink{structvlanrotate_a5058d2047748aa8a859ccf0842b46754}{00158}}         \mbox{\hyperlink{structng__hook}{hook\_p}}            \mbox{\hyperlink{structvlanrotate_a5058d2047748aa8a859ccf0842b46754}{ordered\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00159}\mbox{\hyperlink{structvlanrotate_a784c1dc7f48b385c80d98e70f468a8d8}{00159}}         \mbox{\hyperlink{structng__hook}{hook\_p}}            \mbox{\hyperlink{structvlanrotate_a784c1dc7f48b385c80d98e70f468a8d8}{excessive\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00160}\mbox{\hyperlink{structvlanrotate_a60be18e5d6cd8514c8f8147df5e1dc8f}{00160}}         \mbox{\hyperlink{structng__hook}{hook\_p}}            \mbox{\hyperlink{structvlanrotate_a60be18e5d6cd8514c8f8147df5e1dc8f}{incomplete\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00161}\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{00161}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__vlanrotate__conf}{ng\_vlanrotate\_conf}} \mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00162}\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{00162}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__vlanrotate__kernel__stats}{ng\_vlanrotate\_kernel\_stats}} \mbox{\hyperlink{structstats}{stats}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00163}00163 \};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00164}\mbox{\hyperlink{ng__vlan__rotate_8c_a9262ef4001b0a86fe02aa28a4882510c}{00164}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structvlanrotate}{vlanrotate}} *\mbox{\hyperlink{ng__vlan__rotate_8c_a9262ef4001b0a86fe02aa28a4882510c}{vlanrotate\_p}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00166}00166 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00167}00167 \textcolor{comment}{ * Set up the private data structure.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00168}00168 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00169}00169 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00170}\mbox{\hyperlink{ng__vlan__rotate_8c_a01cf6edae4483a4ac00323775b5788d2}{00170}} \mbox{\hyperlink{ng__vlan__rotate_8c_a0a89d75cbf52d825f399a083220d0a0c}{ng\_vlanrotate\_constructor}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00171}00171 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00172}00172         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00174}00174         \mbox{\hyperlink{structvlanrotate}{vlanrotate\_p}} vrp = malloc(\textcolor{keyword}{sizeof}(*vrp), M\_NETGRAPH, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00176}00176         vrp-\/>\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}}.\mbox{\hyperlink{structng__vlanrotate__conf_a00a7844dce6d1355b0a35e49ac8839ff}{max}} = \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00178}00178         vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ace04e61eedc764a8512c6faa608f35b3}{drops}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00179}00179         vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_a7c63b4696d2af7fa776bbbe3b79b9a16}{excessive}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00180}00180         vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_aab0c6df43e3eef1c66ba7ba7ba689c31}{incomplete}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00181}00181         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}}; i++)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00182}00182                 vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ac31bf52d9e3bb559aa336d074269698a}{histogram}}[i] = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00184}00184         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, vrp);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00185}00185         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00186}00186 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00188}00188 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00189}00189 \textcolor{comment}{ * Give our ok for a hook to be added.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00190}00190 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00191}00191 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00192}\mbox{\hyperlink{ng__vlan__rotate_8c_a771874cf1cd9472ad60793beff40a86f}{00192}} \mbox{\hyperlink{ng__vlan__rotate_8c_a80e5eba15b37268f4abb9fd1cce14968}{ng\_vlanrotate\_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__vlan__rotate_8c_source_l00193}00193 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00194}00194         \textcolor{keyword}{const} \mbox{\hyperlink{structvlanrotate}{vlanrotate\_p}} vrp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00195}00195         \mbox{\hyperlink{structng__hook}{hook\_p}} *dst = NULL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00197}00197         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__vlan__rotate_8h_a2d394bb407f38185cf4bca2141b2ec9c}{NG\_VLANROTATE\_HOOK\_ORDERED}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00198}00198                 dst = \&vrp-\/>\mbox{\hyperlink{structvlanrotate_a5058d2047748aa8a859ccf0842b46754}{ordered\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00199}00199         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__vlan__rotate_8h_ad4fc2e6fedf7bb05958bac9ad1224aed}{NG\_VLANROTATE\_HOOK\_ORIGINAL}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00200}00200                 dst = \&vrp-\/>\mbox{\hyperlink{structvlanrotate_a1d92c5c5dd2652ab4bc4c4ac9aa97b9f}{original\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00201}00201         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__vlan__rotate_8h_a4f9486d215dc6c138592c8761ce886b9}{NG\_VLANROTATE\_HOOK\_EXCESSIVE}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00202}00202                 dst = \&vrp-\/>\mbox{\hyperlink{structvlanrotate_a784c1dc7f48b385c80d98e70f468a8d8}{excessive\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00203}00203         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__vlan__rotate_8h_a422dd2838804ccd9c1391b6bd3ded572}{NG\_VLANROTATE\_HOOK\_INCOMPLETE}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00204}00204                 dst = \&vrp-\/>\mbox{\hyperlink{structvlanrotate_a60be18e5d6cd8514c8f8147df5e1dc8f}{incomplete\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00205}00205         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00206}00206                 \textcolor{keywordflow}{return} (EINVAL);        \textcolor{comment}{/* not a hook we know about */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00208}00208         \textcolor{keywordflow}{if} (*dst != NULL)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00209}00209                 \textcolor{keywordflow}{return} (EADDRINUSE);    \textcolor{comment}{/* don't override */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00211}00211         *dst = hook;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00212}00212         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00213}00213 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00215}00215 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00216}00216 \textcolor{comment}{ * Get a netgraph control message.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00217}00217 \textcolor{comment}{ * A response is not required.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00218}00218 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00219}00219 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00220}\mbox{\hyperlink{ng__vlan__rotate_8c_aa7228b29a8c39ca7c571428aad04f653}{00220}} \mbox{\hyperlink{ng__vlan__rotate_8c_a1c2f959d5e71ec3ab38dd76c9e8552c7}{ng\_vlanrotate\_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__vlan__rotate_8c_source_l00221}00221 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00222}00222         \textcolor{keyword}{const} \mbox{\hyperlink{structvlanrotate}{vlanrotate\_p}} vrp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00223}00223         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *resp = NULL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00224}00224         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00225}00225         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__vlanrotate__conf}{ng\_vlanrotate\_conf}} *pcf;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00226}00226         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00228}00228         \mbox{\hyperlink{netgraph_8h_adc9a04fd174ef3c29ecae94016b84839}{NGI\_GET\_MSG}}(item, msg);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00229}00229         \textcolor{comment}{/* Deal with message according to cookie and command */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00230}00230         \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_ab59e14593b69a406ed5ca4209d489a10}{typecookie}}) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00231}00231         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__vlan__rotate_8h_a1358fc8e78aa25c0acee70cea6a70252}{NGM\_VLANROTATE\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00232}00232                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00233}00233                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a21d438c67b628e0b3a95560630042d65}{NGM\_VLANROTATE\_GET\_CONF}}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00234}00234                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \textcolor{keyword}{sizeof}(vrp-\/>\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}}), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00235}00235                         \textcolor{keywordflow}{if} (!resp) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00236}00236                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00237}00237                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00238}00238                         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00239}00239                         *((\textcolor{keyword}{struct }\mbox{\hyperlink{structng__vlanrotate__conf}{ng\_vlanrotate\_conf}} *)resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}) = vrp-\/>\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00240}00240                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00241}00241                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90ade55809c6dd2c306145efa91ccce59a8}{NGM\_VLANROTATE\_SET\_CONF}}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00242}00242                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != \textcolor{keyword}{sizeof}(*pcf)) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00243}00243                                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00244}00244                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00245}00245                         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00247}00247                         pcf = (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__vlanrotate__conf}{ng\_vlanrotate\_conf}} *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00249}00249                         if (pcf-\/>\mbox{\hyperlink{structng__vlanrotate__conf_a00a7844dce6d1355b0a35e49ac8839ff}{max}} == 0)   \textcolor{comment}{/* keep current value */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00250}00250                                 pcf-\/>\mbox{\hyperlink{structng__vlanrotate__conf_a00a7844dce6d1355b0a35e49ac8839ff}{max}} = vrp-\/>\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}}.\mbox{\hyperlink{structng__vlanrotate__conf_a00a7844dce6d1355b0a35e49ac8839ff}{max}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00252}00252                         \textcolor{keywordflow}{if} ((pcf-\/>\mbox{\hyperlink{structng__vlanrotate__conf_a00a7844dce6d1355b0a35e49ac8839ff}{max}} > \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}}) ||}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00253}00253                             (pcf-\/>\mbox{\hyperlink{structng__vlanrotate__conf_a4fdd9ea7ce6544901e25604fd5659ffe}{min}} > pcf-\/>\mbox{\hyperlink{structng__vlanrotate__conf_a00a7844dce6d1355b0a35e49ac8839ff}{max}}) ||}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00254}00254                             (abs(pcf-\/>\mbox{\hyperlink{structng__vlanrotate__conf_a7ebc3fac8ef3513c3d8ad6d7f2b14d5e}{rot}}) >= pcf-\/>\mbox{\hyperlink{structng__vlanrotate__conf_a00a7844dce6d1355b0a35e49ac8839ff}{max}})) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00255}00255                                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00256}00256                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00257}00257                         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00259}00259                         vrp-\/>\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}} = *pcf;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00260}00260                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00261}00261                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a63d65d0a02391f1029fd90434cffe957}{NGM\_VLANROTATE\_GET\_STAT}}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00262}00262                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a76b4e86809355dc1180bee3e540ba947}{NGM\_VLANROTATE\_GETCLR\_STAT}}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00263}00263                 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00264}00264                         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__vlanrotate__stat}{ng\_vlanrotate\_stat}} *p;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00265}00265                         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00267}00267                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \textcolor{keyword}{sizeof}(*p), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00268}00268                         \textcolor{keywordflow}{if} (!resp) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00269}00269                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00270}00270                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00271}00271                         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00272}00272                         p = (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__vlanrotate__stat}{ng\_vlanrotate\_stat}} *)resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00273}00273                         p-\/>\mbox{\hyperlink{structng__vlanrotate__stat_abe208943bd9c2552ea94c0b11fc4c1ba}{drops}} = counter\_u64\_fetch(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ace04e61eedc764a8512c6faa608f35b3}{drops}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00274}00274                         p-\/>\mbox{\hyperlink{structng__vlanrotate__stat_a8af9e34389b5c1d7f889c9d6c3ac228b}{excessive}} = counter\_u64\_fetch(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_a7c63b4696d2af7fa776bbbe3b79b9a16}{excessive}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00275}00275                         p-\/>\mbox{\hyperlink{structng__vlanrotate__stat_a3845b00a20a59efa781d526ebe1278f1}{incomplete}} = counter\_u64\_fetch(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_aab0c6df43e3eef1c66ba7ba7ba689c31}{incomplete}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00276}00276                         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}}; i++)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00277}00277                                 p-\/>\mbox{\hyperlink{structng__vlanrotate__stat_acc9b7bc56d1bdfc909af6b4bc10278c9}{histogram}}[i] = counter\_u64\_fetch(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ac31bf52d9e3bb559aa336d074269698a}{histogram}}[i]);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00278}00278                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} != \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a76b4e86809355dc1180bee3e540ba947}{NGM\_VLANROTATE\_GETCLR\_STAT}})}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00279}00279                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00280}00280                 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00281}00281                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__vlan__rotate_8h_a68c01102755fc7d1c810bb0b0635fa90a7f4166437329b34055eb9826dfc7a9f2}{NGM\_VLANROTATE\_CLR\_STAT}}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00282}00282                 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00283}00283                         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00285}00285                         counter\_u64\_zero(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ace04e61eedc764a8512c6faa608f35b3}{drops}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00286}00286                         counter\_u64\_zero(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_a7c63b4696d2af7fa776bbbe3b79b9a16}{excessive}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00287}00287                         counter\_u64\_zero(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_aab0c6df43e3eef1c66ba7ba7ba689c31}{incomplete}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00288}00288                         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}}; i++)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00289}00289                                 counter\_u64\_zero(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ac31bf52d9e3bb559aa336d074269698a}{histogram}}[i]);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00290}00290                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00291}00291                 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00292}00292                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00293}00293                         error = EINVAL; \textcolor{comment}{/* unknown command */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00294}00294                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00295}00295                 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00296}00296                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00297}00297         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00298}00298                 error = EINVAL; \textcolor{comment}{/* unknown cookie type */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00299}00299                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00300}00300         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00301}00301 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00302}00302         \textcolor{comment}{/* Take care of synchronous response, if any */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00303}00303         \mbox{\hyperlink{netgraph_8h_a69db50ed7f968e936580df029ab5c5dc}{NG\_RESPOND\_MSG}}(error, node, item, resp);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00304}00304         \textcolor{comment}{/* Free the message and return */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00305}00305         \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00306}00306         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00307}00307 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00308}00308 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00309}00309 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00310}00310 \textcolor{comment}{ * Receive data, and do rotate the vlans as desired.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00311}00311 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00312}00312 \textcolor{comment}{ * Rotating is quite complicated if the rotation offset and the number}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00313}00313 \textcolor{comment}{ * of vlans are not relativly prime. In this case multiple slices need}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00314}00314 \textcolor{comment}{ * to be rotated separately.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00315}00315 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00316}00316 \textcolor{comment}{ * Rotation can be additive or subtractive. Some examples:}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00317}00317 \textcolor{comment}{ *  01234   5 vlans given}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00318}00318 \textcolor{comment}{ *  -\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00319}00319 \textcolor{comment}{ *  34012  +2 rotate}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00320}00320 \textcolor{comment}{ *  12340  +4 rotate}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00321}00321 \textcolor{comment}{ *  12340  -\/1 rotate}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00322}00322 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00323}00323 \textcolor{comment}{ * First some helper functions ...}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00324}00324 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00325}00325 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00326}\mbox{\hyperlink{structether__vlan__stack__entry}{00326}} \textcolor{keyword}{struct }\mbox{\hyperlink{structether__vlan__stack__entry}{ether\_vlan\_stack\_entry}} \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00327}\mbox{\hyperlink{structether__vlan__stack__entry_af6fcbf324e03ad57a0503da58f885b49}{00327}}         uint16\_t        \mbox{\hyperlink{structether__vlan__stack__entry_af6fcbf324e03ad57a0503da58f885b49}{proto}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00328}\mbox{\hyperlink{structether__vlan__stack__entry_ab9f386655332478046b42db176c245e5}{00328}}         uint16\_t        \mbox{\hyperlink{structether__vlan__stack__entry_ab9f386655332478046b42db176c245e5}{tag}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00329}\mbox{\hyperlink{ng__vlan__rotate_8c_a1560ce29ccb13330fd78e854ec096aec}{00329}} \}               \mbox{\hyperlink{ng__vlan__rotate_8c_a1560ce29ccb13330fd78e854ec096aec}{\_\_packed}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00331}\mbox{\hyperlink{structether__vlan__stack__header}{00331}} \textcolor{keyword}{struct }\mbox{\hyperlink{structether__vlan__stack__header}{ether\_vlan\_stack\_header}} \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00332}\mbox{\hyperlink{structether__vlan__stack__header_a1da0b4444e54ceb67f79d4dd9f01fd1a}{00332}}         uint8\_t         \mbox{\hyperlink{structether__vlan__stack__header_a1da0b4444e54ceb67f79d4dd9f01fd1a}{dst}}[ETHER\_ADDR\_LEN];}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00333}\mbox{\hyperlink{structether__vlan__stack__header_a6ddd558002f049c78e32531a84d598e6}{00333}}         uint8\_t         \mbox{\hyperlink{structether__vlan__stack__header_a6ddd558002f049c78e32531a84d598e6}{src}}[ETHER\_ADDR\_LEN];}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00334}\mbox{\hyperlink{structether__vlan__stack__header_a40032cb840fe8f8e051cc3436e160861}{00334}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structether__vlan__stack__entry}{ether\_vlan\_stack\_entry}} \mbox{\hyperlink{structether__vlan__stack__header_a40032cb840fe8f8e051cc3436e160861}{vlan\_stack}}[1];}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00335}00335 \}               \mbox{\hyperlink{ng__vlan__rotate_8c_a1560ce29ccb13330fd78e854ec096aec}{\_\_packed}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00337}00337 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00338}\mbox{\hyperlink{ng__vlan__rotate_8c_a598686ac333cb7aba78084878eb94087}{00338}} \mbox{\hyperlink{ng__vlan__rotate_8c_a598686ac333cb7aba78084878eb94087}{ng\_vlanrotate\_gcd}}(\textcolor{keywordtype}{int} a, \textcolor{keywordtype}{int} b)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00339}00339 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00340}00340         \textcolor{keywordflow}{if} (b == 0)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00341}00341                 \textcolor{keywordflow}{return} a;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00342}00342         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00343}00343                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ng__vlan__rotate_8c_a598686ac333cb7aba78084878eb94087}{ng\_vlanrotate\_gcd}}(b, a \% b);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00344}00344 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00346}00346 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00347}\mbox{\hyperlink{ng__vlan__rotate_8c_a7e2c879a8a3614a5a11cf383182fdf60}{00347}} \mbox{\hyperlink{ng__vlan__rotate_8c_a7e2c879a8a3614a5a11cf383182fdf60}{ng\_vlanrotate\_rotate}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structether__vlan__stack__entry}{ether\_vlan\_stack\_entry}} arr[], \textcolor{keywordtype}{int} d, \textcolor{keywordtype}{int} n)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00348}00348 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00349}00349         \textcolor{keywordtype}{int}             i, j, k;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00350}00350         \textcolor{keyword}{struct }\mbox{\hyperlink{structether__vlan__stack__entry}{ether\_vlan\_stack\_entry}} temp;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00351}00351 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00352}00352         \textcolor{comment}{/* for each commensurable slice */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00353}00353         \textcolor{keywordflow}{for} (i = \mbox{\hyperlink{ng__vlan__rotate_8c_a598686ac333cb7aba78084878eb94087}{ng\_vlanrotate\_gcd}}(d, n); i-\/-\/ > 0;) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00354}00354                 \textcolor{comment}{/* rotate left aka downwards */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00355}00355                 temp = arr[i];}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00356}00356                 j = i;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00357}00357 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00358}00358                 \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00359}00359                         k = j + d;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00360}00360                         \textcolor{keywordflow}{if} (k >= n)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00361}00361                                 k = k -\/ n;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00362}00362                         \textcolor{keywordflow}{if} (k == i)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00363}00363                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00364}00364                         arr[j] = arr[k];}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00365}00365                         j = k;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00366}00366                 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00368}00368                 arr[j] = temp;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00369}00369         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00370}00370 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00371}00371 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00372}00372 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00373}\mbox{\hyperlink{ng__vlan__rotate_8c_a43f6c966e2c46a605200d6452ca7bc59}{00373}} \mbox{\hyperlink{ng__vlan__rotate_8c_a53d573b84a34d51eab22cc3c20e3b225}{ng\_vlanrotate\_rcvdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00374}00374 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00375}00375         \textcolor{keyword}{const} \mbox{\hyperlink{structvlanrotate}{vlanrotate\_p}} vrp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00376}00376         \textcolor{keyword}{struct }\mbox{\hyperlink{structether__vlan__stack__header}{ether\_vlan\_stack\_header}} *evsh;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00377}00377         \textcolor{keyword}{struct }mbuf *m = NULL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00378}00378         \mbox{\hyperlink{structng__hook}{hook\_p}}    dst\_hook;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00379}00379         int8\_t  rotate;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00380}00380         int8\_t  vlans = 0;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00381}00381         \textcolor{keywordtype}{int}     error = ENOSYS;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00383}00383         \mbox{\hyperlink{netgraph_8h_abbb0acb5f480576cff9901caddeef57f}{NGI\_GET\_M}}(item, m);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00384}00384 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00385}00385         \textcolor{keywordflow}{if} (hook == vrp-\/>\mbox{\hyperlink{structvlanrotate_a5058d2047748aa8a859ccf0842b46754}{ordered\_hook}}) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00386}00386                 rotate = +vrp-\/>\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}}.\mbox{\hyperlink{structng__vlanrotate__conf_a7ebc3fac8ef3513c3d8ad6d7f2b14d5e}{rot}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00387}00387                 dst\_hook = vrp-\/>\mbox{\hyperlink{structvlanrotate_a1d92c5c5dd2652ab4bc4c4ac9aa97b9f}{original\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00388}00388         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (hook == vrp-\/>\mbox{\hyperlink{structvlanrotate_a1d92c5c5dd2652ab4bc4c4ac9aa97b9f}{original\_hook}}) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00389}00389                 rotate = -\/vrp-\/>\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}}.\mbox{\hyperlink{structng__vlanrotate__conf_a7ebc3fac8ef3513c3d8ad6d7f2b14d5e}{rot}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00390}00390                 dst\_hook = vrp-\/>\mbox{\hyperlink{structvlanrotate_a5058d2047748aa8a859ccf0842b46754}{ordered\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00391}00391         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00392}00392                 dst\_hook = vrp-\/>\mbox{\hyperlink{structvlanrotate_a1d92c5c5dd2652ab4bc4c4ac9aa97b9f}{original\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00393}00393                 \textcolor{keywordflow}{goto} send;      \textcolor{comment}{/* everything else goes out unmodified */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00394}00394         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00395}00395 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00396}00396         \textcolor{keywordflow}{if} (dst\_hook == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00397}00397                 error = ENETDOWN;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00398}00398                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00399}00399         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00400}00400 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00401}00401         \textcolor{comment}{/* count the vlans */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00402}00402         \textcolor{keywordflow}{for} (vlans = 0; vlans <= \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}}; vlans++) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00403}00403                 \textcolor{keywordtype}{size\_t} expected\_len = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structether__vlan__stack__header}{ether\_vlan\_stack\_header}})}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00404}00404                     + vlans * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structether__vlan__stack__entry}{ether\_vlan\_stack\_entry}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00405}00405 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00406}00406                 \textcolor{keywordflow}{if} (m-\/>m\_len < expected\_len) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00407}00407                         m = m\_pullup(m, expected\_len);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00408}00408                         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00409}00409                                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00410}00410                                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00411}00411                         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00412}00412                 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00413}00413 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00414}00414                 evsh = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structether__vlan__stack__header}{ether\_vlan\_stack\_header}} *);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00415}00415                 \textcolor{keywordflow}{switch} (ntohs(evsh-\/>\mbox{\hyperlink{structether__vlan__stack__header_a40032cb840fe8f8e051cc3436e160861}{vlan\_stack}}[vlans].\mbox{\hyperlink{structether__vlan__stack__entry_af6fcbf324e03ad57a0503da58f885b49}{proto}})) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00416}00416                 \textcolor{keywordflow}{case} ETHERTYPE\_VLAN:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00417}00417                 \textcolor{keywordflow}{case} ETHERTYPE\_QINQ:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00418}00418                 \textcolor{keywordflow}{case} ETHERTYPE\_8021Q9100:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00419}00419                 \textcolor{keywordflow}{case} ETHERTYPE\_8021Q9200:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00420}00420                 \textcolor{keywordflow}{case} ETHERTYPE\_8021Q9300:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00421}00421                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00422}00422                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00423}00423                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00424}00424                 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00425}00425         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00426}00426 out:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00427}00427         \textcolor{keywordflow}{if} ((vlans > vrp-\/>\mbox{\hyperlink{structvlanrotate_a2134c6e48c01678e08eea31a9c29ad6d}{conf}}.\mbox{\hyperlink{structng__vlanrotate__conf_a00a7844dce6d1355b0a35e49ac8839ff}{max}}) || (vlans >= \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}})) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00428}00428                 counter\_u64\_add(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_a7c63b4696d2af7fa776bbbe3b79b9a16}{excessive}}, 1);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00429}00429                 dst\_hook = vrp-\/>\mbox{\hyperlink{structvlanrotate_a784c1dc7f48b385c80d98e70f468a8d8}{excessive\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00430}00430                 \textcolor{keywordflow}{goto} send;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00431}00431         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00432}00432 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00433}00433         \textcolor{keywordflow}{if} ((vlans < vrp-\/>conf.min) || (vlans <= abs(rotate))) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00434}00434                 counter\_u64\_add(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_aab0c6df43e3eef1c66ba7ba7ba689c31}{incomplete}}, 1);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00435}00435                 dst\_hook = vrp-\/>\mbox{\hyperlink{structvlanrotate_a60be18e5d6cd8514c8f8147df5e1dc8f}{incomplete\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00436}00436                 \textcolor{keywordflow}{goto} send;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00437}00437         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00438}00438         counter\_u64\_add(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ac31bf52d9e3bb559aa336d074269698a}{histogram}}[vlans], 1);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00440}00440         \textcolor{comment}{/* rotating upwards always (using modular arithmetics) */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00441}00441         \textcolor{keywordflow}{if} (rotate == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00442}00442                 \textcolor{comment}{/* nothing to do */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00443}00443         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (rotate > 0) \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00444}00444                 \mbox{\hyperlink{ng__vlan__rotate_8c_a7e2c879a8a3614a5a11cf383182fdf60}{ng\_vlanrotate\_rotate}}(evsh-\/>\mbox{\hyperlink{structether__vlan__stack__header_a40032cb840fe8f8e051cc3436e160861}{vlan\_stack}}, rotate, vlans);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00445}00445         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00446}00446                 \mbox{\hyperlink{ng__vlan__rotate_8c_a7e2c879a8a3614a5a11cf383182fdf60}{ng\_vlanrotate\_rotate}}(evsh-\/>\mbox{\hyperlink{structether__vlan__stack__header_a40032cb840fe8f8e051cc3436e160861}{vlan\_stack}}, vlans + rotate, vlans);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00447}00447         \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00449}00449 send:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00450}00450         \textcolor{keywordflow}{if} (dst\_hook == NULL)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00451}00451                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00452}00452         \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, dst\_hook, m);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00453}00453         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00454}00454 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00455}00455 fail:}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00456}00456         counter\_u64\_add(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ace04e61eedc764a8512c6faa608f35b3}{drops}}, 1);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00457}00457         \textcolor{keywordflow}{if} (m != NULL)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00458}00458                 m\_freem(m);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00459}00459         \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00460}00460         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00461}00461 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00462}00462 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00463}00463 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00464}00464 \textcolor{comment}{ * Do local shutdown processing..}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00465}00465 \textcolor{comment}{ * All our links and the name have already been removed.}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00466}00466 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00467}00467 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00468}\mbox{\hyperlink{ng__vlan__rotate_8c_a713a621d67f553b8468bde60ef80d9a9}{00468}} \mbox{\hyperlink{ng__vlan__rotate_8c_a12910a15d0bdb967de109c5df752737b}{ng\_vlanrotate\_shutdown}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00469}00469 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00470}00470         \textcolor{keyword}{const}           \mbox{\hyperlink{structvlanrotate}{vlanrotate\_p}} vrp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00471}00471         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00472}00472 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00473}00473         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, NULL);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00474}00474 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00475}00475         counter\_u64\_free(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ace04e61eedc764a8512c6faa608f35b3}{drops}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00476}00476         counter\_u64\_free(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_a7c63b4696d2af7fa776bbbe3b79b9a16}{excessive}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00477}00477         counter\_u64\_free(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_aab0c6df43e3eef1c66ba7ba7ba689c31}{incomplete}});}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00478}00478         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ng__vlan__rotate_8h_a7b21f3a58d13aa24d3da61229ba03b0d}{NG\_VLANROTATE\_MAX\_VLANS}}; i++)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00479}00479                 counter\_u64\_free(vrp-\/>\mbox{\hyperlink{structvlanrotate_a141caa9874d33ea1f2f6f7ba480c4f1e}{stats}}.\mbox{\hyperlink{structng__vlanrotate__kernel__stats_ac31bf52d9e3bb559aa336d074269698a}{histogram}}[i]);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00481}00481         free(vrp, M\_NETGRAPH);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00483}00483         \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(node);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00484}00484         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00485}00485 \}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00487}00487 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00488}00488 \textcolor{comment}{ * Hook disconnection}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00489}00489 \textcolor{comment}{ * For this type, removal of the last link destroys the node}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00490}00490 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00491}00491 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00492}\mbox{\hyperlink{ng__vlan__rotate_8c_ae2d4032772422732c6224cd9bd79f079}{00492}} \mbox{\hyperlink{ng__vlan__rotate_8c_afee9589ccada109b2a1b641e6d518b85}{ng\_vlanrotate\_disconnect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00493}00493 \{}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00494}00494         \textcolor{keyword}{const}           \mbox{\hyperlink{structvlanrotate}{vlanrotate\_p}} vrp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00496}00496         \textcolor{keywordflow}{if} (vrp-\/>\mbox{\hyperlink{structvlanrotate_a1d92c5c5dd2652ab4bc4c4ac9aa97b9f}{original\_hook}} == hook)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00497}00497                 vrp-\/>\mbox{\hyperlink{structvlanrotate_a1d92c5c5dd2652ab4bc4c4ac9aa97b9f}{original\_hook}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00498}00498         \textcolor{keywordflow}{if} (vrp-\/>\mbox{\hyperlink{structvlanrotate_a5058d2047748aa8a859ccf0842b46754}{ordered\_hook}} == hook)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00499}00499                 vrp-\/>\mbox{\hyperlink{structvlanrotate_a5058d2047748aa8a859ccf0842b46754}{ordered\_hook}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00500}00500         \textcolor{keywordflow}{if} (vrp-\/>\mbox{\hyperlink{structvlanrotate_a784c1dc7f48b385c80d98e70f468a8d8}{excessive\_hook}} == hook)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00501}00501                 vrp-\/>\mbox{\hyperlink{structvlanrotate_a784c1dc7f48b385c80d98e70f468a8d8}{excessive\_hook}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00502}00502         \textcolor{keywordflow}{if} (vrp-\/>\mbox{\hyperlink{structvlanrotate_a60be18e5d6cd8514c8f8147df5e1dc8f}{incomplete\_hook}} == hook)}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00503}00503                 vrp-\/>\mbox{\hyperlink{structvlanrotate_a60be18e5d6cd8514c8f8147df5e1dc8f}{incomplete\_hook}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00505}00505         \textcolor{comment}{/* during shutdown the node is invalid, don't shutdown twice */}}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00506}00506         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{netgraph_8h_ad47e204c5b3adaddfa4bf0c380234f48}{NG\_NODE\_NUMHOOKS}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook)) == 0) \&\&}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00507}00507             (\mbox{\hyperlink{netgraph_8h_a6bdd56e0f33084eeaadbe696febcbbd8}{NG\_NODE\_IS\_VALID}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook))))}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00508}00508                 \mbox{\hyperlink{netgraph_8h_a85914ce0da2b314478aaf7efcdcd3ff0}{ng\_rmnode\_self}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00509}00509         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__vlan__rotate_8c_source_l00510}00510 \}}

\end{DoxyCode}
