Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP/RFC] [skip ci] Add initial implementation for pcap-openvizsla module #840

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matwey
Copy link
Contributor

@matwey matwey commented Sep 1, 2019

Hi,

This module is for supporting OpenVizsla hardware USB sniffer. The implementation is based on libopenvizsla library.

DLT was assigned previously: a69f42f

@mcr
Copy link
Member

mcr commented Aug 28, 2020

Could you rebase?

@mcr mcr added this to the release-after-next milestone Aug 28, 2020
@mcr mcr added the hardware label Aug 28, 2020
@guyharris
Copy link
Member

Please add support to the autoconf script as well.

return PCAP_ERROR;
}

if ((ret = ov_capture_dispatch(handlep->ov, max_packets)) < 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way in which the callback routine can break out of the loop? If, for example, a callback routine calls pcap_breakloop(), that should cause pcap_loop() or pcap_breakloop() not to process any more packets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breakloop_op implementation has been added.

struct pcap_pkthdr pkth;
pkth.caplen = ov_to_host_16(packet->size) + sizeof(struct ov_packet);
pkth.len = pkth.caplen;
pkth.ts.tv_sec = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can no time stamp be supplied?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The device provides 24-bit timestamp with precision of 1/60 usec. Unfortunately, this value wraps around many times during the capture. What would be preferred way to provide best possible timestamp (combining 24-bit timestamp and the host wall clock)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the 24-bit timestamp goes back to zero about 3.58 times per second, is that correct? (If yes, then just a combination of UNIX time and the 24-bit timestamp does not tell the exact time when a packet was received, especially at less then 3.58 packets per second, it needs to be something else.)

Is there any way to keep the 24-bit timestamp in sync with the host clock, such as sending a pulse to the device every second or a fraction of a second?

Copy link
Contributor Author

@matwey matwey Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I think that the simplest way would be to use host receive UNIX timestamp and keep the counter as is.

@infrastation infrastation changed the title [WIP/RFC] Add initial implementation for pcap-openvizsla module [WIP/RFC] [skip ci] Add initial implementation for pcap-openvizsla module Aug 31, 2020
@fxlb
Copy link
Member

fxlb commented Aug 31, 2020

Could you rebase on top of the-tcpdump-group:master?

@matwey
Copy link
Contributor Author

matwey commented Sep 1, 2020

Rebased on master

@matwey
Copy link
Contributor Author

matwey commented Sep 2, 2020

Please add support to the autoconf script as well.

autoconf is supported now

The module requires libopenvizsla library to communicate with the device.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants