1878ed226SJulian Elischer.\" Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 2878ed226SJulian Elischer.\" All rights reserved. 3878ed226SJulian Elischer.\" 4878ed226SJulian Elischer.\" Redistribution and use in source and binary forms, with or without 5878ed226SJulian Elischer.\" modification, are permitted provided that the following conditions 6878ed226SJulian Elischer.\" are met: 7878ed226SJulian Elischer.\" 1. Redistributions of source code must retain the above copyright 8878ed226SJulian Elischer.\" notice, this list of conditions and the following disclaimer. 9878ed226SJulian Elischer.\" 2. Redistributions in binary form must reproduce the above copyright 10878ed226SJulian Elischer.\" notice, this list of conditions and the following disclaimer in the 11878ed226SJulian Elischer.\" documentation and/or other materials provided with the distribution. 12878ed226SJulian Elischer.\" 13878ed226SJulian Elischer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14878ed226SJulian Elischer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15878ed226SJulian Elischer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16878ed226SJulian Elischer.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17878ed226SJulian Elischer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18878ed226SJulian Elischer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19878ed226SJulian Elischer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20878ed226SJulian Elischer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21878ed226SJulian Elischer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22878ed226SJulian Elischer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23878ed226SJulian Elischer.\" SUCH DAMAGE. 24878ed226SJulian Elischer.\" 250986ab12SMaksim Yevmenkin.\" $Id: ng_l2cap.4,v 1.4 2003/09/14 23:37:52 max Exp $ 26878ed226SJulian Elischer.\" $FreeBSD$ 2772f00208SRuslan Ermilov.\" 28878ed226SJulian Elischer.Dd July 4, 2002 29878ed226SJulian Elischer.Dt NG_L2CAP 4 30878ed226SJulian Elischer.Os 31878ed226SJulian Elischer.Sh NAME 3272f00208SRuslan Ermilov.Nm ng_l2cap 33878ed226SJulian Elischer.Nd Netgraph node type that implements Bluetooth Logical Link Control and 34878ed226SJulian ElischerAdaptation Protocol (L2CAP) 35878ed226SJulian Elischer.Sh SYNOPSIS 36878ed226SJulian Elischer.In sys/types.h 373a08bb88SMaksim Yevmenkin.In netgraph/bluetooth/include/ng_hci.h 383a08bb88SMaksim Yevmenkin.In netgraph/bluetooth/include/ng_l2cap.h 39878ed226SJulian Elischer.Sh DESCRIPTION 40878ed226SJulian ElischerThe 4172f00208SRuslan Ermilov.Nm l2cap 42878ed226SJulian Elischernode type is a Netgraph node type that implements Bluetooth Logical Link 43878ed226SJulian ElischerControl and Adaptation Protocol as per chapter D of the Bluetooth Specification 44878ed226SJulian ElischerBook v1.1. 45878ed226SJulian Elischer.Pp 46878ed226SJulian ElischerL2CAP provides connection-oriented and connectionless data services to upper 47878ed226SJulian Elischerlayer protocols with protocol multiplexing capability, segmentation and 4872f00208SRuslan Ermilovreassembly operation, and group abstractions. 4972f00208SRuslan ErmilovL2CAP permits higher level 50878ed226SJulian Elischerprotocols and applications to transmit and receive L2CAP data packets up to 51878ed226SJulian Elischer64 kilobytes in length. 5272f00208SRuslan Ermilov.Ss L2CAP Assumptions 53878ed226SJulian Elischer.Bl -enum -offset indent 54878ed226SJulian Elischer.It 5572f00208SRuslan ErmilovThe ACL link between two units is set up. 5672f00208SRuslan ErmilovThe Baseband provides orderly 57878ed226SJulian Elischerdelivery of data packets, although there might be individual packet corruption 5872f00208SRuslan Ermilovand duplicates. 590986ab12SMaksim YevmenkinNo more than one ACL link exists between any two devices. 60878ed226SJulian Elischer.It 61878ed226SJulian ElischerThe Baseband always provides the impression of full-duplex communication 6272f00208SRuslan Ermilovchannels. 6372f00208SRuslan ErmilovThis does not imply that all L2CAP communications are bi-directional. 64878ed226SJulian ElischerMulticasts and unidirectional traffic (e.g., video) do not require duplex 65878ed226SJulian Elischerchannels. 66878ed226SJulian Elischer.It 67878ed226SJulian ElischerL2CAP provides a reliable channel using the mechanisms available at the 6872f00208SRuslan ErmilovBaseband layer. 6972f00208SRuslan ErmilovThe Baseband always performs data integrity checks when 70878ed226SJulian Elischerrequested and resends data until it has been successfully acknowledged or 7172f00208SRuslan Ermilova timeout occurs. 72b5e7e999SRuslan ErmilovAs acknowledgements may be lost, timeouts may 73878ed226SJulian Elischeroccur even after the data has been successfully sent. 74878ed226SJulian Elischer.El 75878ed226SJulian Elischer.Sh L2CAP GENERAL OPERATION 76878ed226SJulian ElischerThe Logical Link Control and Adaptation Protocol (L2CAP) is based around the 77878ed226SJulian Elischerconcept of 7872f00208SRuslan Ermilov.Dq channels . 7972f00208SRuslan ErmilovEach channel is bound to a single protocol in a many-to-one fashion. 8072f00208SRuslan ErmilovMultiple 81878ed226SJulian Elischerchannels can be bound to the same protocol, but a channel cannot be bound to 8272f00208SRuslan Ermilovmultiple protocols. 8372f00208SRuslan ErmilovEach L2CAP packet received on a channel is directed to 84878ed226SJulian Elischerthe appropriate higher level protocol. 85878ed226SJulian Elischer.Pp 86878ed226SJulian ElischerEach one of the end-points of an L2CAP channel is referred to by a channel 8772f00208SRuslan Ermilovidentifier. 8872f00208SRuslan ErmilovChannel identifiers (CIDs) are local names representing a logical 8972f00208SRuslan Ermilovchannel end-point on the device. 9072f00208SRuslan ErmilovIdentifiers from 0x0001 to 0x003F are reserved 9172f00208SRuslan Ermilovfor specific L2CAP functions. 9272f00208SRuslan ErmilovThe null identifier (0x0000) is defined as an 93878ed226SJulian Elischerillegal identifier and must never be used as a destination end-point. 9472f00208SRuslan ErmilovAll L2CAP signalling commands are sent to CID 0x0001. 9572f00208SRuslan ErmilovCID 0x0002 is reserved for group-oriented channel. 9672f00208SRuslan ErmilovThe same CID must not be reused as a local L2CAP 97878ed226SJulian Elischerchannel endpoint for multiple simultaneous L2CAP channels between a local 98878ed226SJulian Elischerdevice and some remote device. 99878ed226SJulian Elischer.Pp 100878ed226SJulian ElischerCID assignment is relative to a particular device and a device can assign CIDs 10172f00208SRuslan Ermilovindependently from other devices. 10272f00208SRuslan ErmilovThus, even if the same CID value has been 103878ed226SJulian Elischerassigned to (remote) channel endpoints by several remote devices connected 104878ed226SJulian Elischerto a single local device, the local device can still uniquely associate each 105878ed226SJulian Elischerremote CID with a different device. 10672f00208SRuslan Ermilov.Ss Channel Operational States 10772f00208SRuslan Ermilov.Bl -tag -width indent 108878ed226SJulian Elischer.It Dv NG_L2CAP_CLOSED 10972f00208SRuslan ErmilovIn this state, there is no channel associated with this CID. 11072f00208SRuslan ErmilovThis is the only 11172f00208SRuslan Ermilovstate when a link level connection (Baseband) may not exist. 11272f00208SRuslan ErmilovLink disconnection 11372f00208SRuslan Ermilovforces all other states into the 11472f00208SRuslan Ermilov.Dv NG_L2CAP_CLOSED 11572f00208SRuslan Ermilovstate. 116878ed226SJulian Elischer.It Dv NG_L2CAP_W4_L2CAP_CON_RSP 117878ed226SJulian ElischerIn this state, the CID represents a local end-point and an L2CAP Connect 118878ed226SJulian ElischerRequest message has been sent referencing this endpoint and it is now waiting 119878ed226SJulian Elischerfor the corresponding L2CAP Connect Response message. 120878ed226SJulian Elischer.It Dv NG_L2CAP_W4_L2CA_CON_RSP 121878ed226SJulian ElischerIn this state, the remote end-point exists and an L2CAP Connect Request has 12272f00208SRuslan Ermilovbeen received by the local L2CAP entity. 12372f00208SRuslan ErmilovAn L2CA Connect Indication has been 124878ed226SJulian Elischersent to the upper layer and the part of the local L2CAP entity processing the 12572f00208SRuslan Ermilovreceived L2CAP Connect Request waits for the corresponding response. 12672f00208SRuslan ErmilovThe response may require a security check to be performed. 127878ed226SJulian Elischer.It Dv NG_L2CAP_CONFIG 128878ed226SJulian ElischerIn this state, the connection has been established but both sides are still 12972f00208SRuslan Ermilovnegotiating the channel parameters. 13072f00208SRuslan ErmilovThe Configuration state may also be 13172f00208SRuslan Ermiloventered when the channel parameters are being renegotiated. 13272f00208SRuslan ErmilovPrior to entering the 13372f00208SRuslan Ermilov.Dv NG_L2CAP_CONFIG 13472f00208SRuslan Ermilovstate, all outgoing data traffic is suspended since 13572f00208SRuslan Ermilovthe traffic parameters of the data traffic are to be renegotiated. 13672f00208SRuslan ErmilovIncoming 137878ed226SJulian Elischerdata traffic is accepted until the remote channel endpoint has entered 13872f00208SRuslan Ermilovthe 13972f00208SRuslan Ermilov.Dv NG_L2CAP_CONFIG 14072f00208SRuslan Ermilovstate. 14172f00208SRuslan ErmilovIn the 14272f00208SRuslan Ermilov.Dv NG_L2CAP_CONFIG 14372f00208SRuslan Ermilovstate, both sides will issue 144878ed226SJulian ElischerL2CAP Configuration Request messages if only defaults are being used, a null 14572f00208SRuslan Ermilovmessage will be sent. 14672f00208SRuslan ErmilovIf a large amount of parameters need to be negotiated, 147878ed226SJulian Elischermultiple messages will be sent to avoid any MTU limitations and negotiate 14872f00208SRuslan Ermilovincrementally. 14972f00208SRuslan ErmilovMoving from the 15072f00208SRuslan Ermilov.Dv NG_L2CAP_CONFIG 15172f00208SRuslan Ermilovstate to the 15272f00208SRuslan Ermilov.Dv NG_L2CAP_OPEN 15372f00208SRuslan Ermilovstate requires both sides to be ready. 15472f00208SRuslan ErmilovAn L2CAP entity is ready when it has received 155878ed226SJulian Elischera positive response to its final request and it has positively responded to 156878ed226SJulian Elischerthe final request from the remote device. 157878ed226SJulian Elischer.It Dv NG_L2CAP_OPEN 158878ed226SJulian ElischerIn this state, the connection has been established and configured, and data 159878ed226SJulian Elischerflow may proceed. 160878ed226SJulian Elischer.It Dv NG_L2CAP_W4_L2CAP_DISCON_RSP 161878ed226SJulian ElischerIn this state, the connection is shutting down and an L2CAP Disconnect Request 16272f00208SRuslan Ermilovmessage has been sent. 16372f00208SRuslan ErmilovThis state is now waiting for the corresponding response. 164878ed226SJulian Elischer.It Dv NG_L2CAP_W4_L2CA_DISCON_RSP 165878ed226SJulian ElischerIn this state, the connection on the remote endpoint is shutting down and an 16672f00208SRuslan ErmilovL2CAP Disconnect Request message has been received. 16772f00208SRuslan ErmilovAn L2CA Disconnect 168878ed226SJulian ElischerIndication has been sent to the upper layer to notify the owner of the CID 16972f00208SRuslan Ermilovthat the remote endpoint is being closed. 17072f00208SRuslan ErmilovThis state is now waiting for the 171878ed226SJulian Elischercorresponding response from the upper layer before responding to the remote 172878ed226SJulian Elischerendpoint. 173878ed226SJulian Elischer.El 174878ed226SJulian Elischer.Ss Protocol Multiplexing 175878ed226SJulian ElischerL2CAP supports protocol multiplexing because the Baseband Protocol does not 176878ed226SJulian Elischersupport any 177878ed226SJulian Elischer.Dq type 178878ed226SJulian Elischerfield identifying the higher layer protocol being multiplexed above it. 179878ed226SJulian ElischerL2CAP is able to distinguish between upper layer protocols such as the Service 180878ed226SJulian ElischerDiscovery Protocol, RFCOMM and Telephony Control. 181878ed226SJulian Elischer.Ss Segmentation and Reassembly 18272f00208SRuslan ErmilovThe data packets defined by the Baseband Protocol are limited in size. 18372f00208SRuslan ErmilovLarge 184878ed226SJulian ElischerL2CAP packets must be segmented into multiple smaller Baseband packets prior 18572f00208SRuslan Ermilovto their transmission over the air. 18672f00208SRuslan ErmilovSimilarly, multiple received Baseband 187878ed226SJulian Elischerpackets may be reassembled into a single larger L2CAP packet. 188878ed226SJulian Elischer.Ss Quality of Service 189878ed226SJulian ElischerThe L2CAP connection establishment process allows the exchange of information 190878ed226SJulian Elischerregarding the quality of service (QoS) expected between two Bluetooth units. 191878ed226SJulian Elischer.Ss Groups 192878ed226SJulian ElischerThe Baseband Protocol supports the concept of a piconet, a group of devices 19372f00208SRuslan Ermilovsynchronously hopping together using the same clock. 19472f00208SRuslan ErmilovThe L2CAP group 195878ed226SJulian Elischerabstraction permits implementations to efficiently map protocol groups on to 196878ed226SJulian Elischerpiconets. 197878ed226SJulian Elischer.Pp 198878ed226SJulian ElischerThe following features are outside the scope of L2CAP responsibilities: 199878ed226SJulian Elischer.Bl -dash -offset indent 200878ed226SJulian Elischer.It 201878ed226SJulian ElischerL2CAP does not transport audio designated for SCO links. 202878ed226SJulian Elischer.It 203878ed226SJulian ElischerL2CAP does not enforce a reliable channel or ensure data integrity, 204878ed226SJulian Elischerthat is, L2CAP performs no retransmissions or checksum calculations. 205878ed226SJulian Elischer.It 206878ed226SJulian ElischerL2CAP does not support a reliable multicast channel. 207878ed226SJulian Elischer.It 208878ed226SJulian ElischerL2CAP does not support the concept of a global group name. 209878ed226SJulian Elischer.El 210878ed226SJulian Elischer.Sh HOOKS 211878ed226SJulian ElischerThis node type supports the following hooks: 212878ed226SJulian Elischer.Pp 21372f00208SRuslan Ermilov.Bl -tag -width indent 214878ed226SJulian Elischer.It Dv hci 215878ed226SJulian ElischerBluetooth Host Controller Interface downstream hook. 216878ed226SJulian Elischer.It Dv l2c 21772f00208SRuslan ErmilovUpper layer protocol upstream hook. 21872f00208SRuslan ErmilovUsually the Bluetooth L2CAP socket layer is connected to the hook. 219878ed226SJulian Elischer.It Dv ctl 22072f00208SRuslan ErmilovControl hook. 2210986ab12SMaksim YevmenkinUsually the Bluetooth raw L2CAP sockets layer is connected to the hook. 222878ed226SJulian Elischer.El 223878ed226SJulian Elischer.Sh INTERFACE TO THE UPPER LAYER PROTOCOLS (L2CA CONTROL MESSAGES) 224878ed226SJulian ElischerBluetooth specification says that L2CA request must block until response 22572f00208SRuslan Ermilovis ready. 22672f00208SRuslan ErmilovL2CAP node uses 22772f00208SRuslan Ermilov.Va token 22872f00208SRuslan Ermilovfield from Netgraph message header to match L2CA request and response. 22972f00208SRuslan ErmilovThe upper layer protocol must populate 23072f00208SRuslan Ermilov.Va token . 23172f00208SRuslan ErmilovL2CAP node will queue request and start processing. 23272f00208SRuslan ErmilovLater, when response is 233c48524c2SMike Pritchardready or timeout has occurred, L2CAP node will create new Netgraph message, set 23472f00208SRuslan Ermilov.Va token 235878ed226SJulian Elischerand 236878ed226SJulian Elischer.Dv NFG_RESP 23772f00208SRuslan Ermilovflag and send message to the upper layer. 23872f00208SRuslan ErmilovNote that L2CA indication messages 239878ed226SJulian Elischerwill not populate 24072f00208SRuslan Ermilov.Va token 241878ed226SJulian Elischerand will not set 242878ed226SJulian Elischer.Dv NGF_RESP 24372f00208SRuslan Ermilovflag. 24472f00208SRuslan ErmilovThere is no reason for this, because they are just notifications and do 245878ed226SJulian Elischernot require acknowledgment. 24672f00208SRuslan Ermilov.Bl -tag -width indent 247878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CON 248878ed226SJulian ElischerRequests the creation of a channel representing a logical connection to a 24972f00208SRuslan Ermilovphysical address. 25072f00208SRuslan ErmilovInput parameters are the target protocol (PSM) and remote 25172f00208SRuslan Ermilovdevice's 48-bit address (BD_ADDR). 25272f00208SRuslan ErmilovOutput parameters are the local CID (LCID) 25372f00208SRuslan Ermilovallocated by the local L2CAP entity, and Result of the request. 25472f00208SRuslan ErmilovIf Result 255878ed226SJulian Elischerindicates a pending notification, the Status value may contain more information 256878ed226SJulian Elischerof what processing is delaying the establishment of the connection. 257878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CON_IND 258878ed226SJulian ElischerThis message includes the parameters for the address of the remote device that 259878ed226SJulian Elischerissued the connection request, the local CID representing the channel being 260878ed226SJulian Elischerrequested, the Identifier contained in the request, and the PSM value the 261878ed226SJulian Elischerrequest is targeting. 262878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CON_RSP 26372f00208SRuslan ErmilovIssues a response to a connection request event indication. 26472f00208SRuslan ErmilovInput parameters 265878ed226SJulian Elischerare the remote device's 48-bit address, Identifier sent in the request, local 26672f00208SRuslan ErmilovCID, the Response code, and the Status attached to the Response code. 26772f00208SRuslan ErmilovThe output parameter is the Result of the service request. 26872f00208SRuslan ErmilovThis primitive must be 269878ed226SJulian Elischercalled no more than once after receiving the indication. 270878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CFG 271878ed226SJulian ElischerRequests the initial configuration (or reconfiguration) of a channel to a new 27272f00208SRuslan Ermilovset of channel parameters. 27372f00208SRuslan ErmilovInput parameters are the local CID endpoint, new 274878ed226SJulian Elischerincoming receivable MTU (InMTU), new outgoing flow spec-ification, and flush 27572f00208SRuslan Ermilovand link timeouts. 27672f00208SRuslan ErmilovOutput parameters are the Result, accepted incoming MTU 277878ed226SJulian Elischer(InMTU), the remote side's flow requests, and flush and link timeouts. 278878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CFG_IND 279878ed226SJulian ElischerThis message includes the parameters indicating the local CID of the channel 280878ed226SJulian Elischerthe request has been sent to, the outgoing MTU size (maximum packet that can 281878ed226SJulian Elischerbe sent across the channel) and the flowspec describing the characteristics of 28272f00208SRuslan Ermilovthe incoming data. 28372f00208SRuslan ErmilovAll other channel parameters are set to their default values 28472f00208SRuslan Ermilovif not provided by the remote device. 285878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CFG_RSP 28672f00208SRuslan ErmilovIssues a response to a configuration request event indication. 28772f00208SRuslan ErmilovInput parameters 288878ed226SJulian Elischerinclude the local CID of the endpoint being configured, outgoing transmit MTU 289878ed226SJulian Elischer(which may be equal or less to the OutMTU parameter in the configuration 29072f00208SRuslan Ermilovindication event) and the accepted flowspec for incoming traffic. 29172f00208SRuslan ErmilovThe output parameter is the Result value. 292878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_QOS_IND 293878ed226SJulian ElischerThis message includes the parameter indicating the address of the remote 294878ed226SJulian ElischerBluetooth device where the QoS contract has been violated. 295878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_DISCON 29672f00208SRuslan ErmilovRequests the disconnection of the channel. 29772f00208SRuslan ErmilovInput parameter is the CID representing the local channel endpoint. 29872f00208SRuslan ErmilovOutput parameter is Result. 29972f00208SRuslan ErmilovResult 30072f00208SRuslan Ermilovis zero if an L2CAP Disconnect Response is received, otherwise a non-zero value 30172f00208SRuslan Ermilovis returned. 30272f00208SRuslan ErmilovOnce disconnection has been requested, no process will be able to 303878ed226SJulian Elischersuccessfully read or write from the CID. 304878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_DISCON_IND 305878ed226SJulian ElischerThis message includes the parameter indicating the local CID the request has 306878ed226SJulian Elischerbeen sent to. 307878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_WRITE 30872f00208SRuslan ErmilovResponse to transfer of data request. 30972f00208SRuslan ErmilovActual data must be received from 310878ed226SJulian Elischerappropriate upstream hook and must be prepended with header defined as follows. 311878ed226SJulian Elischer.Bd -literal -offset indent 312878ed226SJulian Elischer/* L2CA data packet header */ 313878ed226SJulian Elischertypedef struct { 314878ed226SJulian Elischer u_int32_t token; /* token to use in L2CAP_L2CA_WRITE */ 315878ed226SJulian Elischer u_int16_t length; /* length of the data */ 316878ed226SJulian Elischer u_int16_t lcid; /* local channel ID */ 317878ed226SJulian Elischer} __attribute__ ((packed)) ng_l2cap_l2ca_hdr_t; 318878ed226SJulian Elischer.Ed 319878ed226SJulian Elischer.Pp 320878ed226SJulian ElischerThe output parameters are Result and Length of data written. 321878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_CREATE 322878ed226SJulian ElischerRequests the creation of a CID to represent a logical connection to multiple 32372f00208SRuslan Ermilovdevices. 32472f00208SRuslan ErmilovInput parameter is the PSM value that the outgoing connectionless 32572f00208SRuslan Ermilovtraffic is labelled with, and the filter used for incoming traffic. 32672f00208SRuslan ErmilovOutput parameter is the CID representing the local endpoint. 32772f00208SRuslan ErmilovOn creation, the group 328878ed226SJulian Elischeris empty but incoming traffic destined for the PSM value is readable. 32972f00208SRuslan Ermilov.Bf -emphasis 33072f00208SRuslan ErmilovThis request has not been implemented. 33172f00208SRuslan Ermilov.Ef 332878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_CLOSE 333878ed226SJulian ElischerThe use of this message closes down a Group. 33472f00208SRuslan Ermilov.Bf -emphasis 33572f00208SRuslan ErmilovThis request has not been implemented. 33672f00208SRuslan Ermilov.Ef 337878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_ADD_MEMBER 33872f00208SRuslan ErmilovRequests the addition of a member to a group. 33972f00208SRuslan ErmilovThe input parameter includes the 340878ed226SJulian ElischerCID representing the group and the BD_ADDR of the group member to be added. 341878ed226SJulian ElischerThe output parameter Result confirms the success or failure of the request. 34272f00208SRuslan Ermilov.Bf -emphasis 34372f00208SRuslan ErmilovThis request has not been implemented. 34472f00208SRuslan Ermilov.Ef 345878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_REM_MEMBER 34672f00208SRuslan ErmilovRequests the removal of a member from a group. 34772f00208SRuslan ErmilovThe input parameters include 348878ed226SJulian Elischerthe CID representing the group and BD_ADDR of the group member to be removed. 349878ed226SJulian ElischerThe output parameter Result confirms the success or failure of the request. 35072f00208SRuslan Ermilov.Bf -emphasis 35172f00208SRuslan ErmilovThis request has not been implemented. 35272f00208SRuslan Ermilov.Ef 353878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_MEMBERSHIP 35472f00208SRuslan ErmilovRequests a report of the members of a group. 35572f00208SRuslan ErmilovThe input parameter CID represents the group being queried. 35672f00208SRuslan ErmilovThe output parameter Result confirms the success or 35772f00208SRuslan Ermilovfailure of the operation. 35872f00208SRuslan ErmilovIf the Result is successful, BD_ADDR_Lst is a list 359878ed226SJulian Elischerof the Bluetooth addresses of the N members of the group. 36072f00208SRuslan Ermilov.Bf -emphasis 36172f00208SRuslan ErmilovThis request has not been implemented. 36272f00208SRuslan Ermilov.Ef 363878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_PING 36472f00208SRuslan ErmilovInitiates an L2CA Echo Request message and the reception of the corresponding 36572f00208SRuslan ErmilovL2CAP Echo Response message. 36672f00208SRuslan ErmilovThe input parameters are remote Bluetooth device 36772f00208SRuslan ErmilovBD_ADDR, Echo Data and Length of the echo data. 36872f00208SRuslan ErmilovThe output parameters are 369878ed226SJulian ElischerResult, Echo Data and Length of the echo data. 370878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GET_INFO 37172f00208SRuslan ErmilovInitiates an L2CA Information Request message and the reception of the 37272f00208SRuslan Ermilovcorresponding L2CAP Info Response message. 37372f00208SRuslan ErmilovThe input parameters are remote Bluetooth device BD_ADDR and Information Type. 37472f00208SRuslan ErmilovThe output parameters are 375878ed226SJulian ElischerResult, Information Data and Size of the information data. 376878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_ENABLE_CLT 37772f00208SRuslan ErmilovRequest to disable (enable) the reception of connectionless packets. 37872f00208SRuslan ErmilovThe input 379878ed226SJulian Elischerparameter is the PSM value indicating service that should be blocked 380878ed226SJulian Elischer(unblocked) and Enable flag. 381878ed226SJulian Elischer.El 382878ed226SJulian Elischer.Sh NETGRAPH CONTROL MESSAGES 383878ed226SJulian ElischerThis node type supports the generic control messages, plus the following: 38472f00208SRuslan Ermilov.Bl -tag -width indent 385878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_GET_FLAGS 386878ed226SJulian ElischerReturns current state for the node. 387878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_GET_DEBUG 388878ed226SJulian ElischerReturns an integer containing the current debug level for the node. 389878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_SET_DEBUG 390878ed226SJulian ElischerThis command takes an integer argument and sets current debug level 391878ed226SJulian Elischerfor the node. 392878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_GET_CON_LIST 3935203edcdSRuslan ErmilovReturns list of active baseband connections (i.e., ACL links). 394878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_GET_CHAN_LIST 395878ed226SJulian ElischerReturns list of active L2CAP channels. 396f2bb1caeSJulian Elischer.It Dv NGM_L2CAP_NODE_GET_AUTO_DISCON_TIMO 397f2bb1caeSJulian ElischerReturns an integer containing the current value of the auto disconnect 398f2bb1caeSJulian Elischertimeout (in sec). 399f2bb1caeSJulian Elischer.It Dv NGM_L2CAP_NODE_SET_AUTO_DISCON_TIMO 400f2bb1caeSJulian ElischerThis command accepts an integer and sets the value of the auto disconnect 40172f00208SRuslan Ermilovtimeout (in sec). 40272f00208SRuslan ErmilovThe special value of 0 (zero) disables auto disconnect timeout. 403878ed226SJulian Elischer.El 404878ed226SJulian Elischer.Sh SHUTDOWN 40572f00208SRuslan ErmilovThis node shuts down upon receipt of an 40672f00208SRuslan Ermilov.Dv NGM_SHUTDOWN 40772f00208SRuslan Ermilovcontrol message, or 408878ed226SJulian Elischerwhen all hooks have been disconnected. 409878ed226SJulian Elischer.Sh SEE ALSO 410878ed226SJulian Elischer.Xr netgraph 4 , 411878ed226SJulian Elischer.Xr l2control 8 , 41272f00208SRuslan Ermilov.Xr l2ping 8 , 41372f00208SRuslan Ermilov.Xr ngctl 8 414878ed226SJulian Elischer.Sh HISTORY 415878ed226SJulian ElischerThe 41672f00208SRuslan Ermilov.Nm l2cap 417878ed226SJulian Elischernode type was implemented in 418878ed226SJulian Elischer.Fx 5.0 . 419878ed226SJulian Elischer.Sh AUTHORS 420878ed226SJulian Elischer.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com 4219cbda590SRuslan Ermilov.Sh BUGS 4229cbda590SRuslan ErmilovMost likely. 4239cbda590SRuslan ErmilovPlease report if found. 424