diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-02-08 16:19:12 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-02-09 00:29:51 +0000 |
commit | 1f5f63f8ef98bfe9c4d734674cee0df64855555d (patch) | |
tree | 133dd3563cc8d2d29dd85d4d43cd9a4636283192 /epan/dissectors/packet-btl2cap.c | |
parent | e4c5efafb7da2d25b7d47fe2dac3b1556c0b67b0 (diff) |
Generalize wtap_pkthdr into a structure for packet and non-packet records.
Separate the stuff that any record could have from the stuff that only
particular record types have; put the latter into a union, and put all
that into a wtap_rec structure.
Add some record-type checks as necessary.
Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2
Reviewed-on: https://code.wireshark.org/review/25696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-btl2cap.c')
-rw-r--r-- | epan/dissectors/packet-btl2cap.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c index 7174fb6d0d..363a5e41ca 100644 --- a/epan/dissectors/packet-btl2cap.c +++ b/epan/dissectors/packet-btl2cap.c @@ -705,8 +705,8 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 chandle; psm_data_t *psm_data; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -767,8 +767,8 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 adapter_id; guint32 chandle; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -859,8 +859,8 @@ dissect_le_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *pinf guint32 chandle; psm_data_t *psm_data; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -920,8 +920,8 @@ dissect_le_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *pinf guint32 adapter_id; guint32 chandle; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -1006,8 +1006,8 @@ dissect_le_credit_based_connresponse(tvbuff_t *tvb, int offset, packet_info *pin guint32 chandle; guint32 cid; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -1268,8 +1268,8 @@ dissect_configrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 chandle; guint32 cid; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -1465,8 +1465,8 @@ dissect_configresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 chandle; guint32 cid; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -1556,8 +1556,8 @@ dissect_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 chandle; guint32 cid; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -1757,8 +1757,8 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 key_scid; guint32 key_dcid; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -1849,8 +1849,8 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 chandle; guint32 key_dcid; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; @@ -2435,8 +2435,8 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) l2cap_data = wmem_new(wmem_packet_scope(), btl2cap_data_t); - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - l2cap_data->interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + l2cap_data->interface_id = pinfo->rec->rec_header.packet_header.interface_id; else l2cap_data->interface_id = HCI_INTERFACE_DEFAULT; if (acl_data) { @@ -2712,8 +2712,8 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) guint32 chandle; guint32 key_cid; - if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) - interface_id = pinfo->phdr->interface_id; + if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) + interface_id = pinfo->rec->rec_header.packet_header.interface_id; else interface_id = HCI_INTERFACE_DEFAULT; adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT; |