2021-11-29 23:27:19 -05:00
|
|
|
/** @file
|
|
|
|
*
|
2004-12-28 00:36:06 +00:00
|
|
|
* Definitions for capture ringbuffer files
|
2001-12-04 08:45:04 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-12-04 08:45:04 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2018-02-07 12:26:45 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2001-12-04 08:45:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __RINGBUFFER_H__
|
|
|
|
#define __RINGBUFFER_H__
|
|
|
|
|
2025-01-07 22:56:45 -05:00
|
|
|
#include <wireshark.h>
|
2025-01-21 09:47:46 -05:00
|
|
|
#include <writecap/pcapio.h>
|
2001-12-04 08:45:04 +00:00
|
|
|
|
2003-06-22 16:09:04 +00:00
|
|
|
#define RINGBUFFER_UNLIMITED_FILES 0
|
2010-05-27 18:00:46 +00:00
|
|
|
/* Minimum number of ringbuffer files */
|
2003-06-22 16:09:04 +00:00
|
|
|
#define RINGBUFFER_MIN_NUM_FILES 0
|
2010-05-27 18:00:46 +00:00
|
|
|
/* Maximum number of ringbuffer files */
|
|
|
|
/* Avoid crashes on very large numbers. Should be a power of 10 */
|
|
|
|
#define RINGBUFFER_MAX_NUM_FILES 100000
|
|
|
|
/* Maximum number for FAT filesystems */
|
|
|
|
#define RINGBUFFER_WARN_NUM_FILES 65535
|
2001-12-04 08:45:04 +00:00
|
|
|
|
2025-01-21 09:47:46 -05:00
|
|
|
int ringbuf_init(const char *capture_name, unsigned num_files, bool group_read_access,
|
|
|
|
const char *compress_type, bool nametimenum);
|
2024-07-07 09:29:58 -04:00
|
|
|
bool ringbuf_is_initialized(void);
|
|
|
|
const char *ringbuf_current_filename(void);
|
2025-01-21 09:47:46 -05:00
|
|
|
pcapio_writer* ringbuf_init_libpcap_fdopen(int *err);
|
|
|
|
bool ringbuf_switch_file(pcapio_writer* *pdh, char **save_file, int *save_file_fd,
|
2009-04-26 15:51:25 +00:00
|
|
|
int *err);
|
2024-07-07 09:29:58 -04:00
|
|
|
bool ringbuf_libpcap_dump_close(char **save_file, int *err);
|
2001-12-04 08:45:04 +00:00
|
|
|
void ringbuf_free(void);
|
|
|
|
void ringbuf_error_cleanup(void);
|
2024-07-07 09:29:58 -04:00
|
|
|
bool ringbuf_set_print_name(char *name, int *err);
|
2001-12-04 08:45:04 +00:00
|
|
|
|
2014-10-14 15:58:21 -04:00
|
|
|
#endif /* ringbuffer.h */
|