#include "ws_symbol_export.h"
#include "ws_attributes.h"
#include <epan/tvbuff.h>
#include <epan/packet_info.h>
#include <wsutil/exported_pdu_tlvs.h>
Go to the source code of this file.
|
| struct | exp_pdu_data_item |
| | Bundles the size and populate callbacks with their associated data for a single exported PDU metadata item. More...
|
| |
| struct | _exp_pdu_data_t |
| | Holds a protocol PDU and its associated metadata buffer for export via tap_queue_packet(). More...
|
| |
|
|
#define | EXPORT_PDU_TAP_NAME_LAYER_3 "OSI layer 3" |
| |
|
#define | EXPORT_PDU_TAP_NAME_LAYER_4 "OSI layer 4" |
| |
|
#define | EXPORT_PDU_TAP_NAME_LAYER_7 "OSI layer 7" |
| |
|
| typedef int(* | exp_pdu_get_size) (packet_info *pinfo, void *data) |
| | Compute the size (in bytes) of a pdu item.
|
| |
| typedef int(* | exp_pdu_populate_data) (packet_info *pinfo, void *data, uint8_t *tlv_buffer, uint32_t tlv_buffer_size) |
| | Populate a buffer with pdu item data.
|
| |
|
typedef struct exp_pdu_data_item | exp_pdu_data_item_t |
| | Bundles the size and populate callbacks with their associated data for a single exported PDU metadata item.
|
| |
| typedef struct _exp_pdu_data_t | exp_pdu_data_t |
| | Holds a protocol PDU and its associated metadata buffer for export via tap_queue_packet().
|
| |
|
| WS_DLL_PUBLIC int | register_export_pdu_tap (const char *name) |
| | Register an export PDU tap with a default encapsulation.
|
| |
| WS_DLL_PUBLIC int | register_export_pdu_tap_with_encap (const char *name, int encap) |
| | Register an export PDU tap with a specific encapsulation type.
|
| |
| WS_DLL_PUBLIC GSList * | get_export_pdu_tap_list (void) |
| | Get a list of all registered export PDU taps.
|
| |
| WS_DLL_PUBLIC int | export_pdu_tap_get_encap (const char *name) |
| | Get the encapsulation type for a given export PDU tap name.
|
| |
| WS_DLL_PUBLIC exp_pdu_data_t * | export_pdu_create_tags (packet_info *pinfo, const char *proto_name, uint16_t tag_type, const exp_pdu_data_item_t **items) |
| | Allocates and fills the exp_pdu_data_t struct according to the list of items.
|
| |
| WS_DLL_PUBLIC exp_pdu_data_t * | export_pdu_create_common_tags (packet_info *pinfo, const char *proto_name, uint16_t tag_type) |
| | Allocates and fills the exp_pdu_data_t struct with a common list of items.
|
| |
| WS_DLL_PUBLIC int | exp_pdu_data_dissector_table_num_value_size (packet_info *pinfo, void *data) |
| | Get the size of a value in the dissector table.
|
| |
| WS_DLL_PUBLIC int | exp_pdu_data_dissector_table_num_value_populate_data (packet_info *pinfo, void *data, uint8_t *tlv_buffer, uint32_t buffer_size) |
| | Populate data for an exported PDU using a dissector table.
|
| |
| void | export_pdu_init (void) |
| | Initializes the PDU export system.
|
| |
| void | export_pdu_cleanup (void) |
| | Cleans up resources used by exported PDU handling.
|
| |
Routines for exported_pdu dissection Copyright 2013, Anders Broman ander.nosp@m.s-br.nosp@m.oman@.nosp@m.eric.nosp@m.sson..nosp@m.com
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
◆ exp_pdu_data_t
Holds a protocol PDU and its associated metadata buffer for export via tap_queue_packet().
This struct is used as the data part of tap_queue_packet() and contains a buffer with metadata of the protocol PDU included in the tvb in the struct.
The metadata is a sequence of TLVs in the format for the header of LINKTYPE_WIRESHARK_UPPER_PDU packets in pcap pcapng files.
◆ exp_pdu_get_size
| typedef int(* exp_pdu_get_size) (packet_info *pinfo, void *data) |
Compute the size (in bytes) of a pdu item.
- Parameters
-
| pinfo | Packet info that may contain data for the pdu item |
| data | optional data of the pdu item |
- Returns
- the size of the pdu item
◆ exp_pdu_populate_data
| typedef int(* exp_pdu_populate_data) (packet_info *pinfo, void *data, uint8_t *tlv_buffer, uint32_t tlv_buffer_size) |
Populate a buffer with pdu item data.
- Parameters
-
| pinfo | Packet info that may contain data for the PDU item |
| data | optional data of the PDU item |
| tlv_buffer | buffer to be populated with PDU item |
| tlv_buffer_size | size of buffer to be populated |
- Returns
- the number of bytes populated to the buffer (typically PDU item size)
◆ exp_pdu_data_dissector_table_num_value_populate_data()
| WS_DLL_PUBLIC int exp_pdu_data_dissector_table_num_value_populate_data |
( |
packet_info * |
pinfo, |
|
|
void * |
data, |
|
|
uint8_t * |
tlv_buffer, |
|
|
uint32_t |
buffer_size |
|
) |
| |
Populate data for an exported PDU using a dissector table.
- Parameters
-
| pinfo | The packet information structure. |
| data | Pointer to the data structure to populate. |
| tlv_buffer | Buffer containing TLV data. |
| buffer_size | Size of the TLV buffer. |
- Returns
- 0 on success, -1 on failure.
◆ exp_pdu_data_dissector_table_num_value_size()
| WS_DLL_PUBLIC int exp_pdu_data_dissector_table_num_value_size |
( |
packet_info * |
pinfo, |
|
|
void * |
data |
|
) |
| |
Get the size of a value in the dissector table.
- Parameters
-
| pinfo | The packet information structure. |
| data | A pointer to additional data. |
- Returns
- The size of the value.
◆ export_pdu_cleanup()
| void export_pdu_cleanup |
( |
void |
| ) |
|
|
extern |
Cleans up resources used by exported PDU handling.
This function frees all resources allocated for exporting PDUs, including freeing any dynamically allocated memory and resetting global variables.
◆ export_pdu_create_common_tags()
| WS_DLL_PUBLIC exp_pdu_data_t * export_pdu_create_common_tags |
( |
packet_info * |
pinfo, |
|
|
const char * |
proto_name, |
|
|
uint16_t |
tag_type |
|
) |
| |
Allocates and fills the exp_pdu_data_t struct with a common list of items.
The items that will be exported as the PDU are:
- Source IP
- Destination IP
- Port type
- Source Port
- Destination Port
- Original frame number
- Parameters
-
| pinfo | Packet info that may contain data for the PDU items |
| tag_type | Tag type for protocol's PDU. Must be EXP_PDU_TAG_DISSECTOR_NAME, EXP_PDU_TAG_HEUR_DISSECTOR_NAME or EXP_PDU_TAG_DISSECTOR_TABLE_NAME |
| proto_name | Name of protocol that is exporting PDU |
- Returns
- filled exp_pdu_data_t struct
◆ export_pdu_create_tags()
Allocates and fills the exp_pdu_data_t struct according to the list of items.
The tags in the tag buffer SHOULD be added in numerical order.
- Parameters
-
| pinfo | Packet info that may contain data for the PDU items |
| proto_name | Name of protocol that is exporting PDU |
| tag_type | Tag type for protocol's PDU. Must be EXP_PDU_TAG_DISSECTOR_NAME or EXP_PDU_TAG_HEUR_DISSECTOR_NAME. |
| items | PDU items to be exported |
- Returns
- filled exp_pdu_data_t struct
Allocates and fills the exp_pdu_data_t struct according to the list of items
The tags in the tag buffer SHOULD be added in numerical order.
◆ export_pdu_init()
| void export_pdu_init |
( |
void |
| ) |
|
|
extern |
Initializes the PDU export system.
This function initializes the necessary data structures and resources for exporting PDUs.
◆ export_pdu_tap_get_encap()
| WS_DLL_PUBLIC int export_pdu_tap_get_encap |
( |
const char * |
name | ) |
|
Get the encapsulation type for a given export PDU tap name.
- Parameters
-
| name | The name of the export PDU tap. |
- Returns
- The encapsulation type associated with the tap, or WTAP_ENCAP_WIRESHARK_UPPER_PDU if not found.
◆ get_export_pdu_tap_list()
| WS_DLL_PUBLIC GSList * get_export_pdu_tap_list |
( |
void |
| ) |
|
Get a list of all registered export PDU taps.
- Returns
- List of all registered export PDU taps.
◆ register_export_pdu_tap()
| WS_DLL_PUBLIC int register_export_pdu_tap |
( |
const char * |
name | ) |
|
Register an export PDU tap with a default encapsulation.
- Parameters
-
| name | The name of the export PDU tap. |
- Returns
- int 0 on success, -1 on failure.
◆ register_export_pdu_tap_with_encap()
| WS_DLL_PUBLIC int register_export_pdu_tap_with_encap |
( |
const char * |
name, |
|
|
int |
encap |
|
) |
| |
Register an export PDU tap with a specific encapsulation type.
- Parameters
-
| name | The name of the tap to register. |
| encap | The encapsulation type for the tap. |
- Returns
- int 0 on success, -1 on failure.