I would like to capture RTCP packets and parse its. As I see in the pyshark documentation for live capture I have to define timeout, our packet_count. As my understanding after this option the live capture is stopped, and I able to parse the data. I need to do a calculation so I always need data from packet "n" and "n+1". If the pyshark is parsing data after the timeout, or after x packet, how can I garantee to have always the "n" and "n+1" packet.
Here is an example:
capture = pyshark.LiveCapture(interface='eth0')
for packet in capture.sniff_continuously(packet_count=5):
print 'Just arrived:', packet
If I capture 5 packets, how to do the calculation for the 5th packet? I cannot capture infinite number of packets.
Is it a doable idea if I capture only 1 packet assign it to a packet_0 then capture one more with a while cycle continuously assign it to packet_1, do the calculation, and then shit the packet_1 to packet_0, and return to the beginning of while cycle (capture 1 packet to packet_1)