\hypertarget{ng__pppoe_8c_source}{}\doxysection{ng\+\_\+pppoe.\+c}
\label{ng__pppoe_8c_source}\index{netgraph/ng\_pppoe.c@{netgraph/ng\_pppoe.c}}
\mbox{\hyperlink{ng__pppoe_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00002}00002 \textcolor{comment}{ * ng\_pppoe.c}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00003}00003 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00004}00004 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00005}00005 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 1996-\/1999 Whistle Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00007}00007 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00008}00008 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00009}00009 \textcolor{comment}{ * Subject to the following obligations and disclaimer of warranty, use and}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00010}00010 \textcolor{comment}{ * redistribution of this software, in source or object code forms, with or}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00011}00011 \textcolor{comment}{ * without modifications are expressly permitted by Whistle Communications;}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00012}00012 \textcolor{comment}{ * provided, however, that:}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00013}00013 \textcolor{comment}{ * 1. Any and all reproductions of the source or object code must include the}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00014}00014 \textcolor{comment}{ *    copyright notice above and the following disclaimer of warranties; and}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00015}00015 \textcolor{comment}{ * 2. No rights are granted, in any manner or form, to use Whistle}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00016}00016 \textcolor{comment}{ *    Communications, Inc. trademarks, including the mark "{}WHISTLE}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00017}00017 \textcolor{comment}{ *    COMMUNICATIONS"{} on advertising, endorsements, or otherwise except as}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00018}00018 \textcolor{comment}{ *    such appears in the above copyright notice or in the software.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00019}00019 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "{}AS IS"{}, AND}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00021}00021 \textcolor{comment}{ * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00022}00022 \textcolor{comment}{ * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00023}00023 \textcolor{comment}{ * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00024}00024 \textcolor{comment}{ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-\/INFRINGEMENT.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00025}00025 \textcolor{comment}{ * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00026}00026 \textcolor{comment}{ * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00027}00027 \textcolor{comment}{ * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00028}00028 \textcolor{comment}{ * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00029}00029 \textcolor{comment}{ * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00030}00030 \textcolor{comment}{ * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00031}00031 \textcolor{comment}{ * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00032}00032 \textcolor{comment}{ * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00033}00033 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00034}00034 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00035}00035 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00036}00036 \textcolor{comment}{ * OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00037}00037 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00038}00038 \textcolor{comment}{ * Author: Julian Elischer <julian@freebsd.org>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00039}00039 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00040}00040 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00041}00041 \textcolor{comment}{ * \$Whistle: ng\_pppoe.c,v 1.10 1999/11/01 09:24:52 julian Exp \$}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00042}00042 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/ktr.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/epoch.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/syslog.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__message_8h}{netgraph/ng\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{netgraph_8h}{netgraph/netgraph.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__parse_8h}{netgraph/ng\_parse.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__pppoe_8h}{netgraph/ng\_pppoe.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__ether_8h}{netgraph/ng\_ether.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00061}00061 \textcolor{preprocessor}{\#ifdef NG\_SEPARATE\_MALLOC}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00062}00062 \textcolor{keyword}{static} \mbox{\hyperlink{ng__ccatm_8c_ae738595abd0b2c23262b81953927d5f8}{MALLOC\_DEFINE}}(\mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}}, \textcolor{stringliteral}{"{}netgraph\_pppoe"{}}, \textcolor{stringliteral}{"{}netgraph pppoe node"{}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00063}00063 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00064}\mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{00064}} \textcolor{preprocessor}{\#define M\_NETGRAPH\_PPPOE M\_NETGRAPH}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00065}00065 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00067}\mbox{\hyperlink{ng__pppoe_8c_ab373896d3e3a4b3ee1529d383f0d8b52}{00067}} \textcolor{preprocessor}{\#define SIGNOFF "{}session closed"{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00069}00069 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00070}00070 \textcolor{comment}{ * This section contains the netgraph method declarations for the}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00071}00071 \textcolor{comment}{ * pppoe node. These methods define the netgraph pppoe 'type'.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00072}00072 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00074}\mbox{\hyperlink{ng__pppoe_8c_a45520b43464686d4195590a6960d0b26}{00074}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_abb75b9ed2849e15851d6402d2ab5b899}{ng\_constructor\_t}} \mbox{\hyperlink{ng__pppoe_8c_a45520b43464686d4195590a6960d0b26}{ng\_pppoe\_constructor}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00075}\mbox{\hyperlink{ng__pppoe_8c_a931dd604605a484a03964486f3a4843b}{00075}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a47b860e2900386e775707cc1ae661162}{ng\_rcvmsg\_t}}   \mbox{\hyperlink{ng__pppoe_8c_a931dd604605a484a03964486f3a4843b}{ng\_pppoe\_rcvmsg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00076}\mbox{\hyperlink{ng__pppoe_8c_a1b6c594ed921d408eda25deae94cbff1}{00076}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aab0a679789a1af312a7f856b4668ad74}{ng\_shutdown\_t}}       \mbox{\hyperlink{ng__pppoe_8c_a1b6c594ed921d408eda25deae94cbff1}{ng\_pppoe\_shutdown}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00077}\mbox{\hyperlink{ng__pppoe_8c_ab1803be9184b76f7bccea84a9d9cd074}{00077}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_afa50639df4ed6eb400f8220a890d56e6}{ng\_newhook\_t}} \mbox{\hyperlink{ng__pppoe_8c_ab1803be9184b76f7bccea84a9d9cd074}{ng\_pppoe\_newhook}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00078}\mbox{\hyperlink{ng__pppoe_8c_a13bb93dbe4614823975689a8a0d41e16}{00078}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a0e4a4a62e48409635e5f33c548baaea7}{ng\_connect\_t}} \mbox{\hyperlink{ng__pppoe_8c_a13bb93dbe4614823975689a8a0d41e16}{ng\_pppoe\_connect}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00079}\mbox{\hyperlink{ng__pppoe_8c_abb6de585a7d3e76319b91f2592a564c1}{00079}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}} \mbox{\hyperlink{ng__pppoe_8c_abb6de585a7d3e76319b91f2592a564c1}{ng\_pppoe\_rcvdata}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00080}\mbox{\hyperlink{ng__pppoe_8c_a2ec731436c8c8dbf88c8b6a4856304f9}{00080}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}} \mbox{\hyperlink{ng__pppoe_8c_a2ec731436c8c8dbf88c8b6a4856304f9}{ng\_pppoe\_rcvdata\_ether}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00081}\mbox{\hyperlink{ng__pppoe_8c_afb2e20d22dc3910b5c294b7c838edfd9}{00081}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}} \mbox{\hyperlink{ng__pppoe_8c_afb2e20d22dc3910b5c294b7c838edfd9}{ng\_pppoe\_rcvdata\_debug}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00082}\mbox{\hyperlink{ng__pppoe_8c_a40a2ff206785a0531aa48d792e41bece}{00082}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a669e1783335f933b4a4f90f17d22f381}{ng\_disconnect\_t}}   \mbox{\hyperlink{ng__pppoe_8c_a40a2ff206785a0531aa48d792e41bece}{ng\_pppoe\_disconnect}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00084}00084 \textcolor{comment}{/* Parse type for struct ngpppoe\_init\_data */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00085}\mbox{\hyperlink{ng__pppoe_8c_a9c4ef16ef1186c92484f11c797e15a6a}{00085}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__pppoe_8c_a9c4ef16ef1186c92484f11c797e15a6a}{ngpppoe\_init\_data\_type\_fields}}[]}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00086}00086         = \mbox{\hyperlink{ng__pppoe_8h_a7824063685cf7dc200853d4cd22f00c3}{NG\_PPPOE\_INIT\_DATA\_TYPE\_INFO}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00087}\mbox{\hyperlink{ng__pppoe_8c_a136149e0410a240344867a7d965062e8}{00087}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__pppoe_8c_a136149e0410a240344867a7d965062e8}{ngpppoe\_init\_data\_state\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00088}00088         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00089}00089         \&\mbox{\hyperlink{ng__pppoe_8c_a9c4ef16ef1186c92484f11c797e15a6a}{ngpppoe\_init\_data\_type\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00090}00090 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00091}00091 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00092}00092 \textcolor{comment}{/* Parse type for struct ngpppoe\_sts */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00093}\mbox{\hyperlink{ng__pppoe_8c_a8bd23917e1663ec5355e273b8118ff8d}{00093}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}} \mbox{\hyperlink{ng__pppoe_8c_a8bd23917e1663ec5355e273b8118ff8d}{ng\_pppoe\_sts\_type\_fields}}[]}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00094}00094         = \mbox{\hyperlink{ng__pppoe_8h_a25c0c73688f3c5d54c7c7842e1829a63}{NG\_PPPOE\_STS\_TYPE\_INFO}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00095}\mbox{\hyperlink{ng__pppoe_8c_a8da420bc106672b51212262842458a3d}{00095}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}} \mbox{\hyperlink{ng__pppoe_8c_a8da420bc106672b51212262842458a3d}{ng\_pppoe\_sts\_state\_type}} = \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00096}00096         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00097}00097         \&\mbox{\hyperlink{ng__pppoe_8c_a8bd23917e1663ec5355e273b8118ff8d}{ng\_pppoe\_sts\_type\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00098}00098 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00100}00100 \textcolor{comment}{/* List of commands and how to convert arguments to/from ASCII */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00101}\mbox{\hyperlink{ng__pppoe_8c_a26d46fcb50270149b8fee54aadbf5a20}{00101}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__cmdlist}{ng\_cmdlist}} \mbox{\hyperlink{ng__pppoe_8c_a26d46fcb50270149b8fee54aadbf5a20}{ng\_pppoe\_cmds}}[] = \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00102}00102         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00103}00103           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00104}00104           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a5de3a72ede166fe167268f1ac27f9872}{NGM\_PPPOE\_CONNECT}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00105}00105           \textcolor{stringliteral}{"{}pppoe\_connect"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00106}00106           \&\mbox{\hyperlink{ng__pppoe_8c_a136149e0410a240344867a7d965062e8}{ngpppoe\_init\_data\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00107}00107           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00108}00108         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00109}00109         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00110}00110           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00111}00111           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3abe5e14709c69363de21505e396d60da6}{NGM\_PPPOE\_LISTEN}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00112}00112           \textcolor{stringliteral}{"{}pppoe\_listen"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00113}00113           \&\mbox{\hyperlink{ng__pppoe_8c_a136149e0410a240344867a7d965062e8}{ngpppoe\_init\_data\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00114}00114           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00115}00115         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00116}00116         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00117}00117           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00118}00118           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3aa1a4d5b0ac6d938146ae6560ae027680}{NGM\_PPPOE\_OFFER}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00119}00119           \textcolor{stringliteral}{"{}pppoe\_offer"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00120}00120           \&\mbox{\hyperlink{ng__pppoe_8c_a136149e0410a240344867a7d965062e8}{ngpppoe\_init\_data\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00121}00121           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00122}00122         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00123}00123         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00124}00124           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00125}00125           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a0a336c1715f2c1ac0312df74971ef269}{NGM\_PPPOE\_SERVICE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00126}00126           \textcolor{stringliteral}{"{}pppoe\_service"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00127}00127           \&\mbox{\hyperlink{ng__pppoe_8c_a136149e0410a240344867a7d965062e8}{ngpppoe\_init\_data\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00128}00128           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00129}00129         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00130}00130         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00131}00131           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00132}00132           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a94d21f7972fff6b665f37ec8b5fa9088}{NGM\_PPPOE\_SUCCESS}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00133}00133           \textcolor{stringliteral}{"{}pppoe\_success"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00134}00134           \&\mbox{\hyperlink{ng__pppoe_8c_a8da420bc106672b51212262842458a3d}{ng\_pppoe\_sts\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00135}00135           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00136}00136         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00137}00137         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00138}00138           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00139}00139           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3ab01ed56b01705a3f7ed354b2f6bd7959}{NGM\_PPPOE\_FAIL}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00140}00140           \textcolor{stringliteral}{"{}pppoe\_fail"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00141}00141           \&\mbox{\hyperlink{ng__pppoe_8c_a8da420bc106672b51212262842458a3d}{ng\_pppoe\_sts\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00142}00142           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00143}00143         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00144}00144         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00145}00145           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00146}00146           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3aafe9f964ecc0aa36b5ae644d4c6e9209}{NGM\_PPPOE\_CLOSE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00147}00147           \textcolor{stringliteral}{"{}pppoe\_close"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00148}00148           \&\mbox{\hyperlink{ng__pppoe_8c_a8da420bc106672b51212262842458a3d}{ng\_pppoe\_sts\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00149}00149           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00150}00150         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00151}00151         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00152}00152           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00153}00153           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a799551edd84cd037841b08fcc50d333b}{NGM\_PPPOE\_SETMODE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00154}00154           \textcolor{stringliteral}{"{}pppoe\_setmode"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00155}00155           \&\mbox{\hyperlink{ng__parse_8c_aa4b5bfd2c5af56c9fc6806de550a581a}{ng\_parse\_string\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00156}00156           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00157}00157         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00158}00158         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00159}00159           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00160}00160           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a94ea489afa001a5915672145f7e756f7}{NGM\_PPPOE\_GETMODE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00161}00161           \textcolor{stringliteral}{"{}pppoe\_getmode"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00162}00162           NULL,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00163}00163           \&\mbox{\hyperlink{ng__parse_8c_aa4b5bfd2c5af56c9fc6806de550a581a}{ng\_parse\_string\_type}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00164}00164         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00165}00165         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00166}00166           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00167}00167           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a6aa60a578c6307afc1ec46b259951c6f}{NGM\_PPPOE\_SETENADDR}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00168}00168           \textcolor{stringliteral}{"{}setenaddr"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00169}00169           \&\mbox{\hyperlink{ng__parse_8c_a2752ecd5c215b18d9edf7e08b514d4ab}{ng\_parse\_enaddr\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00170}00170           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00171}00171         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00172}00172         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00173}00173           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00174}00174           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a50f9bfcb6d5b7c23b94c6ca85ba908ce}{NGM\_PPPOE\_SETMAXP}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00175}00175           \textcolor{stringliteral}{"{}setmaxp"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00176}00176           \&\mbox{\hyperlink{ng__parse_8c_a0fada424d8e3a3fd9c81a6cc6a0386cc}{ng\_parse\_uint16\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00177}00177           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00178}00178         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00179}00179         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00180}00180           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00181}00181           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a6a04f9846010e9b53385e9f6b7ec1b74}{NGM\_PPPOE\_SEND\_HURL}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00182}00182           \textcolor{stringliteral}{"{}send\_hurl"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00183}00183           \&\mbox{\hyperlink{ng__pppoe_8c_a136149e0410a240344867a7d965062e8}{ngpppoe\_init\_data\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00184}00184           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00185}00185         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00186}00186         \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00187}00187           \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00188}00188           \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3ad51da1b2c90da47fd5ff90a043ede5f3}{NGM\_PPPOE\_SEND\_MOTM}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00189}00189           \textcolor{stringliteral}{"{}send\_motm"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00190}00190           \&\mbox{\hyperlink{ng__pppoe_8c_a136149e0410a240344867a7d965062e8}{ngpppoe\_init\_data\_state\_type}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00191}00191           NULL}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00192}00192         \},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00193}00193         \{ 0 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00194}00194 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00196}00196 \textcolor{comment}{/* Netgraph node type descriptor */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00197}\mbox{\hyperlink{ng__pppoe_8c_a80a131770518c7fa3758d85054006e7a}{00197}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__type}{ng\_type}} \mbox{\hyperlink{ng__pppoe_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}} = \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00198}00198         .\mbox{\hyperlink{structng__type_adbc1c8884ff0e625c19c4b513262fd0e}{version}} =       \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00199}00199         .name =         \mbox{\hyperlink{ng__pppoe_8h_ab8e3c2093792fb4fee5bd17ef89ab2e9}{NG\_PPPOE\_NODE\_TYPE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00200}00200         .constructor =  \mbox{\hyperlink{ng__pppoe_8c_a45520b43464686d4195590a6960d0b26}{ng\_pppoe\_constructor}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00201}00201         .rcvmsg =       \mbox{\hyperlink{ng__pppoe_8c_a931dd604605a484a03964486f3a4843b}{ng\_pppoe\_rcvmsg}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00202}00202         .shutdown =     \mbox{\hyperlink{ng__pppoe_8c_a1b6c594ed921d408eda25deae94cbff1}{ng\_pppoe\_shutdown}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00203}00203         .newhook =      \mbox{\hyperlink{ng__pppoe_8c_ab1803be9184b76f7bccea84a9d9cd074}{ng\_pppoe\_newhook}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00204}00204         .connect =      \mbox{\hyperlink{ng__pppoe_8c_a13bb93dbe4614823975689a8a0d41e16}{ng\_pppoe\_connect}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00205}00205         .rcvdata =      \mbox{\hyperlink{ng__pppoe_8c_abb6de585a7d3e76319b91f2592a564c1}{ng\_pppoe\_rcvdata}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00206}00206         .disconnect =   \mbox{\hyperlink{ng__pppoe_8c_a40a2ff206785a0531aa48d792e41bece}{ng\_pppoe\_disconnect}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00207}00207         .cmdlist =      \mbox{\hyperlink{ng__pppoe_8c_a26d46fcb50270149b8fee54aadbf5a20}{ng\_pppoe\_cmds}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00208}00208 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00209}\mbox{\hyperlink{ng__pppoe_8c_a1e55c627850430082e5d3a9e0b54ec97}{00209}} \mbox{\hyperlink{ng__pppoe_8c_a1e55c627850430082e5d3a9e0b54ec97}{NETGRAPH\_INIT}}(pppoe, \&\mbox{\hyperlink{ng__pppoe_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00211}00211 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00212}00212 \textcolor{comment}{ * States for the session state machine.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00213}00213 \textcolor{comment}{ * These have no meaning if there is no hook attached yet.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00214}00214 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00215}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90}{00215}} \textcolor{keyword}{enum} \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90}{state}} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00216}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a6ed962cbe8ef75d93c81b0d0de5dab2a}{00216}}     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a6ed962cbe8ef75d93c81b0d0de5dab2a}{PPPOE\_SNONE}}=0,   \textcolor{comment}{/* [both] Initial state */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00217}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad99f69c3e7ba206e04f4e9883d6434e6}{00217}}     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad99f69c3e7ba206e04f4e9883d6434e6}{PPPOE\_LISTENING}},     \textcolor{comment}{/* [Daemon] Listening for discover initiation pkt */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00218}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90abce7db6df3b3336b58aac2dc709eae8a}{00218}}     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90abce7db6df3b3336b58aac2dc709eae8a}{PPPOE\_SINIT}},     \textcolor{comment}{/* [Client] Sent discovery initiation */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00219}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad6677ab0255fdfa44c4a521177196093}{00219}}     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad6677ab0255fdfa44c4a521177196093}{PPPOE\_PRIMED}},   \textcolor{comment}{/* [Server] Awaiting PADI from daemon */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00220}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a536520274a9f9359f0c7f0fa545fb734}{00220}}     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a536520274a9f9359f0c7f0fa545fb734}{PPPOE\_SOFFER}},   \textcolor{comment}{/* [Server] Sent offer message  (got PADI)*/}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00221}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90aa1bc415759fb8cdf37ce1f647854558c}{00221}}     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90aa1bc415759fb8cdf37ce1f647854558c}{PPPOE\_SREQ}},               \textcolor{comment}{/* [Client] Sent a Request */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00222}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a110422095d7a14bc807d39e06449d834}{00222}}     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a110422095d7a14bc807d39e06449d834}{PPPOE\_NEWCONNECTED}},       \textcolor{comment}{/* [Server] Connection established, No data received */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00223}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{00223}}     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{PPPOE\_CONNECTED}},     \textcolor{comment}{/* [Both] Connection established, Data received */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00224}00224     \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ae39dac9b571e6d480c45c559aadc32a5}{PPPOE\_DEAD}}                \textcolor{comment}{/* [Both] */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00225}\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ae39dac9b571e6d480c45c559aadc32a5}{00225}} \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00227}\mbox{\hyperlink{ng__pppoe_8c_acade42f7b4edcfbbcebc00e2589e1e56}{00227}} \textcolor{preprocessor}{\#define NUMTAGS 20 }\textcolor{comment}{/* number of tags we are set up to work with */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00229}00229 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00230}00230 \textcolor{comment}{ * Information we store for each hook on each node for negotiating the}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00231}00231 \textcolor{comment}{ * session. The mbuf and cluster are freed once negotiation has completed.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00232}00232 \textcolor{comment}{ * The whole negotiation block is then discarded.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00233}00233 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00235}\mbox{\hyperlink{structsess__neg}{00235}} \textcolor{keyword}{struct }\mbox{\hyperlink{structsess__neg}{sess\_neg}} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00236}\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{00236}}         \textcolor{keyword}{struct }mbuf             *\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}; \textcolor{comment}{/* holds cluster with last sent packet */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00237}\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{00237}}         \textcolor{keyword}{union   }\mbox{\hyperlink{unionpacket}{packet}}            *\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}; \textcolor{comment}{/* points within the above cluster */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00238}\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{00238}}         \textcolor{keyword}{struct }callout          \mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}};   \textcolor{comment}{/* see timeout(9) */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00239}\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{00239}}         u\_int                   \mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}}; \textcolor{comment}{/* 0,1,2,4,8,16 etc. seconds */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00240}\mbox{\hyperlink{structsess__neg_a4d6b4d03beeb1a3932cb467abcb8057b}{00240}}         u\_int                   \mbox{\hyperlink{structsess__neg_a4d6b4d03beeb1a3932cb467abcb8057b}{numtags}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00241}\mbox{\hyperlink{structsess__neg_aea6e9fd0ae208759e4489e3bf2fa49d9}{00241}}         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *\mbox{\hyperlink{structsess__neg_aea6e9fd0ae208759e4489e3bf2fa49d9}{tags}}[\mbox{\hyperlink{ng__pppoe_8c_acade42f7b4edcfbbcebc00e2589e1e56}{NUMTAGS}}];}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00242}\mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{00242}}         u\_int                   \mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{service\_len}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00243}\mbox{\hyperlink{structsess__neg_a18906af455bd1c43ae891b61ecf16ac2}{00243}}         u\_int                   \mbox{\hyperlink{structsess__neg_a18906af455bd1c43ae891b61ecf16ac2}{ac\_name\_len}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00244}\mbox{\hyperlink{structsess__neg_acdae09368fc466d20e5366e35f2e1a07}{00244}}         u\_int                   \mbox{\hyperlink{structsess__neg_acdae09368fc466d20e5366e35f2e1a07}{host\_uniq\_len}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00246}\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{00246}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structdatatag}{datatag}}           \mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00247}\mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{00247}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structdatatag}{datatag}}           \mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{ac\_name}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00248}\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{00248}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structdatatag}{datatag}}           \mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00249}00249 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00250}\mbox{\hyperlink{ng__pppoe_8c_a9eeacb4035c89b99f1d7bbf3d9a8f524}{00250}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structsess__neg}{sess\_neg}} *\mbox{\hyperlink{ng__pppoe_8c_a9eeacb4035c89b99f1d7bbf3d9a8f524}{negp}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00252}00252 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00253}00253 \textcolor{comment}{ * Session information that is needed after connection.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00254}00254 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00255}\mbox{\hyperlink{structsess__con}{00255}} \textcolor{keyword}{struct }\mbox{\hyperlink{structsess__con}{sess\_con}} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00256}\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{00256}}         \mbox{\hyperlink{structng__hook}{hook\_p}}            \mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00257}\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{00257}}         uint16\_t                \mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00258}\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{00258}}         \textcolor{keyword}{enum} \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90}{state}}         \mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00259}\mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{00259}}         \mbox{\hyperlink{ng__message_8h_aa187b4ec2a9994dc1dd8b06703b22d18}{ng\_ID\_t}}                  \mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{creator}}; \textcolor{comment}{/* who to notify */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00260}\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{00260}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}}     \mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}; \textcolor{comment}{/* used when connected */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00261}\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{00261}}         \mbox{\hyperlink{structsess__neg}{negp}}                        \mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};         \textcolor{comment}{/* used when negotiating */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00262}00262         LIST\_ENTRY(\mbox{\hyperlink{structsess__con}{sess\_con}})    sessions;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00263}00263 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00264}\mbox{\hyperlink{ng__pppoe_8c_ab6f5538b4d3aad6dad4791b291c08969}{00264}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structsess__con}{sess\_con}} *\mbox{\hyperlink{ng__pppoe_8c_ab6f5538b4d3aad6dad4791b291c08969}{sessp}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00266}\mbox{\hyperlink{ng__pppoe_8c_a6615eddd2308fa27b73373ac310ab21c}{00266}} \textcolor{preprocessor}{\#define SESSHASHSIZE    0x0100}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00267}\mbox{\hyperlink{ng__pppoe_8c_a82fc45d68e72538c3986aa8218edcfcf}{00267}} \textcolor{preprocessor}{\#define SESSHASH(x)     (((x) \string^ ((x) >> 8)) \& (SESSHASHSIZE -\/ 1))}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00269}\mbox{\hyperlink{structsess__hash__entry}{00269}} \textcolor{keyword}{struct }\mbox{\hyperlink{structsess__hash__entry}{sess\_hash\_entry}} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00270}\mbox{\hyperlink{structsess__hash__entry_ac05927c24116158a95bfd479c1461370}{00270}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structsess__hash__entry_ac05927c24116158a95bfd479c1461370}{mtx}}   \mbox{\hyperlink{structsess__hash__entry_ac05927c24116158a95bfd479c1461370}{mtx}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00271}00271         \mbox{\hyperlink{ngatmbase_8c_a64ce0b7623e1c2ab0cc07245307db113}{LIST\_HEAD}}(hhead, \mbox{\hyperlink{structsess__con}{sess\_con}}) head;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00272}00272 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00273}00273 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00274}00274 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00275}00275 \textcolor{comment}{ * Information we store for each node}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00276}00276 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00277}\mbox{\hyperlink{structPPPoE}{00277}} \textcolor{keyword}{struct }\mbox{\hyperlink{structPPPoE}{PPPoE}} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00278}\mbox{\hyperlink{structPPPoE_a29e6fa03397c8855cc517d87f3ece567}{00278}}         \mbox{\hyperlink{structng__node}{node\_p}}            \mbox{\hyperlink{structPPPoE_a29e6fa03397c8855cc517d87f3ece567}{node}};               \textcolor{comment}{/* back pointer to node */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00279}\mbox{\hyperlink{structPPPoE_a3b31e0643b0fd93b0c5bee2c2ae8bfa9}{00279}}         \mbox{\hyperlink{structng__hook}{hook\_p}}    \mbox{\hyperlink{structPPPoE_a3b31e0643b0fd93b0c5bee2c2ae8bfa9}{ethernet\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00280}\mbox{\hyperlink{structPPPoE_ad8811bef0f32b4754c907c77864d35df}{00280}}         \mbox{\hyperlink{structng__hook}{hook\_p}}    \mbox{\hyperlink{structPPPoE_ad8811bef0f32b4754c907c77864d35df}{debug\_hook}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00281}\mbox{\hyperlink{structPPPoE_aae07021307e1178ce617687eb787d936}{00281}}         u\_int           \mbox{\hyperlink{structPPPoE_aae07021307e1178ce617687eb787d936}{packets\_in}};   \textcolor{comment}{/* packets in from ethernet */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00282}\mbox{\hyperlink{structPPPoE_a90eee066f0922f01755e363d0bebcc1a}{00282}}         u\_int           \mbox{\hyperlink{structPPPoE_a90eee066f0922f01755e363d0bebcc1a}{packets\_out}}; \textcolor{comment}{/* packets out towards ethernet */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00283}\mbox{\hyperlink{structPPPoE_a9bcd3ae57ecd74e6dd952e3ceb340dd1}{00283}}         uint32\_t        \mbox{\hyperlink{structPPPoE_a9bcd3ae57ecd74e6dd952e3ceb340dd1}{flags}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00284}\mbox{\hyperlink{ng__pppoe_8c_a678f30c81e89ed94377301a04a43416e}{00284}} \textcolor{preprocessor}{\#define COMPAT\_3COM     0x00000001}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00285}\mbox{\hyperlink{ng__pppoe_8c_aae1233f77aa0adb81c4b32d87b5133ad}{00285}} \textcolor{preprocessor}{\#define COMPAT\_DLINK    0x00000002}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00286}\mbox{\hyperlink{structPPPoE_aa8a69dd5949f44c088434f1eb47e6377}{00286}}         \textcolor{keyword}{struct }ether\_header     \mbox{\hyperlink{structPPPoE_aa8a69dd5949f44c088434f1eb47e6377}{eh}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00287}00287         \mbox{\hyperlink{ngatmbase_8c_a64ce0b7623e1c2ab0cc07245307db113}{LIST\_HEAD}}(, \mbox{\hyperlink{structsess__con}{sess\_con}}) listeners;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00288}00288         \textcolor{keyword}{struct }\mbox{\hyperlink{structsess__hash__entry}{sess\_hash\_entry}}   sesshash[\mbox{\hyperlink{ng__pppoe_8c_a6615eddd2308fa27b73373ac310ab21c}{SESSHASHSIZE}}];}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00289}00289         \textcolor{keyword}{struct }\mbox{\hyperlink{structmaxptag}{maxptag}}   max\_payload;    \textcolor{comment}{/* PPP-\/Max-\/Payload (RFC4638) */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00290}00290 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00291}\mbox{\hyperlink{ng__pppoe_8c_a17f6abfa8d4d780f2448f6506e147204}{00291}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structPPPoE}{PPPoE}} *\mbox{\hyperlink{ng__pppoe_8c_a17f6abfa8d4d780f2448f6506e147204}{priv\_p}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00292}00292 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00293}\mbox{\hyperlink{unionuniq}{00293}} \textcolor{keyword}{union }\mbox{\hyperlink{unionuniq}{uniq}} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00294}\mbox{\hyperlink{unionuniq_aec9b41fbe2f647d63259646ec105887d}{00294}}         \textcolor{keywordtype}{char} \mbox{\hyperlink{unionuniq_aec9b41fbe2f647d63259646ec105887d}{bytes}}[\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void} *)];}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00295}\mbox{\hyperlink{unionuniq_a9b28eef5f2d14d3cc01e0e1e4945f696}{00295}}         \textcolor{keywordtype}{void} *\mbox{\hyperlink{unionuniq_a9b28eef5f2d14d3cc01e0e1e4945f696}{pointer}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00296}00296 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00297}00297 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00298}\mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{00298}} \textcolor{preprocessor}{\#define LEAVE(x) do \{ error = x; goto quit; \} while(0)}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00299}00299 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__pppoe_8c_abba562aea9cdad23262f7e965d63bde3}{pppoe\_start}}(\mbox{\hyperlink{structsess__con}{sessp}} sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00300}00300 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__pppoe_8c_afa3a5587fc09b4ea57d954ed91d068b0}{pppoe\_ticker}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{void} *arg1, \textcolor{keywordtype}{int} arg2);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00301}00301 \textcolor{keyword}{static} \textcolor{keyword}{const}    \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *\mbox{\hyperlink{ng__pppoe_8c_a7d80bec3ebc61330788ef50ca9034057}{scan\_tags}}(\mbox{\hyperlink{structsess__con}{sessp}} sp,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00302}00302                         \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__hdr}{pppoe\_hdr}}* ph);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00303}00303 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}     \mbox{\hyperlink{ng__pppoe_8c_a7f63b1db45ec2f3585bea152760fa91c}{pppoe\_send\_event}}(\mbox{\hyperlink{structsess__con}{sessp}} sp, \textcolor{keyword}{enum} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}} cmdid);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00305}00305 \textcolor{comment}{/*************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00306}00306 \textcolor{comment}{ * Some basic utilities  from the Linux version with author's permission.*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00307}00307 \textcolor{comment}{ * Author:      Michal Ostrowski <mostrows@styx.uwaterloo.ca>            *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00308}00308 \textcolor{comment}{ ************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00309}00309 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00310}00310 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00311}00311 \textcolor{comment}{ * Return the location where the next tag can be put}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00312}00312 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00313}00313 \textcolor{keyword}{static} \_\_inline \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}}*}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00314}\mbox{\hyperlink{ng__pppoe_8c_aafdf07cced1e126fea9f8f3e0682f587}{00314}} \mbox{\hyperlink{ng__pppoe_8c_aafdf07cced1e126fea9f8f3e0682f587}{next\_tag}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__hdr}{pppoe\_hdr}}* ph)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00315}00315 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00316}00316         \textcolor{keywordflow}{return} (\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}}*)(((\textcolor{keyword}{const} \textcolor{keywordtype}{char}*)(ph + 1))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00317}00317             + ntohs(ph-\/>\mbox{\hyperlink{structpppoe__hdr_acdfbf6a1eca39566f6802904d92de3f5}{length}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00318}00318 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00320}00320 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00321}00321 \textcolor{comment}{ * Look for a tag of a specific type.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00322}00322 \textcolor{comment}{ * Don't trust any length the other end says,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00323}00323 \textcolor{comment}{ * but assume we already sanity checked ph-\/>length.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00324}00324 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00325}00325 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}}*}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00326}\mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{00326}} \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__hdr}{pppoe\_hdr}}* ph, uint16\_t idx)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00327}00327 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00328}00328         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\textcolor{keyword}{const} end = (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)\mbox{\hyperlink{ng__pppoe_8c_aafdf07cced1e126fea9f8f3e0682f587}{next\_tag}}(ph);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00329}00329         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *pt = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(ph + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00330}00330         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ptn;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00331}00331 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00332}00332         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00333}00333 \textcolor{comment}{         * Keep processing tags while a tag header will still fit.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00334}00334 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00335}00335         \textcolor{keywordflow}{while}((\textcolor{keyword}{const} \textcolor{keywordtype}{char}*)(pt + 1) <= end) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00336}00336                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00337}00337 \textcolor{comment}{                 * If the tag data would go past the end of the packet, abort.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00338}00338 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00339}00339                 ptn = (((\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(pt + 1)) + ntohs(pt-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00340}00340                 \textcolor{keywordflow}{if} (ptn > end) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00341}00341                         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: invalid length for tag \%d"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00342}00342                             \_\_func\_\_, idx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00343}00343                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00344}00344                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00345}00345                 \textcolor{keywordflow}{if} (pt-\/>\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} == idx) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00346}00346                         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: found tag \%d"{}}, \_\_func\_\_, idx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00347}00347                         \textcolor{keywordflow}{return} (pt);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00348}00348                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00349}00349 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00350}00350                 pt = (\textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}}*)ptn;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00351}00351         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00353}00353         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: not found tag \%d"{}}, \_\_func\_\_, idx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00354}00354         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00355}00355 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00356}00356 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00357}00357 \textcolor{comment}{/**************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00358}00358 \textcolor{comment}{ * Inlines to initialise or add tags to a session's tag list.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00359}00359 \textcolor{comment}{ **************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00360}00360 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00361}00361 \textcolor{comment}{ * Initialise the session's tag list.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00362}00362 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00363}00363 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00364}\mbox{\hyperlink{ng__pppoe_8c_a197d647e712fe59b6e1781df4612805b}{00364}} \mbox{\hyperlink{ng__pppoe_8c_a197d647e712fe59b6e1781df4612805b}{init\_tags}}(\mbox{\hyperlink{structsess__con}{sessp}} sp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00365}00365 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00366}00366         KASSERT(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}} != NULL, (\textcolor{stringliteral}{"{}\%s: no neg"{}}, \_\_func\_\_));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00367}00367         sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a4d6b4d03beeb1a3932cb467abcb8057b}{numtags}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00368}00368 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00370}00370 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00371}\mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{00371}} \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(\mbox{\hyperlink{structsess__con}{sessp}} sp, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00372}00372 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00373}00373         \mbox{\hyperlink{structsess__neg}{negp}} neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00374}00374         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00375}00375 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00376}00376         KASSERT(neg != NULL, (\textcolor{stringliteral}{"{}\%s: no neg"{}}, \_\_func\_\_));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00377}00377         \textcolor{keywordflow}{if} ((i = neg-\/>\mbox{\hyperlink{structsess__neg_a4d6b4d03beeb1a3932cb467abcb8057b}{numtags}}++) < \mbox{\hyperlink{ng__pppoe_8c_acade42f7b4edcfbbcebc00e2589e1e56}{NUMTAGS}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00378}00378                 neg-\/>\mbox{\hyperlink{structsess__neg_aea6e9fd0ae208759e4489e3bf2fa49d9}{tags}}[i] = tp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00379}00379         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00380}00380                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe: asked to add too many tags to "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00381}00381                     \textcolor{stringliteral}{"{}packet\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00382}00382                 neg-\/>\mbox{\hyperlink{structsess__neg_a4d6b4d03beeb1a3932cb467abcb8057b}{numtags}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00383}00383         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00384}00384 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00385}00385 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00386}00386 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00387}00387 \textcolor{comment}{ * Make up a packet, using the tags filled out for the session.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00388}00388 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00389}00389 \textcolor{comment}{ * Assume that the actual pppoe header and ethernet header}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00390}00390 \textcolor{comment}{ * are filled out externally to this routine.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00391}00391 \textcolor{comment}{ * Also assume that neg-\/>wh points to the correct}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00392}00392 \textcolor{comment}{ * location at the front of the buffer space.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00393}00393 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00394}00394 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00395}\mbox{\hyperlink{ng__pppoe_8c_a63d11938f3f1ae308335fe07300d774f}{00395}} \mbox{\hyperlink{ng__pppoe_8c_a63d11938f3f1ae308335fe07300d774f}{make\_packet}}(\mbox{\hyperlink{structsess__con}{sessp}} sp) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00396}00396         \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *wh = \&sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00397}00397         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} **tag;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00398}00398         \textcolor{keywordtype}{char} *dp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00399}00399         \textcolor{keywordtype}{int} \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00400}00400         \textcolor{keywordtype}{int} tlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00401}00401         uint16\_t \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00403}00403         KASSERT((sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}} != NULL) \&\& (sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}} != NULL),}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00404}00404             (\textcolor{stringliteral}{"{}\%s: called from wrong state"{}}, \_\_func\_\_));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00405}00405         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00406}00406 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00407}00407         dp = (\textcolor{keywordtype}{char} *)(\&wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}} + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00408}00408         \textcolor{keywordflow}{for} (\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} = 0, tag = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_aea6e9fd0ae208759e4489e3bf2fa49d9}{tags}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00409}00409             ((count < sp-\/>neg-\/>numtags) \&\& (\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} < \mbox{\hyperlink{ng__pppoe_8c_acade42f7b4edcfbbcebc00e2589e1e56}{NUMTAGS}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00410}00410             tag++, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}}++) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00411}00411                 tlen = ntohs((*tag)-\/>tag\_len) + \textcolor{keyword}{sizeof}(**tag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00412}00412                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}} + tlen) > (ETHER\_MAX\_LEN -\/ 4 -\/ \textcolor{keyword}{sizeof}(*wh))) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00413}00413                         log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe: tags too long\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00414}00414                         sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a4d6b4d03beeb1a3932cb467abcb8057b}{numtags}} = \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00415}00415                         \textcolor{keywordflow}{break};  \textcolor{comment}{/* XXX chop off what's too long */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00416}00416                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00417}00417                 bcopy(*tag, (\textcolor{keywordtype}{char} *)dp, tlen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00418}00418                 \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}} += tlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00419}00419                 dp += tlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00420}00420         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00421}00421         wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_acdfbf6a1eca39566f6802904d92de3f5}{length}} = htons(\mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00422}00422         sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}-\/>m\_len = \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}} + \textcolor{keyword}{sizeof}(*wh);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00423}00423         sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}-\/>m\_pkthdr.len = \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}} + \textcolor{keyword}{sizeof}(*wh);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00424}00424 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00426}00426 \textcolor{comment}{/**************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00427}00427 \textcolor{comment}{ * Routines to match a service.                                           *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00428}00428 \textcolor{comment}{ **************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00429}00429 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00430}00430 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00431}00431 \textcolor{comment}{ * Find a hook that has a service string that matches that}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00432}00432 \textcolor{comment}{ * we are seeking. For now use a simple string.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00433}00433 \textcolor{comment}{ * In the future we may need something like regexp().}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00434}00434 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00435}00435 \textcolor{comment}{ * Null string is a wildcard (ANY service), according to RFC2516.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00436}00436 \textcolor{comment}{ * And historical FreeBSD wildcard is also "{}*"{}.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00437}00437 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00438}00438 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00439}00439 \textcolor{keyword}{static} \mbox{\hyperlink{structng__hook}{hook\_p}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00440}\mbox{\hyperlink{ng__pppoe_8c_ab0b370298459490b8814bd861d8b90ea}{00440}} \mbox{\hyperlink{ng__pppoe_8c_ab0b370298459490b8814bd861d8b90ea}{pppoe\_match\_svc}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00441}00441 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00442}00442         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00443}00443         \mbox{\hyperlink{structsess__con}{sessp}} sp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00445}00445         LIST\_FOREACH(sp, \&privp-\/>listeners, sessions) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00446}00446                 \mbox{\hyperlink{structsess__neg}{negp}} neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00447}00447 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00448}00448                 \textcolor{comment}{/* Empty Service-\/Name matches any service. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00449}00449                 \textcolor{keywordflow}{if} (neg-\/>\mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{service\_len}} == 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00450}00450                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00451}00451 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00452}00452                 \textcolor{comment}{/* Special case for a blank or "{}*"{} service name (wildcard). */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00453}00453                 \textcolor{keywordflow}{if} (neg-\/>\mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{service\_len}} == 1 \&\& neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}[0] == \textcolor{charliteral}{'*'})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00454}00454                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00455}00455 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00456}00456                 \textcolor{comment}{/* If the lengths don't match, that aint it. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00457}00457                 \textcolor{keywordflow}{if} (neg-\/>\mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{service\_len}} != ntohs(tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}}))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00458}00458                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00459}00459 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00460}00460                 \textcolor{keywordflow}{if} (strncmp((\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(tag + 1), neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00461}00461                     ntohs(tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}})) == 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00462}00462                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00463}00463         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00464}00464         CTR3(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: matched \%p for \%s"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00465}00465             sp?sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}:NULL, (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(tag + 1));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00467}00467         \textcolor{keywordflow}{return} (sp?sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}:NULL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00468}00468 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00470}00470 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00471}00471 \textcolor{comment}{ * Broadcast the PADI packet in m0 to all listening hooks.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00472}00472 \textcolor{comment}{ * This routine is called when a PADI with empty Service-\/Name}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00473}00473 \textcolor{comment}{ * tag is received. Client should receive PADOs with all}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00474}00474 \textcolor{comment}{ * available services.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00475}00475 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00476}00476 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00477}\mbox{\hyperlink{ng__pppoe_8c_a7ae0ae75aedf4a499759efbfdc654c41}{00477}} \mbox{\hyperlink{ng__pppoe_8c_a7ae0ae75aedf4a499759efbfdc654c41}{pppoe\_broadcast\_padi}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \textcolor{keyword}{struct} mbuf *m0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00478}00478 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00479}00479         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00480}00480         \mbox{\hyperlink{structsess__con}{sessp}} sp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00481}00481         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00483}00483         LIST\_FOREACH(sp, \&privp-\/>listeners, sessions) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00484}00484                 \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00486}00486                 m = m\_dup(m0, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00487}00487                 \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00488}00488                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00489}00489                 \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}(error, sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00490}00490                 \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00491}00491                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00492}00492         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00494}00494         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00495}00495 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00496}00496 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00497}00497 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00498}00498 \textcolor{comment}{ * Find a hook, which name equals to given service.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00499}00499 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00500}00500 \textcolor{keyword}{static} \mbox{\hyperlink{structng__hook}{hook\_p}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00501}\mbox{\hyperlink{ng__pppoe_8c_a2b7bcb986c8a28a16130242b83a74a17}{00501}} \mbox{\hyperlink{ng__pppoe_8c_a2b7bcb986c8a28a16130242b83a74a17}{pppoe\_find\_svc}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *svc\_name, \textcolor{keywordtype}{int} svc\_len)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00502}00502 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00503}00503         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00504}00504         \mbox{\hyperlink{structsess__con}{sessp}} sp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00505}00505 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00506}00506         LIST\_FOREACH(sp, \&privp-\/>listeners, sessions) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00507}00507                 \mbox{\hyperlink{structsess__neg}{negp}} neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00509}00509                 \textcolor{keywordflow}{if} (neg-\/>\mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{service\_len}} == svc\_len \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00510}00510                     strncmp(svc\_name, neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}, svc\_len) == 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00511}00511                         \textcolor{keywordflow}{return} (sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00512}00512         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00513}00513 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00514}00514         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00515}00515 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00516}00516 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00517}00517 \textcolor{comment}{/**************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00518}00518 \textcolor{comment}{ * Routines to find a particular session that matches an incoming packet. *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00519}00519 \textcolor{comment}{ **************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00520}00520 \textcolor{comment}{/* Find free session and add to hash. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00521}00521 \textcolor{keyword}{static} uint16\_t}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00522}\mbox{\hyperlink{ng__pppoe_8c_ae8924db103e99fb2a8c056d553e669fb}{00522}} \mbox{\hyperlink{ng__pppoe_8c_ae8924db103e99fb2a8c056d553e669fb}{pppoe\_getnewsession}}(\mbox{\hyperlink{structsess__con}{sessp}} sp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00523}00523 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00524}00524         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00525}00525         \textcolor{keyword}{static} uint16\_t pppoe\_sid = 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00526}00526         \mbox{\hyperlink{structsess__con}{sessp}}      tsp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00527}00527         uint16\_t val, hash;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00528}00528 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00529}00529 restart:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00530}00530         \textcolor{comment}{/* Atomicity is not needed here as value will be checked. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00531}00531         val = pppoe\_sid++;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00532}00532         \textcolor{comment}{/* Spec says 0xFFFF is reserved, also don't use 0x0000. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00533}00533         \textcolor{keywordflow}{if} (val == 0xffff || val == 0x0000)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00534}00534                 val = pppoe\_sid = 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00536}00536         \textcolor{comment}{/* Check it isn't already in use. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00537}00537         hash = \mbox{\hyperlink{ng__pppoe_8c_a82fc45d68e72538c3986aa8218edcfcf}{SESSHASH}}(val);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00538}00538         mtx\_lock(\&privp-\/>sesshash[hash].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00539}00539         LIST\_FOREACH(tsp, \&privp-\/>sesshash[hash].head, sessions) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00540}00540                 \textcolor{keywordflow}{if} (tsp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}} == val)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00541}00541                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00542}00542         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00543}00543         \textcolor{keywordflow}{if} (!tsp) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00544}00544                 sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}} = val;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00545}00545                 LIST\_INSERT\_HEAD(\&privp-\/>sesshash[hash].head, sp, sessions);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00546}00546         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00547}00547         mtx\_unlock(\&privp-\/>sesshash[hash].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00548}00548         \textcolor{keywordflow}{if} (tsp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00549}00549                 \textcolor{keywordflow}{goto} restart;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00551}00551         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: new sid \%d"{}}, \_\_func\_\_, val);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00553}00553         \textcolor{keywordflow}{return} (val);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00554}00554 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00556}00556 \textcolor{comment}{/* Add specified session to hash. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00557}00557 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00558}\mbox{\hyperlink{ng__pppoe_8c_ab660096a894df8ce246d589fe958a66f}{00558}} \mbox{\hyperlink{ng__pppoe_8c_ab660096a894df8ce246d589fe958a66f}{pppoe\_addsession}}(\mbox{\hyperlink{structsess__con}{sessp}} sp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00559}00559 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00560}00560         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}}      privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00561}00561         uint16\_t        hash = \mbox{\hyperlink{ng__pppoe_8c_a82fc45d68e72538c3986aa8218edcfcf}{SESSHASH}}(sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00563}00563         mtx\_lock(\&privp-\/>sesshash[hash].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00564}00564         LIST\_INSERT\_HEAD(\&privp-\/>sesshash[hash].head, sp, sessions);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00565}00565         mtx\_unlock(\&privp-\/>sesshash[hash].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00566}00566 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00567}00567 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00568}00568 \textcolor{comment}{/* Delete specified session from hash. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00569}00569 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00570}\mbox{\hyperlink{ng__pppoe_8c_afc052746522ca460f79a6f5bb668d49f}{00570}} \mbox{\hyperlink{ng__pppoe_8c_afc052746522ca460f79a6f5bb668d49f}{pppoe\_delsession}}(\mbox{\hyperlink{structsess__con}{sessp}} sp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00571}00571 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00572}00572         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}}      privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00573}00573         uint16\_t        hash = \mbox{\hyperlink{ng__pppoe_8c_a82fc45d68e72538c3986aa8218edcfcf}{SESSHASH}}(sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00575}00575         mtx\_lock(\&privp-\/>sesshash[hash].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00576}00576         LIST\_REMOVE(sp, sessions);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00577}00577         mtx\_unlock(\&privp-\/>sesshash[hash].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00578}00578 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00579}00579 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00580}00580 \textcolor{comment}{/* Find matching peer/session combination. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00581}00581 \textcolor{keyword}{static} \mbox{\hyperlink{structsess__con}{sessp}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00582}\mbox{\hyperlink{ng__pppoe_8c_a5212df6c08b4b291466caaa2e0ef3496}{00582}} \mbox{\hyperlink{ng__pppoe_8c_a5212df6c08b4b291466caaa2e0ef3496}{pppoe\_findsession}}(\mbox{\hyperlink{structnetflow}{priv\_p}} privp, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *wh)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00583}00583 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00584}00584         uint16\_t        session = ntohs(wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_a6542f0408c34f233fdae67e9e3789887}{sid}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00585}00585         uint16\_t        hash = \mbox{\hyperlink{ng__pppoe_8c_a82fc45d68e72538c3986aa8218edcfcf}{SESSHASH}}(session);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00586}00586         \mbox{\hyperlink{structsess__con}{sessp}}              sp = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00588}00588         mtx\_lock(\&privp-\/>sesshash[hash].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00589}00589         LIST\_FOREACH(sp, \&privp-\/>sesshash[hash].head, sessions) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00590}00590                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}} == session \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00591}00591                     bcmp(sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_dhost,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00592}00592                      wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_shost, ETHER\_ADDR\_LEN) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00593}00593                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00594}00594                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00595}00595         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00596}00596         mtx\_unlock(\&privp-\/>sesshash[hash].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00597}00597         CTR3(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: matched \%p for \%d"{}}, \_\_func\_\_, sp?sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}:NULL,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00598}00598             session);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00599}00599 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00600}00600         \textcolor{keywordflow}{return} (sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00601}00601 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00602}00602 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00603}00603 \textcolor{keyword}{static} \mbox{\hyperlink{structng__hook}{hook\_p}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00604}\mbox{\hyperlink{ng__pppoe_8c_a1e2599642ebcdafbcf2afe3f5bad6948}{00604}} \mbox{\hyperlink{ng__pppoe_8c_a1e2599642ebcdafbcf2afe3f5bad6948}{pppoe\_finduniq}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00605}00605 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00606}00606         \mbox{\hyperlink{structng__hook}{hook\_p}}    hook = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00607}00607         \mbox{\hyperlink{structsess__con}{sessp}}      sp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00608}00608 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00609}00609         \textcolor{comment}{/* Cycle through all known hooks. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00610}00610         LIST\_FOREACH(hook, \&node-\/>nd\_hooks, hk\_hooks) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00611}00611                 \textcolor{comment}{/* Skip any nonsession hook. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00612}00612                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook) == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00613}00613                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00614}00614                 sp = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00615}00615                 \textcolor{comment}{/* Skip already connected sessions. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00616}00616                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00617}00617                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00618}00618                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_acdae09368fc466d20e5366e35f2e1a07}{host\_uniq\_len}} == ntohs(tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}}) \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00619}00619                     bcmp(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}, (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(tag + 1),}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00620}00620                      sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_acdae09368fc466d20e5366e35f2e1a07}{host\_uniq\_len}}) == 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00621}00621                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00622}00622         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00623}00623         CTR3(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: matched \%p for \%p"{}}, \_\_func\_\_, hook, sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00624}00624 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00625}00625         \textcolor{keywordflow}{return} (hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00626}00626 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00627}00627 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00628}00628 \textcolor{keyword}{static} \mbox{\hyperlink{structng__hook}{hook\_p}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00629}\mbox{\hyperlink{ng__pppoe_8c_a10b4e9a643481b7c042a3b3bd1b3dd2f}{00629}} \mbox{\hyperlink{ng__pppoe_8c_a10b4e9a643481b7c042a3b3bd1b3dd2f}{pppoe\_findcookie}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00630}00630 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00631}00631         \mbox{\hyperlink{structng__hook}{hook\_p}}    hook = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00632}00632         \textcolor{keyword}{union }\mbox{\hyperlink{unionuniq}{uniq}} cookie;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00633}00633 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00634}00634         bcopy(tag + 1, cookie.\mbox{\hyperlink{unionuniq_aec9b41fbe2f647d63259646ec105887d}{bytes}}, \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void} *));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00635}00635         \textcolor{comment}{/* Cycle through all known hooks. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00636}00636         LIST\_FOREACH(hook, \&node-\/>nd\_hooks, hk\_hooks) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00637}00637                 \textcolor{comment}{/* Skip any nonsession hook. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00638}00638                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook) == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00639}00639                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00640}00640                 \textcolor{keywordflow}{if} (cookie.\mbox{\hyperlink{unionuniq_a9b28eef5f2d14d3cc01e0e1e4945f696}{pointer}} == \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00641}00641                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00642}00642         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00643}00643         CTR3(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: matched \%p for \%p"{}}, \_\_func\_\_, hook, cookie.\mbox{\hyperlink{unionuniq_a9b28eef5f2d14d3cc01e0e1e4945f696}{pointer}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00644}00644 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00645}00645         \textcolor{keywordflow}{return} (hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00646}00646 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00647}00647 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00648}00648 \textcolor{comment}{/**************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00649}00649 \textcolor{comment}{ * Start of Netgraph entrypoints.                                         *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00650}00650 \textcolor{comment}{ **************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00651}00651 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00652}00652 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00653}00653 \textcolor{comment}{ * Allocate the private data structure and link it with node.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00654}00654 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00655}00655 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00656}\mbox{\hyperlink{ng__pppoe_8c_a01356ad3cbb2dbded0e751f1b5cc30a3}{00656}} \mbox{\hyperlink{ng__pppoe_8c_a45520b43464686d4195590a6960d0b26}{ng\_pppoe\_constructor}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00657}00657 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00658}00658         \mbox{\hyperlink{structnetflow}{priv\_p}}    privp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00659}00659         \textcolor{keywordtype}{int}     i;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00660}00660 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00661}00661         \textcolor{comment}{/* Initialize private descriptor. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00662}00662         privp = malloc(\textcolor{keyword}{sizeof}(*privp), \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}}, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00663}00663 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00664}00664         \textcolor{comment}{/* Link structs together; this counts as our one reference to *node. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00665}00665         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, privp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00666}00666         privp-\/>\mbox{\hyperlink{structnetflow_ae990618299373228ee7da77a42c44269}{node}} = node;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00667}00667 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00668}00668         \textcolor{comment}{/* Initialize to standard mode. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00669}00669         memset(\&privp-\/>eh.ether\_dhost, 0xff, ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00670}00670         privp-\/>eh.ether\_type = \mbox{\hyperlink{ng__pppoe_8h_ab952530e40d18b6a6bd01d7bb7680d7b}{ETHERTYPE\_PPPOE\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00671}00671 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00672}00672         LIST\_INIT(\&privp-\/>listeners);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00673}00673         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ng__pppoe_8c_a6615eddd2308fa27b73373ac310ab21c}{SESSHASHSIZE}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00674}00674             mtx\_init(\&privp-\/>sesshash[i].mtx, \textcolor{stringliteral}{"{}PPPoE hash mutex"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00675}00675             LIST\_INIT(\&privp-\/>sesshash[i].head);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00676}00676         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00677}00677 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00678}00678         CTR3(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: created node [\%x] (\%p)"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00679}00679             \_\_func\_\_, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}}, node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00680}00680 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00681}00681         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00682}00682 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00683}00683 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00684}00684 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00685}00685 \textcolor{comment}{ * Give our ok for a hook to be added...}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00686}00686 \textcolor{comment}{ * point the hook's private info to the hook structure.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00687}00687 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00688}00688 \textcolor{comment}{ * The following hook names are special:}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00689}00689 \textcolor{comment}{ *  "{}ethernet"{}:  the hook that should be connected to a NIC.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00690}00690 \textcolor{comment}{ *  "{}debug"{}:    copies of data sent out here  (when I write the code).}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00691}00691 \textcolor{comment}{ * All other hook names need only be unique. (the framework checks this).}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00692}00692 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00693}00693 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00694}\mbox{\hyperlink{ng__pppoe_8c_a7e9e23be90439b1e1b26e5aa56391555}{00694}} \mbox{\hyperlink{ng__pppoe_8c_ab1803be9184b76f7bccea84a9d9cd074}{ng\_pppoe\_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__pppoe_8c_source_l00695}00695 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00696}00696         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00697}00697         \mbox{\hyperlink{structsess__con}{sessp}} sp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00698}00698 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00699}00699         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__pppoe_8h_a23d6136aee7f7e30b7632dbec3c76823}{NG\_PPPOE\_HOOK\_ETHERNET}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00700}00700                 privp-\/>ethernet\_hook = hook;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00701}00701                 \mbox{\hyperlink{netgraph_8h_ab1e7d2c2d5515e199564939de7b47da8}{NG\_HOOK\_SET\_RCVDATA}}(hook, \mbox{\hyperlink{ng__pppoe_8c_a2ec731436c8c8dbf88c8b6a4856304f9}{ng\_pppoe\_rcvdata\_ether}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00702}00702         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__pppoe_8h_a991b52990ee6b265a17aed4215b54329}{NG\_PPPOE\_HOOK\_DEBUG}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00703}00703                 privp-\/>debug\_hook = hook;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00704}00704                 \mbox{\hyperlink{netgraph_8h_ab1e7d2c2d5515e199564939de7b47da8}{NG\_HOOK\_SET\_RCVDATA}}(hook, \mbox{\hyperlink{ng__pppoe_8c_afb2e20d22dc3910b5c294b7c838edfd9}{ng\_pppoe\_rcvdata\_debug}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00705}00705         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00706}00706                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00707}00707 \textcolor{comment}{                 * Any other unique name is OK.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00708}00708 \textcolor{comment}{                 * The infrastructure has already checked that it's unique,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00709}00709 \textcolor{comment}{                 * so just allocate it and hook it in.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00710}00710 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00711}00711                 sp = malloc(\textcolor{keyword}{sizeof}(*sp), \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}}, M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00712}00712                 \textcolor{keywordflow}{if} (sp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00713}00713                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00715}00715                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00716}00716                 sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}} = hook;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00717}00717         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00718}00718         CTR5(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: node [\%x] (\%p) connected hook \%s (\%p)"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00719}00719             \_\_func\_\_, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}}, node, \mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00720}00720 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00721}00721         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00722}00722 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00723}00723 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00724}00724 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00725}00725 \textcolor{comment}{ * Hook has been added successfully. Request the MAC address of}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00726}00726 \textcolor{comment}{ * the underlying Ethernet node.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00727}00727 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00728}00728 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00729}\mbox{\hyperlink{ng__pppoe_8c_a4aa29a973e994687018f285e7c8e11bf}{00729}} \mbox{\hyperlink{ng__pppoe_8c_a13bb93dbe4614823975689a8a0d41e16}{ng\_pppoe\_connect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00730}00730 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00731}00731         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00732}00732         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00733}00733         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00734}00734 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00735}00735         \textcolor{keywordflow}{if} (hook != privp-\/>ethernet\_hook)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00736}00736                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00737}00737 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00738}00738         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00739}00739 \textcolor{comment}{         * If this is Ethernet hook, then request MAC address}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00740}00740 \textcolor{comment}{         * from our downstream.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00741}00741 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00742}00742         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__ether_8h_a16f0a23929224d5ef661fe83f70d460a}{NGM\_ETHER\_COOKIE}}, \mbox{\hyperlink{ng__ether_8h_a16685eea158879e41b101ca3634de462ae9ab89debdb44fc473eb24d50d11e47e}{NGM\_ETHER\_GET\_ENADDR}}, 0, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00743}00743         \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00744}00744                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00745}00745 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00746}00746         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00747}00747 \textcolor{comment}{         * Our hook and peer hook have HK\_INVALID flag set,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00748}00748 \textcolor{comment}{         * so we can't use NG\_SEND\_MSG\_HOOK() macro here.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00749}00749 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00750}00750         \mbox{\hyperlink{netgraph_8h_a90e963a02e95ae7964761de2122b5a88}{NG\_SEND\_MSG\_ID}}(error, privp-\/>\mbox{\hyperlink{structnetflow_ae990618299373228ee7da77a42c44269}{node}}, msg,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00751}00751             \mbox{\hyperlink{netgraph_8h_a4e976220d11ba62c9757bae3cfe1e9ed}{NG\_NODE\_ID}}(\mbox{\hyperlink{netgraph_8h_a2422a9fbdceb03a36586612af27100fb}{NG\_PEER\_NODE}}(privp-\/>ethernet\_hook)),}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00752}00752             \mbox{\hyperlink{netgraph_8h_a4e976220d11ba62c9757bae3cfe1e9ed}{NG\_NODE\_ID}}(privp-\/>\mbox{\hyperlink{structnetflow_ae990618299373228ee7da77a42c44269}{node}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00753}00753 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00754}00754         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00755}00755 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00756}00756 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00757}00757 \textcolor{comment}{ * Get a netgraph control message.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00758}00758 \textcolor{comment}{ * Check it is one we understand. If needed, send a response.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00759}00759 \textcolor{comment}{ * We sometimes save the address for an async action later.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00760}00760 \textcolor{comment}{ * Always free the message.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00761}00761 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00762}00762 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00763}\mbox{\hyperlink{ng__pppoe_8c_a736fcc54565538b62057e70aa3dd8569}{00763}} \mbox{\hyperlink{ng__pppoe_8c_a931dd604605a484a03964486f3a4843b}{ng\_pppoe\_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__pppoe_8c_source_l00764}00764 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00765}00765         \textcolor{keyword}{struct }epoch\_tracker et;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00766}00766         \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00767}00767         \textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__init__data}{ngpppoe\_init\_data}} *ourmsg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00768}00768         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *resp = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00769}00769         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00770}00770         \mbox{\hyperlink{structng__hook}{hook\_p}} hook = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00771}00771         \mbox{\hyperlink{structsess__con}{sessp}} sp = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00772}00772         \mbox{\hyperlink{structsess__neg}{negp}} neg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00773}00773         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00774}00774 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00775}00775         \mbox{\hyperlink{netgraph_8h_adc9a04fd174ef3c29ecae94016b84839}{NGI\_GET\_MSG}}(item, msg);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00776}00776         CTR5(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: node [\%x] (\%p) got message \%d with cookie \%d"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00777}00777             \_\_func\_\_, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}}, node, msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00778}00778             msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_ab59e14593b69a406ed5ca4209d489a10}{typecookie}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00780}00780         \textcolor{comment}{/* Deal with message according to cookie and command. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00781}00781         \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_ab59e14593b69a406ed5ca4209d489a10}{typecookie}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00782}00782         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00783}00783                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00784}00784                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a5de3a72ede166fe167268f1ac27f9872}{NGM\_PPPOE\_CONNECT}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00785}00785                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3abe5e14709c69363de21505e396d60da6}{NGM\_PPPOE\_LISTEN}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00786}00786                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3aa1a4d5b0ac6d938146ae6560ae027680}{NGM\_PPPOE\_OFFER}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00787}00787                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a0a336c1715f2c1ac0312df74971ef269}{NGM\_PPPOE\_SERVICE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00788}00788                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a6a04f9846010e9b53385e9f6b7ec1b74}{NGM\_PPPOE\_SEND\_HURL}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00789}00789                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3ad51da1b2c90da47fd5ff90a043ede5f3}{NGM\_PPPOE\_SEND\_MOTM}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00790}00790                         ourmsg = (\textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__init__data}{ngpppoe\_init\_data}} *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00791}00791                         if (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} < \textcolor{keyword}{sizeof}(*ourmsg)) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00792}00792                                 log(LOG\_ERR, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: init data too "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00793}00793                                     \textcolor{stringliteral}{"{}small\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00794}00794                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EMSGSIZE);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00795}00795                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00796}00796                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a6a04f9846010e9b53385e9f6b7ec1b74}{NGM\_PPPOE\_SEND\_HURL}} ||}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00797}00797                             msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3ad51da1b2c90da47fd5ff90a043ede5f3}{NGM\_PPPOE\_SEND\_MOTM}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00798}00798                                 \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} -\/ \textcolor{keyword}{sizeof}(*ourmsg) >}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00799}00799                                     \mbox{\hyperlink{ng__pppoe_8h_ad124004584a9818d91098dfe658da1ac}{PPPOE\_PADM\_VALUE\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00800}00800                                         log(LOG\_ERR, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: message "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00801}00801                                             \textcolor{stringliteral}{"{}too big\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00802}00802                                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EMSGSIZE);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00803}00803                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00804}00804                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00805}00805                                 \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} -\/ \textcolor{keyword}{sizeof}(*ourmsg) >}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00806}00806                                     \mbox{\hyperlink{ng__pppoe_8h_a693bcdbde52e9b2f37d2cf02c222224c}{PPPOE\_SERVICE\_NAME\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00807}00807                                         log(LOG\_ERR, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: service name "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00808}00808                                             \textcolor{stringliteral}{"{}too big\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00809}00809                                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EMSGSIZE);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00810}00810                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00811}00811                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00812}00812                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} -\/ \textcolor{keyword}{sizeof}(*ourmsg) <}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00813}00813                             ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00814}00814                                 log(LOG\_ERR, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: init data has bad "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00815}00815                                     \textcolor{stringliteral}{"{}length, \%d should be \%zd\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00816}00816                                     ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00817}00817                                     msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} -\/ sizeof (*ourmsg));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00818}00818                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EMSGSIZE);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00819}00819                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00820}00820 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00821}00821                         \textcolor{comment}{/* Make sure strcmp will terminate safely. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00822}00822                         ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a5a3dca6f788ce5dcb9e32492e02223db}{hook}}[\textcolor{keyword}{sizeof}(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a5a3dca6f788ce5dcb9e32492e02223db}{hook}}) -\/ 1] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00823}00823 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00824}00824                         \textcolor{comment}{/* Find hook by name. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00825}00825                         \mbox{\hyperlink{structngpppoe__init__data_a5a3dca6f788ce5dcb9e32492e02223db}{hook}} = \mbox{\hyperlink{netgraph_8h_afe7f3ef6e4db622ef5c1578ba08d3d9c}{ng\_findhook}}(node, ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a5a3dca6f788ce5dcb9e32492e02223db}{hook}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00826}00826                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structngpppoe__init__data_a5a3dca6f788ce5dcb9e32492e02223db}{hook}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00827}00827                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOENT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00828}00828 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00829}00829                         sp = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(\mbox{\hyperlink{structngpppoe__init__data_a5a3dca6f788ce5dcb9e32492e02223db}{hook}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00830}00830                         \textcolor{keywordflow}{if} (sp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00831}00831                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00832}00832 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00833}00833                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3abe5e14709c69363de21505e396d60da6}{NGM\_PPPOE\_LISTEN}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00834}00834                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00835}00835 \textcolor{comment}{                                 * Ensure we aren't already listening for this}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00836}00836 \textcolor{comment}{                                 * service.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00837}00837 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00838}00838                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__pppoe_8c_a2b7bcb986c8a28a16130242b83a74a17}{pppoe\_find\_svc}}(node, ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00839}00839                                     ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}}) != NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00840}00840                                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EEXIST);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00841}00841                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00842}00842 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00843}00843                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00844}00844 \textcolor{comment}{                         * PPPOE\_SERVICE advertisements are set up}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00845}00845 \textcolor{comment}{                         * on sessions that are in PRIMED state.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00846}00846 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00847}00847                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a0a336c1715f2c1ac0312df74971ef269}{NGM\_PPPOE\_SERVICE}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00848}00848                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00849}00849 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00850}00850                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00851}00851 \textcolor{comment}{                         * PADM messages are set up on active sessions.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00852}00852 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00853}00853                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a6a04f9846010e9b53385e9f6b7ec1b74}{NGM\_PPPOE\_SEND\_HURL}} ||}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00854}00854                             msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3ad51da1b2c90da47fd5ff90a043ede5f3}{NGM\_PPPOE\_SEND\_MOTM}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00855}00855                                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a110422095d7a14bc807d39e06449d834}{PPPOE\_NEWCONNECTED}} \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00856}00856                                     sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{PPPOE\_CONNECTED}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00857}00857                                         log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: session is not "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00858}00858                                             \textcolor{stringliteral}{"{}active\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00859}00859                                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EISCONN);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00860}00860                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00861}00861                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00862}00862                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00863}00863 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00864}00864                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a6ed962cbe8ef75d93c81b0d0de5dab2a}{PPPOE\_SNONE}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00865}00865                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: Session already "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00866}00866                                     \textcolor{stringliteral}{"{}active\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00867}00867                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EISCONN);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00868}00868                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00869}00869 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00870}00870                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00871}00871 \textcolor{comment}{                         * Set up prototype header.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00872}00872 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00873}00873                         neg = malloc(\textcolor{keyword}{sizeof}(*neg), \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00874}00874                             M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00875}00875 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00876}00876                         \textcolor{keywordflow}{if} (neg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00877}00877                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00878}00878 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00879}00879                         neg-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}} = m\_getcl(M\_NOWAIT, MT\_DATA, M\_PKTHDR);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00880}00880                         \textcolor{keywordflow}{if} (neg-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00881}00881                                 free(neg, \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00882}00882                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00883}00883                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00884}00884                         neg-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}-\/>m\_pkthdr.rcvif = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00885}00885                         sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}} = neg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00886}00886                         \mbox{\hyperlink{netgraph_8h_a86218dc6ee6651399a66c7cbcba144e4}{ng\_callout\_init}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00887}00887                         neg-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}-\/>m\_len = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00888}00888                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}} = mtod(neg-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}, \textcolor{keyword}{union} \mbox{\hyperlink{unionpacket}{packet}}*);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00889}00889                         memcpy((\textcolor{keywordtype}{void} *)\&neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00890}00890                             \&privp-\/>eh, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ether\_header));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00891}00891                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_ab0a8fcf86b0878f9a88d4879e0e70424}{ver}} = 0x1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00892}00892                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_a95a4e1fe154420387c637c25f6151493}{type}} = 0x1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00893}00893                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_a6542f0408c34f233fdae67e9e3789887}{sid}} = 0x0000;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00894}00894                         neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00895}00895 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00896}00896                         sp-\/>\mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{creator}} = \mbox{\hyperlink{netgraph_8h_a5f4f927f601a420c5dfec90ceedbcbf2}{NGI\_RETADDR}}(item);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00897}00897                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00898}00898                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00899}00899                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a3534eb7bbd0709dcd3f4d180dd042015}{NGM\_PPPOE\_GET\_STATUS}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00900}00900                     \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00901}00901                         \textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoestat}{ngpppoestat}} *\mbox{\hyperlink{structstats}{stats}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00902}00902 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00903}00903                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{structstats}{stats}}), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00904}00904                         \textcolor{keywordflow}{if} (!resp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00905}00905                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00906}00906 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00907}00907                         \mbox{\hyperlink{structstats}{stats}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoestat}{ngpppoestat}} *) resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00908}00908                         \mbox{\hyperlink{structstats}{stats}}-\/>packets\_in = privp-\/>packets\_in;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00909}00909                         \mbox{\hyperlink{structstats}{stats}}-\/>packets\_out = privp-\/>packets\_out;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00910}00910                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00911}00911                     \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00912}00912                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a5de3a72ede166fe167268f1ac27f9872}{NGM\_PPPOE\_CONNECT}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00913}00913                     \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00914}00914                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00915}00915 \textcolor{comment}{                         * Check the hook exists and is Uninitialised.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00916}00916 \textcolor{comment}{                         * Send a PADI request, and start the timeout logic.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00917}00917 \textcolor{comment}{                         * Store the originator of this message so we can send}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00918}00918 \textcolor{comment}{                         * a success or fail message to them later.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00919}00919 \textcolor{comment}{                         * Move the session to SINIT.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00920}00920 \textcolor{comment}{                         * Set up the session to the correct state and}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00921}00921 \textcolor{comment}{                         * start it.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00922}00922 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00923}00923                         \textcolor{keywordtype}{int}     acnpos, acnlen = 0, acnsep = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00924}00924                         \textcolor{keywordtype}{int}     hupos, hulen = 0, husep = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00925}00925                         \textcolor{keywordtype}{int}     i, srvpos, srvlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00926}00926                         acnpos = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00927}00927                         \textcolor{keywordflow}{for} (i = 0; i < ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00928}00928                                 \textcolor{keywordflow}{if} (ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}[i] == \textcolor{charliteral}{'\(\backslash\)\(\backslash\)'}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00929}00929                                         acnlen = i;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00930}00930                                         acnsep = 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00931}00931                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00932}00932                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00933}00933                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00934}00934                         hupos = acnlen + acnsep;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00935}00935                         \textcolor{keywordflow}{for} (i = hupos; i < ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00936}00936                                 \textcolor{keywordflow}{if} (ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}[i] == \textcolor{charliteral}{'|'}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00937}00937                                         hulen = i -\/ hupos;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00938}00938                                         husep = 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00939}00939                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00940}00940                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00941}00941                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00942}00942                         srvpos = hupos + hulen + husep;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00943}00943                         srvlen = ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}} -\/ srvpos;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00944}00944 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00945}00945                         bcopy(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}} + acnpos, neg-\/>\mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{ac\_name}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}, acnlen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00946}00946                         neg-\/>\mbox{\hyperlink{structsess__neg_a18906af455bd1c43ae891b61ecf16ac2}{ac\_name\_len}} = acnlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00947}00947 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00948}00948                         neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} = \mbox{\hyperlink{ng__pppoe_8h_a9fa9dce8e1b8ba78fb44c9fe8410100d}{PTT\_HOST\_UNIQ}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00949}00949                         \textcolor{keywordflow}{if} (hulen == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00950}00950                                 \textcolor{comment}{/* Not provided, generate one */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00951}00951                                 neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} = htons(\textcolor{keyword}{sizeof}(sp));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00952}00952                                 bcopy(\&sp, neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}, \textcolor{keyword}{sizeof}(sp));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00953}00953                                 neg-\/>\mbox{\hyperlink{structsess__neg_acdae09368fc466d20e5366e35f2e1a07}{host\_uniq\_len}} = \textcolor{keyword}{sizeof}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00954}00954                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (hulen > 2 \&\& ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}[hupos] == \textcolor{charliteral}{'0'} \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00955}00955                           ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}[hupos + 1] == \textcolor{charliteral}{'x'} \&\& hulen \% 2 == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00956}00956                                 \textcolor{comment}{/* Hex encoded */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00957}00957                                 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} hexdig[16] = \textcolor{stringliteral}{"{}0123456789abcdef"{}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00958}00958                                 \textcolor{keywordtype}{int} j;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00959}00959 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00960}00960                                 neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} = htons((uint16\_t)(hulen / 2 -\/ 1));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00961}00961                                 \textcolor{keywordflow}{for} (i = 0; i < hulen -\/ 2; i++) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00962}00962                                         \textcolor{keywordflow}{for} (j = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00963}00963                                              j < 16 \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00964}00964                                              ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}[hupos + 2 + i] != hexdig[j];}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00965}00965                                              j++);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00966}00966                                         \textcolor{keywordflow}{if} (j == 16)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00967}00967                                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00968}00968                                         \textcolor{keywordflow}{if} (i \% 2 == 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00969}00969                                                 neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}[i / 2] = j << 4;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00970}00970                                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00971}00971                                                 neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}[i / 2] |= j;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00972}00972                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00973}00973                                 neg-\/>\mbox{\hyperlink{structsess__neg_acdae09368fc466d20e5366e35f2e1a07}{host\_uniq\_len}} = hulen / 2 -\/ 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00974}00974                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00975}00975                                 \textcolor{comment}{/* Plain string */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00976}00976                                 neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} = htons((uint16\_t)hulen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00977}00977                                 bcopy(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}} + hupos, neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}, hulen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00978}00978                                 neg-\/>\mbox{\hyperlink{structsess__neg_acdae09368fc466d20e5366e35f2e1a07}{host\_uniq\_len}} = hulen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00979}00979                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00980}00980 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00981}00981                         neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} = \mbox{\hyperlink{ng__pppoe_8h_aa37c7d47f38ff53ac0dd856d9533b8e2}{PTT\_SRV\_NAME}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00982}00982                         neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} = htons((uint16\_t)srvlen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00983}00983                         bcopy(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}} + srvpos, neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}}, srvlen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00984}00984                         neg-\/>\mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{service\_len}} = srvlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00985}00985                         NET\_EPOCH\_ENTER(et);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00986}00986                         \mbox{\hyperlink{ng__pppoe_8c_abba562aea9cdad23262f7e965d63bde3}{pppoe\_start}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00987}00987                         NET\_EPOCH\_EXIT(et);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00988}00988                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00989}00989                     \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00990}00990                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3abe5e14709c69363de21505e396d60da6}{NGM\_PPPOE\_LISTEN}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00991}00991                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00992}00992 \textcolor{comment}{                         * Check the hook exists and is Uninitialised.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00993}00993 \textcolor{comment}{                         * Install the service matching string.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00994}00994 \textcolor{comment}{                         * Store the originator of this message so we can send}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00995}00995 \textcolor{comment}{                         * a success or fail message to them later.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00996}00996 \textcolor{comment}{                         * Move the hook to 'LISTENING'}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00997}00997 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00998}00998                         neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} = \mbox{\hyperlink{ng__pppoe_8h_aa37c7d47f38ff53ac0dd856d9533b8e2}{PTT\_SRV\_NAME}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l00999}00999                         neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} =}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01000}01000                             htons((uint16\_t)ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01001}01001 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01002}01002                         \textcolor{keywordflow}{if} (ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01003}01003                                 bcopy(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}, neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01004}01004                                     ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01005}01005                         neg-\/>\mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{service\_len}} = ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01006}01006                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_a84cfd1ab04f5e0d6207a6c9b8a2fde8b}{PADT\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01007}01007                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01008}01008 \textcolor{comment}{                         * Wait for PADI packet coming from Ethernet.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01009}01009 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01010}01010                         sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad99f69c3e7ba206e04f4e9883d6434e6}{PPPOE\_LISTENING}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01011}01011                         LIST\_INSERT\_HEAD(\&privp-\/>listeners, sp, sessions);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01012}01012                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01013}01013                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3aa1a4d5b0ac6d938146ae6560ae027680}{NGM\_PPPOE\_OFFER}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01014}01014                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01015}01015 \textcolor{comment}{                         * Check the hook exists and is Uninitialised.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01016}01016 \textcolor{comment}{                         * Store the originator of this message so we can send}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01017}01017 \textcolor{comment}{                         * a success of fail message to them later.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01018}01018 \textcolor{comment}{                         * Store the AC-\/Name given and go to PRIMED.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01019}01019 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01020}01020                         neg-\/>\mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{ac\_name}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} = \mbox{\hyperlink{ng__pppoe_8h_a17138947ce15d5fe0c81edbb14f7d496}{PTT\_AC\_NAME}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01021}01021                         neg-\/>\mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{ac\_name}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} =}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01022}01022                             htons((uint16\_t)ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01023}01023                         \textcolor{keywordflow}{if} (ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01024}01024                                 bcopy(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}, neg-\/>\mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{ac\_name}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01025}01025                                     ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01026}01026                         neg-\/>\mbox{\hyperlink{structsess__neg_a18906af455bd1c43ae891b61ecf16ac2}{ac\_name\_len}} = ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01027}01027                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_a28e6118d88a2f04e22b7fd1d8112d983}{PADO\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01028}01028                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01029}01029 \textcolor{comment}{                         * Wait for PADI packet coming from hook.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01030}01030 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01031}01031                         sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad6677ab0255fdfa44c4a521177196093}{PPPOE\_PRIMED}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01032}01032                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01033}01033                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a0a336c1715f2c1ac0312df74971ef269}{NGM\_PPPOE\_SERVICE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01034}01034                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01035}01035 \textcolor{comment}{                         * Check the session is primed.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01036}01036 \textcolor{comment}{                         * for now just allow ONE service to be advertised.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01037}01037 \textcolor{comment}{                         * If you do it twice you just overwrite.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01038}01038 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01039}01039                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad6677ab0255fdfa44c4a521177196093}{PPPOE\_PRIMED}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01040}01040                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: session not "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01041}01041                                     \textcolor{stringliteral}{"{}primed\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01042}01042                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EISCONN);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01043}01043                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01044}01044                         neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01045}01045                         neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} = \mbox{\hyperlink{ng__pppoe_8h_aa37c7d47f38ff53ac0dd856d9533b8e2}{PTT\_SRV\_NAME}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01046}01046                         neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} =}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01047}01047                             htons((uint16\_t)ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01048}01048 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01049}01049                         \textcolor{keywordflow}{if} (ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01050}01050                                 bcopy(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}, neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01051}01051                                     ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01052}01052                         neg-\/>\mbox{\hyperlink{structsess__neg_a1b5dbbe2fa562af6a8a22dbf8d0e93ae}{service\_len}} = ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01053}01053                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01054}01054                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a799551edd84cd037841b08fcc50d333b}{NGM\_PPPOE\_SETMODE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01055}01055                     \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01056}01056                         \textcolor{keywordtype}{char} *s;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01057}01057                         \textcolor{keywordtype}{size\_t} len;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01058}01058 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01059}01059                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} == 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01060}01060                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01061}01061 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01062}01062                         s = (\textcolor{keywordtype}{char} *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01063}01063                         len = msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01064}01064 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01065}01065                         \textcolor{comment}{/* Search for matching mode string. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01066}01066                         if (len == strlen(\mbox{\hyperlink{ng__pppoe_8h_a80f45969084f1ce1ee49f9114d57a3a3}{NG\_PPPOE\_STANDARD}}) \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01067}01067                             (strncmp(\mbox{\hyperlink{ng__pppoe_8h_a80f45969084f1ce1ee49f9114d57a3a3}{NG\_PPPOE\_STANDARD}}, s, len) == 0)) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01068}01068                                 privp-\/>flags = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01069}01069                                 privp-\/>eh.ether\_type = \mbox{\hyperlink{ng__pppoe_8h_ab952530e40d18b6a6bd01d7bb7680d7b}{ETHERTYPE\_PPPOE\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01070}01070                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01071}01071                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01072}01072                         \textcolor{keywordflow}{if} (len == strlen(\mbox{\hyperlink{ng__pppoe_8h_a239ab4ca7e3868e0c79ceeaee4f8e310}{NG\_PPPOE\_3COM}}) \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01073}01073                             (strncmp(\mbox{\hyperlink{ng__pppoe_8h_a239ab4ca7e3868e0c79ceeaee4f8e310}{NG\_PPPOE\_3COM}}, s, len) == 0)) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01074}01074                                 privp-\/>flags |= \mbox{\hyperlink{ng__pppoe_8c_a678f30c81e89ed94377301a04a43416e}{COMPAT\_3COM}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01075}01075                                 privp-\/>eh.ether\_type =}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01076}01076                                     \mbox{\hyperlink{ng__pppoe_8h_a3ddeaa4abae17dfb1aa83c8d98bd4032}{ETHERTYPE\_PPPOE\_3COM\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01077}01077                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01078}01078                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01079}01079                         \textcolor{keywordflow}{if} (len == strlen(\mbox{\hyperlink{ng__pppoe_8h_a75e66c7020fe758e482946b5abfa9535}{NG\_PPPOE\_DLINK}}) \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01080}01080                             (strncmp(\mbox{\hyperlink{ng__pppoe_8h_a75e66c7020fe758e482946b5abfa9535}{NG\_PPPOE\_DLINK}}, s, len) == 0)) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01081}01081                                 privp-\/>flags |= \mbox{\hyperlink{ng__pppoe_8c_aae1233f77aa0adb81c4b32d87b5133ad}{COMPAT\_DLINK}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01082}01082                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01083}01083                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01084}01084                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01085}01085                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01086}01086                     \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01087}01087                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a94ea489afa001a5915672145f7e756f7}{NGM\_PPPOE\_GETMODE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01088}01088                     \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01089}01089                         \textcolor{keywordtype}{char} *s;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01090}01090                         \textcolor{keywordtype}{size\_t} len = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01091}01091 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01092}01092                         \textcolor{keywordflow}{if} (privp-\/>flags == 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01093}01093                                 len += strlen(\mbox{\hyperlink{ng__pppoe_8h_a80f45969084f1ce1ee49f9114d57a3a3}{NG\_PPPOE\_STANDARD}}) + 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01094}01094                         \textcolor{keywordflow}{if} (privp-\/>flags \& \mbox{\hyperlink{ng__pppoe_8c_a678f30c81e89ed94377301a04a43416e}{COMPAT\_3COM}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01095}01095                                 len += strlen(\mbox{\hyperlink{ng__pppoe_8h_a239ab4ca7e3868e0c79ceeaee4f8e310}{NG\_PPPOE\_3COM}}) + 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01096}01096                         \textcolor{keywordflow}{if} (privp-\/>flags \& \mbox{\hyperlink{ng__pppoe_8c_aae1233f77aa0adb81c4b32d87b5133ad}{COMPAT\_DLINK}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01097}01097                                 len += strlen(\mbox{\hyperlink{ng__pppoe_8h_a75e66c7020fe758e482946b5abfa9535}{NG\_PPPOE\_DLINK}}) + 1;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01098}01098 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01099}01099                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, len, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01100}01100                         \textcolor{keywordflow}{if} (resp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01101}01101                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01102}01102 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01103}01103                         s = (\textcolor{keywordtype}{char} *)resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01104}01104                         if (privp-\/>flags == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01105}01105                                 len = strlen(\mbox{\hyperlink{ng__pppoe_8h_a80f45969084f1ce1ee49f9114d57a3a3}{NG\_PPPOE\_STANDARD}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01106}01106                                 strlcpy(s, \mbox{\hyperlink{ng__pppoe_8h_a80f45969084f1ce1ee49f9114d57a3a3}{NG\_PPPOE\_STANDARD}}, len + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01107}01107                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01108}01108                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01109}01109                         \textcolor{keywordflow}{if} (privp-\/>flags \& \mbox{\hyperlink{ng__pppoe_8c_a678f30c81e89ed94377301a04a43416e}{COMPAT\_3COM}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01110}01110                                 len = strlen(\mbox{\hyperlink{ng__pppoe_8h_a239ab4ca7e3868e0c79ceeaee4f8e310}{NG\_PPPOE\_3COM}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01111}01111                                 strlcpy(s, \mbox{\hyperlink{ng__pppoe_8h_a239ab4ca7e3868e0c79ceeaee4f8e310}{NG\_PPPOE\_3COM}}, len + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01112}01112                                 s += len;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01113}01113                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01114}01114                         \textcolor{keywordflow}{if} (privp-\/>flags \& \mbox{\hyperlink{ng__pppoe_8c_aae1233f77aa0adb81c4b32d87b5133ad}{COMPAT\_DLINK}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01115}01115                                 \textcolor{keywordflow}{if} (s != resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01116}01116                                         *s++ = \textcolor{charliteral}{'|'};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01117}01117                                 len = strlen(\mbox{\hyperlink{ng__pppoe_8h_a75e66c7020fe758e482946b5abfa9535}{NG\_PPPOE\_DLINK}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01118}01118                                 strlcpy(s, \mbox{\hyperlink{ng__pppoe_8h_a75e66c7020fe758e482946b5abfa9535}{NG\_PPPOE\_DLINK}}, len + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01119}01119                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01120}01120                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01121}01121                     \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01122}01122                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a6aa60a578c6307afc1ec46b259951c6f}{NGM\_PPPOE\_SETENADDR}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01123}01123                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != ETHER\_ADDR\_LEN)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01124}01124                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01125}01125                         bcopy(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}, \&privp-\/>eh.ether\_shost,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01126}01126                             ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01127}01127                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01128}01128                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a50f9bfcb6d5b7c23b94c6ca85ba908ce}{NGM\_PPPOE\_SETMAXP}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01129}01129                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != \textcolor{keyword}{sizeof}(uint16\_t))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01130}01130                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01131}01131                         privp-\/>max\_payload.hdr.tag\_type = \mbox{\hyperlink{ng__pppoe_8h_aedd791704cf3ed9e33cb955d15181239}{PTT\_MAX\_PAYL}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01132}01132                         privp-\/>max\_payload.hdr.tag\_len = htons(\textcolor{keyword}{sizeof}(uint16\_t));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01133}01133                         privp-\/>max\_payload.data = htons(*((uint16\_t *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01134}01134                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01135}01135                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a6a04f9846010e9b53385e9f6b7ec1b74}{NGM\_PPPOE\_SEND\_HURL}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01136}01136                     \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01137}01137                         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01138}01138 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01139}01139                         \textcolor{comment}{/* Generate a packet of that type. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01140}01140                         m = m\_gethdr(M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01141}01141                         \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01142}01142                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: session out of "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01143}01143                                     \textcolor{stringliteral}{"{}mbufs\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01144}01144                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01145}01145                                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *wh;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01146}01146                                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01147}01147                                 \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01148}01148 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01149}01149                                 wh = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01150}01150                                 bcopy(\&sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}, wh, \textcolor{keyword}{sizeof}(*wh));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01151}01151 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01152}01152                                 \textcolor{comment}{/* Revert the stored header to DISC/PADM mode. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01153}01153                                 wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_a7e735049083864d166aaecf240925817}{PADM\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01154}01154                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01155}01155 \textcolor{comment}{                                 * Configure ethertype depending on what}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01156}01156 \textcolor{comment}{                                 * was used during sessions stage.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01157}01157 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01158}01158                                 \textcolor{keywordflow}{if} (wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type ==}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01159}01159                                     \mbox{\hyperlink{ng__pppoe_8h_a0867ea8a762dbf215bfdb41f51479859}{ETHERTYPE\_PPPOE\_3COM\_SESS}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01160}01160                                         wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type = \mbox{\hyperlink{ng__pppoe_8h_a3ddeaa4abae17dfb1aa83c8d98bd4032}{ETHERTYPE\_PPPOE\_3COM\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01161}01161                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01162}01162                                         wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type = \mbox{\hyperlink{ng__pppoe_8h_ab952530e40d18b6a6bd01d7bb7680d7b}{ETHERTYPE\_PPPOE\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01163}01163                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01164}01164 \textcolor{comment}{                                 * Add PADM message and adjust sizes.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01165}01165 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01166}01166                                 tag = (\textcolor{keywordtype}{void} *)(\&wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}} + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01167}01167                                 tag-\/>\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} = \mbox{\hyperlink{ng__pppoe_8h_a9e1f1c896119abf52ed215cb2e2774ed}{PTT\_HURL}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01168}01168                                 tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} = htons(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01169}01169                                 strncpy((\textcolor{keywordtype}{char} *)(tag + 1), ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}, ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01170}01170                                 m-\/>m\_pkthdr.len = m-\/>m\_len = \textcolor{keyword}{sizeof}(*wh) + \textcolor{keyword}{sizeof}(*tag) +}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01171}01171                                     ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01172}01172                                 wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_acdfbf6a1eca39566f6802904d92de3f5}{length}} = htons(\textcolor{keyword}{sizeof}(*tag) + ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01173}01173                                 NET\_EPOCH\_ENTER(et);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01174}01174                                 \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}(error,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01175}01175                                     privp-\/>ethernet\_hook, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01176}01176                                 NET\_EPOCH\_EXIT(et);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01177}01177                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01178}01178                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01179}01179                     \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01180}01180                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3ad51da1b2c90da47fd5ff90a043ede5f3}{NGM\_PPPOE\_SEND\_MOTM}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01181}01181                     \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01182}01182                         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01183}01183 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01184}01184                         \textcolor{comment}{/* Generate a packet of that type. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01185}01185                         m = m\_gethdr(M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01186}01186                         \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01187}01187                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: session out of "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01188}01188                                     \textcolor{stringliteral}{"{}mbufs\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01189}01189                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01190}01190                                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *wh;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01191}01191                                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01192}01192                                 \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01193}01193 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01194}01194                                 wh = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01195}01195                                 bcopy(\&sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}, wh, \textcolor{keyword}{sizeof}(*wh));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01196}01196 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01197}01197                                 \textcolor{comment}{/* Revert the stored header to DISC/PADM mode. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01198}01198                                 wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_a7e735049083864d166aaecf240925817}{PADM\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01199}01199                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01200}01200 \textcolor{comment}{                                 * Configure ethertype depending on what}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01201}01201 \textcolor{comment}{                                 * was used during sessions stage.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01202}01202 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01203}01203                                 \textcolor{keywordflow}{if} (wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type ==}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01204}01204                                     \mbox{\hyperlink{ng__pppoe_8h_a0867ea8a762dbf215bfdb41f51479859}{ETHERTYPE\_PPPOE\_3COM\_SESS}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01205}01205                                         wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type = \mbox{\hyperlink{ng__pppoe_8h_a3ddeaa4abae17dfb1aa83c8d98bd4032}{ETHERTYPE\_PPPOE\_3COM\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01206}01206                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01207}01207                                         wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type = \mbox{\hyperlink{ng__pppoe_8h_ab952530e40d18b6a6bd01d7bb7680d7b}{ETHERTYPE\_PPPOE\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01208}01208                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01209}01209 \textcolor{comment}{                                 * Add PADM message and adjust sizes.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01210}01210 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01211}01211                                 tag = (\textcolor{keywordtype}{void} *)(\&wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}} + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01212}01212                                 tag-\/>\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} = \mbox{\hyperlink{ng__pppoe_8h_a77b13dff29b8c71a458c266baee74ed3}{PTT\_MOTM}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01213}01213                                 tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} = htons(ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01214}01214                                 strncpy((\textcolor{keywordtype}{char} *)(tag + 1), ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_ad814042c2237395b099176a5f5f924ae}{data}}, ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01215}01215                                 m-\/>m\_pkthdr.len = m-\/>m\_len = \textcolor{keyword}{sizeof}(*wh) + \textcolor{keyword}{sizeof}(*tag) +}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01216}01216                                     ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01217}01217                                 wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_acdfbf6a1eca39566f6802904d92de3f5}{length}} = htons(\textcolor{keyword}{sizeof}(*tag) + ourmsg-\/>\mbox{\hyperlink{structngpppoe__init__data_a7dd65dbcf0fac3cd304d4030bdc4ad24}{data\_len}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01218}01218                                 NET\_EPOCH\_ENTER(et);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01219}01219                                 \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}(error,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01220}01220                                     privp-\/>ethernet\_hook, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01221}01221                                 NET\_EPOCH\_EXIT(et);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01222}01222                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01223}01223                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01224}01224                     \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01225}01225                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01226}01226                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01227}01227                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01228}01228                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01229}01229         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ether_8h_a16f0a23929224d5ef661fe83f70d460a}{NGM\_ETHER\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01230}01230                 \textcolor{keywordflow}{if} (!(msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_afb60eeac4395f18a7900d6bd5b0f35a6}{flags}} \& \mbox{\hyperlink{ng__message_8h_a5fe4082cbb0ac2567dde73b46d0eabd3}{NGF\_RESP}}))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01231}01231                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01232}01232                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01233}01233                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ether_8h_a16685eea158879e41b101ca3634de462ae9ab89debdb44fc473eb24d50d11e47e}{NGM\_ETHER\_GET\_ENADDR}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01234}01234                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != ETHER\_ADDR\_LEN)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01235}01235                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01236}01236                         bcopy(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}, \&privp-\/>eh.ether\_shost,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01237}01237                             ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01238}01238                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01239}01239                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01240}01240                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01241}01241                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01242}01242                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01243}01243         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01244}01244                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01245}01245         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01246}01246 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01247}01247         \textcolor{comment}{/* Take care of synchronous response, if any. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01248}01248 quit:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01249}01249         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: returning \%d"{}}, \_\_func\_\_, error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01250}01250         \mbox{\hyperlink{netgraph_8h_a69db50ed7f968e936580df029ab5c5dc}{NG\_RESPOND\_MSG}}(error, node, item, resp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01251}01251         \textcolor{comment}{/* Free the message and return. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01252}01252         \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01253}01253         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01254}01254 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01255}01255 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01256}01256 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01257}01257 \textcolor{comment}{ * Start a client into the first state. A separate function because}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01258}01258 \textcolor{comment}{ * it can be needed if the negotiation times out.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01259}01259 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01260}01260 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01261}\mbox{\hyperlink{ng__pppoe_8c_abba562aea9cdad23262f7e965d63bde3}{01261}} \mbox{\hyperlink{ng__pppoe_8c_abba562aea9cdad23262f7e965d63bde3}{pppoe\_start}}(\mbox{\hyperlink{structsess__con}{sessp}} sp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01262}01262 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01263}01263         \mbox{\hyperlink{structng__hook}{hook\_p}}    hook = sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01264}01264         \mbox{\hyperlink{structng__node}{node\_p}}    node = \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01265}01265         \mbox{\hyperlink{structnetflow}{priv\_p}}    privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01266}01266         \mbox{\hyperlink{structsess__neg}{negp}}        neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01267}01267         \textcolor{keyword}{struct  }mbuf *m0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01268}01268         \textcolor{keywordtype}{int}     error;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01269}01269 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01270}01270         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01271}01271 \textcolor{comment}{         * Kick the state machine into starting up.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01272}01272 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01273}01273         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01274}01274         sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90abce7db6df3b3336b58aac2dc709eae8a}{PPPOE\_SINIT}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01275}01275         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01276}01276 \textcolor{comment}{         * Reset the packet header to broadcast. Since we are}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01277}01277 \textcolor{comment}{         * in a client mode use configured ethertype.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01278}01278 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01279}01279         memcpy((\textcolor{keywordtype}{void} *)\&neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}, \&privp-\/>eh,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01280}01280             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ether\_header));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01281}01281         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_adf504c22bf0a15e4e1994cc6251aaa27}{PADI\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01282}01282         \mbox{\hyperlink{ng__pppoe_8c_a197d647e712fe59b6e1781df4612805b}{init\_tags}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01283}01283         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, \&neg-\/>\mbox{\hyperlink{structsess__neg_addb2b09bd3a2097e2822ea0800111630}{host\_uniq}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01284}01284         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, \&neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01285}01285         \textcolor{keywordflow}{if} (privp-\/>max\_payload.data != 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01286}01286                 \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, \&privp-\/>max\_payload.hdr);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01287}01287         \mbox{\hyperlink{ng__pppoe_8c_a63d11938f3f1ae308335fe07300d774f}{make\_packet}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01288}01288         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01289}01289 \textcolor{comment}{         * Send packet and prepare to retransmit it after timeout.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01290}01290 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01291}01291         \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node, hook, \mbox{\hyperlink{ng__pppoe_8h_af025b8b52a2f007f394edf51d5e90deb}{PPPOE\_INITIAL\_TIMEOUT}} * hz,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01292}01292             \mbox{\hyperlink{ng__pppoe_8c_afa3a5587fc09b4ea57d954ed91d068b0}{pppoe\_ticker}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01293}01293         neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} = \mbox{\hyperlink{ng__pppoe_8h_af025b8b52a2f007f394edf51d5e90deb}{PPPOE\_INITIAL\_TIMEOUT}} * 2;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01294}01294         m0 = m\_copypacket(neg-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01295}01295         \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}(error, privp-\/>ethernet\_hook, m0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01296}01296 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01297}01297 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01298}01298 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01299}\mbox{\hyperlink{ng__pppoe_8c_a890d400c93a9a5a620eda2bf555f5b60}{01299}} \mbox{\hyperlink{ng__pppoe_8c_a890d400c93a9a5a620eda2bf555f5b60}{send\_acname}}(\mbox{\hyperlink{structsess__con}{sessp}} sp, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01300}01300 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01301}01301         \textcolor{keywordtype}{int} error, tlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01302}01302         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01303}01303         \textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__sts}{ngpppoe\_sts}} *sts;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01304}01304 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01305}01305         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01306}01306 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01307}01307         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}}, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a9f3018ec5bf5f1fbc0b74a4aaf079cc4}{NGM\_PPPOE\_ACNAME}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01308}01308             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structngpppoe__sts}{ngpppoe\_sts}}), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01309}01309         \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01310}01310                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01311}01311 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01312}01312         sts = (\textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__sts}{ngpppoe\_sts}} *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01313}01313         tlen = \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(\mbox{\hyperlink{ng__message_8h_a2fadb5752a5c456671b0aea53179c2dd}{NG\_HOOKSIZ}} -\/ 1, ntohs(tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01314}01314         strncpy(sts-\/>\mbox{\hyperlink{structngpppoe__sts_af40515689037405446667ab2c665c363}{hook}}, (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(tag + 1), tlen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01315}01315         sts-\/>\mbox{\hyperlink{structngpppoe__sts_af40515689037405446667ab2c665c363}{hook}}[tlen] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01316}01316         \mbox{\hyperlink{netgraph_8h_a90e963a02e95ae7964761de2122b5a88}{NG\_SEND\_MSG\_ID}}(error, \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}), msg, sp-\/>\mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{creator}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01317}01317 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01318}01318         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01319}01319 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01320}01320 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01321}01321 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01322}\mbox{\hyperlink{ng__pppoe_8c_a5955e6e51ecd8989fafe634e2a9325b8}{01322}} \mbox{\hyperlink{ng__pppoe_8c_a5955e6e51ecd8989fafe634e2a9325b8}{send\_sessionid}}(\mbox{\hyperlink{structsess__con}{sessp}} sp)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01323}01323 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01324}01324         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01325}01325         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01326}01326 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01327}01327         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01328}01328 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01329}01329         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}}, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3ae1f385e6f66f1a8c9673636166ed5c58}{NGM\_PPPOE\_SESSIONID}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01330}01330             \textcolor{keyword}{sizeof}(uint16\_t), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01331}01331         \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01332}01332                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01333}01333 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01334}01334         *(uint16\_t *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}} = sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01335}01335         \mbox{\hyperlink{netgraph_8h_a90e963a02e95ae7964761de2122b5a88}{NG\_SEND\_MSG\_ID}}(error, \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}), msg, sp-\/>\mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{creator}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01336}01336 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01337}01337         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01338}01338 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01339}01339 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01340}01340 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01341}\mbox{\hyperlink{ng__pppoe_8c_a8a26822d8c4b14d8bb1a1c25629a6778}{01341}} \mbox{\hyperlink{ng__pppoe_8c_a8a26822d8c4b14d8bb1a1c25629a6778}{send\_maxp}}(\mbox{\hyperlink{structsess__con}{sessp}} sp, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01342}01342 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01343}01343         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01344}01344         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01345}01345         \textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__maxp}{ngpppoe\_maxp}} *maxp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01346}01346 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01347}01347         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01348}01348 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01349}01349         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}}, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a50f9bfcb6d5b7c23b94c6ca85ba908ce}{NGM\_PPPOE\_SETMAXP}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01350}01350             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structngpppoe__maxp}{ngpppoe\_maxp}}), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01351}01351         \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01352}01352                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01353}01353 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01354}01354         maxp = (\textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__maxp}{ngpppoe\_maxp}} *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01355}01355         strncpy(maxp-\/>\mbox{\hyperlink{structngpppoe__maxp_a60f149b84edcedf4afc6e989c0de9910}{hook}}, \mbox{\hyperlink{netgraph_8h_ab077a5607cd5a2e82cc67326badd440a}{NG\_HOOK\_NAME}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}), \mbox{\hyperlink{ng__message_8h_a2fadb5752a5c456671b0aea53179c2dd}{NG\_HOOKSIZ}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01356}01356         maxp-\/>\mbox{\hyperlink{structngpppoe__maxp_aac47a131214d42805911dbafaf9ab021}{data}} = ntohs(((\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structmaxptag}{maxptag}} *)tag)-\/>\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01357}01357         \mbox{\hyperlink{netgraph_8h_a90e963a02e95ae7964761de2122b5a88}{NG\_SEND\_MSG\_ID}}(error, \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}), msg, sp-\/>\mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{creator}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01358}01358 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01359}01359         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01360}01360 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01361}01361 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01362}01362 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01363}\mbox{\hyperlink{ng__pppoe_8c_a20520861aa7bb00826436ccef6c314e6}{01363}} \mbox{\hyperlink{ng__pppoe_8c_a20520861aa7bb00826436ccef6c314e6}{send\_hurl}}(\mbox{\hyperlink{structsess__con}{sessp}} sp, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01364}01364 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01365}01365         \textcolor{keywordtype}{int} error, tlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01366}01366         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01367}01367         \textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__padm}{ngpppoe\_padm}} *padm;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01368}01368 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01369}01369         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01370}01370 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01371}01371         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}, \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}}, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3af8d46fd528e51a84338ad71946374815}{NGM\_PPPOE\_HURL}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01372}01372             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structngpppoe__padm}{ngpppoe\_padm}}), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01373}01373         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01374}01374                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01375}01375 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01376}01376         padm = (\textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__padm}{ngpppoe\_padm}} *)\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}-\/>data;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01377}01377         tlen = \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(\mbox{\hyperlink{ng__pppoe_8h_ad124004584a9818d91098dfe658da1ac}{PPPOE\_PADM\_VALUE\_SIZE}} -\/ 1, ntohs(tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01378}01378         strncpy(padm-\/>\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}, (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(tag + 1), tlen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01379}01379         padm-\/>\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}[tlen] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01380}01380         \mbox{\hyperlink{netgraph_8h_a90e963a02e95ae7964761de2122b5a88}{NG\_SEND\_MSG\_ID}}(error, \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}), \mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}, sp-\/>\mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{creator}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01381}01381 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01382}01382         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01383}01383 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01384}01384 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01385}01385 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01386}\mbox{\hyperlink{ng__pppoe_8c_a9f1b70969d2ebe2ee35b9a97838f83ec}{01386}} \mbox{\hyperlink{ng__pppoe_8c_a9f1b70969d2ebe2ee35b9a97838f83ec}{send\_motm}}(\mbox{\hyperlink{structsess__con}{sessp}} sp, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01387}01387 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01388}01388         \textcolor{keywordtype}{int} error, tlen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01389}01389         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01390}01390         \textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__padm}{ngpppoe\_padm}} *padm;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01391}01391 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01392}01392         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01393}01393 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01394}01394         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}, \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}}, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a0419cf2e9f8d7dd9c34a30ed6832fbfa}{NGM\_PPPOE\_MOTM}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01395}01395             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structngpppoe__padm}{ngpppoe\_padm}}), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01396}01396         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01397}01397                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01398}01398 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01399}01399         padm = (\textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__padm}{ngpppoe\_padm}} *)\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}-\/>data;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01400}01400         tlen = \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(\mbox{\hyperlink{ng__pppoe_8h_ad124004584a9818d91098dfe658da1ac}{PPPOE\_PADM\_VALUE\_SIZE}} -\/ 1, ntohs(tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01401}01401         strncpy(padm-\/>\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}, (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(tag + 1), tlen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01402}01402         padm-\/>\mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}[tlen] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01403}01403         \mbox{\hyperlink{netgraph_8h_a90e963a02e95ae7964761de2122b5a88}{NG\_SEND\_MSG\_ID}}(error, \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}), \mbox{\hyperlink{structngpppoe__padm_a62e6fe4762e5b1f4006095ce01471f6f}{msg}}, sp-\/>\mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{creator}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01404}01404 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01405}01405         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01406}01406 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01407}01407 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01408}01408 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01409}01409 \textcolor{comment}{ * Receive data from session hook and do something with it.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01410}01410 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01411}01411 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01412}\mbox{\hyperlink{ng__pppoe_8c_ae726d1bd7390562135145b7890744482}{01412}} \mbox{\hyperlink{ng__pppoe_8c_abb6de585a7d3e76319b91f2592a564c1}{ng\_pppoe\_rcvdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01413}01413 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01414}01414         \mbox{\hyperlink{structng__node}{node\_p}}                    node = \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01415}01415         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}}              privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01416}01416         \mbox{\hyperlink{structsess__con}{sessp}}                      sp = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01417}01417         \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}}     *wh;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01418}01418         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01419}01419         \textcolor{keywordtype}{int}                     error;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01420}01420 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01421}01421         CTR6(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: node [\%x] (\%p) received \%p on \(\backslash\)"{}\%s\(\backslash\)"{} (\%p)"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01422}01422             \_\_func\_\_, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}}, node, item, hook-\/>\mbox{\hyperlink{structng__hook_a1b5feb51d20fcb4e32d8542159b4abc6}{hk\_name}}, hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01423}01423 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01424}01424         \mbox{\hyperlink{netgraph_8h_abbb0acb5f480576cff9901caddeef57f}{NGI\_GET\_M}}(item, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01425}01425         \textcolor{keywordflow}{switch} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01426}01426         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a110422095d7a14bc807d39e06449d834}{PPPOE\_NEWCONNECTED}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01427}01427         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{PPPOE\_CONNECTED}}: \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01428}01428                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01429}01429 \textcolor{comment}{                 * Remove PPP address and control fields, if any.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01430}01430 \textcolor{comment}{                 * For example, ng\_ppp(4) always sends LCP packets}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01431}01431 \textcolor{comment}{                 * with address and control fields as required by}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01432}01432 \textcolor{comment}{                 * generic PPP. PPPoE is an exception to the rule.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01433}01433 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01434}01434                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len >= 2) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01435}01435                         \textcolor{keywordflow}{if} (m-\/>m\_len < 2 \&\& !(m = m\_pullup(m, 2)))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01436}01436                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01437}01437                         \textcolor{keywordflow}{if} (mtod(m, u\_char *)[0] == 0xff \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01438}01438                             mtod(m, u\_char *)[1] == 0x03)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01439}01439                                 m\_adj(m, 2);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01440}01440                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01441}01441                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01442}01442 \textcolor{comment}{                 * Bang in a pre-\/made header, and set the length up}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01443}01443 \textcolor{comment}{                 * to be correct. Then send it to the ethernet driver.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01444}01444 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01445}01445                 M\_PREPEND(m, \textcolor{keyword}{sizeof}(*wh), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01446}01446                 \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01447}01447                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01448}01448 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01449}01449                 wh = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01450}01450                 bcopy(\&sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}, wh, \textcolor{keyword}{sizeof}(*wh));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01451}01451                 wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_acdfbf6a1eca39566f6802904d92de3f5}{length}} = htons(m-\/>m\_pkthdr.len -\/ \textcolor{keyword}{sizeof}(*wh));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01452}01452                 \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, privp-\/>ethernet\_hook, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01453}01453                 privp-\/>packets\_out++;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01454}01454                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01455}01455                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01456}01456         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad6677ab0255fdfa44c4a521177196093}{PPPOE\_PRIMED}}: \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01457}01457                 \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01458}01458                         \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} hdr;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01459}01459                         \textcolor{keyword}{union   }\mbox{\hyperlink{unionuniq}{uniq}}        \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01460}01460                 \} \mbox{\hyperlink{ng__cisco_8c_a1560ce29ccb13330fd78e854ec096aec}{\_\_packed}}      uniqtag;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01461}01461                 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01462}01462                 \textcolor{keyword}{struct }mbuf     *m0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01463}01463                 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__hdr}{pppoe\_hdr}} *ph;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01464}01464                 \mbox{\hyperlink{structsess__neg}{negp}}                neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01465}01465                 uint8\_t         \mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01466}01466 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01467}01467                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01468}01468 \textcolor{comment}{                 * A PADI packet is being returned by the application}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01469}01469 \textcolor{comment}{                 * that has set up this hook. This indicates that it}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01470}01470 \textcolor{comment}{                 * wants us to offer service.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01471}01471 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01472}01472                 \textcolor{keywordflow}{if} (m-\/>m\_len < \textcolor{keyword}{sizeof}(*wh)) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01473}01473                         m = m\_pullup(m, \textcolor{keyword}{sizeof}(*wh));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01474}01474                         \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01475}01475                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01476}01476                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01477}01477                 wh = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01478}01478                 ph = \&wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01479}01479                 \mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01480}01480                 \textcolor{comment}{/* Use peers mode in session. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01481}01481                 neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type = wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01482}01482                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} != \mbox{\hyperlink{ng__pppoe_8h_adf504c22bf0a15e4e1994cc6251aaa27}{PADI\_CODE}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01483}01483                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01484}01484                 \mbox{\hyperlink{netgraph_8h_aabe13cf527f80501a761c71c9b4888db}{ng\_uncallout}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01485}01485 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01486}01486                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01487}01487 \textcolor{comment}{                 * This is the first time we hear}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01488}01488 \textcolor{comment}{                 * from the client, so note it's}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01489}01489 \textcolor{comment}{                 * unicast address, replacing the}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01490}01490 \textcolor{comment}{                 * broadcast address.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01491}01491 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01492}01492                 bcopy(wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_shost,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01493}01493                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_dhost,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01494}01494                         ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01495}01495                 sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a536520274a9f9359f0c7f0fa545fb734}{PPPOE\_SOFFER}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01496}01496                 neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01497}01497                 neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_a28e6118d88a2f04e22b7fd1d8112d983}{PADO\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01498}01498 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01499}01499                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01500}01500 \textcolor{comment}{                 * Start working out the tags to respond with.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01501}01501 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01502}01502                 uniqtag.hdr.tag\_type = \mbox{\hyperlink{ng__pppoe_8h_a0190a7a4e003483624b0ecefd7f1b104}{PTT\_AC\_COOKIE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01503}01503                 uniqtag.hdr.tag\_len = htons((u\_int16\_t)\textcolor{keyword}{sizeof}(sp));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01504}01504                 uniqtag.data.pointer = sp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01505}01505                 \mbox{\hyperlink{ng__pppoe_8c_a197d647e712fe59b6e1781df4612805b}{init\_tags}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01506}01506                 \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, \&neg-\/>\mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{ac\_name}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}); \textcolor{comment}{/* AC\_NAME */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01507}01507                 \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_aa37c7d47f38ff53ac0dd856d9533b8e2}{PTT\_SRV\_NAME}})))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01508}01508                         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, tag);    \textcolor{comment}{/* return service */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01509}01509                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01510}01510 \textcolor{comment}{                 * If we have a NULL service request}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01511}01511 \textcolor{comment}{                 * and have an extra service defined in this hook,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01512}01512 \textcolor{comment}{                 * then also add a tag for the extra service.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01513}01513 \textcolor{comment}{                 * XXX this is a hack. eventually we should be able}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01514}01514 \textcolor{comment}{                 * to support advertising many services, not just one}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01515}01515 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01516}01516                 \textcolor{keywordflow}{if} (((tag == NULL) || (tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} == 0)) \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01517}01517                     (neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}.\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} != 0)) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01518}01518                         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, \&neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}); \textcolor{comment}{/* SERVICE */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01519}01519                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01520}01520                 \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a9fa9dce8e1b8ba78fb44c9fe8410100d}{PTT\_HOST\_UNIQ}})))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01521}01521                         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, tag); \textcolor{comment}{/* returned hostunique */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01522}01522                 \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, \&uniqtag.hdr);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01523}01523                 \mbox{\hyperlink{ng__pppoe_8c_a7d80bec3ebc61330788ef50ca9034057}{scan\_tags}}(sp, ph);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01524}01524                 \mbox{\hyperlink{ng__pppoe_8c_a63d11938f3f1ae308335fe07300d774f}{make\_packet}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01525}01525                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01526}01526 \textcolor{comment}{                 * Send the offer but if they don't respond}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01527}01527 \textcolor{comment}{                 * in PPPOE\_OFFER\_TIMEOUT seconds, forget about it.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01528}01528 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01529}01529                 \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node, hook, \mbox{\hyperlink{ng__pppoe_8h_aa31d40825118c4d0efbf0706a1fad053}{PPPOE\_OFFER\_TIMEOUT}} * hz,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01530}01530                     \mbox{\hyperlink{ng__pppoe_8c_afa3a5587fc09b4ea57d954ed91d068b0}{pppoe\_ticker}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01531}01531                 m0 = m\_copypacket(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01532}01532                 \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, privp-\/>ethernet\_hook, m0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01533}01533                 privp-\/>packets\_out++;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01534}01534                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01535}01535                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01536}01536 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01537}01537         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01538}01538 \textcolor{comment}{         * Packets coming from the hook make no sense}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01539}01539 \textcolor{comment}{         * to sessions in the rest of states. Throw them away.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01540}01540 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01541}01541         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01542}01542                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01543}01543         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01544}01544 quit:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01545}01545         \textcolor{keywordflow}{if} (item)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01546}01546                 \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01547}01547         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01548}01548         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01549}01549 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01550}01550 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01551}01551 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01552}01552 \textcolor{comment}{ * Receive data from ether and do something with it.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01553}01553 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01554}01554 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01555}\mbox{\hyperlink{ng__pppoe_8c_a6058aa995a795be39639b38515002337}{01555}} \mbox{\hyperlink{ng__pppoe_8c_a2ec731436c8c8dbf88c8b6a4856304f9}{ng\_pppoe\_rcvdata\_ether}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01556}01556 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01557}01557         \mbox{\hyperlink{structng__node}{node\_p}}                    node = \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01558}01558         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}}              privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01559}01559         \mbox{\hyperlink{structsess__con}{sessp}}                      sp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01560}01560         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *utag = NULL, *tag = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01561}01561         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} sntag = \{ \mbox{\hyperlink{ng__pppoe_8h_aa37c7d47f38ff53ac0dd856d9533b8e2}{PTT\_SRV\_NAME}}, 0 \};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01562}01562         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *wh;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01563}01563         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__hdr}{pppoe\_hdr}} *ph;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01564}01564         \mbox{\hyperlink{structsess__neg}{negp}}                        neg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01565}01565         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01566}01566         \mbox{\hyperlink{structng__hook}{hook\_p}}                    sendhook;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01567}01567         \textcolor{keywordtype}{int}                     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01568}01568         uint16\_t                \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01569}01569         uint8\_t                 code;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01570}01570         \textcolor{keyword}{struct  }mbuf            *m0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01571}01571 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01572}01572         CTR6(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: node [\%x] (\%p) received \%p on \(\backslash\)"{}\%s\(\backslash\)"{} (\%p)"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01573}01573             \_\_func\_\_, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}}, node, item, hook-\/>\mbox{\hyperlink{structng__hook_a1b5feb51d20fcb4e32d8542159b4abc6}{hk\_name}}, hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01574}01574 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01575}01575         \mbox{\hyperlink{netgraph_8h_abbb0acb5f480576cff9901caddeef57f}{NGI\_GET\_M}}(item, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01576}01576         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01577}01577 \textcolor{comment}{         * Dig out various fields from the packet.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01578}01578 \textcolor{comment}{         * Use them to decide where to send it.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01579}01579 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01580}01580         privp-\/>packets\_in++;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01581}01581         \textcolor{keywordflow}{if}( m-\/>m\_len < \textcolor{keyword}{sizeof}(*wh)) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01582}01582                 m = m\_pullup(m, \textcolor{keyword}{sizeof}(*wh)); \textcolor{comment}{/* Checks length */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01583}01583                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01584}01584                         log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: couldn't "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01585}01585                             \textcolor{stringliteral}{"{}m\_pullup(wh)\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01586}01586                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01587}01587                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01588}01588         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01589}01589         wh = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01590}01590         \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}} = ntohs(wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_acdfbf6a1eca39566f6802904d92de3f5}{length}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01591}01591         \textcolor{keywordflow}{switch}(wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01592}01592         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a3ddeaa4abae17dfb1aa83c8d98bd4032}{ETHERTYPE\_PPPOE\_3COM\_DISC}}: \textcolor{comment}{/* fall through */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01593}01593         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_ab952530e40d18b6a6bd01d7bb7680d7b}{ETHERTYPE\_PPPOE\_DISC}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01594}01594                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01595}01595 \textcolor{comment}{                 * We need to try to make sure that the tag area}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01596}01596 \textcolor{comment}{                 * is contiguous, or we could wander off the end}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01597}01597 \textcolor{comment}{                 * of a buffer and make a mess.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01598}01598 \textcolor{comment}{                 * (Linux wouldn't have this problem).}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01599}01599 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01600}01600                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len <= MHLEN) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01601}01601                         \textcolor{keywordflow}{if}( m-\/>m\_len < m-\/>m\_pkthdr.len) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01602}01602                                 m = m\_pullup(m, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01603}01603                                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01604}01604                                         log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01605}01605                                             \textcolor{stringliteral}{"{}couldn't m\_pullup(pkthdr)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01606}01606                                             node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01607}01607                                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01608}01608                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01609}01609                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01610}01610                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01611}01611                 \textcolor{keywordflow}{if} (m-\/>m\_len != m-\/>m\_pkthdr.len) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01612}01612                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01613}01613 \textcolor{comment}{                         * It's not all in one piece.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01614}01614 \textcolor{comment}{                         * We need to do extra work.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01615}01615 \textcolor{comment}{                         * Put it into a cluster.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01616}01616 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01617}01617                         \textcolor{keyword}{struct }mbuf *n;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01618}01618                         n = m\_dup(m, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01619}01619                         m\_freem(m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01620}01620                         m = n;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01621}01621                         \textcolor{keywordflow}{if} (m) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01622}01622                                 \textcolor{comment}{/* just check we got a cluster */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01623}01623                                 \textcolor{keywordflow}{if} (m-\/>m\_len != m-\/>m\_pkthdr.len) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01624}01624                                         m\_freem(m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01625}01625                                         m = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01626}01626                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01627}01627                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01628}01628                         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01629}01629                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: packet "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01630}01630                                     \textcolor{stringliteral}{"{}fragmented\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01631}01631                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EMSGSIZE);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01632}01632                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01633}01633                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01634}01634                 wh = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01635}01635                 \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}} = ntohs(wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_acdfbf6a1eca39566f6802904d92de3f5}{length}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01636}01636                 ph = \&wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01637}01637                 code = wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01638}01638 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01639}01639                 \textcolor{keywordflow}{switch}(code) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01640}01640                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_adf504c22bf0a15e4e1994cc6251aaa27}{PADI\_CODE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01641}01641                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01642}01642 \textcolor{comment}{                         * We are a server:}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01643}01643 \textcolor{comment}{                         * Look for a hook with the required service and send}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01644}01644 \textcolor{comment}{                         * the ENTIRE packet up there. It should come back to}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01645}01645 \textcolor{comment}{                         * a new hook in PRIMED state. Look there for further}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01646}01646 \textcolor{comment}{                         * processing.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01647}01647 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01648}01648                         tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_aa37c7d47f38ff53ac0dd856d9533b8e2}{PTT\_SRV\_NAME}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01649}01649                         \textcolor{keywordflow}{if} (tag == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01650}01650                                 tag = \&sntag;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01651}01651 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01652}01652                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01653}01653 \textcolor{comment}{                         * First, try to match Service-\/Name against our }}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01654}01654 \textcolor{comment}{                         * listening hooks. If no success and we are in D-\/Link}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01655}01655 \textcolor{comment}{                         * compat mode and Service-\/Name is empty, then we }}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01656}01656 \textcolor{comment}{                         * broadcast the PADI to all listening hooks.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01657}01657 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01658}01658                         sendhook = \mbox{\hyperlink{ng__pppoe_8c_ab0b370298459490b8814bd861d8b90ea}{pppoe\_match\_svc}}(node, tag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01659}01659                         \textcolor{keywordflow}{if} (sendhook != NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01660}01660                                 \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, sendhook, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01661}01661                         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (privp-\/>flags \& \mbox{\hyperlink{ng__pppoe_8c_aae1233f77aa0adb81c4b32d87b5133ad}{COMPAT\_DLINK}} \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01662}01662                                  ntohs(tag-\/>tag\_len) == 0)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01663}01663                                 error = \mbox{\hyperlink{ng__pppoe_8c_a7ae0ae75aedf4a499759efbfdc654c41}{pppoe\_broadcast\_padi}}(node, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01664}01664                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01665}01665                                 error = ENETUNREACH;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01666}01666                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01667}01667                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a28e6118d88a2f04e22b7fd1d8112d983}{PADO\_CODE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01668}01668                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01669}01669 \textcolor{comment}{                         * We are a client:}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01670}01670 \textcolor{comment}{                         * Use the host\_uniq tag to find the hook this is in}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01671}01671 \textcolor{comment}{                         * response to. Received \#2, now send \#3}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01672}01672 \textcolor{comment}{                         * For now simply accept the first we receive.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01673}01673 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01674}01674                         utag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a9fa9dce8e1b8ba78fb44c9fe8410100d}{PTT\_HOST\_UNIQ}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01675}01675                         \textcolor{keywordflow}{if} (utag == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01676}01676                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: no host "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01677}01677                                     \textcolor{stringliteral}{"{}unique field\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01678}01678                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01679}01679                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01680}01680 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01681}01681                         sendhook = \mbox{\hyperlink{ng__pppoe_8c_a1e2599642ebcdafbcf2afe3f5bad6948}{pppoe\_finduniq}}(node, utag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01682}01682                         \textcolor{keywordflow}{if} (sendhook == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01683}01683                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: no "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01684}01684                                     \textcolor{stringliteral}{"{}matching session\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01685}01685                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01686}01686                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01687}01687 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01688}01688                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01689}01689 \textcolor{comment}{                         * Check the session is in the right state.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01690}01690 \textcolor{comment}{                         * It needs to be in PPPOE\_SINIT.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01691}01691 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01692}01692                         sp = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(sendhook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01693}01693                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} == \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90aa1bc415759fb8cdf37ce1f647854558c}{PPPOE\_SREQ}} ||}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01694}01694                             sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} == \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{PPPOE\_CONNECTED}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01695}01695                                 \textcolor{keywordflow}{break};  \textcolor{comment}{/* Multiple PADO is OK. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01696}01696                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01697}01697                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90abce7db6df3b3336b58aac2dc709eae8a}{PPPOE\_SINIT}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01698}01698                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: session "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01699}01699                                     \textcolor{stringliteral}{"{}in wrong state\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01700}01700                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01701}01701                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01702}01702                         neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01703}01703                         \textcolor{comment}{/* If requested specific AC-\/name, check it. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01704}01704                         \textcolor{keywordflow}{if} (neg-\/>\mbox{\hyperlink{structsess__neg_a18906af455bd1c43ae891b61ecf16ac2}{ac\_name\_len}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01705}01705                                 tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a17138947ce15d5fe0c81edbb14f7d496}{PTT\_AC\_NAME}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01706}01706                                 \textcolor{keywordflow}{if} (!tag) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01707}01707                                         \textcolor{comment}{/* No PTT\_AC\_NAME in PADO */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01708}01708                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01709}01709                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01710}01710                                 \textcolor{keywordflow}{if} (neg-\/>\mbox{\hyperlink{structsess__neg_a18906af455bd1c43ae891b61ecf16ac2}{ac\_name\_len}} != htons(tag-\/>tag\_len) ||}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01711}01711                                     strncmp(neg-\/>\mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{ac\_name}}.\mbox{\hyperlink{structdatatag_a6b301f3c347b69c5bb46bba8a59fa94e}{data}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01712}01712                                     (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(tag + 1),}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01713}01713                                     neg-\/>\mbox{\hyperlink{structsess__neg_a18906af455bd1c43ae891b61ecf16ac2}{ac\_name\_len}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01714}01714                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01715}01715                                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01716}01716                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01717}01717                         sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90aa1bc415759fb8cdf37ce1f647854558c}{PPPOE\_SREQ}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01718}01718                         \mbox{\hyperlink{netgraph_8h_aabe13cf527f80501a761c71c9b4888db}{ng\_uncallout}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01719}01719 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01720}01720                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01721}01721 \textcolor{comment}{                         * This is the first time we hear}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01722}01722 \textcolor{comment}{                         * from the server, so note it's}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01723}01723 \textcolor{comment}{                         * unicast address, replacing the}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01724}01724 \textcolor{comment}{                         * broadcast address .}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01725}01725 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01726}01726                         bcopy(wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_shost,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01727}01727                                 neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_dhost,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01728}01728                                 ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01729}01729                         neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01730}01730                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_af29af5c45fdbfb900647b340f8cd1caf}{PADR\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01731}01731                         \mbox{\hyperlink{ng__pppoe_8c_a197d647e712fe59b6e1781df4612805b}{init\_tags}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01732}01732                         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, utag);         \textcolor{comment}{/* Host Unique */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01733}01733                         \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a0190a7a4e003483624b0ecefd7f1b104}{PTT\_AC\_COOKIE}})))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01734}01734                                 \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, tag);  \textcolor{comment}{/* return cookie */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01735}01735                         \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a17138947ce15d5fe0c81edbb14f7d496}{PTT\_AC\_NAME}}))) \{       }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01736}01736                                 \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, tag);  \textcolor{comment}{/* return it */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01737}01737                                 \mbox{\hyperlink{ng__pppoe_8c_a890d400c93a9a5a620eda2bf555f5b60}{send\_acname}}(sp, tag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01738}01738                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01739}01739                         \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_aedd791704cf3ed9e33cb955d15181239}{PTT\_MAX\_PAYL}})) \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01740}01740                             (privp-\/>max\_payload.data != 0))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01741}01741                                 \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, tag);  \textcolor{comment}{/* return it */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01742}01742                         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, \&neg-\/>\mbox{\hyperlink{structsess__neg_a9e15bfa093f138ac9e9a040b6f4f30dc}{service}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}); \textcolor{comment}{/* Service */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01743}01743                         \mbox{\hyperlink{ng__pppoe_8c_a7d80bec3ebc61330788ef50ca9034057}{scan\_tags}}(sp, ph);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01744}01744                         \mbox{\hyperlink{ng__pppoe_8c_a63d11938f3f1ae308335fe07300d774f}{make\_packet}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01745}01745                         sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90aa1bc415759fb8cdf37ce1f647854558c}{PPPOE\_SREQ}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01746}01746                         \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node, sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01747}01747                             \mbox{\hyperlink{ng__pppoe_8h_af025b8b52a2f007f394edf51d5e90deb}{PPPOE\_INITIAL\_TIMEOUT}} * hz,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01748}01748                             \mbox{\hyperlink{ng__pppoe_8c_afa3a5587fc09b4ea57d954ed91d068b0}{pppoe\_ticker}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01749}01749                         neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} = \mbox{\hyperlink{ng__pppoe_8h_af025b8b52a2f007f394edf51d5e90deb}{PPPOE\_INITIAL\_TIMEOUT}} * 2;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01750}01750                         m0 = m\_copypacket(neg-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01751}01751                         \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, privp-\/>ethernet\_hook, m0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01752}01752                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01753}01753                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_af29af5c45fdbfb900647b340f8cd1caf}{PADR\_CODE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01754}01754                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01755}01755 \textcolor{comment}{                         * We are a server:}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01756}01756 \textcolor{comment}{                         * Use the ac\_cookie tag to find the}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01757}01757 \textcolor{comment}{                         * hook this is in response to.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01758}01758 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01759}01759                         utag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a0190a7a4e003483624b0ecefd7f1b104}{PTT\_AC\_COOKIE}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01760}01760                         \textcolor{keywordflow}{if} ((utag == NULL) ||}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01761}01761                             (ntohs(utag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}}) != \textcolor{keyword}{sizeof}(sp))) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01762}01762                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01763}01763                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01764}01764 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01765}01765                         sendhook = \mbox{\hyperlink{ng__pppoe_8c_a10b4e9a643481b7c042a3b3bd1b3dd2f}{pppoe\_findcookie}}(node, utag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01766}01766                         \textcolor{keywordflow}{if} (sendhook == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01767}01767                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01768}01768 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01769}01769                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01770}01770 \textcolor{comment}{                         * Check the session is in the right state.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01771}01771 \textcolor{comment}{                         * It needs to be in PPPOE\_SOFFER or PPPOE\_NEWCONNECTED.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01772}01772 \textcolor{comment}{                         * If the latter, then this is a retry by the client,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01773}01773 \textcolor{comment}{                         * so be nice, and resend.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01774}01774 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01775}01775                         sp = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(sendhook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01776}01776                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} == \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a110422095d7a14bc807d39e06449d834}{PPPOE\_NEWCONNECTED}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01777}01777                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01778}01778 \textcolor{comment}{                                 * Whoa! drop back to resend that PADS packet.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01779}01779 \textcolor{comment}{                                 * We should still have a copy of it.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01780}01780 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01781}01781                                 sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a536520274a9f9359f0c7f0fa545fb734}{PPPOE\_SOFFER}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01782}01782                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a536520274a9f9359f0c7f0fa545fb734}{PPPOE\_SOFFER}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01783}01783                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}} (ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01784}01784                         neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01785}01785                         \mbox{\hyperlink{netgraph_8h_aabe13cf527f80501a761c71c9b4888db}{ng\_uncallout}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01786}01786                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_a7e6a2ac84de2a3adf5e08cd00cc77320}{PADS\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01787}01787                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01788}01788                                 neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_a6542f0408c34f233fdae67e9e3789887}{sid}} =}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01789}01789                                     htons(\mbox{\hyperlink{ng__pppoe_8c_ae8924db103e99fb2a8c056d553e669fb}{pppoe\_getnewsession}}(sp));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01790}01790                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01791}01791                         \mbox{\hyperlink{ng__pppoe_8c_a5955e6e51ecd8989fafe634e2a9325b8}{send\_sessionid}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01792}01792                         neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01793}01793                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01794}01794 \textcolor{comment}{                         * start working out the tags to respond with.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01795}01795 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01796}01796                         \mbox{\hyperlink{ng__pppoe_8c_a197d647e712fe59b6e1781df4612805b}{init\_tags}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01797}01797                         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, \&neg-\/>\mbox{\hyperlink{structsess__neg_a85d2be22909d7c6c9e004acd99199392}{ac\_name}}.\mbox{\hyperlink{structdatatag_ae050024a1fd0dc7984010afbffa12306}{hdr}}); \textcolor{comment}{/* AC\_NAME */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01798}01798                         \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_aa37c7d47f38ff53ac0dd856d9533b8e2}{PTT\_SRV\_NAME}})))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01799}01799                                 \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, tag);\textcolor{comment}{/* return service */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01800}01800                         \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a9fa9dce8e1b8ba78fb44c9fe8410100d}{PTT\_HOST\_UNIQ}})))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01801}01801                                 \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, tag); \textcolor{comment}{/* return it */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01802}01802                         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, utag); \textcolor{comment}{/* ac\_cookie */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01803}01803                         \mbox{\hyperlink{ng__pppoe_8c_a7d80bec3ebc61330788ef50ca9034057}{scan\_tags}}(sp, ph);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01804}01804                         \mbox{\hyperlink{ng__pppoe_8c_a63d11938f3f1ae308335fe07300d774f}{make\_packet}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01805}01805                         sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a110422095d7a14bc807d39e06449d834}{PPPOE\_NEWCONNECTED}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01806}01806 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01807}01807                         \textcolor{comment}{/* Send the PADS without a timeout -\/ we're now connected. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01808}01808                         m0 = m\_copypacket(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01809}01809                         \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, privp-\/>ethernet\_hook, m0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01810}01810 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01811}01811                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01812}01812 \textcolor{comment}{                         * Having sent the last Negotiation header,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01813}01813 \textcolor{comment}{                         * Set up the stored packet header to be correct for}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01814}01814 \textcolor{comment}{                         * the actual session. But keep the negotialtion stuff}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01815}01815 \textcolor{comment}{                         * around in case we need to resend this last packet.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01816}01816 \textcolor{comment}{                         * We'll discard it when we move from NEWCONNECTED}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01817}01817 \textcolor{comment}{                         * to CONNECTED}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01818}01818 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01819}01819                         sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}} = neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01820}01820                         \textcolor{comment}{/* Configure ethertype depending on what}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01821}01821 \textcolor{comment}{                         * ethertype was used at discovery phase */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01822}01822                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type ==}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01823}01823                             \mbox{\hyperlink{ng__pppoe_8h_a3ddeaa4abae17dfb1aa83c8d98bd4032}{ETHERTYPE\_PPPOE\_3COM\_DISC}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01824}01824                                 sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01825}01825                                         = \mbox{\hyperlink{ng__pppoe_8h_a0867ea8a762dbf215bfdb41f51479859}{ETHERTYPE\_PPPOE\_3COM\_SESS}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01826}01826                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01827}01827                                 sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01828}01828                                         = \mbox{\hyperlink{ng__pppoe_8h_a3e29e74194a092c34197fa65fb824d99}{ETHERTYPE\_PPPOE\_SESS}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01829}01829                         sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01830}01830                         \mbox{\hyperlink{ng__pppoe_8c_a7f63b1db45ec2f3585bea152760fa91c}{pppoe\_send\_event}}(sp, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a94d21f7972fff6b665f37ec8b5fa9088}{NGM\_PPPOE\_SUCCESS}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01831}01831                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01832}01832                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a7e6a2ac84de2a3adf5e08cd00cc77320}{PADS\_CODE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01833}01833                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01834}01834 \textcolor{comment}{                         * We are a client:}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01835}01835 \textcolor{comment}{                         * Use the host\_uniq tag to find the hook this is in}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01836}01836 \textcolor{comment}{                         * response to. Take the session ID and store it away.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01837}01837 \textcolor{comment}{                         * Also make sure the pre-\/made header is correct and}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01838}01838 \textcolor{comment}{                         * set us into Session mode.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01839}01839 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01840}01840                         utag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a9fa9dce8e1b8ba78fb44c9fe8410100d}{PTT\_HOST\_UNIQ}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01841}01841                         \textcolor{keywordflow}{if} (utag == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01842}01842                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}} (ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01843}01843                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01844}01844                         sendhook = \mbox{\hyperlink{ng__pppoe_8c_a1e2599642ebcdafbcf2afe3f5bad6948}{pppoe\_finduniq}}(node, utag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01845}01845                         \textcolor{keywordflow}{if} (sendhook == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01846}01846                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01847}01847 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01848}01848                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01849}01849 \textcolor{comment}{                         * Check the session is in the right state.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01850}01850 \textcolor{comment}{                         * It needs to be in PPPOE\_SREQ.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01851}01851 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01852}01852                         sp = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(sendhook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01853}01853                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90aa1bc415759fb8cdf37ce1f647854558c}{PPPOE\_SREQ}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01854}01854                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01855}01855                         neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01856}01856                         \mbox{\hyperlink{netgraph_8h_aabe13cf527f80501a761c71c9b4888db}{ng\_uncallout}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01857}01857                         neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_a6542f0408c34f233fdae67e9e3789887}{sid}} = wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_a6542f0408c34f233fdae67e9e3789887}{sid}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01858}01858                         sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}} = ntohs(wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_a6542f0408c34f233fdae67e9e3789887}{sid}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01859}01859                         \mbox{\hyperlink{ng__pppoe_8c_ab660096a894df8ce246d589fe958a66f}{pppoe\_addsession}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01860}01860                         \mbox{\hyperlink{ng__pppoe_8c_a5955e6e51ecd8989fafe634e2a9325b8}{send\_sessionid}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01861}01861                         neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01862}01862                         sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{PPPOE\_CONNECTED}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01863}01863                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01864}01864 \textcolor{comment}{                         * Now we have gone to Connected mode,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01865}01865 \textcolor{comment}{                         * Free all resources needed for negotiation.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01866}01866 \textcolor{comment}{                         * Keep a copy of the header we will be using.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01867}01867 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01868}01868                         sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}} = neg-\/>\mbox{\hyperlink{structsess__neg_a920b6378c10ba0e747526306d77d8c86}{pkt}}-\/>\mbox{\hyperlink{unionpacket_ab9851733b7f70fcbba91e1808574dc09}{pkt\_header}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01869}01869                         \textcolor{keywordflow}{if} (privp-\/>flags \& \mbox{\hyperlink{ng__pppoe_8c_a678f30c81e89ed94377301a04a43416e}{COMPAT\_3COM}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01870}01870                                 sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01871}01871                                         = \mbox{\hyperlink{ng__pppoe_8h_a0867ea8a762dbf215bfdb41f51479859}{ETHERTYPE\_PPPOE\_3COM\_SESS}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01872}01872                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01873}01873                                 sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}.\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01874}01874                                         = \mbox{\hyperlink{ng__pppoe_8h_a3e29e74194a092c34197fa65fb824d99}{ETHERTYPE\_PPPOE\_SESS}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01875}01875                         sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}.\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01876}01876                         m\_freem(neg-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01877}01877                         free(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}, \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01878}01878                         sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01879}01879                         \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_aedd791704cf3ed9e33cb955d15181239}{PTT\_MAX\_PAYL}})) \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01880}01880                             (privp-\/>max\_payload.data != 0))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01881}01881                                 \mbox{\hyperlink{ng__pppoe_8c_a8a26822d8c4b14d8bb1a1c25629a6778}{send\_maxp}}(sp, tag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01882}01882                         \mbox{\hyperlink{ng__pppoe_8c_a7f63b1db45ec2f3585bea152760fa91c}{pppoe\_send\_event}}(sp, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3a94d21f7972fff6b665f37ec8b5fa9088}{NGM\_PPPOE\_SUCCESS}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01883}01883                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01884}01884                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a84cfd1ab04f5e0d6207a6c9b8a2fde8b}{PADT\_CODE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01885}01885                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01886}01886 \textcolor{comment}{                         * Find matching peer/session combination.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01887}01887 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01888}01888                         sp = \mbox{\hyperlink{ng__pppoe_8c_a5212df6c08b4b291466caaa2e0ef3496}{pppoe\_findsession}}(privp, wh);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01889}01889                         \textcolor{keywordflow}{if} (sp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01890}01890                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01891}01891                         \textcolor{comment}{/* Disconnect that hook. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01892}01892                         \mbox{\hyperlink{netgraph_8h_a6cbe70c76c741d7035f338d9132a05d0}{ng\_rmhook\_self}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01893}01893                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01894}01894                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a7e735049083864d166aaecf240925817}{PADM\_CODE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01895}01895                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01896}01896 \textcolor{comment}{                         * We are a client:}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01897}01897 \textcolor{comment}{                         * find matching peer/session combination.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01898}01898 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01899}01899                         sp = \mbox{\hyperlink{ng__pppoe_8c_a5212df6c08b4b291466caaa2e0ef3496}{pppoe\_findsession}}(privp, wh);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01900}01900                         \textcolor{keywordflow}{if} (sp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01901}01901                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}} (ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01902}01902                         \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a9e1f1c896119abf52ed215cb2e2774ed}{PTT\_HURL}})))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01903}01903                                 \mbox{\hyperlink{ng__pppoe_8c_a20520861aa7bb00826436ccef6c314e6}{send\_hurl}}(sp, tag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01904}01904                         \textcolor{keywordflow}{if} ((tag = \mbox{\hyperlink{ng__pppoe_8c_aa887e13dd52964f75ac9f59301196944}{get\_tag}}(ph, \mbox{\hyperlink{ng__pppoe_8h_a77b13dff29b8c71a458c266baee74ed3}{PTT\_MOTM}})))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01905}01905                                 \mbox{\hyperlink{ng__pppoe_8c_a9f1b70969d2ebe2ee35b9a97838f83ec}{send\_motm}}(sp, tag);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01906}01906                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01907}01907                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01908}01908                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EPFNOSUPPORT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01909}01909                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01910}01910                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01911}01911         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a0867ea8a762dbf215bfdb41f51479859}{ETHERTYPE\_PPPOE\_3COM\_SESS}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01912}01912         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a3e29e74194a092c34197fa65fb824d99}{ETHERTYPE\_PPPOE\_SESS}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01913}01913                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01914}01914 \textcolor{comment}{                 * Find matching peer/session combination.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01915}01915 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01916}01916                 sp = \mbox{\hyperlink{ng__pppoe_8c_a5212df6c08b4b291466caaa2e0ef3496}{pppoe\_findsession}}(privp, wh);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01917}01917                 \textcolor{keywordflow}{if} (sp == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01918}01918                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}} (ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01919}01919                 m\_adj(m, \textcolor{keyword}{sizeof}(*wh));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01920}01920 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01921}01921                 \textcolor{comment}{/* If packet too short, dump it. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01922}01922                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len < \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01923}01923                         \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EMSGSIZE);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01924}01924                 \textcolor{comment}{/* Also need to trim excess at the end */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01925}01925                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len > \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01926}01926                         m\_adj(m, -\/((\textcolor{keywordtype}{int})(m-\/>m\_pkthdr.len -\/ \mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}})));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01927}01927                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01928}01928                 \textcolor{keywordflow}{if} ( sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{PPPOE\_CONNECTED}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01929}01929                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} == \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a110422095d7a14bc807d39e06449d834}{PPPOE\_NEWCONNECTED}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01930}01930                                 sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} = \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{PPPOE\_CONNECTED}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01931}01931                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01932}01932 \textcolor{comment}{                                 * Now we have gone to Connected mode,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01933}01933 \textcolor{comment}{                                 * Free all resources needed for negotiation.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01934}01934 \textcolor{comment}{                                 * Be paranoid about whether there may be}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01935}01935 \textcolor{comment}{                                 * a timeout.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01936}01936 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01937}01937                                 m\_freem(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01938}01938                                 \mbox{\hyperlink{netgraph_8h_aabe13cf527f80501a761c71c9b4888db}{ng\_uncallout}}(\&sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01939}01939                                 free(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}, \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01940}01940                                 sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01941}01941                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01942}01942                                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}} (ENETUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01943}01943                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01944}01944                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01945}01945                 \mbox{\hyperlink{netgraph_8h_a8c4d1be1c10df792d8e15b4458c9b400}{NG\_FWD\_NEW\_DATA}}(error, item, sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01946}01946                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01947}01947         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01948}01948                 \mbox{\hyperlink{ng__pppoe_8c_a1ea81a52f514f7758e71fca08b038bf6}{LEAVE}}(EPFNOSUPPORT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01949}01949         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01950}01950 quit:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01951}01951         \textcolor{keywordflow}{if} (item)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01952}01952                 \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01953}01953         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01954}01954         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01955}01955 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01956}01956 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01957}01957 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01958}01958 \textcolor{comment}{ * Receive data from debug hook and bypass it to ether.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01959}01959 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01960}01960 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01961}\mbox{\hyperlink{ng__pppoe_8c_ad79926dd13d22859324ff9c570d67f48}{01961}} \mbox{\hyperlink{ng__pppoe_8c_afb2e20d22dc3910b5c294b7c838edfd9}{ng\_pppoe\_rcvdata\_debug}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01962}01962 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01963}01963         \mbox{\hyperlink{structng__node}{node\_p}}            node = \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01964}01964         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}}      privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01965}01965         \textcolor{keywordtype}{int}             error;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01966}01966 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01967}01967         CTR6(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: node [\%x] (\%p) received \%p on \(\backslash\)"{}\%s\(\backslash\)"{} (\%p)"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01968}01968             \_\_func\_\_, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}}, node, item, hook-\/>\mbox{\hyperlink{structng__hook_a1b5feb51d20fcb4e32d8542159b4abc6}{hk\_name}}, hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01969}01969 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01970}01970         \mbox{\hyperlink{netgraph_8h_a52b448e5f7440d396bb16d481af55b64}{NG\_FWD\_ITEM\_HOOK}}(error, item, privp-\/>ethernet\_hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01971}01971         privp-\/>packets\_out++;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01972}01972         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01973}01973 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01974}01974 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01975}01975 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01976}01976 \textcolor{comment}{ * Do local shutdown processing..}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01977}01977 \textcolor{comment}{ * If we are a persistent device, we might refuse to go away, and}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01978}01978 \textcolor{comment}{ * we'd only remove our links and reset ourself.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01979}01979 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01980}01980 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01981}\mbox{\hyperlink{ng__pppoe_8c_aff8ecb13465fd1017f0a9845f09e0ff9}{01981}} \mbox{\hyperlink{ng__pppoe_8c_a1b6c594ed921d408eda25deae94cbff1}{ng\_pppoe\_shutdown}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01982}01982 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01983}01983         \textcolor{keyword}{const} \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01984}01984         \textcolor{keywordtype}{int}     i;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01985}01985 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01986}01986         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ng__pppoe_8c_a6615eddd2308fa27b73373ac310ab21c}{SESSHASHSIZE}}; i++)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01987}01987             mtx\_destroy(\&privp-\/>sesshash[i].mtx);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01988}01988         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, NULL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01989}01989         \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(privp-\/>\mbox{\hyperlink{structnetflow_ae990618299373228ee7da77a42c44269}{node}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01990}01990         free(privp, \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01991}01991         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01992}01992 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01993}01993 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01994}01994 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01995}01995 \textcolor{comment}{ * Hook disconnection}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01996}01996 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01997}01997 \textcolor{comment}{ * Clean up all dangling links and information about the session/hook.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01998}01998 \textcolor{comment}{ * For this type, removal of the last link destroys the node.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l01999}01999 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02000}02000 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02001}\mbox{\hyperlink{ng__pppoe_8c_aa950875cc950e36905933eb9499fade4}{02001}} \mbox{\hyperlink{ng__pppoe_8c_a40a2ff206785a0531aa48d792e41bece}{ng\_pppoe\_disconnect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02002}02002 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02003}02003         \mbox{\hyperlink{structng__node}{node\_p}} node = \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02004}02004         \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02005}02005         \mbox{\hyperlink{structsess__con}{sessp}}      sp;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02006}02006 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02007}02007         \textcolor{keywordflow}{if} (hook == privp-\/>debug\_hook) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02008}02008                 privp-\/>debug\_hook = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02009}02009         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (hook == privp-\/>ethernet\_hook) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02010}02010                 privp-\/>ethernet\_hook = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02011}02011                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_a6bdd56e0f33084eeaadbe696febcbbd8}{NG\_NODE\_IS\_VALID}}(node))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02012}02012                         \mbox{\hyperlink{netgraph_8h_a85914ce0da2b314478aaf7efcdcd3ff0}{ng\_rmnode\_self}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02013}02013         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02014}02014                 sp = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02015}02015                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} != \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a6ed962cbe8ef75d93c81b0d0de5dab2a}{PPPOE\_SNONE}} ) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02016}02016                         \mbox{\hyperlink{ng__pppoe_8c_a7f63b1db45ec2f3585bea152760fa91c}{pppoe\_send\_event}}(sp, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3aafe9f964ecc0aa36b5ae644d4c6e9209}{NGM\_PPPOE\_CLOSE}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02017}02017                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02018}02018                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02019}02019 \textcolor{comment}{                 * According to the spec, if we are connected,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02020}02020 \textcolor{comment}{                 * we should send a DISC packet if we are shutting down}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02021}02021 \textcolor{comment}{                 * a session.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02022}02022 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02023}02023                 \textcolor{keywordflow}{if} ((privp-\/>ethernet\_hook)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02024}02024                 \&\& ((sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} == \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a87f08f94e8288911d467c925a248d928}{PPPOE\_CONNECTED}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02025}02025                  || (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} == \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a110422095d7a14bc807d39e06449d834}{PPPOE\_NEWCONNECTED}}))) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02026}02026                         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02027}02027 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02028}02028                         \textcolor{comment}{/* Generate a packet of that type. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02029}02029                         m = m\_gethdr(M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02030}02030                         \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02031}02031                                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: session out of "{}}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02032}02032                                     \textcolor{stringliteral}{"{}mbufs\(\backslash\)n"{}}, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02033}02033                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02034}02034                                 \textcolor{keyword}{struct }epoch\_tracker et;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02035}02035                                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *wh;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02036}02036                                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *tag;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02037}02037                                 \textcolor{keywordtype}{int}     msglen = strlen(\mbox{\hyperlink{ng__pppoe_8c_ab373896d3e3a4b3ee1529d383f0d8b52}{SIGNOFF}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02038}02038                                 \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02039}02039 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02040}02040                                 wh = mtod(m, \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__full__hdr}{pppoe\_full\_hdr}} *);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02041}02041                                 bcopy(\&sp-\/>\mbox{\hyperlink{structsess__con_a75ead07bfe1f01e2bf2a265294068689}{pkt\_hdr}}, wh, \textcolor{keyword}{sizeof}(*wh));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02042}02042 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02043}02043                                 \textcolor{comment}{/* Revert the stored header to DISC/PADT mode. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02044}02044                                 wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_aaf9467165b778678c537f9acd894e348}{code}} = \mbox{\hyperlink{ng__pppoe_8h_a84cfd1ab04f5e0d6207a6c9b8a2fde8b}{PADT\_CODE}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02045}02045                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02046}02046 \textcolor{comment}{                                 * Configure ethertype depending on what}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02047}02047 \textcolor{comment}{                                 * was used during sessions stage.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02048}02048 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02049}02049                                 \textcolor{keywordflow}{if} (wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type == }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02050}02050                                     \mbox{\hyperlink{ng__pppoe_8h_a0867ea8a762dbf215bfdb41f51479859}{ETHERTYPE\_PPPOE\_3COM\_SESS}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02051}02051                                         wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type = \mbox{\hyperlink{ng__pppoe_8h_a3ddeaa4abae17dfb1aa83c8d98bd4032}{ETHERTYPE\_PPPOE\_3COM\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02052}02052                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02053}02053                                         wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_a2c2385c6acffc027230db82e43bd2bb9}{eh}}.ether\_type = \mbox{\hyperlink{ng__pppoe_8h_ab952530e40d18b6a6bd01d7bb7680d7b}{ETHERTYPE\_PPPOE\_DISC}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02054}02054                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02055}02055 \textcolor{comment}{                                 * Add a General error message and adjust}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02056}02056 \textcolor{comment}{                                 * sizes.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02057}02057 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02058}02058                                 tag = (\textcolor{keywordtype}{void} *)(\&wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}} + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02059}02059                                 tag-\/>\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}} = \mbox{\hyperlink{ng__pppoe_8h_aa9230478d9a572470ecc7f508cc5a6b4}{PTT\_GEN\_ERR}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02060}02060                                 tag-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}} = htons((u\_int16\_t)msglen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02061}02061                                 strncpy((\textcolor{keywordtype}{char} *)(tag + 1), \mbox{\hyperlink{ng__pppoe_8c_ab373896d3e3a4b3ee1529d383f0d8b52}{SIGNOFF}}, msglen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02062}02062                                 m-\/>m\_pkthdr.len = m-\/>m\_len = \textcolor{keyword}{sizeof}(*wh) + \textcolor{keyword}{sizeof}(*tag) +}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02063}02063                                     msglen;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02064}02064                                 wh-\/>\mbox{\hyperlink{structpppoe__full__hdr_aadf3dddbab66b722b43bae65a87eb2c3}{ph}}.\mbox{\hyperlink{structpppoe__hdr_acdfbf6a1eca39566f6802904d92de3f5}{length}} = htons(\textcolor{keyword}{sizeof}(*tag) + msglen);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02065}02065 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02066}02066                                 NET\_EPOCH\_ENTER(et);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02067}02067                                 \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}(error,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02068}02068                                         privp-\/>ethernet\_hook, m);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02069}02069                                 NET\_EPOCH\_EXIT(et);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02070}02070                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02071}02071                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02072}02072                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} == \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad99f69c3e7ba206e04f4e9883d6434e6}{PPPOE\_LISTENING}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02073}02073                         LIST\_REMOVE(sp, sessions);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02074}02074                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02075}02075                         \mbox{\hyperlink{ng__pppoe_8c_afc052746522ca460f79a6f5bb668d49f}{pppoe\_delsession}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02076}02076                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02077}02077 \textcolor{comment}{                 * As long as we have somewhere to store the timeout handle,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02078}02078 \textcolor{comment}{                 * we may have a timeout pending.. get rid of it.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02079}02079 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02080}02080                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02081}02081                         \mbox{\hyperlink{netgraph_8h_aabe13cf527f80501a761c71c9b4888db}{ng\_uncallout}}(\&sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02082}02082                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}})}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02083}02083                                 m\_freem(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02084}02084                         free(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}, \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02085}02085                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02086}02086                 free(sp, \mbox{\hyperlink{ng__pppoe_8c_a1459a834a5941f6c12332a755b70a49b}{M\_NETGRAPH\_PPPOE}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02087}02087                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, NULL);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02088}02088         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02089}02089         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{netgraph_8h_ad47e204c5b3adaddfa4bf0c380234f48}{NG\_NODE\_NUMHOOKS}}(node) == 0) \&\&}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02090}02090             (\mbox{\hyperlink{netgraph_8h_a6bdd56e0f33084eeaadbe696febcbbd8}{NG\_NODE\_IS\_VALID}}(node)))}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02091}02091                 \mbox{\hyperlink{netgraph_8h_a85914ce0da2b314478aaf7efcdcd3ff0}{ng\_rmnode\_self}}(node);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02092}02092         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02093}02093 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02094}02094 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02095}02095 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02096}02096 \textcolor{comment}{ * Timeouts come here.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02097}02097 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02098}02098 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02099}\mbox{\hyperlink{ng__pppoe_8c_afa3a5587fc09b4ea57d954ed91d068b0}{02099}} \mbox{\hyperlink{ng__pppoe_8c_afa3a5587fc09b4ea57d954ed91d068b0}{pppoe\_ticker}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{void} *arg1, \textcolor{keywordtype}{int} arg2)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02100}02100 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02101}02101         \mbox{\hyperlink{structnetflow}{priv\_p}} privp = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02102}02102         \mbox{\hyperlink{structsess__con}{sessp}}      sp = \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02103}02103         \mbox{\hyperlink{structsess__neg}{negp}}        neg = sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02104}02104         \textcolor{keyword}{struct }mbuf *m0 = NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02105}02105         \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02106}02106 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02107}02107         CTR6(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: node [\%x] (\%p) hook \(\backslash\)"{}\%s\(\backslash\)"{} (\%p) session \%d"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02108}02108             \_\_func\_\_, node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}}, node, hook-\/>\mbox{\hyperlink{structng__hook_a1b5feb51d20fcb4e32d8542159b4abc6}{hk\_name}}, hook, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02109}02109         \textcolor{keywordflow}{switch}(sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02110}02110                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02111}02111 \textcolor{comment}{                 * Resend the last packet, using an exponential backoff.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02112}02112 \textcolor{comment}{                 * After a period of time, stop growing the backoff,}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02113}02113 \textcolor{comment}{                 * And either leave it, or revert to the start.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02114}02114 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02115}02115         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90abce7db6df3b3336b58aac2dc709eae8a}{PPPOE\_SINIT}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02116}02116         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90aa1bc415759fb8cdf37ce1f647854558c}{PPPOE\_SREQ}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02117}02117                 \textcolor{comment}{/* Timeouts on these produce resends. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02118}02118                 m0 = m\_copypacket(sp-\/>\mbox{\hyperlink{structsess__con_aaf4bb80eb18f8869b40736c08fac8136}{neg}}-\/>\mbox{\hyperlink{structsess__neg_a59a263aec0af07d0cd3d0186b9632cb7}{m}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02119}02119                 \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}( error, privp-\/>ethernet\_hook, m0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02120}02120                 \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&neg-\/>\mbox{\hyperlink{structsess__neg_a54046ed3a8d090ef4088a105163bd256}{handle}}, node, hook, neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} * hz,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02121}02121                     \mbox{\hyperlink{ng__pppoe_8c_afa3a5587fc09b4ea57d954ed91d068b0}{pppoe\_ticker}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02122}02122                 \textcolor{keywordflow}{if} ((neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} <<= 1) > \mbox{\hyperlink{ng__pppoe_8h_a4b64943f444d9bc27f6c4af972056992}{PPPOE\_TIMEOUT\_LIMIT}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02123}02123                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsess__con_a549b670de4f358ef7bb22bf7ac14600c}{state}} == \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90aa1bc415759fb8cdf37ce1f647854558c}{PPPOE\_SREQ}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02124}02124                                 \textcolor{comment}{/* Revert to SINIT mode. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02125}02125                                 \mbox{\hyperlink{ng__pppoe_8c_abba562aea9cdad23262f7e965d63bde3}{pppoe\_start}}(sp);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02126}02126                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02127}02127                                 neg-\/>\mbox{\hyperlink{structsess__neg_a77be2b7edfa71e8806761ba2045271ed}{timeout}} = \mbox{\hyperlink{ng__pppoe_8h_a4b64943f444d9bc27f6c4af972056992}{PPPOE\_TIMEOUT\_LIMIT}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02128}02128                         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02129}02129                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02130}02130                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02131}02131         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90ad6677ab0255fdfa44c4a521177196093}{PPPOE\_PRIMED}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02132}02132         \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90a536520274a9f9359f0c7f0fa545fb734}{PPPOE\_SOFFER}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02133}02133                 \textcolor{comment}{/* A timeout on these says "{}give up"{} */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02134}02134                 \mbox{\hyperlink{netgraph_8h_a6cbe70c76c741d7035f338d9132a05d0}{ng\_rmhook\_self}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02135}02135                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02136}02136         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02137}02137                 \textcolor{comment}{/* Timeouts have no meaning in other states. */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02138}02138                 log(LOG\_NOTICE, \textcolor{stringliteral}{"{}ng\_pppoe[\%x]: unexpected timeout\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02139}02139                     node-\/>\mbox{\hyperlink{structng__node_a36c6d6eb87594c229db7f0dabf43a8fc}{nd\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02140}02140         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02141}02141 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02142}02142 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02143}02143 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02144}02144 \textcolor{comment}{ * Parse an incoming packet to see if any tags should be copied to the}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02145}02145 \textcolor{comment}{ * output packet. Don't do any tags that have been handled in the main}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02146}02146 \textcolor{comment}{ * state machine.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02147}02147 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02148}02148 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}}*}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02149}\mbox{\hyperlink{ng__pppoe_8c_a7d80bec3ebc61330788ef50ca9034057}{02149}} \mbox{\hyperlink{ng__pppoe_8c_a7d80bec3ebc61330788ef50ca9034057}{scan\_tags}}(\mbox{\hyperlink{structsess__con}{sessp}}   sp, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structpppoe__hdr}{pppoe\_hdr}}* ph)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02150}02150 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02151}02151         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\textcolor{keyword}{const} end = (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)\mbox{\hyperlink{ng__pppoe_8c_aafdf07cced1e126fea9f8f3e0682f587}{next\_tag}}(ph);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02152}02152         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ptn;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02153}02153         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}} *pt = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(ph + 1);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02154}02154 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02155}02155         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02156}02156 \textcolor{comment}{         * Keep processing tags while a tag header will still fit.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02157}02157 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02158}02158         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02159}02159 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02160}02160         \textcolor{keywordflow}{while}((\textcolor{keyword}{const} \textcolor{keywordtype}{char}*)(pt + 1) <= end) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02161}02161                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02162}02162 \textcolor{comment}{                 * If the tag data would go past the end of the packet, abort.}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02163}02163 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02164}02164                 ptn = (((\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)(pt + 1)) + ntohs(pt-\/>\mbox{\hyperlink{structpppoe__tag_aab820f0bbe4fbf6aed10c05d4edd99da}{tag\_len}}));}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02165}02165                 \textcolor{keywordflow}{if}(ptn > end)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02166}02166                         \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02167}02167 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02168}02168                 \textcolor{keywordflow}{switch} (pt-\/>\mbox{\hyperlink{structpppoe__tag_a99e3377a6e174253663b9bfe2dd2e25f}{tag\_type}}) \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02169}02169                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a9c37b96818b34c06aa25e84ae9dcca10}{PTT\_RELAY\_SID}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02170}02170                         \mbox{\hyperlink{ng__pppoe_8c_a78909a6ab9022eeb677226f01d9e410b}{insert\_tag}}(sp, pt);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02171}02171                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02172}02172                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a5c3947309674a739bd688cfb6897b6f8}{PTT\_EOL}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02173}02173                         \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02174}02174                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_aa37c7d47f38ff53ac0dd856d9533b8e2}{PTT\_SRV\_NAME}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02175}02175                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a17138947ce15d5fe0c81edbb14f7d496}{PTT\_AC\_NAME}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02176}02176                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a9fa9dce8e1b8ba78fb44c9fe8410100d}{PTT\_HOST\_UNIQ}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02177}02177                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a0190a7a4e003483624b0ecefd7f1b104}{PTT\_AC\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02178}02178                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_af9e2d66dea70d98477180adcc8b4e945}{PTT\_VENDOR}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02179}02179                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a471f926293de7f3d42a1c9b3b713a7f2}{PTT\_SRV\_ERR}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02180}02180                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a04d993fc99bb56866e29fd6f0d93cae2}{PTT\_SYS\_ERR}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02181}02181                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_aa9230478d9a572470ecc7f508cc5a6b4}{PTT\_GEN\_ERR}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02182}02182                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_aedd791704cf3ed9e33cb955d15181239}{PTT\_MAX\_PAYL}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02183}02183                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a9e1f1c896119abf52ed215cb2e2774ed}{PTT\_HURL}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02184}02184                 \textcolor{keywordflow}{case}    \mbox{\hyperlink{ng__pppoe_8h_a77b13dff29b8c71a458c266baee74ed3}{PTT\_MOTM}}:}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02185}02185                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02186}02186                 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02187}02187                 pt = (\textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structpppoe__tag}{pppoe\_tag}}*)ptn;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02188}02188         \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02189}02189         \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02190}02190 \}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02191}02191 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02192}02192 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02193}\mbox{\hyperlink{ng__pppoe_8c_a7f63b1db45ec2f3585bea152760fa91c}{02193}} \mbox{\hyperlink{ng__pppoe_8c_a7f63b1db45ec2f3585bea152760fa91c}{pppoe\_send\_event}}(\mbox{\hyperlink{structsess__con}{sessp}} sp, \textcolor{keyword}{enum} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}} cmdid)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02194}02194 \{}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02195}02195         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02196}02196         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02197}02197         \textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__sts}{ngpppoe\_sts}} *sts;}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02198}02198 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02199}02199         CTR2(KTR\_NET, \textcolor{stringliteral}{"{}\%20s: called \%d"{}}, \_\_func\_\_, sp-\/>\mbox{\hyperlink{structsess__con_aeec89616fff35d0986b03e048abda6e2}{Session\_ID}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02200}02200 }
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02201}02201         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__pppoe_8h_a89840bb93817599a19715af051a0b3a3}{NGM\_PPPOE\_COOKIE}}, cmdid,}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02202}02202                         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structngpppoe__sts}{ngpppoe\_sts}}), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02203}02203         \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02204}02204                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02205}02205         sts = (\textcolor{keyword}{struct }\mbox{\hyperlink{structngpppoe__sts}{ngpppoe\_sts}} *)msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02206}02206         strncpy(sts-\/>\mbox{\hyperlink{structngpppoe__sts_af40515689037405446667ab2c665c363}{hook}}, \mbox{\hyperlink{netgraph_8h_ab077a5607cd5a2e82cc67326badd440a}{NG\_HOOK\_NAME}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}), \mbox{\hyperlink{ng__message_8h_a2fadb5752a5c456671b0aea53179c2dd}{NG\_HOOKSIZ}});}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02207}02207         \mbox{\hyperlink{netgraph_8h_a90e963a02e95ae7964761de2122b5a88}{NG\_SEND\_MSG\_ID}}(error, \mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(sp-\/>\mbox{\hyperlink{structsess__con_aafe5700f030cc9e82aec1cddae774197}{hook}}), msg, sp-\/>\mbox{\hyperlink{structsess__con_a1e42cb3004c5850e5f4bac2105d91c06}{creator}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02208}02208         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__pppoe_8c_source_l02209}02209 \}}

\end{DoxyCode}
