| 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)
void | io_graph_sma_period_tostr_cb (void *rec, char **out_ptr, unsigned *out_len, const void *vs, const void *u2 _U_)
void | io_graph_sma_period_set_cb (void *rec, const char *buf, unsigned len, const void *vs, const void *u2 _U_)

## 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); }
ws_strdup_printf
#define ws_strdup_printf(...)
Convenience macro for formatting a string using the NULL allocator.
Definition wmem_strutl.h:114