Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for BlUETOOTH_LE_LL frames #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crackle.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#define PFH_BTLE (30006)
#define BLUETOOTH_LE_LL_WITH_PHDR 256
#define PPI 192
#define BLUETOOTH_LE_LL 251

// CACE PPI headers
typedef struct ppi_packetheader {
Expand Down Expand Up @@ -453,6 +454,14 @@ static void packet_decrypter(crackle_state_t *state,
++state->total_processed;
}

void packet_handler_lell(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes)
{
crackle_state_t *state;
state = (crackle_state_t *)user;
size_t header_len = 0;
state->btle_handler(state, h, bytes, header_len, h->caplen);
}

void packet_handler_ble_phdr(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes) {
crackle_state_t *state;
state = (crackle_state_t *)user;
Expand Down Expand Up @@ -1307,6 +1316,7 @@ int main(int argc, char **argv) {
errx(1, "%s", errbuf);

cap_dlt = pcap_datalink(cap);
printf("PCAP contains [%s] frames\n", pcap_datalink_val_to_name(cap_dlt));
snaplen = pcap_snapshot(cap);

if(verbose)
Expand All @@ -1320,6 +1330,9 @@ int main(int argc, char **argv) {
case PPI:
packet_handler = packet_handler_ppi;
break;
case BLUETOOTH_LE_LL:
packet_handler = packet_handler_lell;
break;
default:
printf("Frames inside PCAP file not supported ! dlt_name=%s\n", pcap_datalink_val_to_name(cap_dlt));
printf("Frames format supported:\n");
Expand Down