summaryrefslogtreecommitdiffstats
path: root/plugins/epan/profinet/packet-pn-rtc-one.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugins/epan/profinet/packet-pn-rtc-one.c286
1 files changed, 143 insertions, 143 deletions
diff --git a/plugins/epan/profinet/packet-pn-rtc-one.c b/plugins/epan/profinet/packet-pn-rtc-one.c
index 383909a2..6bed963d 100644
--- a/plugins/epan/profinet/packet-pn-rtc-one.c
+++ b/plugins/epan/profinet/packet-pn-rtc-one.c
@@ -71,76 +71,76 @@
#define PA_PROFILE_API 0x9700u
-static int proto_pn_io_rtc1 = -1;
+static int proto_pn_io_rtc1;
/* General module information */
-static int hf_pn_io_frame_info_type = -1;
-static int hf_pn_io_frame_info_vendor = -1;
-static int hf_pn_io_frame_info_nameofstation = -1;
-static int hf_pn_io_frame_info_gsd_found = -1;
-static int hf_pn_io_frame_info_gsd_error = -1;
-static int hf_pn_io_frame_info_gsd_path = -1;
-static int hf_pn_io_io_data_object = -1;
-static int hf_pn_io_io_data_object_info_module_diff = -1;
-static int hf_pn_io_io_data_object_info_moduleidentnumber = -1;
-static int hf_pn_io_io_data_object_info_submoduleidentnumber = -1;
-
-static int hf_pn_io_iocs = -1;
-static int hf_pn_io_iops = -1;
-static int hf_pn_io_ioxs_extension = -1;
-static int hf_pn_io_ioxs_res14 = -1;
-static int hf_pn_io_ioxs_instance = -1;
-static int hf_pn_io_ioxs_datastate = -1;
+static int hf_pn_io_frame_info_type;
+static int hf_pn_io_frame_info_vendor;
+static int hf_pn_io_frame_info_nameofstation;
+static int hf_pn_io_frame_info_gsd_found;
+static int hf_pn_io_frame_info_gsd_error;
+static int hf_pn_io_frame_info_gsd_path;
+static int hf_pn_io_io_data_object;
+static int hf_pn_io_io_data_object_info_module_diff;
+static int hf_pn_io_io_data_object_info_moduleidentnumber;
+static int hf_pn_io_io_data_object_info_submoduleidentnumber;
+
+static int hf_pn_io_iocs;
+static int hf_pn_io_iops;
+static int hf_pn_io_ioxs_extension;
+static int hf_pn_io_ioxs_res14;
+static int hf_pn_io_ioxs_instance;
+static int hf_pn_io_ioxs_datastate;
/* PROFIsafe statusbyte and controlbyte */
-static int hf_pn_io_ps_sb = -1;
-static int hf_pn_io_ps_sb_iparOK = -1;
-static int hf_pn_io_ps_sb_DeviceFault = -1;
-static int hf_pn_io_ps_sb_CECRC = -1;
-static int hf_pn_io_ps_sb_WDtimeout = -1;
-static int hf_pn_io_ps_sb_FVactivated = -1;
-static int hf_pn_io_ps_sb_Toggle_d = -1;
-static int hf_pn_io_ps_sb_ConsNr_reset = -1;
-static int hf_pn_io_ps_sb_res = -1;
-static int hf_pn_io_ps_sb_toggelBitChanged = -1;
-static int hf_pn_io_ps_sb_toggelBitChange_slot_nr = -1;
-static int hf_pn_io_ps_sb_toggelBitChange_subslot_nr = -1;
-
-static int hf_pn_io_ps_cb = -1;
-static int hf_pn_io_ps_cb_iparEN = -1;
-static int hf_pn_io_ps_cb_OAReq = -1;
-static int hf_pn_io_ps_cb_resetConsNr = -1;
-static int hf_pn_io_ps_cb_useTO2 = -1;
-static int hf_pn_io_ps_cb_activateFV = -1;
-static int hf_pn_io_ps_cb_Toggle_h = -1;
-static int hf_pn_io_ps_cb_Chf_ACK = -1;
-static int hf_pn_io_ps_cb_loopcheck = -1;
-static int hf_pn_io_ps_cb_toggelBitChanged = -1;
-static int hf_pn_io_ps_cb_toggelBitChange_slot_nr = -1;
-static int hf_pn_io_ps_cb_toggelBitChange_subslot_nr = -1;
+static int hf_pn_io_ps_sb;
+static int hf_pn_io_ps_sb_iparOK;
+static int hf_pn_io_ps_sb_DeviceFault;
+static int hf_pn_io_ps_sb_CECRC;
+static int hf_pn_io_ps_sb_WDtimeout;
+static int hf_pn_io_ps_sb_FVactivated;
+static int hf_pn_io_ps_sb_Toggle_d;
+static int hf_pn_io_ps_sb_ConsNr_reset;
+static int hf_pn_io_ps_sb_res;
+static int hf_pn_io_ps_sb_toggelBitChanged;
+static int hf_pn_io_ps_sb_toggelBitChange_slot_nr;
+static int hf_pn_io_ps_sb_toggelBitChange_subslot_nr;
+
+static int hf_pn_io_ps_cb;
+static int hf_pn_io_ps_cb_iparEN;
+static int hf_pn_io_ps_cb_OAReq;
+static int hf_pn_io_ps_cb_resetConsNr;
+static int hf_pn_io_ps_cb_useTO2;
+static int hf_pn_io_ps_cb_activateFV;
+static int hf_pn_io_ps_cb_Toggle_h;
+static int hf_pn_io_ps_cb_Chf_ACK;
+static int hf_pn_io_ps_cb_loopcheck;
+static int hf_pn_io_ps_cb_toggelBitChanged;
+static int hf_pn_io_ps_cb_toggelBitChange_slot_nr;
+static int hf_pn_io_ps_cb_toggelBitChange_subslot_nr;
/* PROFIsafe */
-static int hf_pn_io_ps_f_dest_adr = -1;
-static int hf_pn_io_ps_f_data = -1;
+static int hf_pn_io_ps_f_dest_adr;
+static int hf_pn_io_ps_f_data;
/* PA Profile 4.02 */
-static int hf_pn_pa_profile_status = -1;
-static int hf_pn_pa_profile_status_quality = -1;
-static int hf_pn_pa_profile_status_substatus_bad = -1;
-static int hf_pn_pa_profile_status_substatus_uncertain = -1;
-static int hf_pn_pa_profile_status_substatus_good = -1;
-static int hf_pn_pa_profile_status_update_event = -1;
-static int hf_pn_pa_profile_status_simulate = -1;
-static int hf_pn_pa_profile_value_8bit = -1;
-static int hf_pn_pa_profile_value_16bit = -1;
-static int hf_pn_pa_profile_value_float = -1;
-
-static gint ett_pn_io_rtc = -1;
-static gint ett_pn_io_ioxs = -1;
-static gint ett_pn_io_io_data_object = -1;
-static gint ett_pn_pa_profile_status = -1;
-
-static expert_field ei_pn_io_too_many_data_objects = EI_INIT;
+static int hf_pn_pa_profile_status;
+static int hf_pn_pa_profile_status_quality;
+static int hf_pn_pa_profile_status_substatus_bad;
+static int hf_pn_pa_profile_status_substatus_uncertain;
+static int hf_pn_pa_profile_status_substatus_good;
+static int hf_pn_pa_profile_status_update_event;
+static int hf_pn_pa_profile_status_simulate;
+static int hf_pn_pa_profile_value_8bit;
+static int hf_pn_pa_profile_value_16bit;
+static int hf_pn_pa_profile_value_float;
+
+static int ett_pn_io_rtc;
+static int ett_pn_io_ioxs;
+static int ett_pn_io_io_data_object;
+static int ett_pn_pa_profile_status;
+
+static expert_field ei_pn_io_too_many_data_objects;
static const value_string pn_io_ioxs_extension[] = {
{ 0x00 /* 0*/, "No IOxS octet follows" },
@@ -257,14 +257,14 @@ static int * const pa_profile_status_fields[] = {
/* Dissector for PROFIsafe Status Byte */
static int
dissect_pn_io_ps_SB(tvbuff_t *tvb, int offset,
-packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, int hfindex, int * const *fields)
+packet_info *pinfo _U_, proto_tree *tree, uint8_t *drep _U_, int hfindex, int * const *fields)
{
if (tree) {
- guint8 u8StatusByte;
+ uint8_t u8StatusByte;
proto_item *sb_item;
- u8StatusByte = tvb_get_guint8(tvb, offset);
+ u8StatusByte = tvb_get_uint8(tvb, offset);
/* Add Status Byte subtree */
sb_item = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hfindex, ett_pn_io_ioxs, fields,
@@ -279,14 +279,14 @@ packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, int hfindex, int * c
/* Dissector for PROFIsafe Control Byte */
static int
dissect_pn_io_ps_CB(tvbuff_t *tvb, int offset,
-packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, int hfindex, int * const *fields)
+packet_info *pinfo _U_, proto_tree *tree, uint8_t *drep _U_, int hfindex, int * const *fields)
{
if (tree) {
- guint8 u8ControlByte;
+ uint8_t u8ControlByte;
proto_item *cb_item;
- u8ControlByte = tvb_get_guint8(tvb, offset);
+ u8ControlByte = tvb_get_uint8(tvb, offset);
/* Add Status Byte subtree */
cb_item = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hfindex, ett_pn_io_ioxs, fields,
@@ -302,14 +302,14 @@ packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, int hfindex, int * c
/* Dissector for IOCS (As each IOCS stands for a specific Slot & Subslot) */
static int
dissect_PNIO_IOCS(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree,
- guint8 *drep _U_, int hfindex, guint16 slotNr, guint16 subSlotNr, int * const *fields)
+ uint8_t *drep _U_, int hfindex, uint16_t slotNr, uint16_t subSlotNr, int * const *fields)
{
if (tree) {
- guint8 u8IOxS;
+ uint8_t u8IOxS;
proto_item *ioxs_item;
- u8IOxS = tvb_get_guint8(tvb, offset);
+ u8IOxS = tvb_get_uint8(tvb, offset);
/* Add ioxs subtree */
ioxs_item = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hfindex,
@@ -329,14 +329,14 @@ dissect_PNIO_IOCS(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree
/* dissect the IOxS (IOCS, IOPS) field */
static int
dissect_PNIO_IOxS(tvbuff_t *tvb, int offset,
-packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, int hfindex, int * const *fields)
+packet_info *pinfo _U_, proto_tree *tree, uint8_t *drep _U_, int hfindex, int * const *fields)
{
if (tree) {
- guint8 u8IOxS;
+ uint8_t u8IOxS;
proto_item *ioxs_item;
- u8IOxS = tvb_get_guint8(tvb, offset);
+ u8IOxS = tvb_get_uint8(tvb, offset);
/* Add ioxs subtree */
ioxs_item = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hfindex,
@@ -351,20 +351,20 @@ packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, int hfindex, int * c
}
-/* Universel dissector for flexibel PROFIsafe Data 8 to 64 Bits */
+/* Universal dissector for flexibel PROFIsafe Data 8 to 64 Bits */
static int
-dissect_pn_io_ps_uint(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
- proto_tree *tree, guint8 *drep,
-int hfindex, guint8 bytelength, guint64 *pdata)
+dissect_pn_io_ps_uint(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+ proto_tree *tree, uint8_t *drep,
+int hfindex, uint8_t bytelength, uint64_t *pdata)
{
- guint64 data;
- gboolean generalDissection;
+ uint64_t data;
+ bool generalDissection;
- generalDissection = FALSE;
+ generalDissection = false;
switch (bytelength) {
case 1: /* 8 Bit Safety IO Data */
- data = tvb_get_guint8(tvb, offset);
+ data = tvb_get_uint8(tvb, offset);
if (pdata)
*pdata = data;
break;
@@ -413,11 +413,11 @@ int hfindex, guint8 bytelength, guint64 *pdata)
default: /* Safety IO Data is too big to save it into one variable */
dissect_pn_user_data(tvb, offset, pinfo, tree, bytelength, "Safety IO Data");
- generalDissection = TRUE;
+ generalDissection = true;
break;
}
- if (tree && generalDissection == FALSE) {
+ if (tree && generalDissection == false) {
proto_tree_add_item(tree, hfindex, tvb, offset, bytelength, DREP_ENC_INTEGER(drep));
}
@@ -428,16 +428,16 @@ int hfindex, guint8 bytelength, guint64 *pdata)
/* dissect a PN-IO RTC1 Cyclic Service Data Unit */
int
dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
- packet_info *pinfo, proto_tree *tree, guint8 *drep _U_, guint16 frameid)
+ packet_info *pinfo, proto_tree *tree, uint8_t *drep _U_, uint16_t frameid)
{
proto_tree *data_tree = NULL;
- /* Count & offset for comparation of the arrays */
- guint16 frameOffset;
- guint32 objectCounter;
- gboolean inputFlag;
- gboolean outputFlag;
- gboolean psInfoText; /* Used to display only once per frame the info text "PROFIsafe Device" */
+ /* Count & offset for comparison of the arrays */
+ uint16_t frameOffset;
+ uint32_t objectCounter;
+ bool inputFlag;
+ bool outputFlag;
+ bool psInfoText; /* Used to display only once per frame the info text "PROFIsafe Device" */
proto_item *data_item;
proto_item *IODataObject_item;
@@ -448,18 +448,18 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
wmem_strbuf_t *moduleName;
- guint8 toggleBitSb;
- guint8 toggleBitCb;
- guint64 f_data;
+ uint8_t toggleBitSb;
+ uint8_t toggleBitCb;
+ uint64_t f_data;
- guint8 statusbyte;
- guint8 controlbyte;
- guint8 safety_io_data_length;
+ uint8_t statusbyte;
+ uint8_t controlbyte;
+ uint8_t safety_io_data_length;
- guint16 number_io_data_objects_input_cr;
- guint16 number_iocs_input_cr;
- guint16 number_io_data_objects_output_cr;
- guint16 number_iocs_output_cr;
+ uint16_t number_io_data_objects_input_cr;
+ uint16_t number_iocs_input_cr;
+ uint16_t number_io_data_objects_output_cr;
+ uint16_t number_iocs_output_cr;
conversation_t *conversation;
stationInfo *station_info = NULL;
@@ -472,9 +472,9 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
/* Initial */
frameOffset = 0;
f_data = 0;
- inputFlag = FALSE;
- outputFlag = FALSE;
- psInfoText = FALSE;
+ inputFlag = false;
+ outputFlag = false;
+ psInfoText = false;
number_io_data_objects_input_cr = 0;
number_iocs_input_cr = 0;
number_io_data_objects_output_cr = 0;
@@ -482,7 +482,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
wmem_list_frame_t *aruuid_frame;
ARUUIDFrame *current_aruuid_frame = NULL;
- guint32 current_aruuid = 0;
+ uint32_t current_aruuid = 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PNIO"); /* set protocol name */
@@ -491,7 +491,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
data_tree = proto_item_add_subtree(data_item, ett_pn_io_rtc);
/* dissect_dcerpc_uint16(tvb, offset, pinfo, data_tree, drep, hf_pn_io_packedframe_SFCRC, &u16SFCRC); */
- if (!(dissect_CSF_SDU_heur(tvb, pinfo, data_tree, NULL) == FALSE))
+ if (dissect_CSF_SDU_heur(tvb, pinfo, data_tree, NULL))
return(tvb_captured_length(tvb));
/* Only dissect cyclic RTC1 frames, if PN Connect Request has been read */
@@ -527,20 +527,20 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
if (station_info != NULL) {
pn_find_dcp_station_info(station_info, conversation);
- if (pnio_ps_selection == TRUE) {
+ if (pnio_ps_selection == true) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PNIO_PS"); /* set PROFISsafe protocol name */
}
if (addresses_equal(&(pinfo->src), conversation_key_addr1(conversation->key_ptr)) && addresses_equal(&(pinfo->dst), conversation_key_addr2(conversation->key_ptr))) {
- inputFlag = TRUE;
- outputFlag = FALSE;
+ inputFlag = true;
+ outputFlag = false;
number_io_data_objects_input_cr = station_info->ioDataObjectNr_in;
number_iocs_input_cr = station_info->iocsNr_in;
}
if (addresses_equal(&(pinfo->dst), conversation_key_addr1(conversation->key_ptr)) && addresses_equal(&(pinfo->src), conversation_key_addr2(conversation->key_ptr))) {
- outputFlag = TRUE;
- inputFlag = FALSE;
+ outputFlag = true;
+ inputFlag = false;
number_io_data_objects_output_cr = station_info->ioDataObjectNr_out;
number_iocs_output_cr = station_info->iocsNr_out;
}
@@ -549,7 +549,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
/* ------- Input (PNIO) / Response (PNIO_PS) Frame Handling ------- */
if (inputFlag) {
- if (pnio_ps_selection == TRUE) {
+ if (pnio_ps_selection == true) {
proto_tree_add_string_format_value(data_tree, hf_pn_io_frame_info_type, tvb,
offset, 0, "Response", "Response Frame (IO_Device -> IO_Controller)");
}
@@ -568,8 +568,8 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
0, station_info->nameofstation, "\"%s\"", station_info->nameofstation);
}
- if (station_info->gsdPathLength == TRUE) { /* given path isn't too long for the array */
- if (station_info->gsdFound == TRUE) { /* found a GSD-file */
+ if (station_info->gsdPathLength == true) { /* given path isn't too long for the array */
+ if (station_info->gsdFound == true) { /* found a GSD-file */
if (station_info->gsdLocation != NULL) {
IODataObject_item_info = proto_tree_add_item(data_tree, hf_pn_io_frame_info_gsd_found, tvb, offset, 0, ENC_NA);
proto_item_append_text(IODataObject_item_info, ": \"%s\"", station_info->gsdLocation);
@@ -590,7 +590,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
/* ---- Input IOData-/IOCS-Object Handling ---- */
objectCounter = number_io_data_objects_input_cr + number_iocs_input_cr;
- if (objectCounter > (guint)tvb_reported_length_remaining(tvb, offset)) {
+ if (objectCounter > (unsigned)tvb_reported_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, data_item, &ei_pn_io_too_many_data_objects, "Too many data objects: %d", objectCounter);
return(tvb_captured_length(tvb));
}
@@ -620,17 +620,17 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
proto_tree_add_uint(IODataObject_tree, hf_pn_io_io_data_object_info_submoduleidentnumber, tvb, 0, 0, io_data_object->subModuleIdentNr);
/* PROFIsafe Supported Inputmodule handling */
- if (io_data_object->profisafeSupported == TRUE && pnio_ps_selection == TRUE) {
- if (io_data_object->profisafeSupported == TRUE && psInfoText == FALSE) {
+ if (io_data_object->profisafeSupported == true && pnio_ps_selection == true) {
+ if (io_data_object->profisafeSupported == true && psInfoText == false) {
/* Only add one information string per device to the infotext */
col_append_str(pinfo->cinfo, COL_INFO, ", PROFIsafe Device"); /* Add string to wireshark infotext */
- psInfoText = TRUE;
+ psInfoText = true;
}
proto_tree_add_uint(IODataObject_tree, hf_pn_io_ps_f_dest_adr, tvb, 0, 0, io_data_object->f_dest_adr);
/* Get Safety IO Data */
- if (io_data_object->f_crc_seed == FALSE) {
+ if (io_data_object->f_crc_seed == false) {
safety_io_data_length = io_data_object->length - F_MESSAGE_TRAILER_4BYTE;
} else {
safety_io_data_length = io_data_object->length - F_MESSAGE_TRAILER_5BYTE;
@@ -642,7 +642,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
}
/* ---- Check for new PNIO data using togglebit ---- */
- statusbyte = tvb_get_guint8(tvb, offset);
+ statusbyte = tvb_get_uint8(tvb, offset);
toggleBitSb = statusbyte & 0x20; /* get ToggleBit of StatusByte */
if (io_data_object->lastToggleBit != toggleBitSb) { /* ToggleBit has changed --> new Data incoming */
@@ -676,7 +676,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
}
}
- if (io_data_object->discardIOXS == FALSE) {
+ if (io_data_object->discardIOXS == false) {
offset = dissect_PNIO_IOxS(tvb, offset, pinfo, IODataObject_tree, drep, hf_pn_io_iops, ioxs_fields);
proto_item_set_len(IODataObject_item, io_data_object->length + 1); /* Length = Databytes + IOXS Byte */
}
@@ -697,7 +697,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
moduleName = wmem_strbuf_new(pinfo->pool, "Module");
}
- if (io_data_object->profisafeSupported == TRUE) {
+ if (io_data_object->profisafeSupported == true) {
/* PROFIsafe */
if (io_data_object->length >= 5) { /* 5 due to 3 CRC bytes & 1 status byte & (at least) 1 data byte */
wmem_strbuf_append(moduleName, ", DI");
@@ -722,14 +722,14 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
proto_item_append_text(IODataObject_item, " ModuleName: \"%s\"", io_data_object->moduleNameStr);
/* emphasize the PROFIsafe supported Modul */
- if (io_data_object->profisafeSupported == TRUE && pnio_ps_selection == TRUE) {
+ if (io_data_object->profisafeSupported == true && pnio_ps_selection == true) {
(proto_item_append_text(IODataObject_item, " (PROFIsafe Module)"));
}
/* Set frameOffset to its new value, to find the next object */
frameOffset = frameOffset + io_data_object->length; /* frameOffset = current value + data bytes */
- if (io_data_object->discardIOXS == FALSE) {
+ if (io_data_object->discardIOXS == false) {
frameOffset = frameOffset + 1; /* frameOffset = current value + iops byte */
}
}
@@ -759,7 +759,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
/* ----- Output (PNIO) / Request (PNIO_PS) Frame Handling ------ */
else if (outputFlag) {
- if (pnio_ps_selection == TRUE) {
+ if (pnio_ps_selection == true) {
proto_tree_add_string_format_value(data_tree, hf_pn_io_frame_info_type, tvb,
offset, 0, "Request", "Request Frame (IO_Controller -> IO_Device)");
}
@@ -778,8 +778,8 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
0, station_info->nameofstation, "\"%s\"", station_info->nameofstation);
}
- if (station_info->gsdPathLength == TRUE) { /* given path isn't too long for the array */
- if (station_info->gsdFound == TRUE) { /* found a GSD-file */
+ if (station_info->gsdPathLength == true) { /* given path isn't too long for the array */
+ if (station_info->gsdFound == true) { /* found a GSD-file */
if (station_info->gsdLocation != NULL) {
IODataObject_item_info = proto_tree_add_item(data_tree, hf_pn_io_frame_info_gsd_found, tvb, offset, 0, ENC_NA);
proto_item_append_text(IODataObject_item_info, ": \"%s\"", station_info->gsdLocation);
@@ -800,7 +800,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
/* ---- Output IOData-/IOCS-Object Handling ---- */
objectCounter = number_io_data_objects_output_cr + number_iocs_output_cr;
- if (objectCounter > (guint)tvb_reported_length_remaining(tvb, offset)) {
+ if (objectCounter > (unsigned)tvb_reported_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, data_item, &ei_pn_io_too_many_data_objects, "Too many data objects: %d", objectCounter);
return(tvb_captured_length(tvb));
}
@@ -828,17 +828,17 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
proto_tree_add_uint(IODataObject_tree, hf_pn_io_io_data_object_info_moduleidentnumber, tvb, 0, 0, io_data_object->moduleIdentNr);
proto_tree_add_uint(IODataObject_tree, hf_pn_io_io_data_object_info_submoduleidentnumber, tvb, 0, 0, io_data_object->subModuleIdentNr);
- if (io_data_object->profisafeSupported == TRUE && pnio_ps_selection == TRUE) {
- if (io_data_object->profisafeSupported == TRUE && psInfoText == FALSE) {
+ if (io_data_object->profisafeSupported == true && pnio_ps_selection == true) {
+ if (io_data_object->profisafeSupported == true && psInfoText == false) {
/* Only add one information string per device to the infotext */
col_append_str(pinfo->cinfo, COL_INFO, ", PROFIsafe Device"); /* Add string to wireshark infotext */
- psInfoText = TRUE;
+ psInfoText = true;
}
proto_tree_add_uint(IODataObject_tree, hf_pn_io_ps_f_dest_adr, tvb, 0, 0, io_data_object->f_dest_adr);
/* Get Safety IO Data */
- if (io_data_object->f_crc_seed == FALSE) {
+ if (io_data_object->f_crc_seed == false) {
safety_io_data_length = io_data_object->length - F_MESSAGE_TRAILER_4BYTE;
} else {
safety_io_data_length = io_data_object->length - F_MESSAGE_TRAILER_5BYTE;
@@ -850,7 +850,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
}
/* ---- Check for new PNIO data using togglebit ---- */
- controlbyte = tvb_get_guint8(tvb, offset);
+ controlbyte = tvb_get_uint8(tvb, offset);
toggleBitCb = controlbyte & 0x20; /* get ToggleBit of Controlbyte */
if (io_data_object->lastToggleBit != toggleBitCb) { /* ToggleBit has changed --> new Data incoming */
@@ -883,7 +883,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
}
}
- if (io_data_object->discardIOXS == FALSE) {
+ if (io_data_object->discardIOXS == false) {
offset = dissect_PNIO_IOxS(tvb, offset, pinfo, IODataObject_tree, drep, hf_pn_io_iops, ioxs_fields);
proto_item_set_len(IODataObject_item, io_data_object->length + 1); /* Length = Databytes + IOXS Byte */
}
@@ -904,7 +904,7 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
moduleName = wmem_strbuf_new(pinfo->pool, "Module");
}
- if (io_data_object->profisafeSupported == TRUE) {
+ if (io_data_object->profisafeSupported == true) {
/* PROFIsafe */
if (io_data_object->length >= 5) { /* 5 due to 3 CRC bytes & 1 status byte & (at least) 1 data byte */
wmem_strbuf_append(moduleName, ", DO");
@@ -929,13 +929,13 @@ dissect_PNIO_C_SDU_RTC1(tvbuff_t *tvb, int offset,
proto_item_append_text(IODataObject_item, " ModuleName: \"%s\"", io_data_object->moduleNameStr);
/* emphasize the PROFIsafe supported Modul */
- if (io_data_object->profisafeSupported == TRUE && pnio_ps_selection == TRUE) {
+ if (io_data_object->profisafeSupported == true && pnio_ps_selection == true) {
proto_item_append_text(IODataObject_item, " (PROFIsafe Module)");
}
/* Set frameOffset to its new value, to find the next object */
frameOffset = frameOffset + io_data_object->length; /* frameOffset = current value + data bytes */
- if (io_data_object->discardIOXS == FALSE) {
+ if (io_data_object->discardIOXS == false) {
frameOffset = frameOffset + 1; /* frameOffset = current value + iops byte */
}
}
@@ -974,13 +974,13 @@ dissect_pn_pa_profile_status(tvbuff_t *tvb, int offset,
{
if (tree) {
- guint8 u8status;
- guint8 quality;
+ uint8_t u8status;
+ uint8_t quality;
proto_item *status_item;
proto_tree *status_tree;
- const gchar* quality_name = NULL;
+ const char* quality_name = NULL;
- u8status = tvb_get_guint8(tvb, offset);
+ u8status = tvb_get_uint8(tvb, offset);
quality = (u8status >> 6u) & 0x3u;
/* add status subtree */
@@ -1019,7 +1019,7 @@ dissect_pn_pa_profile_status(tvbuff_t *tvb, int offset,
int
dissect_pn_pa_profile_data(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
- proto_tree *tree, guint32 length, const char *text)
+ proto_tree *tree, uint32_t length, const char *text)
{
(void)text;
/*
@@ -1321,7 +1321,7 @@ init_pn_io_rtc1(int proto)
},
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_pn_io_rtc,
&ett_pn_io_ioxs,
&ett_pn_io_io_data_object,