diff options
Diffstat (limited to 'parser/bnep.c')
-rw-r--r-- | parser/bnep.c | 86 |
1 files changed, 48 insertions, 38 deletions
diff --git a/parser/bnep.c b/parser/bnep.c index f478231..2f977a1 100644 --- a/parser/bnep.c +++ b/parser/bnep.c @@ -1,58 +1,68 @@ -/* - HCIDump - HCI packet analyzer - Copyright (C) 2000-2001 Maxim Krasnyansky <maxk@qualcomm.com> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, - OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, - TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. -*/ - -/* - BNEP parser. - Copyright (C) 2002 Takashi Sasai <sasai@sm.sony.co.jp> -*/ - /* - * $Id$ + * + * Bluetooth packet analyzer - BNEP parser + * + * Copyright (C) 2002-2003 Takashi Sasai <sasai@sm.sony.co.jp> + * Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * $Id$ */ #include <stdio.h> +#include <errno.h> #include <stdlib.h> #include <unistd.h> -#include <errno.h> #include <string.h> #include <sys/types.h> -#include <sys/socket.h> #include <netinet/in.h> -#include <bluetooth/bluetooth.h> -#include <bluetooth/hci.h> -#include <bluetooth/l2cap.h> - -#include "parser.h" -#include "bnep.h" - #include <net/ethernet.h> #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/if_ether.h> #include <arpa/inet.h> +#include "parser.h" + #define PAYLOAD_RAW_DUMP + +/* BNEP Type */ +#define BNEP_GENERAL_ETHERNET 0x00 +#define BNEP_CONTROL 0x01 +#define BNEP_COMPRESSED_ETHERNET 0x02 +#define BNEP_COMPRESSED_ETHERNET_SOURCE_ONLY 0x03 +#define BNEP_COMPRESSED_ETHERNET_DEST_ONLY 0x04 + +/* BNEP Control Packet Type */ +#define BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD 0x00 +#define BNEP_SETUP_CONNECTION_REQUEST_MSG 0x01 +#define BNEP_SETUP_CONNECTION_RESPONSE_MSG 0x02 +#define BNEP_FILTER_NET_TYPE_SET_MSG 0x03 +#define BNEP_FILTER_NET_TYPE_RESPONSE_MSG 0x04 +#define BNEP_FILTER_MULT_ADDR_SET_MSG 0x05 +#define BNEP_FILTER_MULT_ADDR_RESPONSE_MSG 0x06 + +/* BNEP Extension Type */ +#define BNEP_EXTENSION_CONTROL 0x00 + static char *get_macaddr(struct frame *frm) { static char str[20]; @@ -285,11 +295,11 @@ void bnep_dump(int level, struct frame *frm) return; } - //Extension info + /* Extension info */ if (extension) bnep_eval_extension(++level, frm); - //Control packet => No payload info + /* Control packet => No payload info */ if ((type & 0x7f) == BNEP_CONTROL) return; |