1 #ifndef __UDEBUG_PCAP_H
2 #define __UDEBUG_PCAP_H
4 #include <libubox/blobmsg.h>
5 #include <libubox/udebug.h>
13 const char *hw
, *os
, *app
;
16 struct pcap_interface_meta
{
18 const char *description
;
23 struct pcap_dbus_meta
{
24 const char *path
, *interface
, *name
;
25 const char *src
, *dest
;
28 int pcap_init(struct pcap_context
*p
, struct pcap_meta
*meta
);
29 int pcap_interface_init(struct pcap_context
*p
, uint32_t *id
,
30 struct pcap_interface_meta
*meta
);
32 pcap_interface_is_valid(struct pcap_context
*p
, uint32_t idx
)
34 return idx
<= p
->iface_id
;
37 void pcap_packet_init(uint32_t iface
, uint64_t timestamp
);
38 void pcap_dbus_init_string(const struct udebug_packet_info
*meta
, const char *val
);
39 void pcap_dbus_init_blob(const struct udebug_packet_info
*meta
, struct blob_attr
*val
, bool dict
);
40 void *pcap_packet_append(const void *data
, size_t len
);
41 void pcap_packet_done(void);
43 int pcap_interface_rbuf_init(struct pcap_context
*p
, struct udebug_remote_buf
*rb
);
44 int pcap_snapshot_packet_init(struct udebug
*ctx
, struct udebug_iter
*it
);
46 void pcap_block_write_file(FILE *f
);
47 void *pcap_block_get(size_t *len
);