xref: /freebsd/usr.sbin/bluetooth/btpand/bnep.h (revision 2a63c3be158216222d89a073dcbd6a72ee4aab5a)
17718ced0SMaksim Yevmenkin /*	$NetBSD: bnep.h,v 1.1 2008/08/17 13:20:57 plunky Exp $	*/
27718ced0SMaksim Yevmenkin 
37718ced0SMaksim Yevmenkin /*-
4*b61a5730SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
51de7b4b8SPedro F. Giffuni  *
67718ced0SMaksim Yevmenkin  * Copyright (c) 2008 Iain Hibbert
77718ced0SMaksim Yevmenkin  * All rights reserved.
87718ced0SMaksim Yevmenkin  *
97718ced0SMaksim Yevmenkin  * Redistribution and use in source and binary forms, with or without
107718ced0SMaksim Yevmenkin  * modification, are permitted provided that the following conditions
117718ced0SMaksim Yevmenkin  * are met:
127718ced0SMaksim Yevmenkin  * 1. Redistributions of source code must retain the above copyright
137718ced0SMaksim Yevmenkin  *    notice, this list of conditions and the following disclaimer.
147718ced0SMaksim Yevmenkin  * 2. Redistributions in binary form must reproduce the above copyright
157718ced0SMaksim Yevmenkin  *    notice, this list of conditions and the following disclaimer in the
167718ced0SMaksim Yevmenkin  *    documentation and/or other materials provided with the distribution.
177718ced0SMaksim Yevmenkin  *
187718ced0SMaksim Yevmenkin  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
197718ced0SMaksim Yevmenkin  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
207718ced0SMaksim Yevmenkin  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
217718ced0SMaksim Yevmenkin  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
227718ced0SMaksim Yevmenkin  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
237718ced0SMaksim Yevmenkin  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
247718ced0SMaksim Yevmenkin  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
257718ced0SMaksim Yevmenkin  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
267718ced0SMaksim Yevmenkin  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
277718ced0SMaksim Yevmenkin  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
287718ced0SMaksim Yevmenkin  */
297718ced0SMaksim Yevmenkin 
307718ced0SMaksim Yevmenkin 
317718ced0SMaksim Yevmenkin /*
327718ced0SMaksim Yevmenkin  * Constants defined in the Bluetooth Network Encapsulation
337718ced0SMaksim Yevmenkin  * Protocol (BNEP) specification v1.0
347718ced0SMaksim Yevmenkin  */
357718ced0SMaksim Yevmenkin 
367718ced0SMaksim Yevmenkin #define	BNEP_MTU_MIN		1691
377718ced0SMaksim Yevmenkin 
387718ced0SMaksim Yevmenkin #define BNEP_EXT		0x80
397718ced0SMaksim Yevmenkin #define	BNEP_TYPE(x)		((x) & 0x7f)
407718ced0SMaksim Yevmenkin #define BNEP_TYPE_EXT(x)	(((x) & BNEP_EXT) == BNEP_EXT)
417718ced0SMaksim Yevmenkin 
427718ced0SMaksim Yevmenkin /* BNEP packet types */
437718ced0SMaksim Yevmenkin #define	BNEP_GENERAL_ETHERNET			0x00
447718ced0SMaksim Yevmenkin #define	BNEP_CONTROL				0x01
457718ced0SMaksim Yevmenkin #define	BNEP_COMPRESSED_ETHERNET		0x02
467718ced0SMaksim Yevmenkin #define	BNEP_COMPRESSED_ETHERNET_SRC_ONLY	0x03
477718ced0SMaksim Yevmenkin #define	BNEP_COMPRESSED_ETHERNET_DST_ONLY	0x04
487718ced0SMaksim Yevmenkin 
497718ced0SMaksim Yevmenkin /* BNEP extension header types */
507718ced0SMaksim Yevmenkin #define	BNEP_EXTENSION_CONTROL			0x00
517718ced0SMaksim Yevmenkin 
527718ced0SMaksim Yevmenkin /* BNEP control types */
537718ced0SMaksim Yevmenkin #define	BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD	0x00
547718ced0SMaksim Yevmenkin #define	BNEP_SETUP_CONNECTION_REQUEST		0x01
557718ced0SMaksim Yevmenkin #define	BNEP_SETUP_CONNECTION_RESPONSE		0x02
567718ced0SMaksim Yevmenkin #define	BNEP_FILTER_NET_TYPE_SET		0x03
577718ced0SMaksim Yevmenkin #define	BNEP_FILTER_NET_TYPE_RESPONSE		0x04
587718ced0SMaksim Yevmenkin #define	BNEP_FILTER_MULTI_ADDR_SET		0x05
597718ced0SMaksim Yevmenkin #define	BNEP_FILTER_MULTI_ADDR_RESPONSE		0x06
607718ced0SMaksim Yevmenkin 
617718ced0SMaksim Yevmenkin /* BNEP setup response codes */
627718ced0SMaksim Yevmenkin #define	BNEP_SETUP_SUCCESS		0x0000
637718ced0SMaksim Yevmenkin #define	BNEP_SETUP_INVALID_SRC_UUID	0x0001
647718ced0SMaksim Yevmenkin #define	BNEP_SETUP_INVALID_DST_UUID	0x0002
657718ced0SMaksim Yevmenkin #define	BNEP_SETUP_INVALID_UUID_SIZE	0x0003
667718ced0SMaksim Yevmenkin #define	BNEP_SETUP_NOT_ALLOWED		0x0004
677718ced0SMaksim Yevmenkin 
687718ced0SMaksim Yevmenkin /* BNEP filter return codes */
697718ced0SMaksim Yevmenkin #define	BNEP_FILTER_SUCCESS		0x0000
707718ced0SMaksim Yevmenkin #define	BNEP_FILTER_UNSUPPORTED_REQUEST	0x0001
717718ced0SMaksim Yevmenkin #define	BNEP_FILTER_INVALID_RANGE	0x0002
727718ced0SMaksim Yevmenkin #define	BNEP_FILTER_TOO_MANY_FILTERS	0x0003
737718ced0SMaksim Yevmenkin #define	BNEP_FILTER_SECURITY_FAILURE	0x0004
74