Mailing List Archive

how to get the timestamp of packets recv by pfring zc driver
Hi, there,

I found that the ts is always set to 0 if the packet recv by a zc driver.
For example, in zcount.c:

if (buffer->ts.tv_nsec)
printf("[%u.%u] [hash=%08X] ", buffer->ts.tv_sec, buffer->ts.tv_nsec,
buffer->hash);

ts.tv_nsec is always set to 0 if I open ZC:p1p1.
So, the question is, how can I get the timestamp if I cannot get it from
buffer->ts?

Thanks,
Wang
Re: how to get the timestamp of packets recv by pfring zc driver [ In reply to ]
Hi Wang
the ZC library does not compute the timestamp by default for max performance,
please add the PF_RING_ZC_DEVICE_SW_TIMESTAMP flag to pfring_zc_open_device()

Regards
Alfredo

> On 8 Jan 2020, at 11:04, Wang <cnwangyong@gmail.com> wrote:
>
> Hi, there,
>
> I found that the ts is always set to 0 if the packet recv by a zc driver. For example, in zcount.c:
>
> if (buffer->ts.tv_nsec)
> printf("[%u.%u] [hash=%08X] ", buffer->ts.tv_sec, buffer->ts.tv_nsec, buffer->hash);
>
> ts.tv_nsec is always set to 0 if I open ZC:p1p1.
> So, the question is, how can I get the timestamp if I cannot get it from buffer->ts?
>
> Thanks,
> Wang
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc

_______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc