summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Geoffrey Kruse2021-03-07 10:03:55 -0800
committerGravatar Nikias Bassen2022-05-05 18:54:55 +0200
commitaee82afabfcf763618f58c95f9613b40dcf334b0 (patch)
tree16508d80b64f52d915e5bf122a0c4cf6d0aca85f /tools
parenta070a2e0b8774132a2c90822ba22580c4d1842da (diff)
downloadlibimobiledevice-aee82afabfcf763618f58c95f9613b40dcf334b0.tar.gz
libimobiledevice-aee82afabfcf763618f58c95f9613b40dcf334b0.tar.bz2
idevicebtlogger: Cleanup warnings, todos and magic numbers
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicebtlogger.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/tools/idevicebtlogger.c b/tools/idevicebtlogger.c
index fc42290..5446ecf 100644
--- a/tools/idevicebtlogger.c
+++ b/tools/idevicebtlogger.c
@@ -43,9 +43,7 @@
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/bt_packet_logger.h>
-#include <pcap.h>// todo windows???
-
-#define BT_MAX_PACKET_SIZE 65535
+#include <pcap.h>
static int quit_flag = 0;
static int exit_on_disconnect = 0;
@@ -57,12 +55,6 @@ static int use_network = 0;
static char* out_filename = NULL;
static pcap_dumper_t * dump;
-typedef struct {
- uint32_t length;
- uint32_t ts_secs;
- uint32_t ts_usecs;
-} PacketHeaderType;
-
typedef enum {
HCI_COMMAND = 0x00,
HCI_EVENT = 0x01,
@@ -72,12 +64,12 @@ typedef enum {
static void bt_packet_logger_callback(uint8_t * data, uint16_t len, void *user_data)
{
- PacketHeaderType * header = (PacketHeaderType *)data;
- uint16_t offset = sizeof(PacketHeaderType);
+ bt_packet_logger_header_t * header = (bt_packet_logger_header_t *)data;
+ uint16_t offset = sizeof(bt_packet_logger_header_t);
struct pcap_pkthdr pcap_header;
pcap_header.caplen = ntohl(header->length);
- pcap_header.len = len - sizeof(PacketHeaderType);
+ pcap_header.len = len - sizeof(bt_packet_logger_header_t);
pcap_header.ts.tv_sec = ntohl(header->ts_secs);
pcap_header.ts.tv_usec = ntohl(header->ts_usecs);