aboutsummaryrefslogtreecommitdiffstats
path: root/tests/osmo-pcap-test/osmo_pcap.h
blob: cff638b1a4eea8eb7cd996df9c15b6d6fc5a7fa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef _OSMO_PCAP_TEST_H_
#define _OSMO_PCAP_TEST_H_

#include <pcap.h>
#include <osmocom/core/timer.h>

struct msgb;

void osmo_pcap_init(void);

struct osmo_pcap {
	pcap_t			*h;
	struct osmo_timer_list	timer;
	struct timeval		last;
};

pcap_t *osmo_pcap_test_open(const char *pcapfile);
void osmo_pcap_test_close(pcap_t *handle);

int osmo_pcap_test_run(struct osmo_pcap *p, uint8_t pnum, int (*cb)(struct msgb *msgb));

void osmo_pcap_stats_printf(void);

#endif