| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
conversation_filter.h File Reference
`#include <glib.h>`
`#include "ws_symbol_export.h"`

Go to the source code of this file.

## Classes
struct | conversation_filter_s

## Typedefs
typedef bool(* | is_filter_valid_func) (struct _packet_info *pinfo, void *user_data)
typedef char *(* | build_filter_string_func) (struct _packet_info *pinfo, void *user_data)
typedef struct conversation_filter_s | conversation_filter_t

## Functions
void | conversation_filters_init (void)
WS_DLL_PUBLIC void | register_conversation_filter (const char *proto_name, const char *display_name, is_filter_valid_func is_filter_valid, build_filter_string_func build_filter_string, void *user_data)
WS_DLL_PUBLIC void | register_log_conversation_filter (const char *proto_name, const char *display_name, is_filter_valid_func is_filter_valid, build_filter_string_func build_filter_string, void *user_data)
WS_DLL_PUBLIC void | add_conversation_filter_protocol (const char *proto_name)
void | conversation_filters_cleanup (void)
WS_DLL_PUBLIC char * | conversation_filter_from_packet (struct _packet_info *pinfo)
WS_DLL_PUBLIC char * | conversation_filter_from_log (struct _packet_info *pinfo)

## Variables
WS_DLL_PUBLIC GList * | packet_conv_filter_list
WS_DLL_PUBLIC GList * | log_conv_filter_list

## Typedef Documentation

## ◆ build_filter_string_func

typedef char *(* build_filter_string_func) (struct _packet_info *pinfo, void *user_data)

callback function definition: return the available filter for this packet or NULL if no filter is available, Filter needs to be freed after use Callback function which creates a conversation filter.

Parameters

  pinfo | packet_info pointer for the current packet.
  user_data | User data provided to register_conversation_filter or register_log_conversation_filter.

Returns
  A filter for the conversation on success, NULL on failure. The filter must be gfreed.

## ◆ is_filter_valid_func

typedef bool(* is_filter_valid_func) (struct _packet_info *pinfo, void *user_data)

Callback function which checks for filter availability.

Parameters

  pinfo | packet_info pointer for the current packet.
  user_data | User data provided to register_conversation_filter or register_log_conversation_filter.

Returns
  true if the packet has a valid conversation filter, false otherwise.

## Function Documentation

## ◆ add_conversation_filter_protocol()

WS_DLL_PUBLIC void add_conversation_filter_protocol | ( | const char * | proto_name | ) |

Prepend a protocol to the list of filterable protocols.

Parameters

  proto_name | A valid protocol name.

## ◆ conversation_filter_from_log()

WS_DLL_PUBLIC char * conversation_filter_from_log | ( | struct _packet_info * | pinfo | ) |

Tries to build a suitable display filter for the conversation in the current log entry. More specific matches are tried first (like TCP ports) followed by less specific ones (IP addresses). NULL is returned when no filter is found.

Parameters

  pinfo | Packet info

Returns
  A display filter for the conversation. Should be freed with g_free.

## ◆ conversation_filter_from_packet()

WS_DLL_PUBLIC char * conversation_filter_from_packet | ( | struct _packet_info * | pinfo | ) |

Tries to build a suitable display filter for the conversation in the current packet. More specific matches are tried first (like TCP ports) followed by less specific ones (IP addresses). NULL is returned when no filter is found.

Parameters

  pinfo | Packet info

Returns
  A display filter for the conversation. Should be freed with g_free.

## ◆ conversation_filters_cleanup()

void conversation_filters_cleanup | ( | void |  | ) |
| extern

Cleanup internal structures

## ◆ conversation_filters_init()

void conversation_filters_init | ( | void |  | ) |
| extern

Initialize internal structures

## ◆ register_conversation_filter()

WS_DLL_PUBLIC void register_conversation_filter | ( | const char * | proto_name,
|  | const char * | display_name,
|  | is_filter_valid_func | is_filter_valid,
|  | build_filter_string_func | build_filter_string,
|  | void * | user_data
| ) |  |

Register a new packet conversation filter.

Parameters

  proto_name | The protocol name.
  display_name | A friendly name for the filter.
  is_filter_valid | A callback function conforming to is_filter_valid_func.
  build_filter_string | A callback function conforming to build_filter_string_func.
  user_data | User-defined data which is passed to the callback functions. Can be NULL.

## ◆ register_log_conversation_filter()

WS_DLL_PUBLIC void register_log_conversation_filter | ( | const char * | proto_name,
|  | const char * | display_name,
|  | is_filter_valid_func | is_filter_valid,
|  | build_filter_string_func | build_filter_string,
|  | void * | user_data
| ) |  |

Register a new log conversation filter.

Parameters

  proto_name | The protocol name.
  display_name | A friendly name for the filter.
  is_filter_valid | A callback function conforming to is_filter_valid_func.
  build_filter_string | A callback function conforming to build_filter_string_func.
  user_data | User-defined data which is passed to the callback functions. Can be NULL.