3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
6 * Copyright (C) 2002-2008 Marcel Holtmann <marcel@holtmann.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #include <bluetooth/bluetooth.h>
34 #define ETH_ALEN 6 /* Octets in one ethernet addr (ipv4) */
37 #define BNEP_BASE_UUID 0x0000000000001000800000805F9B34FB
38 #define BNEP_UUID16 0x02
39 #define BNEP_UUID32 0x04
40 #define BNEP_UUID128 0x16
42 #define BNEP_SVC_PANU 0x1115
43 #define BNEP_SVC_NAP 0x1116
44 #define BNEP_SVC_GN 0x1117
46 /* BNEP packet types */
47 #define BNEP_GENERAL 0x00
48 #define BNEP_CONTROL 0x01
49 #define BNEP_COMPRESSED 0x02
50 #define BNEP_COMPRESSED_SRC_ONLY 0x03
51 #define BNEP_COMPRESSED_DST_ONLY 0x04
53 /* BNEP control types */
54 #define BNEP_CMD_NOT_UNDERSTOOD 0x00
55 #define BNEP_SETUP_CONN_REQ 0x01
56 #define BNEP_SETUP_CONN_RSP 0x02
57 #define BNEP_FILTER_NET_TYPE_SET 0x03
58 #define BNEP_FILTER_NET_TYPE_RSP 0x04
59 #define BNEP_FILTER_MULT_ADDR_SET 0x05
60 #define BNEP_FILTER_MULT_ADDR_RSP 0x06
62 /* BNEP response messages */
63 #define BNEP_SUCCESS 0x00
65 #define BNEP_CONN_INVALID_DST 0x01
66 #define BNEP_CONN_INVALID_SRC 0x02
67 #define BNEP_CONN_INVALID_SVC 0x03
68 #define BNEP_CONN_NOT_ALLOWED 0x04
70 #define BNEP_FILTER_UNSUPPORTED_REQ 0x01
71 #define BNEP_FILTER_INVALID_RANGE 0x02
72 #define BNEP_FILTER_INVALID_MCADDR 0x02
73 #define BNEP_FILTER_LIMIT_REACHED 0x03
74 #define BNEP_FILTER_DENIED_SECURITY 0x04
78 #define BNEP_FLUSH_TO 0xffff
79 #define BNEP_CONNECT_TO 15
80 #define BNEP_FILTER_TO 15
87 #define BNEP_TYPE_MASK 0x7f
88 #define BNEP_EXT_HEADER 0x80
90 struct bnep_setup_conn_req {
95 } __attribute__((packed));
97 struct bnep_set_filter_req {
102 } __attribute__((packed));
104 struct bnep_control_rsp {
108 } __attribute__((packed));
110 struct bnep_ext_hdr {
114 } __attribute__((packed));
116 /* BNEP ioctl defines */
117 #define BNEPCONNADD _IOW('B', 200, int)
118 #define BNEPCONNDEL _IOW('B', 201, int)
119 #define BNEPGETCONNLIST _IOR('B', 210, int)
120 #define BNEPGETCONNINFO _IOR('B', 211, int)
122 struct bnep_connadd_req {
123 int sock; /* Connected socket */
126 char device[16]; /* Name of the Ethernet device */
129 struct bnep_conndel_req {
131 uint8_t dst[ETH_ALEN];
134 struct bnep_conninfo {
138 uint8_t dst[ETH_ALEN];
142 struct bnep_connlist_req {
144 struct bnep_conninfo *ci;
151 #endif /* __BNEP_H */