Deleted Added
sdiff udiff text old ( 144723 ) new ( 152242 )
full compact
1/*
2 * ng_btsocket.c
3 */
4
5/*-
6 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
7 * All rights reserved.
8 *

--- 14 unchanged lines hidden (view full) ---

23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * $Id: ng_btsocket.c,v 1.4 2003/09/14 23:29:06 max Exp $
31 * $FreeBSD: head/sys/netgraph/bluetooth/socket/ng_btsocket.c 152242 2005-11-09 13:29:16Z ru $
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/bitstring.h>
37#include <sys/errno.h>
38#include <sys/domain.h>
39#include <sys/kernel.h>

--- 95 unchanged lines hidden (view full) ---

135};
136
137/*
138 * Definitions of protocols supported in the BLUETOOTH domain
139 */
140
141static struct protosw ng_btsocket_protosw[] = {
142{
143 .pr_type = SOCK_RAW,
144 .pr_domain = &ng_btsocket_domain,
145 .pr_protocol = BLUETOOTH_PROTO_HCI,
146 .pr_flags = PR_ATOMIC|PR_ADDR,
147 .pr_ctloutput = ng_btsocket_hci_raw_ctloutput,
148 .pr_init = ng_btsocket_hci_raw_init,
149 .pr_usrreqs = &ng_btsocket_hci_raw_usrreqs,
150},
151{
152 .pr_type = SOCK_RAW,
153 .pr_domain = &ng_btsocket_domain,
154 .pr_protocol = BLUETOOTH_PROTO_L2CAP,
155 .pr_flags = PR_ATOMIC|PR_ADDR,
156 .pr_init = ng_btsocket_l2cap_raw_init,
157 .pr_usrreqs = &ng_btsocket_l2cap_raw_usrreqs,
158},
159{
160 .pr_type = SOCK_SEQPACKET,
161 .pr_domain = &ng_btsocket_domain,
162 .pr_protocol = BLUETOOTH_PROTO_L2CAP,
163 .pr_flags = PR_ATOMIC|PR_CONNREQUIRED,
164 .pr_ctloutput = ng_btsocket_l2cap_ctloutput,
165 .pr_init = ng_btsocket_l2cap_init,
166 .pr_usrreqs = &ng_btsocket_l2cap_usrreqs,
167},
168{
169 .pr_type = SOCK_STREAM,
170 .pr_domain = &ng_btsocket_domain,
171 .pr_protocol = BLUETOOTH_PROTO_RFCOMM,
172 .pr_flags = PR_CONNREQUIRED,
173 .pr_ctloutput = ng_btsocket_rfcomm_ctloutput,
174 .pr_init = ng_btsocket_rfcomm_init,
175 .pr_usrreqs = &ng_btsocket_rfcomm_usrreqs,
176}
177};
178#define ng_btsocket_protosw_size \
179 (sizeof(ng_btsocket_protosw)/sizeof(ng_btsocket_protosw[0]))
180#define ng_btsocket_protosw_end \
181 &ng_btsocket_protosw[ng_btsocket_protosw_size]
182
183/*
184 * BLUETOOTH domain
185 */
186
187struct domain ng_btsocket_domain = {
188 .dom_family = AF_BLUETOOTH,
189 .dom_name = "bluetooth",
190 .dom_protosw = ng_btsocket_protosw,
191 .dom_protoswNPROTOSW = ng_btsocket_protosw_end
192};
193
194/*
195 * Socket sysctl tree
196 */
197
198SYSCTL_NODE(_net_bluetooth_hci, OID_AUTO, sockets, CTLFLAG_RW,
199 0, "Bluetooth HCI sockets family");

--- 51 unchanged lines hidden ---