Skip to content

Commit

Permalink
libosdp: pcap: Bump utils submodule to fix issues
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Feb 17, 2024
1 parent c586add commit 888993b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/osdp_pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ void osdp_packet_capture_init(struct osdp_pd *pd)
is_pd_mode(pd) ? "" : "cp-", pd->address);
n += add_iso8601_utc_datetime(path + n, sizeof(path) - n);
strcpy(path + n, ".pcap");
cap = pcap_create(path, OSDP_PACKET_BUF_SIZE,
OSDP_PCAP_LINK_TYPE);
cap = pcap_start(path, OSDP_PACKET_BUF_SIZE, OSDP_PCAP_LINK_TYPE);
if (cap) {
LOG_WRN("Tracing: capturing packets to '%s'");
LOG_WRN("Tracing: a graceful teardown of libosdp ctx is required"
Expand All @@ -36,7 +35,7 @@ void osdp_packet_capture_finish(struct osdp_pd *pd)
pcap_t *cap = pd->packet_capture_ctx;

assert(cap);
pcap_dump(cap);
pcap_stop(cap);
}

void osdp_capture_packet(struct osdp_pd *pd, uint8_t *buf, int len)
Expand All @@ -45,5 +44,5 @@ void osdp_capture_packet(struct osdp_pd *pd, uint8_t *buf, int len)

assert(cap);
assert(len <= OSDP_PACKET_BUF_SIZE);
pcap_add_record(cap, buf, len);
pcap_add(cap, buf, len);
}
2 changes: 1 addition & 1 deletion utils

0 comments on commit 888993b

Please sign in to comment.