From cb3edcf31f7136abf65d7f8edc919ef3b52cd136 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 15 May 2005 20:28:18 +0000 Subject: [PATCH] hcidump: Track the RFCOMM DLCI value --- tools/parser/l2cap.c | 4 +++- tools/parser/parser.h | 1 + tools/parser/rfcomm.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/parser/l2cap.c b/tools/parser/l2cap.c index c3a0e95f2..7332967d5 100644 --- a/tools/parser/l2cap.c +++ b/tools/parser/l2cap.c @@ -851,7 +851,8 @@ void l2cap_dump(int level, struct frame *frm) return; } - if (fr->data) free(fr->data); + if (fr->data) + free(fr->data); if (!(fr->data = malloc(dlen + L2CAP_HDR_SIZE))) { perror("Can't allocate L2CAP reassembly buffer"); @@ -866,6 +867,7 @@ void l2cap_dump(int level, struct frame *frm) fr->handle = frm->handle; fr->cid = frm->cid; fr->num = frm->num; + fr->dlci = frm->dlci; fr->channel = frm->channel; } else { if (!(fr = get_frame(frm->handle))) { diff --git a/tools/parser/parser.h b/tools/parser/parser.h index 96feee507..15642db8c 100644 --- a/tools/parser/parser.h +++ b/tools/parser/parser.h @@ -41,6 +41,7 @@ struct frame { int handle; int cid; int num; + int dlci; int channel; long flags; struct timeval ts; diff --git a/tools/parser/rfcomm.c b/tools/parser/rfcomm.c index 331ea6555..c18ef8aea 100644 --- a/tools/parser/rfcomm.c +++ b/tools/parser/rfcomm.c @@ -264,6 +264,7 @@ static inline void uih_frame(int level, struct frame *frm, long_frame_head *head printf("\n"); frm->len--; + frm->dlci = GET_DLCI(head->addr); frm->channel = head->addr.server_chn; proto = get_proto(frm->handle, RFCOMM_PSM, frm->channel); -- 2.47.3