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