Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
ftypes-int.h File Reference
#include "ftypes.h"
#include <epan/proto.h>
#include <epan/packet.h>

Go to the source code of this file.

Classes

struct  _fvalue_t
 Represents a typed field value used in protocol dissection. More...
 
struct  _ftype_t
 Describes a field type and its associated operations for display filtering. More...
 

Macros

#define FTYPE_LOOKUP(ftype, result)
 

Typedefs

typedef void(* FvalueNewFunc) (fvalue_t *)
 
typedef void(* FvalueCopyFunc) (fvalue_t *, const fvalue_t *)
 
typedef void(* FvalueFreeFunc) (fvalue_t *)
 
typedef bool(* FvalueFromLiteral) (fvalue_t *, const char *, bool, char **)
 
typedef bool(* FvalueFromString) (fvalue_t *, const char *, size_t, char **)
 
typedef bool(* FvalueFromCharConst) (fvalue_t *, unsigned long, char **)
 
typedef bool(* FvalueFromUnsignedInt64) (fvalue_t *, const char *, uint64_t, char **)
 
typedef bool(* FvalueFromSignedInt64) (fvalue_t *, const char *, int64_t, char **)
 
typedef bool(* FvalueFromDouble) (fvalue_t *, const char *, double, char **)
 
typedef char *(* FvalueToStringRepr) (wmem_allocator_t *, const fvalue_t *, ftrepr_t, int field_display)
 
typedef enum ft_result(* FvalueToUnsignedInt64) (const fvalue_t *, uint64_t *)
 
typedef enum ft_result(* FvalueToSignedInt64) (const fvalue_t *, int64_t *)
 
typedef enum ft_result(* FvalueToDouble) (const fvalue_t *, double *)
 
typedef void(* FvalueSetBytesFunc) (fvalue_t *, GBytes *)
 
typedef void(* FvalueSetGuidFunc) (fvalue_t *, const e_guid_t *)
 
typedef void(* FvalueSetTimeFunc) (fvalue_t *, const nstime_t *)
 
typedef void(* FvalueSetStrbufFunc) (fvalue_t *, wmem_strbuf_t *)
 
typedef void(* FvalueSetProtocolFunc) (fvalue_t *, tvbuff_t *value, const char *name, int length)
 
typedef void(* FvalueSetUnsignedIntegerFunc) (fvalue_t *, uint32_t)
 
typedef void(* FvalueSetSignedIntegerFunc) (fvalue_t *, int32_t)
 
typedef void(* FvalueSetUnsignedInteger64Func) (fvalue_t *, uint64_t)
 
typedef void(* FvalueSetSignedInteger64Func) (fvalue_t *, int64_t)
 
typedef void(* FvalueSetFloatingFunc) (fvalue_t *, double)
 
typedef void(* FvalueSetIpv4Func) (fvalue_t *, const ipv4_addr_and_mask *)
 
typedef void(* FvalueSetIpv6Func) (fvalue_t *, const ipv6_addr_and_prefix *)
 
typedef GBytes *(* FvalueGetBytesFunc) (fvalue_t *)
 
typedef const e_guid_t *(* FvalueGetGuidFunc) (fvalue_t *)
 
typedef const nstime_t *(* FvalueGetTimeFunc) (fvalue_t *)
 
typedef const wmem_strbuf_t *(* FvalueGetStrbufFunc) (fvalue_t *)
 
typedef tvbuff_t *(* FvalueGetProtocolFunc) (fvalue_t *)
 
typedef uint32_t(* FvalueGetUnsignedIntegerFunc) (fvalue_t *)
 
typedef int32_t(* FvalueGetSignedIntegerFunc) (fvalue_t *)
 
typedef uint64_t(* FvalueGetUnsignedInteger64Func) (fvalue_t *)
 
typedef int64_t(* FvalueGetSignedInteger64Func) (fvalue_t *)
 
typedef double(* FvalueGetFloatingFunc) (fvalue_t *)
 
typedef const ipv4_addr_and_mask *(* FvalueGetIpv4Func) (fvalue_t *)
 
typedef const ipv6_addr_and_prefix *(* FvalueGetIpv6Func) (fvalue_t *)
 
typedef enum ft_result(* FvalueCompare) (const fvalue_t *, const fvalue_t *, int *)
 
typedef enum ft_result(* FvalueContains) (const fvalue_t *, const fvalue_t *, bool *)
 
typedef enum ft_result(* FvalueMatches) (const fvalue_t *, const ws_regex_t *, bool *)
 
typedef bool(* FvalueIs) (const fvalue_t *)
 
typedef unsigned(* FvalueLen) (fvalue_t *)
 
typedef unsigned(* FvalueHashFunc) (const fvalue_t *)
 
typedef void(* FvalueSlice) (fvalue_t *, void *, unsigned offset, unsigned length)
 
typedef enum ft_result(* FvalueUnaryOp) (fvalue_t *, const fvalue_t *, char **)
 
typedef enum ft_result(* FvalueBinaryOp) (fvalue_t *, const fvalue_t *, const fvalue_t *, char **)
 

Functions

void ftype_register (enum ftenum ftype, const ftype_t *ft)
 Registers a field type handler for Wireshark.
 
void ftype_register_bytes (void)
 Registers the bytes data type handler for Wireshark.
 
void ftype_register_double (void)
 Registers the double data type handler for Wireshark.
 
void ftype_register_ieee_11073_float (void)
 Registers the IEEE 11073 float data type.
 
void ftype_register_integers (void)
 Registers all integer-related field types.
 
void ftype_register_ipv4 (void)
 Registers IPv4 data type.
 
void ftype_register_ipv6 (void)
 Registers IPv6 data type.
 
void ftype_register_guid (void)
 Registers the GUID data type.
 
void ftype_register_none (void)
 Registers the "none" data type.
 
void ftype_register_string (void)
 Registers string field types.
 
void ftype_register_time (void)
 Registers time-related field types.
 
void ftype_register_tvbuff (void)
 Registers a new ftype for TVB (Protocol Data Unit) data.
 
void ftype_register_pseudofields_bytes (int proto)
 Registers pseudofields for byte-related data types.
 
void ftype_register_pseudofields_double (int proto)
 Registers pseudofields for double type.
 
void ftype_register_pseudofields_ieee_11073_float (int proto)
 Registers pseudofields for IEEE 11073 float type.
 
void ftype_register_pseudofields_integer (int proto)
 Registers pseudofields for integer types.
 
void ftype_register_pseudofields_ipv4 (int proto)
 Registers pseudofields for IPv4 data types.
 
void ftype_register_pseudofields_ipv6 (int proto)
 Registers pseudofields for IPv6 data types.
 
void ftype_register_pseudofields_guid (int proto)
 Registers pseudofields for GUID type.
 
void ftype_register_pseudofields_none (int proto)
 Registers pseudofields for a protocol with no specific type.
 
void ftype_register_pseudofields_string (int proto)
 Registers pseudofields for string types.
 
void ftype_register_pseudofields_time (int proto)
 Registers pseudofields for time-related data types.
 
void ftype_register_pseudofields_tvbuff (int proto)
 Registers pseudofields for TVB (Protocol Data Unit) data.
 
GByteArray * byte_array_from_literal (const char *s, char **err_msg)
 Convert a literal string to a GByteArray.
 
GByteArray * byte_array_from_charconst (unsigned long num, char **err_msg)
 Convert an unsigned long to a byte array.
 
char * bytes_to_dfilter_repr (wmem_allocator_t *scope, const uint8_t *src, size_t src_size)
 Convert bytes to a string representation suitable for display filters.
 

Variables

const ftype_ttype_list [FT_ENUM_SIZE+1]
 

Detailed Description

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

◆ FTYPE_LOOKUP

#define FTYPE_LOOKUP (   ftype,
  result 
)
Value:
/* Check input */ \
ws_assert(ftype < FT_NUM_TYPES); \
result = type_list[ftype];
@ FT_NUM_TYPES
Definition ftypes.h:73

Function Documentation

◆ byte_array_from_charconst()

GByteArray * byte_array_from_charconst ( unsigned long  num,
char **  err_msg 
)

Convert an unsigned long to a byte array.

Parameters
numThe number to convert.
err_msgPointer to store error message if conversion fails.
Returns
A new GByteArray containing the byte representation of num, or NULL on failure.

◆ byte_array_from_literal()

GByteArray * byte_array_from_literal ( const char *  s,
char **  err_msg 
)

Convert a literal string to a GByteArray.

This function takes a literal string and converts it into a GByteArray. Leading colons are skipped, and special cases for one-byte hex literals are handled.

Parameters
sThe input literal string.
err_msgPointer to store error message if any.
Returns
A new GByteArray or NULL on failure.

◆ bytes_to_dfilter_repr()

char * bytes_to_dfilter_repr ( wmem_allocator_t scope,
const uint8_t *  src,
size_t  src_size 
)

Convert bytes to a string representation suitable for display filters.

This function converts an array of bytes into a hexadecimal string with punctuation, which can be used in display filters.

Parameters
scopeMemory allocation scope.
srcPointer to the source byte array.
src_sizeSize of the source byte array.
Returns
A newly allocated string representing the bytes, or NULL on failure.

◆ ftype_register()

void ftype_register ( enum ftenum  ftype,
const ftype_t ft 
)

Registers a field type handler for Wireshark.

This function registers a new field type handler with the specified details.

Parameters
ftypeThe enum value representing the field type to register.
ftA pointer to the ftype_t structure containing details of the field type.

◆ ftype_register_pseudofields_bytes()

void ftype_register_pseudofields_bytes ( int  proto)

Registers pseudofields for byte-related data types.

Parameters
protoProtocol identifier to which the pseudofields will be registered.

◆ ftype_register_pseudofields_double()

void ftype_register_pseudofields_double ( int  proto)

Registers pseudofields for double type.

Parameters
protoProtocol to register fields for.

◆ ftype_register_pseudofields_guid()

void ftype_register_pseudofields_guid ( int  proto)

Registers pseudofields for GUID type.

Parameters
protoProtocol to register fields for.

◆ ftype_register_pseudofields_ieee_11073_float()

void ftype_register_pseudofields_ieee_11073_float ( int  proto)

Registers pseudofields for IEEE 11073 float type.

Parameters
protoProtocol to register fields for.

◆ ftype_register_pseudofields_integer()

void ftype_register_pseudofields_integer ( int  proto)

Registers pseudofields for integer types.

Parameters
protoProtocol to register fields for.

◆ ftype_register_pseudofields_ipv4()

void ftype_register_pseudofields_ipv4 ( int  proto)

Registers pseudofields for IPv4 data types.

Parameters
protoThe protocol to register the fields with.

◆ ftype_register_pseudofields_ipv6()

void ftype_register_pseudofields_ipv6 ( int  proto)

Registers pseudofields for IPv6 data types.

Parameters
protoThe protocol to register the fields with.

◆ ftype_register_pseudofields_none()

void ftype_register_pseudofields_none ( int  proto)

Registers pseudofields for a protocol with no specific type.

Parameters
protoThe protocol identifier to register the fields for.

◆ ftype_register_pseudofields_string()

void ftype_register_pseudofields_string ( int  proto)

Registers pseudofields for string types.

Parameters
protoProtocol number to register the fields with.

◆ ftype_register_pseudofields_time()

void ftype_register_pseudofields_time ( int  proto)

Registers pseudofields for time-related data types.

Parameters
protoProtocol identifier to which the fields will be registered.

◆ ftype_register_pseudofields_tvbuff()

void ftype_register_pseudofields_tvbuff ( int  proto)

Registers pseudofields for TVB (Protocol Data Unit) data.

Parameters
protoThe protocol to register the fields with.