1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <sys/param.h>
19 #include <sys/domain.h>
20 #include <sys/protosw.h>
21 #include <sys/socket.h>
22 #include <sys/timeout.h>
23
24 #include <netbt/bluetooth.h>
25 #include <netbt/bt_var.h>
26 #include <netbt/hci.h>
27 #include <netbt/l2cap.h>
28 #include <netbt/rfcomm.h>
29 #include <netbt/sco.h>
30
31 struct domain btdomain;
32
33 struct protosw btsw[] = {
34 { SOCK_RAW, &btdomain, BTPROTO_HCI,
35 PR_ATOMIC | PR_ADDR,
36 NULL, NULL, NULL,
37 hci_ctloutput, hci_usrreq, NULL,
38 NULL, NULL, NULL,
39 NULL
40 },
41 { SOCK_SEQPACKET, &btdomain, BTPROTO_SCO,
42 PR_ATOMIC | PR_CONNREQUIRED,
43 NULL, NULL, NULL,
44 sco_ctloutput, sco_usrreq, NULL,
45 NULL, NULL, NULL,
46 NULL
47 },
48 { SOCK_SEQPACKET, &btdomain, BTPROTO_L2CAP,
49 PR_ATOMIC | PR_CONNREQUIRED,
50 NULL, NULL, NULL,
51 l2cap_ctloutput, l2cap_usrreq, l2cap_init,
52 NULL, NULL, NULL,
53 NULL
54 },
55 { SOCK_STREAM, &btdomain, BTPROTO_RFCOMM,
56 PR_CONNREQUIRED | PR_WANTRCVD,
57 NULL, NULL, NULL,
58 rfcomm_ctloutput, rfcomm_usrreq, rfcomm_init,
59 NULL, NULL, NULL,
60 NULL
61 }
62 };
63
64 struct domain btdomain = {
65 AF_BLUETOOTH, "bluetooth",
66 NULL, NULL, NULL,
67 btsw, &btsw[sizeof(btsw) / sizeof(btsw[0])], NULL,
68 NULL, 32, sizeof(struct sockaddr_bt),
69 NULL, NULL
70 };