1213365Smarcel/*	$NetBSD: bnep.h,v 1.1 2008/08/17 13:20:57 plunky Exp $	*/
2213365Smarcel
3213365Smarcel/*-
4213365Smarcel * Copyright (c) 2008 Iain Hibbert
5213365Smarcel * All rights reserved.
6213365Smarcel *
7213365Smarcel * Redistribution and use in source and binary forms, with or without
8213365Smarcel * modification, are permitted provided that the following conditions
9213365Smarcel * are met:
10213365Smarcel * 1. Redistributions of source code must retain the above copyright
11213365Smarcel *    notice, this list of conditions and the following disclaimer.
12213365Smarcel * 2. Redistributions in binary form must reproduce the above copyright
13213365Smarcel *    notice, this list of conditions and the following disclaimer in the
14213365Smarcel *    documentation and/or other materials provided with the distribution.
15213365Smarcel *
16213365Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17213365Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18213365Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19213365Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20213365Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21213365Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22213365Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23213365Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24213365Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25213365Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26213365Smarcel */
27213365Smarcel
28213365Smarcel/* $FreeBSD: releng/11.0/usr.sbin/bluetooth/btpand/bnep.h 187938 2009-01-30 22:23:21Z emax $ */
29213365Smarcel
30213365Smarcel/*
31213365Smarcel * Constants defined in the Bluetooth Network Encapsulation
32213365Smarcel * Protocol (BNEP) specification v1.0
33213365Smarcel */
34213365Smarcel
35213365Smarcel#define	BNEP_MTU_MIN		1691
36213365Smarcel
37213365Smarcel#define BNEP_EXT		0x80
38213365Smarcel#define	BNEP_TYPE(x)		((x) & 0x7f)
39213365Smarcel#define BNEP_TYPE_EXT(x)	(((x) & BNEP_EXT) == BNEP_EXT)
40213365Smarcel
41213365Smarcel/* BNEP packet types */
42213365Smarcel#define	BNEP_GENERAL_ETHERNET			0x00
43213365Smarcel#define	BNEP_CONTROL				0x01
44213365Smarcel#define	BNEP_COMPRESSED_ETHERNET		0x02
45213365Smarcel#define	BNEP_COMPRESSED_ETHERNET_SRC_ONLY	0x03
46213365Smarcel#define	BNEP_COMPRESSED_ETHERNET_DST_ONLY	0x04
47213365Smarcel
48213365Smarcel/* BNEP extension header types */
49213365Smarcel#define	BNEP_EXTENSION_CONTROL			0x00
50213365Smarcel
51213365Smarcel/* BNEP control types */
52213365Smarcel#define	BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD	0x00
53213365Smarcel#define	BNEP_SETUP_CONNECTION_REQUEST		0x01
54213365Smarcel#define	BNEP_SETUP_CONNECTION_RESPONSE		0x02
55213365Smarcel#define	BNEP_FILTER_NET_TYPE_SET		0x03
56213365Smarcel#define	BNEP_FILTER_NET_TYPE_RESPONSE		0x04
57213365Smarcel#define	BNEP_FILTER_MULTI_ADDR_SET		0x05
58213365Smarcel#define	BNEP_FILTER_MULTI_ADDR_RESPONSE		0x06
59213365Smarcel
60213365Smarcel/* BNEP setup response codes */
61213365Smarcel#define	BNEP_SETUP_SUCCESS		0x0000
62213365Smarcel#define	BNEP_SETUP_INVALID_SRC_UUID	0x0001
63213365Smarcel#define	BNEP_SETUP_INVALID_DST_UUID	0x0002
64213365Smarcel#define	BNEP_SETUP_INVALID_UUID_SIZE	0x0003
65213365Smarcel#define	BNEP_SETUP_NOT_ALLOWED		0x0004
66213365Smarcel
67213365Smarcel/* BNEP filter return codes */
68213365Smarcel#define	BNEP_FILTER_SUCCESS		0x0000
69213365Smarcel#define	BNEP_FILTER_UNSUPPORTED_REQUEST	0x0001
70213365Smarcel#define	BNEP_FILTER_INVALID_RANGE	0x0002
71213365Smarcel#define	BNEP_FILTER_TOO_MANY_FILTERS	0x0003
72213365Smarcel#define	BNEP_FILTER_SECURITY_FAILURE	0x0004
73213365Smarcel