aboutsummaryrefslogtreecommitdiff
path: root/share/man/man4/ng_btsocket.4
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2003-05-20 21:01:21 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2003-05-20 21:01:21 +0000
commit72f00208e54ddee7e52769953a28734e0d4ec7dd (patch)
treecc71fbdbb548ae9fb5856beadc19f74dae54e77b /share/man/man4/ng_btsocket.4
parent7f4725bd0940ff01b17be53ded2d47659bc089e2 (diff)
downloadsrc-72f00208e54ddee7e52769953a28734e0d4ec7dd.tar.gz
src-72f00208e54ddee7e52769953a28734e0d4ec7dd.zip
Reapply mdoc(7) fixes that got accidentally lost in the last
Bluetooth update, and fix a few more issues. Submitted by: Maksim Yevmenkin <m_evmenkin@yahoo.com>, ru Approved by: re (blanket)
Notes
Notes: svn path=/head/; revision=115185
Diffstat (limited to 'share/man/man4/ng_btsocket.4')
-rw-r--r--share/man/man4/ng_btsocket.4234
1 files changed, 125 insertions, 109 deletions
diff --git a/share/man/man4/ng_btsocket.4 b/share/man/man4/ng_btsocket.4
index 8c5ad1cdd29e..c3405ecac5d8 100644
--- a/share/man/man4/ng_btsocket.4
+++ b/share/man/man4/ng_btsocket.4
@@ -1,5 +1,3 @@
-.\" ng_btsocket.4
-.\"
.\" Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
.\" All rights reserved.
.\"
@@ -26,6 +24,7 @@
.\"
.\" $Id: ng_btsocket.4,v 1.6 2003/03/18 00:09:34 max Exp $
.\" $FreeBSD$
+.\"
.Dd July 8, 2002
.Dt NG_BTSOCKET 4
.Os
@@ -36,30 +35,29 @@
.In sys/types.h
.In sys/socket.h
.In bitstring.h
-.In netgraph.h
.In ng_hci.h
.In ng_l2cap.h
.In ng_btsocket.h
.Sh DESCRIPTION
The
.Nm
-module implements three Netgraph node types. Each type in its turn implements
-one protocol within
+module implements three Netgraph node types.
+Each type in its turn implements one protocol within
.Dv PF_BLUETOOTH
domain.
-.Pp
-.Sh BLUETOOTH_PROTO_HCI protocol
-.Ss SOCK_RAW HCI sockets
+.Sh Dv BLUETOOTH_PROTO_HCI Sh protocol
+.Ss Dv SOCK_RAW Ss HCI sockets
Implemented by
-.Cm btsock_hci_raw
-Netgraph type. Raw HCI sockets allow sending of raw HCI command datagrams
+.Nm btsock_hci_raw
+Netgraph type.
+Raw HCI sockets allow sending of raw HCI command datagrams
only to correspondents named in
.Xr send 2
-calls. Raw HCI datagrams (HCI commands, events and data) are generally
-received with
+calls.
+Raw HCI datagrams (HCI commands, events and data) are generally received with
.Xr recvfrom 2 ,
-which returns the next datagram with its return address. Also raw HCI
-sockets can be used to control HCI nodes.
+which returns the next datagram with its return address.
+Raw HCI sockets can also be used to control HCI nodes.
.Pp
The Bluetooth raw HCI socket address is defined as follows:
.Bd -literal -offset indent
@@ -71,14 +69,14 @@ struct sockaddr_hci {
};
.Ed
.Pp
-Raw HCI sockets support number of
-.Xr ioctl 2
+Raw HCI sockets support number of
+.Xr ioctl 2
requests such as:
-.Bl -tag -width foo
+.Bl -tag -width indent
.It Dv SIOC_HCI_RAW_NODE_GET_STATE
Returns current state for the HCI node.
.It Dv SIOC_HCI_RAW_NODE_INIT
-Turn on
+Turn on
.Dq inited
bit for the HCI node.
.It Dv SIOC_HCI_RAW_NODE_GET_DEBUG
@@ -117,14 +115,15 @@ Sets new value of the role switch parameter for the HCI node.
.El
.Pp
The
-.Dv net.bluetooth.hci.sockets.raw.ioctl_timeout
-variable, that can be examined and set via
+.Va net.bluetooth.hci.sockets.raw.ioctl_timeout
+variable, that can be examined and set via
.Xr sysctl 8 ,
controls the control request timeout (in seconds) for raw HCI sockets.
.Pp
-Raw HCI sockets support filters. The application can filter certain
-HCI datagram types. For HCI event datagrams the application can set
-additional filter. The raw HCI socket filter defined as follows:
+Raw HCI sockets support filters.
+The application can filter certain HCI datagram types.
+For HCI event datagrams the application can set additional filter.
+The raw HCI socket filter defined as follows:
.Bd -literal -offset indent
/*
* Raw HCI socket filter.
@@ -139,17 +138,16 @@ struct ng_btsocket_hci_raw_filter {
};
.Ed
.Pp
-The
+The
.Dv SO_HCI_RAW_FILTER
option defined at
-.Dv SOL_HCI_RAW
+.Dv SOL_HCI_RAW
level can be used to obtain via
.Xr getsockopt 2
-or change via
-.Xr setsockopt 2
+or change via
+.Xr setsockopt 2
raw HCI socket's filter.
-.Pp
-.Sh BLUETOOTH_PROTO_L2CAP protocol
+.Sh Dv BLUETOOTH_PROTO_L2CAP Sh protocol
The Bluetooth L2CAP socket address is defined as follows:
.Bd -literal -offset indent
/* Bluetooth version of struct sockaddr for L2CAP sockets */
@@ -160,19 +158,23 @@ struct sockaddr_l2cap {
bdaddr_t l2cap_bdaddr; /* address */
};
.Ed
-.Pp
-.Ss SOCK_RAW L2CAP sockets
+.Ss Dv SOCK_RAW Ss L2CAP sockets
Implemented by
-.Cm btsock_l2c_raw
+.Nm btsock_l2c_raw
Netgraph type.
-Raw L2CAP sockets do not provide access to raw L2CAP datagrams. These
-sockets used to control L2CAP nodes and to issue special L2CAP requests
-such as ECHO_REQUEST and GET_INFO request.
+Raw L2CAP sockets do not provide access to raw L2CAP datagrams.
+These
+sockets used to control L2CAP nodes and to issue special L2CAP requests
+such as
+.Dv ECHO_REQUEST
+and
+.Dv GET_INFO
+request.
.Pp
-Raw L2CAP sockets support number of
-.Xr ioctl 2
+Raw L2CAP sockets support number of
+.Xr ioctl 2
requests such as:
-.Bl -tag -width foo
+.Bl -tag -width indent
.It Dv SIOC_L2CAP_NODE_GET_FLAGS
Returns current state for the L2CAP node.
.It Dv SIOC_L2CAP_NODE_GET_DEBUG
@@ -185,69 +187,80 @@ node.
.It Dv SIOC_L2CAP_NODE_GET_CHAN_LIST
Returns list of active channels for the L2CAP node.
.It Dv SIOC_L2CAP_L2CA_PING
-Issues L2CAP ECHO_REQUEST.
+Issues L2CAP
+.Dv ECHO_REQUEST .
.It Dv SIOC_L2CAP_L2CA_GET_INFO
-Issues L2CAP GET_INFO request.
+Issues L2CAP
+.Dv GET_INFO
+request.
.El
.Pp
The
-.Dv net.bluetooth.l2cap.sockets.raw.ioctl_timeout
-variable, that can be examined and set via
+.Va net.bluetooth.l2cap.sockets.raw.ioctl_timeout
+variable, that can be examined and set via
.Xr sysctl 8 ,
controls the control request timeout (in seconds) for raw L2CAP sockets.
-.Pp
-.Ss SOCK_SEQPACKET L2CAP sockets
+.Ss Dv SOCK_SEQPACKET Ss L2CAP sockets
Implemented by
-.Cm btsock_l2c
+.Nm btsock_l2c
Netgraph type.
-L2CAP sockets are either
+L2CAP sockets are either
.Dq active
or
.Dq passive .
-Active sockets initiate connections to passive sockets. By default L2CAP
-sockets are created active; to create a passive socket the
+Active sockets initiate connections to passive sockets.
+By default, L2CAP sockets are created active; to create a passive socket, the
.Xr listen 2
-system call must be used after binding the socket with the
+system call must be used after binding the socket with the
.Xr bind 2
-system call. Only passive sockets may use the
-.Xr accept 2
-call to accept incoming connections. Only active sockets may use the
-.Xr connect 2
-call to initiate connections.
+system call.
+Only passive sockets may use the
+.Xr accept 2
+call to accept incoming connections.
+Only active sockets may use the
+.Xr connect 2
+call to initiate connections.
.Pp
L2CAP sockets support
-.Dq wildcard addressing .
-In this case socket must be bound to
-.Dv NG_HCI_BDADDR_ANY
-address. Note that PSM (Protocol/Service Multiplexor) field is always
-required. Once a connection has been established the socket's address is
-fixed by the peer entity's location. The address assigned the socket is
-the address associated with the Bluetooth device through which packets are
+.Dq "wildcard addressing" .
+In this case, socket must be bound to
+.Dv NG_HCI_BDADDR_ANY
+address.
+Note that PSM (Protocol/Service Multiplexor) field is always required.
+Once a connection has been established, the socket's address is
+fixed by the peer entity's location.
+The address assigned to the socket is
+the address associated with the Bluetooth device through which packets are
being transmitted and received, and PSM (Protocol/Service Multiplexor).
.Pp
L2CAP sockets support number of options defined at
-.Dv SOL_L2CAP
-level which can be set with
-.Xr setsockopt 2
-and tested with
+.Dv SOL_L2CAP
+level which can be set with
+.Xr setsockopt 2
+and tested with
.Xr getsockopt 2 :
-.Bl -tag -width foo
+.Bl -tag -width indent
.It Dv SO_L2CAP_IMTU
Get (set) maximum payload size the local socket is capable of accepting.
.It Dv SO_L2CAP_OMTU
Get maximum payload size the remote socket is capable of accepting.
.It Dv SO_L2CAP_IFLOW
-Get incoming flow specification for the socket.
-.Em Not implemented at the L2CAP layer .
+Get incoming flow specification for the socket.
+.Bf -emphasis
+Not implemented.
+.Ef
.It Dv SO_L2CAP_OFLOW
Get (set) outgoing flow specification for the socket.
-.Em Not implemented at the L2CAP layer .
+.Bf -emphasis
+Not implemented.
+.Ef
.It Dv SO_L2CAP_FLUSH
Get (set) value of the flush timeout.
-.Em Not implemeted at the L2CAP layer .
+.Bf -emphasis
+Not implemented.
+.Ef
.El
-.Pp
-.Sh BLUETOOTH_PROTO_RFCOMM protocol
+.Sh Dv BLUETOOTH_PROTO_RFCOMM Sh protocol
The Bluetooth RFCOMM socket address is defined as follows:
.Bd -literal -offset indent
/* Bluetooth version of struct sockaddr for RFCOMM sockets */
@@ -258,73 +271,76 @@ struct sockaddr_rfcomm {
u_int8_t rfcomm_channel; /* channel */
};
.Ed
-.Pp
-.Ss SOCK_STREAM RFCOMM sockets
-Note that RFCOMM sockets do not have associated Netgraph node type. RFCOMM
-sockets are implemented as additional layer on top of L2CAP sockets. RFCOMM
-sockets are either
+.Ss Dv SOCK_STREAM Ss RFCOMM sockets
+Note that RFCOMM sockets do not have associated Netgraph node type.
+RFCOMM sockets are implemented as additional layer on top of L2CAP sockets.
+RFCOMM sockets are either
.Dq active
or
.Dq passive .
-Active sockets initiate connections to passive sockets. By default RFCOMM
-sockets are created active; to create a passive socket the
+Active sockets initiate connections to passive sockets.
+By default, RFCOMM sockets are created active; to create a passive socket, the
.Xr listen 2
-system call must be used after binding the socket with the
+system call must be used after binding the socket with the
.Xr bind 2
-system call. Only passive sockets may use the
-.Xr accept 2
-call to accept incoming connections. Only active sockets may use the
-.Xr connect 2
-call to initiate connections.
+system call.
+Only passive sockets may use the
+.Xr accept 2
+call to accept incoming connections.
+Only active sockets may use the
+.Xr connect 2
+call to initiate connections.
.Pp
RFCOMM sockets support
-.Dq wildcard addressing .
-In this case socket must be bound to
-.Dv NG_HCI_BDADDR_ANY
-address. Note that RFCOMM channel field is always required. Once a connection
-has been established the socket's address is fixed by the peer entity's
-location. The address assigned the socket is the address associated with the
-Bluetooth device through which packets are being transmitted and received,
+.Dq "wildcard addressing" .
+In this case, socket must be bound to
+.Dv NG_HCI_BDADDR_ANY
+address.
+Note that RFCOMM channel field is always required.
+Once a connection has been established, the socket's address is fixed by the
+peer entity's location.
+The address assigned to the socket is the address associated with the
+Bluetooth device through which packets are being transmitted and received,
and RFCOMM channel.
.Pp
-The following options, which can be tested with
+The following options, which can be tested with
.Xr getsockopt 2
-call, are defined at
-.Dv SOL_RFCOMM
+call, are defined at
+.Dv SOL_RFCOMM
level for RFCOMM sockets:
-.Bl -tag -width foo
-.It SO_RFCOMM_MTU
-Returns the maximum transfer unit size (in bytes) for the underlying RFCOMM
-channel. Note that application still can write/read bigger chunks to/from the
-socket.
-.It SO_RFCOMM_FC_INFO
+.Bl -tag -width indent
+.It Dv SO_RFCOMM_MTU
+Returns the maximum transfer unit size (in bytes) for the underlying RFCOMM
+channel.
+Note that application still can write/read bigger chunks to/from the socket.
+.It Dv SO_RFCOMM_FC_INFO
Return the flow control information for the underlying RFCOMM channel.
.El
.Pp
The
-.Dv net.bluetooth.rfcomm.sockets.stream.timeout
-variable, that can be examined and set via
+.Va net.bluetooth.rfcomm.sockets.stream.timeout
+variable, that can be examined and set via
.Xr sysctl 8 ,
controls the connection timeout (in seconds) for RFCOMM sockets.
-.Pp
.Sh HOOKS
-These node types support hooks with arbitrary names (as long as they are
+These node types support hooks with arbitrary names (as long as they are
unique) and always accept hook connection requests.
.Sh NETGRAPH CONTROL MESSAGES
These node types support the generic control messages.
.Sh SHUTDOWN
These nodes are persistent and cannot be shut down.
.Sh BUGS
-Most likely. Please report if found.
+Most likely.
+Please report if found.
.Sh SEE ALSO
+.Xr btsockstat 1 ,
.Xr socket 2 ,
.Xr netgraph 4 ,
-.Xr ngctl 8 ,
-.Xr sysctl 8 ,
.Xr ng_bluetooth 4 ,
.Xr ng_hci 4 ,
.Xr ng_l2cap 4 ,
-.Xr btsockstat 1
+.Xr ngctl 8 ,
+.Xr sysctl 8
.Sh HISTORY
The
.Nm