xref: /freebsd/share/man/man4/ng_l2cap.4 (revision b2c76c41be32f904179efed29c0ca04d53f3996c)
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 $
2672f00208SRuslan Ermilov.\"
27878ed226SJulian Elischer.Dd July 4, 2002
28878ed226SJulian Elischer.Dt NG_L2CAP 4
29878ed226SJulian Elischer.Os
30878ed226SJulian Elischer.Sh NAME
3172f00208SRuslan Ermilov.Nm ng_l2cap
32878ed226SJulian Elischer.Nd Netgraph node type that implements Bluetooth Logical Link Control and
33878ed226SJulian ElischerAdaptation Protocol (L2CAP)
34878ed226SJulian Elischer.Sh SYNOPSIS
35878ed226SJulian Elischer.In sys/types.h
363a08bb88SMaksim Yevmenkin.In netgraph/bluetooth/include/ng_hci.h
373a08bb88SMaksim Yevmenkin.In netgraph/bluetooth/include/ng_l2cap.h
38878ed226SJulian Elischer.Sh DESCRIPTION
39878ed226SJulian ElischerThe
4072f00208SRuslan Ermilov.Nm l2cap
41878ed226SJulian Elischernode type is a Netgraph node type that implements Bluetooth Logical Link
42878ed226SJulian ElischerControl and Adaptation Protocol as per chapter D of the Bluetooth Specification
43878ed226SJulian ElischerBook v1.1.
44878ed226SJulian Elischer.Pp
45878ed226SJulian ElischerL2CAP provides connection-oriented and connectionless data services to upper
46878ed226SJulian Elischerlayer protocols with protocol multiplexing capability, segmentation and
4772f00208SRuslan Ermilovreassembly operation, and group abstractions.
4872f00208SRuslan ErmilovL2CAP permits higher level
49878ed226SJulian Elischerprotocols and applications to transmit and receive L2CAP data packets up to
50878ed226SJulian Elischer64 kilobytes in length.
5172f00208SRuslan Ermilov.Ss L2CAP Assumptions
52878ed226SJulian Elischer.Bl -enum -offset indent
53878ed226SJulian Elischer.It
5472f00208SRuslan ErmilovThe ACL link between two units is set up.
5572f00208SRuslan ErmilovThe Baseband provides orderly
56878ed226SJulian Elischerdelivery of data packets, although there might be individual packet corruption
5772f00208SRuslan Ermilovand duplicates.
580986ab12SMaksim YevmenkinNo more than one ACL link exists between any two devices.
59878ed226SJulian Elischer.It
60878ed226SJulian ElischerThe Baseband always provides the impression of full-duplex communication
6172f00208SRuslan Ermilovchannels.
6272f00208SRuslan ErmilovThis does not imply that all L2CAP communications are bi-directional.
63878ed226SJulian ElischerMulticasts and unidirectional traffic (e.g., video) do not require duplex
64878ed226SJulian Elischerchannels.
65878ed226SJulian Elischer.It
66878ed226SJulian ElischerL2CAP provides a reliable channel using the mechanisms available at the
6772f00208SRuslan ErmilovBaseband layer.
6872f00208SRuslan ErmilovThe Baseband always performs data integrity checks when
69878ed226SJulian Elischerrequested and resends data until it has been successfully acknowledged or
7072f00208SRuslan Ermilova timeout occurs.
71b5e7e999SRuslan ErmilovAs acknowledgements may be lost, timeouts may
72878ed226SJulian Elischeroccur even after the data has been successfully sent.
73878ed226SJulian Elischer.El
74878ed226SJulian Elischer.Sh L2CAP GENERAL OPERATION
75878ed226SJulian ElischerThe Logical Link Control and Adaptation Protocol (L2CAP) is based around the
76878ed226SJulian Elischerconcept of
7772f00208SRuslan Ermilov.Dq channels .
7872f00208SRuslan ErmilovEach channel is bound to a single protocol in a many-to-one fashion.
7972f00208SRuslan ErmilovMultiple
80878ed226SJulian Elischerchannels can be bound to the same protocol, but a channel cannot be bound to
8172f00208SRuslan Ermilovmultiple protocols.
8272f00208SRuslan ErmilovEach L2CAP packet received on a channel is directed to
83878ed226SJulian Elischerthe appropriate higher level protocol.
84878ed226SJulian Elischer.Pp
85878ed226SJulian ElischerEach one of the end-points of an L2CAP channel is referred to by a channel
8672f00208SRuslan Ermilovidentifier.
8772f00208SRuslan ErmilovChannel identifiers (CIDs) are local names representing a logical
8872f00208SRuslan Ermilovchannel end-point on the device.
8972f00208SRuslan ErmilovIdentifiers from 0x0001 to 0x003F are reserved
9072f00208SRuslan Ermilovfor specific L2CAP functions.
9172f00208SRuslan ErmilovThe null identifier (0x0000) is defined as an
92878ed226SJulian Elischerillegal identifier and must never be used as a destination end-point.
9372f00208SRuslan ErmilovAll L2CAP signalling commands are sent to CID 0x0001.
9472f00208SRuslan ErmilovCID 0x0002 is reserved for group-oriented channel.
9572f00208SRuslan ErmilovThe same CID must not be reused as a local L2CAP
96878ed226SJulian Elischerchannel endpoint for multiple simultaneous L2CAP channels between a local
97878ed226SJulian Elischerdevice and some remote device.
98878ed226SJulian Elischer.Pp
99878ed226SJulian ElischerCID assignment is relative to a particular device and a device can assign CIDs
10072f00208SRuslan Ermilovindependently from other devices.
10172f00208SRuslan ErmilovThus, even if the same CID value has been
102878ed226SJulian Elischerassigned to (remote) channel endpoints by several remote devices connected
103878ed226SJulian Elischerto a single local device, the local device can still uniquely associate each
104878ed226SJulian Elischerremote CID with a different device.
10572f00208SRuslan Ermilov.Ss Channel Operational States
106c60bda17SJoel Dahl.Bl -tag -width foo
107878ed226SJulian Elischer.It Dv NG_L2CAP_CLOSED
10872f00208SRuslan ErmilovIn this state, there is no channel associated with this CID.
10972f00208SRuslan ErmilovThis is the only
11072f00208SRuslan Ermilovstate when a link level connection (Baseband) may not exist.
11172f00208SRuslan ErmilovLink disconnection
11272f00208SRuslan Ermilovforces all other states into the
11372f00208SRuslan Ermilov.Dv NG_L2CAP_CLOSED
11472f00208SRuslan Ermilovstate.
115878ed226SJulian Elischer.It Dv NG_L2CAP_W4_L2CAP_CON_RSP
116878ed226SJulian ElischerIn this state, the CID represents a local end-point and an L2CAP Connect
117878ed226SJulian ElischerRequest message has been sent referencing this endpoint and it is now waiting
118878ed226SJulian Elischerfor the corresponding L2CAP Connect Response message.
119878ed226SJulian Elischer.It Dv NG_L2CAP_W4_L2CA_CON_RSP
120878ed226SJulian ElischerIn this state, the remote end-point exists and an L2CAP Connect Request has
12172f00208SRuslan Ermilovbeen received by the local L2CAP entity.
12272f00208SRuslan ErmilovAn L2CA Connect Indication has been
123878ed226SJulian Elischersent to the upper layer and the part of the local L2CAP entity processing the
12472f00208SRuslan Ermilovreceived L2CAP Connect Request waits for the corresponding response.
12572f00208SRuslan ErmilovThe response may require a security check to be performed.
126878ed226SJulian Elischer.It Dv NG_L2CAP_CONFIG
127878ed226SJulian ElischerIn this state, the connection has been established but both sides are still
12872f00208SRuslan Ermilovnegotiating the channel parameters.
12972f00208SRuslan ErmilovThe Configuration state may also be
13072f00208SRuslan Ermiloventered when the channel parameters are being renegotiated.
13172f00208SRuslan ErmilovPrior to entering the
13272f00208SRuslan Ermilov.Dv NG_L2CAP_CONFIG
13372f00208SRuslan Ermilovstate, all outgoing data traffic is suspended since
13472f00208SRuslan Ermilovthe traffic parameters of the data traffic are to be renegotiated.
13572f00208SRuslan ErmilovIncoming
136878ed226SJulian Elischerdata traffic is accepted until the remote channel endpoint has entered
13772f00208SRuslan Ermilovthe
13872f00208SRuslan Ermilov.Dv NG_L2CAP_CONFIG
13972f00208SRuslan Ermilovstate.
14072f00208SRuslan ErmilovIn the
14172f00208SRuslan Ermilov.Dv NG_L2CAP_CONFIG
14272f00208SRuslan Ermilovstate, both sides will issue
143878ed226SJulian ElischerL2CAP Configuration Request messages if only defaults are being used, a null
14472f00208SRuslan Ermilovmessage will be sent.
14572f00208SRuslan ErmilovIf a large amount of parameters need to be negotiated,
146878ed226SJulian Elischermultiple messages will be sent to avoid any MTU limitations and negotiate
14772f00208SRuslan Ermilovincrementally.
14872f00208SRuslan ErmilovMoving from the
14972f00208SRuslan Ermilov.Dv NG_L2CAP_CONFIG
15072f00208SRuslan Ermilovstate to the
15172f00208SRuslan Ermilov.Dv NG_L2CAP_OPEN
15272f00208SRuslan Ermilovstate requires both sides to be ready.
15372f00208SRuslan ErmilovAn L2CAP entity is ready when it has received
154878ed226SJulian Elischera positive response to its final request and it has positively responded to
155878ed226SJulian Elischerthe final request from the remote device.
156878ed226SJulian Elischer.It Dv NG_L2CAP_OPEN
157878ed226SJulian ElischerIn this state, the connection has been established and configured, and data
158878ed226SJulian Elischerflow may proceed.
159878ed226SJulian Elischer.It Dv NG_L2CAP_W4_L2CAP_DISCON_RSP
160878ed226SJulian ElischerIn this state, the connection is shutting down and an L2CAP Disconnect Request
16172f00208SRuslan Ermilovmessage has been sent.
16272f00208SRuslan ErmilovThis state is now waiting for the corresponding response.
163878ed226SJulian Elischer.It Dv NG_L2CAP_W4_L2CA_DISCON_RSP
164878ed226SJulian ElischerIn this state, the connection on the remote endpoint is shutting down and an
16572f00208SRuslan ErmilovL2CAP Disconnect Request message has been received.
16672f00208SRuslan ErmilovAn L2CA Disconnect
167878ed226SJulian ElischerIndication has been sent to the upper layer to notify the owner of the CID
16872f00208SRuslan Ermilovthat the remote endpoint is being closed.
16972f00208SRuslan ErmilovThis state is now waiting for the
170878ed226SJulian Elischercorresponding response from the upper layer before responding to the remote
171878ed226SJulian Elischerendpoint.
172878ed226SJulian Elischer.El
173878ed226SJulian Elischer.Ss Protocol Multiplexing
174878ed226SJulian ElischerL2CAP supports protocol multiplexing because the Baseband Protocol does not
175878ed226SJulian Elischersupport any
176878ed226SJulian Elischer.Dq type
177878ed226SJulian Elischerfield identifying the higher layer protocol being multiplexed above it.
178878ed226SJulian ElischerL2CAP is able to distinguish between upper layer protocols such as the Service
179878ed226SJulian ElischerDiscovery Protocol, RFCOMM and Telephony Control.
180878ed226SJulian Elischer.Ss Segmentation and Reassembly
18172f00208SRuslan ErmilovThe data packets defined by the Baseband Protocol are limited in size.
18272f00208SRuslan ErmilovLarge
183878ed226SJulian ElischerL2CAP packets must be segmented into multiple smaller Baseband packets prior
18472f00208SRuslan Ermilovto their transmission over the air.
18572f00208SRuslan ErmilovSimilarly, multiple received Baseband
186878ed226SJulian Elischerpackets may be reassembled into a single larger L2CAP packet.
187878ed226SJulian Elischer.Ss Quality of Service
188878ed226SJulian ElischerThe L2CAP connection establishment process allows the exchange of information
189878ed226SJulian Elischerregarding the quality of service (QoS) expected between two Bluetooth units.
190878ed226SJulian Elischer.Ss Groups
191878ed226SJulian ElischerThe Baseband Protocol supports the concept of a piconet, a group of devices
19272f00208SRuslan Ermilovsynchronously hopping together using the same clock.
19372f00208SRuslan ErmilovThe L2CAP group
194878ed226SJulian Elischerabstraction permits implementations to efficiently map protocol groups on to
195878ed226SJulian Elischerpiconets.
196878ed226SJulian Elischer.Pp
197878ed226SJulian ElischerThe following features are outside the scope of L2CAP responsibilities:
198878ed226SJulian Elischer.Bl -dash -offset indent
199878ed226SJulian Elischer.It
200878ed226SJulian ElischerL2CAP does not transport audio designated for SCO links.
201878ed226SJulian Elischer.It
202878ed226SJulian ElischerL2CAP does not enforce a reliable channel or ensure data integrity,
203878ed226SJulian Elischerthat is, L2CAP performs no retransmissions or checksum calculations.
204878ed226SJulian Elischer.It
205878ed226SJulian ElischerL2CAP does not support a reliable multicast channel.
206878ed226SJulian Elischer.It
207878ed226SJulian ElischerL2CAP does not support the concept of a global group name.
208878ed226SJulian Elischer.El
209878ed226SJulian Elischer.Sh HOOKS
210878ed226SJulian ElischerThis node type supports the following hooks:
211c60bda17SJoel Dahl.Bl -tag -width ".Va hci"
212c60bda17SJoel Dahl.It Va hci
213878ed226SJulian ElischerBluetooth Host Controller Interface downstream hook.
214c60bda17SJoel Dahl.It Va l2c
21572f00208SRuslan ErmilovUpper layer protocol upstream hook.
21672f00208SRuslan ErmilovUsually the Bluetooth L2CAP socket layer is connected to the hook.
217c60bda17SJoel Dahl.It Va ctl
21872f00208SRuslan ErmilovControl hook.
2190986ab12SMaksim YevmenkinUsually the Bluetooth raw L2CAP sockets layer is connected to the hook.
220878ed226SJulian Elischer.El
221878ed226SJulian Elischer.Sh INTERFACE TO THE UPPER LAYER PROTOCOLS (L2CA CONTROL MESSAGES)
222878ed226SJulian ElischerBluetooth specification says that L2CA request must block until response
22372f00208SRuslan Ermilovis ready.
22472f00208SRuslan ErmilovL2CAP node uses
22572f00208SRuslan Ermilov.Va token
22672f00208SRuslan Ermilovfield from Netgraph message header to match L2CA request and response.
22772f00208SRuslan ErmilovThe upper layer protocol must populate
22872f00208SRuslan Ermilov.Va token .
22972f00208SRuslan ErmilovL2CAP node will queue request and start processing.
23072f00208SRuslan ErmilovLater, when response is
231c48524c2SMike Pritchardready or timeout has occurred, L2CAP node will create new Netgraph message, set
23272f00208SRuslan Ermilov.Va token
233878ed226SJulian Elischerand
234878ed226SJulian Elischer.Dv NFG_RESP
23572f00208SRuslan Ermilovflag and send message to the upper layer.
23672f00208SRuslan ErmilovNote that L2CA indication messages
237878ed226SJulian Elischerwill not populate
23872f00208SRuslan Ermilov.Va token
239878ed226SJulian Elischerand will not set
240878ed226SJulian Elischer.Dv NGF_RESP
24172f00208SRuslan Ermilovflag.
24272f00208SRuslan ErmilovThere is no reason for this, because they are just notifications and do
243878ed226SJulian Elischernot require acknowledgment.
244c60bda17SJoel Dahl.Bl -tag -width foo
245878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CON
246878ed226SJulian ElischerRequests the creation of a channel representing a logical connection to a
24772f00208SRuslan Ermilovphysical address.
24872f00208SRuslan ErmilovInput parameters are the target protocol (PSM) and remote
24972f00208SRuslan Ermilovdevice's 48-bit address (BD_ADDR).
25072f00208SRuslan ErmilovOutput parameters are the local CID (LCID)
25172f00208SRuslan Ermilovallocated by the local L2CAP entity, and Result of the request.
25272f00208SRuslan ErmilovIf Result
253878ed226SJulian Elischerindicates a pending notification, the Status value may contain more information
254878ed226SJulian Elischerof what processing is delaying the establishment of the connection.
255878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CON_IND
256878ed226SJulian ElischerThis message includes the parameters for the address of the remote device that
257878ed226SJulian Elischerissued the connection request, the local CID representing the channel being
258878ed226SJulian Elischerrequested, the Identifier contained in the request, and the PSM value the
259878ed226SJulian Elischerrequest is targeting.
260878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CON_RSP
26172f00208SRuslan ErmilovIssues a response to a connection request event indication.
26272f00208SRuslan ErmilovInput parameters
263878ed226SJulian Elischerare the remote device's 48-bit address, Identifier sent in the request, local
26472f00208SRuslan ErmilovCID, the Response code, and the Status attached to the Response code.
26572f00208SRuslan ErmilovThe output parameter is the Result of the service request.
26672f00208SRuslan ErmilovThis primitive must be
267878ed226SJulian Elischercalled no more than once after receiving the indication.
268878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CFG
269878ed226SJulian ElischerRequests the initial configuration (or reconfiguration) of a channel to a new
27072f00208SRuslan Ermilovset of channel parameters.
27172f00208SRuslan ErmilovInput parameters are the local CID endpoint, new
272878ed226SJulian Elischerincoming receivable MTU (InMTU), new outgoing flow spec-ification, and flush
27372f00208SRuslan Ermilovand link timeouts.
27472f00208SRuslan ErmilovOutput parameters are the Result, accepted incoming MTU
275878ed226SJulian Elischer(InMTU), the remote side's flow requests, and flush and link timeouts.
276878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CFG_IND
277878ed226SJulian ElischerThis message includes the parameters indicating the local CID of the channel
278878ed226SJulian Elischerthe request has been sent to, the outgoing MTU size (maximum packet that can
279878ed226SJulian Elischerbe sent across the channel) and the flowspec describing the characteristics of
28072f00208SRuslan Ermilovthe incoming data.
28172f00208SRuslan ErmilovAll other channel parameters are set to their default values
28272f00208SRuslan Ermilovif not provided by the remote device.
283878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_CFG_RSP
28472f00208SRuslan ErmilovIssues a response to a configuration request event indication.
28572f00208SRuslan ErmilovInput parameters
286878ed226SJulian Elischerinclude the local CID of the endpoint being configured, outgoing transmit MTU
287878ed226SJulian Elischer(which may be equal or less to the OutMTU parameter in the configuration
28872f00208SRuslan Ermilovindication event) and the accepted flowspec for incoming traffic.
28972f00208SRuslan ErmilovThe output parameter is the Result value.
290878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_QOS_IND
291878ed226SJulian ElischerThis message includes the parameter indicating the address of the remote
292878ed226SJulian ElischerBluetooth device where the QoS contract has been violated.
293878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_DISCON
29472f00208SRuslan ErmilovRequests the disconnection of the channel.
29572f00208SRuslan ErmilovInput parameter is the CID representing the local channel endpoint.
29672f00208SRuslan ErmilovOutput parameter is Result.
29772f00208SRuslan ErmilovResult
29872f00208SRuslan Ermilovis zero if an L2CAP Disconnect Response is received, otherwise a non-zero value
29972f00208SRuslan Ermilovis returned.
30072f00208SRuslan ErmilovOnce disconnection has been requested, no process will be able to
301878ed226SJulian Elischersuccessfully read or write from the CID.
302878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_DISCON_IND
303878ed226SJulian ElischerThis message includes the parameter indicating the local CID the request has
304878ed226SJulian Elischerbeen sent to.
305878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_WRITE
30672f00208SRuslan ErmilovResponse to transfer of data request.
30772f00208SRuslan ErmilovActual data must be received from
308878ed226SJulian Elischerappropriate upstream hook and must be prepended with header defined as follows.
309878ed226SJulian Elischer.Bd -literal -offset indent
310878ed226SJulian Elischer/* L2CA data packet header */
311878ed226SJulian Elischertypedef struct {
3126b99842aSEd Schouten        uint32_t token;  /* token to use in L2CAP_L2CA_WRITE */
3136b99842aSEd Schouten        uint16_t length; /* length of the data */
3146b99842aSEd Schouten        uint16_t lcid;   /* local channel ID */
315878ed226SJulian Elischer} __attribute__ ((packed)) ng_l2cap_l2ca_hdr_t;
316878ed226SJulian Elischer.Ed
317878ed226SJulian Elischer.Pp
318878ed226SJulian ElischerThe output parameters are Result and Length of data written.
319878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_CREATE
320878ed226SJulian ElischerRequests the creation of a CID to represent a logical connection to multiple
32172f00208SRuslan Ermilovdevices.
32272f00208SRuslan ErmilovInput parameter is the PSM value that the outgoing connectionless
32372f00208SRuslan Ermilovtraffic is labelled with, and the filter used for incoming traffic.
32472f00208SRuslan ErmilovOutput parameter is the CID representing the local endpoint.
32572f00208SRuslan ErmilovOn creation, the group
326878ed226SJulian Elischeris empty but incoming traffic destined for the PSM value is readable.
32772f00208SRuslan Ermilov.Bf -emphasis
32872f00208SRuslan ErmilovThis request has not been implemented.
32972f00208SRuslan Ermilov.Ef
330878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_CLOSE
331878ed226SJulian ElischerThe use of this message closes down a Group.
33272f00208SRuslan Ermilov.Bf -emphasis
33372f00208SRuslan ErmilovThis request has not been implemented.
33472f00208SRuslan Ermilov.Ef
335878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_ADD_MEMBER
33672f00208SRuslan ErmilovRequests the addition of a member to a group.
33772f00208SRuslan ErmilovThe input parameter includes the
338878ed226SJulian ElischerCID representing the group and the BD_ADDR of the group member to be added.
339878ed226SJulian ElischerThe output parameter Result confirms the success or failure of the request.
34072f00208SRuslan Ermilov.Bf -emphasis
34172f00208SRuslan ErmilovThis request has not been implemented.
34272f00208SRuslan Ermilov.Ef
343878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_REM_MEMBER
34472f00208SRuslan ErmilovRequests the removal of a member from a group.
34572f00208SRuslan ErmilovThe input parameters include
346878ed226SJulian Elischerthe CID representing the group and BD_ADDR of the group member to be removed.
347878ed226SJulian ElischerThe output parameter Result confirms the success or failure of the request.
34872f00208SRuslan Ermilov.Bf -emphasis
34972f00208SRuslan ErmilovThis request has not been implemented.
35072f00208SRuslan Ermilov.Ef
351878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GRP_MEMBERSHIP
35272f00208SRuslan ErmilovRequests a report of the members of a group.
35372f00208SRuslan ErmilovThe input parameter CID represents the group being queried.
35472f00208SRuslan ErmilovThe output parameter Result confirms the success or
35572f00208SRuslan Ermilovfailure of the operation.
35672f00208SRuslan ErmilovIf the Result is successful, BD_ADDR_Lst is a list
357878ed226SJulian Elischerof the Bluetooth addresses of the N members of the group.
35872f00208SRuslan Ermilov.Bf -emphasis
35972f00208SRuslan ErmilovThis request has not been implemented.
36072f00208SRuslan Ermilov.Ef
361878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_PING
36272f00208SRuslan ErmilovInitiates an L2CA Echo Request message and the reception of the corresponding
36372f00208SRuslan ErmilovL2CAP Echo Response message.
36472f00208SRuslan ErmilovThe input parameters are remote Bluetooth device
36572f00208SRuslan ErmilovBD_ADDR, Echo Data and Length of the echo data.
36672f00208SRuslan ErmilovThe output parameters are
367878ed226SJulian ElischerResult, Echo Data and Length of the echo data.
368878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_GET_INFO
36972f00208SRuslan ErmilovInitiates an L2CA Information Request message and the reception of the
37072f00208SRuslan Ermilovcorresponding L2CAP Info Response message.
37172f00208SRuslan ErmilovThe input parameters are remote Bluetooth device BD_ADDR and Information Type.
37272f00208SRuslan ErmilovThe output parameters are
373878ed226SJulian ElischerResult, Information Data and Size of the information data.
374878ed226SJulian Elischer.It Dv NGM_L2CAP_L2CA_ENABLE_CLT
37572f00208SRuslan ErmilovRequest to disable (enable) the reception of connectionless packets.
37672f00208SRuslan ErmilovThe input
377878ed226SJulian Elischerparameter is the PSM value indicating service that should be blocked
378878ed226SJulian Elischer(unblocked) and Enable flag.
379878ed226SJulian Elischer.El
380878ed226SJulian Elischer.Sh NETGRAPH CONTROL MESSAGES
381878ed226SJulian ElischerThis node type supports the generic control messages, plus the following:
382c60bda17SJoel Dahl.Bl -tag -width foo
383878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_GET_FLAGS
384878ed226SJulian ElischerReturns current state for the node.
385878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_GET_DEBUG
386878ed226SJulian ElischerReturns an integer containing the current debug level for the node.
387878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_SET_DEBUG
388878ed226SJulian ElischerThis command takes an integer argument and sets current debug level
389878ed226SJulian Elischerfor the node.
390878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_GET_CON_LIST
3915203edcdSRuslan ErmilovReturns list of active baseband connections (i.e., ACL links).
392878ed226SJulian Elischer.It Dv NGM_L2CAP_NODE_GET_CHAN_LIST
393878ed226SJulian ElischerReturns list of active L2CAP channels.
394f2bb1caeSJulian Elischer.It Dv NGM_L2CAP_NODE_GET_AUTO_DISCON_TIMO
395f2bb1caeSJulian ElischerReturns an integer containing the current value of the auto disconnect
396f2bb1caeSJulian Elischertimeout (in sec).
397f2bb1caeSJulian Elischer.It Dv NGM_L2CAP_NODE_SET_AUTO_DISCON_TIMO
398f2bb1caeSJulian ElischerThis command accepts an integer and sets the value of the auto disconnect
39972f00208SRuslan Ermilovtimeout (in sec).
40072f00208SRuslan ErmilovThe special value of 0 (zero) disables auto disconnect timeout.
401878ed226SJulian Elischer.El
402878ed226SJulian Elischer.Sh SHUTDOWN
40372f00208SRuslan ErmilovThis node shuts down upon receipt of an
40472f00208SRuslan Ermilov.Dv NGM_SHUTDOWN
40572f00208SRuslan Ermilovcontrol message, or
406878ed226SJulian Elischerwhen all hooks have been disconnected.
407878ed226SJulian Elischer.Sh SEE ALSO
408878ed226SJulian Elischer.Xr netgraph 4 ,
409878ed226SJulian Elischer.Xr l2control 8 ,
41072f00208SRuslan Ermilov.Xr l2ping 8 ,
41172f00208SRuslan Ermilov.Xr ngctl 8
412878ed226SJulian Elischer.Sh HISTORY
413878ed226SJulian ElischerThe
41472f00208SRuslan Ermilov.Nm l2cap
415878ed226SJulian Elischernode type was implemented in
416878ed226SJulian Elischer.Fx 5.0 .
417878ed226SJulian Elischer.Sh AUTHORS
418*6c899950SBaptiste Daroussin.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
4199cbda590SRuslan Ermilov.Sh BUGS
4209cbda590SRuslan ErmilovMost likely.
4219cbda590SRuslan ErmilovPlease report if found.
422