blob: 512ba982f10476f1d74ed83ee4caa6e3c9008e1d [file] [log] [blame]
Ramon Friedac598c12019-07-18 21:43:30 +03001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright 2019
4 * Ramon Fried <rfried.dev@gmail.com>
5 */
6
7/**
8 * pcap_init() - Initialize PCAP memory buffer
9 *
10 * @paddr physicaly memory address to store buffer
11 * @size maximum size of capture file in memory
12 *
13 * @return 0 on success, -ERROR on error
14 */
15int pcap_init(phys_addr_t paddr, unsigned long size);
16
17/**
18 * pcap_start_stop() - start / stop pcap capture
19 *
20 * @start if true, start capture if false stop capture
21 *
22 * @return 0 on success, -ERROR on error
23 */
24int pcap_start_stop(bool start);
25
26/**
27 * pcap_clear() - clear pcap capture buffer and statistics
28 *
29 * @return 0 on success, -ERROR on error
30 */
31int pcap_clear(void);
32
33/**
34 * pcap_print_status() - print status of pcap capture
35 *
36 * @return 0 on success, -ERROR on error
37 */
38int pcap_print_status(void);
39
40/**
41 * pcap_active() - check if pcap is enabled
42 *
43 * @return TRUE if active, FALSE if not.
44 */
45bool pcap_active(void);
46
47/**
48 * pcap_post() - Post a packet to PCAP file
49 *
50 * @packet: packet to post
51 * @len: packet length in bytes
52 * @outgoing packet direction (outgoing/incoming)
53 * @return 0 on success, -ERROR on error
54 */
55int pcap_post(const void *packet, size_t len, bool outgoing);