Sort cases in pcap_get_phdr_size(), add a missing one for WTAP_ENCAP_NFC_LLCP.

Sort the cases to match the order in other routines.

That turned up a missing case for WTAP_ENCAP_NFC_LLCP, so add it.

Change-Id: I500731322ae93c6d2efc368f16cf468f589910f3
Reviewed-on: https://code.wireshark.org/review/29858
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-09-26 10:52:25 -07:00
parent 7a07832712
commit 0a19ec761d
1 changed files with 16 additions and 12 deletions

View File

@ -2357,6 +2357,22 @@ pcap_get_phdr_size(int encap, const union wtap_pseudo_header *pseudo_header)
hdrsize = SITA_HDR_LEN;
break;
case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR:
hdrsize = (int)sizeof (struct pcap_bt_phdr);
break;
case WTAP_ENCAP_BLUETOOTH_LINUX_MONITOR:
hdrsize = (int)sizeof (struct pcap_bt_monitor_phdr);
break;
case WTAP_ENCAP_NFC_LLCP:
hdrsize = LLCP_HEADER_LEN;
break;
case WTAP_ENCAP_PPP_WITH_PHDR:
hdrsize = (int)sizeof (struct pcap_ppp_phdr);
break;
case WTAP_ENCAP_ERF:
hdrsize = (int)sizeof (struct erf_phdr);
switch (pseudo_header->erf.phdr.type & 0x7F) {
@ -2406,18 +2422,6 @@ pcap_get_phdr_size(int encap, const union wtap_pseudo_header *pseudo_header)
hdrsize = (int)sizeof (struct i2c_file_hdr);
break;
case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR:
hdrsize = (int)sizeof (struct pcap_bt_phdr);
break;
case WTAP_ENCAP_PPP_WITH_PHDR:
hdrsize = (int)sizeof (struct pcap_ppp_phdr);
break;
case WTAP_ENCAP_BLUETOOTH_LINUX_MONITOR:
hdrsize = (int)sizeof (struct pcap_bt_monitor_phdr);
break;
default:
hdrsize = 0;
break;