Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
ftypes.h File Reference
#include <wireshark.h>
#include <wsutil/regex.h>
#include <epan/wmem_scopes.h>
#include <wsutil/inet_cidr.h>
#include <epan/guid-utils.h>
#include <epan/tvbuff.h>
#include <wsutil/nstime.h>
#include <epan/dfilter/drange.h>

Go to the source code of this file.

Classes

struct  _protocol_value_t
 Holds a protocol value's buffer and associated metadata for use in display filter evaluation. More...
 

Macros

#define ASSERT_FTYPE_NOT_REACHED(ft)    ws_error("Invalid field type '%s'.", ftype_name(ft))
 
#define FT_IS_INT32(ft)
 True if ft is a signed integer type backed by a 32-bit value.
 
#define FT_IS_INT64(ft)
 True if ft is a signed integer type backed by a 64-bit value.
 
#define FT_IS_INT(ft)   (FT_IS_INT32(ft) || FT_IS_INT64(ft))
 True if ft is any signed integer type (INT8 through INT64).
 
#define FT_IS_UINT32(ft)
 True if ft is an unsigned integer type backed by a 32-bit value.
 
#define FT_IS_UINT64(ft)
 True if ft is an unsigned integer type backed by a 64-bit value.
 
#define FT_IS_UINT(ft)   (FT_IS_UINT32(ft) || FT_IS_UINT64(ft))
 True if ft is any unsigned integer type (CHAR, UINT8 through UINT64, FRAMENUM).
 
#define FT_IS_INTEGER(ft)   (FT_IS_INT(ft) || FT_IS_UINT(ft))
 True if ft is any signed or unsigned integer type.
 
#define FT_IS_FLOATING(ft)   ((ft) == FT_FLOAT || (ft) == FT_DOUBLE)
 True if ft is a floating-point type (FT_FLOAT or FT_DOUBLE).
 
#define FT_IS_TIME(ft)    ((ft) == FT_ABSOLUTE_TIME || (ft) == FT_RELATIVE_TIME)
 True if ft is a time type (FT_ABSOLUTE_TIME or FT_RELATIVE_TIME).
 
#define FT_IS_STRING(ft)
 True if ft is any string-like type.
 
#define FT_IS_SCALAR(ft)   ((ft) == FT_INT64 || (ft) == FT_DOUBLE)
 True if ft is a scalar type suitable for internal arithmetic (FT_INT64 or FT_DOUBLE).
 
#define FT_ETHER_LEN   6
 Fixed byte length of an FT_ETHER (IEEE 802 MAC address) field.
 
#define FT_GUID_LEN   16
 Fixed byte length of an FT_GUID (UUID) field.
 
#define FT_IPv4_LEN   4
 Fixed byte length of an FT_IPv4 address field.
 
#define FT_IPv6_LEN   16
 Fixed byte length of an FT_IPv6 address field.
 
#define FT_IPXNET_LEN   4
 Fixed byte length of an FT_IPXNET address field.
 
#define FT_EUI64_LEN   8
 Fixed byte length of an FT_EUI64 identifier field.
 
#define FT_AX25_ADDR_LEN   7
 Fixed byte length of an FT_AX25 address field.
 
#define FT_VINES_ADDR_LEN   6
 Fixed byte length of an FT_VINES address field.
 
#define FT_FCWWN_LEN   8
 Fixed byte length of an FT_FCWWN (Fibre Channel WWN) field.
 
#define FT_VARINT_MAX_LEN   10
 Maximum byte length of a variable-length base-128 (varint) encoded uint64; ceil(64/7) = 10.
 
#define FT_TRUE   1
 
#define FT_FALSE   0
 
#define fvalue_to_debug_repr(scope, fv)    fvalue_to_string_repr(scope, fv, FTREPR_DFILTER, 0)
 

Typedefs

typedef enum ftenum ftenum_t
 Convenience typedef for ftenum.
 
typedef enum ft_framenum_type ft_framenum_type_t
 Convenience typedef for ft_framenum_type.
 
typedef struct _ftype_t ftype_t
 
typedef int ft_bool_t
 Three-state boolean type for ftype comparison results.
 
typedef enum ftrepr ftrepr_t
 
typedef struct _protocol_value_t protocol_value_t
 Holds a protocol value's buffer and associated metadata for use in display filter evaluation.
 
typedef struct _fvalue_t fvalue_t
 

Enumerations

enum  ftenum {
  FT_NONE , FT_PROTOCOL , FT_BOOLEAN , FT_CHAR ,
  FT_UINT8 , FT_UINT16 , FT_UINT24 , FT_UINT32 ,
  FT_UINT40 , FT_UINT48 , FT_UINT56 , FT_UINT64 ,
  FT_INT8 , FT_INT16 , FT_INT24 , FT_INT32 ,
  FT_INT40 , FT_INT48 , FT_INT56 , FT_INT64 ,
  FT_IEEE_11073_SFLOAT , FT_IEEE_11073_FLOAT , FT_FLOAT , FT_DOUBLE ,
  FT_ABSOLUTE_TIME , FT_RELATIVE_TIME , FT_STRING , FT_STRINGZ ,
  FT_UINT_STRING , FT_ETHER , FT_BYTES , FT_UINT_BYTES ,
  FT_IPv4 , FT_IPv6 , FT_IPXNET , FT_FRAMENUM ,
  FT_GUID , FT_OID , FT_EUI64 , FT_AX25 ,
  FT_VINES , FT_REL_OID , FT_SYSTEM_ID , FT_STRINGZPAD ,
  FT_FCWWN , FT_STRINGZTRUNC , FT_NUM_TYPES , FT_SCALAR ,
  FT_ENUM_SIZE = FT_SCALAR
}
 Fundamental field value types used throughout the Wireshark dissector framework. More...
 
enum  ft_framenum_type {
  FT_FRAMENUM_NONE , FT_FRAMENUM_REQUEST , FT_FRAMENUM_RESPONSE , FT_FRAMENUM_ACK ,
  FT_FRAMENUM_DUP_ACK , FT_FRAMENUM_RETRANS_PREV , FT_FRAMENUM_RETRANS_NEXT , FT_FRAMENUM_NUM_TYPES
}
 Semantic role of an FT_FRAMENUM field, describing the relationship it encodes. More...
 
enum  ft_result {
  FT_OK = 0 , FT_OVERFLOW , FT_UNDERFLOW , FT_BADARG ,
  FT_ERROR
}
 Return codes for ftype operations such as conversion and comparison. More...
 
enum  ftrepr {
  FTREPR_DISPLAY , FTREPR_DFILTER , FTREPR_JSON , FTREPR_RAW ,
  FTREPR_EK
}
 Output representation formats for field value serialization. More...
 

Functions

void ftypes_initialize (void)
 Initializes various field types in Wireshark.
 
void ftypes_register_pseudofields (void)
 Registers pseudofields for various data types in Wireshark.
 
bool ftype_similar_types (const enum ftenum ftype_a, const enum ftenum ftype_b)
 Determine if two field types are similar.
 
WS_DLL_PUBLIC const char * ftype_name (ftenum_t ftype)
 Get the name of a field type.
 
WS_DLL_PUBLIC const char * ftype_pretty_name (ftenum_t ftype)
 Returns a string representing the "pretty" name of the field type.
 
WS_DLL_PUBLIC int ftype_wire_size (ftenum_t ftype)
 Get the wire size of a field type.
 
WS_DLL_PUBLIC bool ftype_can_length (enum ftenum ftype)
 Determines if a given field type can have its length retrieved.
 
WS_DLL_PUBLIC bool ftype_can_slice (enum ftenum ftype)
 Determines if a given field type can be sliced.
 
WS_DLL_PUBLIC bool ftype_can_eq (enum ftenum ftype)
 Checks if a given field type can be compared.
 
WS_DLL_PUBLIC bool ftype_can_cmp (enum ftenum ftype)
 Determines if a given field type can be compared.
 
WS_DLL_PUBLIC bool ftype_can_bitwise_and (enum ftenum ftype)
 Checks if a given field type can perform bitwise AND operation.
 
WS_DLL_PUBLIC bool ftype_can_unary_minus (enum ftenum ftype)
 Check if a given ftenum can be negated using unary minus.
 
WS_DLL_PUBLIC bool ftype_can_add (enum ftenum ftype)
 Checks if a given field type can be added.
 
WS_DLL_PUBLIC bool ftype_can_subtract (enum ftenum ftype)
 Checks if the given ftype can be subtracted.
 
WS_DLL_PUBLIC bool ftype_can_multiply (enum ftenum ftype)
 Checks if the given field type can be multiplied.
 
WS_DLL_PUBLIC bool ftype_can_divide (enum ftenum ftype)
 Checks if a given field type can be divided.
 
WS_DLL_PUBLIC bool ftype_can_modulo (enum ftenum ftype)
 Check if a given ftype can perform modulo operation.
 
WS_DLL_PUBLIC bool ftype_can_contains (enum ftenum ftype)
 Checks if a given ftype can contain other types.
 
WS_DLL_PUBLIC bool ftype_can_matches (enum ftenum ftype)
 Checks if a given field type can match another.
 
WS_DLL_PUBLIC bool ftype_can_is_zero (enum ftenum ftype)
 Determines if a given field type can be zero.
 
WS_DLL_PUBLIC bool ftype_can_is_negative (enum ftenum ftype)
 Determines if a given field type can represent negative values.
 
WS_DLL_PUBLIC bool ftype_can_is_nan (enum ftenum ftype)
 Check if the given ftenum can represent NaN values.
 
WS_DLL_PUBLIC bool ftype_can_val_to_sinteger (enum ftenum ftype)
 Checks if a given ftype can be converted to a signed integer.
 
WS_DLL_PUBLIC bool ftype_can_val_to_uinteger (enum ftenum ftype)
 Checks if a given ftenum can be converted to an unsigned integer.
 
WS_DLL_PUBLIC bool ftype_can_val_to_sinteger64 (enum ftenum ftype)
 Checks if a given field type can be converted to a signed 64-bit integer.
 
WS_DLL_PUBLIC bool ftype_can_val_to_uinteger64 (enum ftenum ftype)
 Checks if a given ftenum can be converted to an unsigned 64-bit integer.
 
WS_DLL_PUBLIC bool ftype_can_val_to_double (enum ftenum ftype)
 Determines if a given field type can be converted to a double.
 
WS_DLL_PUBLIC fvalue_tfvalue_new (ftenum_t ftype)
 Creates a new fvalue_t structure.
 
WS_DLL_PUBLIC fvalue_tfvalue_dup (const fvalue_t *fv)
 Duplicates a fvalue_t structure.
 
WS_DLL_PUBLIC void fvalue_init (fvalue_t *fv, ftenum_t ftype)
 Initialize a fvalue_t structure.
 
WS_DLL_PUBLIC void fvalue_cleanup (fvalue_t *fv)
 Clean up a fvalue_t structure.
 
WS_DLL_PUBLIC void fvalue_free (fvalue_t *fv)
 Frees an fvalue_t structure.
 
WS_DLL_PUBLIC fvalue_tfvalue_from_literal (ftenum_t ftype, const char *s, bool allow_partial_value, char **err_msg)
 Create a new fvalue from a literal string.
 
fvalue_tfvalue_from_string (ftenum_t ftype, const char *s, size_t len, char **err_msg)
 Create a new fvalue_t from a string.
 
fvalue_tfvalue_from_charconst (ftenum_t ftype, unsigned long number, char **err_msg)
 Create a new fvalue from a character constant.
 
fvalue_tfvalue_from_sinteger64 (ftenum_t ftype, const char *s, int64_t number, char **err_msg)
 Creates a field value from a signed 64-bit integer.
 
fvalue_tfvalue_from_uinteger64 (ftenum_t ftype, const char *s, uint64_t number, char **err_msg)
 Creates a new fvalue_t from an unsigned 64-bit integer.
 
fvalue_tfvalue_from_floating (ftenum_t ftype, const char *s, double number, char **err_msg)
 Creates a floating-point field value from a string representation.
 
WS_DLL_PUBLIC char * fvalue_to_string_repr (wmem_allocator_t *scope, const fvalue_t *fv, ftrepr_t rtype, int field_display)
 Convert a fvalue to its string representation.
 
WS_DLL_PUBLIC enum ft_result fvalue_to_uinteger (const fvalue_t *fv, uint32_t *repr)
 Convert a fvalue_t to an unsigned 32-bit integer.
 
WS_DLL_PUBLIC enum ft_result fvalue_to_sinteger (const fvalue_t *fv, int32_t *repr)
 Convert a fvalue_t to a 32-bit signed integer.
 
WS_DLL_PUBLIC enum ft_result fvalue_to_uinteger64 (const fvalue_t *fv, uint64_t *repr)
 Convert a fvalue_t to an unsigned 64-bit integer.
 
WS_DLL_PUBLIC enum ft_result fvalue_to_sinteger64 (const fvalue_t *fv, int64_t *repr)
 Convert a fvalue_t to an int64_t.
 
WS_DLL_PUBLIC enum ft_result fvalue_to_double (const fvalue_t *fv, double *repr)
 Convert a fvalue_t to its double representation.
 
WS_DLL_PUBLIC ftenum_t fvalue_type_ftenum (const fvalue_t *fv)
 Get the ftype of a fvalue_t.
 
WS_DLL_PUBLIC const char * fvalue_type_name (const fvalue_t *fv)
 Get the name of the type associated with a fvalue_t.
 
WS_DLL_PUBLIC void fvalue_set_bytes (fvalue_t *fv, GBytes *value)
 Set the value of an fvalue_t to a GBytes object.
 
WS_DLL_PUBLIC void fvalue_set_byte_array (fvalue_t *fv, GByteArray *value)
 Set the byte array value of an fvalue_t.
 
WS_DLL_PUBLIC void fvalue_set_bytes_data (fvalue_t *fv, const void *data, size_t size)
 Set the bytes data for a fvalue_t.
 
WS_DLL_PUBLIC void fvalue_set_fcwwn (fvalue_t *fv, const uint8_t *value)
 Set the value of an fvalue_t to a FC-WWN (Fibre Channel World Wide Name).
 
WS_DLL_PUBLIC void fvalue_set_ax25 (fvalue_t *fv, const uint8_t *value)
 Set the value of an fvalue_t to an AX.25 address.
 
WS_DLL_PUBLIC void fvalue_set_vines (fvalue_t *fv, const uint8_t *value)
 Set the value of an fvalue_t to a VINES address.
 
WS_DLL_PUBLIC void fvalue_set_ether (fvalue_t *fv, const uint8_t *value)
 Set the value of an fvalue_t to a new Ethernet address.
 
WS_DLL_PUBLIC void fvalue_set_guid (fvalue_t *fv, const e_guid_t *value)
 Set the value of a fvalue_t to a GUID.
 
WS_DLL_PUBLIC void fvalue_set_time (fvalue_t *fv, const nstime_t *value)
 Set the time value of an fvalue_t structure.
 
WS_DLL_PUBLIC void fvalue_set_string (fvalue_t *fv, const char *value)
 Set the string value of an fvalue_t.
 
WS_DLL_PUBLIC void fvalue_set_strbuf (fvalue_t *fv, wmem_strbuf_t *value)
 Set the value of an fvalue_t to a string buffer.
 
WS_DLL_PUBLIC void fvalue_set_protocol (fvalue_t *fv, tvbuff_t *value, const char *name, int length)
 Set the protocol value for a field value.
 
WS_DLL_PUBLIC void fvalue_set_protocol_length (fvalue_t *fv, int length)
 Set the protocol length for a fvalue_t structure.
 
WS_DLL_PUBLIC void fvalue_set_uinteger (fvalue_t *fv, uint32_t value)
 Set the value of a fvalue_t to an unsigned 32-bit integer.
 
WS_DLL_PUBLIC void fvalue_set_sinteger (fvalue_t *fv, int32_t value)
 Set the value of an fvalue_t to a signed 32-bit integer.
 
WS_DLL_PUBLIC void fvalue_set_uinteger64 (fvalue_t *fv, uint64_t value)
 Set the value of a fvalue_t to an unsigned 64-bit integer.
 
WS_DLL_PUBLIC void fvalue_set_sinteger64 (fvalue_t *fv, int64_t value)
 Set the value of an fvalue_t to a 64-bit signed integer.
 
WS_DLL_PUBLIC void fvalue_set_floating (fvalue_t *fv, double value)
 Set the floating-point value of an fvalue_t.
 
WS_DLL_PUBLIC void fvalue_set_ipv4 (fvalue_t *fv, const ipv4_addr_and_mask *value)
 Set the IPv4 value of an fvalue_t structure.
 
WS_DLL_PUBLIC void fvalue_set_ipv6 (fvalue_t *fv, const ipv6_addr_and_prefix *value)
 Set the IPv6 value of an fvalue_t.
 
WS_DLL_PUBLIC GBytes * fvalue_get_bytes (fvalue_t *fv)
 Get the bytes value from an fvalue_t.
 
WS_DLL_PUBLIC size_t fvalue_get_bytes_size (fvalue_t *fv)
 Get the size of the bytes data stored in an fvalue_t.
 
WS_DLL_PUBLIC const void * fvalue_get_bytes_data (fvalue_t *fv)
 Retrieves the bytes data from an fvalue_t.
 
WS_DLL_PUBLIC const e_guid_tfvalue_get_guid (fvalue_t *fv)
 Retrieves a GUID value from an fvalue_t structure.
 
WS_DLL_PUBLIC const nstime_tfvalue_get_time (fvalue_t *fv)
 Retrieves a time value from an fvalue_t structure.
 
WS_DLL_PUBLIC const char * fvalue_get_string (fvalue_t *fv)
 Get a string representation of an fvalue.
 
WS_DLL_PUBLIC const wmem_strbuf_tfvalue_get_strbuf (fvalue_t *fv)
 Retrieves the string buffer value from an fvalue_t structure.
 
WS_DLL_PUBLIC tvbuff_tfvalue_get_protocol (fvalue_t *fv)
 Get the protocol value from an fvalue_t structure.
 
WS_DLL_PUBLIC uint32_t fvalue_get_uinteger (fvalue_t *fv)
 Get the unsigned integer value from an fvalue_t structure.
 
WS_DLL_PUBLIC int32_t fvalue_get_sinteger (fvalue_t *fv)
 Retrieves a signed integer value from an fvalue_t structure.
 
WS_DLL_PUBLIC uint64_t fvalue_get_uinteger64 (fvalue_t *fv)
 Retrieves an unsigned 64-bit integer value from a fvalue_t structure.
 
WS_DLL_PUBLIC int64_t fvalue_get_sinteger64 (fvalue_t *fv)
 Get the 64-bit signed integer value from an fvalue_t structure.
 
WS_DLL_PUBLIC double fvalue_get_floating (fvalue_t *fv)
 Retrieves the floating-point value from an fvalue_t structure.
 
WS_DLL_PUBLIC const ipv4_addr_and_maskfvalue_get_ipv4 (fvalue_t *fv)
 Retrieves the IPv4 address from an fvalue_t structure.
 
WS_DLL_PUBLIC const ipv6_addr_and_prefixfvalue_get_ipv6 (fvalue_t *fv)
 Retrieves the IPv6 value from an fvalue_t structure.
 
WS_DLL_PUBLIC ft_bool_t fvalue_eq (const fvalue_t *a, const fvalue_t *b)
 Compares two fvalue_t structures for equality.
 
WS_DLL_PUBLIC ft_bool_t fvalue_ne (const fvalue_t *a, const fvalue_t *b)
 Compares two fvalue_t structures for inequality.
 
WS_DLL_PUBLIC ft_bool_t fvalue_gt (const fvalue_t *a, const fvalue_t *b)
 Compares two fvalue_t structures to determine if the first is greater than the second.
 
WS_DLL_PUBLIC ft_bool_t fvalue_ge (const fvalue_t *a, const fvalue_t *b)
 Compares two fvalue_t structures for greater than or equal to.
 
WS_DLL_PUBLIC ft_bool_t fvalue_lt (const fvalue_t *a, const fvalue_t *b)
 Compares two fvalue_t objects to determine if the first is less than the second.
 
WS_DLL_PUBLIC ft_bool_t fvalue_le (const fvalue_t *a, const fvalue_t *b)
 Compares two fvalue_t objects lexicographically.
 
WS_DLL_PUBLIC ft_bool_t fvalue_contains (const fvalue_t *a, const fvalue_t *b)
 Checks if one fvalue_t contains another.
 
WS_DLL_PUBLIC ft_bool_t fvalue_matches (const fvalue_t *a, const ws_regex_t *re)
 Checks if a fvalue_t matches a regular expression.
 
WS_DLL_PUBLIC bool fvalue_is_zero (const fvalue_t *a)
 Checks if a fvalue_t is zero.
 
WS_DLL_PUBLIC bool fvalue_is_negative (const fvalue_t *a)
 Checks if a fvalue_t is negative.
 
WS_DLL_PUBLIC bool fvalue_is_nan (const fvalue_t *a)
 Checks if a fvalue_t is NaN.
 
WS_DLL_PUBLIC size_t fvalue_length2 (fvalue_t *fv)
 Get the length of a fvalue_t.
 
WS_DLL_PUBLIC fvalue_tfvalue_slice (fvalue_t *fv, drange_t *dr)
 Slices a fvalue_t based on a drange_t.
 
WS_DLL_PUBLIC fvalue_tfvalue_bitwise_and (const fvalue_t *a, const fvalue_t *b, char **err_msg)
 Perform a bitwise AND operation on two fvalue_t objects.
 
WS_DLL_PUBLIC fvalue_tfvalue_unary_minus (const fvalue_t *fv, char **err_msg)
 Applies unary minus operation to a fvalue.
 
WS_DLL_PUBLIC fvalue_tfvalue_add (const fvalue_t *a, const fvalue_t *b, char **err_msg)
 Adds two fvalue_t objects.
 
WS_DLL_PUBLIC fvalue_tfvalue_subtract (const fvalue_t *a, const fvalue_t *b, char **err_msg)
 Subtracts one fvalue from another.
 
WS_DLL_PUBLIC fvalue_tfvalue_multiply (const fvalue_t *a, const fvalue_t *b, char **err_msg)
 Multiplies two fvalue_t objects.
 
WS_DLL_PUBLIC fvalue_tfvalue_divide (const fvalue_t *a, const fvalue_t *b, char **err_msg)
 Divides two fvalue_t objects.
 
WS_DLL_PUBLIC fvalue_tfvalue_modulo (const fvalue_t *a, const fvalue_t *b, char **err_msg)
 Calculate the modulo of two fvalue_t objects.
 
WS_DLL_PUBLIC unsigned fvalue_hash (const fvalue_t *fv)
 Calculate the hash value for a fvalue_t.
 
WS_DLL_PUBLIC bool fvalue_equal (const fvalue_t *a, const fvalue_t *b)
 Compares two fvalue_t structures for equality.
 

Detailed Description

Definitions for field types

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

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

Macro Definition Documentation

◆ FT_FALSE

#define FT_FALSE   0

Comparison result: false

◆ FT_IS_FLOATING

#define FT_IS_FLOATING (   ft)    ((ft) == FT_FLOAT || (ft) == FT_DOUBLE)

True if ft is a floating-point type (FT_FLOAT or FT_DOUBLE).

Parameters
ftAn ftenum value to test.

◆ FT_IS_INT

#define FT_IS_INT (   ft)    (FT_IS_INT32(ft) || FT_IS_INT64(ft))

True if ft is any signed integer type (INT8 through INT64).

Parameters
ftAn ftenum value to test.

◆ FT_IS_INT32

#define FT_IS_INT32 (   ft)
Value:
((ft) == FT_INT8 || \
(ft) == FT_INT16 || \
(ft) == FT_INT24 || \
(ft) == FT_INT32)
@ FT_INT16
Definition ftypes.h:40
@ FT_INT32
Definition ftypes.h:42
@ FT_INT8
Definition ftypes.h:39
@ FT_INT24
Definition ftypes.h:41

True if ft is a signed integer type backed by a 32-bit value.

Parameters
ftAn ftenum value to test.

◆ FT_IS_INT64

#define FT_IS_INT64 (   ft)
Value:
((ft) == FT_INT40 || \
(ft) == FT_INT48 || \
(ft) == FT_INT56 || \
(ft) == FT_INT64)
@ FT_INT64
Definition ftypes.h:46
@ FT_INT40
Definition ftypes.h:43
@ FT_INT48
Definition ftypes.h:44
@ FT_INT56
Definition ftypes.h:45

True if ft is a signed integer type backed by a 64-bit value.

Parameters
ftAn ftenum value to test.

◆ FT_IS_INTEGER

#define FT_IS_INTEGER (   ft)    (FT_IS_INT(ft) || FT_IS_UINT(ft))

True if ft is any signed or unsigned integer type.

Parameters
ftAn ftenum value to test.

◆ FT_IS_SCALAR

#define FT_IS_SCALAR (   ft)    ((ft) == FT_INT64 || (ft) == FT_DOUBLE)

True if ft is a scalar type suitable for internal arithmetic (FT_INT64 or FT_DOUBLE).

Parameters
ftAn ftenum value to test.

◆ FT_IS_STRING

#define FT_IS_STRING (   ft)
Value:
((ft) == FT_STRING || (ft) == FT_STRINGZ || (ft) == FT_STRINGZPAD || \
(ft) == FT_STRINGZTRUNC || (ft) == FT_UINT_STRING || (ft) == FT_AX25)
@ FT_STRINGZ
Definition ftypes.h:54
@ FT_STRINGZTRUNC
Definition ftypes.h:72
@ FT_AX25
Definition ftypes.h:66
@ FT_UINT_STRING
Definition ftypes.h:55
@ FT_STRING
Definition ftypes.h:53
@ FT_STRINGZPAD
Definition ftypes.h:70

True if ft is any string-like type.

Parameters
ftAn ftenum value to test.

◆ FT_IS_TIME

#define FT_IS_TIME (   ft)     ((ft) == FT_ABSOLUTE_TIME || (ft) == FT_RELATIVE_TIME)

True if ft is a time type (FT_ABSOLUTE_TIME or FT_RELATIVE_TIME).

Parameters
ftAn ftenum value to test.

◆ FT_IS_UINT

#define FT_IS_UINT (   ft)    (FT_IS_UINT32(ft) || FT_IS_UINT64(ft))

True if ft is any unsigned integer type (CHAR, UINT8 through UINT64, FRAMENUM).

Parameters
ftAn ftenum value to test.

◆ FT_IS_UINT32

#define FT_IS_UINT32 (   ft)
Value:
((ft) == FT_CHAR || \
(ft) == FT_UINT8 || \
(ft) == FT_UINT16 || \
(ft) == FT_UINT24 || \
(ft) == FT_UINT32 || \
(ft) == FT_FRAMENUM)
@ FT_FRAMENUM
Definition ftypes.h:62
@ FT_UINT24
Definition ftypes.h:33
@ FT_UINT8
Definition ftypes.h:31
@ FT_CHAR
Definition ftypes.h:30
@ FT_UINT16
Definition ftypes.h:32
@ FT_UINT32
Definition ftypes.h:34

True if ft is an unsigned integer type backed by a 32-bit value.

Parameters
ftAn ftenum value to test.

◆ FT_IS_UINT64

#define FT_IS_UINT64 (   ft)
Value:
((ft) == FT_UINT40 || \
(ft) == FT_UINT48 || \
(ft) == FT_UINT56 || \
(ft) == FT_UINT64)
@ FT_UINT64
Definition ftypes.h:38
@ FT_UINT48
Definition ftypes.h:36
@ FT_UINT56
Definition ftypes.h:37
@ FT_UINT40
Definition ftypes.h:35

True if ft is an unsigned integer type backed by a 64-bit value.

Parameters
ftAn ftenum value to test.

◆ FT_TRUE

#define FT_TRUE   1

Comparison result: true

Typedef Documentation

◆ ft_bool_t

typedef int ft_bool_t

Three-state boolean type for ftype comparison results.

Note that ft_bool == FT_FALSE and ft_bool != FT_TRUE are semantically distinct results due to the three-state (true / false / error) logic. Negative values indicate an error condition.

Enumeration Type Documentation

◆ ft_framenum_type

Semantic role of an FT_FRAMENUM field, describing the relationship it encodes.

Enumerator
FT_FRAMENUM_NONE 

No specific semantic role

FT_FRAMENUM_REQUEST 

References the request frame for this response

FT_FRAMENUM_RESPONSE 

References the response frame for this request

FT_FRAMENUM_ACK 

References the frame being acknowledged

FT_FRAMENUM_DUP_ACK 

References a duplicate acknowledgement frame

FT_FRAMENUM_RETRANS_PREV 

References the previous retransmission of this frame

FT_FRAMENUM_RETRANS_NEXT 

References the next retransmission of this frame

FT_FRAMENUM_NUM_TYPES 

Sentinel: one past the last valid framenum type

◆ ft_result

enum ft_result

Return codes for ftype operations such as conversion and comparison.

Enumerator
FT_OK 

Operation completed successfully

FT_OVERFLOW 

Value exceeds the representable range (too large)

FT_UNDERFLOW 

Value is below the representable range (too small)

FT_BADARG 

One or more arguments are invalid

FT_ERROR 

Generic unspecified error

◆ ftenum

enum ftenum

Fundamental field value types used throughout the Wireshark dissector framework.

Enumerator
FT_NONE 

Text label with no associated value

FT_PROTOCOL 

Protocol subtree node

FT_BOOLEAN 

Boolean value; true/false from <glib.h>

FT_CHAR 

Single-octet character, displayed as value 0–255

FT_UINT8 

Unsigned 8-bit integer

FT_UINT16 

Unsigned 16-bit integer

FT_UINT24 

Unsigned 24-bit integer; stored as UINT32, displayed as 6 hex digits with FD_HEX

FT_UINT32 

Unsigned 32-bit integer

FT_UINT40 

Unsigned 40-bit integer; stored as UINT64, displayed as 10 hex digits with FD_HEX

FT_UINT48 

Unsigned 48-bit integer; stored as UINT64, displayed as 12 hex digits with FD_HEX

FT_UINT56 

Unsigned 56-bit integer; stored as UINT64, displayed as 14 hex digits with FD_HEX

FT_UINT64 

Unsigned 64-bit integer

FT_INT8 

Signed 8-bit integer

FT_INT16 

Signed 16-bit integer

FT_INT24 

Signed 24-bit integer; stored as INT32 (see FT_UINT24)

FT_INT32 

Signed 32-bit integer

FT_INT40 

Signed 40-bit integer; stored as INT64 (see FT_UINT40)

FT_INT48 

Signed 48-bit integer; stored as INT64 (see FT_UINT48)

FT_INT56 

Signed 56-bit integer; stored as INT64 (see FT_UINT56)

FT_INT64 

Signed 64-bit integer

FT_IEEE_11073_SFLOAT 

IEEE 11073 16-bit SFLOAT (medical device float)

FT_IEEE_11073_FLOAT 

IEEE 11073 32-bit FLOAT (medical device float)

FT_FLOAT 

IEEE 754 single-precision (32-bit) floating point

FT_DOUBLE 

IEEE 754 double-precision (64-bit) floating point

FT_ABSOLUTE_TIME 

Absolute date/time timestamp

FT_RELATIVE_TIME 

Relative time delta

FT_STRING 

Counted byte string with no null terminator

FT_STRINGZ 

Null-terminated (C-style) string

FT_UINT_STRING 

Length-prefixed string; leading bytes encode the count

FT_ETHER 

IEEE 802 MAC address (6 bytes)

FT_BYTES 

Arbitrary byte array

FT_UINT_BYTES 

Length-prefixed byte array; leading bytes encode the count

FT_IPv4 

IPv4 address (4 bytes)

FT_IPv6 

IPv6 address (16 bytes)

FT_IPXNET 

IPX network address (4 bytes)

FT_FRAMENUM 

UINT32 frame number; clicking navigates to the referenced frame

FT_GUID 

Globally Unique Identifier / UUID (16 bytes)

FT_OID 

ASN.1 OBJECT IDENTIFIER

FT_EUI64 

IEEE EUI-64 identifier (8 bytes)

FT_AX25 

AX.25 amateur radio address (7 bytes)

FT_VINES 

Banyan VINES network address (6 bytes)

FT_REL_OID 

ASN.1 RELATIVE-OID

FT_SYSTEM_ID 

IS-IS System Identifier

FT_STRINGZPAD 

Fixed-length null-padded string

FT_FCWWN 

Fibre Channel World Wide Name (8 bytes)

FT_STRINGZTRUNC 

Fixed-length null-truncated string

FT_NUM_TYPES 

Sentinel: one past the last real field type

FT_SCALAR 

Pseudo-type used internally for arithmetic operations only; not a real field type

FT_ENUM_SIZE 

Must equal the last enumerator to size arrays correctly

◆ ftrepr

enum ftrepr

Output representation formats for field value serialization.

Enumerator
FTREPR_DISPLAY 

Human-readable display string (as shown in the packet details pane)

FTREPR_DFILTER 

Display filter syntax representation (suitable for use in filter expressions)

FTREPR_JSON 

Standard JSON value representation

FTREPR_RAW 

Raw unformatted byte/value representation

FTREPR_EK 

ElasticSearch/OpenSearch JSON representation

Function Documentation

◆ ftype_can_add()

WS_DLL_PUBLIC bool ftype_can_add ( enum ftenum  ftype)

Checks if a given field type can be added.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be added, false otherwise.

◆ ftype_can_bitwise_and()

WS_DLL_PUBLIC bool ftype_can_bitwise_and ( enum ftenum  ftype)

Checks if a given field type can perform bitwise AND operation.

Parameters
ftypeThe field type to check.
Returns
true If the field type supports bitwise AND, false otherwise.

◆ ftype_can_cmp()

WS_DLL_PUBLIC bool ftype_can_cmp ( enum ftenum  ftype)

Determines if a given field type can be compared.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be compared, false otherwise.

◆ ftype_can_contains()

WS_DLL_PUBLIC bool ftype_can_contains ( enum ftenum  ftype)

Checks if a given ftype can contain other types.

Parameters
ftypeThe type to check.
Returns
true If the ftype can contain other types, false otherwise.

◆ ftype_can_divide()

WS_DLL_PUBLIC bool ftype_can_divide ( enum ftenum  ftype)

Checks if a given field type can be divided.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be divided, false otherwise.

◆ ftype_can_eq()

WS_DLL_PUBLIC bool ftype_can_eq ( enum ftenum  ftype)

Checks if a given field type can be compared.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be compared, false otherwise.

◆ ftype_can_is_nan()

WS_DLL_PUBLIC bool ftype_can_is_nan ( enum ftenum  ftype)

Check if the given ftenum can represent NaN values.

Parameters
ftypeThe ftenum to check.
Returns
true If the ftenum can represent NaN values, false otherwise.

◆ ftype_can_is_negative()

WS_DLL_PUBLIC bool ftype_can_is_negative ( enum ftenum  ftype)

Determines if a given field type can represent negative values.

Parameters
ftypeThe field type to check.
Returns
true If the field type can represent negative values, false otherwise.

◆ ftype_can_is_zero()

WS_DLL_PUBLIC bool ftype_can_is_zero ( enum ftenum  ftype)

Determines if a given field type can be zero.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be zero, false otherwise.

◆ ftype_can_length()

WS_DLL_PUBLIC bool ftype_can_length ( enum ftenum  ftype)

Determines if a given field type can have its length retrieved.

Parameters
ftypeThe field type to check.
Returns
true If the field type can have its length retrieved, false otherwise.

◆ ftype_can_matches()

WS_DLL_PUBLIC bool ftype_can_matches ( enum ftenum  ftype)

Checks if a given field type can match another.

Parameters
ftypeThe field type to check.
Returns
true If the field type can match, false otherwise.

◆ ftype_can_modulo()

WS_DLL_PUBLIC bool ftype_can_modulo ( enum ftenum  ftype)

Check if a given ftype can perform modulo operation.

Parameters
ftypeThe type to check.
Returns
true If the ftype can perform modulo operation, false otherwise.

◆ ftype_can_multiply()

WS_DLL_PUBLIC bool ftype_can_multiply ( enum ftenum  ftype)

Checks if the given field type can be multiplied.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be multiplied.
false Otherwise.

◆ ftype_can_slice()

WS_DLL_PUBLIC bool ftype_can_slice ( enum ftenum  ftype)

Determines if a given field type can be sliced.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be sliced, false otherwise.

◆ ftype_can_subtract()

WS_DLL_PUBLIC bool ftype_can_subtract ( enum ftenum  ftype)

Checks if the given ftype can be subtracted.

Parameters
ftypeThe type to check.
Returns
true If the ftype can be subtracted, false otherwise.

◆ ftype_can_unary_minus()

WS_DLL_PUBLIC bool ftype_can_unary_minus ( enum ftenum  ftype)

Check if a given ftenum can be negated using unary minus.

Parameters
ftypeThe ftenum to check.
Returns
true If the ftype can be negated using unary minus.
false If the ftype cannot be negated using unary minus.

◆ ftype_can_val_to_double()

WS_DLL_PUBLIC bool ftype_can_val_to_double ( enum ftenum  ftype)

Determines if a given field type can be converted to a double.

This function checks whether the specified field type supports conversion to a double value.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be converted to a double, false otherwise.

◆ ftype_can_val_to_sinteger()

WS_DLL_PUBLIC bool ftype_can_val_to_sinteger ( enum ftenum  ftype)

Checks if a given ftype can be converted to a signed integer.

Parameters
ftypeThe type of field to check.
Returns
true If the ftype can be converted to a signed integer, false otherwise.

◆ ftype_can_val_to_sinteger64()

WS_DLL_PUBLIC bool ftype_can_val_to_sinteger64 ( enum ftenum  ftype)

Checks if a given field type can be converted to a signed 64-bit integer.

Parameters
ftypeThe field type to check.
Returns
true If the field type can be converted to a signed 64-bit integer, false otherwise.

◆ ftype_can_val_to_uinteger()

WS_DLL_PUBLIC bool ftype_can_val_to_uinteger ( enum ftenum  ftype)

Checks if a given ftenum can be converted to an unsigned integer.

Parameters
ftypeThe ftenum type to check.
Returns
true If the ftype can be converted to an unsigned integer, false otherwise.

◆ ftype_can_val_to_uinteger64()

WS_DLL_PUBLIC bool ftype_can_val_to_uinteger64 ( enum ftenum  ftype)

Checks if a given ftenum can be converted to an unsigned 64-bit integer.

Parameters
ftypeThe ftenum to check.
Returns
true If the ftype can be converted to an unsigned 64-bit integer.
false Otherwise.

◆ ftype_name()

WS_DLL_PUBLIC const char * ftype_name ( ftenum_t  ftype)

Get the name of a field type.

Parameters
ftypeThe field type to get the name for.
Returns
A const char* pointing to the name of the field type, or "(null)" if not recognized.

◆ ftype_pretty_name()

WS_DLL_PUBLIC const char * ftype_pretty_name ( ftenum_t  ftype)

Returns a string representing the "pretty" name of the field type.

The pretty name is more user-friendly than the internal "FT_*" name.

Parameters
ftypeThe field type to get the pretty name for.
Returns
A const char* pointing to the pretty name of the field type, or "(null)" if not found.

◆ ftype_similar_types()

bool ftype_similar_types ( const enum ftenum  ftype_a,
const enum ftenum  ftype_b 
)

Determine if two field types are similar.

Parameters
ftype_aThe first field type to compare.
ftype_bThe second field type to compare.
Returns
true If the field types are similar.
false If the field types are not similar.

◆ ftype_wire_size()

WS_DLL_PUBLIC int ftype_wire_size ( ftenum_t  ftype)

Get the wire size of a field type.

Parameters
ftypeThe field type to query.
Returns
int The wire size of the field type.

◆ ftypes_initialize()

void ftypes_initialize ( void  )

Initializes various field types in Wireshark.

This function registers all built-in field types used by Wireshark for packet analysis.

◆ ftypes_register_pseudofields()

void ftypes_register_pseudofields ( void  )

Registers pseudofields for various data types in Wireshark.

This function registers a set of pseudofields that can be used to represent different data types within Wireshark. This includes bytes, double, IEEE 11073 float, integers, IPv4, IPv6, GUIDs, none, strings, time, and TV buffers.

◆ fvalue_add()

WS_DLL_PUBLIC fvalue_t * fvalue_add ( const fvalue_t a,
const fvalue_t b,
char **  err_msg 
)

Adds two fvalue_t objects.

Parameters
aThe first fvalue_t object to add.
bThe second fvalue_t object to add.
err_msgA pointer to a char pointer that will store any error message.
Returns
fvalue_t* A new fvalue_t object containing the result of the addition, or NULL on failure.

◆ fvalue_bitwise_and()

WS_DLL_PUBLIC fvalue_t * fvalue_bitwise_and ( const fvalue_t a,
const fvalue_t b,
char **  err_msg 
)

Perform a bitwise AND operation on two fvalue_t objects.

Parameters
aPointer to the first fvalue_t object.
bPointer to the second fvalue_t object.
err_msgPointer to a string that will hold any error message if an error occurs.
Returns
Pointer to the result of the bitwise AND operation, or NULL on failure.

◆ fvalue_cleanup()

WS_DLL_PUBLIC void fvalue_cleanup ( fvalue_t fv)

Clean up a fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure to clean up.

◆ fvalue_contains()

WS_DLL_PUBLIC ft_bool_t fvalue_contains ( const fvalue_t a,
const fvalue_t b 
)

Checks if one fvalue_t contains another.

Parameters
aThe first fvalue_t to check.
bThe second fvalue_t to check for containment within the first.
Returns
true If 'a' contains 'b'.
false Otherwise.

< Comparison result: true

< Comparison result: false

◆ fvalue_divide()

WS_DLL_PUBLIC fvalue_t * fvalue_divide ( const fvalue_t a,
const fvalue_t b,
char **  err_msg 
)

Divides two fvalue_t objects.

Parameters
aPointer to the first fvalue_t object.
bPointer to the second fvalue_t object.
err_msgPointer to a string that will hold an error message if an error occurs.
Returns
The result of the division as an fvalue_t object, or NULL on error.

◆ fvalue_dup()

WS_DLL_PUBLIC fvalue_t * fvalue_dup ( const fvalue_t fv)

Duplicates a fvalue_t structure.

Creates a new fvalue_t structure and copies the data from the original one. If a deep copy is required, it uses the appropriate copy function.

Parameters
fvPointer to the original fvalue_t structure.
Returns
A pointer to the newly created fvalue_t structure.

◆ fvalue_eq()

WS_DLL_PUBLIC ft_bool_t fvalue_eq ( const fvalue_t a,
const fvalue_t b 
)

Compares two fvalue_t structures for equality.

Parameters
aPointer to the first fvalue_t structure.
bPointer to the second fvalue_t structure.
Returns
ft_bool_t FT_TRUE if the values are equal, FT_FALSE otherwise.

< Comparison result: true

< Comparison result: false

◆ fvalue_equal()

WS_DLL_PUBLIC bool fvalue_equal ( const fvalue_t a,
const fvalue_t b 
)

Compares two fvalue_t structures for equality.

This function checks if two fvalue_t structures are equal based on their values and types.

Parameters
aPointer to the first fvalue_t structure.
bPointer to the second fvalue_t structure.
Returns
FT_TRUE if the two fvalue_t structures are equal, FT_FALSE otherwise.

< Comparison result: true

◆ fvalue_free()

WS_DLL_PUBLIC void fvalue_free ( fvalue_t fv)

Frees an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure to be freed.

◆ fvalue_from_charconst()

fvalue_t * fvalue_from_charconst ( ftenum_t  ftype,
unsigned long  number,
char **  err_msg 
)

Create a new fvalue from a character constant.

Parameters
ftypeThe type of the fvalue to create.
numberThe character constant value.
err_msgA pointer to a string that will be set if an error occurs.
Returns
A pointer to the created fvalue, or NULL on failure.

◆ fvalue_from_floating()

fvalue_t * fvalue_from_floating ( ftenum_t  ftype,
const char *  s,
double  number,
char **  err_msg 
)

Creates a floating-point field value from a string representation.

Parameters
ftypeThe type of the field.
sThe string representation of the number.
numberThe numeric value to be converted.
err_msgA pointer to a buffer where an error message will be stored if conversion fails.
Returns
A new fvalue_t representing the floating-point value, or NULL on failure.

◆ fvalue_from_literal()

WS_DLL_PUBLIC fvalue_t * fvalue_from_literal ( ftenum_t  ftype,
const char *  s,
bool  allow_partial_value,
char **  err_msg 
)

Create a new fvalue from a literal string.

Parameters
ftypeThe type of the fvalue to create.
sThe literal string to convert.
allow_partial_valueWhether partial values are allowed.
err_msgPointer to store error message if conversion fails.
Returns
A new fvalue on success, NULL otherwise.

◆ fvalue_from_sinteger64()

fvalue_t * fvalue_from_sinteger64 ( ftenum_t  ftype,
const char *  s,
int64_t  number,
char **  err_msg 
)

Creates a field value from a signed 64-bit integer.

Parameters
ftypeThe type of the field value to create.
sA string representation of the number.
numberThe signed 64-bit integer value.
err_msgPointer to a string that will receive an error message if the conversion fails.
Returns
A pointer to the created field value, or NULL if the conversion fails.

◆ fvalue_from_string()

fvalue_t * fvalue_from_string ( ftenum_t  ftype,
const char *  s,
size_t  len,
char **  err_msg 
)

Create a new fvalue_t from a string.

Parameters
ftypeThe type of the fvalue to create.
sThe string to convert.
lenThe length of the string.
err_msgA pointer to a char pointer that will receive an error message if conversion fails.
Returns
A new fvalue_t or NULL on failure.
Note
String MUST be null-terminated. Length is optional (pass zero) and does not include the null terminator.

◆ fvalue_from_uinteger64()

fvalue_t * fvalue_from_uinteger64 ( ftenum_t  ftype,
const char *  s,
uint64_t  number,
char **  err_msg 
)

Creates a new fvalue_t from an unsigned 64-bit integer.

Parameters
ftypeThe field type of the value to create.
sA string representation of the number (for error messages).
numberThe unsigned 64-bit integer value.
err_msgPointer to a char pointer that will receive an error message if conversion fails.
Returns
A new fvalue_t containing the unsigned 64-bit integer, or NULL on failure.

◆ fvalue_ge()

WS_DLL_PUBLIC ft_bool_t fvalue_ge ( const fvalue_t a,
const fvalue_t b 
)

Compares two fvalue_t structures for greater than or equal to.

Parameters
aPointer to the first fvalue_t structure.
bPointer to the second fvalue_t structure.
Returns
ft_bool_t True if a is greater than or equal to b, False otherwise.

< Comparison result: true

< Comparison result: false

◆ fvalue_get_bytes()

WS_DLL_PUBLIC GBytes * fvalue_get_bytes ( fvalue_t fv)

Get the bytes value from an fvalue_t.

Parameters
fvThe fvalue_t containing the bytes value.
Returns
const void* A pointer to the bytes data.

◆ fvalue_get_bytes_data()

WS_DLL_PUBLIC const void * fvalue_get_bytes_data ( fvalue_t fv)

Retrieves the bytes data from an fvalue_t.

Parameters
fvThe fvalue_t to retrieve the bytes data from.
Returns
const void* A pointer to the bytes data.

◆ fvalue_get_bytes_size()

WS_DLL_PUBLIC size_t fvalue_get_bytes_size ( fvalue_t fv)

Get the size of the bytes data stored in an fvalue_t.

Parameters
fvPointer to the fvalue_t containing the bytes data.
Returns
The size of the bytes data.

◆ fvalue_get_floating()

WS_DLL_PUBLIC double fvalue_get_floating ( fvalue_t fv)

Retrieves the floating-point value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the floating-point value.
Returns
The floating-point value.

◆ fvalue_get_guid()

WS_DLL_PUBLIC const e_guid_t * fvalue_get_guid ( fvalue_t fv)

Retrieves a GUID value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the GUID value.
Returns
const char* The GUID value as a string, or NULL if not applicable.

◆ fvalue_get_ipv4()

WS_DLL_PUBLIC const ipv4_addr_and_mask * fvalue_get_ipv4 ( fvalue_t fv)

Retrieves the IPv4 address from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the IPv4 address.
Returns
The IPv4 address as a pointer to ipv4_addr_and_mask.

◆ fvalue_get_ipv6()

WS_DLL_PUBLIC const ipv6_addr_and_prefix * fvalue_get_ipv6 ( fvalue_t fv)

Retrieves the IPv6 value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the IPv6 value.
Returns
The IPv6 address as a string.

◆ fvalue_get_protocol()

WS_DLL_PUBLIC tvbuff_t * fvalue_get_protocol ( fvalue_t fv)

Get the protocol value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the protocol value.
Returns
The protocol value as a uint32_t.

◆ fvalue_get_sinteger()

WS_DLL_PUBLIC int32_t fvalue_get_sinteger ( fvalue_t fv)

Retrieves a signed integer value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the value.
Returns
The signed integer value.

◆ fvalue_get_sinteger64()

WS_DLL_PUBLIC int64_t fvalue_get_sinteger64 ( fvalue_t fv)

Get the 64-bit signed integer value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the value.
Returns
The 64-bit signed integer value.

◆ fvalue_get_strbuf()

WS_DLL_PUBLIC const wmem_strbuf_t * fvalue_get_strbuf ( fvalue_t fv)

Retrieves the string buffer value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure.
Returns
tvbuff_t* Pointer to the tvbuff_t containing the string buffer, or NULL if not applicable.

◆ fvalue_get_string()

WS_DLL_PUBLIC const char * fvalue_get_string ( fvalue_t fv)

Get a string representation of an fvalue.

Parameters
fvPointer to the fvalue structure.
Returns
A pointer to the string representation of the fvalue.

◆ fvalue_get_time()

WS_DLL_PUBLIC const nstime_t * fvalue_get_time ( fvalue_t fv)

Retrieves a time value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the time value.
Returns
The time value as a pointer to an nstime_t structure.

◆ fvalue_get_uinteger()

WS_DLL_PUBLIC uint32_t fvalue_get_uinteger ( fvalue_t fv)

Get the unsigned integer value from an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the value.
Returns
The unsigned integer value.

◆ fvalue_get_uinteger64()

WS_DLL_PUBLIC uint64_t fvalue_get_uinteger64 ( fvalue_t fv)

Retrieves an unsigned 64-bit integer value from a fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure containing the value.
Returns
The retrieved unsigned 64-bit integer value.

◆ fvalue_gt()

WS_DLL_PUBLIC ft_bool_t fvalue_gt ( const fvalue_t a,
const fvalue_t b 
)

Compares two fvalue_t structures to determine if the first is greater than the second.

Parameters
aPointer to the first fvalue_t structure.
bPointer to the second fvalue_t structure.
Returns
ft_bool_t FT_TRUE if a > b, otherwise FT_FALSE.

< Comparison result: true

< Comparison result: false

◆ fvalue_hash()

WS_DLL_PUBLIC unsigned fvalue_hash ( const fvalue_t fv)

Calculate the hash value for a fvalue_t.

Parameters
fvPointer to the fvalue_t structure.
Returns
The calculated hash value.

◆ fvalue_init()

WS_DLL_PUBLIC void fvalue_init ( fvalue_t fv,
ftenum_t  ftype 
)

Initialize a fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure to initialize.
ftypeThe type of the value to be stored in the fvalue_t structure.

◆ fvalue_is_nan()

WS_DLL_PUBLIC bool fvalue_is_nan ( const fvalue_t a)

Checks if a fvalue_t is NaN.

Parameters
aPointer to the fvalue_t to check.
Returns
true If the fvalue_t is NaN, false otherwise.

◆ fvalue_is_negative()

WS_DLL_PUBLIC bool fvalue_is_negative ( const fvalue_t a)

Checks if a fvalue_t is negative.

Parameters
aPointer to the fvalue_t to check.
Returns
true If the fvalue_t is negative, false otherwise.

◆ fvalue_is_zero()

WS_DLL_PUBLIC bool fvalue_is_zero ( const fvalue_t a)

Checks if a fvalue_t is zero.

Parameters
aPointer to the fvalue_t to check.
Returns
true If the fvalue_t is zero, false otherwise.

◆ fvalue_le()

WS_DLL_PUBLIC ft_bool_t fvalue_le ( const fvalue_t a,
const fvalue_t b 
)

Compares two fvalue_t objects lexicographically.

Parameters
aPointer to the first fvalue_t object.
bPointer to the second fvalue_t object.
Returns
ft_bool_t FT_TRUE if a is less than or equal to b, otherwise FT_FALSE.

< Comparison result: true

< Comparison result: false

◆ fvalue_length2()

WS_DLL_PUBLIC size_t fvalue_length2 ( fvalue_t fv)

Get the length of a fvalue_t.

Parameters
fvThe fvalue_t to get the length from.
Returns
size_t The length of the fvalue_t, or 0 if an error occurs.

◆ fvalue_lt()

WS_DLL_PUBLIC ft_bool_t fvalue_lt ( const fvalue_t a,
const fvalue_t b 
)

Compares two fvalue_t objects to determine if the first is less than the second.

Parameters
aPointer to the first fvalue_t object.
bPointer to the second fvalue_t object.
Returns
ft_bool_t FT_TRUE if a < b, otherwise FT_FALSE.

< Comparison result: true

< Comparison result: false

◆ fvalue_matches()

WS_DLL_PUBLIC ft_bool_t fvalue_matches ( const fvalue_t a,
const ws_regex_t re 
)

Checks if a fvalue_t matches a regular expression.

Parameters
aThe fvalue_t to check.
reThe regular expression to match against.
Returns
true If the fvalue_t matches the regular expression.
false If the fvalue_t does not match the regular expression.

< Comparison result: true

< Comparison result: false

◆ fvalue_modulo()

WS_DLL_PUBLIC fvalue_t * fvalue_modulo ( const fvalue_t a,
const fvalue_t b,
char **  err_msg 
)

Calculate the modulo of two fvalue_t objects.

Parameters
aPointer to the first fvalue_t object.
bPointer to the second fvalue_t object.
err_msgPointer to store error message if any.
Returns
The result of the modulo operation as an fvalue_t object.

◆ fvalue_multiply()

WS_DLL_PUBLIC fvalue_t * fvalue_multiply ( const fvalue_t a,
const fvalue_t b,
char **  err_msg 
)

Multiplies two fvalue_t objects.

Parameters
aPointer to the first fvalue_t object.
bPointer to the second fvalue_t object.
err_msgPointer to a string that will hold any error message if an error occurs.
Returns
A new fvalue_t object containing the result of the multiplication, or NULL on failure.

◆ fvalue_ne()

WS_DLL_PUBLIC ft_bool_t fvalue_ne ( const fvalue_t a,
const fvalue_t b 
)

Compares two fvalue_t structures for inequality.

Parameters
aPointer to the first fvalue_t structure.
bPointer to the second fvalue_t structure.
Returns
ft_bool_t FT_TRUE if the values are not equal, FT_FALSE otherwise.

< Comparison result: true

< Comparison result: false

◆ fvalue_new()

WS_DLL_PUBLIC fvalue_t * fvalue_new ( ftenum_t  ftype)

Creates a new fvalue_t structure.

Parameters
ftypeThe type of the fvalue to create.
Returns
A pointer to the newly created fvalue_t structure.

◆ fvalue_set_ax25()

WS_DLL_PUBLIC void fvalue_set_ax25 ( fvalue_t fv,
const uint8_t *  value 
)

Set the value of an fvalue_t to an AX.25 address.

Parameters
fvPointer to the fvalue_t structure to be set.
valuePointer to the byte array containing the AX.25 address.

◆ fvalue_set_byte_array()

WS_DLL_PUBLIC void fvalue_set_byte_array ( fvalue_t fv,
GByteArray *  value 
)

Set the byte array value of an fvalue_t.

Parameters
fvPointer to the fvalue_t structure.
valuePointer to the GByteArray containing the byte array data.

◆ fvalue_set_bytes()

WS_DLL_PUBLIC void fvalue_set_bytes ( fvalue_t fv,
GBytes *  value 
)

Set the value of an fvalue_t to a GBytes object.

Parameters
fvPointer to the fvalue_t structure.
valuePointer to the GBytes object containing the data.

◆ fvalue_set_bytes_data()

WS_DLL_PUBLIC void fvalue_set_bytes_data ( fvalue_t fv,
const void *  data,
size_t  size 
)

Set the bytes data for a fvalue_t.

Parameters
fvThe fvalue_t to set.
dataThe data to set.
sizeThe size of the data.

◆ fvalue_set_ether()

WS_DLL_PUBLIC void fvalue_set_ether ( fvalue_t fv,
const uint8_t *  value 
)

Set the value of an fvalue_t to a new Ethernet address.

Parameters
fvPointer to the fvalue_t structure to be modified.
valuePointer to the uint8_t array containing the Ethernet address.

◆ fvalue_set_fcwwn()

WS_DLL_PUBLIC void fvalue_set_fcwwn ( fvalue_t fv,
const uint8_t *  value 
)

Set the value of an fvalue_t to a FC-WWN (Fibre Channel World Wide Name).

Parameters
fvPointer to the fvalue_t structure.
valuePointer to the uint8_t array containing the FC-WWN value.

◆ fvalue_set_floating()

WS_DLL_PUBLIC void fvalue_set_floating ( fvalue_t fv,
double  value 
)

Set the floating-point value of an fvalue_t.

Parameters
fvPointer to the fvalue_t structure.
valueThe double value to set.

◆ fvalue_set_guid()

WS_DLL_PUBLIC void fvalue_set_guid ( fvalue_t fv,
const e_guid_t value 
)

Set the value of a fvalue_t to a GUID.

Parameters
fvPointer to the fvalue_t structure.
valuePointer to the e_guid_t structure containing the GUID value.

◆ fvalue_set_ipv4()

WS_DLL_PUBLIC void fvalue_set_ipv4 ( fvalue_t fv,
const ipv4_addr_and_mask value 
)

Set the IPv4 value of an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure.
valuePointer to the ipv4_addr_and_mask structure containing the new value.

◆ fvalue_set_ipv6()

WS_DLL_PUBLIC void fvalue_set_ipv6 ( fvalue_t fv,
const ipv6_addr_and_prefix value 
)

Set the IPv6 value of an fvalue_t.

Parameters
fvPointer to the fvalue_t structure.
valuePointer to the ipv6_addr_and_prefix structure containing the new value.

◆ fvalue_set_protocol()

WS_DLL_PUBLIC void fvalue_set_protocol ( fvalue_t fv,
tvbuff_t value,
const char *  name,
int  length 
)

Set the protocol value for a field value.

Parameters
fvPointer to the field value structure.
valuePointer to the tvbuff containing the protocol data.
nameName of the protocol.
lengthLength of the protocol data.

◆ fvalue_set_protocol_length()

WS_DLL_PUBLIC void fvalue_set_protocol_length ( fvalue_t fv,
int  length 
)

Set the protocol length for a fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure.
lengthThe new protocol length to set.

◆ fvalue_set_sinteger()

WS_DLL_PUBLIC void fvalue_set_sinteger ( fvalue_t fv,
int32_t  value 
)

Set the value of an fvalue_t to a signed 32-bit integer.

Parameters
fvPointer to the fvalue_t structure.
valueThe signed 32-bit integer value to set.

◆ fvalue_set_sinteger64()

WS_DLL_PUBLIC void fvalue_set_sinteger64 ( fvalue_t fv,
int64_t  value 
)

Set the value of an fvalue_t to a 64-bit signed integer.

Parameters
fvPointer to the fvalue_t structure.
valueThe 64-bit signed integer value to set.

◆ fvalue_set_strbuf()

WS_DLL_PUBLIC void fvalue_set_strbuf ( fvalue_t fv,
wmem_strbuf_t value 
)

Set the value of an fvalue_t to a string buffer.

Parameters
fvPointer to the fvalue_t structure.
valuePointer to the wmem_strbuf_t containing the new value.

◆ fvalue_set_string()

WS_DLL_PUBLIC void fvalue_set_string ( fvalue_t fv,
const char *  value 
)

Set the string value of an fvalue_t.

Parameters
fvPointer to the fvalue_t structure.
valueThe string value to set.

◆ fvalue_set_time()

WS_DLL_PUBLIC void fvalue_set_time ( fvalue_t fv,
const nstime_t value 
)

Set the time value of an fvalue_t structure.

Parameters
fvPointer to the fvalue_t structure to be modified.
valuePointer to the nstime_t structure containing the new time value.

◆ fvalue_set_uinteger()

WS_DLL_PUBLIC void fvalue_set_uinteger ( fvalue_t fv,
uint32_t  value 
)

Set the value of a fvalue_t to an unsigned 32-bit integer.

Parameters
fvPointer to the fvalue_t structure.
valueThe unsigned 32-bit integer value to set.

◆ fvalue_set_uinteger64()

WS_DLL_PUBLIC void fvalue_set_uinteger64 ( fvalue_t fv,
uint64_t  value 
)

Set the value of a fvalue_t to an unsigned 64-bit integer.

Parameters
fvPointer to the fvalue_t structure.
valueThe unsigned 64-bit integer value to set.

◆ fvalue_set_vines()

WS_DLL_PUBLIC void fvalue_set_vines ( fvalue_t fv,
const uint8_t *  value 
)

Set the value of an fvalue_t to a VINES address.

Parameters
fvPointer to the fvalue_t structure.
valuePointer to the uint8_t array containing the VINES address.

◆ fvalue_slice()

WS_DLL_PUBLIC fvalue_t * fvalue_slice ( fvalue_t fv,
drange_t dr 
)

Slices a fvalue_t based on a drange_t.

Parameters
fvThe fvalue_t to slice.
drThe range to slice the fvalue_t by.
Returns
A new fvalue_t containing the sliced data, or NULL if an error occurs.

◆ fvalue_subtract()

WS_DLL_PUBLIC fvalue_t * fvalue_subtract ( const fvalue_t a,
const fvalue_t b,
char **  err_msg 
)

Subtracts one fvalue from another.

Parameters
aThe first fvalue to subtract from.
bThe fvalue to subtract.
err_msgPointer to store error message if any.
Returns
The result of the subtraction or NULL on failure.

◆ fvalue_to_double()

WS_DLL_PUBLIC enum ft_result fvalue_to_double ( const fvalue_t fv,
double *  repr 
)

Convert a fvalue_t to its double representation.

Parameters
fvPointer to the fvalue_t structure.
reprPointer to store the double representation.
Returns
FTENUM_T The result of the conversion or an error code.

◆ fvalue_to_sinteger()

WS_DLL_PUBLIC enum ft_result fvalue_to_sinteger ( const fvalue_t fv,
int32_t *  repr 
)

Convert a fvalue_t to a 32-bit signed integer.

Parameters
fvThe fvalue_t to convert.
reprPointer to store the converted 32-bit signed integer.
Returns
enum ft_result Result of the conversion.

◆ fvalue_to_sinteger64()

WS_DLL_PUBLIC enum ft_result fvalue_to_sinteger64 ( const fvalue_t fv,
int64_t *  repr 
)

Convert a fvalue_t to an int64_t.

Parameters
fvThe fvalue_t to convert.
reprPointer to store the converted value.
Returns
enum ft_result FT_OK on success, FT_BADARG if conversion is not supported.

◆ fvalue_to_string_repr()

WS_DLL_PUBLIC char * fvalue_to_string_repr ( wmem_allocator_t scope,
const fvalue_t fv,
ftrepr_t  rtype,
int  field_display 
)

Convert a fvalue to its string representation.

Creates the string representation of the field value. Memory for the buffer is allocated based on wmem allocator provided.

field_display parameter should be a BASE_ value (enum field_display_e) BASE_NONE should be used if field information isn't available.

Returns NULL if the string cannot be represented in the given rtype.

Parameters
scopeMemory allocator scope.
fvThe fvalue to convert.
rtypeThe type of representation required.
field_displayDisplay options for the field.
Returns
A pointer to the string representation, or NULL if not available.

◆ fvalue_to_uinteger()

WS_DLL_PUBLIC enum ft_result fvalue_to_uinteger ( const fvalue_t fv,
uint32_t *  repr 
)

Convert a fvalue_t to an unsigned 32-bit integer.

Parameters
fvThe fvalue_t to convert.
reprPointer to store the resulting unsigned 32-bit integer.
Returns
enum ft_result FT_OK on success, FT_OVERFLOW if the value is too large for uint32_t.

◆ fvalue_to_uinteger64()

WS_DLL_PUBLIC enum ft_result fvalue_to_uinteger64 ( const fvalue_t fv,
uint64_t *  repr 
)

Convert a fvalue_t to an unsigned 64-bit integer.

Parameters
fvThe fvalue_t to convert.
reprPointer to store the converted value.
Returns
enum ft_result FT_OK on success, FT_BADARG if conversion is not supported.

◆ fvalue_type_ftenum()

WS_DLL_PUBLIC ftenum_t fvalue_type_ftenum ( const fvalue_t fv)

Get the ftype of a fvalue_t.

Parameters
fvThe fvalue_t to get the ftype from.
Returns
The ftype of the fvalue_t.

◆ fvalue_type_name()

WS_DLL_PUBLIC const char * fvalue_type_name ( const fvalue_t fv)

Get the name of the type associated with a fvalue_t.

Parameters
fvPointer to the fvalue_t structure.
Returns
const char* The name of the type.

◆ fvalue_unary_minus()

WS_DLL_PUBLIC fvalue_t * fvalue_unary_minus ( const fvalue_t fv,
char **  err_msg 
)

Applies unary minus operation to a fvalue.

Parameters
fvPointer to the fvalue to apply the unary minus operation on.
err_msgPointer to a string that will hold any error message if an error occurs.
Returns
Pointer to the resulting fvalue after applying the unary minus, or NULL if an error occurred.