TCNOpen TRDP-SPY  2.0
packet-trdp_spy.c File Reference

Dissector plugin main source. More...

#include "config.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <epan/tvbuff.h>
#include <epan/packet_info.h>
#include <epan/column-utils.h>
#include <epan/packet.h>
#include <epan/dissectors/packet-tcp.h>
#include <epan/prefs.h>
#include <epan/strutil.h>
#include <epan/expert.h>
#include <epan/plugin_if.h>
#include <wsutil/report_message.h>
#include "trdp_env.h"
#include "trdpDict.h"
Include dependency graph for packet-trdp_spy.c:

Functions

static guint32 dissect_trdp_generic_body (tvbuff_t *tvb, packet_info *pinfo, proto_tree *trdp_spy_tree, proto_tree *trdpRootNode, guint32 trdp_spy_comid, guint32 offset, guint clength, guint8 dataset_level, const gchar *title, const gint32 arr_idx)
 Extract all information from the userdata (uses the parsebody module for unmarshalling) More...
 

Detailed Description

Dissector plugin main source.

Note
Project: TRDP SPY
Author
Florian Weispfenning, Bombardier Transportation
Thorsten Schulz, Universität Rostock

Version 2.0 extended to work with complex dataset and makeover for Wireshark 2.6 – 3

     Based on work:
         Ethereal - Network traffic analyzer
         By Gerald Combs <gerald@ethereal.com>
         Copyright 1998 Gerald Combs
         SPDX-License-Identifier: GPL-2.0-or-later

         The new display-filter approach contains aspects and code snippets
         from the wimaxasncp dissector by Stephen Croll.
Id

Function Documentation

◆ dissect_trdp_generic_body()

guint32 dissect_trdp_generic_body ( tvbuff_t *  tvb,
packet_info *  pinfo,
proto_tree *  trdp_spy_tree,
proto_tree *  trdpRootNode,
guint32  trdp_spy_comid,
guint32  offset,
guint  clength,
guint8  dataset_level,
const gchar *  title,
const gint32  arr_idx 
)
static

Extract all information from the userdata (uses the parsebody module for unmarshalling)

Parameters
tvbbuffer
pinfoinfo for the packet
trdp_spy_treeto which the information are added
trdpRootNodeRoot node of the view of an TRDP packet (Necessary, as this function will be called recursively)
trdp_spy_comidthe already extracted comId
offsetwhere the userdata starts in the TRDP packet
clengthAmount of bytes, that are transported for the users
dataset_levelis set to 0 for the beginning
titlepresents the instance-name of the dataset for the sub-tree
arr_idxindex for presentation when a dataset occurs in an array element
Returns
the actual offset in the packet
packet-trdp_spy.h
Interface between Wireshark and the TRDP anaylsis module.
Dataset
Description of one dataset.
Definition: trdpDict.h:104
Element::typeName
char typeName[32]
Definition: trdpDict.h:84
Dataset::lastOfElements
struct Element * lastOfElements
Definition: trdpDict.h:114
TrdpDict::xml_file
gchar * xml_file
Definition: trdpDict.h:169
Dataset::size
gint32 size
Definition: trdpDict.h:106
Element::linkedDS
struct Dataset * linkedDS
Definition: trdpDict.h:90
Element
description of one element
Definition: trdpDict.h:75
TRDP_MD_HEADERLENGTH
#define TRDP_MD_HEADERLENGTH
Definition: trdp_env.h:93
Dataset::listOfElements
struct Element * listOfElements
Definition: trdpDict.h:113
TRDP_UINT64
#define TRDP_UINT64
Definition: trdp_env.h:48
Dataset::ett_id
gint ett_id
Definition: trdpDict.h:111
TRDP_INT16
#define TRDP_INT16
Definition: trdp_env.h:42
Dataset_preCalculate
static gint32 Dataset_preCalculate(Dataset *self, const TrdpDict *dict)
calculateSize
Definition: trdpDict.c:488
TrdpDict_get_Dataset
Dataset * TrdpDict_get_Dataset(const TrdpDict *self, guint32 datasetId)
Lookup a given datasetId in the dictionary self.
Definition: trdpDict.c:356
TRDP_INT32
#define TRDP_INT32
Definition: trdp_env.h:43
trdp_env.h
Definition of the TRDP constants and specific calculations.
TRDP_FCS_LENGTH
#define TRDP_FCS_LENGTH
Definition: trdp_env.h:95
TrdpDict::mTableDataset
struct Dataset * mTableDataset
Definition: trdpDict.h:164
Dataset::next
struct Dataset * next
Definition: trdpDict.h:115
ComId::next
struct ComId * next
Definition: trdpDict.h:148
TRDP_INT8
#define TRDP_INT8
Definition: trdp_env.h:41
Element::type
guint32 type
Definition: trdpDict.h:82
TRDP_REAL64
#define TRDP_REAL64
Definition: trdp_env.h:50
TrdpDict_lookup_ComId
const ComId * TrdpDict_lookup_ComId(const TrdpDict *self, guint32 comId)
Lookup a given comId in the dictionary self.
Definition: trdpDict.c:350
ComId::size
gint32 size
Definition: trdpDict.h:144
Dataset::name
gchar * name
Definition: trdpDict.h:107
TRDP_TIMEDATE64
#define TRDP_TIMEDATE64
Definition: trdp_env.h:53
Element::array_size
gint32 array_size
Definition: trdpDict.h:85
TRDP_TIMEDATE32
#define TRDP_TIMEDATE32
Definition: trdp_env.h:51
Dataset::datasetId
guint32 datasetId
Definition: trdpDict.h:110
Element::scale
gdouble scale
Definition: trdpDict.h:86
Element::name
char * name
Definition: trdpDict.h:77
Element::offset
gint32 offset
Definition: trdpDict.h:87
Element::unit
char * unit
Definition: trdpDict.h:78
ComId_preCalculate
static gint32 ComId_preCalculate(ComId *self, const TrdpDict *dict)
Definition: trdpDict.c:566
ComId::linkedDS
struct Dataset * linkedDS
Definition: trdpDict.h:147
TRDP_UINT16
#define TRDP_UINT16
Definition: trdp_env.h:46
TRDP_CHAR8
#define TRDP_CHAR8
Definition: trdp_env.h:39
Element::width
gint32 width
Definition: trdpDict.h:89
ComId::name
char * name
Definition: trdpDict.h:139
TRDP_INT64
#define TRDP_INT64
Definition: trdp_env.h:44
TRDP_UINT32
#define TRDP_UINT32
Definition: trdp_env.h:47
dissect_trdp_generic_body
static guint32 dissect_trdp_generic_body(tvbuff_t *tvb, packet_info *pinfo, proto_tree *trdp_spy_tree, proto_tree *trdpRootNode, guint32 trdp_spy_comid, guint32 offset, guint clength, guint8 dataset_level, const gchar *title, const gint32 arr_idx)
Extract all information from the userdata (uses the parsebody module for unmarshalling)
Definition: packet-trdp_spy.c:277
TRDP_BOOL8
#define TRDP_BOOL8
Definition: trdp_env.h:36
TrdpDict_summary
gchar * TrdpDict_summary(const TrdpDict *self)
Get some human-readable info.
Definition: trdpDict.c:327
TrdpDict
This struct is the root container for the XML type dictionary.
Definition: trdpDict.h:161
ComId::ett_id
gint ett_id
Definition: trdpDict.h:145
ComId::dataset
guint32 dataset
Definition: trdpDict.h:143
TrdpDict::mTableComId
struct ComId * mTableComId
Definition: trdpDict.h:168
TRDP_UTF16
#define TRDP_UTF16
Definition: trdp_env.h:40
TrdpDict_get_Dataset
Dataset * TrdpDict_get_Dataset(const TrdpDict *self, guint32 datasetId)
Lookup a given datasetId in the dictionary self.
Definition: trdpDict.c:356
ComId
This struct makes a mapping between one comId and one dataset.
Definition: trdpDict.h:138
trdpDict.h
Parser of the XML description.
TRDP_REAL32
#define TRDP_REAL32
Definition: trdp_env.h:49
TRDP_STANDARDTYPE_MAX
#define TRDP_STANDARDTYPE_MAX
Definition: trdp_env.h:55
TrdpDict_lookup_ComId
const ComId * TrdpDict_lookup_ComId(const TrdpDict *self, guint32 comId)
Lookup a given comId in the dictionary self.
Definition: trdpDict.c:350
TRDP_UINT8
#define TRDP_UINT8
Definition: trdp_env.h:45
TrdpDict_summary
gchar * TrdpDict_summary(const TrdpDict *self)
Get some human-readable info.
Definition: trdpDict.c:327
TRDP_TIMEDATE48
#define TRDP_TIMEDATE48
Definition: trdp_env.h:52
TrdpDict::knowledge
guint knowledge
Definition: trdpDict.h:167
ComId::comId
guint32 comId
Definition: trdpDict.h:142