Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
field_urls.h File Reference
#include <stdbool.h>
#include "ws_symbol_export.h"

Go to the source code of this file.

Macros

#define FIELDURLS_FILE_NAME   "fieldurls"

Functions

WS_DLL_PUBLIC char * field_url_expand (const char *url, const char *fieldname, const char *fieldvalue)
 Replace the placeholders in a URL.
WS_DLL_PUBLIC bool field_url_needs_value (const char *fieldname, const char *protoname)
 Check whether the value of a field is needed to get its URL.
WS_DLL_PUBLIC char * field_url_for (const char *fieldname, const char *protoname, const char *fieldvalue)
 Get the user-defined URL for a field, with placeholders expanded.

Detailed Description

User-defined override URLs for the "Filter Field Reference" action Copyright 2026, Mark Stout mark..nosp@m.stou.nosp@m.t@mar.nosp@m.ksto.nosp@m.ut.co.nosp@m.m

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

◆ FIELDURLS_FILE_NAME

#define FIELDURLS_FILE_NAME   "fieldurls"

Personal (all profiles) field URL override file.

Function Documentation

◆ field_url_expand()

WS_DLL_PUBLIC char * field_url_expand ( const char * url,
const char * fieldname,
const char * fieldvalue )

Replace the placeholders in a URL.

  • "${fieldname}": fieldname with each '.' replaced by '-' (ip.ttl -> ip-ttl).
  • "${fieldnameraw}": fieldname as is (ip.ttl).
  • "${fieldvalue}": fieldvalue with each '.' and ':' replaced by '-' (10.0.0.1 -> 10-0-0-1, fe80::1 -> fe80–1).
  • "${fieldvalueraw}": fieldvalue percent-encoded, '.' kept , (a ':' becomes %3A).

Other text, including unknown "${...}" sequences, is left untouched.

Parameters
urlThe URL, possibly containing placeholders.
fieldnameAbbreviation of the selected field, e.g. "tcp.len".
fieldvalueValue of the selected field, or NULL for an empty value.
Returns
The expanded URL, which must be g_free()d.

◆ field_url_for()

WS_DLL_PUBLIC char * field_url_for ( const char * fieldname,
const char * protoname,
const char * fieldvalue )

Get the user-defined URL for a field, with placeholders expanded.

Tries an entry for fieldname, then one for protoname. An entry with rules gives the URL of the first rule that matches fieldvalue, or else its default URL, and if it has neither the next entry is tried.

Parameters
fieldnameAbbreviation of the selected field, e.g. "tcp.len".
protonameAbbreviation of the field's protocol, e.g. "tcp".
fieldvalueValue of the selected field, or NULL for an empty value.
Returns
The expanded URL, which must be g_free()d, or NULL if there is no override.

◆ field_url_needs_value()

WS_DLL_PUBLIC bool field_url_needs_value ( const char * fieldname,
const char * protoname )

Check whether the value of a field is needed to get its URL.

The value is needed if the entry that applies to the field has rules, which are matched against the value, or if its URL uses a "${fieldvalue}" or "${fieldvalueraw}" placeholder. Getting a field's value can be expensive (e.g. for large byte fields), so callers can use this to avoid computing it when it isn't needed.

Parameters
fieldnameAbbreviation of the selected field, e.g. "tcp.len".
protonameAbbreviation of the field's protocol, e.g. "tcp".
Returns
true if there is an entry for the field or protocol and it needs the field value.