Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Functions
io_graph_uat.h File Reference

Go to the source code of this file.

Macros

#define UAT_BOOL_ENABLE_CB_DEF(basename, field_name, rec_t)
 
#define UAT_FLD_BOOL_ENABLE(basename, field_name, title, desc)   {#field_name, title, PT_TXTMOD_BOOL,{uat_fld_chk_enable,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
 
#define UAT_FLD_SMA_PERIOD(basename, field_name, title, enum, desc)    {#field_name, title, PT_TXTMOD_ENUM,{sma_period_chk_enum,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{&(enum),&(enum),&(enum)},&(enum),desc,FLDFILL}
 

Functions

bool sma_period_chk_enum (void *u1 _U_, const char *strptr, unsigned len, const void *v, const void *u3 _U_, char **err)
 Checks if the SMA period value is valid.
 
void io_graph_sma_period_tostr_cb (void *rec, char **out_ptr, unsigned *out_len, const void *vs, const void *u2 _U_)
 Converts SMA period to a string representation.
 
void io_graph_sma_period_set_cb (void *rec, const char *buf, unsigned len, const void *vs, const void *u2 _U_)
 Callback function to set the SMA period for an IO graph.
 

Detailed Description

Macros for I/O graph UAT items

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

Macro Definition Documentation

◆ UAT_BOOL_ENABLE_CB_DEF

#define UAT_BOOL_ENABLE_CB_DEF (   basename,
  field_name,
  rec_t 
)
Value:
static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* UNUSED_PARAMETER(u1), const void* UNUSED_PARAMETER(u2)) {\
char* tmp_str = g_strndup(buf,len); \
if (tmp_str && ((g_strcmp0(tmp_str, "Enabled") == 0) || \
(g_ascii_strcasecmp(tmp_str, "true") == 0))) \
((rec_t*)rec)->field_name = 1; \
else \
((rec_t*)rec)->field_name = 0; \
g_free(tmp_str); } \
static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, const void* UNUSED_PARAMETER(u1), const void* UNUSED_PARAMETER(u2)) {\
*out_ptr = ws_strdup_printf("%s",((rec_t*)rec)->field_name ? "Enabled" : "Disabled"); \
*out_len = (unsigned)strlen(*out_ptr); }
#define ws_strdup_printf(...)
Convenience macro for formatting a string using the NULL allocator.
Definition wmem_strutl.h:114

Function Documentation

◆ io_graph_sma_period_set_cb()

void io_graph_sma_period_set_cb ( void *  rec,
const char *  buf,
unsigned  len,
const void *  vs,
const void *u2  _U_ 
)

Callback function to set the SMA period for an IO graph.

This function processes the input buffer containing the SMA period setting and updates the record accordingly.

Parameters
recPointer to the record being updated.
bufBuffer containing the input string.
lenLength of the input buffer.
vsPointer to the value_string array for valid SMA periods.
u2Unused parameter.

◆ io_graph_sma_period_tostr_cb()

void io_graph_sma_period_tostr_cb ( void *  rec,
char **  out_ptr,
unsigned *  out_len,
const void *  vs,
const void *u2  _U_ 
)

Converts SMA period to a string representation.

Parameters
recPointer to the record containing the SMA period.
out_ptrPointer to the output buffer for the string.
out_lenPointer to the length of the output buffer.
vsPointer to the value string array.
u2Unused parameter.

◆ sma_period_chk_enum()

bool sma_period_chk_enum ( void *u1  _U_,
const char *  strptr,
unsigned  len,
const void *  v,
const void *u3  _U_,
char **  err 
)

Checks if the SMA period value is valid.

Parameters
u1Unused parameter.
strptrThe string pointer to be checked.
lenThe length of the string.
vPointer to the value string array.
u3Unused parameter.
errPointer to store error message if any.
Returns
true If the SMA period is valid.
false If the SMA period is invalid.