\hypertarget{ng__btsocket__l2cap__raw_8c_source}{}\doxysection{ng\+\_\+btsocket\+\_\+l2cap\+\_\+raw.\+c}
\label{ng__btsocket__l2cap__raw_8c_source}\index{netgraph/bluetooth/socket/ng\_btsocket\_l2cap\_raw.c@{netgraph/bluetooth/socket/ng\_btsocket\_l2cap\_raw.c}}
\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00002}00002 \textcolor{comment}{ * ng\_btsocket\_l2cap\_raw.c}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00003}00003 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00004}00004 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00005}00005 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00006}00006 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00008}00008 \textcolor{comment}{ * Copyright (c) 2001-\/2002 Maksim Yevmenkin <m\_evmenkin@yahoo.com>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00009}00009 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00011}00011 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00012}00012 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00013}00013 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00014}00014 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00015}00015 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00016}00016 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00018}00018 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00019}00019 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00021}00021 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00022}00022 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00023}00023 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00024}00024 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00025}00025 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00026}00026 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00027}00027 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00028}00028 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00029}00029 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00030}00030 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00032}00032 \textcolor{comment}{ * \$Id: ng\_btsocket\_l2cap\_raw.c,v 1.12 2003/09/14 23:29:06 max Exp \$}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00033}00033 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/bitstring.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/domain.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/filedesc.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/ioccom.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/protosw.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/socketvar.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/taskqueue.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <net/vnet.h>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__message_8h}{netgraph/ng\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{netgraph_8h}{netgraph/netgraph.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__bluetooth_8h}{netgraph/bluetooth/include/ng\_bluetooth.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__hci_8h}{netgraph/bluetooth/include/ng\_hci.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__l2cap_8h}{netgraph/bluetooth/include/ng\_l2cap.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__btsocket_8h}{netgraph/bluetooth/include/ng\_btsocket.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__btsocket__l2cap_8h}{netgraph/bluetooth/include/ng\_btsocket\_l2cap.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00066}00066 \textcolor{comment}{/* MALLOC define */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00067}00067 \textcolor{preprocessor}{\#ifdef NG\_SEPARATE\_MALLOC}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00068}00068 \textcolor{keyword}{static} \mbox{\hyperlink{ng__ccatm_8c_ae738595abd0b2c23262b81953927d5f8}{MALLOC\_DEFINE}}(\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a5ef0ba0b0e6063f505b943580e86d510}{M\_NETGRAPH\_BTSOCKET\_L2CAP\_RAW}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00069}00069     \textcolor{stringliteral}{"{}netgraph\_btsocks\_l2cap\_raw"{}}, \textcolor{stringliteral}{"{}Netgraph Bluetooth raw L2CAP sockets"{}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00070}00070 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00071}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a5ef0ba0b0e6063f505b943580e86d510}{00071}} \textcolor{preprocessor}{\#define M\_NETGRAPH\_BTSOCKET\_L2CAP\_RAW M\_NETGRAPH}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00072}00072 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* NG\_SEPARATE\_MALLOC */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00074}00074 \textcolor{comment}{/* Netgraph node methods */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00075}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a451e94043a40962741e83e1e3167ea2d}{00075}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_abb75b9ed2849e15851d6402d2ab5b899}{ng\_constructor\_t}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a451e94043a40962741e83e1e3167ea2d}{ng\_btsocket\_l2cap\_raw\_node\_constructor}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00076}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a245c38f155aa03021b075bdaf53d5ea3}{00076}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a47b860e2900386e775707cc1ae661162}{ng\_rcvmsg\_t}}   \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a245c38f155aa03021b075bdaf53d5ea3}{ng\_btsocket\_l2cap\_raw\_node\_rcvmsg}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00077}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aaa653f66022a1f5b6e7f4404e0c10831}{00077}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aab0a679789a1af312a7f856b4668ad74}{ng\_shutdown\_t}}       \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aaa653f66022a1f5b6e7f4404e0c10831}{ng\_btsocket\_l2cap\_raw\_node\_shutdown}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00078}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ab3ad77a4e7e46c3457ff8eb2d6304647}{00078}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_afa50639df4ed6eb400f8220a890d56e6}{ng\_newhook\_t}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ab3ad77a4e7e46c3457ff8eb2d6304647}{ng\_btsocket\_l2cap\_raw\_node\_newhook}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00079}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a7b364d353e0b415efecb8f89cbb00b63}{00079}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a0e4a4a62e48409635e5f33c548baaea7}{ng\_connect\_t}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a7b364d353e0b415efecb8f89cbb00b63}{ng\_btsocket\_l2cap\_raw\_node\_connect}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00080}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a6d4925dfa6fc6f3f2e2bf42342236d1f}{00080}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a6d4925dfa6fc6f3f2e2bf42342236d1f}{ng\_btsocket\_l2cap\_raw\_node\_rcvdata}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00081}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ad5a73174ff444722854675e322a9cb00}{00081}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a669e1783335f933b4a4f90f17d22f381}{ng\_disconnect\_t}}   \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ad5a73174ff444722854675e322a9cb00}{ng\_btsocket\_l2cap\_raw\_node\_disconnect}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00083}00083 \textcolor{keyword}{static} \textcolor{keywordtype}{void}             \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4b4732674ee5c350517f1e487f2b40db}{ng\_btsocket\_l2cap\_raw\_input}}     (\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00084}00084 \textcolor{keyword}{static} \textcolor{keywordtype}{void}             \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a1f182d43df291b65f79290147fcf8d16}{ng\_btsocket\_l2cap\_raw\_rtclean}}   (\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00085}00085 \textcolor{keyword}{static} \textcolor{keywordtype}{void}             \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aea36fc477539263576c377abde42b8c7}{ng\_btsocket\_l2cap\_raw\_get\_token}} (u\_int32\_t *);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00087}00087 \textcolor{keyword}{static} \textcolor{keywordtype}{int}              \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_abc2e0da44f30ca9fab14356004ab1f2c}{ng\_btsocket\_l2cap\_raw\_send\_ngmsg}}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00088}00088                                 (\mbox{\hyperlink{structng__hook}{hook\_p}}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00089}00089 \textcolor{keyword}{static} \textcolor{keywordtype}{int}              \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0ae88f29aa40f143ce76c0707e4d8f10}{ng\_btsocket\_l2cap\_raw\_send\_sync\_ngmsg}}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00090}00090                                 (\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00091}00091 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00092}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ada318aed9f06ad1ac3d50ea374336247}{00092}} \textcolor{preprocessor}{\#define ng\_btsocket\_l2cap\_raw\_wakeup\_input\_task() \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00093}00093 \textcolor{preprocessor}{        taskqueue\_enqueue(taskqueue\_swi, \&ng\_btsocket\_l2cap\_raw\_queue\_task)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00095}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4e36ef821ef0d3fdfea69e98c1df4acf}{00095}} \textcolor{preprocessor}{\#define ng\_btsocket\_l2cap\_raw\_wakeup\_route\_task() \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00096}00096 \textcolor{preprocessor}{        taskqueue\_enqueue(taskqueue\_swi, \&ng\_btsocket\_l2cap\_raw\_rt\_task)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00098}00098 \textcolor{comment}{/* Netgraph type descriptor */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00099}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a80a131770518c7fa3758d85054006e7a}{00099}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__type}{ng\_type}}    \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}} = \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00100}00100         .\mbox{\hyperlink{structng__type_adbc1c8884ff0e625c19c4b513262fd0e}{version}} =       \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00101}00101         .name =         \mbox{\hyperlink{ng__btsocket_8h_a72916314da15d96514164a66f6142196}{NG\_BTSOCKET\_L2CAP\_RAW\_NODE\_TYPE}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00102}00102         .constructor =  \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a451e94043a40962741e83e1e3167ea2d}{ng\_btsocket\_l2cap\_raw\_node\_constructor}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00103}00103         .rcvmsg =       \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a245c38f155aa03021b075bdaf53d5ea3}{ng\_btsocket\_l2cap\_raw\_node\_rcvmsg}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00104}00104         .shutdown =     \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aaa653f66022a1f5b6e7f4404e0c10831}{ng\_btsocket\_l2cap\_raw\_node\_shutdown}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00105}00105         .newhook =      \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ab3ad77a4e7e46c3457ff8eb2d6304647}{ng\_btsocket\_l2cap\_raw\_node\_newhook}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00106}00106         .connect =      \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a7b364d353e0b415efecb8f89cbb00b63}{ng\_btsocket\_l2cap\_raw\_node\_connect}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00107}00107         .rcvdata =      \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a6d4925dfa6fc6f3f2e2bf42342236d1f}{ng\_btsocket\_l2cap\_raw\_node\_rcvdata}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00108}00108         .disconnect =   \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ad5a73174ff444722854675e322a9cb00}{ng\_btsocket\_l2cap\_raw\_node\_disconnect}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00109}00109 \};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00111}00111 \textcolor{comment}{/* Globals */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00112}00112 \textcolor{keyword}{extern} \textcolor{keywordtype}{int}                                      \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4ae44a4904f51f52d1275cc443a960a4}{ifqmaxlen}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00113}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a6929719626c82c4d61c3a7f440b389f6}{00113}} \textcolor{keyword}{static} u\_int32\_t                                \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a6929719626c82c4d61c3a7f440b389f6}{ng\_btsocket\_l2cap\_raw\_debug\_level}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00114}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a2196aeead72b538141ba6b1afbb0345f}{00114}} \textcolor{keyword}{static} u\_int32\_t                                \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a2196aeead72b538141ba6b1afbb0345f}{ng\_btsocket\_l2cap\_raw\_ioctl\_timeout}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00115}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{00115}} \textcolor{keyword}{static} \mbox{\hyperlink{structng__node}{node\_p}}                                     \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00116}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{00116}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__bt__itemq}{ng\_bt\_itemq}}                    \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00117}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0cd393cc82f5e55e04749faf58b7804a}{00117}} \textcolor{keyword}{static} \textcolor{keyword}{struct }mtx                               \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0cd393cc82f5e55e04749faf58b7804a}{ng\_btsocket\_l2cap\_raw\_queue\_mtx}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00118}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a1fa5110c92a73e4f1f7ed57cb9940a0a}{00118}} \textcolor{keyword}{static} \textcolor{keyword}{struct }task                              \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a1fa5110c92a73e4f1f7ed57cb9940a0a}{ng\_btsocket\_l2cap\_raw\_queue\_task}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00119}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a926fa180ec6adeca8ac3dfeb034a8a63}{00119}} \textcolor{keyword}{static} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a926fa180ec6adeca8ac3dfeb034a8a63}{LIST\_HEAD}}(, \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb}}) ng\_btsocket\_l2cap\_raw\_sockets;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00120}00120 \textcolor{keyword}{static} \textcolor{keyword}{struct }mtx                               ng\_btsocket\_l2cap\_raw\_sockets\_mtx;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00121}00121 \textcolor{keyword}{static} u\_int32\_t                                ng\_btsocket\_l2cap\_raw\_token;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00122}00122 \textcolor{keyword}{static} \textcolor{keyword}{struct }mtx                               ng\_btsocket\_l2cap\_raw\_token\_mtx;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00123}00123 \textcolor{keyword}{static} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a926fa180ec6adeca8ac3dfeb034a8a63}{LIST\_HEAD}}(, \mbox{\hyperlink{structng__btsocket__l2cap__rtentry}{ng\_btsocket\_l2cap\_rtentry}}) ng\_btsocket\_l2cap\_raw\_rt;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00124}00124 \textcolor{keyword}{static} \textcolor{keyword}{struct }mtx                               ng\_btsocket\_l2cap\_raw\_rt\_mtx;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00125}00125 \textcolor{keyword}{static} \textcolor{keyword}{struct }task                              ng\_btsocket\_l2cap\_raw\_rt\_task;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00126}00126 \textcolor{keyword}{static} \textcolor{keyword}{struct }timeval                           ng\_btsocket\_l2cap\_raw\_lasttime;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00127}00127 \textcolor{keyword}{static} \textcolor{keywordtype}{int}                                      ng\_btsocket\_l2cap\_raw\_curpps;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00129}00129 \textcolor{comment}{/* Sysctl tree */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00130}00130 SYSCTL\_DECL(\_net\_bluetooth\_l2cap\_sockets);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00131}00131 \textcolor{keyword}{static} \mbox{\hyperlink{ng__bluetooth_8c_a3c59ac7d808011194bfbbe652810f4e4}{SYSCTL\_NODE}}(\_net\_bluetooth\_l2cap\_sockets, OID\_AUTO, raw,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00132}00132     CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00133}00133     \textcolor{stringliteral}{"{}Bluetooth raw L2CAP sockets family"{}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00134}00134 \mbox{\hyperlink{ng__bluetooth_8c_aeae145f2f7d2b59105b827ec16deecf3}{SYSCTL\_UINT}}(\_net\_bluetooth\_l2cap\_sockets\_raw, OID\_AUTO, debug\_level,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00135}00135         CTLFLAG\_RW,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00136}00136         \&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a6929719626c82c4d61c3a7f440b389f6}{ng\_btsocket\_l2cap\_raw\_debug\_level}}, \mbox{\hyperlink{ng__btsocket_8h_add6a7e27a470c8b3aeb4793e015b84bb}{NG\_BTSOCKET\_WARN\_LEVEL}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00137}00137         \textcolor{stringliteral}{"{}Bluetooth raw L2CAP sockets debug level"{}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00138}00138 \mbox{\hyperlink{ng__bluetooth_8c_aeae145f2f7d2b59105b827ec16deecf3}{SYSCTL\_UINT}}(\_net\_bluetooth\_l2cap\_sockets\_raw, OID\_AUTO, ioctl\_timeout,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00139}00139         CTLFLAG\_RW,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00140}00140         \&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a2196aeead72b538141ba6b1afbb0345f}{ng\_btsocket\_l2cap\_raw\_ioctl\_timeout}}, 5,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00141}00141         \textcolor{stringliteral}{"{}Bluetooth raw L2CAP sockets ioctl timeout"{}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00142}00142 \mbox{\hyperlink{ng__bluetooth_8c_aeae145f2f7d2b59105b827ec16deecf3}{SYSCTL\_UINT}}(\_net\_bluetooth\_l2cap\_sockets\_raw, OID\_AUTO, queue\_len,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00143}00143         CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00144}00144         \&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}}.\mbox{\hyperlink{structng__bt__itemq_ae75502ec4557ae00201acb1a16ae9505}{len}}, 0,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00145}00145         \textcolor{stringliteral}{"{}Bluetooth raw L2CAP sockets input queue length"{}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00146}00146 \mbox{\hyperlink{ng__bluetooth_8c_aeae145f2f7d2b59105b827ec16deecf3}{SYSCTL\_UINT}}(\_net\_bluetooth\_l2cap\_sockets\_raw, OID\_AUTO, queue\_maxlen,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00147}00147         CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00148}00148         \&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}}.\mbox{\hyperlink{structng__bt__itemq_a1881770a6bd0fce44c8e330779971f3f}{maxlen}}, 0,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00149}00149         \textcolor{stringliteral}{"{}Bluetooth raw L2CAP sockets input queue max. length"{}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00150}00150 \mbox{\hyperlink{ng__bluetooth_8c_aeae145f2f7d2b59105b827ec16deecf3}{SYSCTL\_UINT}}(\_net\_bluetooth\_l2cap\_sockets\_raw, OID\_AUTO, queue\_drops,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00151}00151         CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00152}00152         \&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}}.\mbox{\hyperlink{structng__bt__itemq_aac338b6d45f4722ae204e7596ab24afd}{drops}}, 0,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00153}00153         \textcolor{stringliteral}{"{}Bluetooth raw L2CAP sockets input queue drops"{}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00155}00155 \textcolor{comment}{/* Debug */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00156}00156 \textcolor{preprocessor}{\#define NG\_BTSOCKET\_L2CAP\_RAW\_INFO \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00157}00157 \textcolor{preprocessor}{        if (ng\_btsocket\_l2cap\_raw\_debug\_level >= NG\_BTSOCKET\_INFO\_LEVEL \&\& \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00158}00158 \textcolor{preprocessor}{            ppsratecheck(\&ng\_btsocket\_l2cap\_raw\_lasttime, \&ng\_btsocket\_l2cap\_raw\_curpps, 1)) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00159}00159 \textcolor{preprocessor}{                printf}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00161}00161 \textcolor{preprocessor}{\#define NG\_BTSOCKET\_L2CAP\_RAW\_WARN \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00162}00162 \textcolor{preprocessor}{        if (ng\_btsocket\_l2cap\_raw\_debug\_level >= NG\_BTSOCKET\_WARN\_LEVEL \&\& \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00163}00163 \textcolor{preprocessor}{            ppsratecheck(\&ng\_btsocket\_l2cap\_raw\_lasttime, \&ng\_btsocket\_l2cap\_raw\_curpps, 1)) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00164}00164 \textcolor{preprocessor}{                printf}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00166}00166 \textcolor{preprocessor}{\#define NG\_BTSOCKET\_L2CAP\_RAW\_ERR \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00167}00167 \textcolor{preprocessor}{        if (ng\_btsocket\_l2cap\_raw\_debug\_level >= NG\_BTSOCKET\_ERR\_LEVEL \&\& \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00168}00168 \textcolor{preprocessor}{            ppsratecheck(\&ng\_btsocket\_l2cap\_raw\_lasttime, \&ng\_btsocket\_l2cap\_raw\_curpps, 1)) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00169}00169 \textcolor{preprocessor}{                printf}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00171}00171 \textcolor{preprocessor}{\#define NG\_BTSOCKET\_L2CAP\_RAW\_ALERT \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00172}00172 \textcolor{preprocessor}{        if (ng\_btsocket\_l2cap\_raw\_debug\_level >= NG\_BTSOCKET\_ALERT\_LEVEL \&\& \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00173}00173 \textcolor{preprocessor}{            ppsratecheck(\&ng\_btsocket\_l2cap\_raw\_lasttime, \&ng\_btsocket\_l2cap\_raw\_curpps, 1)) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00174}00174 \textcolor{preprocessor}{                printf}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00176}00176 \textcolor{comment}{/*****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00177}00177 \textcolor{comment}{ *****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00178}00178 \textcolor{comment}{ **                        Netgraph node interface}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00179}00179 \textcolor{comment}{ *****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00180}00180 \textcolor{comment}{ *****************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00182}00182 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00183}00183 \textcolor{comment}{ * Netgraph node constructor. Do not allow to create node of this type.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00184}00184 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00186}00186 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00187}00187 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a451e94043a40962741e83e1e3167ea2d}{ng\_btsocket\_l2cap\_raw\_node\_constructor}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00188}00188 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00189}00189         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00190}00190 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_node\_constructor */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00192}00192 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00193}00193 \textcolor{comment}{ * Do local shutdown processing. Let old node go and create new fresh one.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00194}00194 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00196}00196 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00197}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a96b963d27c37f796fea80f2d1015181b}{00197}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aaa653f66022a1f5b6e7f4404e0c10831}{ng\_btsocket\_l2cap\_raw\_node\_shutdown}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00198}00198 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00199}00199         \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00201}00201         \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(node);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00202}00202 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00203}00203         \textcolor{comment}{/* Create new node */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00204}00204         error = \mbox{\hyperlink{netgraph_8h_aba2cbbfc891d71bd283ce2368c8392db}{ng\_make\_node\_common}}(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}}, \&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00205}00205         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00206}00206                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ac1b720a95dcc343a86087d7bb49e08d7}{NG\_BTSOCKET\_L2CAP\_RAW\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00207}00207 \textcolor{stringliteral}{"{}\%s: Could not create Netgraph node, error=\%d\(\backslash\)n"{}}, \_\_func\_\_, error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00209}00209                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00211}00211                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00212}00212         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00214}00214         error = \mbox{\hyperlink{netgraph_8h_abae5851c9f312eebd398b1cd085fe067}{ng\_name\_node}}(\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00215}00215                                 \mbox{\hyperlink{ng__btsocket_8h_a72916314da15d96514164a66f6142196}{NG\_BTSOCKET\_L2CAP\_RAW\_NODE\_TYPE}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00216}00216         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00217}00217                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ac1b720a95dcc343a86087d7bb49e08d7}{NG\_BTSOCKET\_L2CAP\_RAW\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00218}00218 \textcolor{stringliteral}{"{}\%s: Could not name Netgraph node, error=\%d\(\backslash\)n"{}}, \_\_func\_\_, error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00220}00220                 \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00221}00221                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00223}00223                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00224}00224         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00225}00225                 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00226}00226         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00227}00227 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_node\_shutdown */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00229}00229 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00230}00230 \textcolor{comment}{ * We allow any hook to be connected to the node.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00231}00231 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00232}00232 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00233}00233 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00234}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a22c472583c76cfd0e13ca7d6f91c63c9}{00234}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ab3ad77a4e7e46c3457ff8eb2d6304647}{ng\_btsocket\_l2cap\_raw\_node\_newhook}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{char} \textcolor{keyword}{const} *\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}})}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00235}00235 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00236}00236         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00237}00237 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_node\_newhook */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00239}00239 \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00240}00240 \textcolor{comment}{ * Just say "{}YEP, that's OK by me!"{}}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00241}00241 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00243}00243 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00244}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aa6607da9f3cae7064ce8cd80f3c79eb8}{00244}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a7b364d353e0b415efecb8f89cbb00b63}{ng\_btsocket\_l2cap\_raw\_node\_connect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00245}00245 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00246}00246         \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, NULL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00247}00247         \mbox{\hyperlink{netgraph_8h_aa62902771ada6bf2c313d96abadb3c85}{NG\_HOOK\_REF}}(hook); \textcolor{comment}{/* Keep extra reference to the hook */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00249}00249         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00250}00250 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_node\_connect */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00252}00252 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00253}00253 \textcolor{comment}{ * Hook disconnection. Schedule route cleanup task}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00254}00254 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00256}00256 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00257}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a888fbf0db7e8cfdb1d84d7edae460121}{00257}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ad5a73174ff444722854675e322a9cb00}{ng\_btsocket\_l2cap\_raw\_node\_disconnect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00258}00258 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00259}00259         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00260}00260 \textcolor{comment}{         * If hook has private information than we must have this hook in}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00261}00261 \textcolor{comment}{         * the routing table and must schedule cleaning for the routing table.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00262}00262 \textcolor{comment}{         * Otherwise hook was connected but we never got "{}hook\_info"{} message,}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00263}00263 \textcolor{comment}{         * so we have never added this hook to the routing table and it save}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00264}00264 \textcolor{comment}{         * to just delete it.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00265}00265 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00267}00267         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook) != NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00268}00268                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4e36ef821ef0d3fdfea69e98c1df4acf}{ng\_btsocket\_l2cap\_raw\_wakeup\_route\_task}}());}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00270}00270         \mbox{\hyperlink{netgraph_8h_a2b9c519a8b574618def581e0091cbf49}{NG\_HOOK\_UNREF}}(hook); \textcolor{comment}{/* Remove extra reference */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00272}00272         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00273}00273 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_node\_disconnect */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00275}00275 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00276}00276 \textcolor{comment}{ * Process incoming messages }}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00277}00277 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00279}00279 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00280}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aba6d8c7a220a17da65b9062c62794998}{00280}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a245c38f155aa03021b075bdaf53d5ea3}{ng\_btsocket\_l2cap\_raw\_node\_rcvmsg}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__item}{item\_p}} item, \mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00281}00281 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00282}00282         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}}   *msg = \mbox{\hyperlink{netgraph_8h_a1377b8149d9d15b4856104076930fd88}{NGI\_MSG}}(item); \textcolor{comment}{/* item still has message */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00283}00283         \textcolor{keywordtype}{int}              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00285}00285         \textcolor{keywordflow}{if} (msg != NULL \&\& msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_ab59e14593b69a406ed5ca4209d489a10}{typecookie}} == \mbox{\hyperlink{ng__l2cap_8h_a7e452e3322a39653affa38cdea2c761a}{NGM\_L2CAP\_COOKIE}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00286}00286                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00287}00287 \textcolor{comment}{                 * NGM\_L2CAP\_NODE\_HOOK\_INFO is special message initiated by}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00288}00288 \textcolor{comment}{                 * L2CAP layer. Ignore all other messages if they are not}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00289}00289 \textcolor{comment}{                 * replies or token is zero }}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00290}00290 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00292}00292                 \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} != \mbox{\hyperlink{ng__l2cap_8h_af0d5230b3b003fe1b19b8827f3ae7e0c}{NGM\_L2CAP\_NODE\_HOOK\_INFO}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00293}00293                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}} == 0 ||}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00294}00294                             !(msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_afb60eeac4395f18a7900d6bd5b0f35a6}{flags}} \& \mbox{\hyperlink{ng__message_8h_a5fe4082cbb0ac2567dde73b46d0eabd3}{NGF\_RESP}})) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00295}00295                                 \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00296}00296                                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00297}00297                         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00298}00298                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00299}00299 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00300}00300                 mtx\_lock(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0cd393cc82f5e55e04749faf58b7804a}{ng\_btsocket\_l2cap\_raw\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00301}00301                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__bluetooth_8h_a0d7b74f8b75184a1b93e5d7cb81945ce}{NG\_BT\_ITEMQ\_FULL}}(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}})) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00302}00302                         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a9495d95777bfc133b9c3aab68905c764}{NG\_BTSOCKET\_L2CAP\_RAW\_ERR}}(}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00303}00303 \textcolor{stringliteral}{"{}\%s: Input queue is full\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00305}00305                         \mbox{\hyperlink{ng__bluetooth_8h_aeabfe2b533d531ed490f22826e86eb82}{NG\_BT\_ITEMQ\_DROP}}(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00306}00306                         \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00307}00307                         error = ENOBUFS;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00308}00308                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00309}00309                         \textcolor{keywordflow}{if} (hook != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00310}00310                                 \mbox{\hyperlink{netgraph_8h_aa62902771ada6bf2c313d96abadb3c85}{NG\_HOOK\_REF}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00311}00311                                 \mbox{\hyperlink{netgraph_8h_a022a652da5adecfd757ff7b5906a9957}{NGI\_SET\_HOOK}}(item, hook);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00312}00312                         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00314}00314                         \mbox{\hyperlink{ng__bluetooth_8h_a0a1d3e4078540c449e00e7bfd3dcea3c}{NG\_BT\_ITEMQ\_ENQUEUE}}(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}}, item);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00315}00315                         error = \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ada318aed9f06ad1ac3d50ea374336247}{ng\_btsocket\_l2cap\_raw\_wakeup\_input\_task}}();}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00316}00316                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00317}00317                 mtx\_unlock(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0cd393cc82f5e55e04749faf58b7804a}{ng\_btsocket\_l2cap\_raw\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00318}00318         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00319}00319                 \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00320}00320                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00321}00321         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00323}00323         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00324}00324 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_node\_rcvmsg */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00325}00325 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00326}00326 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00327}00327 \textcolor{comment}{ * Receive data on a hook}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00328}00328 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00330}00330 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00331}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a349fc0b1df7910756d496eb618bc6a3e}{00331}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a6d4925dfa6fc6f3f2e2bf42342236d1f}{ng\_btsocket\_l2cap\_raw\_node\_rcvdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00332}00332 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00333}00333         \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00335}00335         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00336}00336 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_node\_rcvdata */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00337}00337 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00338}00338 \textcolor{comment}{/*****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00339}00339 \textcolor{comment}{ *****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00340}00340 \textcolor{comment}{ **                              Socket interface}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00341}00341 \textcolor{comment}{ *****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00342}00342 \textcolor{comment}{ *****************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00344}00344 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00345}00345 \textcolor{comment}{ * L2CAP sockets input routine}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00346}00346 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00347}00347 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00348}00348 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00349}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4b4732674ee5c350517f1e487f2b40db}{00349}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4b4732674ee5c350517f1e487f2b40db}{ng\_btsocket\_l2cap\_raw\_input}}(\textcolor{keywordtype}{void} *context, \textcolor{keywordtype}{int} pending)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00350}00350 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00351}00351         \mbox{\hyperlink{structng__item}{item\_p}}             item = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00352}00352         \mbox{\hyperlink{structng__hook}{hook\_p}}             hook = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00353}00353         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}}  *msg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00354}00354 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00355}00355         \textcolor{keywordflow}{for} (;;) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00356}00356                 mtx\_lock(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0cd393cc82f5e55e04749faf58b7804a}{ng\_btsocket\_l2cap\_raw\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00357}00357                 \mbox{\hyperlink{ng__bluetooth_8h_ac75bfc439cac72b87f9e8fe561a6eb03}{NG\_BT\_ITEMQ\_DEQUEUE}}(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}}, item);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00358}00358                 mtx\_unlock(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0cd393cc82f5e55e04749faf58b7804a}{ng\_btsocket\_l2cap\_raw\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00360}00360                 \textcolor{keywordflow}{if} (item == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00361}00361                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00363}00363                 KASSERT((item-\/>\mbox{\hyperlink{structng__item_a838ef946fef909f08e5e85f13484cd5e}{el\_flags}} \& \mbox{\hyperlink{netgraph_8h_a4cd46f025f7a1982e34ac54745b59bd1}{NGQF\_TYPE}}) == \mbox{\hyperlink{netgraph_8h_a9e3984d767a278bf9893ae7145a143a8}{NGQF\_MESG}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00364}00364 (\textcolor{stringliteral}{"{}\%s: invalid item type=\%ld\(\backslash\)n"{}}, \_\_func\_\_, (item-\/>\mbox{\hyperlink{structng__item_a838ef946fef909f08e5e85f13484cd5e}{el\_flags}} \& \mbox{\hyperlink{netgraph_8h_a4cd46f025f7a1982e34ac54745b59bd1}{NGQF\_TYPE}})));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00365}00365 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00366}00366                 \mbox{\hyperlink{netgraph_8h_adc9a04fd174ef3c29ecae94016b84839}{NGI\_GET\_MSG}}(item, msg);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00367}00367                 \mbox{\hyperlink{netgraph_8h_a1d7f4586c2c27938d66748ba39a1c792}{NGI\_GET\_HOOK}}(item, hook);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00368}00368                 \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00370}00370                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00371}00371                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__l2cap_8h_af0d5230b3b003fe1b19b8827f3ae7e0c}{NGM\_L2CAP\_NODE\_HOOK\_INFO}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00372}00372                         \mbox{\hyperlink{structng__btsocket__l2cap__rtentry}{ng\_btsocket\_l2cap\_rtentry\_t}}  *rt = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00374}00374                         \textcolor{keywordflow}{if} (hook == NULL || \mbox{\hyperlink{netgraph_8h_a360d005d270d1ff7e5133d800678321f}{NG\_HOOK\_NOT\_VALID}}(hook) ||}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00375}00375                             msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != \textcolor{keyword}{sizeof}(bdaddr\_t))}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00376}00376                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00377}00377 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00378}00378                         \textcolor{keywordflow}{if} (bcmp(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}, \mbox{\hyperlink{ng__hci_8h_a5087b37d7deab31f2b7c7580982b4c1c}{NG\_HCI\_BDADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00379}00379                                         \textcolor{keyword}{sizeof}(bdaddr\_t)) == 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00380}00380                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00382}00382                         rt = (\mbox{\hyperlink{structng__btsocket__l2cap__rtentry}{ng\_btsocket\_l2cap\_rtentry\_t}} *) }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00383}00383                                 \mbox{\hyperlink{netgraph_8h_afe8dccb32c473a2098104a16179e754b}{NG\_HOOK\_PRIVATE}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00384}00384                         \textcolor{keywordflow}{if} (rt == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00385}00385                                 rt = malloc(\textcolor{keyword}{sizeof}(*rt),}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00386}00386                                         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a5ef0ba0b0e6063f505b943580e86d510}{M\_NETGRAPH\_BTSOCKET\_L2CAP\_RAW}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00387}00387                                         M\_NOWAIT|M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00388}00388                                 \textcolor{keywordflow}{if} (rt == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00389}00389                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00390}00390 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00391}00391                                 \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(hook, rt);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00393}00393                                 mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00395}00395                                 LIST\_INSERT\_HEAD(\&ng\_btsocket\_l2cap\_raw\_rt, }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00396}00396                                         rt, next);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00397}00397                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00398}00398                                 mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00399}00399                 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00400}00400                         bcopy(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}, \&rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}, \textcolor{keyword}{sizeof}(rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00401}00401                         rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}} = hook;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00403}00403                         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a77181191bac876b133c525e4be909f7f}{NG\_BTSOCKET\_L2CAP\_RAW\_INFO}}(}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00404}00404 \textcolor{stringliteral}{"{}\%s: Updating hook \(\backslash\)"{}\%s\(\backslash\)"{}, src bdaddr=\%x:\%x:\%x:\%x:\%x:\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00405}00405                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_ab077a5607cd5a2e82cc67326badd440a}{NG\_HOOK\_NAME}}(hook), }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00406}00406                                 rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}.b[5], rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}.b[4], rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}.b[3],}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00407}00407                                 rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}.b[2], rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}.b[1], rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}.b[0]);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00409}00409                         mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00410}00410                         \} \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00411}00411 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00412}00412                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__l2cap_8h_a92088679bff7177b91d348248a394a32}{NGM\_L2CAP\_NODE\_GET\_FLAGS}}:}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00413}00413                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__l2cap_8h_a92f8bbb041bfdae3f3451b9168952f70}{NGM\_L2CAP\_NODE\_GET\_DEBUG}}:}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00414}00414                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__l2cap_8h_a86bbdfe2e60ba36882c0675395b579c6}{NGM\_L2CAP\_NODE\_GET\_CON\_LIST}}:}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00415}00415                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__l2cap_8h_a33cf1899ec3f149a7e84d9cfa1ceeee8}{NGM\_L2CAP\_NODE\_GET\_CHAN\_LIST}}:}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00416}00416                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__l2cap_8h_a4e438e8d649105505164d037b1371adc}{NGM\_L2CAP\_NODE\_GET\_AUTO\_DISCON\_TIMO}}:}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00417}00417                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__l2cap_8h_a5cc9ac995ecc282ed7fb40281a574e92}{NGM\_L2CAP\_L2CA\_PING}}:}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00418}00418                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__l2cap_8h_aa192a3f581fe83ae64391a7410717f62}{NGM\_L2CAP\_L2CA\_GET\_INFO}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00419}00419                         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}  pcb = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00420}00420 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00421}00421                         mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00423}00423                         LIST\_FOREACH(pcb,\&ng\_btsocket\_l2cap\_raw\_sockets,next) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00424}00424                                 mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00426}00426                                 \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} == msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00427}00427                                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = msg;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00428}00428                                         msg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00429}00429                                         wakeup(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00430}00430                                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00431}00431                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00432}00432                                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00434}00434                                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00435}00435                         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00436}00436 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00437}00437                         mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00438}00438                         \} \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00440}00440                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00441}00441                         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_afae553014a2dd496b99d074c613dd8be}{NG\_BTSOCKET\_L2CAP\_RAW\_WARN}}(}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00442}00442 \textcolor{stringliteral}{"{}\%s: Unknown message, cmd=\%d\(\backslash\)n"{}}, \_\_func\_\_, msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00443}00443                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00444}00444                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00445}00445 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00446}00446                 \textcolor{keywordflow}{if} (hook != NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00447}00447                         \mbox{\hyperlink{netgraph_8h_a2b9c519a8b574618def581e0091cbf49}{NG\_HOOK\_UNREF}}(hook); \textcolor{comment}{/* remove extra reference */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00449}00449                 \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg); \textcolor{comment}{/* Checks for msg != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00450}00450         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00451}00451 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_input */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00452}00452 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00453}00453 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00454}00454 \textcolor{comment}{ * Route cleanup task. Gets scheduled when hook is disconnected. Here we }}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00455}00455 \textcolor{comment}{ * will find all sockets that use "{}invalid"{} hook and disconnect them.}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00456}00456 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00457}00457 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00458}00458 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00459}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a1f182d43df291b65f79290147fcf8d16}{00459}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a1f182d43df291b65f79290147fcf8d16}{ng\_btsocket\_l2cap\_raw\_rtclean}}(\textcolor{keywordtype}{void} *context, \textcolor{keywordtype}{int} pending)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00460}00460 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00461}00461         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}  pcb = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00462}00462         \mbox{\hyperlink{structng__btsocket__l2cap__rtentry}{ng\_btsocket\_l2cap\_rtentry\_p}}  rt = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00464}00464         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00465}00465 \textcolor{comment}{         * First disconnect all sockets that use "{}invalid"{} hook}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00466}00466 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00468}00468         mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00470}00470         LIST\_FOREACH(pcb, \&ng\_btsocket\_l2cap\_raw\_sockets, next) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00471}00471                 mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00472}00472 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00473}00473                 \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}} != NULL \&\&}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00474}00474                     pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}} != NULL \&\& \mbox{\hyperlink{netgraph_8h_a360d005d270d1ff7e5133d800678321f}{NG\_HOOK\_NOT\_VALID}}(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}})) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00475}00475                         \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a39118e243820b5d78cccd1cb5ed94bfd}{so}} != NULL \&\&}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00476}00476                             pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a39118e243820b5d78cccd1cb5ed94bfd}{so}}-\/>so\_state \& SS\_ISCONNECTED)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00477}00477                                 soisdisconnected(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a39118e243820b5d78cccd1cb5ed94bfd}{so}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00478}00478 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00479}00479                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00480}00480                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00481}00481 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00482}00482                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00483}00483         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00484}00484 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00485}00485         mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00487}00487         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00488}00488 \textcolor{comment}{         * Now cleanup routing table}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00489}00489 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00490}00490 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00491}00491         mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00493}00493         \textcolor{keywordflow}{for} (rt = LIST\_FIRST(\&ng\_btsocket\_l2cap\_raw\_rt); rt != NULL; ) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00494}00494                 \mbox{\hyperlink{structng__btsocket__l2cap__rtentry}{ng\_btsocket\_l2cap\_rtentry\_p}}  rt\_next = LIST\_NEXT(rt, next);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00496}00496                 \textcolor{keywordflow}{if} (rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}} != NULL \&\& \mbox{\hyperlink{netgraph_8h_a360d005d270d1ff7e5133d800678321f}{NG\_HOOK\_NOT\_VALID}}(rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}})) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00497}00497                         LIST\_REMOVE(rt, next);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00498}00498 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00499}00499                         \mbox{\hyperlink{netgraph_8h_a8167c04e701189ca4bc1bc3af5454ce6}{NG\_HOOK\_SET\_PRIVATE}}(rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}, NULL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00500}00500                         \mbox{\hyperlink{netgraph_8h_a2b9c519a8b574618def581e0091cbf49}{NG\_HOOK\_UNREF}}(rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}); \textcolor{comment}{/* Remove extra reference */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00502}00502                         bzero(rt, \textcolor{keyword}{sizeof}(*rt));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00503}00503                         free(rt, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a5ef0ba0b0e6063f505b943580e86d510}{M\_NETGRAPH\_BTSOCKET\_L2CAP\_RAW}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00504}00504                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00505}00505 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00506}00506                 rt = rt\_next;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00507}00507         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00509}00509         mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00510}00510 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_rtclean */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00511}00511 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00512}00512 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00513}00513 \textcolor{comment}{ * Initialize everything}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00514}00514 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00515}00515 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00516}00516 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00517}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ae2a58552780f749ccac35950efcc6ae0}{00517}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ae2a58552780f749ccac35950efcc6ae0}{ng\_btsocket\_l2cap\_raw\_init}}(\textcolor{keywordtype}{void} *arg \_\_unused)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00518}00518 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00519}00519         \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00520}00520 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00521}00521         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00522}00522         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a6929719626c82c4d61c3a7f440b389f6}{ng\_btsocket\_l2cap\_raw\_debug\_level}} = \mbox{\hyperlink{ng__btsocket_8h_add6a7e27a470c8b3aeb4793e015b84bb}{NG\_BTSOCKET\_WARN\_LEVEL}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00523}00523         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a2196aeead72b538141ba6b1afbb0345f}{ng\_btsocket\_l2cap\_raw\_ioctl\_timeout}} = 5;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00524}00524 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00525}00525         \textcolor{comment}{/* Register Netgraph node type */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00526}00526         error = \mbox{\hyperlink{netgraph_8h_a67f567d871dc683c4cb7a75dcfedf458}{ng\_newtype}}(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00527}00527         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00528}00528                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ac1b720a95dcc343a86087d7bb49e08d7}{NG\_BTSOCKET\_L2CAP\_RAW\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00529}00529 \textcolor{stringliteral}{"{}\%s: Could not register Netgraph node type, error=\%d\(\backslash\)n"{}}, \_\_func\_\_, error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00531}00531                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00532}00532         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00534}00534         \textcolor{comment}{/* Create Netgrapg node */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00535}00535         error = \mbox{\hyperlink{netgraph_8h_aba2cbbfc891d71bd283ce2368c8392db}{ng\_make\_node\_common}}(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}}, \&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00536}00536         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00537}00537                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ac1b720a95dcc343a86087d7bb49e08d7}{NG\_BTSOCKET\_L2CAP\_RAW\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00538}00538 \textcolor{stringliteral}{"{}\%s: Could not create Netgraph node, error=\%d\(\backslash\)n"{}}, \_\_func\_\_, error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00539}00539 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00540}00540                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00542}00542                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00543}00543         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00545}00545         error = \mbox{\hyperlink{netgraph_8h_abae5851c9f312eebd398b1cd085fe067}{ng\_name\_node}}(\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00546}00546                                 \mbox{\hyperlink{ng__btsocket_8h_a72916314da15d96514164a66f6142196}{NG\_BTSOCKET\_L2CAP\_RAW\_NODE\_TYPE}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00547}00547         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00548}00548                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ac1b720a95dcc343a86087d7bb49e08d7}{NG\_BTSOCKET\_L2CAP\_RAW\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00549}00549 \textcolor{stringliteral}{"{}\%s: Could not name Netgraph node, error=\%d\(\backslash\)n"{}}, \_\_func\_\_, error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00551}00551                 \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00552}00552                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00553}00553 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00554}00554                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00555}00555         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00556}00556 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00557}00557         \textcolor{comment}{/* Create input queue */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00558}00558         \mbox{\hyperlink{ng__bluetooth_8h_aac74453fd1344531d8b0d6544142da25}{NG\_BT\_ITEMQ\_INIT}}(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_af877476c48b6acdb1a0914a6ec994b0c}{ng\_btsocket\_l2cap\_raw\_queue}}, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4ae44a4904f51f52d1275cc443a960a4}{ifqmaxlen}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00559}00559         mtx\_init(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0cd393cc82f5e55e04749faf58b7804a}{ng\_btsocket\_l2cap\_raw\_queue\_mtx}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00560}00560                 \textcolor{stringliteral}{"{}btsocks\_l2cap\_raw\_queue\_mtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00561}00561         TASK\_INIT(\&\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a1fa5110c92a73e4f1f7ed57cb9940a0a}{ng\_btsocket\_l2cap\_raw\_queue\_task}}, 0,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00562}00562                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4b4732674ee5c350517f1e487f2b40db}{ng\_btsocket\_l2cap\_raw\_input}}, NULL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00563}00563 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00564}00564         \textcolor{comment}{/* Create list of sockets */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00565}00565         LIST\_INIT(\&ng\_btsocket\_l2cap\_raw\_sockets);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00566}00566         mtx\_init(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00567}00567                 \textcolor{stringliteral}{"{}btsocks\_l2cap\_raw\_sockets\_mtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00568}00568 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00569}00569         \textcolor{comment}{/* Tokens */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00570}00570         ng\_btsocket\_l2cap\_raw\_token = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00571}00571         mtx\_init(\&ng\_btsocket\_l2cap\_raw\_token\_mtx,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00572}00572                 \textcolor{stringliteral}{"{}btsocks\_l2cap\_raw\_token\_mtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00573}00573 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00574}00574         \textcolor{comment}{/* Routing table */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00575}00575         LIST\_INIT(\&ng\_btsocket\_l2cap\_raw\_rt);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00576}00576         mtx\_init(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00577}00577                 \textcolor{stringliteral}{"{}btsocks\_l2cap\_raw\_rt\_mtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00578}00578         TASK\_INIT(\&ng\_btsocket\_l2cap\_raw\_rt\_task, 0,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00579}00579                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a1f182d43df291b65f79290147fcf8d16}{ng\_btsocket\_l2cap\_raw\_rtclean}}, NULL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00580}00580 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_init */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00581}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aa3034c8f4f9556f5c1ef4055b3c10ed0}{00581}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aa3034c8f4f9556f5c1ef4055b3c10ed0}{SYSINIT}}(\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ae2a58552780f749ccac35950efcc6ae0}{ng\_btsocket\_l2cap\_raw\_init}}, SI\_SUB\_PROTO\_DOMAIN, SI\_ORDER\_THIRD,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00582}00582     \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ae2a58552780f749ccac35950efcc6ae0}{ng\_btsocket\_l2cap\_raw\_init}}, NULL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00584}00584 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00585}00585 \textcolor{comment}{ * Abort connection on socket}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00586}00586 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00588}00588 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00589}\mbox{\hyperlink{ng__btsocket__l2cap_8h_aff758e5108a194479dc372e5d17d276d}{00589}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aa3594891f97ffbfb682b8828aad9e21b}{ng\_btsocket\_l2cap\_raw\_abort}}(\textcolor{keyword}{struct} socket *so)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00590}00590 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00591}00591 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00592}00592         (void)\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a16a521938ef4258c2c35cf26b1bbfb36}{ng\_btsocket\_l2cap\_raw\_disconnect}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00593}00593 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_abort */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00594}00594 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00595}00595 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00596}\mbox{\hyperlink{ng__btsocket__l2cap_8h_a77da5fd21ea2836e9c09ad81c11fa345}{00596}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a110792481b39e16afc928cb9f87feba7}{ng\_btsocket\_l2cap\_raw\_close}}(\textcolor{keyword}{struct} socket *so)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00597}00597 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00598}00598 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00599}00599         (void)\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a16a521938ef4258c2c35cf26b1bbfb36}{ng\_btsocket\_l2cap\_raw\_disconnect}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00600}00600 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_close */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00601}00601 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00602}00602 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00603}00603 \textcolor{comment}{ * Create and attach new socket}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00604}00604 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00606}00606 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00607}\mbox{\hyperlink{ng__btsocket__l2cap_8h_a4f17d3e76ae84c9117415ba55b1f8940}{00607}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ad43aa40180c0111dfb1f1a68f51e9cb6}{ng\_btsocket\_l2cap\_raw\_attach}}(\textcolor{keyword}{struct} socket *so, \textcolor{keywordtype}{int} proto, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00608}00608 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00609}00609         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}  pcb = \mbox{\hyperlink{ng__btsocket__l2cap_8h_a5394c4fe7ccfdb1b406008b4408fe592}{so2l2cap\_raw\_pcb}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00610}00610         \textcolor{keywordtype}{int}                             error;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00611}00611 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00612}00612         \textcolor{keywordflow}{if} (pcb != NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00613}00613                 \textcolor{keywordflow}{return} (EISCONN);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00614}00614 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00615}00615         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} == NULL) }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00616}00616                 \textcolor{keywordflow}{return} (EPROTONOSUPPORT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00617}00617         \textcolor{keywordflow}{if} (so-\/>so\_type != SOCK\_RAW)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00618}00618                 \textcolor{keywordflow}{return} (ESOCKTNOSUPPORT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00620}00620         \textcolor{comment}{/* Reserve send and receive space if it is not reserved yet */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00621}00621         error = soreserve(so, \mbox{\hyperlink{ng__btsocket__l2cap_8h_a0e3b081151e6e5e18abd787746e57192}{NG\_BTSOCKET\_L2CAP\_RAW\_SENDSPACE}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00622}00622                         \mbox{\hyperlink{ng__btsocket__l2cap_8h_ab1c3deb7f6a00358776dc95554e63150}{NG\_BTSOCKET\_L2CAP\_RAW\_RECVSPACE}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00623}00623         \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00624}00624                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00626}00626         \textcolor{comment}{/* Allocate the PCB */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00627}00627         pcb = malloc(\textcolor{keyword}{sizeof}(*pcb),}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00628}00628                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a5ef0ba0b0e6063f505b943580e86d510}{M\_NETGRAPH\_BTSOCKET\_L2CAP\_RAW}}, M\_NOWAIT|M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00629}00629         \textcolor{keywordflow}{if} (pcb == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00630}00630                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00631}00631 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00632}00632         \textcolor{comment}{/* Link the PCB and the socket */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00633}00633         so-\/>so\_pcb = (caddr\_t) pcb;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00634}00634         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a39118e243820b5d78cccd1cb5ed94bfd}{so}} = so;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00635}00635 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00636}00636         \textcolor{keywordflow}{if} (priv\_check(td, PRIV\_NETBLUETOOTH\_RAW) == 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00637}00637                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a594a92adb63a3e2f0e00e4570713c731}{flags}} |= \mbox{\hyperlink{ng__btsocket__l2cap_8h_afa653c3f8cc74066f366ceaaabb11cde}{NG\_BTSOCKET\_L2CAP\_RAW\_PRIVILEGED}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00638}00638 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00639}00639         mtx\_init(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}}, \textcolor{stringliteral}{"{}btsocks\_l2cap\_raw\_pcb\_mtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00640}00640 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00641}00641         \textcolor{comment}{/* Add the PCB to the list */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00642}00642         mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00643}00643         LIST\_INSERT\_HEAD(\&ng\_btsocket\_l2cap\_raw\_sockets, pcb, next);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00644}00644         mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00645}00645 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00646}00646         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00647}00647 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_attach */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00648}00648 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00649}00649 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00650}00650 \textcolor{comment}{ * Bind socket}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00651}00651 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00652}00652 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00653}00653 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00654}\mbox{\hyperlink{ng__btsocket__l2cap_8h_a1e073b9dad143635df3e911e029735b2}{00654}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_ad591f6bfdcbd5a7e50e65e880b43d8ca}{ng\_btsocket\_l2cap\_raw\_bind}}(\textcolor{keyword}{struct} socket *so, \textcolor{keyword}{struct} sockaddr *nam, }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00655}00655                 \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00656}00656 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00657}00657         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_t}}  *pcb = \mbox{\hyperlink{ng__btsocket__l2cap_8h_a5394c4fe7ccfdb1b406008b4408fe592}{so2l2cap\_raw\_pcb}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00658}00658         \textcolor{keyword}{struct }\mbox{\hyperlink{structsockaddr__l2cap}{sockaddr\_l2cap}}             *sa = (\textcolor{keyword}{struct }\mbox{\hyperlink{structsockaddr__l2cap}{sockaddr\_l2cap}} *) nam;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00659}00659         \mbox{\hyperlink{structng__btsocket__l2cap__rtentry}{ng\_btsocket\_l2cap\_rtentry\_t}}  *rt = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00660}00660 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00661}00661         \textcolor{keywordflow}{if} (pcb == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00662}00662                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00663}00663         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} == NULL) }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00664}00664                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00666}00666         \textcolor{keywordflow}{if} (sa == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00667}00667                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00668}00668         \textcolor{keywordflow}{if} (sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_ab83019b07d4bc193848ecbab48a37d74}{l2cap\_family}} != AF\_BLUETOOTH)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00669}00669                 \textcolor{keywordflow}{return} (EAFNOSUPPORT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00670}00670         \textcolor{keywordflow}{if}((sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a2873ac0f21c26fbe6ec34259c5006ba0}{l2cap\_len}} != \textcolor{keyword}{sizeof}(*sa))\&\&}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00671}00671            (sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a2873ac0f21c26fbe6ec34259c5006ba0}{l2cap\_len}} != \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structsockaddr__l2cap__compat}{sockaddr\_l2cap\_compat}})))}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00672}00672                 return (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00673}00673 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00674}00674         \textcolor{keywordflow}{if} (bcmp(\&sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}, \mbox{\hyperlink{ng__hci_8h_a5087b37d7deab31f2b7c7580982b4c1c}{NG\_HCI\_BDADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00675}00675                                 \textcolor{keyword}{sizeof}(sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}})) != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00676}00676                 mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00677}00677 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00678}00678                 LIST\_FOREACH(rt, \&ng\_btsocket\_l2cap\_raw\_rt, next) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00679}00679                         \textcolor{keywordflow}{if} (rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}} == NULL || \mbox{\hyperlink{netgraph_8h_a360d005d270d1ff7e5133d800678321f}{NG\_HOOK\_NOT\_VALID}}(rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}))}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00680}00680                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00681}00681 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00682}00682                         \textcolor{keywordflow}{if} (bcmp(\&sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}, \&rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00683}00683                                         \textcolor{keyword}{sizeof}(rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}})) == 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00684}00684                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00685}00685                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00686}00686 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00687}00687                 mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00688}00688 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00689}00689                 \textcolor{keywordflow}{if} (rt == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00690}00690                         \textcolor{keywordflow}{return} (ENETDOWN);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00691}00691         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00692}00692                 rt = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00694}00694         mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00695}00695         bcopy(\&sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a10b267cae9dae892642c306b2616b0fd}{src}}, \textcolor{keyword}{sizeof}(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a10b267cae9dae892642c306b2616b0fd}{src}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00696}00696         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}} = rt;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00697}00697         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00698}00698 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00699}00699         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00700}00700 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_bind */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00701}00701 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00702}00702 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00703}00703 \textcolor{comment}{ * Connect socket}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00704}00704 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00705}00705 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00706}00706 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00707}\mbox{\hyperlink{ng__btsocket__l2cap_8h_a8ee22b8e60f91d840c48eb61712aec53}{00707}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a9ea13cedcdf146ac7422ff3c29147da7}{ng\_btsocket\_l2cap\_raw\_connect}}(\textcolor{keyword}{struct} socket *so, \textcolor{keyword}{struct} sockaddr *nam, }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00708}00708                 \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00709}00709 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00710}00710         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_t}}  *pcb = \mbox{\hyperlink{ng__btsocket__l2cap_8h_a5394c4fe7ccfdb1b406008b4408fe592}{so2l2cap\_raw\_pcb}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00711}00711         \textcolor{keyword}{struct }\mbox{\hyperlink{structsockaddr__l2cap}{sockaddr\_l2cap}}             *sa = (\textcolor{keyword}{struct }\mbox{\hyperlink{structsockaddr__l2cap}{sockaddr\_l2cap}} *) nam;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00712}00712         \mbox{\hyperlink{structng__btsocket__l2cap__rtentry}{ng\_btsocket\_l2cap\_rtentry\_t}}  *rt = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00713}00713         \textcolor{keywordtype}{int}                              error;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00715}00715         \textcolor{keywordflow}{if} (pcb == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00716}00716                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00717}00717         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} == NULL) }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00718}00718                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00719}00719 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00720}00720         \textcolor{keywordflow}{if} (sa == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00721}00721                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00722}00722         \textcolor{keywordflow}{if} (sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_ab83019b07d4bc193848ecbab48a37d74}{l2cap\_family}} != AF\_BLUETOOTH)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00723}00723                 \textcolor{keywordflow}{return} (EAFNOSUPPORT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00724}00724         \textcolor{keywordflow}{if}((sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a2873ac0f21c26fbe6ec34259c5006ba0}{l2cap\_len}} != \textcolor{keyword}{sizeof}(*sa))\&\&}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00725}00725            (sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a2873ac0f21c26fbe6ec34259c5006ba0}{l2cap\_len}} != \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structsockaddr__l2cap__compat}{sockaddr\_l2cap\_compat}})))}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00726}00726                 return (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00727}00727 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00728}00728         \textcolor{keywordflow}{if} (bcmp(\&sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}, \mbox{\hyperlink{ng__hci_8h_a5087b37d7deab31f2b7c7580982b4c1c}{NG\_HCI\_BDADDR\_ANY}}, \textcolor{keyword}{sizeof}(bdaddr\_t)) == 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00729}00729                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00730}00730 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00731}00731         mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00732}00732 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00733}00733         bcopy(\&sa-\/>\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_ae2209c77cf796c521638fdc1dacd2503}{dst}}, \textcolor{keyword}{sizeof}(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_ae2209c77cf796c521638fdc1dacd2503}{dst}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00734}00734 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00735}00735         \textcolor{keywordflow}{if} (bcmp(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a10b267cae9dae892642c306b2616b0fd}{src}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_ae2209c77cf796c521638fdc1dacd2503}{dst}}, \textcolor{keyword}{sizeof}(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a10b267cae9dae892642c306b2616b0fd}{src}})) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00736}00736                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00737}00737 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00738}00738                 \textcolor{keywordflow}{return} (EADDRNOTAVAIL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00739}00739         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00740}00740 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00741}00741         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00742}00742 \textcolor{comment}{         * If there is route already -\/ use it}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00743}00743 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00744}00744 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00745}00745         \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00746}00746                 soisconnected(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00747}00747                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00749}00749                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00750}00750         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00751}00751 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00752}00752         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00753}00753 \textcolor{comment}{         * Find the first hook that does not match specified destination address}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00754}00754 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00756}00756         mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00758}00758         LIST\_FOREACH(rt, \&ng\_btsocket\_l2cap\_raw\_rt, next) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00759}00759                 \textcolor{keywordflow}{if} (rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}} == NULL || \mbox{\hyperlink{netgraph_8h_a360d005d270d1ff7e5133d800678321f}{NG\_HOOK\_NOT\_VALID}}(rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}))}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00760}00760                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00761}00761 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00762}00762                 \textcolor{keywordflow}{if} (bcmp(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_ae2209c77cf796c521638fdc1dacd2503}{dst}}, \&rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}, \textcolor{keyword}{sizeof}(rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}})) != 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00763}00763                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00764}00764         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00765}00765 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00766}00766         \textcolor{keywordflow}{if} (rt != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00767}00767                 soisconnected(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00769}00769                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}} = rt;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00770}00770                 bcopy(\&rt-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a3f85803ece1961c834829e2230a144ef}{src}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a10b267cae9dae892642c306b2616b0fd}{src}}, \textcolor{keyword}{sizeof}(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a10b267cae9dae892642c306b2616b0fd}{src}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00772}00772                 error = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00773}00773         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00774}00774                 error = ENETDOWN;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00775}00775 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00776}00776         mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_rt\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00777}00777         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00778}00778 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00779}00779         \textcolor{keywordflow}{return}  (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00780}00780 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_connect */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00782}00782 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00783}00783 \textcolor{comment}{ * Process ioctl's calls on socket}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00784}00784 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00785}00785 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00786}00786 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00787}\mbox{\hyperlink{ng__btsocket__l2cap_8h_a50beb37212a89d9bdb0c6c8295f1c629}{00787}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a8893d3ab890760ac9742530658e609e8}{ng\_btsocket\_l2cap\_raw\_control}}(\textcolor{keyword}{struct} socket *so, u\_long \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}, caddr\_t \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00788}00788                 \textcolor{keyword}{struct} ifnet *ifp, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00789}00789 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00790}00790         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}   pcb = \mbox{\hyperlink{ng__btsocket__l2cap_8h_a5394c4fe7ccfdb1b406008b4408fe592}{so2l2cap\_raw\_pcb}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00791}00791         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}}                   *msg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00792}00792         \textcolor{keywordtype}{int}                              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00793}00793 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00794}00794         \textcolor{keywordflow}{if} (pcb == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00795}00795                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00796}00796         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00797}00797                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00798}00798 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00799}00799         mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00800}00800 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00801}00801         \textcolor{comment}{/* Check if we route info */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00802}00802         \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00803}00803                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00804}00804                 \textcolor{keywordflow}{return} (EHOSTUNREACH);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00805}00805         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00806}00806 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00807}00807         \textcolor{comment}{/* Check if we have pending ioctl() */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00808}00808         \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00809}00809                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00810}00810                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00811}00811         \}  }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00812}00812 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00813}00813         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00814}00814         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_a218426e695985661a8e69ab65f2410f6}{SIOC\_L2CAP\_NODE\_GET\_FLAGS}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00815}00815                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__flags}{ng\_btsocket\_l2cap\_raw\_node\_flags}} *p =}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00816}00816                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__flags}{ng\_btsocket\_l2cap\_raw\_node\_flags}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00817}00817 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00818}00818                 error = \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0ae88f29aa40f143ce76c0707e4d8f10}{ng\_btsocket\_l2cap\_raw\_send\_sync\_ngmsg}}(pcb,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00819}00819                                 \mbox{\hyperlink{ng__l2cap_8h_a92088679bff7177b91d348248a394a32}{NGM\_L2CAP\_NODE\_GET\_FLAGS}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00820}00820                                 \&p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__flags_a1aca0c561fdd055b355bca022bf2654c}{flags}}, \textcolor{keyword}{sizeof}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__flags_a1aca0c561fdd055b355bca022bf2654c}{flags}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00821}00821                 \} \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00822}00822 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00823}00823         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_a4e9f13d04cc31f6b1b2c9a27f523d964}{SIOC\_L2CAP\_NODE\_GET\_DEBUG}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00824}00824                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__debug}{ng\_btsocket\_l2cap\_raw\_node\_debug}} *p =}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00825}00825                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__debug}{ng\_btsocket\_l2cap\_raw\_node\_debug}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00826}00826 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00827}00827                 error = \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0ae88f29aa40f143ce76c0707e4d8f10}{ng\_btsocket\_l2cap\_raw\_send\_sync\_ngmsg}}(pcb,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00828}00828                                 \mbox{\hyperlink{ng__l2cap_8h_a92f8bbb041bfdae3f3451b9168952f70}{NGM\_L2CAP\_NODE\_GET\_DEBUG}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00829}00829                                 \&p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__debug_a0c4a2b1d8fdc22fda7bcaead27281ef2}{debug}}, \textcolor{keyword}{sizeof}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__debug_a0c4a2b1d8fdc22fda7bcaead27281ef2}{debug}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00830}00830                 \} \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00831}00831 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00832}00832         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_ab329060a65e8e7323252d6116f7d238f}{SIOC\_L2CAP\_NODE\_SET\_DEBUG}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00833}00833                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__debug}{ng\_btsocket\_l2cap\_raw\_node\_debug}} *p = }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00834}00834                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__debug}{ng\_btsocket\_l2cap\_raw\_node\_debug}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00835}00835 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00836}00836                 \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a594a92adb63a3e2f0e00e4570713c731}{flags}} \& \mbox{\hyperlink{ng__btsocket__l2cap_8h_afa653c3f8cc74066f366ceaaabb11cde}{NG\_BTSOCKET\_L2CAP\_RAW\_PRIVILEGED}})}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00837}00837                         error = \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_abc2e0da44f30ca9fab14356004ab1f2c}{ng\_btsocket\_l2cap\_raw\_send\_ngmsg}}(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00838}00838                                         \mbox{\hyperlink{ng__l2cap_8h_a5b04a721f2b3df75ff9cdbd496b6a4bf}{NGM\_L2CAP\_NODE\_SET\_DEBUG}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00839}00839                                         \&p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__debug_a0c4a2b1d8fdc22fda7bcaead27281ef2}{debug}}, \textcolor{keyword}{sizeof}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__node__debug_a0c4a2b1d8fdc22fda7bcaead27281ef2}{debug}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00840}00840                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00841}00841                         error = EPERM;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00842}00842                 \} \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00843}00843 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00844}00844         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_aad73234afe059b2051d82fc02cf1067b}{SIOC\_L2CAP\_NODE\_GET\_CON\_LIST}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00845}00845                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list}{ng\_btsocket\_l2cap\_raw\_con\_list}}     *p =}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00846}00846                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list}{ng\_btsocket\_l2cap\_raw\_con\_list}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00847}00847                 \mbox{\hyperlink{structng__l2cap__node__con__list__ep}{ng\_l2cap\_node\_con\_list\_ep}}              *p1 = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00848}00848                 \mbox{\hyperlink{structng__l2cap__node__con__ep}{ng\_l2cap\_node\_con\_ep}}                        *p2 = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00849}00849 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00850}00850                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list_a8abba87d4cac4ff6bfbdea3c76701368}{num\_connections}} == 0 ||}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00851}00851                     p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list_a8abba87d4cac4ff6bfbdea3c76701368}{num\_connections}} > \mbox{\hyperlink{ng__l2cap_8h_aa869fe4c76e0dec62efc155710941f99}{NG\_L2CAP\_MAX\_CON\_NUM}} ||}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00852}00852                     p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list_ae27ac2275df72abe53dc7f1e98e1b39e}{connections}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00853}00853                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00854}00854                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00855}00855                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00856}00856 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00857}00857                 \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__l2cap_8h_a7e452e3322a39653affa38cdea2c761a}{NGM\_L2CAP\_COOKIE}}, \mbox{\hyperlink{ng__l2cap_8h_a86bbdfe2e60ba36882c0675395b579c6}{NGM\_L2CAP\_NODE\_GET\_CON\_LIST}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00858}00858                         0, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00859}00859                 \textcolor{keywordflow}{if} (msg == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00860}00860                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00861}00861                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00862}00862                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00863}00863                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aea36fc477539263576c377abde42b8c7}{ng\_btsocket\_l2cap\_raw\_get\_token}}(\&msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00864}00864                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00865}00865                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00866}00866 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00867}00867                 \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(error, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}}, msg,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00868}00868                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00869}00869                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00870}00870                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00871}00871                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00872}00872                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00873}00873                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00874}00874 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00875}00875                 error = msleep(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}}, PZERO|PCATCH, \textcolor{stringliteral}{"{}l2ctl"{}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00876}00876                                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a2196aeead72b538141ba6b1afbb0345f}{ng\_btsocket\_l2cap\_raw\_ioctl\_timeout}} * hz);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00877}00877                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00878}00878 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00879}00879                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00880}00880                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00881}00881                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00882}00882                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00883}00883 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00884}00884                 msg = pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00885}00885                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00886}00886 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00887}00887                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00888}00888 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00889}00889                 \textcolor{keywordflow}{if} (msg != NULL \&\&}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00890}00890                     msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__l2cap_8h_a86bbdfe2e60ba36882c0675395b579c6}{NGM\_L2CAP\_NODE\_GET\_CON\_LIST}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00891}00891                         \textcolor{comment}{/* Return data back to user space */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00892}00892                         p1 = (\mbox{\hyperlink{structng__l2cap__node__con__list__ep}{ng\_l2cap\_node\_con\_list\_ep}} *)(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00893}00893                         p2 = (\mbox{\hyperlink{structng__l2cap__node__con__ep}{ng\_l2cap\_node\_con\_ep}} *)(p1 + 1);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00894}00894 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00895}00895                         p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list_a8abba87d4cac4ff6bfbdea3c76701368}{num\_connections}} = \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list_a8abba87d4cac4ff6bfbdea3c76701368}{num\_connections}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00896}00896                                                 p1-\/>\mbox{\hyperlink{structng__l2cap__node__con__list__ep_a1e30aee3d41bfbd2193a4d097de9757b}{num\_connections}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00897}00897                         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list_a8abba87d4cac4ff6bfbdea3c76701368}{num\_connections}} > 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00898}00898                                 error = copyout((caddr\_t) p2, }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00899}00899                                         (caddr\_t) p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list_ae27ac2275df72abe53dc7f1e98e1b39e}{connections}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00900}00900                                         p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__con__list_a8abba87d4cac4ff6bfbdea3c76701368}{num\_connections}} * \textcolor{keyword}{sizeof}(*p2));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00901}00901                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00902}00902                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00903}00903 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00904}00904                 \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg); \textcolor{comment}{/* checks for != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00905}00905                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00906}00906                 \} \textcolor{comment}{/* NOTREACHED */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00907}00907 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00908}00908         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_afe00c4b141da76b7effa6ff24678f361}{SIOC\_L2CAP\_NODE\_GET\_CHAN\_LIST}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00909}00909                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list}{ng\_btsocket\_l2cap\_raw\_chan\_list}}   *p =}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00910}00910                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list}{ng\_btsocket\_l2cap\_raw\_chan\_list}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00911}00911                 \mbox{\hyperlink{structng__l2cap__node__chan__list__ep}{ng\_l2cap\_node\_chan\_list\_ep}}            *p1 = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00912}00912                 \mbox{\hyperlink{structng__l2cap__node__chan__ep}{ng\_l2cap\_node\_chan\_ep}}                      *p2 = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00913}00913 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00914}00914                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list_aa2856482108c90cc5d1a36ecc011b099}{num\_channels}} == 0 ||}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00915}00915                     p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list_aa2856482108c90cc5d1a36ecc011b099}{num\_channels}} > \mbox{\hyperlink{ng__l2cap_8h_ad233ba61876ae0b2732db5ec679e8f0a}{NG\_L2CAP\_MAX\_CHAN\_NUM}} ||}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00916}00916                     p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list_a3c0e6acb31655dd6497ea5f8529eef7e}{channels}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00917}00917                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00918}00918                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00919}00919                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00920}00920 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00921}00921                 \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__l2cap_8h_a7e452e3322a39653affa38cdea2c761a}{NGM\_L2CAP\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00922}00922                         \mbox{\hyperlink{ng__l2cap_8h_a33cf1899ec3f149a7e84d9cfa1ceeee8}{NGM\_L2CAP\_NODE\_GET\_CHAN\_LIST}}, 0, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00923}00923                 \textcolor{keywordflow}{if} (msg == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00924}00924                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00925}00925                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00926}00926                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00927}00927                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aea36fc477539263576c377abde42b8c7}{ng\_btsocket\_l2cap\_raw\_get\_token}}(\&msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00928}00928                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00929}00929                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00930}00930 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00931}00931                 \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(error, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}}, msg,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00932}00932                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00933}00933                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00934}00934                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00935}00935                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00936}00936                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00937}00937                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00938}00938 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00939}00939                 error = msleep(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}}, PZERO|PCATCH, \textcolor{stringliteral}{"{}l2ctl"{}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00940}00940                                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a2196aeead72b538141ba6b1afbb0345f}{ng\_btsocket\_l2cap\_raw\_ioctl\_timeout}} * hz);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00941}00941                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00942}00942 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00943}00943                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00944}00944                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00945}00945                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00946}00946                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00947}00947 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00948}00948                 msg = pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00949}00949                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00950}00950 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00951}00951                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00952}00952 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00953}00953                 \textcolor{keywordflow}{if} (msg != NULL \&\&}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00954}00954                     msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__l2cap_8h_a33cf1899ec3f149a7e84d9cfa1ceeee8}{NGM\_L2CAP\_NODE\_GET\_CHAN\_LIST}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00955}00955                         \textcolor{comment}{/* Return data back to user space */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00956}00956                         p1 = (\mbox{\hyperlink{structng__l2cap__node__chan__list__ep}{ng\_l2cap\_node\_chan\_list\_ep}} *)(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00957}00957                         p2 = (\mbox{\hyperlink{structng__l2cap__node__chan__ep}{ng\_l2cap\_node\_chan\_ep}} *)(p1 + 1);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00958}00958 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00959}00959                         p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list_aa2856482108c90cc5d1a36ecc011b099}{num\_channels}} = \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list_aa2856482108c90cc5d1a36ecc011b099}{num\_channels}}, }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00960}00960                                                 p1-\/>\mbox{\hyperlink{structng__l2cap__node__chan__list__ep_a4b98fa9a6f90e5c70c9a9b8888f7a4fd}{num\_channels}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00961}00961                         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list_aa2856482108c90cc5d1a36ecc011b099}{num\_channels}} > 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00962}00962                                 error = copyout((caddr\_t) p2, }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00963}00963                                                 (caddr\_t) p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list_a3c0e6acb31655dd6497ea5f8529eef7e}{channels}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00964}00964                                                 p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__chan__list_aa2856482108c90cc5d1a36ecc011b099}{num\_channels}} * \textcolor{keyword}{sizeof}(*p2));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00965}00965                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00966}00966                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00967}00967 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00968}00968                 \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg); \textcolor{comment}{/* checks for != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00969}00969                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00970}00970                 \} \textcolor{comment}{/* NOTREACHED */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00971}00971 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00972}00972         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_a76de016821900f78c361e12a6b1bfbba}{SIOC\_L2CAP\_L2CA\_PING}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00973}00973                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping}{ng\_btsocket\_l2cap\_raw\_ping}}     *p = }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00974}00974                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping}{ng\_btsocket\_l2cap\_raw\_ping}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00975}00975                 \mbox{\hyperlink{structng__l2cap__l2ca__ping__ip}{ng\_l2cap\_l2ca\_ping\_ip}}                      *ip = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00976}00976                 \mbox{\hyperlink{structng__l2cap__l2ca__ping__op}{ng\_l2cap\_l2ca\_ping\_op}}                      *op = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00977}00977 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00978}00978                 \textcolor{keywordflow}{if} ((p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}} != 0 \&\& p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_ad7e6e92d045741addeb9dadf5b45a5c4}{echo\_data}} == NULL) ||}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00979}00979                      p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}} > \mbox{\hyperlink{ng__l2cap_8h_ad891ca5bf83f34ceb46c152396cf13dc}{NG\_L2CAP\_MAX\_ECHO\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00980}00980                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00981}00981                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00982}00982                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00983}00983 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00984}00984                 \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__l2cap_8h_a7e452e3322a39653affa38cdea2c761a}{NGM\_L2CAP\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00985}00985                         \mbox{\hyperlink{ng__l2cap_8h_a5cc9ac995ecc282ed7fb40281a574e92}{NGM\_L2CAP\_L2CA\_PING}}, \textcolor{keyword}{sizeof}(*ip) + p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00986}00986                         M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00987}00987                 \textcolor{keywordflow}{if} (msg == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00988}00988                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00989}00989                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00990}00990                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00991}00991                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aea36fc477539263576c377abde42b8c7}{ng\_btsocket\_l2cap\_raw\_get\_token}}(\&msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00992}00992                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00993}00993                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00994}00994 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00995}00995                 ip = (\mbox{\hyperlink{structng__l2cap__l2ca__ping__ip}{ng\_l2cap\_l2ca\_ping\_ip}} *)(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00996}00996                 bcopy(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_ae2209c77cf796c521638fdc1dacd2503}{dst}}, \&ip-\/>\mbox{\hyperlink{structng__l2cap__l2ca__ping__ip_ad76d1cf1bd55d4189ca7e50b35ac8668}{bdaddr}}, \textcolor{keyword}{sizeof}(ip-\/>\mbox{\hyperlink{structng__l2cap__l2ca__ping__ip_ad76d1cf1bd55d4189ca7e50b35ac8668}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00997}00997                 ip-\/>\mbox{\hyperlink{structng__l2cap__l2ca__ping__ip_a2706cbc8ef2744ec2723d892bffbeb07}{echo\_size}} = p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l00999}00999                 \textcolor{keywordflow}{if} (ip-\/>\mbox{\hyperlink{structng__l2cap__l2ca__ping__ip_a2706cbc8ef2744ec2723d892bffbeb07}{echo\_size}} > 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01000}01000                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01001}01001                         error = copyin(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_ad7e6e92d045741addeb9dadf5b45a5c4}{echo\_data}}, ip + 1, p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01002}01002                         mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01003}01003 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01004}01004                         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01005}01005                                 \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01006}01006                                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01007}01007                                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01008}01008                                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01009}01009                         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01010}01010                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01011}01011 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01012}01012                 \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(error, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}}, msg,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01013}01013                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01014}01014                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01015}01015                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01016}01016                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01017}01017                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01018}01018                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01019}01019 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01020}01020                 error = msleep(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}}, PZERO|PCATCH, \textcolor{stringliteral}{"{}l2ctl"{}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01021}01021                                 \mbox{\hyperlink{ng__bluetooth_8c_a8f9f90d41247bf91f94cc233147736ca}{bluetooth\_l2cap\_rtx\_timeout}}());}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01022}01022                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01023}01023 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01024}01024                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01025}01025                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01026}01026                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01027}01027                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01028}01028 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01029}01029                 msg = pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01030}01030                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01031}01031 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01032}01032                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01033}01033 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01034}01034                 \textcolor{keywordflow}{if} (msg != NULL \&\&}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01035}01035                     msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__l2cap_8h_a5cc9ac995ecc282ed7fb40281a574e92}{NGM\_L2CAP\_L2CA\_PING}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01036}01036                         \textcolor{comment}{/* Return data back to the user space */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01037}01037                         op = (\mbox{\hyperlink{structng__l2cap__l2ca__ping__op}{ng\_l2cap\_l2ca\_ping\_op}} *)(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01038}01038                         p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_a43cb00f602203a2448264eb581549d5b}{result}} = op-\/>\mbox{\hyperlink{structng__l2cap__l2ca__ping__op_ab1090dab179fdf7a158d3325ec463c22}{result}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01039}01039                         p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}} = \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}}, op-\/>\mbox{\hyperlink{structng__l2cap__l2ca__ping__op_af08482596206a37ebd0ec2084f3ccedc}{echo\_size}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01040}01040 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01041}01041                         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}} > 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01042}01042                                 error = copyout(op + 1, p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_ad7e6e92d045741addeb9dadf5b45a5c4}{echo\_data}}, }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01043}01043                                                 p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__ping_aeea379048aa3d6536c3f1ab3a86902cd}{echo\_size}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01044}01044                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01045}01045                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01046}01046 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01047}01047                 \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg); \textcolor{comment}{/* checks for != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01048}01048                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01049}01049                 \} \textcolor{comment}{/* NOTREACHED */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01050}01050 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01051}01051         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_a061509bcee46a37ea209a5c6f44d24f0}{SIOC\_L2CAP\_L2CA\_GET\_INFO}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01052}01052                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info}{ng\_btsocket\_l2cap\_raw\_get\_info}}     *p = }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01053}01053                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info}{ng\_btsocket\_l2cap\_raw\_get\_info}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01054}01054                 \mbox{\hyperlink{structng__l2cap__l2ca__get__info__ip}{ng\_l2cap\_l2ca\_get\_info\_ip}}              *ip = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01055}01055                 \mbox{\hyperlink{structng__l2cap__l2ca__get__info__op}{ng\_l2cap\_l2ca\_get\_info\_op}}              *op = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01056}01056 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01057}01057                 \textcolor{keywordflow}{if} (!(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a594a92adb63a3e2f0e00e4570713c731}{flags}} \& \mbox{\hyperlink{ng__btsocket__l2cap_8h_afa653c3f8cc74066f366ceaaabb11cde}{NG\_BTSOCKET\_L2CAP\_RAW\_PRIVILEGED}})) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01058}01058                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01059}01059                         \textcolor{keywordflow}{return} (EPERM);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01060}01060                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01061}01061 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01062}01062                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_af63bdd0122ef102ec487079e54add1f6}{info\_size}} != 0 \&\& p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_a02a06909ca477de4dadf2d99c5cdcf86}{info\_data}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01063}01063                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01064}01064                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01065}01065                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01066}01066 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01067}01067                 \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__l2cap_8h_a7e452e3322a39653affa38cdea2c761a}{NGM\_L2CAP\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01068}01068                         \mbox{\hyperlink{ng__l2cap_8h_aa192a3f581fe83ae64391a7410717f62}{NGM\_L2CAP\_L2CA\_GET\_INFO}}, \textcolor{keyword}{sizeof}(*ip) + p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_af63bdd0122ef102ec487079e54add1f6}{info\_size}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01069}01069                         M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01070}01070                 \textcolor{keywordflow}{if} (msg == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01071}01071                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01072}01072                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01073}01073                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01074}01074                 \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aea36fc477539263576c377abde42b8c7}{ng\_btsocket\_l2cap\_raw\_get\_token}}(\&msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01075}01075                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01076}01076                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01077}01077 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01078}01078                 ip = (\mbox{\hyperlink{structng__l2cap__l2ca__get__info__ip}{ng\_l2cap\_l2ca\_get\_info\_ip}} *)(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01079}01079                 bcopy(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_ae2209c77cf796c521638fdc1dacd2503}{dst}}, \&ip-\/>\mbox{\hyperlink{structng__l2cap__l2ca__get__info__ip_ab02680047cde1786c8533f291fabdcc9}{bdaddr}}, \textcolor{keyword}{sizeof}(ip-\/>\mbox{\hyperlink{structng__l2cap__l2ca__get__info__ip_ab02680047cde1786c8533f291fabdcc9}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01080}01080                 ip-\/>\mbox{\hyperlink{structng__l2cap__l2ca__get__info__ip_a7ab045c78df46f478b4c02d37cf4bc72}{info\_type}} = p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_ab3ade829fd79ab606d99ed119951fa96}{info\_type}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01081}01081 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01082}01082                 \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(error, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}}, msg,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01083}01083                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01084}01084                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01085}01085                         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01086}01086                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01087}01087                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01088}01088                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01089}01089 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01090}01090                 error = msleep(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}}, PZERO|PCATCH, \textcolor{stringliteral}{"{}l2ctl"{}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01091}01091                                 \mbox{\hyperlink{ng__bluetooth_8c_a8f9f90d41247bf91f94cc233147736ca}{bluetooth\_l2cap\_rtx\_timeout}}());}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01092}01092                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01093}01093 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01094}01094                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01095}01095                         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01096}01096                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01097}01097                 \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01098}01098 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01099}01099                 msg = pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01100}01100                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01101}01101 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01102}01102                 mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01103}01103 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01104}01104                 \textcolor{keywordflow}{if} (msg != NULL \&\&}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01105}01105                     msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__l2cap_8h_aa192a3f581fe83ae64391a7410717f62}{NGM\_L2CAP\_L2CA\_GET\_INFO}}) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01106}01106                         \textcolor{comment}{/* Return data back to the user space */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01107}01107                         op = (\mbox{\hyperlink{structng__l2cap__l2ca__get__info__op}{ng\_l2cap\_l2ca\_get\_info\_op}} *)(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01108}01108                         p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_a67bf3ebe495d7adef7470d795c1d8e65}{result}} = op-\/>\mbox{\hyperlink{structng__l2cap__l2ca__get__info__op_a758e6396bb2fbd6a9f53a0a88bb46d79}{result}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01109}01109                         p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_af63bdd0122ef102ec487079e54add1f6}{info\_size}} = \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_af63bdd0122ef102ec487079e54add1f6}{info\_size}}, op-\/>\mbox{\hyperlink{structng__l2cap__l2ca__get__info__op_a42f88f53bd0acff63990cbfde249db05}{info\_size}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01110}01110 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01111}01111                         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_af63bdd0122ef102ec487079e54add1f6}{info\_size}} > 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01112}01112                                 error = copyout(op + 1, p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_a02a06909ca477de4dadf2d99c5cdcf86}{info\_data}}, }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01113}01113                                                 p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__get__info_af63bdd0122ef102ec487079e54add1f6}{info\_size}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01114}01114                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01115}01115                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01116}01116 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01117}01117                 \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg); \textcolor{comment}{/* checks for != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01118}01118                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01119}01119                 \} \textcolor{comment}{/* NOTREACHED */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01120}01120 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01121}01121         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_a6de3af2f18a58c198de44e17990c9a13}{SIOC\_L2CAP\_NODE\_GET\_AUTO\_DISCON\_TIMO}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01122}01122                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__auto__discon__timo}{ng\_btsocket\_l2cap\_raw\_auto\_discon\_timo}}     *p =}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01123}01123                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__auto__discon__timo}{ng\_btsocket\_l2cap\_raw\_auto\_discon\_timo}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01124}01124 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01125}01125                 error = \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0ae88f29aa40f143ce76c0707e4d8f10}{ng\_btsocket\_l2cap\_raw\_send\_sync\_ngmsg}}(pcb,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01126}01126                                 \mbox{\hyperlink{ng__l2cap_8h_a4e438e8d649105505164d037b1371adc}{NGM\_L2CAP\_NODE\_GET\_AUTO\_DISCON\_TIMO}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01127}01127                                 \&p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__auto__discon__timo_ac24a98ab81e61633c053f4b174d57c6e}{timeout}}, \textcolor{keyword}{sizeof}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__auto__discon__timo_ac24a98ab81e61633c053f4b174d57c6e}{timeout}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01128}01128                 \} \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01129}01129 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01130}01130         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__btsocket_8h_a6cc93bc9a50d55545e315562d1e0cb05}{SIOC\_L2CAP\_NODE\_SET\_AUTO\_DISCON\_TIMO}}: \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01131}01131                 \textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__auto__discon__timo}{ng\_btsocket\_l2cap\_raw\_auto\_discon\_timo}}     *p =}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01132}01132                         (\textcolor{keyword}{struct }\mbox{\hyperlink{structng__btsocket__l2cap__raw__auto__discon__timo}{ng\_btsocket\_l2cap\_raw\_auto\_discon\_timo}} *) \mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01133}01133 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01134}01134                 \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a594a92adb63a3e2f0e00e4570713c731}{flags}} \& \mbox{\hyperlink{ng__btsocket__l2cap_8h_afa653c3f8cc74066f366ceaaabb11cde}{NG\_BTSOCKET\_L2CAP\_RAW\_PRIVILEGED}})}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01135}01135                         error = \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_abc2e0da44f30ca9fab14356004ab1f2c}{ng\_btsocket\_l2cap\_raw\_send\_ngmsg}}(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01136}01136                                         \mbox{\hyperlink{ng__l2cap_8h_acb4b2d55b2e9caf169aac1899db5685c}{NGM\_L2CAP\_NODE\_SET\_AUTO\_DISCON\_TIMO}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01137}01137                                         \&p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__auto__discon__timo_ac24a98ab81e61633c053f4b174d57c6e}{timeout}}, \textcolor{keyword}{sizeof}(p-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__auto__discon__timo_ac24a98ab81e61633c053f4b174d57c6e}{timeout}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01138}01138                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01139}01139                         error = EPERM;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01140}01140                 \} \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01141}01141 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01142}01142         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01143}01143                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01144}01144                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01145}01145         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01146}01146 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01147}01147         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01148}01148 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01149}01149         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01150}01150 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_control */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01151}01151 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01152}01152 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01153}01153 \textcolor{comment}{ * Detach and destroy socket}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01154}01154 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01155}01155 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01156}01156 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01157}\mbox{\hyperlink{ng__btsocket__l2cap_8h_aea75adb1cc096799e74679ce9f446a36}{01157}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a1c068e84a56c121010fad9f19843f66c}{ng\_btsocket\_l2cap\_raw\_detach}}(\textcolor{keyword}{struct} socket *so)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01158}01158 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01159}01159         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}  pcb = \mbox{\hyperlink{ng__btsocket__l2cap_8h_a5394c4fe7ccfdb1b406008b4408fe592}{so2l2cap\_raw\_pcb}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01160}01160 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01161}01161         KASSERT(pcb != NULL, (\textcolor{stringliteral}{"{}nt\_btsocket\_l2cap\_raw\_detach: pcb == NULL"{}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01162}01162         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} == NULL) }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01163}01163                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01164}01164 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01165}01165         mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01166}01166         mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01167}01167 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01168}01168         LIST\_REMOVE(pcb, next);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01169}01169 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01170}01170         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01171}01171         mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_sockets\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01172}01172 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01173}01173         mtx\_destroy(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01174}01174 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01175}01175         bzero(pcb, \textcolor{keyword}{sizeof}(*pcb));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01176}01176         free(pcb, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a5ef0ba0b0e6063f505b943580e86d510}{M\_NETGRAPH\_BTSOCKET\_L2CAP\_RAW}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01177}01177 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01178}01178         so-\/>so\_pcb = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01179}01179 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_detach */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01180}01180 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01181}01181 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01182}01182 \textcolor{comment}{ * Disconnect socket}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01183}01183 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01184}01184 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01185}01185 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01186}\mbox{\hyperlink{ng__btsocket__l2cap_8h_aba56c4c0cdd0cb2d3a8a8671a60f1bc1}{01186}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a16a521938ef4258c2c35cf26b1bbfb36}{ng\_btsocket\_l2cap\_raw\_disconnect}}(\textcolor{keyword}{struct} socket *so)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01187}01187 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01188}01188         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}  pcb = \mbox{\hyperlink{ng__btsocket__l2cap_8h_a5394c4fe7ccfdb1b406008b4408fe592}{so2l2cap\_raw\_pcb}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01189}01189 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01190}01190         \textcolor{keywordflow}{if} (pcb == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01191}01191                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01192}01192         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01193}01193                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01194}01194 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01195}01195         mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01196}01196         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01197}01197         soisdisconnected(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01198}01198         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01199}01199 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01200}01200         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01201}01201 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_disconnect */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01202}01202 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01203}01203 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01204}01204 \textcolor{comment}{ * Get peer address}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01205}01205 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01206}01206 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01207}01207 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01208}\mbox{\hyperlink{ng__btsocket__l2cap_8h_a4a1c5ceba5b105d1c7e876d24aad899b}{01208}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_afe442e5a1af5d9bffd2b33060c8dd7da}{ng\_btsocket\_l2cap\_raw\_peeraddr}}(\textcolor{keyword}{struct} socket *so, \textcolor{keyword}{struct} sockaddr **nam)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01209}01209 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01210}01210         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}  pcb = \mbox{\hyperlink{ng__btsocket__l2cap_8h_a5394c4fe7ccfdb1b406008b4408fe592}{so2l2cap\_raw\_pcb}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01211}01211         \textcolor{keyword}{struct }\mbox{\hyperlink{structsockaddr__l2cap}{sockaddr\_l2cap}}             sa;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01212}01212 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01213}01213         \textcolor{keywordflow}{if} (pcb == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01214}01214                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01215}01215         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} == NULL) }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01216}01216                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01217}01217 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01218}01218         mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01219}01219         bcopy(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_ae2209c77cf796c521638fdc1dacd2503}{dst}}, \&sa.\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}, \textcolor{keyword}{sizeof}(sa.\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01220}01220         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01221}01221 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01222}01222         sa.\mbox{\hyperlink{structsockaddr__l2cap_a4b54ce6ea97267b165f6d03296017a45}{l2cap\_psm}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01223}01223         sa.\mbox{\hyperlink{structsockaddr__l2cap_a2873ac0f21c26fbe6ec34259c5006ba0}{l2cap\_len}} = \textcolor{keyword}{sizeof}(sa);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01224}01224         sa.\mbox{\hyperlink{structsockaddr__l2cap_ab83019b07d4bc193848ecbab48a37d74}{l2cap\_family}} = AF\_BLUETOOTH;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01225}01225         sa.\mbox{\hyperlink{structsockaddr__l2cap_a38c4767bfc057e400a77b8de2b1df741}{l2cap\_cid}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01226}01226         sa.\mbox{\hyperlink{structsockaddr__l2cap_a398183a3a841fa5ec842bb5c36a190a1}{l2cap\_bdaddr\_type}} = \mbox{\hyperlink{ng__bluetooth_8h_a84acdd31fe3b4424a3499bdfcd0c5856}{BDADDR\_BREDR}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01227}01227 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01228}01228         *nam = sodupsockaddr((\textcolor{keyword}{struct} sockaddr *) \&sa, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01229}01229 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01230}01230         \textcolor{keywordflow}{return} ((*nam == NULL)? ENOMEM : 0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01231}01231 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_peeraddr */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01232}01232 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01233}01233 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01234}01234 \textcolor{comment}{ * Send data to socket}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01235}01235 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01236}01236 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01237}01237 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01238}\mbox{\hyperlink{ng__btsocket__l2cap_8h_a3b2a7716a45fbad2d5f6e8235bd037f3}{01238}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a9abd3319eb9dcbff6e41cc45bdf54340}{ng\_btsocket\_l2cap\_raw\_send}}(\textcolor{keyword}{struct} socket *so, \textcolor{keywordtype}{int} \mbox{\hyperlink{netflow_8h_aa2585d779da0ab21273a8d92de9a0ebe}{flags}}, \textcolor{keyword}{struct} mbuf *m,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01239}01239                 \textcolor{keyword}{struct} sockaddr *nam, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ad817e591b4b470ae7791851e6d78896a}{control}}, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01240}01240 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01241}01241         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m); \textcolor{comment}{/* Checks for m != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01242}01242         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__btsocket__rfcomm_8h_ad817e591b4b470ae7791851e6d78896a}{control}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01243}01243 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01244}01244         \textcolor{keywordflow}{return} (EOPNOTSUPP);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01245}01245 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_send */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01246}01246 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01247}01247 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01248}01248 \textcolor{comment}{ * Get socket address}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01249}01249 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01250}01250 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01251}01251 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01252}\mbox{\hyperlink{ng__btsocket__l2cap_8h_a00e1586a7f90e6e244d7d0200fa9a679}{01252}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a4d76fb07eb4fd436f14b000d5c226f97}{ng\_btsocket\_l2cap\_raw\_sockaddr}}(\textcolor{keyword}{struct} socket *so, \textcolor{keyword}{struct} sockaddr **nam)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01253}01253 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01254}01254         \mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}}  pcb = \mbox{\hyperlink{ng__btsocket__l2cap_8h_a5394c4fe7ccfdb1b406008b4408fe592}{so2l2cap\_raw\_pcb}}(so);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01255}01255         \textcolor{keyword}{struct }\mbox{\hyperlink{structsockaddr__l2cap}{sockaddr\_l2cap}}             sa;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01256}01256 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01257}01257         \textcolor{keywordflow}{if} (pcb == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01258}01258                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01259}01259         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}} == NULL) }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01260}01260                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01261}01261 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01262}01262         mtx\_lock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01263}01263         bcopy(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a10b267cae9dae892642c306b2616b0fd}{src}}, \&sa.\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}, \textcolor{keyword}{sizeof}(sa.\mbox{\hyperlink{structsockaddr__l2cap_a62f797ac0225bfd8fcf54729775561cb}{l2cap\_bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01264}01264         mtx\_unlock(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01265}01265 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01266}01266         sa.\mbox{\hyperlink{structsockaddr__l2cap_a4b54ce6ea97267b165f6d03296017a45}{l2cap\_psm}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01267}01267         sa.\mbox{\hyperlink{structsockaddr__l2cap_a2873ac0f21c26fbe6ec34259c5006ba0}{l2cap\_len}} = \textcolor{keyword}{sizeof}(sa);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01268}01268         sa.\mbox{\hyperlink{structsockaddr__l2cap_ab83019b07d4bc193848ecbab48a37d74}{l2cap\_family}} = AF\_BLUETOOTH;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01269}01269         sa.\mbox{\hyperlink{structsockaddr__l2cap_a38c4767bfc057e400a77b8de2b1df741}{l2cap\_cid}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01270}01270         sa.\mbox{\hyperlink{structsockaddr__l2cap_a398183a3a841fa5ec842bb5c36a190a1}{l2cap\_bdaddr\_type}} = \mbox{\hyperlink{ng__bluetooth_8h_a84acdd31fe3b4424a3499bdfcd0c5856}{BDADDR\_BREDR}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01271}01271         *nam = sodupsockaddr((\textcolor{keyword}{struct} sockaddr *) \&sa, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01272}01272 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01273}01273         \textcolor{keywordflow}{return} ((*nam == NULL)? ENOMEM : 0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01274}01274 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_sockaddr */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01275}01275 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01276}01276 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01277}01277 \textcolor{comment}{ * Get next token}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01278}01278 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01279}01279 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01280}01280 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01281}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aea36fc477539263576c377abde42b8c7}{01281}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aea36fc477539263576c377abde42b8c7}{ng\_btsocket\_l2cap\_raw\_get\_token}}(u\_int32\_t *token)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01282}01282 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01283}01283         mtx\_lock(\&ng\_btsocket\_l2cap\_raw\_token\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01284}01284   }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01285}01285         \textcolor{keywordflow}{if} (++ ng\_btsocket\_l2cap\_raw\_token == 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01286}01286                 ng\_btsocket\_l2cap\_raw\_token = 1;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01287}01287 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01288}01288         *token = ng\_btsocket\_l2cap\_raw\_token;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01289}01289 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01290}01290         mtx\_unlock(\&ng\_btsocket\_l2cap\_raw\_token\_mtx);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01291}01291 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_get\_token */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01292}01292 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01293}01293 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01294}01294 \textcolor{comment}{ * Send Netgraph message to the node -\/ do not expect reply}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01295}01295 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01296}01296 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01297}01297 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01298}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_abc2e0da44f30ca9fab14356004ab1f2c}{01298}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_abc2e0da44f30ca9fab14356004ab1f2c}{ng\_btsocket\_l2cap\_raw\_send\_ngmsg}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}, \textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} arglen)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01299}01299 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01300}01300         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}}   *msg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01301}01301         \textcolor{keywordtype}{int}              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01302}01302 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01303}01303         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__l2cap_8h_a7e452e3322a39653affa38cdea2c761a}{NGM\_L2CAP\_COOKIE}}, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}, arglen, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01304}01304         \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01305}01305                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01306}01306 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01307}01307         \textcolor{keywordflow}{if} (arg != NULL \&\& arglen > 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01308}01308                 bcopy(arg, msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}, arglen);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01309}01309 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01310}01310         \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(error, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}}, msg, hook, 0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01311}01311 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01312}01312         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01313}01313 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_send\_ngmsg */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01314}01314 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01315}01315 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01316}01316 \textcolor{comment}{ * Send Netgraph message to the node (no data) and wait for reply}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01317}01317 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01318}01318 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01319}01319 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01320}\mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0ae88f29aa40f143ce76c0707e4d8f10}{01320}} \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a0ae88f29aa40f143ce76c0707e4d8f10}{ng\_btsocket\_l2cap\_raw\_send\_sync\_ngmsg}}(\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb}{ng\_btsocket\_l2cap\_raw\_pcb\_p}} pcb,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01321}01321                 \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}, \textcolor{keywordtype}{void} *rsp, \textcolor{keywordtype}{int} rsplen)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01322}01322 \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01323}01323         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}}   *msg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01324}01324         \textcolor{keywordtype}{int}              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01325}01325 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01326}01326         mtx\_assert(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01327}01327 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01328}01328         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__l2cap_8h_a7e452e3322a39653affa38cdea2c761a}{NGM\_L2CAP\_COOKIE}}, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}, 0, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01329}01329         \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01330}01330                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01331}01331 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01332}01332         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_aea36fc477539263576c377abde42b8c7}{ng\_btsocket\_l2cap\_raw\_get\_token}}(\&msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}});}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01333}01333         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_aad8fce296b9145aca0485d0fcb080627}{token}};}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01334}01334         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01335}01335 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01336}01336         \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(error, \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a63172140cf050e20bebf4c5e89d990f6}{ng\_btsocket\_l2cap\_raw\_node}}, msg,}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01337}01337                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a09363b25753b65dec7161d9068300e22}{rt}}-\/>\mbox{\hyperlink{structng__btsocket__l2cap__rtentry_a383377bd8995aec5f652ec12553c1050}{hook}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01338}01338         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01339}01339                 pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01340}01340                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01341}01341         \}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01342}01342 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01343}01343         error = msleep(\&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}}, \&pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a1a98b964393b5154041a5166f3709219}{pcb\_mtx}}, PZERO|PCATCH, \textcolor{stringliteral}{"{}l2ctl"{}},}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01344}01344                         \mbox{\hyperlink{ng__btsocket__l2cap__raw_8c_a2196aeead72b538141ba6b1afbb0345f}{ng\_btsocket\_l2cap\_raw\_ioctl\_timeout}} * hz);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01345}01345         pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_a66fdd727caff9e2b1d43d489ad4826d5}{token}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01346}01346 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01347}01347         \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01348}01348                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01349}01349 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01350}01350         \textcolor{keywordflow}{if} (pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}} != NULL \&\& pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}}-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}} == \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}})}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01351}01351                 bcopy(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}}-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}, rsp, rsplen);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01352}01352         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01353}01353                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01354}01354 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01355}01355         \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(pcb-\/>\mbox{\hyperlink{structng__btsocket__l2cap__raw__pcb_adb530528a896abe38a579fe5daa77b16}{msg}}); \textcolor{comment}{/* checks for != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01356}01356 }
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01357}01357         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__btsocket__l2cap__raw_8c_source_l01358}01358 \} \textcolor{comment}{/* ng\_btsocket\_l2cap\_raw\_send\_sync\_ngmsg */}}

\end{DoxyCode}
