diff options
Diffstat (limited to 'epan/dissectors/packet-bacapp.c')
-rw-r--r-- | epan/dissectors/packet-bacapp.c | 3339 |
1 files changed, 1713 insertions, 1626 deletions
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c index 1d8b5cd5..d35cce72 100644 --- a/epan/dissectors/packet-bacapp.c +++ b/epan/dissectors/packet-bacapp.c @@ -21,10 +21,11 @@ #include <epan/reassemble.h> #include <epan/expert.h> #include <epan/proto_data.h> +#include <epan/tfs.h> #include <epan/stats_tree.h> #include "packet-bacapp.h" -static int bacapp_tap = -1; +static int bacapp_tap; /* formerly bacapp.h contains definitions and forward declarations */ @@ -45,7 +46,7 @@ static int bacapp_tap = -1; #define BACAPP_SEGMENT_NAK 0x02 #define BACAPP_SENT_BY 0x01 -#define BACAPP_MAX_RECURSION_DEPTH 100 // Arbitrary +#define BACAPP_MAX_RECURSION_DEPTH 50 // Arbitrary /** * dissect_bacapp ::= CHOICE { @@ -84,8 +85,8 @@ static int bacapp_tap = -1; * @param offset the offset in the tvb * @return modified offset */ -static guint -fConfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fConfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * @param tvb the tv buffer of the current data @@ -97,9 +98,9 @@ fConfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param tt - output varable to return service choice item * @return modified offset */ -static guint -fStartConfirmed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 ack, - gint *svc, proto_item **tt); +static unsigned +fStartConfirmed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t ack, + int *svc, proto_item **tt); /** * Unconfirmed-Request-PDU ::= SEQUENCE { @@ -114,8 +115,8 @@ fStartConfirmed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse * @param offset the offset in the tvb * @return modified offset */ -static guint -fUnconfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fUnconfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * SimpleACK-PDU ::= SEQUENCE { @@ -130,8 +131,8 @@ fUnconfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin * @param offset the offset in the tvb * @return modified offset */ -static guint -fSimpleAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSimpleAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ComplexACK-PDU ::= SEQUENCE { @@ -151,8 +152,8 @@ fSimpleAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) * @param offset the offset in the tvb * @return modified offset */ -static guint -fComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * SegmentACK-PDU ::= SEQUENCE { @@ -170,8 +171,8 @@ fComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fSegmentAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSegmentAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Error-PDU ::= SEQUENCE { @@ -187,8 +188,8 @@ fSegmentAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fErrorPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fErrorPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Reject-PDU ::= SEQUENCE { @@ -203,8 +204,8 @@ fErrorPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fRejectPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fRejectPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Abort-PDU ::= SEQUENCE { @@ -220,8 +221,8 @@ fRejectPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fAbortPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAbortPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * 20.2.4, adds the label with max 64Bit unsigned Integer Value to tree @@ -232,8 +233,8 @@ fAbortPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param label the label of this item * @return modified offset */ -static guint -fUnsignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fUnsignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * 20.2.5, adds the label with max 64Bit signed Integer Value to tree @@ -244,8 +245,8 @@ fUnsignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, * @param label the label of this item * @return modified offset */ -static guint -fSignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fSignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * 20.2.8, adds the label with Octet String to tree; if lvt == 0 then lvt = restOfFrame @@ -257,8 +258,8 @@ fSignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, co * @param lvt length of String * @return modified offset */ -static guint -fOctetString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, guint32 lvt); +static unsigned +fOctetString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, uint32_t lvt); /** * 20.2.12, adds the label with Date Value to tree @@ -269,8 +270,8 @@ fOctetString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, * @param label the label of this item * @return modified offset */ -static guint -fDate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fDate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * 20.2.13, adds the label with Time Value to tree @@ -281,8 +282,8 @@ fDate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const g * @param label the label of this item * @return modified offset */ -static guint -fTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * 20.2.14, adds Object Identifier to tree @@ -294,8 +295,8 @@ fTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const g * @param label the label of this item * @return modified offset */ -static guint -fObjectIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fObjectIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * BACnet-Confirmed-Service-Request ::= CHOICE { @@ -307,8 +308,8 @@ fObjectIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off * @param service_choice the service choice * @return offset */ -static guint -fConfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice); +static unsigned +fConfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, int service_choice); /** * BACnet-Confirmed-Service-ACK ::= CHOICE { @@ -320,8 +321,8 @@ fConfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu * @param service_choice the service choice * @return offset */ -static guint -fConfirmedServiceAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice); +static unsigned +fConfirmedServiceAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, int service_choice); /** * AcknowledgeAlarm-Request ::= SEQUENCE { @@ -338,8 +339,8 @@ fConfirmedServiceAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param offset the offset in the tvb * @return modified offset */ -static guint -fAcknowledgeAlarmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAcknowledgeAlarmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ConfirmedCOVNotification-Request ::= SEQUENCE { @@ -355,8 +356,8 @@ fAcknowledgeAlarmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu * @param offset the offset in the tvb * @return modified offset */ -static guint -fConfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fConfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ConfirmedEventNotification-Request ::= SEQUENCE { @@ -380,8 +381,8 @@ fConfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree * * @param offset the offset in the tvb * @return modified offset */ -static guint -fConfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fConfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * GetAlarmSummary-ACK ::= SEQUENCE OF SEQUENCE { @@ -395,8 +396,8 @@ fConfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tre * @param offset the offset in the tvb * @return modified offset */ -static guint -fGetAlarmSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fGetAlarmSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * GetEnrollmentSummary-Request ::= SEQUENCE { @@ -426,8 +427,8 @@ fGetAlarmSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @param offset the offset in the tvb * @return modified offset */ -static guint -fGetEnrollmentSummaryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fGetEnrollmentSummaryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * GetEnrollmentSummary-ACK ::= SEQUENCE OF SEQUENCE { @@ -443,8 +444,8 @@ fGetEnrollmentSummaryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree * @param offset the offset in the tvb * @return modified offset */ -static guint -fGetEnrollmentSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fGetEnrollmentSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * GetEventInformation-Request ::= SEQUENCE { @@ -456,8 +457,8 @@ fGetEnrollmentSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu * @param offset the offset in the tvb * @return modified offset */ -static guint -fGetEventInformationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fGetEventInformationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * GetEventInformation-ACK ::= SEQUENCE { @@ -470,8 +471,8 @@ fGetEventInformationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fGetEventInformationACK(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fGetEventInformationACK(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * LifeSafetyOperation-Request ::= SEQUENCE { @@ -486,8 +487,8 @@ fGetEventInformationACK(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui * @param offset the offset in the tvb * @return modified offset */ -static guint -fLifeSafetyOperationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fLifeSafetyOperationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * SubscribeCOV-Request ::= SEQUENCE { @@ -502,8 +503,8 @@ fLifeSafetyOperationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fSubscribeCOVRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSubscribeCOVRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * SubscribeCOVProperty-Request ::= SEQUENCE { @@ -520,8 +521,8 @@ fSubscribeCOVRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param offset the offset in the tvb * @return modified offset */ -static guint -fSubscribeCOVPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSubscribeCOVPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * AtomicReadFile-Request ::= SEQUENCE { @@ -543,8 +544,8 @@ fSubscribeCOVPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree * @param offset the offset in the tvb * @return modified offset */ -static guint -fAtomicReadFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAtomicReadFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * AtomicWriteFile-ACK ::= SEQUENCE { @@ -567,8 +568,8 @@ fAtomicReadFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin * @param offset the offset in the tvb * @return modified offset */ -static guint -fAtomicReadFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAtomicReadFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * AtomicWriteFile-Request ::= SEQUENCE { @@ -591,8 +592,8 @@ fAtomicReadFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of * @param offset the offset in the tvb * @return modified offset */ -static guint -fAtomicWriteFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAtomicWriteFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * AtomicWriteFile-ACK ::= SEQUENCE { @@ -605,8 +606,8 @@ fAtomicWriteFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui * @param offset the offset in the tvb * @return modified offset */ -static guint -fAtomicWriteFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAtomicWriteFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * AddListElement-Request ::= SEQUENCE { @@ -621,8 +622,8 @@ fAtomicWriteFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @param offset the offset in the tvb * @return modified offset */ -static guint -fAddListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAddListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * CreateObject-Request ::= SEQUENCE { @@ -635,8 +636,8 @@ fAddListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin * @param offset the offset in the tvb * @return modified offset */ -static guint -fCreateObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset); +static unsigned +fCreateObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset); /** * CreateObject-Request ::= BACnetObjectIdentifier @@ -646,8 +647,8 @@ fCreateObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, gui * @param offset the offset in the tvb * @return modified offset */ -static guint -fCreateObjectAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fCreateObjectAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * DeleteObject-Request ::= SEQUENCE { @@ -659,8 +660,8 @@ fCreateObjectAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @param offset the offset in the tvb * @return modified offset */ -static guint -fDeleteObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fDeleteObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReadProperty-Request ::= SEQUENCE { @@ -674,8 +675,8 @@ fDeleteObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param offset the offset in the tvb * @return modified offset */ -static guint -fReadPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fReadPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReadProperty-ACK ::= SEQUENCE { @@ -690,8 +691,8 @@ fReadPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param offset the offset in the tvb * @return modified offset */ -static guint -fReadPropertyAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fReadPropertyAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReadPropertyConditional-Request ::= SEQUENCE { @@ -704,8 +705,8 @@ fReadPropertyAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @param offset the offset in the tvb * @return modified offset */ -static guint -fReadPropertyConditionalRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset); +static unsigned +fReadPropertyConditionalRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset); /** * ReadPropertyConditional-ACK ::= SEQUENCE { @@ -717,8 +718,8 @@ fReadPropertyConditionalRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *s * @param offset the offset in the tvb * @return modified offset */ -static guint -fReadPropertyConditionalAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fReadPropertyConditionalAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReadPropertyMultiple-Request ::= SEQUENCE { @@ -730,8 +731,8 @@ fReadPropertyConditionalAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return offset modified */ -static guint -fReadPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset); +static unsigned +fReadPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset); /** * ReadPropertyMultiple-Ack ::= SEQUENCE { @@ -743,8 +744,8 @@ fReadPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subt * @param offset the offset in the tvb * @return offset modified */ -static guint -fReadPropertyMultipleAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fReadPropertyMultipleAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReadRange-Request ::= SEQUENCE { @@ -772,8 +773,8 @@ fReadPropertyMultipleAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu * @param offset the offset in the tvb * @return modified offset */ -static guint -fReadRangeRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fReadRangeRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReadRange-ACK ::= SEQUENCE { @@ -790,8 +791,8 @@ fReadRangeRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off * @param offset the offset in the tvb * @return modified offset */ -static guint -fReadRangeAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fReadRangeAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * RemoveListElement-Request ::= SEQUENCE { @@ -806,8 +807,8 @@ fReadRangeAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) * @param offset the offset in the tvb * @return modified offset */ -static guint -fRemoveListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fRemoveListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * WriteProperty-Request ::= SEQUENCE { @@ -823,8 +824,8 @@ fRemoveListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g * @param offset the offset in the tvb * @return modified offset */ -static guint -fWritePropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fWritePropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * WritePropertyMultiple-Request ::= SEQUENCE { @@ -836,8 +837,8 @@ fWritePropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param offset the offset in the tvb * @return modified offset */ -static guint -fWritePropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fWritePropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * DeviceCommunicationControl-Request ::= SEQUENCE { @@ -854,8 +855,8 @@ fWritePropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre * @param offset the offset in the tvb * @return modified offset */ -static guint -fDeviceCommunicationControlRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fDeviceCommunicationControlRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ConfirmedPrivateTransfer-Request ::= SEQUENCE { @@ -869,8 +870,8 @@ fDeviceCommunicationControlRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree * @param offset the offset in the tvb * @return modified offset */ -static guint -fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ConfirmedPrivateTransfer-ACK ::= SEQUENCE { @@ -884,8 +885,8 @@ fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree * * @param offset the offset in the tvb * @return modified offset */ -static guint -fConfirmedPrivateTransferAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fConfirmedPrivateTransferAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ConfirmedTextMessage-Request ::= SEQUENCE { @@ -906,8 +907,8 @@ fConfirmedPrivateTransferAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree * @param offset the offset in the tvb * @return modified offset */ -static guint -fConfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fConfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReinitializeDevice-Request ::= SEQUENCE { @@ -928,8 +929,8 @@ fConfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree * @param offset the offset in the tvb * @return modified offset */ -static guint -fReinitializeDeviceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fReinitializeDeviceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * VTOpen-Request ::= SEQUENCE { @@ -942,8 +943,8 @@ fReinitializeDeviceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fVtOpenRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fVtOpenRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * VTOpen-ACK ::= SEQUENCE { @@ -955,8 +956,8 @@ fVtOpenRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fVtOpenAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fVtOpenAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * VTClose-Request ::= SEQUENCE { @@ -968,8 +969,8 @@ fVtOpenAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fVtCloseRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fVtCloseRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * VTData-Request ::= SEQUENCE { @@ -983,13 +984,13 @@ fVtCloseRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse * @param offset the offset in the tvb * @return modified offset */ -static guint -fVtDataRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fVtDataRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * VTData-ACK ::= SEQUENCE { * allNewDataAccepted [0] BOOLEAN, - * acceptedOctetCount [1] Unsigned OPTIONAL -- present only if allNewDataAccepted = FALSE + * acceptedOctetCount [1] Unsigned OPTIONAL -- present only if allNewDataAccepted = false * } * @param tvb the tv buffer of the current data * @param pinfo the packet info of the current data @@ -997,8 +998,8 @@ fVtDataRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fVtDataAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fVtDataAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Authenticate-Request ::= SEQUENCE { @@ -1014,8 +1015,8 @@ fVtDataAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fAuthenticateRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAuthenticateRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Authenticate-ACK ::= SEQUENCE { @@ -1027,8 +1028,8 @@ fAuthenticateRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param offset the offset in the tvb * @return modified offset */ -static guint -fAuthenticateAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAuthenticateAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * RequestKey-Request ::= SEQUENCE { @@ -1043,8 +1044,8 @@ fAuthenticateAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @param offset the offset in the tvb * @return modified offset */ -static guint -fRequestKeyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fRequestKeyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Unconfirmed-Service-Request ::= CHOICE { @@ -1056,8 +1057,8 @@ fRequestKeyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of * @param service_choice the service choice * @return modified offset */ -static guint -fUnconfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice); +static unsigned +fUnconfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, int service_choice); /** * UnconfirmedCOVNotification-Request ::= SEQUENCE { @@ -1073,8 +1074,8 @@ fUnconfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fUnconfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fUnconfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * UnconfirmedEventNotification-Request ::= SEQUENCE { @@ -1098,8 +1099,8 @@ fUnconfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree * @param offset the offset in the tvb * @return modified offset */ -static guint -fUnconfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fUnconfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * I-Am-Request ::= SEQUENCE { @@ -1114,8 +1115,8 @@ fUnconfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tr * @param offset the offset in the tvb * @return modified offset */ -static guint -fIAmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fIAmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** @@ -1130,8 +1131,8 @@ fIAmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fIHaveRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fIHaveRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * UnconfirmedPrivateTransfer-Request ::= SEQUENCE { @@ -1145,8 +1146,8 @@ fIHaveRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) * @param offset the offset in the tvb * @return modified offset */ -static guint -fUnconfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fUnconfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * UnconfirmedTextMessage-Request ::= SEQUENCE { @@ -1167,8 +1168,8 @@ fUnconfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree * @param offset the offset in the tvb * @return modified offset */ -static guint -fUnconfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fUnconfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * TimeSynchronization-Request ::= SEQUENCE { @@ -1180,8 +1181,8 @@ fUnconfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * @param offset the offset in the tvb * @return modified offset */ -static guint -fTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * UTCTimeSynchronization-Request ::= SEQUENCE { @@ -1193,8 +1194,8 @@ fTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fUTCTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fUTCTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Who-Has-Request ::= SEQUENCE { @@ -1213,8 +1214,8 @@ fUTCTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * @param offset the offset in the tvb * @return modified offset */ -static guint -fWhoHas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fWhoHas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Who-Is-Request ::= SEQUENCE { @@ -1226,8 +1227,8 @@ fWhoHas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fWhoIsRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fWhoIsRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnet-Error ::= CHOICE { @@ -1246,8 +1247,8 @@ fWhoIsRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) * @param service the service * @return modified offset */ -static guint -fBACnetError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint service); +static unsigned +fBACnetError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, unsigned service); /** * Dissect a BACnetError in a context tag @@ -1258,7 +1259,7 @@ fBACnetError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, * @param offset the offset in the tvb * @return modified offset */ -static guint fContextTaggedError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned fContextTaggedError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ChangeList-Error ::= SEQUENCE { @@ -1272,8 +1273,8 @@ static guint fContextTaggedError(tvbuff_t *tvb, packet_info *pinfo, proto_tree * * @param offset the offset in the tvb * @return modified offset */ -static guint -fChangeListError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fChangeListError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * CreateObject-Error ::= SEQUENCE { @@ -1287,8 +1288,8 @@ fChangeListError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @param offset the offset in the tvb * @return modified offset */ -static guint -fCreateObjectError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fCreateObjectError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ConfirmedPrivateTransfer-Error ::= SEQUENCE { @@ -1304,8 +1305,8 @@ fCreateObjectError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of * @param offset the offset in the tvb * @return modified offset */ -static guint -fConfirmedPrivateTransferError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fConfirmedPrivateTransferError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * WritePropertyMultiple-Error ::= SEQUENCE { @@ -1319,8 +1320,8 @@ fConfirmedPrivateTransferError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * @param offset the offset in the tvb * @return modified offset */ -static guint -fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * VTClose-Error ::= SEQUENCE { @@ -1334,8 +1335,8 @@ fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fVTCloseError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fVTCloseError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnet Application Types chapter 20.2.1 @@ -1346,8 +1347,8 @@ fVTCloseError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) * @param label the label of this item * @return modified offset */ -static guint -fApplicationTypes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fApplicationTypes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * BACnetActionCommand ::= SEQUENCE { @@ -1368,8 +1369,8 @@ fApplicationTypes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off * @param tag_match the tag number * @return modified offset */ -static guint -fActionCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tag_match); +static unsigned +fActionCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t tag_match); /** * BACnetActionList ::= SEQUENCE { @@ -1381,8 +1382,8 @@ fActionCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fActionList(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fActionList(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** BACnetAddress ::= SEQUENCE { * network-number Unsigned16, -- A value 0 indicates the local network @@ -1394,8 +1395,8 @@ fActionList(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetAddressBinding ::= SEQUENCE { @@ -1408,8 +1409,8 @@ fAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fAddressBinding(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAddressBinding(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetCalendarEntry ::= CHOICE { @@ -1423,8 +1424,8 @@ fAddressBinding(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse * @param offset the offset in the tvb * @return modified offset */ -static guint -fCalendarEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fCalendarEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetClientCOV ::= CHOICE { @@ -1436,8 +1437,8 @@ fCalendarEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fClientCOV(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fClientCOV(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** @@ -1450,8 +1451,8 @@ fClientCOV(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fDailySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fDailySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetHealth ::= SEQUENCE { @@ -1466,8 +1467,8 @@ fDailySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fHealth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fHealth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetSCFailedConnectionRequest ::= SEQUENCE { @@ -1484,8 +1485,8 @@ fHealth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fSCFailedConnectionRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSCFailedConnectionRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetSCDirectConnection ::= SEQUENCE { @@ -1505,8 +1506,8 @@ fSCFailedConnectionRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fSCDirectConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSCDirectConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetSCHubConnection ::= SEQUENCE { @@ -1522,8 +1523,8 @@ fSCDirectConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @param offset the offset in the tvb * @return modified offset */ -static guint -fSCHubConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSCHubConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetSCHubFunctionConnection ::= SEQUENCE { @@ -1542,8 +1543,8 @@ fSCHubConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @param offset the offset in the tvb * @return modified offset */ -static guint -fSCHubFunctionConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSCHubFunctionConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetWeeklySchedule ::= SEQUENCE { @@ -1555,8 +1556,8 @@ fSCHubFunctionConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu * @param offset the offset in the tvb * @return modified offset */ -static guint -fWeeklySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fWeeklySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetDateRange ::= SEQUENCE { @@ -1569,8 +1570,8 @@ fWeeklySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse * @param offset the offset in the tvb * @return modified offset */ -static guint -fDateRange(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fDateRange(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetDateTime ::= SEQUENCE { @@ -1584,8 +1585,8 @@ fDateRange(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param label the label of this item * @return modified offset */ -static guint -fDateTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fDateTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * BACnetDestination ::= SEQUENCE { @@ -1603,8 +1604,8 @@ fDateTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, con * @param offset the offset in the tvb * @return modified offset */ -static guint -fDestination(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fDestination(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetDeviceObjectPropertyReference ::= SEQUENCE { @@ -1619,8 +1620,8 @@ fDestination(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fDeviceObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fDeviceObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetObjectPropertyReference ::= SEQUENCE { @@ -1634,8 +1635,8 @@ fDeviceObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * @param offset the offset in the tvb * @return modified offset */ -static guint -fObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetDeviceObjectReference ::= SEQUENCE { @@ -1648,8 +1649,8 @@ fObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu * @param offset the offset in the tvb * @return modified offset */ -static guint -fDeviceObjectReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fDeviceObjectReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetEventParameter ::= CHOICE { @@ -1754,8 +1755,8 @@ fDeviceObjectReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin * @param offset the offset in the tvb * @return modified offset */ -static guint -fEventParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fEventParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); @@ -1783,8 +1784,8 @@ fEventParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse * @param offset the offset in the tvb * @return modified offset */ -static guint -fLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetEventLogRecord ::= SEQUENCE { @@ -1801,11 +1802,11 @@ fLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fEventLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fEventLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fLogMultipleRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fLogMultipleRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetNotificationParameters ::= CHOICE { @@ -1918,8 +1919,8 @@ fLogMultipleRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of * @param offset the offset in the tvb * @return modified offset */ -static guint -fNotificationParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fNotificationParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetObjectPropertyReference ::= SEQUENCE { @@ -1933,8 +1934,8 @@ fNotificationParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui * @param offset the offset in the tvb * @return modified offset */ -static guint -fBACnetObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fBACnetObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); #if 0 /** @@ -1951,8 +1952,8 @@ fBACnetObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * @param offset the offset in the tvb * @return modified offset */ -static guint -fObjectPropertyValue(tvbuff_t *tvb, proto_tree *tree, guint offset); +static unsigned +fObjectPropertyValue(tvbuff_t *tvb, proto_tree *tree, unsigned offset); #endif /** @@ -1963,11 +1964,11 @@ fObjectPropertyValue(tvbuff_t *tvb, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fPriorityArray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fPriorityArray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tagoffset, guint8 list); +static unsigned +fPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t tagoffset, uint8_t list); /** * BACnetPropertyReference ::= SEQUENCE { @@ -1980,14 +1981,14 @@ fPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of * @param offset the offset in the tvb * @return modified offset */ -static guint -fBACnetPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 list); +static unsigned +fBACnetPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t list); -static guint -fLOPR(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fLOPR(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fRestartReason(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fRestartReason(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetPropertyValue ::= SEQUENCE { @@ -2003,11 +2004,11 @@ fRestartReason(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fBACnetPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fBACnetPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tagoffset); +static unsigned +fPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t tagoffset); /** * BACnet Application PDUs chapter 21 @@ -2021,8 +2022,8 @@ fPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset * @param offset the offset in the tvb * @return modified offset */ -static guint -fRecipient(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fRecipient(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnet Application PDUs chapter 21 @@ -2036,11 +2037,11 @@ fRecipient(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fRecipientProcess(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fRecipientProcess(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fCOVSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fCOVSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); #if 0 /** @@ -2054,8 +2055,8 @@ fCOVSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @return modified offset * @todo check if checksum is displayed correctly */ -static guint -fSessionKey(tvbuff_t *tvb, proto_tree *tree, guint offset); +static unsigned +fSessionKey(tvbuff_t *tvb, proto_tree *tree, unsigned offset); #endif /** @@ -2073,8 +2074,8 @@ fSessionKey(tvbuff_t *tvb, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fSpecialEvent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSpecialEvent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetTimeStamp ::= CHOICE { @@ -2089,11 +2090,11 @@ fSpecialEvent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) * @param label the label of this item * @return modified offset */ -static guint -fTimeStamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fTimeStamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); -static guint -fEventTimeStamps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fEventTimeStamps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnetTimeValue ::= SEQUENCE { @@ -2106,8 +2107,8 @@ fEventTimeStamps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @param offset the offset in the tvb * @return modified offset */ -static guint -fTimeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fTimeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); #if 0 /** @@ -2121,8 +2122,8 @@ fTimeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fVTSession(tvbuff_t *tvb, proto_tree *tree, guint offset); +static unsigned +fVTSession(tvbuff_t *tvb, proto_tree *tree, unsigned offset); #endif /** @@ -2144,8 +2145,8 @@ fVTSession(tvbuff_t *tvb, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fWeekNDay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fWeekNDay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReadAccessResult ::= SEQUENCE { @@ -2165,8 +2166,8 @@ fWeekNDay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fReadAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fReadAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * ReadAccessSpecification ::= SEQUENCE { @@ -2179,8 +2180,8 @@ fReadAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off * @param offset the offset in the tvb * @return modified offset */ -static guint -fReadAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset); +static unsigned +fReadAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset); /** * WriteAccessSpecification ::= SEQUENCE { @@ -2193,8 +2194,8 @@ fReadAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fWriteAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset); +static unsigned +fWriteAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset); /********************************************************* Helper functions *******************************************/ @@ -2205,8 +2206,8 @@ fWriteAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree * @param offset the offset in the tvb in actual tvb * @return Tag Number corresponding to BACnet 20.2.1.2 Tag Number */ -static guint -fTagNo(tvbuff_t *tvb, guint offset); +static unsigned +fTagNo(tvbuff_t *tvb, unsigned offset); /** * splits Tag Header coresponding to 20.2.1 General Rules For BACnet Tags @@ -2219,8 +2220,8 @@ fTagNo(tvbuff_t *tvb, guint offset); * @return offs = length of this header */ -static guint -fTagHeader(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint8 *tag_no, guint8* class_tag, guint32 *lvt); +static unsigned +fTagHeader(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, uint8_t *tag_no, uint8_t* class_tag, uint32_t *lvt); /** @@ -2231,8 +2232,8 @@ fTagHeader(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint8 *tag_no, guin * @param offset the offset in the tvb * @return modified offset */ -static guint -fProcessId(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fProcessId(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * adds present value to the tree @@ -2245,8 +2246,8 @@ fProcessId(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param type present value datatype enum * @return modified offset */ -static guint -fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const value_string *vs, guint32 split_val, BacappPresentValueType type); +static unsigned +fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const value_string *vs, uint32_t split_val, BacappPresentValueType type); /** * adds event type to the tree @@ -2256,8 +2257,8 @@ fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, * @param offset the offset in the tvb * @return modified offset */ -static guint -fEventType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fEventType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * adds notify type to the tree @@ -2267,8 +2268,8 @@ fEventType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fNotifyType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fNotifyType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * adds next_state with max 32Bit unsigned Integer Value to tree @@ -2278,8 +2279,8 @@ fNotifyType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fToState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fToState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * adds from_state with max 32Bit unsigned Integer Value to tree @@ -2289,8 +2290,8 @@ fToState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fFromState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fFromState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * adds object_name string value to tree @@ -2300,8 +2301,8 @@ fFromState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fObjectName(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fObjectName(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * wrapper function for fCharacterStringBase @@ -2311,8 +2312,8 @@ fObjectName(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fCharacterString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fCharacterString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * adds string value to tree @@ -2324,9 +2325,9 @@ fCharacterString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @param object_name_dissect exposes string as object_name property * @return modified offset */ -static guint -fCharacterStringBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, - gboolean present_val_dissect, gboolean object_name_dissect); +static unsigned +fCharacterStringBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, + bool present_val_dissect, bool object_name_dissect); /** * adds timeSpan with max 32Bit unsigned Integer Value to tree @@ -2336,8 +2337,8 @@ fCharacterStringBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param offset the offset in the tvb * @return modified offset */ -static guint -fTimeSpan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fTimeSpan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * BACnet Application PDUs chapter 21 @@ -2350,8 +2351,8 @@ fTimeSpan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, con * @param offset the offset in the tvb * @return modified offset */ -static guint -fPropertyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fPropertyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * BACnet Application PDUs chapter 21 @@ -2364,8 +2365,8 @@ fPropertyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @param offset the offset in the tvb * @return modified offset */ -static guint -fPropertyArrayIndex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fPropertyArrayIndex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * listOfEventSummaries ::= SEQUENCE OF SEQUENCE { @@ -2383,8 +2384,8 @@ fPropertyArrayIndex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @param offset the offset in the tvb * @return modified offset */ -static guint -flistOfEventSummaries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +flistOfEventSummaries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * SelectionCriteria ::= SEQUENCE { @@ -2399,8 +2400,8 @@ flistOfEventSummaries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param offset the offset in the tvb * @return modified offset */ -static guint -fSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * objectSelectionCriteria ::= SEQUENCE { @@ -2413,8 +2414,8 @@ fSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of * @param offset the offset in the tvb * @return modified offset */ -static guint -fObjectSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset); +static unsigned +fObjectSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset); /** * BACnet-Error ::= SEQUENCE { @@ -2428,8 +2429,8 @@ fObjectSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Adds error-code from BACnet-Error to the tree @@ -2439,8 +2440,8 @@ fError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fErrorCode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fErrorCode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Adds error-class from BACnet-Error to the tree @@ -2450,8 +2451,8 @@ fErrorCode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @param offset the offset in the tvb * @return modified offset */ -static guint -fErrorClass(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fErrorClass(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** * Generic handler for context tagged values. Mostly for handling @@ -2463,8 +2464,8 @@ fErrorClass(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); * @return modified offset * @todo beautify this ugly construct */ -static guint -fContextTaggedValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fContextTaggedValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); /** * realizes some ABSTRACT-SYNTAX.&Type @@ -2475,104 +2476,104 @@ fContextTaggedValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @return modified offset * @todo beautify this ugly construct */ -static guint -fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fBitStringTagVS(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, +static unsigned +fBitStringTagVS(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, const value_string *src); -static guint -fBitStringTagVSBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, - const value_string *src, gboolean present_val_dissect); +static unsigned +fBitStringTagVSBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, + const value_string *src, bool present_val_dissect); -static guint -fFaultParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fFaultParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fEventNotificationSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fEventNotificationSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fLightingCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *lable); +static unsigned +fLightingCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *lable); -static guint -fColorCommand(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint offset, const gchar* lable); +static unsigned +fColorCommand(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, unsigned offset, const char* lable); -static guint -fXyColor(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint offset, const gchar* lable); +static unsigned +fXyColor(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, unsigned offset, const char* lable); -static guint -fTimerStateChangeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fTimerStateChangeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fHostNPort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *lable); +static unsigned +fHostNPort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *lable); -static guint -fBDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *lable); +static unsigned +fBDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *lable); -static guint -fFDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *lable); +static unsigned +fFDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *lable); -static guint -fRouterEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fRouterEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fVMACEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fVMACEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fValueSource(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fValueSource(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fAssignedLandingCalls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAssignedLandingCalls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fLandingCallStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fLandingCallStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fLandingDoorStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fLandingDoorStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fCOVMultipleSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fCOVMultipleSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fNameValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fNameValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fNameValueCollection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fNameValueCollection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fAuthenticationFactor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAuthenticationFactor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fAuthenticationFactorFormat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAuthenticationFactorFormat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fAuthenticationPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAuthenticationPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fAccessRule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAccessRule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fChannelValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label); +static unsigned +fChannelValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label); -static guint -fPropertyAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fPropertyAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fNetworkSecurityPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fNetworkSecurityPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fSecurityKeySet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fSecurityKeySet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fAuditLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fAuditLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fStageLimitValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fStageLimitValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint -fObjectSelector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); +static unsigned +fObjectSelector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); /** @@ -2587,9 +2588,9 @@ proto_register_bacapp(void); static reassembly_table msg_reassembly_table; /* some necessary forward function prototypes */ -static guint -fApplicationTypesEnumerated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, - const gchar *label, const value_string *vs); +static unsigned +fApplicationTypesEnumerated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, + const char *label, const value_string *vs); static const char *bacapp_unknown_service_str = "unknown service"; /* Usage: no format specifiers */ static const char ASHRAE_Reserved_Fmt[] = "(%d) Reserved for Use by ASHRAE"; @@ -2984,7 +2985,7 @@ BACnetFileStartOption [] = { }; static const value_string -BACnetFileRequestCount [] = { +BacnetFileRequestedCount [] = { { 0, "Requested Octet Count: "}, { 1, "Requested Record Count: "}, { 0, NULL} @@ -3171,8 +3172,8 @@ BACnetLifeSafetyState [] = { static const value_string BACnetLimitEnable[] = { - { 0, "low-limit" }, - { 1, "high-limit" }, + { 0, "low-limit-enable" }, + { 1, "high-limit-enable" }, { 0, NULL } }; @@ -3458,6 +3459,7 @@ BACnetReliability [] = { { 22, "proprietary-command-failure"}, { 23, "faults-listed"}, { 24, "referenced-object-fault"}, + { 25, "multi-state-out-of-range"}, { 0, NULL} }; @@ -4641,9 +4643,9 @@ BACnetAcknowledgementFilter [] = { static const value_string BACnetResultFlags [] = { - { 0, "firstitem"}, - { 1, "lastitem"}, - { 2, "moreitems"}, + { 0, "first-item"}, + { 1, "last-item"}, + { 2, "more-items"}, { 0, NULL} }; @@ -4808,7 +4810,7 @@ BACnetEventType [] = { { 4, "floating-limit" }, { 5, "out-of-range" }, { 6, "complex-event-type" }, - { 7, "(deprecated)buffer-ready" }, + { 7, "(deprecated)event-buffer-ready" }, { 8, "change-of-life-safety" }, { 9, "extended" }, { 10, "buffer-ready" }, @@ -5265,7 +5267,7 @@ BACnetSuccessFilter [] = { /* These values are generated by tools/generate-bacnet-vendors.py from * https://bacnet.org/assigned-vendor-ids/ - * Version: "As of November 27, 2023" + * Version: "As of January 24, 2024" */ static const value_string @@ -5399,7 +5401,7 @@ BACnetVendorIdentifiers [] = { { 126, "Data Aire, Inc." }, { 127, "ABB, Inc." }, { 128, "Transbit Sp. z o. o." }, - { 129, "Toshiba Carrier Corporation" }, + { 129, "Carrier Japan Corporation" }, { 130, "Shenzhen Junzhi Hi-Tech Co., Ltd." }, { 131, "Tokai Soft" }, { 132, "Blue Ridge Technologies" }, @@ -5863,7 +5865,7 @@ BACnetVendorIdentifiers [] = { { 590, "Home Systems Consulting SpA" }, { 591, "Socomec" }, { 592, "Everex Communications, Inc." }, - { 593, "Ceiec Electric Technology" }, + { 593, "CET Electric Technology, Inc." }, { 594, "Atrila GmbH" }, { 595, "WingTechs" }, { 596, "Shenzhen Mek Intellisys Pte Ltd." }, @@ -6640,12 +6642,10 @@ BACnetVendorIdentifiers [] = { { 1367, "iDM Energiesysteme GmbH" }, { 1368, "BeNext B.V." }, { 1369, "CleanAir.ai Corporation" }, - { 1369, "CleanAir.ai Corporation" }, { 1370, "Revolution Microelectronics (America) Inc." }, { 1371, "Real-Time Systems GmbH" }, { 1372, "ZedBee Technologies Pvt Ltd" }, { 1373, "Winmate Technology Solutions Pvt. Ltd." }, - { 1373, "Winmate Technology Solutions Pvt. Ltd." }, { 1374, "Senticon Ltd." }, { 1375, "Rossaker AB" }, { 1376, "OPIT Solutions Ltd" }, @@ -6724,103 +6724,135 @@ BACnetVendorIdentifiers [] = { { 1451, "Ryobi Limited" }, { 1452, "EkkoSense Ltd" }, { 1453, "ClimaCool" }, + { 1454, "Grid Connect Inc." }, + { 1455, "Ziegler Instrumentation UK Ltd" }, + { 1456, "ControlTec, LLC" }, + { 1457, "Aeterlink Corporation" }, + { 1458, "Alpha Epsilon Automation" }, + { 1459, "Astralite Inc." }, + { 1460, "Delta Fire Ltda." }, + { 1461, "Bock Water Heaters, Inc." }, + { 1462, "Cleaver-Brooks" }, + { 1463, "Scanalytics, Inc." }, + { 1464, "WI6LABS" }, + { 1465, "AC&T System Co., Ltd" }, + { 1466, "VergeSense" }, + { 1467, "Systemair Mfg. Inc." }, + { 1468, "Seeley International" }, + { 1469, "Crane Building Services & Utilities" }, + { 1470, "Brady Corporation" }, + { 1471, "Qingdao Hisense Hitachi Air-Conditioning Systems Co., Ltd." }, + { 1472, "Golden Quality Co. Ltd." }, + { 1473, "Elvaco AB" }, + { 1474, "Strong Technology, LLC" }, + { 1475, "REC Environmental Technology (Guangzhou) Company Limited" }, + { 1476, "Disruptive Technologies Research AS" }, + { 1477, "Nico Consultancy Limited" }, + { 1478, "Horten lot (Jiangsu) Co., Ltd." }, + { 1479, "Paxton Controls Corp." }, + { 1480, "Fell Technology AS" }, + { 1481, "SHLOK Information Systems India Private Limited" }, + { 1482, "Microgro PLC Ltd." }, + { 1483, "Clouder Oy" }, + { 1484, "Gebäude Automatisierung GmbH" }, + { 1485, "solvimus GmbH" }, { 0, NULL } }; static value_string_ext BACnetVendorIdentifiers_ext = VALUE_STRING_EXT_INIT(BACnetVendorIdentifiers); -static int proto_bacapp = -1; -static int hf_bacapp_type = -1; -static int hf_bacapp_pduflags = -1; -static int hf_bacapp_SEG = -1; -static int hf_bacapp_MOR = -1; -static int hf_bacapp_SA = -1; -static int hf_bacapp_response_segments = -1; -static int hf_bacapp_max_adpu_size = -1; -static int hf_bacapp_invoke_id = -1; -static int hf_bacapp_objectType = -1; -static int hf_bacapp_object_name = -1; -static int hf_bacapp_instanceNumber = -1; -static int hf_bacapp_sequence_number = -1; -static int hf_bacapp_window_size = -1; -static int hf_bacapp_service = -1; -static int hf_bacapp_NAK = -1; -static int hf_bacapp_SRV = -1; -static int hf_bacapp_notify_type = -1; -static int hf_bacapp_event_type = -1; -static int hf_bacapp_error_class = -1; -static int hf_bacapp_error_code = -1; -static int hf_Device_Instance_Range_Low_Limit = -1; -static int hf_Device_Instance_Range_High_Limit = -1; -static int hf_BACnetRejectReason = -1; -static int hf_BACnetAbortReason = -1; -static int hf_BACnetApplicationTagNumber = -1; -static int hf_BACnetContextTagNumber = -1; -static int hf_BACnetExtendedTagNumber = -1; -static int hf_BACnetNamedTag = -1; -static int hf_BACnetTagClass = -1; -static int hf_BACnetCharacterSet = -1; -static int hf_BACnetCodePage = -1; -static int hf_bacapp_tag_lvt = -1; -static int hf_bacapp_tag_ProcessId = -1; -static int hf_bacapp_tag_to_state = -1; -static int hf_bacapp_tag_from_state = -1; -static int hf_bacapp_uservice = -1; -static int hf_BACnetPropertyIdentifier = -1; -static int hf_BACnetVendorIdentifier = -1; -static int hf_BACnetRestartReason = -1; -static int hf_bacapp_tag_IPV4 = -1; -static int hf_bacapp_tag_IPV6 = -1; -static int hf_bacapp_tag_PORT = -1; -static int hf_bacapp_tag_mac_address_broadcast = -1; -static int hf_bacapp_reserved_ashrea = -1; -static int hf_bacapp_unused_bits = -1; -static int hf_bacapp_bit = -1; -static int hf_bacapp_complete_bitstring = -1; +static int proto_bacapp; +static int hf_bacapp_type; +static int hf_bacapp_pduflags; +static int hf_bacapp_SEG; +static int hf_bacapp_MOR; +static int hf_bacapp_SA; +static int hf_bacapp_response_segments; +static int hf_bacapp_max_adpu_size; +static int hf_bacapp_invoke_id; +static int hf_bacapp_objectType; +static int hf_bacapp_object_name; +static int hf_bacapp_instanceNumber; +static int hf_bacapp_sequence_number; +static int hf_bacapp_window_size; +static int hf_bacapp_service; +static int hf_bacapp_NAK; +static int hf_bacapp_SRV; +static int hf_bacapp_notify_type; +static int hf_bacapp_event_type; +static int hf_bacapp_error_class; +static int hf_bacapp_error_code; +static int hf_Device_Instance_Range_Low_Limit; +static int hf_Device_Instance_Range_High_Limit; +static int hf_BACnetRejectReason; +static int hf_BACnetAbortReason; +static int hf_BACnetApplicationTagNumber; +static int hf_BACnetContextTagNumber; +static int hf_BACnetExtendedTagNumber; +static int hf_BACnetNamedTag; +static int hf_BACnetTagClass; +static int hf_BACnetCharacterSet; +static int hf_BACnetCodePage; +static int hf_bacapp_tag_lvt; +static int hf_bacapp_tag_ProcessId; +static int hf_bacapp_tag_to_state; +static int hf_bacapp_tag_from_state; +static int hf_bacapp_uservice; +static int hf_BACnetPropertyIdentifier; +static int hf_BACnetVendorIdentifier; +static int hf_BACnetRestartReason; +static int hf_bacapp_tag_IPV4; +static int hf_bacapp_tag_IPV6; +static int hf_bacapp_tag_PORT; +static int hf_bacapp_tag_mac_address_broadcast; +static int hf_bacapp_reserved_ashrea; +static int hf_bacapp_unused_bits; +static int hf_bacapp_bit; +static int hf_bacapp_complete_bitstring; /* present value */ -static int hf_bacapp_present_value_null = -1; -static int hf_bacapp_present_value_bool = -1; -static int hf_bacapp_present_value_unsigned = -1; -static int hf_bacapp_present_value_signed = -1; -static int hf_bacapp_present_value_real = -1; -static int hf_bacapp_present_value_double = -1; -static int hf_bacapp_present_value_octet_string = -1; -static int hf_bacapp_present_value_char_string = -1; -static int hf_bacapp_present_value_bit_string = -1; -static int hf_bacapp_present_value_enum_index = -1; +static int hf_bacapp_present_value_null; +static int hf_bacapp_present_value_bool; +static int hf_bacapp_present_value_unsigned; +static int hf_bacapp_present_value_signed; +static int hf_bacapp_present_value_real; +static int hf_bacapp_present_value_double; +static int hf_bacapp_present_value_octet_string; +static int hf_bacapp_present_value_char_string; +static int hf_bacapp_present_value_bit_string; +static int hf_bacapp_present_value_enum_index; /* some more variables for segmented messages */ -static int hf_msg_fragments = -1; -static int hf_msg_fragment = -1; -static int hf_msg_fragment_overlap = -1; -static int hf_msg_fragment_overlap_conflicts = -1; -static int hf_msg_fragment_multiple_tails = -1; -static int hf_msg_fragment_too_long_fragment = -1; -static int hf_msg_fragment_error = -1; -static int hf_msg_fragment_count = -1; -static int hf_msg_reassembled_in = -1; -static int hf_msg_reassembled_length = -1; - -static gint ett_msg_fragment = -1; -static gint ett_msg_fragments = -1; - -static gint ett_bacapp = -1; -static gint ett_bacapp_control = -1; -static gint ett_bacapp_tag = -1; -static gint ett_bacapp_list = -1; -static gint ett_bacapp_value = -1; - -static expert_field ei_bacapp_bad_length = EI_INIT; -static expert_field ei_bacapp_bad_tag = EI_INIT; -static expert_field ei_bacapp_opening_tag = EI_INIT; -static expert_field ei_bacapp_max_recursion_depth_reached = EI_INIT; - -static gint32 propertyIdentifier = -1; -static gint32 propertyArrayIndex = -1; -static guint32 object_type = 4096; - -static guint8 bacapp_flags = 0; -static guint8 bacapp_seq = 0; +static int hf_msg_fragments; +static int hf_msg_fragment; +static int hf_msg_fragment_overlap; +static int hf_msg_fragment_overlap_conflicts; +static int hf_msg_fragment_multiple_tails; +static int hf_msg_fragment_too_long_fragment; +static int hf_msg_fragment_error; +static int hf_msg_fragment_count; +static int hf_msg_reassembled_in; +static int hf_msg_reassembled_length; + +static int ett_msg_fragment; +static int ett_msg_fragments; + +static int ett_bacapp; +static int ett_bacapp_control; +static int ett_bacapp_tag; +static int ett_bacapp_list; +static int ett_bacapp_value; + +static expert_field ei_bacapp_bad_length; +static expert_field ei_bacapp_bad_tag; +static expert_field ei_bacapp_opening_tag; +static expert_field ei_bacapp_max_recursion_depth_reached; + +static int32_t propertyIdentifier = -1; +static int32_t propertyArrayIndex = -1; +static uint32_t object_type = 4096; + +static uint8_t bacapp_flags; +static uint8_t bacapp_seq; /* Defined to allow vendor identifier registration of private transfer dissectors */ static dissector_table_t bacapp_dissector_table; @@ -6829,9 +6861,9 @@ static dissector_table_t bacapp_dissector_table; /* Stat: BACnet Packets sorted by IP */ bacapp_info_value_t bacinfo; -static const gchar* st_str_packets_by_ip = "BACnet Packets by IP"; -static const gchar* st_str_packets_by_ip_dst = "By Destination"; -static const gchar* st_str_packets_by_ip_src = "By Source"; +static const char* st_str_packets_by_ip = "BACnet Packets by IP"; +static const char* st_str_packets_by_ip_dst = "By Destination"; +static const char* st_str_packets_by_ip_src = "By Source"; static int st_node_packets_by_ip = -1; static int st_node_packets_by_ip_dst = -1; static int st_node_packets_by_ip_src = -1; @@ -6840,14 +6872,14 @@ static void bacapp_packet_stats_tree_init(stats_tree* st) { st_node_packets_by_ip = stats_tree_create_pivot(st, st_str_packets_by_ip, 0); - st_node_packets_by_ip_src = stats_tree_create_node(st, st_str_packets_by_ip_src, st_node_packets_by_ip, STAT_DT_INT, TRUE); - st_node_packets_by_ip_dst = stats_tree_create_node(st, st_str_packets_by_ip_dst, st_node_packets_by_ip, STAT_DT_INT, TRUE); + st_node_packets_by_ip_src = stats_tree_create_node(st, st_str_packets_by_ip_src, st_node_packets_by_ip, STAT_DT_INT, true); + st_node_packets_by_ip_dst = stats_tree_create_node(st, st_str_packets_by_ip_dst, st_node_packets_by_ip, STAT_DT_INT, true); } -static gchar * +static char * bacapp_get_address_label(const char *tag, address *addr) { - gchar *addr_str, *label_str; + char *addr_str, *label_str; addr_str = address_to_str(NULL, addr); label_str = wmem_strconcat(NULL, tag, addr_str, NULL); @@ -6868,28 +6900,28 @@ bacapp_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt int objectid_for_this_src; int instanceid_for_this_dst; int instanceid_for_this_src; - gchar *dststr; - gchar *srcstr; + char *dststr; + char *srcstr; const bacapp_info_value_t *binfo = (const bacapp_info_value_t *)p; srcstr = bacapp_get_address_label("Src: ", &pinfo->src); dststr = bacapp_get_address_label("Dst: ", &pinfo->dst); - tick_stat_node(st, st_str_packets_by_ip, 0, TRUE); - packets_for_this_dst = tick_stat_node(st, st_str_packets_by_ip_dst, st_node_packets_by_ip, TRUE); - packets_for_this_src = tick_stat_node(st, st_str_packets_by_ip_src, st_node_packets_by_ip, TRUE); - src_for_this_dst = tick_stat_node(st, dststr, packets_for_this_dst, TRUE); - dst_for_this_src = tick_stat_node(st, srcstr, packets_for_this_src, TRUE); - service_for_this_src = tick_stat_node(st, dststr, dst_for_this_src, TRUE); - service_for_this_dst = tick_stat_node(st, srcstr, src_for_this_dst, TRUE); + tick_stat_node(st, st_str_packets_by_ip, 0, true); + packets_for_this_dst = tick_stat_node(st, st_str_packets_by_ip_dst, st_node_packets_by_ip, true); + packets_for_this_src = tick_stat_node(st, st_str_packets_by_ip_src, st_node_packets_by_ip, true); + src_for_this_dst = tick_stat_node(st, dststr, packets_for_this_dst, true); + dst_for_this_src = tick_stat_node(st, srcstr, packets_for_this_src, true); + service_for_this_src = tick_stat_node(st, dststr, dst_for_this_src, true); + service_for_this_dst = tick_stat_node(st, srcstr, src_for_this_dst, true); if (binfo->service_type) { - objectid_for_this_dst = tick_stat_node(st, binfo->service_type, service_for_this_dst, TRUE); - objectid_for_this_src = tick_stat_node(st, binfo->service_type, service_for_this_src, TRUE); + objectid_for_this_dst = tick_stat_node(st, binfo->service_type, service_for_this_dst, true); + objectid_for_this_src = tick_stat_node(st, binfo->service_type, service_for_this_src, true); if (binfo->object_ident) { - instanceid_for_this_dst = tick_stat_node(st, binfo->object_ident, objectid_for_this_dst, TRUE); - tick_stat_node(st, binfo->instance_ident, instanceid_for_this_dst, FALSE); - instanceid_for_this_src = tick_stat_node(st, binfo->object_ident, objectid_for_this_src, TRUE); - tick_stat_node(st, binfo->instance_ident, instanceid_for_this_src, FALSE); + instanceid_for_this_dst = tick_stat_node(st, binfo->object_ident, objectid_for_this_dst, true); + tick_stat_node(st, binfo->instance_ident, instanceid_for_this_dst, false); + instanceid_for_this_src = tick_stat_node(st, binfo->object_ident, objectid_for_this_src, true); + tick_stat_node(st, binfo->instance_ident, instanceid_for_this_src, false); } } @@ -6900,7 +6932,7 @@ bacapp_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt } /* Stat: BACnet Packets sorted by Service */ -static const gchar* st_str_packets_by_service = "BACnet Packets by Service"; +static const char* st_str_packets_by_service = "BACnet Packets by Service"; static int st_node_packets_by_service = -1; static void @@ -6916,22 +6948,22 @@ bacapp_stats_tree_service(stats_tree* st, packet_info* pinfo, epan_dissect_t* ed int src, dst; int objectid; - gchar *dststr; - gchar *srcstr; + char *dststr; + char *srcstr; const bacapp_info_value_t *binfo = (const bacapp_info_value_t *)p; srcstr = bacapp_get_address_label("Src: ", &pinfo->src); dststr = bacapp_get_address_label("Dst: ", &pinfo->dst); - tick_stat_node(st, st_str_packets_by_service, 0, TRUE); + tick_stat_node(st, st_str_packets_by_service, 0, true); if (binfo->service_type) { - servicetype = tick_stat_node(st, binfo->service_type, st_node_packets_by_service, TRUE); - src = tick_stat_node(st, srcstr, servicetype, TRUE); - dst = tick_stat_node(st, dststr, src, TRUE); + servicetype = tick_stat_node(st, binfo->service_type, st_node_packets_by_service, true); + src = tick_stat_node(st, srcstr, servicetype, true); + dst = tick_stat_node(st, dststr, src, true); if (binfo->object_ident) { - objectid = tick_stat_node(st, binfo->object_ident, dst, TRUE); - tick_stat_node(st, binfo->instance_ident, objectid, FALSE); + objectid = tick_stat_node(st, binfo->object_ident, dst, true); + tick_stat_node(st, binfo->instance_ident, objectid, false); } } @@ -6942,7 +6974,7 @@ bacapp_stats_tree_service(stats_tree* st, packet_info* pinfo, epan_dissect_t* ed } /* Stat: BACnet Packets sorted by Object Type */ -static const gchar* st_str_packets_by_objectid = "BACnet Packets by Object Type"; +static const char* st_str_packets_by_objectid = "BACnet Packets by Object Type"; static int st_node_packets_by_objectid = -1; static void @@ -6958,21 +6990,21 @@ bacapp_stats_tree_objectid(stats_tree* st, packet_info* pinfo, epan_dissect_t* e int src, dst; int objectid; - gchar *dststr; - gchar *srcstr; + char *dststr; + char *srcstr; const bacapp_info_value_t *binfo = (const bacapp_info_value_t *)p; srcstr = bacapp_get_address_label("Src: ", &pinfo->src); dststr = bacapp_get_address_label("Dst: ", &pinfo->dst); - tick_stat_node(st, st_str_packets_by_objectid, 0, TRUE); + tick_stat_node(st, st_str_packets_by_objectid, 0, true); if (binfo->object_ident) { - objectid = tick_stat_node(st, binfo->object_ident, st_node_packets_by_objectid, TRUE); - src = tick_stat_node(st, srcstr, objectid, TRUE); - dst = tick_stat_node(st, dststr, src, TRUE); + objectid = tick_stat_node(st, binfo->object_ident, st_node_packets_by_objectid, true); + src = tick_stat_node(st, srcstr, objectid, true); + dst = tick_stat_node(st, dststr, src, true); if (binfo->service_type) { - servicetype = tick_stat_node(st, binfo->service_type, dst, TRUE); - tick_stat_node(st, binfo->instance_ident, servicetype, FALSE); + servicetype = tick_stat_node(st, binfo->service_type, dst, true); + tick_stat_node(st, binfo->instance_ident, servicetype, false); } } @@ -6983,7 +7015,7 @@ bacapp_stats_tree_objectid(stats_tree* st, packet_info* pinfo, epan_dissect_t* e } /* Stat: BACnet Packets sorted by Instance No */ -static const gchar* st_str_packets_by_instanceid = "BACnet Packets by Instance ID"; +static const char* st_str_packets_by_instanceid = "BACnet Packets by Instance ID"; static int st_node_packets_by_instanceid = -1; static void @@ -6999,21 +7031,21 @@ bacapp_stats_tree_instanceid(stats_tree* st, packet_info* pinfo, epan_dissect_t* int src, dst; int instanceid; - gchar *dststr; - gchar *srcstr; + char *dststr; + char *srcstr; const bacapp_info_value_t *binfo = (const bacapp_info_value_t *)p; srcstr = bacapp_get_address_label("Src: ", &pinfo->src); dststr = bacapp_get_address_label("Dst: ", &pinfo->dst); - tick_stat_node(st, st_str_packets_by_instanceid, 0, TRUE); + tick_stat_node(st, st_str_packets_by_instanceid, 0, true); if (binfo->object_ident) { - instanceid = tick_stat_node(st, binfo->instance_ident, st_node_packets_by_instanceid, TRUE); - src = tick_stat_node(st, srcstr, instanceid, TRUE); - dst = tick_stat_node(st, dststr, src, TRUE); + instanceid = tick_stat_node(st, binfo->instance_ident, st_node_packets_by_instanceid, true); + src = tick_stat_node(st, srcstr, instanceid, true); + dst = tick_stat_node(st, dststr, src, true); if (binfo->service_type) { - servicetype = tick_stat_node(st, binfo->service_type, dst, TRUE); - tick_stat_node(st, binfo->object_ident, servicetype, FALSE); + servicetype = tick_stat_node(st, binfo->service_type, dst, true); + tick_stat_node(st, binfo->object_ident, servicetype, false); } } @@ -7024,23 +7056,23 @@ bacapp_stats_tree_instanceid(stats_tree* st, packet_info* pinfo, epan_dissect_t* } -/* register all BACnet Ststistic trees */ +/* register all BACnet Statistic trees */ static void register_bacapp_stat_trees(void) { - stats_tree_register("bacapp", "bacapp_ip", "BACnet/Packets sorted by IP", 0, + stats_tree_register("bacapp", "bacapp_ip", "BACnet" STATS_TREE_MENU_SEPARATOR "Packets sorted by IP", 0, bacapp_stats_tree_packet, bacapp_packet_stats_tree_init, NULL); - stats_tree_register("bacapp", "bacapp_service", "BACnet/Packets sorted by Service", 0, + stats_tree_register("bacapp", "bacapp_service", "BACnet" STATS_TREE_MENU_SEPARATOR "Packets sorted by Service", 0, bacapp_stats_tree_service, bacapp_service_stats_tree_init, NULL); - stats_tree_register("bacapp", "bacapp_objectid", "BACnet/Packets sorted by Object Type", 0, + stats_tree_register("bacapp", "bacapp_objectid", "BACnet" STATS_TREE_MENU_SEPARATOR "Packets sorted by Object Type", 0, bacapp_stats_tree_objectid, bacapp_objectid_stats_tree_init, NULL); - stats_tree_register("bacapp", "bacapp_instanceid", "BACnet/Packets sorted by Instance ID", 0, + stats_tree_register("bacapp", "bacapp_instanceid", "BACnet" STATS_TREE_MENU_SEPARATOR "Packets sorted by Instance ID", 0, bacapp_stats_tree_instanceid, bacapp_instanceid_stats_tree_init, NULL); } /* 'data' must be allocated with wmem packet scope */ -static gint -updateBacnetInfoValue(gint whichval, const gchar *data) +static int +updateBacnetInfoValue(int whichval, const char *data) { if (whichval == BACINFO_SERVICE) { bacinfo.service_type = data; @@ -7087,16 +7119,16 @@ static const fragment_items msg_frag_items = { #if 0 /* if BACnet uses the reserved values, then patch the corresponding values here, maximum 16 values are defined */ /* FIXME: fGetMaxAPDUSize is commented out, as it is not used. It was used to set variables which were not later used. */ -static const guint MaxAPDUSize [] = { 50, 128, 206, 480, 1024, 1476 }; +static const unsigned MaxAPDUSize [] = { 50, 128, 206, 480, 1024, 1476 }; -static guint -fGetMaxAPDUSize(guint8 idx) +static unsigned +fGetMaxAPDUSize(uint8_t idx) { /* only 16 values are defined, so use & 0x0f */ /* check the size of the Array, deliver either the entry or the first entry if idx is outside of the array (bug 3736 comment#7) */ - if ((idx & 0x0f) >= (gint)(sizeof(MaxAPDUSize)/sizeof(guint))) + if ((idx & 0x0f) >= (int)array_length(MaxAPDUSize)) return MaxAPDUSize[0]; else return MaxAPDUSize[idx & 0x0f]; @@ -7104,14 +7136,14 @@ fGetMaxAPDUSize(guint8 idx) #endif static const char* -val_to_split_str(guint32 val, guint32 split_val, const value_string *vs, +val_to_split_str(uint32_t val, uint32_t split_val, const value_string *vs, const char *fmt, const char *split_fmt) G_GNUC_PRINTF(4, 0) G_GNUC_PRINTF(5, 0); /* Used when there are ranges of reserved and proprietary enumerations */ static const char* -val_to_split_str(guint32 val, guint32 split_val, const value_string *vs, +val_to_split_str(uint32_t val, uint32_t split_val, const value_string *vs, const char *fmt, const char *split_fmt) { if (val < split_val) @@ -7122,20 +7154,20 @@ val_to_split_str(guint32 val, guint32 split_val, const value_string *vs, /* from clause 20.2.1.3.2 Constructed Data */ /* returns true if the extended value is used */ -static gboolean -tag_is_extended_value(guint8 tag) +static bool +tag_is_extended_value(uint8_t tag) { return (tag & 0x07) == 5; } -static gboolean -tag_is_opening(guint8 tag) +static bool +tag_is_opening(uint8_t tag) { return (tag & 0x07) == 6; } -static gboolean -tag_is_closing(guint8 tag) +static bool +tag_is_closing(uint8_t tag) { return (tag & 0x07) == 7; } @@ -7143,44 +7175,44 @@ tag_is_closing(guint8 tag) /* from clause 20.2.1.1 Class class bit shall be one for context specific tags */ /* returns true if the tag is context specific */ -static gboolean -tag_is_context_specific(guint8 tag) +static bool +tag_is_context_specific(uint8_t tag) { return (tag & 0x08) != 0; } -static gboolean -tag_is_extended_tag_number(guint8 tag) +static bool +tag_is_extended_tag_number(uint8_t tag) { return ((tag & 0xF0) == 0xF0); } -static guint32 -object_id_type(guint32 object_identifier) +static uint32_t +object_id_type(uint32_t object_identifier) { return ((object_identifier >> 22) & 0x3FF); } -static guint32 -object_id_instance(guint32 object_identifier) +static uint32_t +object_id_instance(uint32_t object_identifier) { return (object_identifier & 0x3FFFFF); } -static guint -fTagNo(tvbuff_t *tvb, guint offset) +static unsigned +fTagNo(tvbuff_t *tvb, unsigned offset) { - return (guint)(tvb_get_guint8(tvb, offset) >> 4); + return (unsigned)(tvb_get_uint8(tvb, offset) >> 4); } -static gboolean -fUnsigned32(tvbuff_t *tvb, guint offset, guint32 lvt, guint32 *val) +static bool +fUnsigned32(tvbuff_t *tvb, unsigned offset, uint32_t lvt, uint32_t *val) { - gboolean valid = TRUE; + bool valid = true; switch (lvt) { case 1: - *val = tvb_get_guint8(tvb, offset); + *val = tvb_get_uint8(tvb, offset); break; case 2: *val = tvb_get_ntohs(tvb, offset); @@ -7192,24 +7224,24 @@ fUnsigned32(tvbuff_t *tvb, guint offset, guint32 lvt, guint32 *val) *val = tvb_get_ntohl(tvb, offset); break; default: - valid = FALSE; + valid = false; break; } return valid; } -static gboolean -fUnsigned64(tvbuff_t *tvb, guint offset, guint32 lvt, guint64 *val) +static bool +fUnsigned64(tvbuff_t *tvb, unsigned offset, uint32_t lvt, uint64_t *val) { - gboolean valid = FALSE; - gint64 value = 0; - guint8 data, i; + bool valid = false; + int64_t value = 0; + uint8_t data, i; if (lvt && (lvt <= 8)) { - valid = TRUE; + valid = true; for (i = 0; i < lvt; i++) { - data = tvb_get_guint8(tvb, offset+i); + data = tvb_get_uint8(tvb, offset+i); value = (value << 8) + data; } *val = value; @@ -7224,25 +7256,25 @@ fUnsigned64(tvbuff_t *tvb, guint offset, guint32 lvt, guint64 *val) shall not be X'00' if the most significant bit (bit 7) of the second octet is 0, and the first octet shall not be X'FF' if the most significant bit of the second octet is 1. ASHRAE-135-2004-20.2.5 */ -static gboolean -fSigned64(tvbuff_t *tvb, guint offset, guint32 lvt, gint64 *val) +static bool +fSigned64(tvbuff_t *tvb, unsigned offset, uint32_t lvt, int64_t *val) { - gboolean valid = FALSE; - gint64 value = 0; - guint8 data; - guint32 i; + bool valid = false; + int64_t value = 0; + uint8_t data; + uint32_t i; /* we can only handle 7 bytes for a 64-bit value due to signed-ness */ if (lvt && (lvt <= 7)) { - valid = TRUE; - data = tvb_get_guint8(tvb, offset); + valid = true; + data = tvb_get_uint8(tvb, offset); if ((data & 0x80) != 0) - value = (~G_GUINT64_CONSTANT(0) << 8) | data; + value = (~UINT64_C(0) << 8) | data; else value = data; for (i = 1; i < lvt; i++) { - data = tvb_get_guint8(tvb, offset+i); - value = ((guint64)value << 8) | data; + data = tvb_get_uint8(tvb, offset+i); + value = ((uint64_t)value << 8) | data; } *val = value; } @@ -7250,19 +7282,19 @@ fSigned64(tvbuff_t *tvb, guint offset, guint32 lvt, gint64 *val) return valid; } -static guint +static unsigned fTagHeaderTree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - guint offset, guint8 *tag_no, guint8* tag_info, guint32 *lvt) + unsigned offset, uint8_t *tag_no, uint8_t* tag_info, uint32_t *lvt) { proto_item *ti = NULL; - guint8 tag; - guint8 value; - guint tag_len = 1; - guint lvt_len = 1; /* used for tree display of lvt */ - guint lvt_offset; /* used for tree display of lvt */ + uint8_t tag; + uint8_t value; + unsigned tag_len = 1; + unsigned lvt_len = 1; /* used for tree display of lvt */ + unsigned lvt_offset; /* used for tree display of lvt */ lvt_offset = offset; - tag = tvb_get_guint8(tvb, offset); + tag = tvb_get_uint8(tvb, offset); *tag_info = 0; *lvt = tag & 0x07; @@ -7272,11 +7304,11 @@ fTagHeaderTree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tag_is_context_specific(tag)) *tag_info = tag & 0x0F; *tag_no = tag >> 4; if (tag_is_extended_tag_number(tag)) { - *tag_no = tvb_get_guint8(tvb, offset + tag_len++); + *tag_no = tvb_get_uint8(tvb, offset + tag_len++); } if (tag_is_extended_value(tag)) { /* length is more than 4 Bytes */ lvt_offset += tag_len; - value = tvb_get_guint8(tvb, lvt_offset); + value = tvb_get_uint8(tvb, lvt_offset); tag_len++; if (value == 254) { /* length is encoded with 16 Bits */ *lvt = tvb_get_ntohs(tvb, lvt_offset+1); @@ -7356,18 +7388,18 @@ fTagHeaderTree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return tag_len; } -static guint -fTagHeader(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint8 *tag_no, guint8* tag_info, - guint32 *lvt) +static unsigned +fTagHeader(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, uint8_t *tag_no, uint8_t* tag_info, + uint32_t *lvt) { return fTagHeaderTree(tvb, pinfo, NULL, offset, tag_no, tag_info, lvt); } -static guint -fNullTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fNullTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree; subtree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_bacapp_tag, NULL, "%sNULL", label); @@ -7376,17 +7408,17 @@ fNullTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, cons return offset + 1; } -static guint -fBooleanTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fBooleanTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint8 tag_no, tag_info; - guint32 lvt = 0; + uint8_t tag_no, tag_info; + uint32_t lvt = 0; proto_tree *subtree; - guint bool_len = 1; + unsigned bool_len = 1; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (tag_info && lvt == 1) { - lvt = tvb_get_guint8(tvb, offset+1); + lvt = tvb_get_uint8(tvb, offset+1); ++bool_len; } @@ -7397,13 +7429,13 @@ fBooleanTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, c return offset + bool_len; } -static guint -fUnsignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fUnsignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint64 val = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint64_t val = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -7419,12 +7451,12 @@ fUnsignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, return offset+tag_len+lvt; } -static guint -fDevice_Instance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, int hf) +static unsigned +fDevice_Instance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, int hf) { - guint8 tag_no, tag_info; - guint32 lvt, safe_lvt; - guint tag_len; + uint8_t tag_no, tag_info; + uint32_t lvt, safe_lvt; + unsigned tag_len; proto_item *ti; proto_tree *subtree; @@ -7448,14 +7480,14 @@ fDevice_Instance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs } /* set split_val to zero when not needed */ -static guint +static unsigned fEnumeratedTagSplit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - guint offset, const gchar *label, const value_string *vs, guint32 split_val) + unsigned offset, const char *label, const value_string *vs, uint32_t split_val) { - guint32 val = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint32_t val = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -7478,20 +7510,20 @@ fEnumeratedTagSplit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return offset+tag_len+lvt; } -static guint +static unsigned fEnumeratedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - guint offset, const gchar *label, const value_string *vs) + unsigned offset, const char *label, const value_string *vs) { return fEnumeratedTagSplit(tvb, pinfo, tree, offset, label, vs, 0); } -static guint -fSignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fSignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - gint64 val = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + int64_t val = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -7506,13 +7538,13 @@ fSignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, co return offset+tag_len+lvt; } -static guint -fRealTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fRealTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; - gfloat f_val; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; + float f_val; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -7524,13 +7556,13 @@ fRealTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, cons return offset+tag_len+4; } -static guint -fDoubleTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fDoubleTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; - gdouble d_val; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; + double d_val; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -7542,14 +7574,14 @@ fDoubleTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, co return offset+tag_len+8; } -static guint -fProcessId(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fProcessId(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0, lvt; - guint8 tag_no, tag_info; + uint32_t val = 0, lvt; + uint8_t tag_no, tag_info; proto_item *ti; proto_tree *subtree; - guint tag_len; + unsigned tag_len; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset+tag_len, lvt, &val)) @@ -7569,25 +7601,25 @@ fProcessId(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const value_string *vs, guint32 split_val, BacappPresentValueType type) +static unsigned +fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const value_string *vs, uint32_t split_val, BacappPresentValueType type) { // tag vars - guint32 lvt; - guint8 tag_no, tag_info; - guint tag_len; - guint curr_offset = offset; + uint32_t lvt; + uint8_t tag_no, tag_info; + unsigned tag_len; + unsigned curr_offset = offset; // tree vars proto_item *tree_item = NULL; proto_tree *subtree = NULL; // dissection vars - guint bool_len = 1; - guint64 unsigned_val = 0; - gint64 signed_val = 0; - gfloat float_val; - gdouble double_val; - guint32 enum_index = 0; - guint32 object_id; + unsigned bool_len = 1; + uint64_t unsigned_val = 0; + int64_t signed_val = 0; + float float_val; + double double_val; + uint32_t enum_index = 0; + uint32_t object_id; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); switch(type) { @@ -7597,7 +7629,7 @@ fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, break; case BACAPP_PRESENT_VALUE_BOOL: if (tag_info && lvt == 1) { - lvt = tvb_get_guint8(tvb, offset+1); + lvt = tvb_get_uint8(tvb, offset+1); bool_len++; } tree_item = proto_tree_add_boolean(tree, hf_bacapp_present_value_bool, tvb, offset, bool_len, lvt); @@ -7615,7 +7647,7 @@ fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, break; case BACAPP_PRESENT_VALUE_REAL: float_val = tvb_get_ntohieee_float(tvb, offset+tag_len); - double_val = (gdouble) float_val; + double_val = (double) float_val; tree_item = proto_tree_add_double(tree, hf_bacapp_present_value_real, tvb, offset, lvt+tag_len, double_val); curr_offset += tag_len + lvt; break; @@ -7630,10 +7662,10 @@ fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, curr_offset += tag_len + lvt; break; case BACAPP_PRESENT_VALUE_CHARACTER_STRING: - curr_offset = fCharacterStringBase(tvb, pinfo, tree, offset, NULL, TRUE, FALSE); + curr_offset = fCharacterStringBase(tvb, pinfo, tree, offset, NULL, true, false); break; case BACAPP_PRESENT_VALUE_BIT_STRING: - curr_offset = fBitStringTagVSBase(tvb, pinfo, tree, offset, NULL, NULL, TRUE); + curr_offset = fBitStringTagVSBase(tvb, pinfo, tree, offset, NULL, NULL, true); break; case BACAPP_PRESENT_VALUE_ENUM: if (fUnsigned32(tvb, offset+tag_len, lvt, &enum_index)) { @@ -7686,14 +7718,14 @@ fPresentValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, return curr_offset; } -static guint -fEventType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fEventType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0, lvt; - guint8 tag_no, tag_info; + uint32_t val = 0, lvt; + uint8_t tag_no, tag_info; proto_item *ti; proto_tree *subtree; - guint tag_len; + unsigned tag_len; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset+tag_len, lvt, &val)) @@ -7713,14 +7745,14 @@ fEventType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fNotifyType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fNotifyType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0, lvt; - guint8 tag_no, tag_info; + uint32_t val = 0, lvt; + uint8_t tag_no, tag_info; proto_item *ti; proto_tree *subtree; - guint tag_len; + unsigned tag_len; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset+tag_len, lvt, &val)) @@ -7740,14 +7772,14 @@ fNotifyType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fToState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fToState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0, lvt; - guint8 tag_no, tag_info; + uint32_t val = 0, lvt; + uint8_t tag_no, tag_info; proto_item *ti; proto_tree *subtree; - guint tag_len; + unsigned tag_len; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset+tag_len, lvt, &val)) @@ -7767,14 +7799,14 @@ fToState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fFromState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fFromState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0, lvt; - guint8 tag_no, tag_info; + uint32_t val = 0, lvt; + uint8_t tag_no, tag_info; proto_item *ti; proto_tree *subtree; - guint tag_len; + unsigned tag_len; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset+tag_len, lvt, &val)) @@ -7794,13 +7826,13 @@ fFromState(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fTimeSpan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fTimeSpan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint32 val = 0, lvt; - guint8 tag_no, tag_info; + uint32_t val = 0, lvt; + uint8_t tag_no, tag_info; proto_tree *subtree; - guint tag_len; + unsigned tag_len; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset+tag_len, lvt, &val)) @@ -7819,19 +7851,19 @@ fTimeSpan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, con return offset+tag_len+lvt; } -static guint -fWeekNDay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fWeekNDay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 month, weekOfMonth, dayOfWeek; - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint32_t month, weekOfMonth, dayOfWeek; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); - month = tvb_get_guint8(tvb, offset+tag_len); - weekOfMonth = tvb_get_guint8(tvb, offset+tag_len+1); - dayOfWeek = tvb_get_guint8(tvb, offset+tag_len+2); + month = tvb_get_uint8(tvb, offset+tag_len); + weekOfMonth = tvb_get_uint8(tvb, offset+tag_len+1); + dayOfWeek = tvb_get_uint8(tvb, offset+tag_len+2); subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, ett_bacapp_tag, NULL, "%s %s, %s", val_to_str(month, months, "month (%d) not found"), @@ -7842,20 +7874,20 @@ fWeekNDay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset+tag_len+lvt; } -static guint -fDate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fDate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint32 year, month, day, weekday; - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint32_t year, month, day, weekday; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); - year = tvb_get_guint8(tvb, offset+tag_len); - month = tvb_get_guint8(tvb, offset+tag_len+1); - day = tvb_get_guint8(tvb, offset+tag_len+2); - weekday = tvb_get_guint8(tvb, offset+tag_len+3); + year = tvb_get_uint8(tvb, offset+tag_len); + month = tvb_get_uint8(tvb, offset+tag_len+1); + day = tvb_get_uint8(tvb, offset+tag_len+2); + weekday = tvb_get_uint8(tvb, offset+tag_len+3); if ((year == 255) && (day == 255) && (month == 255) && (weekday == 255)) { subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, ett_bacapp_tag, NULL, @@ -7884,19 +7916,19 @@ fDate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const g return offset+tag_len+lvt; } -static guint -fTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint32 hour, minute, second, msec, lvt; - guint8 tag_no, tag_info; - guint tag_len; + uint32_t hour, minute, second, msec, lvt; + uint8_t tag_no, tag_info; + unsigned tag_len; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); - hour = tvb_get_guint8(tvb, offset+tag_len); - minute = tvb_get_guint8(tvb, offset+tag_len+1); - second = tvb_get_guint8(tvb, offset+tag_len+2); - msec = tvb_get_guint8(tvb, offset+tag_len+3); + hour = tvb_get_uint8(tvb, offset+tag_len); + minute = tvb_get_uint8(tvb, offset+tag_len+1); + second = tvb_get_uint8(tvb, offset+tag_len+2); + msec = tvb_get_uint8(tvb, offset+tag_len+3); if ((hour == 255) && (minute == 255) && (second == 255) && (msec == 255)) subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, ett_bacapp_tag, NULL, @@ -7915,8 +7947,8 @@ fTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const g return offset+tag_len+lvt; } -static guint -fDateTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fDateTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { proto_tree *subtree = tree; @@ -7927,12 +7959,12 @@ fDateTime(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, con return fTime(tvb, pinfo, subtree, offset, "Time: "); } -static guint -fTimeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fTimeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -7948,11 +7980,11 @@ fTimeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fCalendarEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fCalendarEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; switch (fTagNo(tvb, offset)) { case 0: /* Date */ @@ -7973,10 +8005,10 @@ fCalendarEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset return offset; } -static guint -fEventTimeStamps( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fEventTimeStamps( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 lvt = 0; + uint32_t lvt = 0; proto_tree* subtree = tree; if (tvb_reported_length_remaining(tvb, offset) > 0) { @@ -7989,11 +8021,11 @@ fEventTimeStamps( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off return offset; } -static guint -fTimeStamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fTimeStamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint8 tag_no = 0, tag_info = 0; - guint32 lvt = 0; + uint8_t tag_no = 0, tag_info = 0; + uint32_t lvt = 0; if (tvb_reported_length_remaining(tvb, offset) > 0) { /* don't loop, it's a CHOICE */ switch (fTagNo(tvb, offset)) { @@ -8018,8 +8050,8 @@ fTimeStamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, co } -static guint -fClientCOV(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fClientCOV(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { if (tvb_reported_length_remaining(tvb, offset) > 0) { offset = fApplicationTypes(tvb, pinfo, tree, offset, "increment: "); @@ -8039,8 +8071,8 @@ BACnetDaysOfWeek [] = { { 0, NULL } }; -static guint -fDestination(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fDestination(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { if (tvb_reported_length_remaining(tvb, offset) > 0) { offset = fApplicationTypesEnumerated(tvb, pinfo, tree, offset, @@ -8058,12 +8090,12 @@ fDestination(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) } -static guint -fOctetString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, guint32 lvt) +static unsigned +fOctetString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, uint32_t lvt) { - gchar *tmp; - guint start = offset; - guint8 tag_no, tag_info; + char *tmp; + unsigned start = offset; + uint8_t tag_no, tag_info; proto_tree *subtree = tree; offset += fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -8080,11 +8112,11 @@ fOctetString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, return offset; } -static guint -fMacAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, guint32 lvt) +static unsigned +fMacAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, uint32_t lvt) { - guint start = offset; - guint8 tag_no, tag_info; + unsigned start = offset; + uint8_t tag_no, tag_info; proto_tree* subtree = tree; offset += fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -8109,12 +8141,12 @@ fMacAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, c return offset; } -static guint -fAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint offs; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned offs; offset = fUnsignedTag(tvb, pinfo, tree, offset, "network-number"); offs = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -8127,21 +8159,21 @@ fAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fSessionKey(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSessionKey(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { offset = fOctetString(tvb, pinfo, tree, offset, "session key: ", 8); return fAddress(tvb, pinfo, tree, offset); } -static guint -fObjectIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fObjectIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_length; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_length; proto_tree *subtree; - guint32 object_id; + uint32_t object_id; tag_length = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); object_id = tvb_get_ntohl(tvb, offset+tag_length); @@ -8184,17 +8216,17 @@ fObjectIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off return offset; } -static guint -fObjectName(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fObjectName(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - return fCharacterStringBase(tvb, pinfo, tree, offset, "Object Name", FALSE, TRUE); + return fCharacterStringBase(tvb, pinfo, tree, offset, "Object Name", false, true); } -static guint -fRecipient(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fRecipient(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (tag_no < 2) { @@ -8210,12 +8242,12 @@ fRecipient(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fRecipientProcess(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fRecipientProcess(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *orgtree = tree; proto_tree *subtree; @@ -8244,15 +8276,15 @@ fRecipientProcess(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off return offset; } -static guint -fCOVSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fCOVSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree; proto_tree *orgtree = tree; - guint itemno = 1; + unsigned itemno = 1; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -8298,19 +8330,20 @@ fCOVSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs return offset; } -static guint -fAddressBinding(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAddressBinding(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { offset = fObjectIdentifier(tvb, pinfo, tree, offset, "DeviceIdentifier: "); return fAddress(tvb, pinfo, tree, offset); } -static guint -fActionCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tag_match) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fActionCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t tag_match) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; /* set the optional global properties to indicate not-used */ @@ -8369,12 +8402,13 @@ fActionCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset action [0] SEQUENCE OF BACnetActionCommand } */ -static guint -fActionList(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fActionList(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { @@ -8406,15 +8440,16 @@ fActionList(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fPropertyAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fPropertyAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint32 save_object_type; - guint32 save_inner_object_type; - gint32 save_propertyIdentifier; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + uint32_t save_object_type; + uint32_t save_inner_object_type; + int32_t save_propertyIdentifier; /* save the external entry data because it might get overwritten here */ save_object_type = object_type; @@ -8479,19 +8514,19 @@ fPropertyAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fPropertyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fPropertyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_tree *subtree; - const gchar *label = "Property Identifier"; + static const char *label = "Property Identifier"; propertyIdentifier = 0; /* global Variable */ tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); /* can we decode this value? */ - if (fUnsigned32(tvb, offset+tag_len, lvt, (guint32 *)&propertyIdentifier)) { + if (fUnsigned32(tvb, offset+tag_len, lvt, (uint32_t *)&propertyIdentifier)) { subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, ett_bacapp_tag, NULL, "%s: %s (%u)", label, @@ -8516,16 +8551,16 @@ fPropertyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o return offset+tag_len+lvt; } -static guint -fPropertyArrayIndex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fPropertyArrayIndex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_tree *subtree; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); - if (fUnsigned32(tvb, offset + tag_len, lvt, (guint32 *)&propertyArrayIndex)) + if (fUnsigned32(tvb, offset + tag_len, lvt, (uint32_t *)&propertyArrayIndex)) subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, ett_bacapp_tag, NULL, "property Array Index (Unsigned) %u", propertyArrayIndex); else @@ -8536,11 +8571,11 @@ fPropertyArrayIndex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o return offset+tag_len+lvt; } -static guint -fChannelValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fChannelValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; if (tvb_reported_length_remaining(tvb, offset) > 0) { fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -8568,29 +8603,29 @@ fChannelValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, return offset; } -static guint -fCharacterString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fCharacterString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - return fCharacterStringBase(tvb, pinfo, tree, offset, label, FALSE, FALSE); + return fCharacterStringBase(tvb, pinfo, tree, offset, label, false, false); } -static guint -fCharacterStringBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, gboolean present_val_dissect, gboolean object_name_dissect) +static unsigned +fCharacterStringBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, bool present_val_dissect, bool object_name_dissect) { - guint8 tag_no, tag_info, character_set; - guint32 lvt, l; - guint offs; + uint8_t tag_no, tag_info, character_set; + uint32_t lvt, l; + unsigned offs; const char *coding; - guint8 *out; + uint8_t *out; proto_tree *subtree; - guint start = offset; + unsigned start = offset; if (tvb_reported_length_remaining(tvb, offset) > 0) { offs = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); offset += offs; - character_set = tvb_get_guint8(tvb, offset); + character_set = tvb_get_uint8(tvb, offset); offset++; lvt--; @@ -8674,10 +8709,10 @@ fCharacterStringBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint if (present_val_dissect) { subtree = proto_tree_add_subtree(tree, tvb, offset, l, ett_bacapp_tag, NULL, "present-value"); - proto_tree_add_string(subtree, hf_bacapp_present_value_char_string, tvb, offset, l, (const gchar*) out); + proto_tree_add_string(subtree, hf_bacapp_present_value_char_string, tvb, offset, l, (const char*) out); } else if (object_name_dissect) { subtree = proto_tree_add_subtree(tree, tvb, offset, l, ett_bacapp_tag, NULL, label); - proto_tree_add_string(subtree, hf_bacapp_object_name, tvb, offset, l, (const gchar*) out); + proto_tree_add_string(subtree, hf_bacapp_object_name, tvb, offset, l, (const char*) out); } else { subtree = proto_tree_add_subtree_format(tree, tvb, offset, l, ett_bacapp_tag, NULL, "%s%s '%s'", label, coding, out); @@ -8698,34 +8733,34 @@ fCharacterStringBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fBitStringTagVS(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, +static unsigned +fBitStringTagVS(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, const value_string *src) { - return fBitStringTagVSBase(tvb, pinfo, tree, offset, label, src, FALSE); + return fBitStringTagVSBase(tvb, pinfo, tree, offset, label, src, false); } -static guint -fBitStringTagVSBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, - const value_string *src, gboolean present_val_dissect) +static unsigned +fBitStringTagVSBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, + const value_string *src, bool present_val_dissect) { - guint8 tag_no, tag_info, tmp; - gint j, unused, skip; - guint start = offset; - guint offs; - guint32 lvt, i, numberOfBytes; + uint8_t tag_no, tag_info, tmp; + int j, unused, skip; + unsigned start = offset; + unsigned offs; + uint32_t lvt, i, numberOfBytes; char bf_arr[256 + 1]; proto_tree *subtree = tree; offs = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); numberOfBytes = lvt-1; /* Ignore byte for unused bit count */ offset += offs; - unused = tvb_get_guint8(tvb, offset); /* get the unused Bits */ + unused = tvb_get_uint8(tvb, offset); /* get the unused Bits */ memset(bf_arr, 0, sizeof(bf_arr)); skip = 0; for (i = 0; i < numberOfBytes; i++) { - tmp = tvb_get_guint8(tvb, (offset)+i + 1); + tmp = tvb_get_uint8(tvb, (offset)+i + 1); if (i == numberOfBytes - 1) { skip = unused; } for (j = 0; j < 8 - skip; j++) { bf_arr[MIN(sizeof(bf_arr) - 2, (i * 8) + j)] = tmp & (1 << (7 - j)) ? 'T' : 'F'; @@ -8747,13 +8782,13 @@ fBitStringTagVSBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o memset(bf_arr, 0, sizeof(bf_arr)); skip = 0; for (i = 0; i < numberOfBytes; i++) { - tmp = tvb_get_guint8(tvb, (offset)+i+1); + tmp = tvb_get_uint8(tvb, (offset)+i+1); if (i == numberOfBytes-1) { skip = unused; } for (j = 0; j < 8-skip; j++) { if (src != NULL) { proto_tree_add_boolean_format(subtree, hf_bacapp_bit, tvb, offset+i+1, 1, (tmp & (1 << (7 - j))), "%s = %s", - val_to_str((guint) (i*8 +j), src, ASHRAE_Reserved_Fmt), + val_to_str((unsigned) (i*8 +j), src, ASHRAE_Reserved_Fmt), (tmp & (1 << (7 - j))) ? "TRUE" : "FALSE"); } else { bf_arr[MIN(255, (i*8)+j)] = tmp & (1 << (7 - j)) ? '1' : '0'; @@ -8771,21 +8806,21 @@ fBitStringTagVSBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o return offset; } -static guint -fBitStringTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fBitStringTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { return fBitStringTagVS(tvb, pinfo, tree, offset, label, NULL); } /* handles generic application types, as well as enumerated and enumerations with reserved and proprietarty ranges (split) */ -static guint -fApplicationTypesEnumeratedSplit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, - const gchar *label, const value_string *src, guint32 split_val) +static unsigned +fApplicationTypesEnumeratedSplit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, + const char *label, const value_string *src, uint32_t split_val) { - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; if (tvb_reported_length_remaining(tvb, offset) > 0) { tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -8844,10 +8879,10 @@ fApplicationTypesEnumeratedSplit(tvbuff_t *tvb, packet_info *pinfo, proto_tree * return offset; } -static guint -fShedLevel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fShedLevel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -8870,34 +8905,34 @@ fShedLevel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fApplicationTypesEnumerated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, - const gchar *label, const value_string *vs) +static unsigned +fApplicationTypesEnumerated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, + const char *label, const value_string *vs) { return fApplicationTypesEnumeratedSplit(tvb, pinfo, tree, offset, label, vs, 0); } -static guint -fApplicationTypes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, - const gchar *label) +static unsigned +fApplicationTypes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, + const char *label) { return fApplicationTypesEnumeratedSplit(tvb, pinfo, tree, offset, label, NULL, 0); } -static guint -fContextTaggedValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fContextTaggedValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_tree *subtree; - gint tvb_len; + int tvb_len; (void)label; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); /* cap the the suggested length in case of bad data */ tvb_len = tvb_reported_length_remaining(tvb, offset+tag_len); - if ((tvb_len >= 0) && ((guint32)tvb_len < lvt)) { + if ((tvb_len >= 0) && ((uint32_t)tvb_len < lvt)) { lvt = tvb_len; } subtree = proto_tree_add_subtree_format(tree, tvb, offset+tag_len, lvt, @@ -8913,12 +8948,12 @@ BACnetPrescale ::= SEQUENCE { moduloDivide [1] Unsigned } */ -static guint -fPrescale(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fPrescale(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -8947,12 +8982,12 @@ BACnetScale ::= CHOICE { integerScale [1] INTEGER } */ -static guint -fScale(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fScale(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -8988,12 +9023,12 @@ BACnetAccumulatorRecord ::= SEQUENCE { } } */ -static guint -fLoggingRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fLoggingRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -9027,12 +9062,12 @@ fLoggingRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset /* SEQ OF Any enumeration (current usage is SEQ OF BACnetDoorAlarmState */ -static guint -fSequenceOfEnums(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label, const value_string *vs) +static unsigned +fSequenceOfEnums(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label, const value_string *vs) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -9050,12 +9085,12 @@ fSequenceOfEnums(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs SEQ OF BACnetDeviceObjectReference (accessed as an array) } */ -static guint -fDoorMembers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fDoorMembers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -9072,12 +9107,12 @@ fDoorMembers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) /* SEQ OF ReadAccessSpecification */ -static guint -fListOfGroupMembers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fListOfGroupMembers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -9091,15 +9126,16 @@ fListOfGroupMembers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o return offset; } -static guint -fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0, depth = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0, depth = 0; char ar[256]; - guint32 save_object_type; - gboolean do_default_handling; + uint32_t save_object_type; + bool do_default_handling; if (propertyIdentifier >= 0) { snprintf(ar, sizeof(ar), "%s: ", @@ -9112,11 +9148,11 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint } unsigned recursion_depth = p_get_proto_depth(pinfo, proto_bacapp); - if (++recursion_depth >= BACAPP_MAX_RECURSION_DEPTH) { + if (recursion_depth > BACAPP_MAX_RECURSION_DEPTH) { proto_tree_add_expert(tree, pinfo, &ei_bacapp_max_recursion_depth_reached, tvb, 0, 0); return offset; } - p_set_proto_depth(pinfo, proto_bacapp, recursion_depth); + p_set_proto_depth(pinfo, proto_bacapp, recursion_depth + 1); while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -9127,7 +9163,7 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint } } - do_default_handling = FALSE; + do_default_handling = false; /* Application Tags */ switch (propertyIdentifier) { @@ -9433,6 +9469,8 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset = fXyColor(tvb, pinfo, tree, offset, ar); else if (object_type == 64) /* color-temperature */ offset = fUnsignedTag(tvb, pinfo, tree, offset, ar); + else if (object_type == 54) /* lighting-output */ + offset = fRealTag(tvb, pinfo, tree, offset, ar); break; case 166: /* life-safety-alarm-values */ offset = fApplicationTypesEnumerated(tvb, pinfo, tree, offset, ar, BACnetLifeSafetyState); @@ -9447,7 +9485,7 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset = fScale(tvb, pinfo, tree, offset); break; case 189: /* update-time */ - if (object_type == 37) + if (object_type == 37) /* credential-data-input */ offset = fTimeStamp(tvb, pinfo, tree, offset, ar); else offset = fDateTime(tvb, pinfo, tree, offset, ar); @@ -9514,7 +9552,7 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint case 302: /* positive-access-rules */ offset = fAccessRule(tvb, pinfo, tree, offset); break; - case 304: /* suppoprted-formats */ + case 304: /* supported-formats */ offset = fAuthenticationFactorFormat(tvb, pinfo, tree, offset); break; case 327: /* base-device-security-policy */ @@ -9846,12 +9884,12 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset = fPresentValue(tvb, pinfo, tree, offset, NULL, 0, (BacappPresentValueType) tag_no); } } else { - do_default_handling = TRUE; + do_default_handling = true; } } break; default: - do_default_handling = TRUE; + do_default_handling = true; break; } if (do_default_handling) { @@ -9874,15 +9912,16 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint cleanup: recursion_depth = p_get_proto_depth(pinfo, proto_bacapp); - p_set_proto_depth(pinfo, proto_bacapp, recursion_depth - 1); + p_set_proto_depth(pinfo, proto_bacapp, recursion_depth); return offset; } -static guint -fPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tag_info) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t tag_info) { - guint8 tag_no; - guint32 lvt; + uint8_t tag_no; + uint32_t lvt; if (tag_is_opening(tag_info)) { offset += fTagHeaderTree(tvb, pinfo, tree, offset, @@ -9901,12 +9940,13 @@ fPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset } -static guint -fPropertyIdentifierValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tagoffset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fPropertyIdentifierValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t tagoffset) { - guint lastoffset = offset; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = offset; + uint8_t tag_no, tag_info; + uint32_t lvt; offset = fPropertyReference(tvb, pinfo, tree, offset, tagoffset, 0); if (offset > lastoffset) { @@ -9918,12 +9958,13 @@ fPropertyIdentifierValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu return offset; } -static guint -fBACnetPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fBACnetPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -9940,12 +9981,12 @@ fBACnetPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fSubscribeCOVPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSubscribeCOVPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -9991,12 +10032,12 @@ fSubscribeCOVPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree return offset; } -static guint -fSubscribeCOVPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSubscribeCOVPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; proto_tree *subsubtree = tree; @@ -10100,12 +10141,12 @@ fSubscribeCOVPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tr return offset; } -static guint -fSubscribeCOVPropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSubscribeCOVPropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -10168,16 +10209,16 @@ fSubscribeCOVPropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree return offset; } -static guint -fSubscribeCOVRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSubscribeCOVRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fSubscribeCOVPropertyRequest(tvb, pinfo, tree, offset); } -static guint -fWhoHas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fWhoHas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -10204,12 +10245,12 @@ fWhoHas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) } -static guint -fDailySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset) +static unsigned +fDailySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (tag_is_opening(tag_info) && tag_no == 0) { @@ -10246,12 +10287,12 @@ fDailySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint off * @param offset the offset in the tvb * @return modified offset */ -static guint -fHealth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fHealth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -10303,12 +10344,12 @@ fHealth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) * @param offset the offset in the tvb * @return modified offset */ -static guint -fSCDirectConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSCDirectConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -10326,7 +10367,7 @@ fSCDirectConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o break; case 2: /* connect-timestamp */ offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); - offset = fDateTime(tvb, pinfo, tree, offset, "connet-timestamp: "); + offset = fDateTime(tvb, pinfo, tree, offset, "connect-timestamp: "); offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; case 3: /* disconnect-timestamp */ @@ -10376,12 +10417,12 @@ fSCDirectConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @param offset the offset in the tvb * @return modified offset */ -static guint -fSCFailedConnectionRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSCFailedConnectionRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -10393,7 +10434,7 @@ fSCFailedConnectionRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, switch (tag_no) { case 0: /* timestamp */ offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); - offset = fDateTime(tvb, pinfo, tree, offset, "connet-timestamp: "); + offset = fDateTime(tvb, pinfo, tree, offset, "connect-timestamp: "); offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; case 1: /* peer-address */ @@ -10437,12 +10478,12 @@ fSCFailedConnectionRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @param offset the offset in the tvb * @return modified offset */ -static guint -fSCHubConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSCHubConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -10457,7 +10498,7 @@ fSCHubConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs break; case 1: /* connect-timestamp */ offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); - offset = fDateTime(tvb, pinfo, tree, offset, "connet-timestamp: "); + offset = fDateTime(tvb, pinfo, tree, offset, "connect-timestamp: "); offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; case 2: /* disconnect-timestamp */ @@ -10498,12 +10539,12 @@ fSCHubConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs * @param offset the offset in the tvb * @return modified offset */ -static guint -fSCHubFunctionConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSCHubFunctionConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -10518,7 +10559,7 @@ fSCHubFunctionConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu break; case 1: /* connect-timestamp */ offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); - offset = fDateTime(tvb, pinfo, tree, offset, "connet-timestamp: "); + offset = fDateTime(tvb, pinfo, tree, offset, "connect-timestamp: "); offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; case 2: /* disconnect-timestamp */ @@ -10553,13 +10594,13 @@ fSCHubFunctionConnection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu return offset; } -static guint -fWeeklySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fWeeklySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint i = 1; /* day of week array index */ + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned i = 1; /* day of week array index */ proto_tree *subtree = tree; if (propertyArrayIndex > 0) { @@ -10587,8 +10628,8 @@ fWeeklySchedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse } -static guint -fUTCTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fUTCTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { if (tvb_reported_length_remaining(tvb, offset) <= 0) return offset; @@ -10596,8 +10637,8 @@ fUTCTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr return fDateTime(tvb, pinfo, tree, offset, "UTC-Time: "); } -static guint -fTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { if (tvb_reported_length_remaining(tvb, offset) <= 0) return offset; @@ -10605,12 +10646,12 @@ fTimeSynchronizationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return fDateTime(tvb, pinfo, tree, offset, NULL); } -static guint -fWriteGroupRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fWriteGroupRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -10685,8 +10726,8 @@ fWriteGroupRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of return offset; } -static guint -fDateRange(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fDateRange(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { if (tvb_reported_length_remaining(tvb, offset) <= 0) return offset; @@ -10694,16 +10735,16 @@ fDateRange(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return fDate(tvb, pinfo, tree, offset, "End Date: "); } -static guint -fVendorIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fVendorIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint32_t val = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_item *ti; proto_tree *subtree; - const gchar *label = "Vendor ID"; + static const char *label = "Vendor ID"; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset + tag_len, lvt, &val)) @@ -10729,16 +10770,16 @@ fVendorIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off return offset+tag_len+lvt; } -static guint -fRestartReason(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fRestartReason(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint tag_len; + uint32_t val = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned tag_len; proto_item *ti; proto_tree *subtree; - const gchar *label = "Restart Reason"; + static const char *label = "Restart Reason"; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset + tag_len, lvt, &val)) @@ -10762,12 +10803,12 @@ fRestartReason(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset return offset+tag_len+lvt; } -static guint -fConfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fConfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -10802,22 +10843,22 @@ fConfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree return offset; } -static guint -fUnconfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fUnconfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fConfirmedTextMessageRequest(tvb, pinfo, tree, offset); } -static guint -fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; tvbuff_t *next_tvb; - guint vendor_identifier = 0; - guint service_number = 0; + unsigned vendor_identifier = 0; + unsigned service_number = 0; len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); fUnsigned32(tvb, offset+len, lvt, &vendor_identifier); @@ -10874,24 +10915,24 @@ fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree * return offset; } -static guint -fUnconfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fUnconfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fConfirmedPrivateTransferRequest(tvb, pinfo, tree, offset); } -static guint -fConfirmedPrivateTransferAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fConfirmedPrivateTransferAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fConfirmedPrivateTransferRequest(tvb, pinfo, tree, offset); } -static guint -fLifeSafetyOperationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label) +static unsigned +fLifeSafetyOperationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *label) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; if (label != NULL) { @@ -10925,7 +10966,7 @@ fLifeSafetyOperationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } typedef struct _value_string_enum { - guint8 tag_no; + uint8_t tag_no; const value_string *valstr; } value_string_enum; @@ -10988,16 +11029,15 @@ BACnetPropertyStatesEnums[] = { { 59, BACnetAuditLevel }, { 60, BACnetAuditOperation } }; -#define BACnetPropertyStatesEnums_Size \ - (sizeof(BACnetPropertyStatesEnums) / sizeof(BACnetPropertyStatesEnums[0])) +#define BACnetPropertyStatesEnums_Size array_length(BACnetPropertyStatesEnums) -static guint -fBACnetPropertyStates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fBACnetPropertyStates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint32 idx; - const gchar* label; + uint8_t tag_no, tag_info; + uint32_t lvt; + uint32_t idx; + const char* label; const value_string_enum* valstrenum; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -11054,12 +11094,13 @@ BACnetDeviceObjectPropertyValue ::= SEQUENCE { value [4] ABSTRACT-SYNTAX.&Type } */ -static guint -fDeviceObjectPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fDeviceObjectPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -11105,8 +11146,8 @@ BACnetDeviceObjectPropertyReference ::= SEQUENCE { deviceIdentifier [3] BACnetObjectIdentifier OPTIONAL } */ -static guint -fObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fDeviceObjectPropertyReference(tvb, pinfo, tree, offset); } @@ -11121,12 +11162,13 @@ BACnetDeviceObjectPropertyReference ::= SEQUENCE { deviceIdentifier [3] BACnetObjectIdentifier OPTIONAL } */ -static guint -fDeviceObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fDeviceObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -11157,12 +11199,13 @@ fDeviceObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr return offset; } -static guint -fNotificationParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fNotificationParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = offset; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = offset; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; proto_tree *pvtree; @@ -11396,7 +11439,7 @@ fNotificationParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui offset += fTagHeaderTree(tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt); while (tvb_reported_length_remaining(tvb, offset) > 0) { - const guint param_lastoffset = offset; + const unsigned param_lastoffset = offset; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (tag_is_closing(tag_info)) { @@ -11744,12 +11787,13 @@ fNotificationParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui return offset; } -static guint -fEventParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fEventParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = offset; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = offset; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -12246,12 +12290,12 @@ fEventParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse return offset; } -static guint -fFaultParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fFaultParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = offset; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = offset; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -12420,14 +12464,14 @@ fFaultParameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse return offset; } -static guint -fEventNotificationSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fEventNotificationSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree; - guint itemno = 1; + unsigned itemno = 1; while (tvb_reported_length_remaining(tvb, offset) > 0 && offset > lastoffset) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -12464,12 +12508,12 @@ fEventNotificationSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr return offset; } -static guint -fLightingCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *lable) +static unsigned +fLightingCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *lable) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; subtree = proto_tree_add_subtree_format(subtree, tvb, offset, 0, @@ -12509,12 +12553,12 @@ fLightingCommand(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs return offset; } -static guint -fColorCommand(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint offset, const gchar* lable) +static unsigned +fColorCommand(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, unsigned offset, const char* lable) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree* subtree = tree; subtree = proto_tree_add_subtree_format(subtree, tvb, offset, 0, @@ -12556,8 +12600,8 @@ fColorCommand(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint offset, return offset; } -static guint -fXyColor(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint offset, const gchar* label) +static unsigned +fXyColor(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, unsigned offset, const char* label) { proto_tree* subtree = tree; @@ -12568,13 +12612,15 @@ fXyColor(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint offset, cons return fRealTag(tvb, pinfo, subtree, offset, "y-coordinate: "); } -static guint -fTimerStateChangeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fTimerStateChangeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint ftag_offset; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + int32_t save_propertyIdentifier; + unsigned ftag_offset; while (tvb_reported_length_remaining(tvb, offset) > 0 && offset > lastoffset) { lastoffset = offset; @@ -12590,7 +12636,13 @@ fTimerStateChangeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin break; case 1: /* constructed-value */ offset += ftag_offset; - offset = fAbstractSyntaxNType(tvb, pinfo, tree, offset); + /* this ASN-1 construction may contain also an property identifier, so + save the one we have got and restore it later and invalidate current + one to avoid misinterpretations */ + save_propertyIdentifier = propertyIdentifier; + propertyIdentifier = -1; + offset = fAbstractSyntaxNType(tvb, pinfo, tree, offset); + propertyIdentifier = save_propertyIdentifier; offset += fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); break; case 2: /* date-time */ @@ -12614,11 +12666,11 @@ fTimerStateChangeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin return offset; } -static guint -fHostAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fHostAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; if (tvb_reported_length_remaining(tvb, offset) > 0) { fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -12640,12 +12692,12 @@ fHostAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fHostNPort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *lable) +static unsigned +fHostNPort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *lable) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; subtree = proto_tree_add_subtree_format(subtree, tvb, offset, 0, @@ -12675,12 +12727,12 @@ fHostNPort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, co return offset; } -static guint -fBDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *lable) +static unsigned +fBDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *lable) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; subtree = proto_tree_add_subtree_format(subtree, tvb, offset, 0, @@ -12711,12 +12763,12 @@ fBDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, con return offset; } -static guint -fFDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *lable) +static unsigned +fFDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, const char *lable) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; subtree = proto_tree_add_subtree_format(subtree, tvb, offset, 0, @@ -12748,12 +12800,12 @@ fFDTEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, con return offset; } -static guint -fRouterEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fRouterEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -12784,12 +12836,12 @@ fRouterEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fVMACEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fVMACEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -12814,11 +12866,11 @@ fVMACEntry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fValueSource(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fValueSource(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; if (tvb_reported_length_remaining(tvb, offset) > 0) { fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -12844,12 +12896,12 @@ fValueSource(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fAssignedLandingCalls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAssignedLandingCalls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); @@ -12877,12 +12929,12 @@ fAssignedLandingCalls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fLandingCallStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fLandingCallStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -12901,6 +12953,9 @@ fLandingCallStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of case 2: /* destination */ offset = fUnsignedTag(tvb, pinfo, tree, offset, "destination: "); break; + case 3: /* floor-text */ + offset = fCharacterString(tvb, pinfo, tree, offset, "floor-text: "); + break; default: return offset; } @@ -12910,12 +12965,12 @@ fLandingCallStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of return offset; } -static guint -fLandingDoorStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fLandingDoorStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); @@ -12943,12 +12998,12 @@ fLandingDoorStatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of return offset; } -static guint -fCOVMultipleSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fCOVMultipleSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -12973,6 +13028,7 @@ fCOVMultipleSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu offset = fUnsignedTag(tvb, pinfo, tree, offset, "max notification delay: "); break; case 4: /* list-of-cov-subscription-specifications */ + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; /* check the tag. A closing tag means we are done */ @@ -12985,6 +13041,7 @@ fCOVMultipleSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu offset = fObjectIdentifier(tvb, pinfo, tree, offset, "ObjectIdentifier: "); break; case 1: /* list-of-cov-references */ + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; /* check the tag. A closing tag means we are done */ @@ -13009,12 +13066,14 @@ fCOVMultipleSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu } if (offset <= lastoffset) break; /* nothing happened, exit loop */ } + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; default: return offset; } if (offset <= lastoffset) break; /* nothing happened, exit loop */ } + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; default: return offset; @@ -13025,12 +13084,12 @@ fCOVMultipleSubscription(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu return offset; } -static guint -fNameValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fNameValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; @@ -13064,12 +13123,12 @@ fNameValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fNameValueCollection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fNameValueCollection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; subtree = proto_tree_add_subtree_format(subtree, tvb, offset, 0, @@ -13092,12 +13151,12 @@ fNameValueCollection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fObjectSelector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fObjectSelector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13124,8 +13183,8 @@ fObjectSelector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse return offset; } -static guint -fStageLimitValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fStageLimitValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { if (tvb_reported_length_remaining(tvb, offset) <= 0) return offset; @@ -13139,12 +13198,12 @@ fStageLimitValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs return offset; } -static guint -fLifeSafetyInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fLifeSafetyInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13169,12 +13228,12 @@ fLifeSafetyInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse return offset; } -static guint -fAcknowledgeAlarmInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAcknowledgeAlarmInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13201,13 +13260,14 @@ fAcknowledgeAlarmInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fAuditNotificationInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fAuditNotificationInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint len, lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; - guint32 operation = 0; + unsigned len, lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + uint32_t operation = 0; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -13331,12 +13391,13 @@ fAuditNotificationInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin return offset; } -static guint -fAuditLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fAuditLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -13381,12 +13442,13 @@ fAuditLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse return offset; } -static guint -fEventLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fEventLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -13426,13 +13488,14 @@ fEventLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse return offset; } -static guint -fLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; - gint32 save_propertyIdentifier; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + int32_t save_propertyIdentifier; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13506,13 +13569,14 @@ fLogRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fLogMultipleRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fLogMultipleRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; - gint32 save_propertyIdentifier; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + int32_t save_propertyIdentifier; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13599,12 +13663,13 @@ fLogMultipleRecord(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of } -static guint -fConfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fConfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13665,18 +13730,18 @@ fConfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree return offset; } -static guint -fUnconfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fUnconfirmedEventNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fConfirmedEventNotificationRequest(tvb, pinfo, tree, offset); } -static guint -fConfirmedCOVNotificationMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fConfirmedCOVNotificationMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; proto_tree *subsubtree = tree; @@ -13787,18 +13852,18 @@ fConfirmedCOVNotificationMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, prot return offset; } -static guint -fUnconfirmedCOVNotificationMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fUnconfirmedCOVNotificationMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fConfirmedCOVNotificationMultipleRequest(tvb, pinfo, tree, offset); } -static guint -fConfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fConfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -13842,18 +13907,18 @@ fConfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree * return offset; } -static guint -fUnconfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fUnconfirmedCOVNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fConfirmedCOVNotificationRequest(tvb, pinfo, tree, offset); } -static guint -fAcknowledgeAlarmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAcknowledgeAlarmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no = 0, tag_info = 0; - guint32 lvt = 0; + unsigned lastoffset = 0; + uint8_t tag_no = 0, tag_info = 0; + uint32_t lvt = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13889,10 +13954,10 @@ fAcknowledgeAlarmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu return offset; } -static guint -fGetAlarmSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fGetAlarmSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13906,12 +13971,12 @@ fGetAlarmSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o return offset; } -static guint -fGetEnrollmentSummaryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fGetEnrollmentSummaryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13950,10 +14015,10 @@ fGetEnrollmentSummaryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree return offset; } -static guint -fGetEnrollmentSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fGetEnrollmentSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -13971,8 +14036,8 @@ fGetEnrollmentSummaryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu return offset; } -static guint -fGetEventInformationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fGetEventInformationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { if (tvb_reported_length_remaining(tvb, offset) > 0) { if (fTagNo(tvb, offset) == 0) { @@ -13982,12 +14047,12 @@ fGetEventInformationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return offset; } -static guint -flistOfEventSummaries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +flistOfEventSummaries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree* subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -14040,14 +14105,14 @@ flistOfEventSummaries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fLOPR(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fLOPR(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -14061,12 +14126,12 @@ fLOPR(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fGetEventInformationACK(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fGetEventInformationACK(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14087,15 +14152,15 @@ fGetEventInformationACK(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui return offset; } -static guint -fAddListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAddListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14128,16 +14193,16 @@ fAddListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin return offset; } -static guint -fDeleteObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fDeleteObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fObjectIdentifier(tvb, pinfo, tree, offset, "ObjectIdentifier: "); } -static guint -fDeviceCommunicationControlRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fDeviceCommunicationControlRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14161,10 +14226,10 @@ fDeviceCommunicationControlRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree return offset; } -static guint -fReinitializeDeviceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fReinitializeDeviceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14186,24 +14251,24 @@ fReinitializeDeviceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return offset; } -static guint -fVtOpenRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fVtOpenRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { offset = fApplicationTypesEnumerated(tvb, pinfo, tree, offset, "vtClass: ", BACnetVTClass); return fApplicationTypes(tvb, pinfo, tree, offset, "local VT Session ID: "); } -static guint -fVtOpenAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fVtOpenAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fApplicationTypes(tvb, pinfo, tree, offset, "remote VT Session ID: "); } -static guint -fVtCloseRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fVtCloseRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14213,18 +14278,18 @@ fVtCloseRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse return offset; } -static guint -fVtDataRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fVtDataRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { offset= fApplicationTypes(tvb, pinfo, tree, offset, "VT Session ID: "); offset = fApplicationTypes(tvb, pinfo, tree, offset, "VT New Data: "); return fApplicationTypes(tvb, pinfo, tree, offset, "VT Data Flag: "); } -static guint -fVtDataAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fVtDataAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14244,13 +14309,13 @@ fVtDataAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fConfirmedAuditNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fConfirmedAuditNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint firstloop = 1; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + unsigned firstloop = 1; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14271,18 +14336,18 @@ fConfirmedAuditNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree return offset; } -static guint -fUnconfirmedAuditNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fUnconfirmedAuditNotificationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fConfirmedAuditNotificationRequest(tvb, pinfo, tree, offset); } -static guint -fAuditLogQueryByTargetParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuditLogQueryByTargetParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14328,12 +14393,12 @@ fAuditLogQueryByTargetParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree * return offset; } -static guint -fAuditLogQueryBySourceParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuditLogQueryBySourceParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14370,12 +14435,12 @@ fAuditLogQueryBySourceParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree * return offset; } -static guint -fAuditLogQueryParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuditLogQueryParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -14406,12 +14471,12 @@ fAuditLogQueryParameters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu return offset; } -static guint -fAuditLogQueryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuditLogQueryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -14442,12 +14507,12 @@ fAuditLogQueryRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fAuditLogRecordResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuditLogRecordResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -14475,12 +14540,12 @@ fAuditLogRecordResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fAuditLogQueryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuditLogQueryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -14508,10 +14573,10 @@ fAuditLogQueryAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off return offset; } -static guint -fWhoAmIRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fWhoAmIRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14523,20 +14588,26 @@ fWhoAmIRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset return offset; } -static guint -fYouAreRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fYouAreRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; offset = fApplicationTypes(tvb, pinfo, tree, offset, "Vendor ID: "); offset = fApplicationTypes(tvb, pinfo, tree, offset, "Model name: "); offset = fApplicationTypes(tvb, pinfo, tree, offset, "Serial number: "); - if(tvb_reported_length_remaining(tvb, offset) > 0) { + + fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); + if(tvb_reported_length_remaining(tvb, offset) > 0 && tag_no == 12) { offset = fApplicationTypes(tvb, pinfo, tree, offset, "Device Identifier: "); } - if(tvb_reported_length_remaining(tvb, offset) > 0) { + + fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); + if(tvb_reported_length_remaining(tvb, offset) > 0 && tag_no == 6) { offset = fApplicationTypes(tvb, pinfo, tree, offset, "Device MAC address: "); } if (offset <= lastoffset) break; /* nothing happened, exit loop */ @@ -14544,10 +14615,10 @@ fYouAreRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset return offset; } -static guint -fAuthenticateRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuthenticateRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14559,10 +14630,10 @@ fAuthenticateRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint case 1: /* expected Invoke ID Unsigned8 OPTIONAL */ proto_tree_add_item(tree, hf_bacapp_invoke_id, tvb, offset++, 1, ENC_BIG_ENDIAN); break; - case 2: /* Chararacter String OPTIONAL */ + case 2: /* Character String OPTIONAL */ offset = fCharacterString(tvb, pinfo, tree, offset, "operator Name: "); break; - case 3: /* Chararacter String OPTIONAL */ + case 3: /* Character String OPTIONAL */ offset = fCharacterString(tvb, pinfo, tree, offset, "operator Password: "); break; case 4: /* Boolean OPTIONAL */ @@ -14576,18 +14647,18 @@ fAuthenticateRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fAuthenticateAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuthenticateAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fApplicationTypes(tvb, pinfo, tree, offset, "modified Random Number: "); } -static guint -fAuthenticationFactor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuthenticationFactor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14617,12 +14688,12 @@ fAuthenticationFactor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fAuthenticationFactorFormat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuthenticationFactorFormat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14652,12 +14723,12 @@ fAuthenticationFactorFormat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return offset; } -static guint -fAuthenticationPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAuthenticationPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14681,7 +14752,9 @@ fAuthenticationPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint switch (tag_no) { case 0: /* credential-data-input */ + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); offset = fDeviceObjectReference(tvb, pinfo, tree, offset); + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; case 1: /* index */ offset = fUnsignedTag(tvb, pinfo, tree, offset, "index: "); @@ -14709,34 +14782,42 @@ fAuthenticationPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fRequestKeyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fRequestKeyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { + uint8_t tag_no, tag_info; + uint32_t lvt; + offset = fObjectIdentifier(tvb, pinfo, tree, offset, "DeviceIdentifier: "); /* Requesting Device Identifier */ + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); offset = fAddress(tvb, pinfo, tree, offset); + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); offset = fObjectIdentifier(tvb, pinfo, tree, offset, "DeviceIdentifier: "); /* Remote Device Identifier */ - return fAddress(tvb, pinfo, tree, offset); + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); + offset = fAddress(tvb, pinfo, tree, offset); + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); + return offset; } -static guint -fRemoveListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fRemoveListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { /* Same as AddListElement request after service choice */ return fAddListElementRequest(tvb, pinfo, tree, offset); } -static guint -fReadPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fReadPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fBACnetObjectPropertyReference(tvb, pinfo, tree, offset); } -static guint -fReadPropertyAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fReadPropertyAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; /* set the optional global properties to indicate not-used */ @@ -14770,12 +14851,12 @@ fReadPropertyAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs return offset; } -static guint -fWritePropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fWritePropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; /* set the optional global properties to indicate not-used */ @@ -14812,12 +14893,12 @@ fWritePropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fWriteAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset) +static unsigned +fWriteAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14848,22 +14929,22 @@ fWriteAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree return offset; } -static guint -fWritePropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fWritePropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { if (offset >= tvb_reported_length(tvb)) return offset; - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ return fWriteAccessSpecification(tvb, pinfo, tree, offset); } -static guint -fPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tagoffset, guint8 list) +static unsigned +fPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t tagoffset, uint8_t list) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; /* set the optional global properties to indicate not-used */ propertyArrayIndex = -1; @@ -14893,17 +14974,17 @@ fPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of return offset; } -static guint -fBACnetPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 list) +static unsigned +fBACnetPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t list) { - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ return fPropertyReference(tvb, pinfo, tree, offset, 0, list); } -static guint -fBACnetObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fBACnetObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -14914,7 +14995,7 @@ fBACnetObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr break; case 1: /* PropertyIdentifier and propertyArrayIndex */ offset = fPropertyReference(tvb, pinfo, tree, offset, 1, 0); - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ /* FALLTHROUGH */ default: lastoffset = offset; /* Set loop end condition */ @@ -14926,12 +15007,12 @@ fBACnetObjectPropertyReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr } #if 0 -static guint -fObjectPropertyValue(tvbuff_t *tvb, proto_tree *tree, guint offset) +static unsigned +fObjectPropertyValue(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree* subtree = tree; proto_item* tt; @@ -14967,14 +15048,15 @@ fObjectPropertyValue(tvbuff_t *tvb, proto_tree *tree, guint offset) } #endif -static guint -fPriorityArray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fPriorityArray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { char i = 1, ar[256]; - guint lastoffset = 0; - guint8 tag_no; - guint8 tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no; + uint8_t tag_info; + uint32_t lvt; if (propertyArrayIndex > 0) { /* BACnetARRAY index 0 refers to the length @@ -15028,12 +15110,12 @@ fPriorityArray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset return offset; } -static guint -fDeviceObjectReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fDeviceObjectReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -15057,12 +15139,12 @@ fDeviceObjectReference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin return offset; } -static guint -fSpecialEvent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset) +static unsigned +fSpecialEvent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; - guint lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -15102,12 +15184,12 @@ fSpecialEvent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offs return offset; } -static guint -fNetworkSecurityPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fNetworkSecurityPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree; subtree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_bacapp_tag, NULL, "network security policy"); @@ -15135,12 +15217,12 @@ fNetworkSecurityPolicy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin return offset; } -static guint -fKeyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fKeyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0 && offset > lastoffset) { lastoffset = offset; @@ -15164,12 +15246,12 @@ fKeyIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset return offset; } -static guint -fSecurityKeySet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSecurityKeySet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree; subtree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_bacapp_tag, NULL, "security keyset"); @@ -15212,12 +15294,12 @@ fSecurityKeySet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse return offset; } -static guint -fSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -15251,12 +15333,12 @@ fSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of return offset; } -static guint -fObjectSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset) +static unsigned +fObjectSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -15289,12 +15371,12 @@ fObjectSelectionCriteria(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, } -static guint -fReadPropertyConditionalRequest(tvbuff_t *tvb, packet_info* pinfo, proto_tree *subtree, guint offset) +static unsigned +fReadPropertyConditionalRequest(tvbuff_t *tvb, packet_info* pinfo, proto_tree *subtree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -15319,12 +15401,12 @@ fReadPropertyConditionalRequest(tvbuff_t *tvb, packet_info* pinfo, proto_tree *s return offset; } -static guint -fReadAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fReadAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -15356,13 +15438,14 @@ fReadAccessSpecification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu return offset; } -static guint -fReadAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +fReadAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0, len; - guint8 tag_no; - guint8 tag_info; - guint32 lvt; + unsigned lastoffset = 0, len; + uint8_t tag_no; + uint8_t tag_info; + uint32_t lvt; proto_tree *subtree = tree; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -15425,20 +15508,20 @@ fReadAccessResult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off } -static guint -fReadPropertyConditionalAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fReadPropertyConditionalAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { /* listOfReadAccessResults */ return fReadAccessResult(tvb, pinfo, tree, offset); } -static guint -fCreateObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset) +static unsigned +fCreateObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -15476,17 +15559,17 @@ fCreateObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, gui return offset; } -static guint -fCreateObjectAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fCreateObjectAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { return fObjectIdentifier(tvb, pinfo, tree, offset, "ObjectIdentifier: "); } -static guint -fReadRangeRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fReadRangeRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; offset = fBACnetObjectPropertyReference(tvb, pinfo, subtree, offset); @@ -15522,11 +15605,11 @@ fReadRangeRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off return offset; } -static guint -fReadRangeAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fReadRangeAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; /* set the optional global properties to indicate not-used */ @@ -15543,7 +15626,7 @@ fReadRangeAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) /* itemData */ fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (tag_is_opening(tag_info)) { - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ subtree = proto_tree_add_subtree(subtree, tvb, offset, 1, ett_bacapp_value, NULL, "itemData"); offset += fTagHeaderTree(tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt); offset = fAbstractSyntaxNType(tvb, pinfo, subtree, offset); @@ -15557,12 +15640,12 @@ fReadRangeAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fAccessMethod(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAccessMethod(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint32 lvt; - guint8 tag_no, tag_info; + unsigned lastoffset = 0; + uint32_t lvt; + uint8_t tag_no, tag_info; proto_tree* subtree = NULL; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); @@ -15593,12 +15676,12 @@ fAccessMethod(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fAccessRule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAccessRule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no, tag_info; - guint32 lvt; + unsigned lastoffset = 0; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -15613,13 +15696,17 @@ fAccessRule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) offset = fEnumeratedTag(tvb, pinfo, tree, offset, "time-range-specifier: ", NULL); break; case 1: /* time-range */ + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); offset = fDeviceObjectPropertyReference(tvb, pinfo, tree, offset); + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; case 2: /* location-specifier */ offset = fEnumeratedTag(tvb, pinfo, tree, offset, "location-specifier: ", NULL); break; case 3: /* location */ + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); offset = fDeviceObjectReference(tvb, pinfo, tree, offset); + offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; case 4: /* enable */ offset = fBooleanTag(tvb, pinfo, tree, offset, "enable: "); @@ -15634,11 +15721,11 @@ fAccessRule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fAtomicReadFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAtomicReadFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; proto_tree *subtree = tree; offset = fObjectIdentifier(tvb, pinfo, tree, offset, "ObjectIdentifier: "); @@ -15650,14 +15737,14 @@ fAtomicReadFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin val_to_str_const(tag_no, BACnetFileAccessOption, "unknown access method")); offset += fTagHeaderTree(tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt); offset = fSignedTag(tvb, pinfo, subtree, offset, val_to_str_const(tag_no, BACnetFileStartOption, "unknown option")); - offset = fUnsignedTag(tvb, pinfo, subtree, offset, val_to_str_const(tag_no, BACnetFileRequestCount, "unknown option")); + offset = fUnsignedTag(tvb, pinfo, subtree, offset, val_to_str_const(tag_no, BacnetFileRequestedCount, "unknown option")); offset += fTagHeaderTree(tvb, pinfo, subtree, offset, &tag_no, &tag_info, &lvt); } return offset; } -static guint -fAtomicWriteFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAtomicWriteFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { offset = fObjectIdentifier(tvb, pinfo, tree, offset, "ObjectIdentifier: "); /* file Identifier */ @@ -15666,15 +15753,15 @@ fAtomicWriteFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui return offset; } -static guint -fAtomicWriteFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAtomicWriteFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint tag_no = fTagNo(tvb, offset); + unsigned tag_no = fTagNo(tvb, offset); return fSignedTag(tvb, pinfo, tree, offset, val_to_str_const(tag_no, BACnetFileStartOption, "unknown option")); } -static guint -fAtomicReadFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fAtomicReadFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { offset = fApplicationTypes(tvb, pinfo, tree, offset, "End Of File: "); offset = fAccessMethod(tvb, pinfo, tree, offset); @@ -15682,22 +15769,22 @@ fAtomicReadFileAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of return offset; } -static guint -fReadPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset) +static unsigned +fReadPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, unsigned offset) { - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ return fReadAccessSpecification(tvb, pinfo, subtree, offset); } -static guint -fReadPropertyMultipleAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fReadPropertyMultipleAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ return fReadAccessResult(tvb, pinfo, tree, offset); } -static guint -fConfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice) +static unsigned +fConfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, int service_choice) { if (tvb_reported_length_remaining(tvb, offset) <= 0) return offset; @@ -15810,8 +15897,8 @@ fConfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu return offset; } -static guint -fConfirmedServiceAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice) +static unsigned +fConfirmedServiceAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, int service_choice) { if (tvb_reported_length_remaining(tvb, offset) <= 0) return offset; @@ -15868,8 +15955,8 @@ fConfirmedServiceAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint return offset; } -static guint -fIAmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fIAmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { /* BACnetObjectIdentifier */ offset = fApplicationTypes(tvb, pinfo, tree, offset, "BACnet Object Identifier: "); @@ -15885,8 +15972,8 @@ fIAmRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return fVendorIdentifier(tvb, pinfo, tree, offset); } -static guint -fIHaveRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fIHaveRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { /* BACnetDeviceIdentifier */ offset = fApplicationTypes(tvb, pinfo, tree, offset, "Device Identifier: "); @@ -15898,15 +15985,15 @@ fIHaveRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return fObjectName(tvb, pinfo, tree, offset); } -static guint -fWhoIsRequest(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint offset) +static unsigned +fWhoIsRequest(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint val; - guint8 tag_len; + unsigned lastoffset = 0; + unsigned val; + uint8_t tag_len; - guint8 tag_no, tag_info; - guint32 lvt; + uint8_t tag_no, tag_info; + uint32_t lvt; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -15937,8 +16024,8 @@ fWhoIsRequest(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fUnconfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice) +static unsigned +fUnconfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, int service_choice) { if (tvb_reported_length_remaining(tvb, offset) <= 0) return offset; @@ -15995,25 +16082,25 @@ fUnconfirmedServiceRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return offset; } -static guint -fStartConfirmed(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, guint offset, guint8 ack, - gint *svc, proto_item **tt) +static unsigned +fStartConfirmed(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, unsigned offset, uint8_t ack, + int *svc, proto_item **tt) { proto_item *tc; proto_tree *bacapp_tree_control; - gint tmp; - guint extra = 2; + int tmp; + unsigned extra = 2; bacapp_seq = 0; - tmp = tvb_get_gint8(tvb, offset); + tmp = tvb_get_int8(tvb, offset); bacapp_flags = tmp & 0x0f; if (ack == 0) { extra = 3; } - *svc = tvb_get_gint8(tvb, offset+extra); + *svc = tvb_get_int8(tvb, offset+extra); if (bacapp_flags & 0x08) - *svc = tvb_get_gint8(tvb, offset+extra+2); + *svc = tvb_get_int8(tvb, offset+extra+2); proto_tree_add_item(bacapp_tree, hf_bacapp_type, tvb, offset, 1, ENC_BIG_ENDIAN); tc = proto_tree_add_item(bacapp_tree, hf_bacapp_pduflags, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -16031,7 +16118,7 @@ fStartConfirmed(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, offset++; proto_tree_add_item(bacapp_tree, hf_bacapp_invoke_id, tvb, offset++, 1, ENC_BIG_ENDIAN); if (bacapp_flags & 0x08) { - bacapp_seq = tvb_get_guint8(tvb, offset); + bacapp_seq = tvb_get_uint8(tvb, offset); proto_tree_add_item(bacapp_tree, hf_bacapp_sequence_number, tvb, offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(bacapp_tree, hf_bacapp_window_size, tvb, @@ -16042,43 +16129,43 @@ fStartConfirmed(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, return offset; } -static guint -fContinueConfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, guint offset, gint svc) +static unsigned +fContinueConfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, unsigned offset, int svc) { /* BACnet-Confirmed-Request */ /* ASHRAE 135-2001 20.1.2 */ return fConfirmedServiceRequest(tvb, pinfo, bacapp_tree, offset, svc); } -static guint -fConfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, guint offset) +static unsigned +fConfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, unsigned offset) { /* BACnet-Confirmed-Request */ /* ASHRAE 135-2001 20.1.2 */ - gint svc; + int svc; proto_item *tt = 0; offset = fStartConfirmed(tvb, pinfo, bacapp_tree, offset, 0, &svc, &tt); return fContinueConfirmedRequestPDU(tvb, pinfo, bacapp_tree, offset, svc); } -static guint -fUnconfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, guint offset) +static unsigned +fUnconfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, unsigned offset) { /* BACnet-Unconfirmed-Request-PDU */ /* ASHRAE 135-2001 20.1.3 */ - gint tmp; + int tmp; proto_tree_add_item(bacapp_tree, hf_bacapp_type, tvb, offset++, 1, ENC_BIG_ENDIAN); - tmp = tvb_get_guint8(tvb, offset); + tmp = tvb_get_uint8(tvb, offset); proto_tree_add_item(bacapp_tree, hf_bacapp_uservice, tvb, offset++, 1, ENC_BIG_ENDIAN); /* Service Request follows... Variable Encoding 20.2ff */ return fUnconfirmedServiceRequest(tvb, pinfo, bacapp_tree, offset, tmp); } -static guint -fSimpleAckPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, guint offset) +static unsigned +fSimpleAckPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, unsigned offset) { /* BACnet-Simple-Ack-PDU */ /* ASHRAE 135-2001 20.1.4 */ @@ -16092,8 +16179,8 @@ fSimpleAckPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, gu return offset; } -static guint -fContinueComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, guint offset, gint svc) +static unsigned +fContinueComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, unsigned offset, int svc) { /* BACnet-Complex-Ack-PDU */ /* ASHRAE 135-2001 20.1.5 */ @@ -16101,19 +16188,19 @@ fContinueComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tre return fConfirmedServiceAck(tvb, pinfo, bacapp_tree, offset, svc); } -static guint -fComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, guint offset) +static unsigned +fComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, unsigned offset) { /* BACnet-Complex-Ack-PDU */ /* ASHRAE 135-2001 20.1.5 */ - gint svc; + int svc; proto_item *tt = 0; offset = fStartConfirmed(tvb, pinfo, bacapp_tree, offset, 1, &svc, &tt); return fContinueComplexAckPDU(tvb, pinfo, bacapp_tree, offset, svc); } -static guint -fSegmentAckPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, guint offset) +static unsigned +fSegmentAckPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, unsigned offset) { /* BACnet-SegmentAck-PDU */ /* ASHRAE 135-2001 20.1.6 */ @@ -16134,29 +16221,29 @@ fSegmentAckPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, g return offset; } -static guint -fContextTaggedError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fContextTaggedError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_info = 0; - guint8 parsed_tag = 0; - guint32 lvt = 0; + uint8_t tag_info = 0; + uint8_t parsed_tag = 0; + uint32_t lvt = 0; offset += fTagHeaderTree(tvb, pinfo, tree, offset, &parsed_tag, &tag_info, &lvt); offset = fError(tvb, pinfo, tree, offset); return offset + fTagHeaderTree(tvb, pinfo, tree, offset, &parsed_tag, &tag_info, &lvt); } -static guint -fConfirmedPrivateTransferError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fConfirmedPrivateTransferError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no = 0, tag_info = 0; - guint32 lvt = 0; + unsigned lastoffset = 0; + uint8_t tag_no = 0, tag_info = 0; + uint32_t lvt = 0; proto_tree *subtree = tree; - guint vendor_identifier = 0; - guint service_number = 0; - guint8 tag_len = 0; + unsigned vendor_identifier = 0; + unsigned service_number = 0; + uint8_t tag_len = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ @@ -16200,10 +16287,10 @@ fConfirmedPrivateTransferError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr return offset; } -static guint -fCreateObjectError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fCreateObjectError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; + unsigned lastoffset = 0; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; @@ -16222,18 +16309,18 @@ fCreateObjectError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of return offset; } -static guint -fChangeListError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fChangeListError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { /* Identical to CreateObjectError */ return fCreateObjectError(tvb, pinfo, tree, offset); } -static guint -fVTCloseError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fVTCloseError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint8 tag_no = 0, tag_info = 0; - guint32 lvt = 0; + uint8_t tag_no = 0, tag_info = 0; + uint32_t lvt = 0; if (fTagNo(tvb, offset) == 0) { /* errorType */ @@ -16249,14 +16336,14 @@ fVTCloseError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint lastoffset = 0; - guint8 tag_no = 0, tag_info = 0; - guint32 lvt = 0; + unsigned lastoffset = 0; + uint8_t tag_no = 0, tag_info = 0; + uint32_t lvt = 0; - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); /* don't set all infos into INFO column */ + col_set_writable(pinfo->cinfo, COL_INFO, false); /* don't set all infos into INFO column */ while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; switch (fTagNo(tvb, offset)) { @@ -16276,14 +16363,14 @@ fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return offset; } -static guint -fErrorClass(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fErrorClass(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0, lvt; - guint8 tag_no, tag_info; + uint32_t val = 0, lvt; + uint8_t tag_no, tag_info; proto_item *ti; proto_tree *subtree; - guint tag_len; + unsigned tag_len; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset+tag_len, lvt, &val)) @@ -16303,14 +16390,14 @@ fErrorClass(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fErrorCode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fErrorCode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint32 val = 0, lvt; - guint8 tag_no, tag_info; + uint32_t val = 0, lvt; + uint8_t tag_no, tag_info; proto_item *ti; proto_tree *subtree; - guint tag_len; + unsigned tag_len; tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fUnsigned32(tvb, offset+tag_len, lvt, &val)) @@ -16330,16 +16417,16 @@ fErrorCode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) return offset; } -static guint -fError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +static unsigned +fError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { offset = fErrorClass(tvb, pinfo, tree, offset); return fErrorCode(tvb, pinfo, tree, offset); } -static guint -fBACnetError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint service) +static unsigned +fBACnetError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, unsigned service) { switch (service) { case 8: @@ -16370,29 +16457,29 @@ fBACnetError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, return offset; } -static guint -fErrorPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, guint offset) +static unsigned +fErrorPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bacapp_tree, unsigned offset) { /* BACnet-Error-PDU */ /* ASHRAE 135-2001 20.1.7 */ proto_item *tc; proto_tree *bacapp_tree_control; - guint8 tmp; + uint8_t tmp; tc = proto_tree_add_item(bacapp_tree, hf_bacapp_type, tvb, offset++, 1, ENC_BIG_ENDIAN); bacapp_tree_control = proto_item_add_subtree(tc, ett_bacapp); proto_tree_add_item(bacapp_tree_control, hf_bacapp_invoke_id, tvb, offset++, 1, ENC_BIG_ENDIAN); - tmp = tvb_get_guint8(tvb, offset); + tmp = tvb_get_uint8(tvb, offset); proto_tree_add_item(bacapp_tree_control, hf_bacapp_service, tvb, offset++, 1, ENC_BIG_ENDIAN); /* Error Handling follows... */ return fBACnetError(tvb, pinfo, bacapp_tree, offset, tmp); } -static guint -fRejectPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, guint offset) +static unsigned +fRejectPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, unsigned offset) { /* BACnet-Reject-PDU */ /* ASHRAE 135-2001 20.1.8 */ @@ -16409,8 +16496,8 @@ fRejectPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, guint return offset; } -static guint -fAbortPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, guint offset) +static unsigned +fAbortPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, unsigned offset) { /* BACnet-Abort-PDU */ /* ASHRAE 135-2001 20.1.9 */ @@ -16428,13 +16515,13 @@ fAbortPDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *bacapp_tree, guint return offset; } -static guint +static unsigned do_the_dissection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - guint8 flag, bacapp_type; - guint offset = 0; + uint8_t flag, bacapp_type; + unsigned offset = 0; - flag = tvb_get_gint8(tvb, 0); + flag = tvb_get_int8(tvb, 0); bacapp_type = (flag >> 4) & 0x0f; if (tvb == NULL) { @@ -16474,33 +16561,33 @@ do_the_dissection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static int dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - guint8 flag, bacapp_type; - guint save_fragmented = FALSE, data_offset = 0, /*bacapp_apdu_size,*/ fragment = FALSE; + uint8_t flag, bacapp_type; + unsigned save_fragmented = false, data_offset = 0, /*bacapp_apdu_size,*/ fragment = false; tvbuff_t *new_tvb = NULL; - guint offset = 0; - guint8 bacapp_seqno = 0; - guint8 bacapp_service, bacapp_reason/*, bacapp_prop_win_size*/; - guint8 bacapp_invoke_id = 0; + unsigned offset = 0; + uint8_t bacapp_seqno = 0; + uint8_t bacapp_service, bacapp_reason/*, bacapp_prop_win_size*/; + uint8_t bacapp_invoke_id = 0; proto_item *ti; proto_tree *bacapp_tree = NULL; - gint svc = 0; + int svc = 0; proto_item *tt = 0; - gint8 ack = 0; + int8_t ack = 0; /* Strings for BACnet Statistics */ - const gchar errstr[] = "ERROR: "; - const gchar rejstr[] = "REJECTED: "; - const gchar abortstr[] = "ABORTED: "; - const gchar sackstr[] = " (SimpleAck)"; - const gchar cackstr[] = " (ComplexAck)"; - const gchar uconfsreqstr[] = " (Unconfirmed Service Request)"; - const gchar confsreqstr[] = " (Confirmed Service Request)"; + static const char errstr[] = "ERROR: "; + static const char rejstr[] = "REJECTED: "; + static const char abortstr[] = "ABORTED: "; + static const char sackstr[] = " (SimpleAck)"; + static const char cackstr[] = " (ComplexAck)"; + static const char uconfsreqstr[] = " (Unconfirmed Service Request)"; + static const char confsreqstr[] = " (Confirmed Service Request)"; col_set_str(pinfo->cinfo, COL_PROTOCOL, "BACnet-APDU"); col_clear(pinfo->cinfo, COL_INFO); - flag = tvb_get_guint8(tvb, 0); + flag = tvb_get_uint8(tvb, 0); bacapp_type = (flag >> 4) & 0x0f; /* show some descriptive text in the INFO column */ @@ -16516,17 +16603,17 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ case BACAPP_TYPE_CONFIRMED_SERVICE_REQUEST: /* segmented messages have 2 additional bytes */ if (flag & BACAPP_SEGMENTED_REQUEST) { - fragment = TRUE; + fragment = true; ack = 0; - /* bacapp_apdu_size = fGetMaxAPDUSize(tvb_get_guint8(tvb, offset + 1)); */ /* has 16 values, reserved are 50 Bytes */ - bacapp_invoke_id = tvb_get_guint8(tvb, offset + 2); - bacapp_seqno = tvb_get_guint8(tvb, offset + 3); - /* bacapp_prop_win_size = tvb_get_guint8(tvb, offset + 4); */ - bacapp_service = tvb_get_guint8(tvb, offset + 5); + /* bacapp_apdu_size = fGetMaxAPDUSize(tvb_get_uint8(tvb, offset + 1)); */ /* has 16 values, reserved are 50 Bytes */ + bacapp_invoke_id = tvb_get_uint8(tvb, offset + 2); + bacapp_seqno = tvb_get_uint8(tvb, offset + 3); + /* bacapp_prop_win_size = tvb_get_uint8(tvb, offset + 4); */ + bacapp_service = tvb_get_uint8(tvb, offset + 5); data_offset = 6; } else { - bacapp_invoke_id = tvb_get_guint8(tvb, offset + 2); - bacapp_service = tvb_get_guint8(tvb, offset + 3); + bacapp_invoke_id = tvb_get_uint8(tvb, offset + 2); + bacapp_service = tvb_get_uint8(tvb, offset + 3); } col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", val_to_str_const(bacapp_service, @@ -16545,7 +16632,7 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ confsreqstr, NULL)); break; case BACAPP_TYPE_UNCONFIRMED_SERVICE_REQUEST: - bacapp_service = tvb_get_guint8(tvb, offset + 1); + bacapp_service = tvb_get_uint8(tvb, offset + 1); col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(bacapp_service, BACnetUnconfirmedServiceChoice, @@ -16559,8 +16646,8 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ uconfsreqstr, NULL)); break; case BACAPP_TYPE_SIMPLE_ACK: - bacapp_invoke_id = tvb_get_guint8(tvb, offset + 1); - bacapp_service = tvb_get_guint8(tvb, offset + 2); + bacapp_invoke_id = tvb_get_uint8(tvb, offset + 1); + bacapp_service = tvb_get_uint8(tvb, offset + 2); col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", /* "original-invokeID" replaced */ val_to_str_const(bacapp_service, BACnetConfirmedServiceChoice, @@ -16581,17 +16668,17 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ case BACAPP_TYPE_COMPLEX_ACK: /* segmented messages have 2 additional bytes */ if (flag & BACAPP_SEGMENTED_REQUEST) { - fragment = TRUE; + fragment = true; ack = 1; /* bacapp_apdu_size = fGetMaxAPDUSize(0); */ /* has minimum of 50 Bytes */ - bacapp_invoke_id = tvb_get_guint8(tvb, offset + 1); - bacapp_seqno = tvb_get_guint8(tvb, offset + 2); - /* bacapp_prop_win_size = tvb_get_guint8(tvb, offset + 3); */ - bacapp_service = tvb_get_guint8(tvb, offset + 4); + bacapp_invoke_id = tvb_get_uint8(tvb, offset + 1); + bacapp_seqno = tvb_get_uint8(tvb, offset + 2); + /* bacapp_prop_win_size = tvb_get_uint8(tvb, offset + 3); */ + bacapp_service = tvb_get_uint8(tvb, offset + 4); data_offset = 5; } else { - bacapp_invoke_id = tvb_get_guint8(tvb, offset + 1); - bacapp_service = tvb_get_guint8(tvb, offset + 2); + bacapp_invoke_id = tvb_get_uint8(tvb, offset + 1); + bacapp_service = tvb_get_uint8(tvb, offset + 2); } col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", /* "original-invokeID" replaced */ val_to_str_const(bacapp_service, @@ -16613,8 +16700,8 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ /* nothing more to add */ break; case BACAPP_TYPE_ERROR: - bacapp_invoke_id = tvb_get_guint8(tvb, offset + 1); - bacapp_service = tvb_get_guint8(tvb, offset + 2); + bacapp_invoke_id = tvb_get_uint8(tvb, offset + 1); + bacapp_service = tvb_get_uint8(tvb, offset + 2); col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", /* "original-invokeID" replaced */ val_to_str_const(bacapp_service, BACnetConfirmedServiceChoice, @@ -16633,8 +16720,8 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ NULL)); break; case BACAPP_TYPE_REJECT: - bacapp_invoke_id = tvb_get_guint8(tvb, offset + 1); - bacapp_reason = tvb_get_guint8(tvb, offset + 2); + bacapp_invoke_id = tvb_get_uint8(tvb, offset + 1); + bacapp_reason = tvb_get_uint8(tvb, offset + 2); col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", /* "original-invokeID" replaced */ val_to_split_str(bacapp_reason, 64, @@ -16654,8 +16741,8 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ NULL)); break; case BACAPP_TYPE_ABORT: - bacapp_invoke_id = tvb_get_guint8(tvb, offset + 1); - bacapp_reason = tvb_get_guint8(tvb, offset + 2); + bacapp_invoke_id = tvb_get_uint8(tvb, offset + 1); + bacapp_reason = tvb_get_uint8(tvb, offset + 2); col_append_fstr(pinfo->cinfo, COL_INFO, "%s[%3u] ", /* "original-invokeID" replaced */ val_to_split_str(bacapp_reason, 64, @@ -16695,7 +16782,7 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ if (fragment) { /* fragmented */ fragment_head *frag_msg; - pinfo->fragmented = TRUE; + pinfo->fragmented = true; frag_msg = fragment_add_seq_check(&msg_reassembly_table, tvb, data_offset, @@ -16844,7 +16931,7 @@ proto_register_bacapp(void) }, { &hf_bacapp_present_value_bool, { "Present Value (bool)", "bacapp.present_value.boolean", - FT_BOOLEAN, 8, NULL, 0, NULL, HFILL } + FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_bacapp_present_value_unsigned, { "Present Value (uint)", "bacapp.present_value.uint", @@ -16978,7 +17065,7 @@ proto_register_bacapp(void) }, { &hf_bacapp_bit, { "bit", "bacapp.bit", - FT_BOOLEAN, 8, NULL, 0, NULL, HFILL } + FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_bacapp_complete_bitstring, { "Complete bitstring", "bacapp.complete_bitstring", @@ -17017,7 +17104,7 @@ proto_register_bacapp(void) { "Reassembled BACapp length", "bacapp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } } }; - static gint *ett[] = { + static int *ett[] = { &ett_bacapp, &ett_bacapp_control, &ett_bacapp_tag, |