Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
/builds/wireshark/wireshark/extcap_parser.h File Reference
#include <stdio.h>
#include <glib.h>
#include <string.h>
#include "ui/iface_toolbar.h"

Go to the source code of this file.

Classes

struct  _extcap_value
 
struct  _extcap_complex
 
struct  _extcap_arg
 
struct  _extcap_interface
 
struct  _extcap_dlt
 
struct  _extcap_token_sentence
 

Macros

#define ENUM_KEY(s)   GUINT_TO_POINTER((unsigned)s)
 
#define EXTCAP_PARAM_REQUIRED_SUFFICIENT   "sufficient"
 

Typedefs

typedef struct _extcap_value extcap_value
 
typedef struct _extcap_complex extcap_complex
 
typedef struct _extcap_arg extcap_arg
 
typedef struct _extcap_interface extcap_interface
 
typedef struct _extcap_dlt extcap_dlt
 
typedef struct _extcap_token_sentence extcap_token_sentence
 

Enumerations

enum  extcap_sentence_type {
  EXTCAP_SENTENCE_UNKNOWN , EXTCAP_SENTENCE_ARG , EXTCAP_SENTENCE_VALUE , EXTCAP_SENTENCE_EXTCAP ,
  EXTCAP_SENTENCE_INTERFACE , EXTCAP_SENTENCE_DLT , EXTCAP_SENTENCE_CONTROL
}
 
enum  extcap_arg_type {
  EXTCAP_ARG_UNKNOWN , EXTCAP_ARG_INTEGER , EXTCAP_ARG_UNSIGNED , EXTCAP_ARG_LONG ,
  EXTCAP_ARG_DOUBLE , EXTCAP_ARG_BOOLEAN , EXTCAP_ARG_BOOLFLAG , EXTCAP_ARG_STRING ,
  EXTCAP_ARG_PASSWORD , EXTCAP_ARG_SELECTOR , EXTCAP_ARG_EDIT_SELECTOR , EXTCAP_ARG_RADIO ,
  EXTCAP_ARG_MULTICHECK , EXTCAP_ARG_TABLE , EXTCAP_ARG_FILESELECT , EXTCAP_ARG_TIMESTAMP
}
 
enum  extcap_param_type {
  EXTCAP_PARAM_UNKNOWN , EXTCAP_PARAM_ARGNUM , EXTCAP_PARAM_CALL , EXTCAP_PARAM_DISPLAY ,
  EXTCAP_PARAM_TYPE , EXTCAP_PARAM_ARG , EXTCAP_PARAM_DEFAULT , EXTCAP_PARAM_VALUE ,
  EXTCAP_PARAM_RANGE , EXTCAP_PARAM_TOOLTIP , EXTCAP_PARAM_PLACEHOLDER , EXTCAP_PARAM_NAME ,
  EXTCAP_PARAM_ENABLED , EXTCAP_PARAM_FILE_MUSTEXIST , EXTCAP_PARAM_FILE_EXTENSION , EXTCAP_PARAM_GROUP ,
  EXTCAP_PARAM_PARENT , EXTCAP_PARAM_REQUIRED , EXTCAP_PARAM_RELOAD , EXTCAP_PARAM_CONFIGURABLE ,
  EXTCAP_PARAM_PREFIX , EXTCAP_PARAM_SAVE , EXTCAP_PARAM_VALIDATION , EXTCAP_PARAM_VERSION ,
  EXTCAP_PARAM_HELP , EXTCAP_PARAM_CONTROL , EXTCAP_PARAM_ROLE
}
 

Functions

extcap_complexextcap_parse_complex (extcap_arg_type complex_type, const char *data)
 Parse a complex value from a string.
 
void extcap_free_complex (extcap_complex *comp)
 Free a complex value.
 
void extcap_printf_complex (extcap_complex *comp)
 Prints a complex type using its string representation.
 
char * extcap_get_complex_as_string (extcap_complex *comp)
 Get a string representation of a complex type.
 
int extcap_complex_get_int (extcap_complex *comp)
 Retrieves an integer value from an extcap complex structure.
 
unsigned extcap_complex_get_uint (extcap_complex *comp)
 Retrieves an unsigned integer value from an extcap complex structure.
 
int64_t extcap_complex_get_long (extcap_complex *comp)
 Retrieves a long value from an extcap complex structure.
 
double extcap_complex_get_double (extcap_complex *comp)
 Retrieves the double value from an extcap_complex structure.
 
bool extcap_complex_get_bool (extcap_complex *comp)
 Retrieves the boolean value from an extcap complex structure.
 
char * extcap_complex_get_string (extcap_complex *comp)
 Get the string value from an extcap complex structure.
 
bool extcap_compare_is_default (extcap_arg *element, extcap_complex *test)
 Compares an argument's default complex value with a test complex value.
 
void extcap_free_arg (extcap_arg *a)
 Free a single argument.
 
void extcap_free_toolbar_control (iface_toolbar_control *control)
 Free entire toolbar control structure.
 
void extcap_free_arg_list (GList *a)
 Free an entire arg list.
 
GList * extcap_parse_args (char *output)
 
GList * extcap_parse_values (char *output)
 Parse all sentences for values.
 
GList * extcap_parse_interfaces (char *output, GList **control_items)
 Parse all sentences for interfaces.
 
GList * extcap_parse_dlts (char *output)
 Parse all sentences for DLT (Data Link Type) information.
 

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 1998 Gerald Combs

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

Function Documentation

◆ extcap_compare_is_default()

bool extcap_compare_is_default ( extcap_arg element,
extcap_complex test 
)

Compares an argument's default complex value with a test complex value.

Parameters
elementThe extcap_arg structure containing the default complex value.
testThe extcap_complex structure to compare against the default.
Returns
true if the default complex value matches the test value, false otherwise.

◆ extcap_complex_get_bool()

bool extcap_complex_get_bool ( extcap_complex comp)

Retrieves the boolean value from an extcap complex structure.

Parameters
compPointer to the extcap_complex structure.
Returns
true if the value is valid andmatches a boolean regex, false otherwise.

◆ extcap_complex_get_double()

double extcap_complex_get_double ( extcap_complex comp)

Retrieves the double value from an extcap_complex structure.

Parameters
compPointer to the extcap_complex structure.
Returns
The double value, or 0 if the input is invalid.

◆ extcap_complex_get_int()

int extcap_complex_get_int ( extcap_complex comp)

Retrieves an integer value from an extcap complex structure.

Parameters
compPointer to the extcap_complex structure.
Returns
The integer value, or 0 if the input is invalid.

◆ extcap_complex_get_long()

int64_t extcap_complex_get_long ( extcap_complex comp)

Retrieves a long value from an extcap complex structure.

Parameters
compPointer to the extcap_complex structure.
Returns
The long value, or 0 if the input is invalid.

◆ extcap_complex_get_string()

char * extcap_complex_get_string ( extcap_complex comp)

Get the string value from an extcap complex structure.

Parameters
compPointer to the extcap_complex structure.
Returns
char* The string value, or NULL if the input is NULL.

◆ extcap_complex_get_uint()

unsigned extcap_complex_get_uint ( extcap_complex comp)

Retrieves an unsigned integer value from an extcap complex structure.

Parameters
compPointer to the extcap_complex structure.
Returns
The unsigned integer value, or 0 if the input is invalid.

◆ extcap_free_arg()

void extcap_free_arg ( extcap_arg a)

Free a single argument.

This function releases all resources associated with an extcap_arg structure, including freeing memory for its various fields and nested structures.

Parameters
aPointer to the extcap_arg structure to be freed.

◆ extcap_free_arg_list()

void extcap_free_arg_list ( GList *  a)

Free an entire arg list.

This function frees a GList containing extcap_arg structures, calling extcap_free_arg on each element.

Parameters
aThe GList to be freed.

◆ extcap_free_complex()

void extcap_free_complex ( extcap_complex comp)

Free a complex value.

Parameters
compPointer to the extcap_complex structure to be freed.

◆ extcap_free_toolbar_control()

void extcap_free_toolbar_control ( iface_toolbar_control control)

Free entire toolbar control structure.

Parameters
controlPointer to the toolbar control structure to be freed.

◆ extcap_get_complex_as_string()

char * extcap_get_complex_as_string ( extcap_complex comp)

Get a string representation of a complex type.

Returns
a string representation of a complex type
Note
Caller is responsible for calling g_free on the returned string

◆ extcap_parse_args()

GList * extcap_parse_args ( char *  output)

Parser for extcap data

◆ extcap_parse_complex()

extcap_complex * extcap_parse_complex ( extcap_arg_type  complex_type,
const char *  data 
)

Parse a complex value from a string.

Parameters
complex_typeThe type of the complex value.
dataThe string representation of the complex value.
Returns
extcap_complex* A pointer to the newly created complex value, or NULL on failure.

◆ extcap_parse_dlts()

GList * extcap_parse_dlts ( char *  output)

Parse all sentences for DLT (Data Link Type) information.

This function tokenizes the input output into sentences and then parses each sentence to extract DLT information. It returns a GList containing parsed extcap_dlt structures.

Parameters
outputThe input string containing DLT information.
Returns
A GList of extcap_dlt structures representing the parsed DLTs, or NULL if parsing fails.

◆ extcap_parse_interfaces()

GList * extcap_parse_interfaces ( char *  output,
GList **  control_items 
)

Parse all sentences for interfaces.

This function parses the interfaces section of extcap output and returns a list of interface objects.

Parameters
outputThe extcap output string to parse.
control_itemsPointer to a GList containing control items for parsing.
Returns
A GList of parsed extcap_interface objects, or NULL if parsing fails.

◆ extcap_parse_values()

GList * extcap_parse_values ( char *  output)

Parse all sentences for values.

Parameters
outputThe output string containing sentences to parse.
Returns
GList* A list of parsed extcap_value structures.

◆ extcap_printf_complex()

void extcap_printf_complex ( extcap_complex comp)

Prints a complex type using its string representation.

Parameters
compPointer to the extcap_complex structure to be printed.