4 * Copyright (c) 2008 Iain Hibbert
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * Constants defined in the Bluetooth Network Encapsulation
30 * Protocol (BNEP) specification v1.0
33 #define BNEP_MTU_MIN 1691
36 #define BNEP_TYPE(x) ((x) & 0x7f)
37 #define BNEP_TYPE_EXT(x) (((x) & BNEP_EXT) == BNEP_EXT)
39 /* BNEP packet types */
40 #define BNEP_GENERAL_ETHERNET 0x00
41 #define BNEP_CONTROL 0x01
42 #define BNEP_COMPRESSED_ETHERNET 0x02
43 #define BNEP_COMPRESSED_ETHERNET_SRC_ONLY 0x03
44 #define BNEP_COMPRESSED_ETHERNET_DST_ONLY 0x04
46 /* BNEP extension header types */
47 #define BNEP_EXTENSION_CONTROL 0x00
49 /* BNEP control types */
50 #define BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD 0x00
51 #define BNEP_SETUP_CONNECTION_REQUEST 0x01
52 #define BNEP_SETUP_CONNECTION_RESPONSE 0x02
53 #define BNEP_FILTER_NET_TYPE_SET 0x03
54 #define BNEP_FILTER_NET_TYPE_RESPONSE 0x04
55 #define BNEP_FILTER_MULTI_ADDR_SET 0x05
56 #define BNEP_FILTER_MULTI_ADDR_RESPONSE 0x06
58 /* BNEP setup response codes */
59 #define BNEP_SETUP_SUCCESS 0x0000
60 #define BNEP_SETUP_INVALID_SRC_UUID 0x0001
61 #define BNEP_SETUP_INVALID_DST_UUID 0x0002
62 #define BNEP_SETUP_INVALID_UUID_SIZE 0x0003
63 #define BNEP_SETUP_NOT_ALLOWED 0x0004
65 /* BNEP filter return codes */
66 #define BNEP_FILTER_SUCCESS 0x0000
67 #define BNEP_FILTER_UNSUPPORTED_REQUEST 0x0001
68 #define BNEP_FILTER_INVALID_RANGE 0x0002
69 #define BNEP_FILTER_TOO_MANY_FILTERS 0x0003
70 #define BNEP_FILTER_SECURITY_FAILURE 0x0004