mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'contrib/github_pr_7966' into 'master'
Changed argument pointer to correct data (GitHub PR) Closes IDFGH-6303 See merge request espressif/esp-idf!16351
This commit is contained in:
commit
81cd70cf7f
@ -175,10 +175,10 @@ esp_err_t pcap_print_summary(pcap_file_handle_t pcap, FILE *print_file)
|
||||
real_read = fread(packet_payload, payload_length, 1, pcap->file);
|
||||
ESP_GOTO_ON_FALSE(real_read == 1, ESP_FAIL, err, TAG, "read payload error");
|
||||
// print packet information
|
||||
// currently only print info for 802.11
|
||||
if (file_header.link_type == PCAP_LINK_TYPE_802_11) {
|
||||
fprintf(print_file, "Packet Type: %2x\n", (packet_payload[0] >> 4) & 0x03);
|
||||
fprintf(print_file, "Packet Subtype: %2x\n", packet_payload[0] & 0x0F);
|
||||
// Frame Control Field is coded as LSB first
|
||||
fprintf(print_file, "Frame Type: %2x\n", (packet_payload[0] >> 2) & 0x03);
|
||||
fprintf(print_file, "Frame Subtype: %2x\n", (packet_payload[0] >> 4) & 0x0F);
|
||||
fprintf(print_file, "Destination: ");
|
||||
for (int j = 0; j < 5; j++) {
|
||||
fprintf(print_file, "%2x ", packet_payload[4 + j]);
|
||||
|
@ -1,3 +1,5 @@
|
||||
# SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import re
|
||||
@ -33,8 +35,8 @@ def test_examples_simple_sniffer(env, _): # type: (Any, Any) -> None
|
||||
dut.expect(re.compile(r'Timestamp \(Microseconds\): [0-9]*'))
|
||||
dut.expect(re.compile(r'Capture Length: [0-9]*'))
|
||||
dut.expect(re.compile(r'Packet Length: [0-9]*'))
|
||||
dut.expect(re.compile(r'Packet Type: .*'))
|
||||
dut.expect(re.compile(r'Packet Subtype: .*'))
|
||||
dut.expect(re.compile(r'Frame Type: .*'))
|
||||
dut.expect(re.compile(r'Frame Subtype: .*'))
|
||||
dut.expect(re.compile(r'Destination: .*'))
|
||||
dut.expect(re.compile(r'Source: .*'))
|
||||
dut.expect('Pcap packet Number: 10')
|
||||
|
@ -143,7 +143,7 @@ static void wifi_sniffer_cb(void *recv_buf, wifi_promiscuous_pkt_type_t type)
|
||||
/* For now, the sniffer only dumps the length of the MISC type frame */
|
||||
if (type != WIFI_PKT_MISC && !sniffer->rx_ctrl.rx_state) {
|
||||
packet_info.length -= SNIFFER_PAYLOAD_FCS_LEN;
|
||||
queue_packet(recv_buf, &packet_info);
|
||||
queue_packet(sniffer->payload, &packet_info);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user