diff options
| author | Tom Rini <[email protected]> | 2019-09-04 16:02:03 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2019-09-04 16:02:03 -0400 |
| commit | ece9834f7d223097cec92e3d3c70cd37b3768482 (patch) | |
| tree | d2935e582cb3494364bf2b7bc89a3d227d616e97 /include/net | |
| parent | 448f11f7503995746a7b71e5e3b3a831c4651be9 (diff) | |
| parent | 5a5d1def59024dd3225e2a6142f8ee3ee10180a8 (diff) | |
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-net
- Assorted CVE fixes
- Other fixes
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/pcap.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/net/pcap.h b/include/net/pcap.h new file mode 100644 index 00000000000..512ba982f10 --- /dev/null +++ b/include/net/pcap.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2019 + * Ramon Fried <[email protected]> + */ + +/** + * pcap_init() - Initialize PCAP memory buffer + * + * @paddr physicaly memory address to store buffer + * @size maximum size of capture file in memory + * + * @return 0 on success, -ERROR on error + */ +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 + * + * @return 0 on success, -ERROR on error + */ +int pcap_start_stop(bool start); + +/** + * pcap_clear() - clear pcap capture buffer and statistics + * + * @return 0 on success, -ERROR on error + */ +int pcap_clear(void); + +/** + * pcap_print_status() - print status of pcap capture + * + * @return 0 on success, -ERROR on error + */ +int pcap_print_status(void); + +/** + * pcap_active() - check if pcap is enabled + * + * @return TRUE if active, FALSE if not. + */ +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) + * @return 0 on success, -ERROR on error + */ +int pcap_post(const void *packet, size_t len, bool outgoing); |
