2019-07-18 18:43:30 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright 2019
|
|
|
|
* Ramon Fried <rfried.dev@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* pcap_init() - Initialize PCAP memory buffer
|
|
|
|
*
|
|
|
|
* @paddr physicaly memory address to store buffer
|
|
|
|
* @size maximum size of capture file in memory
|
|
|
|
*
|
2022-01-19 17:05:50 +00:00
|
|
|
* Return: 0 on success, -ERROR on error
|
2019-07-18 18:43:30 +00:00
|
|
|
*/
|
|
|
|
int pcap_init(phys_addr_t paddr, unsigned long size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* pcap_start_stop() - start / stop pcap capture
|
|
|
|
*
|
|
|
|
* @start if true, start capture if false stop capture
|
|
|
|
*
|
2022-01-19 17:05:50 +00:00
|
|
|
* Return: 0 on success, -ERROR on error
|
2019-07-18 18:43:30 +00:00
|
|
|
*/
|
|
|
|
int pcap_start_stop(bool start);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* pcap_clear() - clear pcap capture buffer and statistics
|
|
|
|
*
|
2022-01-19 17:05:50 +00:00
|
|
|
* Return: 0 on success, -ERROR on error
|
2019-07-18 18:43:30 +00:00
|
|
|
*/
|
|
|
|
int pcap_clear(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* pcap_print_status() - print status of pcap capture
|
|
|
|
*
|
2022-01-19 17:05:50 +00:00
|
|
|
* Return: 0 on success, -ERROR on error
|
2019-07-18 18:43:30 +00:00
|
|
|
*/
|
|
|
|
int pcap_print_status(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* pcap_active() - check if pcap is enabled
|
|
|
|
*
|
2022-01-19 17:05:50 +00:00
|
|
|
* Return: TRUE if active, FALSE if not.
|
2019-07-18 18:43:30 +00:00
|
|
|
*/
|
|
|
|
bool pcap_active(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* pcap_post() - Post a packet to PCAP file
|
|
|
|
*
|
|
|
|
* @packet: packet to post
|
|
|
|
* @len: packet length in bytes
|
|
|
|
* @outgoing packet direction (outgoing/incoming)
|
2022-01-19 17:05:50 +00:00
|
|
|
* Return: 0 on success, -ERROR on error
|
2019-07-18 18:43:30 +00:00
|
|
|
*/
|
|
|
|
int pcap_post(const void *packet, size_t len, bool outgoing);
|