Ramon Fried | 3eaac63 | 2019-07-18 21:43:30 +0300 | [diff] [blame] | 1 | /* 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 | */ |
| 15 | int 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 | */ |
| 24 | int 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 | */ |
| 31 | int pcap_clear(void); |
| 32 | |
| 33 | /** |
| 34 | * pcap_print_status() - print status of pcap capture |
| 35 | * |
| 36 | * @return 0 on success, -ERROR on error |
| 37 | */ |
| 38 | int pcap_print_status(void); |
| 39 | |
| 40 | /** |
| 41 | * pcap_active() - check if pcap is enabled |
| 42 | * |
| 43 | * @return TRUE if active, FALSE if not. |
| 44 | */ |
| 45 | bool 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 | */ |
| 55 | int pcap_post(const void *packet, size_t len, bool outgoing); |