\hypertarget{ng__lmi_8c_source}{}\doxysection{ng\+\_\+lmi.\+c}
\label{ng__lmi_8c_source}\index{netgraph/ng\_lmi.c@{netgraph/ng\_lmi.c}}
\mbox{\hyperlink{ng__lmi_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00002}00002 \textcolor{comment}{ * ng\_lmi.c}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00003}00003 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00004}00004 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00005}00005 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 1996-\/1999 Whistle Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00007}00007 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00008}00008 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00009}00009 \textcolor{comment}{ * Subject to the following obligations and disclaimer of warranty, use and}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00010}00010 \textcolor{comment}{ * redistribution of this software, in source or object code forms, with or}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00011}00011 \textcolor{comment}{ * without modifications are expressly permitted by Whistle Communications;}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00012}00012 \textcolor{comment}{ * provided, however, that:}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00013}00013 \textcolor{comment}{ * 1. Any and all reproductions of the source or object code must include the}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00014}00014 \textcolor{comment}{ *    copyright notice above and the following disclaimer of warranties; and}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00015}00015 \textcolor{comment}{ * 2. No rights are granted, in any manner or form, to use Whistle}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00016}00016 \textcolor{comment}{ *    Communications, Inc. trademarks, including the mark "{}WHISTLE}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00017}00017 \textcolor{comment}{ *    COMMUNICATIONS"{} on advertising, endorsements, or otherwise except as}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00018}00018 \textcolor{comment}{ *    such appears in the above copyright notice or in the software.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00019}00019 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "{}AS IS"{}, AND}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00021}00021 \textcolor{comment}{ * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00022}00022 \textcolor{comment}{ * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00023}00023 \textcolor{comment}{ * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00024}00024 \textcolor{comment}{ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-\/INFRINGEMENT.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00025}00025 \textcolor{comment}{ * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00026}00026 \textcolor{comment}{ * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00027}00027 \textcolor{comment}{ * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00028}00028 \textcolor{comment}{ * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00029}00029 \textcolor{comment}{ * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00030}00030 \textcolor{comment}{ * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00031}00031 \textcolor{comment}{ * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00032}00032 \textcolor{comment}{ * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00033}00033 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00034}00034 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00035}00035 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00036}00036 \textcolor{comment}{ * OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00037}00037 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00038}00038 \textcolor{comment}{ * Author: Julian Elischer <julian@freebsd.org>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00039}00039 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00040}00040 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00041}00041 \textcolor{comment}{ * \$Whistle: ng\_lmi.c,v 1.38 1999/11/01 09:24:52 julian Exp \$}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00042}00042 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00044}00044 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00045}00045 \textcolor{comment}{ * This node performs the frame relay LMI protocol. It knows how}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00046}00046 \textcolor{comment}{ * to do ITU Annex A, ANSI Annex D, and "{}Group-\/of-\/Four"{} variants}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00047}00047 \textcolor{comment}{ * of the protocol.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00048}00048 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00049}00049 \textcolor{comment}{ * A specific protocol can be forced by connecting the corresponding}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00050}00050 \textcolor{comment}{ * hook to DLCI 0 or 1023 (as appropriate) of a frame relay link.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00051}00051 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00052}00052 \textcolor{comment}{ * Alternately, this node can do auto-\/detection of the LMI protocol}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00053}00053 \textcolor{comment}{ * by connecting hook "{}auto0"{} to DLCI 0 and "{}auto1023"{} to DLCI 1023.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00054}00054 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <sys/syslog.h>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__message_8h}{netgraph/ng\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{netgraph_8h}{netgraph/netgraph.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__lmi_8h}{netgraph/ng\_lmi.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00067}00067 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00068}00068 \textcolor{comment}{ * Human readable names for LMI}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00069}00069 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00070}\mbox{\hyperlink{ng__lmi_8c_ade750a60cf1431ae117bde7f4de9c457}{00070}} \textcolor{preprocessor}{\#define NAME\_ANNEXA     NG\_LMI\_HOOK\_ANNEXA}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00071}\mbox{\hyperlink{ng__lmi_8c_a08fbdfa006326dcdddb5b301a4c4169e}{00071}} \textcolor{preprocessor}{\#define NAME\_ANNEXD     NG\_LMI\_HOOK\_ANNEXD}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00072}\mbox{\hyperlink{ng__lmi_8c_a2f450fd797d0d4599bbc570a7fcc3d60}{00072}} \textcolor{preprocessor}{\#define NAME\_GROUP4     NG\_LMI\_HOOK\_GROUPOF4}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00073}\mbox{\hyperlink{ng__lmi_8c_ae07389c36f2fed8525368b5c20dca40c}{00073}} \textcolor{preprocessor}{\#define NAME\_NONE       "{}None"{}}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00075}\mbox{\hyperlink{ng__lmi_8c_ab4376b984bab7a153fea6ebb5a7a9a3a}{00075}} \textcolor{preprocessor}{\#define MAX\_DLCIS       128}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00076}\mbox{\hyperlink{ng__lmi_8c_ad2e528c8d444673a8c4390ba51c9cae3}{00076}} \textcolor{preprocessor}{\#define MAXDLCI         1023}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00078}00078 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00079}00079 \textcolor{comment}{ * DLCI states}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00080}00080 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00081}\mbox{\hyperlink{ng__lmi_8c_a4b45f1b7969e05c5ec2b807c495ab451}{00081}} \textcolor{preprocessor}{\#define DLCI\_NULL       0}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00082}\mbox{\hyperlink{ng__lmi_8c_ae68ad97485ca240cd6ff7f3298082735}{00082}} \textcolor{preprocessor}{\#define DLCI\_UP         1}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00083}\mbox{\hyperlink{ng__lmi_8c_afcb9f0fe1ed68e04bf199e61812b53f1}{00083}} \textcolor{preprocessor}{\#define DLCI\_DOWN       2}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00085}00085 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00086}00086 \textcolor{comment}{ * Any received LMI frame should be at least this long}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00087}00087 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00088}\mbox{\hyperlink{ng__lmi_8c_ae9076bdfc14d64dc40edce8ca652823d}{00088}} \textcolor{preprocessor}{\#define LMI\_MIN\_LENGTH  8       }\textcolor{comment}{/* XXX verify */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00090}00090 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00091}00091 \textcolor{comment}{ * Netgraph node methods and type descriptor}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00092}00092 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00093}\mbox{\hyperlink{ng__lmi_8c_a4b8687f66222e102a83adc7cd55fb601}{00093}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_abb75b9ed2849e15851d6402d2ab5b899}{ng\_constructor\_t}} \mbox{\hyperlink{ng__lmi_8c_a4b8687f66222e102a83adc7cd55fb601}{nglmi\_constructor}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00094}\mbox{\hyperlink{ng__lmi_8c_a3cfb8621adc478707421cf146e4870c9}{00094}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a47b860e2900386e775707cc1ae661162}{ng\_rcvmsg\_t}}   \mbox{\hyperlink{ng__lmi_8c_a3cfb8621adc478707421cf146e4870c9}{nglmi\_rcvmsg}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00095}\mbox{\hyperlink{ng__lmi_8c_a1943c7e9bfab87eb261030a66c490cca}{00095}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aab0a679789a1af312a7f856b4668ad74}{ng\_shutdown\_t}}       \mbox{\hyperlink{ng__lmi_8c_a1943c7e9bfab87eb261030a66c490cca}{nglmi\_shutdown}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00096}\mbox{\hyperlink{ng__lmi_8c_a33e85d7ab3390c9329224289fd43e150}{00096}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_afa50639df4ed6eb400f8220a890d56e6}{ng\_newhook\_t}} \mbox{\hyperlink{ng__lmi_8c_a33e85d7ab3390c9329224289fd43e150}{nglmi\_newhook}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00097}\mbox{\hyperlink{ng__lmi_8c_a5b1c91c805f4ecfa5d7d633d08307cd7}{00097}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}} \mbox{\hyperlink{ng__lmi_8c_a5b1c91c805f4ecfa5d7d633d08307cd7}{nglmi\_rcvdata}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00098}\mbox{\hyperlink{ng__lmi_8c_a053a6913e15557f1982644cc971b90ca}{00098}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a669e1783335f933b4a4f90f17d22f381}{ng\_disconnect\_t}}   \mbox{\hyperlink{ng__lmi_8c_a053a6913e15557f1982644cc971b90ca}{nglmi\_disconnect}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00099}00099 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{ng__lmi_8c_a6fbe8c7d60934a83f6022276ce88d7db}{nglmi\_checkdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keyword}{struct} mbuf *m);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00101}\mbox{\hyperlink{ng__lmi_8c_a80a131770518c7fa3758d85054006e7a}{00101}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__type}{ng\_type}} \mbox{\hyperlink{ng__lmi_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}} = \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00102}00102         .\mbox{\hyperlink{structng__type_adbc1c8884ff0e625c19c4b513262fd0e}{version}} =       \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00103}00103         .name =         \mbox{\hyperlink{ng__lmi_8h_af52fbb74578ac49abd2e8ddeea130e29}{NG\_LMI\_NODE\_TYPE}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00104}00104         .constructor =  \mbox{\hyperlink{ng__lmi_8c_a4b8687f66222e102a83adc7cd55fb601}{nglmi\_constructor}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00105}00105         .rcvmsg =       \mbox{\hyperlink{ng__lmi_8c_a3cfb8621adc478707421cf146e4870c9}{nglmi\_rcvmsg}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00106}00106         .shutdown =     \mbox{\hyperlink{ng__lmi_8c_a1943c7e9bfab87eb261030a66c490cca}{nglmi\_shutdown}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00107}00107         .newhook =      \mbox{\hyperlink{ng__lmi_8c_a33e85d7ab3390c9329224289fd43e150}{nglmi\_newhook}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00108}00108         .rcvdata =      \mbox{\hyperlink{ng__lmi_8c_a5b1c91c805f4ecfa5d7d633d08307cd7}{nglmi\_rcvdata}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00109}00109         .disconnect =   \mbox{\hyperlink{ng__lmi_8c_a053a6913e15557f1982644cc971b90ca}{nglmi\_disconnect}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00110}00110 \};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00111}\mbox{\hyperlink{ng__lmi_8c_adc861a610ad76fa2ccf6d78076bdb909}{00111}} \mbox{\hyperlink{ng__lmi_8c_adc861a610ad76fa2ccf6d78076bdb909}{NETGRAPH\_INIT}}(lmi, \&\mbox{\hyperlink{ng__lmi_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00113}00113 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00114}00114 \textcolor{comment}{ * Info and status per node}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00115}00115 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00116}\mbox{\hyperlink{structnglmi__softc}{00116}} \textcolor{keyword}{struct }\mbox{\hyperlink{structnglmi__softc}{nglmi\_softc}} \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00117}\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{00117}}         \mbox{\hyperlink{structng__node}{node\_p}}  \mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}};         \textcolor{comment}{/* netgraph node */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00118}\mbox{\hyperlink{structnglmi__softc_a5a1119273f9317879feae3c6929b60fb}{00118}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structnglmi__softc_a5a1119273f9317879feae3c6929b60fb}{flags}};             \textcolor{comment}{/* state */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00119}\mbox{\hyperlink{structnglmi__softc_a95969416e45d0ad9428797fa8d9497f9}{00119}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structnglmi__softc_a95969416e45d0ad9428797fa8d9497f9}{poll\_count}};   \textcolor{comment}{/* the count of times for autolmi */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00120}\mbox{\hyperlink{structnglmi__softc_ab81d67ff52d855cc974bf8b979e6cc73}{00120}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structnglmi__softc_ab81d67ff52d855cc974bf8b979e6cc73}{poll\_state}};   \textcolor{comment}{/* state of auto detect machine */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00121}\mbox{\hyperlink{structnglmi__softc_aadbc293b2983cf341d46739705574d9e}{00121}}         u\_char  \mbox{\hyperlink{structnglmi__softc_aadbc293b2983cf341d46739705574d9e}{remote\_seq}};   \textcolor{comment}{/* sequence number the remote sent */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00122}\mbox{\hyperlink{structnglmi__softc_a3705bad6b80381ddee4a0e7c73e6c098}{00122}}         u\_char  \mbox{\hyperlink{structnglmi__softc_a3705bad6b80381ddee4a0e7c73e6c098}{local\_seq}};     \textcolor{comment}{/* last sequence number we sent */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00123}\mbox{\hyperlink{structnglmi__softc_abc10ca1c8dcc61f3cb68bef58f84434a}{00123}}         u\_char  \mbox{\hyperlink{structnglmi__softc_abc10ca1c8dcc61f3cb68bef58f84434a}{protoID}}; \textcolor{comment}{/* 9 for group of 4, 8 otherwise */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00124}\mbox{\hyperlink{structnglmi__softc_a49172c8583bc9ac87e5653cfd71cc322}{00124}}         u\_long  \mbox{\hyperlink{structnglmi__softc_a49172c8583bc9ac87e5653cfd71cc322}{seq\_retries}}; \textcolor{comment}{/* sent this how many time so far */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00125}\mbox{\hyperlink{structnglmi__softc_a2c52bd0912cb752cedc2d8b110b51263}{00125}}         \textcolor{keyword}{struct  }callout \mbox{\hyperlink{structnglmi__softc_a2c52bd0912cb752cedc2d8b110b51263}{handle}};   \textcolor{comment}{/* see timeout(9) */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00126}\mbox{\hyperlink{structnglmi__softc_a35ea4a34ff7747751f952de05d67817c}{00126}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structnglmi__softc_a35ea4a34ff7747751f952de05d67817c}{liv\_per\_full}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00127}\mbox{\hyperlink{structnglmi__softc_a8560aefec2e523780e3e3ef647c61b00}{00127}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structnglmi__softc_a8560aefec2e523780e3e3ef647c61b00}{liv\_rate}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00128}\mbox{\hyperlink{structnglmi__softc_a05e83a831f4165941e356ac268256a93}{00128}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structnglmi__softc_a05e83a831f4165941e356ac268256a93}{livs}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00129}\mbox{\hyperlink{structnglmi__softc_a7602be89614964baf3ec0f7dd041305c}{00129}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structnglmi__softc_a7602be89614964baf3ec0f7dd041305c}{need\_full}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00130}\mbox{\hyperlink{structnglmi__softc_a66bb693de12454580697a9f3c3eff1d5}{00130}}         \mbox{\hyperlink{structng__hook}{hook\_p}}  \mbox{\hyperlink{structnglmi__softc_a66bb693de12454580697a9f3c3eff1d5}{lmi\_channel}};   \textcolor{comment}{/* whatever we ended up using */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00131}\mbox{\hyperlink{structnglmi__softc_acd24923de344784fd2ed522a20a5d78a}{00131}}         \mbox{\hyperlink{structng__hook}{hook\_p}}  \mbox{\hyperlink{structnglmi__softc_acd24923de344784fd2ed522a20a5d78a}{lmi\_annexA}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00132}\mbox{\hyperlink{structnglmi__softc_a5ec307be7db36def2e2ee36baf8673b2}{00132}}         \mbox{\hyperlink{structng__hook}{hook\_p}}  \mbox{\hyperlink{structnglmi__softc_a5ec307be7db36def2e2ee36baf8673b2}{lmi\_annexD}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00133}\mbox{\hyperlink{structnglmi__softc_ae33ef9bdb05de6fd14d6c0f18699b6d7}{00133}}         \mbox{\hyperlink{structng__hook}{hook\_p}}  \mbox{\hyperlink{structnglmi__softc_ae33ef9bdb05de6fd14d6c0f18699b6d7}{lmi\_group4}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00134}\mbox{\hyperlink{structnglmi__softc_a23b3ea81a7e7e1ea5a1991a2da10b786}{00134}}         \mbox{\hyperlink{structng__hook}{hook\_p}}  \mbox{\hyperlink{structnglmi__softc_a23b3ea81a7e7e1ea5a1991a2da10b786}{lmi\_channel0}}; \textcolor{comment}{/* auto-\/detect on DLCI 0 */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00135}\mbox{\hyperlink{structnglmi__softc_a76e260014da12790eaa51dfa8d9a40b7}{00135}}         \mbox{\hyperlink{structng__hook}{hook\_p}}  \mbox{\hyperlink{structnglmi__softc_a76e260014da12790eaa51dfa8d9a40b7}{lmi\_channel1023}};\textcolor{comment}{/* auto-\/detect on DLCI 1023 */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00136}\mbox{\hyperlink{structnglmi__softc_a25d5596b27a24f1f60ba2b8d9bf9a222}{00136}}         \textcolor{keywordtype}{char}   *\mbox{\hyperlink{structnglmi__softc_a25d5596b27a24f1f60ba2b8d9bf9a222}{protoname}};     \textcolor{comment}{/* cache protocol name */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00137}\mbox{\hyperlink{structnglmi__softc_a8f68b29367c785e0d4d9b26d51716bc8}{00137}}         u\_char  \mbox{\hyperlink{structnglmi__softc_a8f68b29367c785e0d4d9b26d51716bc8}{dlci\_state}}[\mbox{\hyperlink{ng__lmi_8c_ad2e528c8d444673a8c4390ba51c9cae3}{MAXDLCI}} + 1];}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00138}\mbox{\hyperlink{structnglmi__softc_af610a6bd892a1bc070b31ece04e544d5}{00138}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structnglmi__softc_af610a6bd892a1bc070b31ece04e544d5}{invalidx}};       \textcolor{comment}{/* next dlci's to invalidate */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00139}00139 \};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00140}\mbox{\hyperlink{ng__lmi_8c_a7e2e482108ce9726bb4397fccefeda25}{00140}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\mbox{\hyperlink{structnglmi__softc}{nglmi\_softc}} *\mbox{\hyperlink{ng__lmi_8c_a7e2e482108ce9726bb4397fccefeda25}{sc\_p}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00142}00142 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00143}00143 \textcolor{comment}{ * Other internal functions}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00144}00144 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00145}00145 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__lmi_8c_a4027a65fbe46679bac3b435be7b52fe8}{LMI\_ticker}}(\mbox{\hyperlink{structng__node}{node\_p}} \mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{void} *arg1, \textcolor{keywordtype}{int} arg2);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00146}00146 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__lmi_8c_abb4872c42c8302e43bbbecaedcd02a40}{nglmi\_startup\_fixed}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, \mbox{\hyperlink{structng__hook}{hook\_p}} hook);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00147}00147 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__lmi_8c_ad88933ce82e9359ac2d66c6657604415}{nglmi\_startup\_auto}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00148}00148 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__lmi_8c_a9442a31587418d2307bc6fd5ee3595cf}{nglmi\_startup}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00149}00149 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__lmi_8c_a054ee892670fe88faa9e23ba004b55cf}{nglmi\_inquire}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, \textcolor{keywordtype}{int} full);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00150}00150 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ng__lmi_8c_aa088f02c12d8c8f8927428756de9fd6c}{ngauto\_state\_machine}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00152}00152 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00153}00153 \textcolor{comment}{ * Values for 'flags' field}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00154}00154 \textcolor{comment}{ * NB: the SCF\_CONNECTED flag is set if and only if the timer is running.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00155}00155 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00156}\mbox{\hyperlink{ng__lmi_8c_a377669240a1eea340f019bc9b0913e3f}{00156}} \textcolor{preprocessor}{\#define SCF\_CONNECTED   0x01    }\textcolor{comment}{/* connected to something */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00157}\mbox{\hyperlink{ng__lmi_8c_a53bd41e130e5700fc07d51222f31e460}{00157}} \textcolor{preprocessor}{\#define SCF\_AUTO        0x02    }\textcolor{comment}{/* we are auto-\/detecting */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00158}\mbox{\hyperlink{ng__lmi_8c_a2e34366462c2af90c8287e9c92d3c509}{00158}} \textcolor{preprocessor}{\#define SCF\_FIXED       0x04    }\textcolor{comment}{/* we are fixed from the start */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00160}\mbox{\hyperlink{ng__lmi_8c_afb2c1c310c6ba5b7a957f0e92d3437f9}{00160}} \textcolor{preprocessor}{\#define SCF\_LMITYPE     0x18    }\textcolor{comment}{/* mask for determining Annex mode */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00161}\mbox{\hyperlink{ng__lmi_8c_a2c305ac09337dee40ca6c135a3665252}{00161}} \textcolor{preprocessor}{\#define SCF\_NOLMI       0x00    }\textcolor{comment}{/* no LMI type selected yet */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00162}\mbox{\hyperlink{ng__lmi_8c_a5b2431e74aefed8d1d157600925934b2}{00162}} \textcolor{preprocessor}{\#define SCF\_ANNEX\_A     0x08    }\textcolor{comment}{/* running annex A mode */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00163}\mbox{\hyperlink{ng__lmi_8c_ae18e334658bf437ef4e13dd54fef02fd}{00163}} \textcolor{preprocessor}{\#define SCF\_ANNEX\_D     0x10    }\textcolor{comment}{/* running annex D mode */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00164}\mbox{\hyperlink{ng__lmi_8c_aa507b2e2a86acf22d144d03349b42a16}{00164}} \textcolor{preprocessor}{\#define SCF\_GROUP4      0x18    }\textcolor{comment}{/* running group of 4 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00166}\mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{00166}} \textcolor{preprocessor}{\#define SETLMITYPE(sc, annex)                                           \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00167}00167 \textcolor{preprocessor}{do \{                                                                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00168}00168 \textcolor{preprocessor}{        (sc)-\/>flags \&= \string~SCF\_LMITYPE;                                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00169}00169 \textcolor{preprocessor}{        (sc)-\/>flags |= (annex);                                         \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00170}00170 \textcolor{preprocessor}{\} while (0)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00172}\mbox{\hyperlink{ng__lmi_8c_a8b896689dd419b4de00e86edc16ae335}{00172}} \textcolor{preprocessor}{\#define NOPROTO(sc) (((sc)-\/>flags \& SCF\_LMITYPE) == SCF\_NOLMI)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00173}\mbox{\hyperlink{ng__lmi_8c_a711fa7b423149d39e275a194c15db9fb}{00173}} \textcolor{preprocessor}{\#define ANNEXA(sc) (((sc)-\/>flags \& SCF\_LMITYPE) == SCF\_ANNEX\_A)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00174}\mbox{\hyperlink{ng__lmi_8c_afbcded1b9264e0738e00b49c145a4a7d}{00174}} \textcolor{preprocessor}{\#define ANNEXD(sc) (((sc)-\/>flags \& SCF\_LMITYPE) == SCF\_ANNEX\_D)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00175}\mbox{\hyperlink{ng__lmi_8c_a92402508636109ea950658d46e756fd2}{00175}} \textcolor{preprocessor}{\#define GROUP4(sc) (((sc)-\/>flags \& SCF\_LMITYPE) == SCF\_GROUP4)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00176}00176 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00177}\mbox{\hyperlink{ng__lmi_8c_a16e456db825c72e3cb67bd34263a36b8}{00177}} \textcolor{preprocessor}{\#define LMIPOLLSIZE     3}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00178}\mbox{\hyperlink{ng__lmi_8c_ae659e7af8d476b87db708e37ef4fc70d}{00178}} \textcolor{preprocessor}{\#define LMI\_PATIENCE    8       }\textcolor{comment}{/* declare all DLCI DOWN after N LMI failures */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00180}00180 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00181}00181 \textcolor{comment}{ * Node constructor}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00182}00182 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00183}00183 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00184}\mbox{\hyperlink{ng__lmi_8c_a44aca24ea6e1c7c725e9996c0ca1694d}{00184}} \mbox{\hyperlink{ng__lmi_8c_a4b8687f66222e102a83adc7cd55fb601}{nglmi\_constructor}}(\mbox{\hyperlink{structng__node}{node\_p}} \mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00185}00185 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00186}00186         \mbox{\hyperlink{structng__async__private}{sc\_p}} sc;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00188}00188         sc = malloc(\textcolor{keyword}{sizeof}(*sc), M\_NETGRAPH, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00190}00190         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}, sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00191}00191         sc-\/>\mbox{\hyperlink{structng__async__private_abc8d009d3a7da97a2116416295b6626c}{node}} = \mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00193}00193         \mbox{\hyperlink{netgraph_8h_a86218dc6ee6651399a66c7cbcba144e4}{ng\_callout\_init}}(\&sc-\/>handle);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00194}00194         sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_ae07389c36f2fed8525368b5c20dca40c}{NAME\_NONE}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00195}00195         sc-\/>liv\_per\_full = \mbox{\hyperlink{ng__lmi_8h_a7c0dba361d3b001ec5f2698678b16987}{NG\_LMI\_SEQ\_PER\_FULL}};      \textcolor{comment}{/* make this dynamic */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00196}00196         sc-\/>liv\_rate = \mbox{\hyperlink{ng__lmi_8h_a2de6f8c8417083cb009242e6cc4e48f9}{NG\_LMI\_KEEPALIVE\_RATE}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00197}00197         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00198}00198 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00200}00200 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00201}00201 \textcolor{comment}{ * The LMI channel has a private pointer which is the same as the}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00202}00202 \textcolor{comment}{ * node private pointer. The debug channel has a NULL private pointer.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00203}00203 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00204}00204 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00205}\mbox{\hyperlink{ng__lmi_8c_a850b6d335a3ea1e0cd514f22e1e62431}{00205}} \mbox{\hyperlink{ng__lmi_8c_a33e85d7ab3390c9329224289fd43e150}{nglmi\_newhook}}(\mbox{\hyperlink{structng__node}{node\_p}} \mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00206}00206 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00207}00207         \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00209}00209         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__lmi_8h_aaaebfc58c04aeed4483704f167fd5cb2}{NG\_LMI\_HOOK\_DEBUG}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00210}00210                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, NULL);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00211}00211                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00212}00212         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00213}00213         \textcolor{keywordflow}{if} (sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a377669240a1eea340f019bc9b0913e3f}{SCF\_CONNECTED}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00214}00214                 \textcolor{comment}{/* already connected, return an error */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00215}00215                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00216}00216         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00217}00217         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__lmi_8h_a5217a4179d8fe32b573072824d4d399c}{NG\_LMI\_HOOK\_ANNEXA}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00218}00218                 sc-\/>lmi\_annexA = hook;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00219}00219                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00220}00220                 sc-\/>protoID = 8;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00221}00221                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_a5b2431e74aefed8d1d157600925934b2}{SCF\_ANNEX\_A}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00222}00222                 sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_ade750a60cf1431ae117bde7f4de9c457}{NAME\_ANNEXA}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00223}00223                 \mbox{\hyperlink{ng__lmi_8c_abb4872c42c8302e43bbbecaedcd02a40}{nglmi\_startup\_fixed}}(sc, hook);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00224}00224         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__lmi_8h_a0c1dcfa350bcc73afb23459e16679c03}{NG\_LMI\_HOOK\_ANNEXD}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00225}00225                 sc-\/>lmi\_annexD = hook;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00226}00226                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00227}00227                 sc-\/>protoID = 8;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00228}00228                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_ae18e334658bf437ef4e13dd54fef02fd}{SCF\_ANNEX\_D}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00229}00229                 sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_a08fbdfa006326dcdddb5b301a4c4169e}{NAME\_ANNEXD}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00230}00230                 \mbox{\hyperlink{ng__lmi_8c_abb4872c42c8302e43bbbecaedcd02a40}{nglmi\_startup\_fixed}}(sc, hook);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00231}00231         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__lmi_8h_a328772b1598a293c1afcc2fffc4792f5}{NG\_LMI\_HOOK\_GROUPOF4}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00232}00232                 sc-\/>lmi\_group4 = hook;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00233}00233                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00234}00234                 sc-\/>protoID = 9;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00235}00235                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_aa507b2e2a86acf22d144d03349b42a16}{SCF\_GROUP4}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00236}00236                 sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_a2f450fd797d0d4599bbc570a7fcc3d60}{NAME\_GROUP4}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00237}00237                 \mbox{\hyperlink{ng__lmi_8c_abb4872c42c8302e43bbbecaedcd02a40}{nglmi\_startup\_fixed}}(sc, hook);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00238}00238         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__lmi_8h_aac6934da1511942b861cd637ac30fbd0}{NG\_LMI\_HOOK\_AUTO0}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00239}00239                 \textcolor{comment}{/* Note this, and if B is already installed, we're complete */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00240}00240                 sc-\/>lmi\_channel0 = hook;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00241}00241                 sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_ae07389c36f2fed8525368b5c20dca40c}{NAME\_NONE}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00242}00242                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00243}00243                 \textcolor{keywordflow}{if} (sc-\/>lmi\_channel1023)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00244}00244                         \mbox{\hyperlink{ng__lmi_8c_ad88933ce82e9359ac2d66c6657604415}{nglmi\_startup\_auto}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00245}00245         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__lmi_8h_a0a6bc01543dbea169fb2e15f784d1932}{NG\_LMI\_HOOK\_AUTO1023}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00246}00246                 \textcolor{comment}{/* Note this, and if A is already installed, we're complete */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00247}00247                 sc-\/>lmi\_channel1023 = hook;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00248}00248                 sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_ae07389c36f2fed8525368b5c20dca40c}{NAME\_NONE}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00249}00249                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00250}00250                 \textcolor{keywordflow}{if} (sc-\/>lmi\_channel0)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00251}00251                         \mbox{\hyperlink{ng__lmi_8c_ad88933ce82e9359ac2d66c6657604415}{nglmi\_startup\_auto}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00252}00252         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00253}00253                 \textcolor{keywordflow}{return} (EINVAL);                \textcolor{comment}{/* unknown hook */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00254}00254         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00255}00255 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00256}00256 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00257}00257 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00258}00258 \textcolor{comment}{ * We have just attached to a live (we hope) node.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00259}00259 \textcolor{comment}{ * Fire out a LMI inquiry, and then start up the timers.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00260}00260 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00261}00261 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00262}\mbox{\hyperlink{ng__lmi_8c_a4027a65fbe46679bac3b435be7b52fe8}{00262}} \mbox{\hyperlink{ng__lmi_8c_a4027a65fbe46679bac3b435be7b52fe8}{LMI\_ticker}}(\mbox{\hyperlink{structng__node}{node\_p}} \mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{void} *arg1, \textcolor{keywordtype}{int} arg2)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00263}00263 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00264}00264         \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00266}00266         \textcolor{keywordflow}{if} (sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a53bd41e130e5700fc07d51222f31e460}{SCF\_AUTO}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00267}00267                 \mbox{\hyperlink{ng__lmi_8c_aa088f02c12d8c8f8927428756de9fd6c}{ngauto\_state\_machine}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00268}00268                 \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&sc-\/>handle, \mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}, NULL, \mbox{\hyperlink{ng__lmi_8h_a07beac469cf23f399ead4a399d8088e0}{NG\_LMI\_POLL\_RATE}} * hz,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00269}00269                     \mbox{\hyperlink{ng__lmi_8c_a4027a65fbe46679bac3b435be7b52fe8}{LMI\_ticker}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00270}00270         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00271}00271                 \textcolor{keywordflow}{if} (sc-\/>livs++ >= sc-\/>liv\_per\_full) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00272}00272                         \mbox{\hyperlink{ng__lmi_8c_a054ee892670fe88faa9e23ba004b55cf}{nglmi\_inquire}}(sc, 1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00273}00273                         \textcolor{comment}{/* sc-\/>livs = 0; */}\textcolor{comment}{/* do this when we get the answer! */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00274}00274                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00275}00275                         \mbox{\hyperlink{ng__lmi_8c_a054ee892670fe88faa9e23ba004b55cf}{nglmi\_inquire}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00276}00276                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00277}00277                 \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&sc-\/>handle, \mbox{\hyperlink{structnglmi__softc_ac272eee6c0a71b22c9ca0155ee7d5063}{node}}, NULL, sc-\/>liv\_rate * hz,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00278}00278                     \mbox{\hyperlink{ng__lmi_8c_a4027a65fbe46679bac3b435be7b52fe8}{LMI\_ticker}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00279}00279         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00280}00280 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00282}00282 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00283}\mbox{\hyperlink{ng__lmi_8c_abb4872c42c8302e43bbbecaedcd02a40}{00283}} \mbox{\hyperlink{ng__lmi_8c_abb4872c42c8302e43bbbecaedcd02a40}{nglmi\_startup\_fixed}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, \mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00284}00284 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00285}00285         sc-\/>flags |= (\mbox{\hyperlink{ng__lmi_8c_a2e34366462c2af90c8287e9c92d3c509}{SCF\_FIXED}} | \mbox{\hyperlink{ng__lmi_8c_a377669240a1eea340f019bc9b0913e3f}{SCF\_CONNECTED}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00286}00286         sc-\/>lmi\_channel = hook;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00287}00287         \mbox{\hyperlink{ng__lmi_8c_a9442a31587418d2307bc6fd5ee3595cf}{nglmi\_startup}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00288}00288 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00290}00290 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00291}\mbox{\hyperlink{ng__lmi_8c_ad88933ce82e9359ac2d66c6657604415}{00291}} \mbox{\hyperlink{ng__lmi_8c_ad88933ce82e9359ac2d66c6657604415}{nglmi\_startup\_auto}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00292}00292 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00293}00293         sc-\/>flags |= (\mbox{\hyperlink{ng__lmi_8c_a53bd41e130e5700fc07d51222f31e460}{SCF\_AUTO}} | \mbox{\hyperlink{ng__lmi_8c_a377669240a1eea340f019bc9b0913e3f}{SCF\_CONNECTED}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00294}00294         sc-\/>poll\_state = 0;     \textcolor{comment}{/* reset state machine */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00295}00295         sc-\/>poll\_count = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00296}00296         \mbox{\hyperlink{ng__lmi_8c_a9442a31587418d2307bc6fd5ee3595cf}{nglmi\_startup}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00297}00297 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00299}00299 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00300}\mbox{\hyperlink{ng__lmi_8c_a9442a31587418d2307bc6fd5ee3595cf}{00300}} \mbox{\hyperlink{ng__lmi_8c_a9442a31587418d2307bc6fd5ee3595cf}{nglmi\_startup}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00301}00301 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00302}00302         sc-\/>remote\_seq = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00303}00303         sc-\/>local\_seq = 1;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00304}00304         sc-\/>seq\_retries = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00305}00305         sc-\/>livs = sc-\/>liv\_per\_full -\/ 1;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00306}00306         \textcolor{comment}{/* start off the ticker in 1 sec */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00307}00307         \mbox{\hyperlink{netgraph_8h_aed70061429167aaa4b93a6129c959f0f}{ng\_callout}}(\&sc-\/>handle, sc-\/>\mbox{\hyperlink{structng__async__private_abc8d009d3a7da97a2116416295b6626c}{node}}, NULL, hz, \mbox{\hyperlink{ng__lmi_8c_a4027a65fbe46679bac3b435be7b52fe8}{LMI\_ticker}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00308}00308 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00309}00309 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00310}00310 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00311}\mbox{\hyperlink{ng__lmi_8c_a054ee892670fe88faa9e23ba004b55cf}{00311}} \mbox{\hyperlink{ng__lmi_8c_a054ee892670fe88faa9e23ba004b55cf}{nglmi\_inquire}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc, \textcolor{keywordtype}{int} full)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00312}00312 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00313}00313         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00314}00314         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__tag__prio}{ng\_tag\_prio}} *ptag;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00315}00315         \textcolor{keywordtype}{char}   *cptr, *start;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00316}00316         \textcolor{keywordtype}{int}     error;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00318}00318         \textcolor{keywordflow}{if} (sc-\/>lmi\_channel == NULL)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00319}00319                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00320}00320         MGETHDR(m, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00321}00321         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00322}00322                 log(LOG\_ERR, \textcolor{stringliteral}{"{}nglmi: unable to start up LMI processing\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00323}00323                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00324}00324         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00325}00325         m-\/>m\_pkthdr.rcvif = NULL;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00327}00327         \textcolor{comment}{/* Attach a tag to packet, marking it of link level state priority, so}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00328}00328 \textcolor{comment}{         * that device driver would put it in the beginning of queue */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00330}00330         ptag = (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__tag__prio}{ng\_tag\_prio}} *)m\_tag\_alloc(\mbox{\hyperlink{ng__message_8h_a577acb07400a990f6e293df85928c01e}{NGM\_GENERIC\_COOKIE}}, \mbox{\hyperlink{netgraph_8h_ab40f5f093de9f5b5a5e9c18690fa23c2}{NG\_TAG\_PRIO}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00331}00331             (\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structng__tag__prio}{ng\_tag\_prio}}) -\/ \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} m\_tag)), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00332}00332         \textcolor{keywordflow}{if} (ptag != NULL) \{     \textcolor{comment}{/* if it failed, well, it was optional anyhow */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00333}00333                 ptag-\/>\mbox{\hyperlink{structng__tag__prio_aa92bd8b47c6cabcca222d5ddea60bd99}{priority}} = \mbox{\hyperlink{netgraph_8h_a475bd22f3bce3cebb01ff118f4e9e1f6}{NG\_PRIO\_LINKSTATE}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00334}00334                 ptag-\/>\mbox{\hyperlink{structng__tag__prio_a9c48b65a62a5f8d18c7321050eb2c330}{discardability}} = -\/1;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00335}00335                 m\_tag\_prepend(m, \&ptag-\/>\mbox{\hyperlink{structng__tag__prio_ab047a9c47cbeb2465d1b1fe492348f92}{tag}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00336}00336         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00337}00337 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00338}00338         m-\/>m\_data += 4;         \textcolor{comment}{/* leave some room for a header */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00339}00339         cptr = start = mtod(m, \textcolor{keywordtype}{char} *);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00340}00340         \textcolor{comment}{/* add in the header for an LMI inquiry. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00341}00341         *cptr++ = 0x03;         \textcolor{comment}{/* UI frame */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00342}00342         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_a92402508636109ea950658d46e756fd2}{GROUP4}}(sc))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00343}00343                 *cptr++ = 0x09; \textcolor{comment}{/* proto discriminator */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00344}00344         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00345}00345                 *cptr++ = 0x08; \textcolor{comment}{/* proto discriminator */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00346}00346         *cptr++ = 0x00;         \textcolor{comment}{/* call reference */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00347}00347         *cptr++ = 0x75;         \textcolor{comment}{/* inquiry */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00349}00349         \textcolor{comment}{/* If we are Annex-\/D, add locking shift to codeset 5. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00350}00350         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_afbcded1b9264e0738e00b49c145a4a7d}{ANNEXD}}(sc))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00351}00351                 *cptr++ = 0x95; \textcolor{comment}{/* locking shift */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00352}00352         \textcolor{comment}{/* Add a request type */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00353}00353         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_a711fa7b423149d39e275a194c15db9fb}{ANNEXA}}(sc))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00354}00354                 *cptr++ = 0x51; \textcolor{comment}{/* report type */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00355}00355         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00356}00356                 *cptr++ = 0x01; \textcolor{comment}{/* report type */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00357}00357         *cptr++ = 0x01;         \textcolor{comment}{/* size = 1 */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00358}00358         \textcolor{keywordflow}{if} (full)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00359}00359                 *cptr++ = 0x00; \textcolor{comment}{/* full */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00360}00360         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00361}00361                 *cptr++ = 0x01; \textcolor{comment}{/* partial */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00363}00363         \textcolor{comment}{/* Add a link verification IE */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00364}00364         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_a711fa7b423149d39e275a194c15db9fb}{ANNEXA}}(sc))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00365}00365                 *cptr++ = 0x53; \textcolor{comment}{/* verification IE */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00366}00366         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00367}00367                 *cptr++ = 0x03; \textcolor{comment}{/* verification IE */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00368}00368         *cptr++ = 0x02;         \textcolor{comment}{/* 2 extra bytes */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00369}00369         *cptr++ = sc-\/>local\_seq;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00370}00370         *cptr++ = sc-\/>remote\_seq;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00371}00371         sc-\/>seq\_retries++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00372}00372 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00373}00373         \textcolor{comment}{/* Send it */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00374}00374         m-\/>m\_len = m-\/>m\_pkthdr.len = cptr -\/ start;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00375}00375         \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}(error, sc-\/>lmi\_channel, m);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00376}00376 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00377}00377         \textcolor{comment}{/* If we've been sending requests for long enough, and there has}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00378}00378 \textcolor{comment}{         * been no response, then mark as DOWN, any DLCIs that are UP. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00379}00379         \textcolor{keywordflow}{if} (sc-\/>seq\_retries == \mbox{\hyperlink{ng__lmi_8c_ae659e7af8d476b87db708e37ef4fc70d}{LMI\_PATIENCE}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00380}00380                 \textcolor{keywordtype}{int}     \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00382}00382                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} = 0; \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} < \mbox{\hyperlink{ng__lmi_8c_ad2e528c8d444673a8c4390ba51c9cae3}{MAXDLCI}}; \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}}++)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00383}00383                         \textcolor{keywordflow}{if} (sc-\/>dlci\_state[\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}}] == \mbox{\hyperlink{ng__lmi_8c_ae68ad97485ca240cd6ff7f3298082735}{DLCI\_UP}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00384}00384                                 sc-\/>dlci\_state[\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}}] = \mbox{\hyperlink{ng__lmi_8c_afcb9f0fe1ed68e04bf199e61812b53f1}{DLCI\_DOWN}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00385}00385         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00386}00386 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00387}00387 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00388}00388 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00389}00389 \textcolor{comment}{ * State machine for LMI auto-\/detect. The transitions are ordered}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00390}00390 \textcolor{comment}{ * to try the more likely possibilities first.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00391}00391 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00392}00392 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00393}\mbox{\hyperlink{ng__lmi_8c_aa088f02c12d8c8f8927428756de9fd6c}{00393}} \mbox{\hyperlink{ng__lmi_8c_aa088f02c12d8c8f8927428756de9fd6c}{ngauto\_state\_machine}}(\mbox{\hyperlink{structng__async__private}{sc\_p}} sc)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00394}00394 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00395}00395         \textcolor{keywordflow}{if} ((sc-\/>poll\_count <= 0) || (sc-\/>poll\_count > \mbox{\hyperlink{ng__lmi_8c_a16e456db825c72e3cb67bd34263a36b8}{LMIPOLLSIZE}})) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00396}00396                 \textcolor{comment}{/* time to change states in the auto probe machine */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00397}00397                 \textcolor{comment}{/* capture wild values of poll\_count while we are at it */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00398}00398                 sc-\/>poll\_count = \mbox{\hyperlink{ng__lmi_8c_a16e456db825c72e3cb67bd34263a36b8}{LMIPOLLSIZE}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00399}00399                 sc-\/>poll\_state++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00400}00400         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00401}00401         \textcolor{keywordflow}{switch} (sc-\/>poll\_state) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00402}00402         \textcolor{keywordflow}{case} 7:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00403}00403                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: no response from exchange\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00404}00404         \textcolor{keywordflow}{default}:                \textcolor{comment}{/* capture bad states */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00405}00405                 sc-\/>poll\_state = 1;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00406}00406         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00407}00407                 sc-\/>lmi\_channel = sc-\/>lmi\_channel0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00408}00408                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_ae18e334658bf437ef4e13dd54fef02fd}{SCF\_ANNEX\_D}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00409}00409                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00410}00410         \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00411}00411                 sc-\/>lmi\_channel = sc-\/>lmi\_channel1023;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00412}00412                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_ae18e334658bf437ef4e13dd54fef02fd}{SCF\_ANNEX\_D}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00413}00413                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00414}00414         \textcolor{keywordflow}{case} 3:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00415}00415                 sc-\/>lmi\_channel = sc-\/>lmi\_channel0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00416}00416                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_a5b2431e74aefed8d1d157600925934b2}{SCF\_ANNEX\_A}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00417}00417                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00418}00418         \textcolor{keywordflow}{case} 4:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00419}00419                 sc-\/>lmi\_channel = sc-\/>lmi\_channel1023;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00420}00420                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_aa507b2e2a86acf22d144d03349b42a16}{SCF\_GROUP4}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00421}00421                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00422}00422         \textcolor{keywordflow}{case} 5:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00423}00423                 sc-\/>lmi\_channel = sc-\/>lmi\_channel1023;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00424}00424                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_a5b2431e74aefed8d1d157600925934b2}{SCF\_ANNEX\_A}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00425}00425                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00426}00426         \textcolor{keywordflow}{case} 6:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00427}00427                 sc-\/>lmi\_channel = sc-\/>lmi\_channel0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00428}00428                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_aa507b2e2a86acf22d144d03349b42a16}{SCF\_GROUP4}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00429}00429                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00430}00430         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00432}00432         \textcolor{comment}{/* send an inquirey encoded appropriately */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00433}00433         \mbox{\hyperlink{ng__lmi_8c_a054ee892670fe88faa9e23ba004b55cf}{nglmi\_inquire}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00434}00434         sc-\/>poll\_count-\/-\/;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00435}00435 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00436}00436 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00437}00437 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00438}00438 \textcolor{comment}{ * Receive a netgraph control message.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00439}00439 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00440}00440 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00441}\mbox{\hyperlink{ng__lmi_8c_a550556a04580ba650d37662c6942b2ca}{00441}} \mbox{\hyperlink{ng__lmi_8c_a3cfb8621adc478707421cf146e4870c9}{nglmi\_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__lmi_8c_source_l00442}00442 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00443}00443         \mbox{\hyperlink{structng__async__private}{sc\_p}}    sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00444}00444         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *resp = NULL;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00445}00445         \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00446}00446         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}} *msg;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00447}00447 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00448}00448         \mbox{\hyperlink{netgraph_8h_adc9a04fd174ef3c29ecae94016b84839}{NGI\_GET\_MSG}}(item, msg);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00449}00449         \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_ab59e14593b69a406ed5ca4209d489a10}{typecookie}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00450}00450         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__message_8h_a577acb07400a990f6e293df85928c01e}{NGM\_GENERIC\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00451}00451                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00452}00452                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__message_8h_ae8a3b6a5d0d3244ed73924ab2421a0d0af7e8d918ab39873056284fe1b8dfe71b}{NGM\_TEXT\_STATUS}}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00453}00453                     \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00454}00454                         \textcolor{keywordtype}{char}   *arg;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00455}00455                         \textcolor{keywordtype}{int}     pos, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00456}00456 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00457}00457                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \mbox{\hyperlink{ng__message_8h_a3a84bfff41ce7395b73b14eb82a0f4e1}{NG\_TEXTRESPONSE}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00458}00458                         \textcolor{keywordflow}{if} (resp == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00459}00459                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00460}00460                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00461}00461                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00462}00462                         arg = resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00463}00463                         pos = sprintf(arg, \textcolor{stringliteral}{"{}protocol \%s "{}}, sc-\/>protoname);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00464}00464                         \textcolor{keywordflow}{if} (sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a2e34366462c2af90c8287e9c92d3c509}{SCF\_FIXED}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00465}00465                                 pos += sprintf(arg + pos, \textcolor{stringliteral}{"{}fixed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00466}00466                         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a53bd41e130e5700fc07d51222f31e460}{SCF\_AUTO}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00467}00467                                 pos += sprintf(arg + pos, \textcolor{stringliteral}{"{}auto-\/detecting\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00468}00468                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00469}00469                                 pos += sprintf(arg + pos, \textcolor{stringliteral}{"{}auto on dlci \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00470}00470                                     (sc-\/>lmi\_channel == sc-\/>lmi\_channel0) ?}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00471}00471                                     0 : 1023);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00472}00472                         pos += sprintf(arg + pos,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00473}00473                             \textcolor{stringliteral}{"{}keepalive period: \%d seconds\(\backslash\)n"{}}, sc-\/>liv\_rate);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00474}00474                         pos += sprintf(arg + pos,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00475}00475                             \textcolor{stringliteral}{"{}unacknowledged keepalives: \%ld\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00476}00476                             sc-\/>seq\_retries);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00477}00477                         \textcolor{keywordflow}{for} (\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00478}00478                              ((\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} <= \mbox{\hyperlink{ng__lmi_8c_ad2e528c8d444673a8c4390ba51c9cae3}{MAXDLCI}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00479}00479                               \&\& (pos < (\mbox{\hyperlink{ng__message_8h_a3a84bfff41ce7395b73b14eb82a0f4e1}{NG\_TEXTRESPONSE}} -\/ 20)));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00480}00480                              \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}}++) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00481}00481                                 \textcolor{keywordflow}{if} (sc-\/>dlci\_state[\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}}]) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00482}00482                                         pos += sprintf(arg + pos,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00483}00483                                                \textcolor{stringliteral}{"{}dlci \%d \%s\(\backslash\)n"{}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00484}00484                                                (sc-\/>dlci\_state[\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}}]}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00485}00485                                         == \mbox{\hyperlink{ng__lmi_8c_ae68ad97485ca240cd6ff7f3298082735}{DLCI\_UP}}) ? \textcolor{stringliteral}{"{}up"{}} : \textcolor{stringliteral}{"{}down"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00486}00486                                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00487}00487                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00488}00488                         resp-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} = pos + 1;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00489}00489                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00490}00490                     \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00491}00491                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00492}00492                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00493}00493                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00494}00494                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00495}00495                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00496}00496         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__lmi_8h_a0080b19f7a95c8497c21dd5d267e4d27}{NGM\_LMI\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00497}00497                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00498}00498                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__lmi_8h_a84627a72058502328269676b81780f89a53686adf0225641dde7885bed075c9a5}{NGM\_LMI\_GET\_STATUS}}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00499}00499                     \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00500}00500                         \textcolor{keyword}{struct }\mbox{\hyperlink{structnglmistat}{nglmistat}} *stat;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00501}00501                         \textcolor{keywordtype}{int} k;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00502}00502 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00503}00503                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(resp, msg, \textcolor{keyword}{sizeof}(*stat), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00504}00504                         \textcolor{keywordflow}{if} (!resp) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00505}00505                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00506}00506                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00507}00507                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00508}00508                         stat = (\textcolor{keyword}{struct }\mbox{\hyperlink{structnglmistat}{nglmistat}} *) resp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00509}00509                         strncpy(stat-\/>\mbox{\hyperlink{structnglmistat_a4d4341cf69ee3a54953e11dade457e7d}{proto}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00510}00510                              sc-\/>protoname, \textcolor{keyword}{sizeof}(stat-\/>\mbox{\hyperlink{structnglmistat_a4d4341cf69ee3a54953e11dade457e7d}{proto}}) -\/ 1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00511}00511                         strncpy(stat-\/>\mbox{\hyperlink{structnglmistat_a6be43ca56f77a585f523e3ae513e7136}{hook}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00512}00512                               sc-\/>protoname, \textcolor{keyword}{sizeof}(stat-\/>\mbox{\hyperlink{structnglmistat_a6be43ca56f77a585f523e3ae513e7136}{hook}}) -\/ 1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00513}00513                         stat-\/>\mbox{\hyperlink{structnglmistat_ad652acfc12b0c810da6760796e8f6a08}{autod}} = !!(sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a53bd41e130e5700fc07d51222f31e460}{SCF\_AUTO}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00514}00514                         stat-\/>\mbox{\hyperlink{structnglmistat_a0e0ad0b74bdbf19a4cc9d204270cb75d}{fixed}} = !!(sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a2e34366462c2af90c8287e9c92d3c509}{SCF\_FIXED}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00515}00515                         \textcolor{keywordflow}{for} (k = 0; k <= \mbox{\hyperlink{ng__lmi_8c_ad2e528c8d444673a8c4390ba51c9cae3}{MAXDLCI}}; k++) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00516}00516                                 \textcolor{keywordflow}{switch} (sc-\/>dlci\_state[k]) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00517}00517                                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__lmi_8c_ae68ad97485ca240cd6ff7f3298082735}{DLCI\_UP}}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00518}00518                                         stat-\/>\mbox{\hyperlink{structnglmistat_a767a07704c39e6eaf1042b4c4758d649}{up}}[k / 8] |= (1 << (k \% 8));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00519}00519                                         \textcolor{comment}{/* fall through */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00520}00520                                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__lmi_8c_afcb9f0fe1ed68e04bf199e61812b53f1}{DLCI\_DOWN}}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00521}00521                                         stat-\/>\mbox{\hyperlink{structnglmistat_a783a8c8abd7c622555428323f752248f}{seen}}[k / 8] |= (1 << (k \% 8));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00522}00522                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00523}00523                                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00524}00524                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00525}00525                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00526}00526                     \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00527}00527                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00528}00528                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00529}00529                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00530}00530                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00531}00531                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00532}00532         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00533}00533                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00534}00534                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00535}00535         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00536}00536 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00537}00537         \mbox{\hyperlink{netgraph_8h_a69db50ed7f968e936580df029ab5c5dc}{NG\_RESPOND\_MSG}}(error, node, item, resp);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00538}00538         \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00539}00539         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00540}00540 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00542}\mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{00542}} \textcolor{preprocessor}{\#define STEPBY(stepsize)                        \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00543}00543 \textcolor{preprocessor}{        do \{                                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00544}00544 \textcolor{preprocessor}{                packetlen -\/= (stepsize);        \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00545}00545 \textcolor{preprocessor}{                data += (stepsize);             \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00546}00546 \textcolor{preprocessor}{        \} while (0)}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00547}00547 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00548}00548 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00549}00549 \textcolor{comment}{ * receive data, and use it to update our status.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00550}00550 \textcolor{comment}{ * Anything coming in on the debug port is discarded.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00551}00551 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00552}00552 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00553}\mbox{\hyperlink{ng__lmi_8c_a9bb3d8c3cfc9fa9e7310c0cb07e0d43f}{00553}} \mbox{\hyperlink{ng__lmi_8c_a5b1c91c805f4ecfa5d7d633d08307cd7}{nglmi\_rcvdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} \mbox{\hyperlink{structnglmistat_a6be43ca56f77a585f523e3ae513e7136}{hook}}, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00554}00554 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00555}00555         \mbox{\hyperlink{structng__async__private}{sc\_p}}    sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(\mbox{\hyperlink{structnglmistat_a6be43ca56f77a585f523e3ae513e7136}{hook}}));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00556}00556         \textcolor{keyword}{const}   u\_char *\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00557}00557         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00558}00558         u\_short packetlen;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00559}00559         \textcolor{keywordtype}{int}     resptype\_seen = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00560}00560         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00561}00561 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00562}00562         \mbox{\hyperlink{netgraph_8h_abbb0acb5f480576cff9901caddeef57f}{NGI\_GET\_M}}(item, m);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00563}00563         \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00564}00564         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook) == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00565}00565                 \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00566}00566         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00567}00567         packetlen = m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00568}00568 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00569}00569         \textcolor{comment}{/* XXX what if it's more than 1 mbuf? */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00570}00570         \textcolor{keywordflow}{if} ((packetlen > MHLEN) \&\& !(m-\/>m\_flags \& M\_EXT)) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00571}00571                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: packetlen (\%d) too big\(\backslash\)n"{}}, packetlen);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00572}00572                 \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00573}00573         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00574}00574         \textcolor{keywordflow}{if} (m-\/>m\_len < packetlen \&\& (m = m\_pullup(m, packetlen)) == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00575}00575                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00576}00576                     \textcolor{stringliteral}{"{}nglmi: m\_pullup failed for \%d bytes\(\backslash\)n"{}}, packetlen);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00577}00577                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00578}00578         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00579}00579         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_a6fbe8c7d60934a83f6022276ce88d7db}{nglmi\_checkdata}}(hook, m) == 0)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00580}00580                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00581}00581 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00582}00582         \textcolor{comment}{/* pass the first 4 bytes (already checked in the nglmi\_checkdata()) */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00583}00583         \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}} = mtod(m, \textcolor{keyword}{const} u\_char *);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00584}00584         \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(4);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00585}00585 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00586}00586         \textcolor{comment}{/* Now check if there is a 'locking shift'. This is only seen in}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00587}00587 \textcolor{comment}{         * Annex D frames. don't bother checking, we already did that. Don't}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00588}00588 \textcolor{comment}{         * increment immediately as it might not be there. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00589}00589         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_afbcded1b9264e0738e00b49c145a4a7d}{ANNEXD}}(sc))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00590}00590                 \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00591}00591 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00592}00592         \textcolor{comment}{/* If we get this far we should consider that it is a legitimate}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00593}00593 \textcolor{comment}{         * frame and we know what it is. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00594}00594         \textcolor{keywordflow}{if} (sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a53bd41e130e5700fc07d51222f31e460}{SCF\_AUTO}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00595}00595                 \textcolor{comment}{/* note the hook that this valid channel came from and drop}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00596}00596 \textcolor{comment}{                 * out of auto probe mode. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00597}00597                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_a711fa7b423149d39e275a194c15db9fb}{ANNEXA}}(sc))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00598}00598                         sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_ade750a60cf1431ae117bde7f4de9c457}{NAME\_ANNEXA}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00599}00599                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_afbcded1b9264e0738e00b49c145a4a7d}{ANNEXD}}(sc))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00600}00600                         sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_a08fbdfa006326dcdddb5b301a4c4169e}{NAME\_ANNEXD}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00601}00601                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_a92402508636109ea950658d46e756fd2}{GROUP4}}(sc))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00602}00602                         sc-\/>protoname = \mbox{\hyperlink{ng__lmi_8c_a2f450fd797d0d4599bbc570a7fcc3d60}{NAME\_GROUP4}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00603}00603                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00604}00604                         log(LOG\_ERR, \textcolor{stringliteral}{"{}nglmi: No known type\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00605}00605                         \textcolor{keywordflow}{goto} drop;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00606}00606                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00607}00607                 sc-\/>lmi\_channel = hook;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00608}00608                 sc-\/>flags \&= \string~SCF\_AUTO;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00609}00609                 log(LOG\_INFO, \textcolor{stringliteral}{"{}nglmi: auto-\/detected \%s LMI on DLCI \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00610}00610                     sc-\/>protoname, hook == sc-\/>lmi\_channel0 ? 0 : 1023);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00611}00611         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00612}00612 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00613}00613         \textcolor{comment}{/* While there is more data in the status packet, keep processing}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00614}00614 \textcolor{comment}{         * status items. First make sure there is enough data for the}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00615}00615 \textcolor{comment}{         * segment descriptor's length field. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00616}00616         \textcolor{keywordflow}{while} (packetlen >= 2) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00617}00617                 u\_int   segtype = \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[0];}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00618}00618                 u\_int   segsize = \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[1];}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00620}00620                 \textcolor{comment}{/* Now that we know how long it claims to be, make sure}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00621}00621 \textcolor{comment}{                 * there is enough data for the next seg. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00622}00622                 \textcolor{keywordflow}{if} (packetlen < segsize + 2)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00623}00623                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00624}00624                 \textcolor{keywordflow}{switch} (segtype) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00625}00625                 \textcolor{keywordflow}{case} 0x01:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00626}00626                 \textcolor{keywordflow}{case} 0x51:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00627}00627                         \textcolor{keywordflow}{if} (resptype\_seen) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00628}00628                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: dup MSGTYPE\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00629}00629                                 \textcolor{keywordflow}{goto} nextIE;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00630}00630                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00631}00631                         resptype\_seen++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00632}00632                         \textcolor{comment}{/* The remote end tells us what kind of response}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00633}00633 \textcolor{comment}{                         * this is. Only expect a type 0 or 1. if we are a}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00634}00634 \textcolor{comment}{                         * full status, invalidate a few DLCIs just to see}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00635}00635 \textcolor{comment}{                         * that they are still ok. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00636}00636                         \textcolor{keywordflow}{if} (segsize != 1)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00637}00637                                 \textcolor{keywordflow}{goto} nextIE;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00638}00638                         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[2]) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00639}00639                         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00640}00640                                 \textcolor{comment}{/* partial status, do no extra processing */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00641}00641                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00642}00642                         \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00643}00643                             \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00644}00644                                 \textcolor{keywordtype}{int}     \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00645}00645                                 \textcolor{keywordtype}{int}     idx = sc-\/>invalidx;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00646}00646 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00647}00647                                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} = 0; \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} < 10; \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}}++) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00648}00648                                         \textcolor{keywordflow}{if} (idx > \mbox{\hyperlink{ng__lmi_8c_ad2e528c8d444673a8c4390ba51c9cae3}{MAXDLCI}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00649}00649                                                 idx = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00650}00650                                         \textcolor{keywordflow}{if} (sc-\/>dlci\_state[idx] == \mbox{\hyperlink{ng__lmi_8c_ae68ad97485ca240cd6ff7f3298082735}{DLCI\_UP}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00651}00651                                                 sc-\/>dlci\_state[idx] = \mbox{\hyperlink{ng__lmi_8c_afcb9f0fe1ed68e04bf199e61812b53f1}{DLCI\_DOWN}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00652}00652                                         idx++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00653}00653                                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00654}00654                                 sc-\/>invalidx = idx;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00655}00655                                 \textcolor{comment}{/* we got and we wanted one. relax}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00656}00656 \textcolor{comment}{                                 * now.. but don't reset to 0 if it}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00657}00657 \textcolor{comment}{                                 * was unrequested. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00658}00658                                 \textcolor{keywordflow}{if} (sc-\/>livs > sc-\/>liv\_per\_full)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00659}00659                                         sc-\/>livs = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00660}00660                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00661}00661                             \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00662}00662                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00663}00663                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00664}00664                 \textcolor{keywordflow}{case} 0x03:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00665}00665                 \textcolor{keywordflow}{case} 0x53:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00666}00666                         \textcolor{comment}{/* The remote tells us what it thinks the sequence}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00667}00667 \textcolor{comment}{                         * numbers are. If it's not size 2, it must be a}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00668}00668 \textcolor{comment}{                         * duplicate to have gotten this far, skip it. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00669}00669                         \textcolor{keywordflow}{if} (segsize != 2)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00670}00670                                 \textcolor{keywordflow}{goto} nextIE;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00671}00671                         sc-\/>remote\_seq = \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[2];}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00672}00672                         \textcolor{keywordflow}{if} (sc-\/>local\_seq == \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[3]) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00673}00673                                 sc-\/>local\_seq++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00674}00674                                 sc-\/>seq\_retries = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00675}00675                                 \textcolor{comment}{/* Note that all 3 Frame protocols seem to}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00676}00676 \textcolor{comment}{                                 * not like 0 as a sequence number. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00677}00677                                 \textcolor{keywordflow}{if} (sc-\/>local\_seq == 0)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00678}00678                                         sc-\/>local\_seq = 1;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00679}00679                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00680}00680                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00681}00681                 \textcolor{keywordflow}{case} 0x07:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00682}00682                 \textcolor{keywordflow}{case} 0x57:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00683}00683                         \textcolor{comment}{/* The remote tells us about a DLCI that it knows}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00684}00684 \textcolor{comment}{                         * about. There may be many of these in a single}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00685}00685 \textcolor{comment}{                         * status response */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00686}00686                         \textcolor{keywordflow}{switch} (segsize) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00687}00687                         \textcolor{keywordflow}{case} 6:\textcolor{comment}{/* only on 'group of 4' */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00688}00688                                 \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} = ((u\_short) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[2] \& 0xff) << 8;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00689}00689                                 \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} |= (\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[3] \& 0xff);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00690}00690                                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} < 1024) \&\& (\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} > 0)) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00691}00691                                   \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00692}00692                                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00693}00693                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00694}00694                         \textcolor{keywordflow}{case} 3:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00695}00695                                 \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} = ((u\_short) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[2] \& 0x3f) << 4;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00696}00696                                 \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} |= ((\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[3] \& 0x78) >> 3);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00697}00697                                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} < 1024) \&\& (\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} > 0)) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00698}00698                                         \textcolor{comment}{/* set up the bottom half of the}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00699}00699 \textcolor{comment}{                                         * support for that dlci if it's not}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00700}00700 \textcolor{comment}{                                         * already been done */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00701}00701                                         \textcolor{comment}{/* store this information somewhere */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00702}00702                                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00703}00703                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00704}00704                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00705}00705                                 \textcolor{keywordflow}{goto} nextIE;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00706}00706                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00707}00707                         \textcolor{keywordflow}{if} (sc-\/>dlci\_state[\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}}] != \mbox{\hyperlink{ng__lmi_8c_ae68ad97485ca240cd6ff7f3298082735}{DLCI\_UP}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00708}00708                                 \textcolor{comment}{/* bring new DLCI to life */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00709}00709                                 \textcolor{comment}{/* may do more here some day */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00710}00710                                 \textcolor{keywordflow}{if} (sc-\/>dlci\_state[\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}}] != \mbox{\hyperlink{ng__lmi_8c_afcb9f0fe1ed68e04bf199e61812b53f1}{DLCI\_DOWN}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00711}00711                                         log(LOG\_INFO,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00712}00712                                             \textcolor{stringliteral}{"{}nglmi: DLCI \%d became active\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00713}00713                                             \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00714}00714                                 sc-\/>dlci\_state[\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}}] = \mbox{\hyperlink{ng__lmi_8c_ae68ad97485ca240cd6ff7f3298082735}{DLCI\_UP}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00715}00715                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00716}00716                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00717}00717                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00718}00718 nextIE:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00719}00719                 \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(segsize + 2);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00720}00720         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00721}00721         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00722}00722         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00723}00723 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00724}00724 drop:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00725}00725         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00726}00726         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00727}00727 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00728}00728 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00729}00729 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00730}00730 \textcolor{comment}{ * Check that a packet is entirely kosha.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00731}00731 \textcolor{comment}{ * return 1 of ok, and 0 if not.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00732}00732 \textcolor{comment}{ * All data is discarded if a 0 is returned.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00733}00733 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00734}00734 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00735}\mbox{\hyperlink{ng__lmi_8c_a6fbe8c7d60934a83f6022276ce88d7db}{00735}} \mbox{\hyperlink{ng__lmi_8c_a6fbe8c7d60934a83f6022276ce88d7db}{nglmi\_checkdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00736}00736 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00737}00737         \mbox{\hyperlink{structng__async__private}{sc\_p}}    sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00738}00738         \textcolor{keyword}{const}   u\_char *\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00739}00739         u\_short packetlen;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00740}00740         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00741}00741         u\_char  \mbox{\hyperlink{ng__btsocket__rfcomm_8h_a3cce6e7fc609fa524af48647bd518f51}{type}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00742}00742         u\_char  nextbyte;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00743}00743         \textcolor{keywordtype}{int}     seq\_seen = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00744}00744         \textcolor{keywordtype}{int}     resptype\_seen = 0;      \textcolor{comment}{/* 0 , 1 (partial) or 2 (full) */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00745}00745         \textcolor{keywordtype}{int}     highest\_dlci = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00746}00746 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00747}00747         packetlen = m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00748}00748         \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}} = mtod(m, \textcolor{keyword}{const} u\_char *);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00749}00749         \textcolor{keywordflow}{if} (*\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}} != 0x03) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00750}00750                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: unexpected value in LMI(\%d)\(\backslash\)n"{}}, 1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00751}00751                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00752}00752         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00753}00753         \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00754}00754 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00755}00755         \textcolor{comment}{/* look at the protocol ID */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00756}00756         nextbyte = *\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00757}00757         \textcolor{keywordflow}{if} (sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a53bd41e130e5700fc07d51222f31e460}{SCF\_AUTO}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00758}00758                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_a2c305ac09337dee40ca6c135a3665252}{SCF\_NOLMI}});   \textcolor{comment}{/* start with a clean slate */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00759}00759                 \textcolor{keywordflow}{switch} (nextbyte) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00760}00760                 \textcolor{keywordflow}{case} 0x8:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00761}00761                         sc-\/>protoID = 8;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00762}00762                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00763}00763                 \textcolor{keywordflow}{case} 0x9:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00764}00764                         \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_aa507b2e2a86acf22d144d03349b42a16}{SCF\_GROUP4}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00765}00765                         sc-\/>protoID = 9;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00766}00766                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00767}00767                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00768}00768                         log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: bad Protocol ID(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00769}00769                             (\textcolor{keywordtype}{int}) nextbyte);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00770}00770                         \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00771}00771                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00772}00772         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00773}00773                 \textcolor{keywordflow}{if} (nextbyte != sc-\/>protoID) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00774}00774                         log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: unexpected Protocol ID(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00775}00775                             (\textcolor{keywordtype}{int}) nextbyte);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00776}00776                         \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00777}00777                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00778}00778         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00779}00779         \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00780}00780 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00781}00781         \textcolor{comment}{/* check call reference (always null in non ISDN frame relay) */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00782}00782         \textcolor{keywordflow}{if} (*\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}} != 0x00) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00783}00783                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: unexpected Call Reference (0x\%x)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00784}00784                     \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[-\/1]);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00785}00785                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00786}00786         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00787}00787         \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00788}00788 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00789}00789         \textcolor{comment}{/* check message type */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00790}00790         \textcolor{keywordflow}{switch} ((\mbox{\hyperlink{ng__btsocket__rfcomm_8h_a3cce6e7fc609fa524af48647bd518f51}{type}} = *\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}})) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00791}00791         \textcolor{keywordflow}{case} 0x75:              \textcolor{comment}{/* Status enquiry */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00792}00792                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: unexpected message type(0x\%x)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00793}00793                     \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[-\/1]);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00794}00794                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00795}00795         \textcolor{keywordflow}{case} 0x7D:              \textcolor{comment}{/* Status message */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00796}00796                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00797}00797         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00798}00798                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00799}00799                     \textcolor{stringliteral}{"{}nglmi: unexpected msg type(0x\%x) \(\backslash\)n"{}}, (\textcolor{keywordtype}{int}) \mbox{\hyperlink{ng__btsocket__rfcomm_8h_a3cce6e7fc609fa524af48647bd518f51}{type}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00800}00800                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00801}00801         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00802}00802         \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00803}00803 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00804}00804         \textcolor{comment}{/* Now check if there is a 'locking shift'. This is only seen in}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00805}00805 \textcolor{comment}{         * Annex D frames. Don't increment immediately as it might not be}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00806}00806 \textcolor{comment}{         * there. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00807}00807         nextbyte = *\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00808}00808         \textcolor{keywordflow}{if} (sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a53bd41e130e5700fc07d51222f31e460}{SCF\_AUTO}}) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00809}00809                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{ng__lmi_8c_a92402508636109ea950658d46e756fd2}{GROUP4}}(sc))) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00810}00810                         \textcolor{keywordflow}{if} (nextbyte == 0x95) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00811}00811                                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_ae18e334658bf437ef4e13dd54fef02fd}{SCF\_ANNEX\_D}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00812}00812                                 \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00813}00813                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00814}00814                                 \mbox{\hyperlink{ng__lmi_8c_ae369d1e0febabcb8dab985ed8de2127b}{SETLMITYPE}}(sc, \mbox{\hyperlink{ng__lmi_8c_a5b2431e74aefed8d1d157600925934b2}{SCF\_ANNEX\_A}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00815}00815                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (nextbyte == 0x95) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00816}00816                         log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: locking shift seen in G4\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00817}00817                         \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00818}00818                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00819}00819         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00820}00820                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_afbcded1b9264e0738e00b49c145a4a7d}{ANNEXD}}(sc)) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00821}00821                         \textcolor{keywordflow}{if} (*\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}} == 0x95)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00822}00822                                 \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00823}00823                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00824}00824                                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00825}00825                                     \textcolor{stringliteral}{"{}nglmi: locking shift missing\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00826}00826                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00827}00827                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00828}00828                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (*\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}} == 0x95) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00829}00829                         log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: locking shift seen\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00830}00830                         \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00831}00831                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00832}00832         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00834}00834         \textcolor{comment}{/* While there is more data in the status packet, keep processing}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00835}00835 \textcolor{comment}{         * status items. First make sure there is enough data for the}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00836}00836 \textcolor{comment}{         * segment descriptor's length field. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00837}00837         \textcolor{keywordflow}{while} (packetlen >= 2) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00838}00838                 u\_int   segtype = \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[0];}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00839}00839                 u\_int   segsize = \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[1];}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00840}00840 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00841}00841                 \textcolor{comment}{/* Now that we know how long it claims to be, make sure}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00842}00842 \textcolor{comment}{                 * there is enough data for the next seg. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00843}00843                 \textcolor{keywordflow}{if} (packetlen < (segsize + 2)) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00844}00844                         log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: IE longer than packet\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00845}00845                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00846}00846                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00847}00847                 \textcolor{keywordflow}{switch} (segtype) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00848}00848                 \textcolor{keywordflow}{case} 0x01:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00849}00849                 \textcolor{keywordflow}{case} 0x51:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00850}00850                         \textcolor{comment}{/* According to MCI's HP analyser, we should just}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00851}00851 \textcolor{comment}{                         * ignore if there is mor ethan one of these (?). */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00852}00852                         \textcolor{keywordflow}{if} (resptype\_seen) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00853}00853                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: dup MSGTYPE\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00854}00854                                 \textcolor{keywordflow}{goto} nextIE;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00855}00855                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00856}00856                         \textcolor{keywordflow}{if} (segsize != 1) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00857}00857                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: MSGTYPE wrong size\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00858}00858                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00859}00859                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00860}00860                         \textcolor{comment}{/* The remote end tells us what kind of response}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00861}00861 \textcolor{comment}{                         * this is. Only expect a type 0 or 1. if it was a}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00862}00862 \textcolor{comment}{                         * full (type 0) check we just asked for a type}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00863}00863 \textcolor{comment}{                         * full. */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00864}00864                         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[2]) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00865}00865                         \textcolor{keywordflow}{case} 1:\textcolor{comment}{/* partial */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00866}00866                                 \textcolor{keywordflow}{if} (sc-\/>livs > sc-\/>liv\_per\_full) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00867}00867                                         log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00868}00868                                           \textcolor{stringliteral}{"{}nglmi: LIV when FULL expected\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00869}00869                                         \textcolor{keywordflow}{goto} reject;    \textcolor{comment}{/* need full */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00870}00870                                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00871}00871                                 resptype\_seen = 1;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00872}00872                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00873}00873                         \textcolor{keywordflow}{case} 0:\textcolor{comment}{/* full */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00874}00874                                 \textcolor{comment}{/* Full response is always acceptable */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00875}00875                                 resptype\_seen = 2;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00876}00876                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00877}00877                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00878}00878                                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00879}00879                                  \textcolor{stringliteral}{"{}nglmi: Unknown report type \%d\(\backslash\)n"{}}, \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[2]);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00880}00880                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00881}00881                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00882}00882                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00883}00883                 \textcolor{keywordflow}{case} 0x03:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00884}00884                 \textcolor{keywordflow}{case} 0x53:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00885}00885                         \textcolor{comment}{/* The remote tells us what it thinks the sequence}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00886}00886 \textcolor{comment}{                         * numbers are. I would have thought that there}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00887}00887 \textcolor{comment}{                         * needs to be one and only one of these, but MCI}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00888}00888 \textcolor{comment}{                         * want us to just ignore extras. (?) */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00889}00889                         \textcolor{keywordflow}{if} (resptype\_seen == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00890}00890                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: no TYPE before SEQ\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00891}00891                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00892}00892                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00893}00893                         \textcolor{keywordflow}{if} (seq\_seen != 0)      \textcolor{comment}{/* already seen seq numbers */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00894}00894                                 \textcolor{keywordflow}{goto} nextIE;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00895}00895                         \textcolor{keywordflow}{if} (segsize != 2) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00896}00896                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: bad SEQ sts size\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00897}00897                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00898}00898                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00899}00899                         \textcolor{keywordflow}{if} (sc-\/>local\_seq != \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[3]) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00900}00900                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: unexpected SEQ\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00901}00901                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00902}00902                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00903}00903                         seq\_seen = 1;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00904}00904                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00905}00905                 \textcolor{keywordflow}{case} 0x07:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00906}00906                 \textcolor{keywordflow}{case} 0x57:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00907}00907                         \textcolor{comment}{/* The remote tells us about a DLCI that it knows}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00908}00908 \textcolor{comment}{                         * about. There may be many of these in a single}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00909}00909 \textcolor{comment}{                         * status response */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00910}00910                         \textcolor{keywordflow}{if} (seq\_seen != 1) \{    \textcolor{comment}{/* already seen seq numbers? */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00911}00911                                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00912}00912                                     \textcolor{stringliteral}{"{}nglmi: No sequence before DLCI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00913}00913                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00914}00914                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00915}00915                         \textcolor{keywordflow}{if} (resptype\_seen != 2) \{       \textcolor{comment}{/* must be full */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00916}00916                                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00917}00917                                     \textcolor{stringliteral}{"{}nglmi: No resp type before DLCI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00918}00918                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00919}00919                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00920}00920                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__lmi_8c_a92402508636109ea950658d46e756fd2}{GROUP4}}(sc)) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00921}00921                                 \textcolor{keywordflow}{if} (segsize != 6) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00922}00922                                         log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00923}00923                                             \textcolor{stringliteral}{"{}nglmi: wrong IE segsize\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00924}00924                                         \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00925}00925                                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00926}00926                                 \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} = ((u\_short) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[2] \& 0xff) << 8;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00927}00927                                 \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} |= (\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[3] \& 0xff);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00928}00928                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00929}00929                                 \textcolor{keywordflow}{if} (segsize != 3) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00930}00930                                         log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00931}00931                                             \textcolor{stringliteral}{"{}nglmi: DLCI headersize of \%d"{}}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00932}00932                                             \textcolor{stringliteral}{"{} not supported\(\backslash\)n"{}}, segsize -\/ 1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00933}00933                                         \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00934}00934                                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00935}00935                                 \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} = ((u\_short) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[2] \& 0x3f) << 4;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00936}00936                                 \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} |= ((\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}}[3] \& 0x78) >> 3);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00937}00937                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00938}00938                         \textcolor{comment}{/* async can only have one of these */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00939}00939 \textcolor{preprocessor}{\#if 0                           }\textcolor{comment}{/* async not yet accepted */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00940}00940                         \textcolor{keywordflow}{if} (async \&\& highest\_dlci) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00941}00941                                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00942}00942                                     \textcolor{stringliteral}{"{}nglmi: Async with > 1 DLCI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00943}00943                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00944}00944                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00945}00945 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00946}00946                         \textcolor{comment}{/* Annex D says these will always be Ascending, but}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00947}00947 \textcolor{comment}{                         * the HP test for G4 says we should accept}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00948}00948 \textcolor{comment}{                         * duplicates, so for now allow that. ( <= vs. < ) */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00949}00949 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00950}00950                         \textcolor{comment}{/* MCI tests want us to accept out of order for AnxD */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00951}00951                         \textcolor{keywordflow}{if} ((!\mbox{\hyperlink{ng__lmi_8c_a92402508636109ea950658d46e756fd2}{GROUP4}}(sc)) \&\& (\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} < highest\_dlci)) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00952}00952                                 \textcolor{comment}{/* duplicate or mis-\/ordered dlci */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00953}00953                                 \textcolor{comment}{/* (spec says they will increase in number) */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00954}00954                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: DLCI out of order\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00955}00955                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00956}00956                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00957}00957 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00958}00958                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}} > 1023) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00959}00959                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: DLCI out of range\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00960}00960                                 \textcolor{keywordflow}{goto} reject;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00961}00961                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00962}00962                         highest\_dlci = \mbox{\hyperlink{ng__btsocket__rfcomm_8h_ae7b5fe33845a9a9847e5a9a98a9ec030}{dlci}};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00963}00963                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00964}00964                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00965}00965                         log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00966}00966                             \textcolor{stringliteral}{"{}nglmi: unknown LMI segment type \%d\(\backslash\)n"{}}, segtype);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00967}00967                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00968}00968 nextIE:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00969}00969                 \mbox{\hyperlink{ng__lmi_8c_a44d016b90c55bc96f654f8daf2ea178e}{STEPBY}}(segsize + 2);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00970}00970         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00971}00971         \textcolor{keywordflow}{if} (packetlen != 0) \{   \textcolor{comment}{/* partial junk at end? */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00972}00972                 log(LOG\_WARNING,}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00973}00973                     \textcolor{stringliteral}{"{}nglmi: \%d bytes extra at end of packet\(\backslash\)n"{}}, packetlen);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00974}00974                 \textcolor{keywordflow}{goto} print;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00975}00975         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00976}00976         \textcolor{keywordflow}{if} (resptype\_seen == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00977}00977                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: No response type seen\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00978}00978                 \textcolor{keywordflow}{goto} reject;    \textcolor{comment}{/* had no response type */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00979}00979         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00980}00980         \textcolor{keywordflow}{if} (seq\_seen == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00981}00981                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: No sequence numbers seen\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00982}00982                 \textcolor{keywordflow}{goto} reject;    \textcolor{comment}{/* had no sequence numbers */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00983}00983         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00984}00984         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00985}00985 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00986}00986 print:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00987}00987         \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00988}00988                 \textcolor{keywordtype}{int}     i, j, k, pos;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00989}00989                 \textcolor{keywordtype}{char}    buf[100];}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00990}00990                 \textcolor{keywordtype}{int}     loc;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00991}00991                 \textcolor{keyword}{const}   u\_char *bp = mtod(m, \textcolor{keyword}{const} u\_char *);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00992}00992 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00993}00993                 k = i = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00994}00994                 loc = (m-\/>m\_len -\/ packetlen);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00995}00995                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: error at location \%d\(\backslash\)n"{}}, loc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00996}00996                 \textcolor{keywordflow}{while} (k < m-\/>m\_len) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00997}00997                         pos = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00998}00998                         j = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l00999}00999                         \textcolor{keywordflow}{while} ((j++ < 16) \&\& k < m-\/>m\_len) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01000}01000                                 pos += sprintf(buf + pos, \textcolor{stringliteral}{"{}\%c\%02x"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01001}01001                                                ((loc == k) ? \textcolor{charliteral}{'>'} : \textcolor{charliteral}{' '}),}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01002}01002                                                bp[k]);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01003}01003                                 k++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01004}01004                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01005}01005                         \textcolor{keywordflow}{if} (i == 0)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01006}01006                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: packet data:\%s\(\backslash\)n"{}}, buf);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01007}01007                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01008}01008                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}\%04d              :\%s\(\backslash\)n"{}}, k, buf);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01009}01009                         i++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01010}01010                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01011}01011         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01012}01012         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01013}01013 reject:}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01014}01014         \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01015}01015                 \textcolor{keywordtype}{int}     i, j, k, pos;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01016}01016                 \textcolor{keywordtype}{char}    buf[100];}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01017}01017                 \textcolor{keywordtype}{int}     loc;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01018}01018                 \textcolor{keyword}{const}   u\_char *bp = mtod(m, \textcolor{keyword}{const} u\_char *);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01019}01019 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01020}01020                 k = i = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01021}01021                 loc = (m-\/>m\_len -\/ packetlen);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01022}01022                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: error at location \%d\(\backslash\)n"{}}, loc);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01023}01023                 \textcolor{keywordflow}{while} (k < m-\/>m\_len) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01024}01024                         pos = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01025}01025                         j = 0;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01026}01026                         \textcolor{keywordflow}{while} ((j++ < 16) \&\& k < m-\/>m\_len) \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01027}01027                                 pos += sprintf(buf + pos, \textcolor{stringliteral}{"{}\%c\%02x"{}},}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01028}01028                                                ((loc == k) ? \textcolor{charliteral}{'>'} : \textcolor{charliteral}{' '}),}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01029}01029                                                bp[k]);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01030}01030                                 k++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01031}01031                         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01032}01032                         \textcolor{keywordflow}{if} (i == 0)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01033}01033                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}nglmi: packet data:\%s\(\backslash\)n"{}}, buf);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01034}01034                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01035}01035                                 log(LOG\_WARNING, \textcolor{stringliteral}{"{}\%04d              :\%s\(\backslash\)n"{}}, k, buf);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01036}01036                         i++;}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01037}01037                 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01038}01038         \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01039}01039         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01040}01040         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01041}01041 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01042}01042 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01043}01043 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01044}01044 \textcolor{comment}{ * Do local shutdown processing..}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01045}01045 \textcolor{comment}{ * Cut any remaining links and free our local resources.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01046}01046 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01047}01047 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01048}\mbox{\hyperlink{ng__lmi_8c_a33051449cb4ec717fcbdfb480a064aac}{01048}} \mbox{\hyperlink{ng__lmi_8c_a1943c7e9bfab87eb261030a66c490cca}{nglmi\_shutdown}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01049}01049 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01050}01050         \textcolor{keyword}{const} \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01051}01051 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01052}01052         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, NULL);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01053}01053         \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(sc-\/>\mbox{\hyperlink{structng__async__private_abc8d009d3a7da97a2116416295b6626c}{node}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01054}01054         free(sc, M\_NETGRAPH);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01055}01055         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01056}01056 \}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01057}01057 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01058}01058 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01059}01059 \textcolor{comment}{ * Hook disconnection}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01060}01060 \textcolor{comment}{ * For this type, removal of any link except "{}debug"{} destroys the node.}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01061}01061 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01062}01062 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01063}\mbox{\hyperlink{ng__lmi_8c_ae5d324b6aa843749f61529b268d2999b}{01063}} \mbox{\hyperlink{ng__lmi_8c_a053a6913e15557f1982644cc971b90ca}{nglmi\_disconnect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01064}01064 \{}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01065}01065         \textcolor{keyword}{const} \mbox{\hyperlink{structng__async__private}{sc\_p}} sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01066}01066 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01067}01067         \textcolor{comment}{/* OK to remove debug hook(s) */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01068}01068         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook) == NULL)}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01069}01069                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01070}01070 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01071}01071         \textcolor{comment}{/* Stop timer if it's currently active */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01072}01072         \textcolor{keywordflow}{if} (sc-\/>flags \& \mbox{\hyperlink{ng__lmi_8c_a377669240a1eea340f019bc9b0913e3f}{SCF\_CONNECTED}})}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01073}01073                 \mbox{\hyperlink{netgraph_8h_aabe13cf527f80501a761c71c9b4888db}{ng\_uncallout}}(\&sc-\/>handle, sc-\/>\mbox{\hyperlink{structng__async__private_abc8d009d3a7da97a2116416295b6626c}{node}});}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01074}01074 }
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01075}01075         \textcolor{comment}{/* Self-\/destruct */}}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01076}01076         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_a6bdd56e0f33084eeaadbe696febcbbd8}{NG\_NODE\_IS\_VALID}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook)))}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01077}01077                 \mbox{\hyperlink{netgraph_8h_a85914ce0da2b314478aaf7efcdcd3ff0}{ng\_rmnode\_self}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01078}01078         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__lmi_8c_source_l01079}01079 \}}

\end{DoxyCode}
