tizen 2.3.1 release
[framework/connectivity/bluez.git] / monitor / packet.h
1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2011-2014  Intel Corporation
6  *  Copyright (C) 2002-2010  Marcel Holtmann <marcel@holtmann.org>
7  *
8  *
9  *  This library is free software; you can redistribute it and/or
10  *  modify it under the terms of the GNU Lesser General Public
11  *  License as published by the Free Software Foundation; either
12  *  version 2.1 of the License, or (at your option) any later version.
13  *
14  *  This library is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  *  Lesser General Public License for more details.
18  *
19  *  You should have received a copy of the GNU Lesser General Public
20  *  License along with this library; if not, write to the Free Software
21  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22  *
23  */
24
25 #include <stdint.h>
26 #include <stdbool.h>
27 #include <sys/time.h>
28
29 #define PACKET_FILTER_SHOW_INDEX        (1 << 0)
30 #define PACKET_FILTER_SHOW_DATE         (1 << 1)
31 #define PACKET_FILTER_SHOW_TIME         (1 << 2)
32 #define PACKET_FILTER_SHOW_TIME_OFFSET  (1 << 3)
33 #define PACKET_FILTER_SHOW_ACL_DATA     (1 << 4)
34 #define PACKET_FILTER_SHOW_SCO_DATA     (1 << 5)
35
36 void packet_set_filter(unsigned long filter);
37 void packet_add_filter(unsigned long filter);
38 void packet_del_filter(unsigned long filter);
39
40 void packet_select_index(uint16_t index);
41
42 void packet_hexdump(const unsigned char *buf, uint16_t len);
43 void packet_print_error(const char *label, uint8_t error);
44 void packet_print_version(const char *label, uint8_t version,
45                                 const char *sublabel, uint16_t subversion);
46 void packet_print_company(const char *label, uint16_t company);
47 void packet_print_addr(const char *label, const void *data, bool random);
48 void packet_print_ad(const void *data, uint8_t size);
49 void packet_print_features_lmp(const uint8_t *features, uint8_t page);
50 void packet_print_features_ll(const uint8_t *features);
51 void packet_print_channel_map_lmp(const uint8_t *map);
52 void packet_print_channel_map_ll(const uint8_t *map);
53 void packet_print_io_capability(uint8_t capability);
54 void packet_print_io_authentication(uint8_t authentication);
55
56 void packet_control(struct timeval *tv, uint16_t index, uint16_t opcode,
57                                         const void *data, uint16_t size);
58 void packet_monitor(struct timeval *tv, uint16_t index, uint16_t opcode,
59                                         const void *data, uint16_t size);
60 void packet_simulator(struct timeval *tv, uint16_t frequency,
61                                         const void *data, uint16_t size);
62
63 void packet_new_index(struct timeval *tv, uint16_t index, const char *label,
64                                 uint8_t type, uint8_t bus, const char *name);
65 void packet_del_index(struct timeval *tv, uint16_t index, const char *label);
66
67 void packet_hci_command(struct timeval *tv, uint16_t index,
68                                         const void *data, uint16_t size);
69 void packet_hci_event(struct timeval *tv, uint16_t index,
70                                         const void *data, uint16_t size);
71 void packet_hci_acldata(struct timeval *tv, uint16_t index, bool in,
72                                         const void *data, uint16_t size);
73 void packet_hci_scodata(struct timeval *tv, uint16_t index, bool in,
74                                         const void *data, uint16_t size);
75
76 void packet_todo(void);