Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
capture.h File Reference
#include "ui/capture_opts.h"
#include "capture_info.h"
#include <epan/cfile.h>
#include "capture/capture_session.h"

Go to the source code of this file.

Typedefs

typedef void(* capture_callback_t) (int event, capture_session *cap_session, void *user_data)

Enumerations

enum  capture_cbs {
  capture_cb_capture_prepared , capture_cb_capture_update_started , capture_cb_capture_update_continue , capture_cb_capture_update_finished ,
  capture_cb_capture_fixed_started , capture_cb_capture_fixed_continue , capture_cb_capture_fixed_finished , capture_cb_capture_stopping ,
  capture_cb_capture_failed
}
 Event identifiers for live capture lifecycle callbacks. More...

Functions

void capture_callback_add (capture_callback_t func, void *user_data)
 Add a capture callback.
void capture_callback_remove (capture_callback_t func, void *user_data)
 Remove a capture callback.
void capture_input_init (capture_session *cap_session, capture_file *cf)
bool capture_start (capture_options *capture_opts, GPtrArray *capture_comments, capture_session *cap_session, info_data_t *cap_data, void(*update_cb)(void))
void capture_stop (capture_session *cap_session)
 Stop a capture session (usually from a menu item).
void capture_kill_child (capture_session *cap_session)
 Terminate the capture child cleanly when exiting.

Detailed Description

Definitions for packet capture windows

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Capture related things.

Enumeration Type Documentation

◆ capture_cbs

Event identifiers for live capture lifecycle callbacks.

Enumerator
capture_cb_capture_prepared 

Capture interfaces have been opened and the capture is ready to start

capture_cb_capture_update_started 

An updatable (real-time) capture session has started

capture_cb_capture_update_continue 

An updatable capture session has received new packets and the display should refresh

capture_cb_capture_update_finished 

An updatable capture session has ended normally

capture_cb_capture_fixed_started 

A fixed (non-updating) capture session has started

capture_cb_capture_fixed_continue 

A fixed capture session is continuing; progress update without display refresh

capture_cb_capture_fixed_finished 

A fixed capture session has ended normally

capture_cb_capture_stopping 

The capture is in the process of stopping (user-initiated or limit reached)

capture_cb_capture_failed 

The capture session failed to start or was terminated due to an error

Function Documentation

◆ capture_callback_add()

void capture_callback_add ( capture_callback_t func,
void * user_data )
extern

Add a capture callback.

Parameters
funcThe callback function.
user_dataUser data to pass to the callback.

◆ capture_callback_remove()

void capture_callback_remove ( capture_callback_t func,
void * user_data )
extern

Remove a capture callback.

Parameters
funcThe callback function.
user_dataUser data to pass to the callback.

◆ capture_input_init()

void capture_input_init ( capture_session * cap_session,
capture_file * cf )
extern

Initialize a capture session.

Parameters
cap_sessionthe handle for the capture session
cfthe capture_file for the file

◆ capture_kill_child()

void capture_kill_child ( capture_session * cap_session)
extern

Terminate the capture child cleanly when exiting.

Parameters
cap_sessionThe handle for the capture session.

◆ capture_start()

bool capture_start ( capture_options * capture_opts,
GPtrArray * capture_comments,
capture_session * cap_session,
info_data_t * cap_data,
void(* update_cb )(void) )
extern

Start a capture session.

Parameters
capture_optsthe numerous capture options
capture_commentsif not NULL, a GPtrArray * to a set of comments to put in the capture file's Section Header Block if it's a pcapng file
cap_sessionthe handle for the capture session
cap_dataa struct with capture info data
update_cbupdate screen
Returns
true if the capture starts successfully, false otherwise.

◆ capture_stop()

void capture_stop ( capture_session * cap_session)
extern

Stop a capture session (usually from a menu item).

Parameters
cap_sessionThe handle for the capture session.