Another try to fix the compiler warnings on win64.
[metze/wireshark/wip.git] / epan / dissectors / packet-bacapp.h
1 /* packet-bacapp.h
2  * Routines for BACnet (APDU) dissection
3  * Copyright 2004, Herbert Lischka <lischka@kieback-peter.de>, Berlin
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * Copied from README.developer,v 1.23
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26  */
27
28 #ifndef __BACAPP_H__
29 #define __BACAPP_H__
30
31
32 #ifndef min
33 #define min(a,b) (((a)<(b))?(a):(b))
34 #endif
35
36 #ifndef max
37 #define max(a,b) (((a)>(b))?(a):(b))
38 #endif
39
40 #ifndef FAULT
41 #define FAULT                   proto_tree_add_text(subtree, tvb, offset, tvb_length(tvb) - offset, "something is going wrong here !!"); \
42                         offset = tvb_length(tvb);
43 #endif
44
45 #ifndef false
46 #define false 0
47 #endif
48 #ifndef true
49 #define true 1
50 #endif
51
52 /* BACnet PDU Types */
53 #define BACAPP_TYPE_CONFIRMED_SERVICE_REQUEST 0
54 #define BACAPP_TYPE_UNCONFIRMED_SERVICE_REQUEST 1
55 #define BACAPP_TYPE_SIMPLE_ACK 2
56 #define BACAPP_TYPE_COMPLEX_ACK 3
57 #define BACAPP_TYPE_SEGMENT_ACK 4
58 #define BACAPP_TYPE_ERROR 5
59 #define BACAPP_TYPE_REJECT 6
60 #define BACAPP_TYPE_ABORT 7
61 #define MAX_BACAPP_TYPE 8
62
63 #define BACAPP_SEGMENTED_REQUEST 0x08
64 #define BACAPP_MORE_SEGMENTS 0x04
65 #define BACAPP_SEGMENTED_RESPONSE 0x02
66 #define BACAPP_SEGMENT_NAK 0x02
67 #define BACAPP_SENT_BY 0x01
68
69
70 /**
71  * dissect_bacapp ::= CHOICE {
72  *  confirmed-request-PDU       [0] BACnet-Confirmed-Request-PDU,
73  *  unconfirmed-request-PDU     [1] BACnet-Unconfirmed-Request-PDU,
74  *  simpleACK-PDU               [2] BACnet-SimpleACK-PDU,
75  *  complexACK-PDU              [3] BACnet-ComplexACK-PDU,
76  *  segmentACK-PDU              [4] BACnet-SegmentACK-PDU,
77  *  error-PDU                   [5] BACnet-Error-PDU,
78  *  reject-PDU                  [6] BACnet-Reject-PDU,
79  *  abort-PDU                   [7] BACnet-Abort-PDU
80  * }
81  * @param tvb
82  * @param pinfo
83  * @param tree
84  */
85 void
86 dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
87
88 /**
89  * ConfirmedRequest-PDU ::= SEQUENCE {
90  *      pdu-type                                        [0] Unsigned (0..15), -- 0 for this PDU Type
91  *  segmentedMessage                    [1] BOOLEAN,
92  *  moreFollows                                 [2] BOOLEAN,
93  *  segmented-response-accepted [3] BOOLEAN,
94  *  reserved                                    [4] Unsigned (0..3), -- must be set zero
95  *  max-segments-accepted               [5] Unsigned (0..7), -- as per 20.1.2.4
96  *  max-APDU-length-accepted    [5] Unsigned (0..15), -- as per 20.1.2.5
97  *  invokeID                                    [6] Unsigned (0..255),
98  *  sequence-number                             [7] Unsigned (0..255) OPTIONAL, -- only if segmented msg
99  *  proposed-window-size                [8] Unsigned (0..127) OPTIONAL, -- only if segmented msg
100  *  service-choice                              [9] BACnetConfirmedServiceChoice,
101  *  service-request                             [10] BACnet-Confirmed-Service-Request OPTIONAL
102  * }
103  * @param tvb
104  * @param pinfo
105  * @param tree
106  * @param offset
107  * @return modified offset
108  */
109 static guint
110 fConfirmedRequestPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
111
112 /**
113  * @param tvb
114  * @param tree
115  * @param offset
116  * @param ack - indocates whether working on request or ack
117  * @param svc - output variable to return service choice
118  * @param tt  - output varable to return service choice item
119  * @return modified offset
120  */
121 static guint
122 fStartConfirmed(tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 ack,
123                                 gint *svc, proto_item **tt);
124
125 /**
126  * Unconfirmed-Request-PDU ::= SEQUENCE {
127  *      pdu-type                [0] Unsigned (0..15), -- 1 for this PDU type
128  *  reserved            [1] Unsigned (0..15), -- must be set zero
129  *  service-choice      [2] BACnetUnconfirmedServiceChoice,
130  *  service-request     [3] BACnetUnconfirmedServiceRequest -- Context-specific tags 0..3 are NOT used in header encoding
131  * }
132  * @param tvb
133  * @param tree
134  * @param offset
135  * @return modified offset
136  */
137 static guint
138 fUnconfirmedRequestPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
139
140 /**
141  * SimpleACK-PDU ::= SEQUENCE {
142  *      pdu-type                [0] Unsigned (0..15), -- 2 for this PDU type
143  *  reserved            [1] Unsigned (0..15), -- must be set zero
144  *  invokeID            [2] Unsigned (0..255),
145  *  service-ACK-choice  [3] BACnetUnconfirmedServiceChoice -- Context-specific tags 0..3 are NOT used in header encoding
146  * }
147  * @param tvb
148  * @param tree
149  * @param offset
150  * @return modified offset
151  */
152 static guint
153 fSimpleAckPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
154
155 /**
156  * ComplexACK-PDU ::= SEQUENCE {
157  *      pdu-type                                [0] Unsigned (0..15), -- 3 for this PDU Type
158  *  segmentedMessage            [1] BOOLEAN,
159  *  moreFollows                         [2] BOOLEAN,
160  *  reserved                            [3] Unsigned (0..3), -- must be set zero
161  *  invokeID                            [4] Unsigned (0..255),
162  *  sequence-number                     [5] Unsigned (0..255) OPTIONAL, -- only if segmented msg
163  *  proposed-window-size        [6] Unsigned (0..127) OPTIONAL, -- only if segmented msg
164  *  service-ACK-choice          [7] BACnetConfirmedServiceChoice,
165  *  service-ACK                         [8] BACnet-Confirmed-Service-Request  -- Context-specific tags 0..8 are NOT used in header encoding
166  * }
167  * @param tvb
168  * @param tree
169  * @param offset
170  * @return modified offset
171  */
172 static guint
173 fComplexAckPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
174
175 /**
176  * SegmentACK-PDU ::= SEQUENCE {
177  *      pdu-type                                [0] Unsigned (0..15), -- 4 for this PDU Type
178  *  reserved                            [1] Unsigned (0..3), -- must be set zero
179  *  negative-ACK                        [2] BOOLEAN,
180  *  server                                      [3] BOOLEAN,
181  *  original-invokeID           [4] Unsigned (0..255),
182  *  sequence-number                     [5] Unsigned (0..255),
183  *  actual-window-size          [6] Unsigned (0..127)
184  * }
185  * @param tvb
186  * @param tree
187  * @param offset
188  * @return modified offset
189  */
190 static guint
191 fSegmentAckPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
192
193 /**
194  * Error-PDU ::= SEQUENCE {
195  *      pdu-type                                [0] Unsigned (0..15), -- 5 for this PDU Type
196  *  reserved                            [1] Unsigned (0..3), -- must be set zero
197  *  original-invokeID           [2] Unsigned (0..255),
198  *  error-choice                        [3] BACnetConfirmedServiceChoice,
199  *  error                                       [4] BACnet-Error
200  * }
201  * @param tvb
202  * @param tree
203  * @param offset
204  * @return modified offset
205  */
206 static guint
207 fErrorPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
208
209 /**
210  * Reject-PDU ::= SEQUENCE {
211  *      pdu-type                                [0] Unsigned (0..15), -- 6 for this PDU Type
212  *  reserved                            [1] Unsigned (0..3), -- must be set zero
213  *  original-invokeID           [2] Unsigned (0..255),
214  *  reject-reason                       [3] BACnetRejectReason
215  * }
216  * @param tvb
217  * @param tree
218  * @param offset
219  * @return modified offset
220  */
221 static guint
222 fRejectPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
223
224 /**
225  * Abort-PDU ::= SEQUENCE {
226  *      pdu-type                                [0] Unsigned (0..15), -- 7 for this PDU Type
227  *  reserved                            [1] Unsigned (0..3), -- must be set zero
228  *  server                                      [2] BOOLEAN,
229  *  original-invokeID           [3] Unsigned (0..255),
230  *  abort-reason                        [4] BACnetAbortReason
231  * }
232  * @param tvb
233  * @param tree
234  * @param offset
235  * @return modified offset
236  */
237 static guint
238 fAbortPDU(tvbuff_t *tvb, proto_tree *tree, guint offset);
239
240 /**
241  * 20.2.4, adds the label with max 64Bit unsigned Integer Value to tree
242  * @param tvb
243  * @param tree
244  * @param offset
245  * @param label
246  * @return modified offset
247  */
248 static guint
249 fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
250
251 /**
252  * 20.2.5, adds the label with max 64Bit signed Integer Value to tree
253  * @param tvb
254  * @param tree
255  * @param offset
256  * @param label
257  * @return modified offset
258  */
259 static guint
260 fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
261
262 /**
263  * 20.2.8, adds the label with Octet String to tree; if lvt == 0 then lvt = restOfFrame
264  * @param tvb
265  * @param tree
266  * @param offset
267  * @param label
268  * @param lvt length of String
269  * @return modified offset
270  */
271 static guint
272 fOctetString (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label, guint32 lvt);
273
274 /**
275  * 20.2.12, adds the label with Date Value to tree
276  * @param tvb
277  * @param tree
278  * @param offset
279  * @param label
280  * @return modified offset
281  */
282 static guint
283 fDate    (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
284
285 /**
286  * 20.2.13, adds the label with Time Value to tree
287  * @param tvb
288  * @param tree
289  * @param offset
290  * @param label
291  * @return modified offset
292  */
293 static guint
294 fTime (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
295
296 /**
297  * 20.2.14, adds Object Identifier to tree
298  * use BIG ENDIAN: Bits 31..22 Object Type, Bits 21..0 Instance Number
299  * @param tvb
300  * @param tree
301  * @param offset
302  * @return modified offset
303  */
304 static guint
305 fObjectIdentifier (tvbuff_t *tvb, proto_tree *tree, guint offset);
306
307 /**
308  * BACnet-Confirmed-Service-Request ::= CHOICE {
309  * }
310  * @param tvb
311  * @param tree
312  * @param offset
313  * @param service_choice
314  * @return offset
315  */
316 static guint
317 fConfirmedServiceRequest (tvbuff_t *tvb, proto_tree *tree, guint offset, gint service_choice);
318
319 /**
320  * BACnet-Confirmed-Service-ACK ::= CHOICE {
321  * }
322  * @param tvb
323  * @param tree
324  * @param offset
325  * @param service_choice
326  * @return offset
327  */
328 static guint
329 fConfirmedServiceAck (tvbuff_t *tvb, proto_tree *tree, guint offset, gint service_choice);
330
331 /**
332  * AcknowledgeAlarm-Request ::= SEQUENCE {
333  *      acknowledgingProcessIdentifier  [0]     Unsigned32,
334  *      eventObjectIdentifier   [1] BACnetObjectIdentifer,
335  *      eventStateAcknowledge   [2] BACnetEventState,
336  *      timeStamp       [3] BACnetTimeStamp,
337  *      acknowledgementSource   [4] Character String,
338  *  timeOfAcknowledgement       [5] BACnetTimeStamp
339  * }
340  * @param tvb
341  * @param tree
342  * @param offset
343  * @return modified offset
344  */
345 static guint
346 fAcknowledgeAlarmRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
347
348 /**
349  * ConfirmedCOVNotification-Request ::= SEQUENCE {
350  *      subscriberProcessIdentifier     [0]     Unsigned32,
351  *      initiatingDeviceIdentifier      [1] BACnetObjectIdentifer,
352  *      monitoredObjectIdentifier       [2] BACnetObjectIdentifer,
353  *      timeRemaining   [3] unsigned,
354  *      listOfValues    [4] SEQUENCE OF BACnetPropertyValues
355  * }
356  * @param tvb
357  * @param tree
358  * @param offset
359  * @return modified offset
360  */
361 static guint
362 fConfirmedCOVNotificationRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
363
364 /**
365  * ConfirmedEventNotification-Request ::= SEQUENCE {
366  *      ProcessIdentifier       [0]     Unsigned32,
367  *      initiatingDeviceIdentifier      [1] BACnetObjectIdentifer,
368  *      eventObjectIdentifier   [2] BACnetObjectIdentifer,
369  *      timeStamp       [3] BACnetTimeStamp,
370  *      notificationClass       [4] unsigned,
371  *      priority        [5] unsigned8,
372  *      eventType       [6] BACnetEventType,
373  *      messageText     [7] CharacterString OPTIONAL,
374  *      notifyType      [8] BACnetNotifyType,
375  *      ackRequired     [9] BOOLEAN OPTIONAL,
376  *      fromState       [10] BACnetEventState OPTIONAL,
377  *      toState [11] BACnetEventState,
378  *      eventValues     [12] BACnetNotificationParameters OPTIONAL
379  * }
380  * @param tvb
381  * @param tree
382  * @param offset
383  * @return modified offset
384  */
385 static guint
386 fConfirmedEventNotificationRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
387
388 /**
389  * GetAlarmSummary-ACK ::= SEQUENCE OF SEQUENCE {
390  *      objectIdentifier        BACnetObjectIdentifer,
391  *      alarmState      BACnetEventState,
392  *      acknowledgedTransitions  BACnetEventTransitionBits
393  * }
394  * @param tvb
395  * @param tree
396  * @param offset
397  * @return modified offset
398  */
399 static guint
400 fGetAlarmSummaryAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
401
402 /**
403  * GetEnrollmentSummary-Request ::= SEQUENCE {
404  *      acknowledgmentFilter    [0]     ENUMERATED {
405  *      all (0),
406  *      acked   (1),
407  *      not-acked   (2)
408  *      },
409  *      enrollmentFilter        [1] BACnetRecipientProcess OPTIONAL,
410  *      eventStateFilter        [2] ENUMERATED {
411  *      offnormal   (0),
412  *      fault   (1),
413  *      normal  (2),
414  *      all (3),
415  *      active  (4)
416  *      },
417  *      eventTypeFilter [3] BACnetEventType OPTIONAL,
418  *      priorityFilter  [4] SEQUENCE {
419  *      minPriority [0] Unsigned8,
420  *      maxPriority [1] Unsigned8
421  *      } OPTIONAL,
422  *  notificationClassFilter     [5] Unsigned OPTIONAL
423  * }
424  * @param tvb
425  * @param tree
426  * @param offset
427  * @return modified offset
428  */
429 static guint
430 fGetEnrollmentSummaryRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
431
432 /**
433  * GetEnrollmentSummary-ACK ::= SEQUENCE OF SEQUENCE {
434  *      objectIdentifier        BACnetObjectIdentifer,
435  *      eventType       BACnetEventType,
436  *      eventState      BACnetEventState,
437  *      priority    Unsigned8,
438  *  notificationClass   Unsigned OPTIONAL
439  * }
440  * @param tvb
441  * @param tree
442  * @param offset
443  * @return modified offset
444  */
445 static guint
446 fGetEnrollmentSummaryAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
447
448 /**
449  * GetEventInformation-Request ::= SEQUENCE {
450  *      lastReceivedObjectIdentifier    [0] BACnetObjectIdentifer
451  * }
452  * @param tvb
453  * @param tree
454  * @param offset
455  * @return modified offset
456  */
457 static guint
458 fGetEventInformationRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
459
460 /**
461  * GetEventInformation-ACK ::= SEQUENCE {
462  *      listOfEventSummaries    [0] listOfEventSummaries,
463  *  moreEvents  [1] BOOLEAN
464  * }
465  * @param tvb
466  * @param tree
467  * @param offset
468  * @return modified offset
469  */
470 static guint
471 fGetEventInformationACK (tvbuff_t *tvb, proto_tree *tree, guint offset);
472
473 /**
474  * LifeSafetyOperation-Request ::= SEQUENCE {
475  *      requestingProcessIdentifier     [0]     Unsigned32
476  *      requestingSource        [1] CharacterString
477  *      request [2] BACnetLifeSafetyOperation
478  *      objectIdentifier        [3] BACnetObjectIdentifier OPTIONAL
479  * }
480  * @param tvb
481  * @param tree
482  * @param offset
483  * @return modified offset
484  */
485 static guint
486 fLifeSafetyOperationRequest(tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
487
488 /**
489  * SubscribeCOV-Request ::= SEQUENCE {
490  *      subscriberProcessIdentifier     [0]     Unsigned32
491  *      monitoredObjectIdentifier       [1] BACnetObjectIdentifier
492  *      issueConfirmedNotifications     [2] BOOLEAN OPTIONAL
493  *      lifetime        [3] Unsigned OPTIONAL
494  * }
495  * @param tvb
496  * @param tree
497  * @param offset
498  * @param label
499  * @param src
500  * @return modified offset
501  */
502 static guint
503 fSubscribeCOVRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
504
505 /**
506  * SubscribeCOVProperty-Request ::= SEQUENCE {
507  *      subscriberProcessIdentifier     [0]     Unsigned32
508  *      monitoredObjectIdentifier       [1] BACnetObjectIdentifier
509  *      issueConfirmedNotifications     [2] BOOLEAN OPTIONAL
510  *      lifetime        [3] Unsigned OPTIONAL
511  *      monitoredPropertyIdentifier     [4] BACnetPropertyReference OPTIONAL
512  *      covIncrement    [5] Unsigned OPTIONAL
513  * }
514  * @param tvb
515  * @param tree
516  * @param offset
517  * @return modified offset
518  */
519 static guint
520 fSubscribeCOVPropertyRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
521
522 /**
523  * AtomicReadFile-Request ::= SEQUENCE {
524  *      fileIdentifier  BACnetObjectIdentifier,
525  *  accessMethod        CHOICE {
526  *      streamAccess    [0] SEQUENCE {
527  *              fileStartPosition       INTEGER,
528  *                      requestedOctetCount     Unsigned
529  *                      },
530  *              recordAccess    [1] SEQUENCE {
531  *                      fileStartRecord INTEGER,
532  *                      requestedRecordCount    Unsigned
533  *                      }
534  *              }
535  * }
536  * @param tvb
537  * @param tree
538  * @param offset
539  * @return modified offset
540  */
541 static guint
542 fAtomicReadFileRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
543
544 /**
545  * AtomicWriteFile-ACK ::= SEQUENCE {
546  *      endOfFile       BOOLEAN,
547  *  accessMethod        CHOICE {
548  *      streamAccess    [0] SEQUENCE {
549  *              fileStartPosition       INTEGER,
550  *                      fileData        OCTET STRING
551  *                      },
552  *              recordAccess    [1] SEQUENCE {
553  *                      fileStartRecord INTEGER,
554  *                      returnedRecordCount     Unsigned,
555  *                      fileRecordData  SEQUENCE OF OCTET STRING
556  *                      }
557  *              }
558  * }
559  * @param tvb
560  * @param tree
561  * @param offset
562  * @return modified offset
563  */
564 static guint
565 fAtomicReadFileAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
566
567 /**
568  * AtomicWriteFile-Request ::= SEQUENCE {
569  *      fileIdentifier  BACnetObjectIdentifier,
570  *  accessMethod        CHOICE {
571  *      streamAccess    [0] SEQUENCE {
572  *              fileStartPosition       INTEGER,
573  *                      fileData        OCTET STRING
574  *                      },
575  *              recordAccess    [1] SEQUENCE {
576  *                      fileStartRecord INTEGER,
577  *                      recordCount     Unsigned,
578  *                      fileRecordData  SEQUENCE OF OCTET STRING
579  *                      }
580  *              }
581  * }
582  * @param tvb
583  * @param tree
584  * @param offset
585  * @return modified offset
586  */
587 static guint
588 fAtomicWriteFileRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
589
590 /**
591  * AtomicWriteFile-ACK ::= SEQUENCE {
592  *              fileStartPosition       [0] INTEGER,
593  *              fileStartRecord [1] INTEGER,
594  * }
595  * @param tvb
596  * @param tree
597  * @param offset
598  * @return modified offset
599  */
600 static guint
601 fAtomicWriteFileAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
602
603 /**
604  * AddListElement-Request ::= SEQUENCE {
605  *      objectIdentifier        [0] BACnetObjectIdentifier,
606  *  propertyIdentifier  [1] BACnetPropertyIdentifier,
607  *  propertyArrayIndex  [2] Unsigned OPTIONAL, -- used only with array datatype
608  *  listOfElements  [3] ABSTRACT-SYNTAX.&Type
609  * }
610  * @param tvb
611  * @param tree
612  * @param offset
613  * @return modified offset
614  */
615 static guint
616 fAddListElementRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
617
618 /**
619  * CreateObject-Request ::= SEQUENCE {
620  *      objectSpecifier [0] ObjectSpecifier,
621  *  listOfInitialValues [1] SEQUENCE OF BACnetPropertyValue OPTIONAL
622  * }
623  * @param tvb
624  * @param tree
625  * @param offset
626  * @return modified offset
627  */
628 static guint
629 fCreateObjectRequest(tvbuff_t *tvb, proto_tree *subtree, guint offset);
630
631 /**
632  * CreateObject-Request ::= BACnetObjectIdentifier
633  * @param tvb
634  * @param tree
635  * @param offset
636  * @return modified offset
637  */
638 static guint
639 fCreateObjectAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
640
641 /**
642  * DeleteObject-Request ::= SEQUENCE {
643  *      ObjectIdentifier        BACnetObjectIdentifer
644  * }
645  * @param tvb
646  * @param tree
647  * @param offset
648  * @return modified offset
649  */
650 static guint
651 fDeleteObjectRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
652
653 /**
654  * ReadProperty-Request ::= SEQUENCE {
655  *      objectIdentifier        [0]     BACnetObjectIdentifier,
656  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
657  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
658  * }
659  * @param tvb
660  * @param tree
661  * @param offset
662  * @return modified offset
663  */
664 static guint
665 fReadPropertyRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
666
667 /**
668  * ReadProperty-ACK ::= SEQUENCE {
669  *      objectIdentifier        [0]     BACnetObjectIdentifier,
670  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
671  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
672  *      propertyValue   [3] ABSTRACT-SYNTAX.&Type
673  * }
674  * @param tvb
675  * @param tree
676  * @param offset
677  * @return modified offset
678  */
679 static guint
680 fReadPropertyAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
681
682 /**
683  * ReadPropertyConditional-Request ::= SEQUENCE {
684  *      objectSelectionCriteria [0] objectSelectionCriteria,
685  *      listOfPropertyReferences        [1] SEQUENCE OF BACnetPropertyReference OPTIONAL
686  * }
687  * @param tvb
688  * @param tree
689  * @param offset
690  * @return modified offset
691  */
692 static guint
693 fReadPropertyConditionalRequest(tvbuff_t *tvb, proto_tree *subtree, guint offset);
694
695 /**
696  * ReadPropertyConditional-ACK ::= SEQUENCE {
697  *      listOfPReadAccessResults        SEQUENCE OF ReadAccessResult OPTIONAL
698  * }
699  * @param tvb
700  * @param tree
701  * @param offset
702  * @return modified offset
703  */
704 static guint
705 fReadPropertyConditionalAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
706
707 /**
708  * ReadPropertyMultiple-Request ::= SEQUENCE {
709  *  listOfReadAccessSpecs       SEQUENCE OF ReadAccessSpecification
710  * }
711  * @param tvb
712  * @param tree
713  * @param offset
714  * @return offset modified
715  */
716 static guint
717 fReadPropertyMultipleRequest(tvbuff_t *tvb, proto_tree *subtree, guint offset);
718
719 /**
720  * ReadPropertyMultiple-Ack ::= SEQUENCE {
721  *  listOfReadAccessResults     SEQUENCE OF ReadAccessResult
722  * }
723  * @param tvb
724  * @param tree
725  * @param offset
726  * @return offset modified
727  */
728 static guint
729 fReadPropertyMultipleAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
730
731 /**
732  * ReadRange-Request ::= SEQUENCE {
733  *      objectIdentifier        [0] BACnetObjectIdentifier,
734  *  propertyIdentifier  [1] BACnetPropertyIdentifier,
735  *  propertyArrayIndex  [2] Unsigned OPTIONAL, -- used only with array datatype
736  *      range   CHOICE {
737  *              byPosition      [3] SEQUENCE {
738  *                      referencedIndex Unsigned,
739  *                      count INTEGER
740  *                      },
741  *              byTime  [4] SEQUENCE {
742  *                      referenceTime BACnetDateTime,
743  *                      count INTEGER
744  *                      },
745  *              timeRange       [5] SEQUENCE {
746  *                      beginningTime BACnetDateTime,
747  *                      endingTime BACnetDateTime
748  *                      },
749  *              } OPTIONAL
750  * }
751  * @param tvb
752  * @param tree
753  * @param offset
754  * @return modified offset
755  */
756 static guint
757 fReadRangeRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
758
759 /**
760  * ReadRange-ACK ::= SEQUENCE {
761  *      objectIdentifier        [0] BACnetObjectIdentifier,
762  *  propertyIdentifier  [1] BACnetPropertyIdentifier,
763  *  propertyArrayIndex  [2] Unsigned OPTIONAL, -- used only with array datatype
764  *  resultFlags [3] BACnetResultFlags,
765  *  itemCount   [4] Unsigned,
766  *  itemData    [5] SEQUENCE OF ABSTRACT-SYNTAX.&Type
767  * }
768  * @param tvb
769  * @param tree
770  * @param offset
771  * @return modified offset
772  */
773 static guint
774 fReadRangeAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
775
776 /**
777  * RemoveListElement-Request ::= SEQUENCE {
778  *      objectIdentifier        [0]     BACnetObjectIdentifier,
779  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
780  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
781  *      listOfElements  [3] ABSTRACT-SYNTAX.&Type
782  * }
783  * @param tvb
784  * @param tree
785  * @param offset
786  * @return modified offset
787  */
788 static guint
789 fRemoveListElementRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
790
791 /**
792  * WriteProperty-Request ::= SEQUENCE {
793  *      objectIdentifier        [0]     BACnetObjectIdentifier,
794  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
795  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
796  *      propertyValue   [3] ABSTRACT-SYNTAX.&Type
797  *  priority    [4] Unsigned8 (1..16) OPTIONAL --used only when property is commandable
798  * }
799  * @param tvb
800  * @param tree
801  * @param offset
802  * @return modified offset
803  */
804 static guint
805 fWritePropertyRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
806
807 /**
808  * WritePropertyMultiple-Request ::= SEQUENCE {
809  *      listOfWriteAccessSpecifications SEQUENCE OF WriteAccessSpecification
810  * }
811  * @param tvb
812  * @param tree
813  * @param offset
814  * @return modified offset
815  */
816 static guint
817 fWritePropertyMultipleRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
818
819 /**
820  * DeviceCommunicationControl-Request ::= SEQUENCE {
821  *      timeDuration    [0] Unsigned16 OPTIONAL,
822  *  enable-disable      [1] ENUMERATED {
823  *              enable (0),
824  *              disable (1)
825  *              },
826  *  password    [2] CharacterString (SIZE(1..20)) OPTIONAL
827  * }
828  * @param tvb
829  * @param tree
830  * @param offset
831  * @return modified offset
832  */
833 static guint
834 fDeviceCommunicationControlRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
835
836 /**
837  * ConfirmedPrivateTransfer-Request ::= SEQUENCE {
838  *      vendorID        [0]     Unsigned,
839  *      serviceNumber   [1] Unsigned,
840  *      serviceParameters       [2] ABSTRACT-SYNTAX.&Type OPTIONAL
841  * }
842  * @param tvb
843  * @param tree
844  * @param offset
845  * @return modified offset
846  */
847 static guint
848 fConfirmedPrivateTransferRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
849
850 /**
851  * ConfirmedPrivateTransfer-ACK ::= SEQUENCE {
852  *      vendorID        [0]     Unsigned,
853  *      serviceNumber   [1] Unsigned,
854  *      resultBlock     [2] ABSTRACT-SYNTAX.&Type OPTIONAL
855  * }
856  * @param tvb
857  * @param tree
858  * @param offset
859  * @return modified offset
860  */
861 static guint
862 fConfirmedPrivateTransferAck(tvbuff_t *tvb, proto_tree *tree, guint offset);
863
864 /**
865  * ConfirmedTextMessage-Request ::=  SEQUENCE {
866  *  textMessageSourceDevice [0] BACnetObjectIdentifier,
867  *  messageClass [1] CHOICE {
868  *      numeric [0] Unsigned,
869  *      character [1] CharacterString
870  *      } OPTIONAL,
871  *  messagePriority [2] ENUMERATED {
872  *      normal (0),
873  *      urgent (1)
874  *      },
875  *  message [3] CharacterString
876  * }
877  * @param tvb
878  * @param tree
879  * @param offset
880  * @return modified offset
881  */
882 static guint
883 fConfirmedTextMessageRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
884
885 /**
886  * ReinitializeDevice-Request ::= SEQUENCE {
887  *  reinitializedStateOfDevice  [0] ENUMERATED {
888  *              coldstart (0),
889  *              warmstart (1),
890  *              startbackup (2),
891  *              endbackup (3),
892  *              startrestore (4),
893  *              endrestore (5),
894  *              abortrestor (6)
895  *              },
896  *  password    [1] CharacterString (SIZE(1..20)) OPTIONAL
897  * }
898  * @param tvb
899  * @param tree
900  * @param offset
901  * @return modified offset
902  */
903 static guint
904 fReinitializeDeviceRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
905
906 /**
907  * VTOpen-Request ::= SEQUENCE {
908  *  vtClass     BACnetVTClass,
909  *  localVTSessionIdentifier    Unsigned8
910  * }
911  * @param tvb
912  * @param tree
913  * @param offset
914  * @return modified offset
915  */
916 static guint
917 fVtOpenRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
918
919 /**
920  * VTOpen-ACK ::= SEQUENCE {
921  *  remoteVTSessionIdentifier   Unsigned8
922  * }
923  * @param tvb
924  * @param tree
925  * @param offset
926  * @return modified offset
927  */
928 static guint
929 fVtOpenAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
930
931 /**
932  * VTClose-Request ::= SEQUENCE {
933  *  listOfRemoteVTSessionIdentifiers    SEQUENCE OF Unsigned8
934  * }
935  * @param tvb
936  * @param tree
937  * @param offset
938  * @return modified offset
939  */
940 static guint
941 fVtCloseRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
942
943 /**
944  * VTData-Request ::= SEQUENCE {
945  *  vtSessionIdentifier Unsigned8,
946  *  vtNewData   OCTET STRING,
947  *  vtDataFlag  Unsigned (0..1)
948  * }
949  * @param tvb
950  * @param tree
951  * @param offset
952  * @return modified offset
953  */
954 static guint
955 fVtDataRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
956
957 /**
958  * VTData-ACK ::= SEQUENCE {
959  *  allNewDataAccepted  [0] BOOLEAN,
960  *  acceptedOctetCount  [1] Unsigned OPTIONAL -- present only if allNewDataAccepted = FALSE
961  * }
962  * @param tvb
963  * @param tree
964  * @param offset
965  * @return modified offset
966  */
967 static guint
968 fVtDataAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
969
970 /**
971  * Authenticate-Request ::= SEQUENCE {
972  *  pseudoRandomNumber  [0] Unsigned32,
973  *  excpectedInvokeID   [1] Unsigned8 OPTIONAL,
974  *  operatorName        [2] CharacterString OPTIONAL,
975  *  operatorPassword    [3] CharacterString (SIZE(1..20)) OPTIONAL,
976  *  startEncypheredSession      [4] BOOLEAN OPTIONAL
977  * }
978  * @param tvb
979  * @param tree
980  * @param offset
981  * @return modified offset
982  */
983 static guint
984 fAuthenticateRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
985
986 /**
987  * Authenticate-ACK ::= SEQUENCE {
988  *  modifiedRandomNumber        Unsigned32,
989  * }
990  * @param tvb
991  * @param tree
992  * @param offset
993  * @return modified offset
994  */
995 static guint
996 fAuthenticateAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
997
998 /**
999  * RequestKey-Request ::= SEQUENCE {
1000  *  requestingDeviceIdentifier  BACnetObjectIdentifier,
1001  *  requestingDeviceAddress     BACnetAddress,
1002  *  remoteDeviceIdentifier      BACnetObjectIdentifier,
1003  *  remoteDeviceAddress BACnetAddress
1004  * }
1005  * @param tvb
1006  * @param tree
1007  * @param offset
1008  * @return modified offset
1009  */
1010 static guint
1011 fRequestKeyRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
1012
1013 /**
1014  * Unconfirmed-Service-Request ::= CHOICE {
1015  * }
1016  * @param tvb
1017  * @param tree
1018  * @param offset
1019  * @param service_choice
1020  * @return modified offset
1021  */
1022 static guint
1023 fUnconfirmedServiceRequest (tvbuff_t *tvb, proto_tree *tree, guint offset, gint service_choice);
1024
1025 /**
1026  * UnconfirmedCOVNotification-Request ::= SEQUENCE {
1027  *      subscriberProcessIdentifier     [0]     Unsigned32,
1028  *      initiatingDeviceIdentifier      [1] BACnetObjectIdentifer,
1029  *      monitoredObjectIdentifier       [2] BACnetObjectIdentifer,
1030  *      timeRemaining   [3] unsigned,
1031  *      listOfValues    [4] SEQUENCE OF BACnetPropertyValues
1032  * }
1033  * @param tvb
1034  * @param tree
1035  * @param offset
1036  * @return modified offset
1037  */
1038 static guint
1039 fUnconfirmedCOVNotificationRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
1040
1041 /**
1042  * UnconfirmedEventNotification-Request ::= SEQUENCE {
1043  *      ProcessIdentifier       [0]     Unsigned32,
1044  *      initiatingDeviceIdentifier      [1] BACnetObjectIdentifer,
1045  *      eventObjectIdentifier   [2] BACnetObjectIdentifer,
1046  *      timeStamp       [3] BACnetTimeStamp,
1047  *      notificationClass       [4] unsigned,
1048  *      priority        [5] unsigned8,
1049  *      eventType       [6] BACnetEventType,
1050  *      messageText     [7] CharacterString OPTIONAL,
1051  *      notifyType      [8] BACnetNotifyType,
1052  *      ackRequired     [9] BOOLEAN OPTIONAL,
1053  *      fromState       [10] BACnetEventState OPTIONAL,
1054  *      toState [11] BACnetEventState,
1055  *      eventValues     [12] BACnetNotificationParameters OPTIONAL
1056  * }
1057  * @param tvb
1058  * @param tree
1059  * @param offset
1060  * @return modified offset
1061  */
1062 static guint
1063 fUnconfirmedEventNotificationRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
1064
1065 /**
1066  * I-Am-Request ::= SEQUENCE {
1067  *      aAmDeviceIdentifier     BACnetObjectIdentifier,
1068  *  maxAPDULengthAccepted       Unsigned,
1069  *      segmentationSupported   BACnetSegmentation,
1070  *      vendorID        Unsigned
1071  * }
1072  * @param tvb
1073  * @param tree
1074  * @param offset
1075  * @return modified offset
1076  */
1077 static guint
1078 fIAmRequest  (tvbuff_t *tvb, proto_tree *tree, guint offset);
1079
1080
1081 /**
1082  * I-Have-Request ::= SEQUENCE {
1083  *      deviceIdentifier        BACnetObjectIdentifier,
1084  *  objectIdentifier    BACnetObjectIdentifier,
1085  *      objectName      CharacterString
1086  * }
1087  * @param tvb
1088  * @param tree
1089  * @param offset
1090  * @return modified offset
1091  */
1092 static guint
1093 fIHaveRequest  (tvbuff_t *tvb, proto_tree *tree, guint offset);
1094
1095 /**
1096  * UnconfirmedPrivateTransfer-Request ::= SEQUENCE {
1097  *      vendorID        [0]     Unsigned,
1098  *      serviceNumber   [1] Unsigned,
1099  *      serviceParameters       [2] ABSTRACT-SYNTAX.&Type OPTIONAL
1100  * }
1101  * @param tvb
1102  * @param tree
1103  * @param offset
1104  * @return modified offset
1105  */
1106 static guint
1107 fUnconfirmedPrivateTransferRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
1108
1109 /**
1110  * UnconfirmedTextMessage-Request ::=  SEQUENCE {
1111  *  textMessageSourceDevice [0] BACnetObjectIdentifier,
1112  *  messageClass [1] CHOICE {
1113  *      numeric [0] Unsigned,
1114  *      character [1] CharacterString
1115  *      } OPTIONAL,
1116  *  messagePriority [2] ENUMERATED {
1117  *      normal (0),
1118  *      urgent (1)
1119  *      },
1120  *  message [3] CharacterString
1121  * }
1122  * @param tvb
1123  * @param tree
1124  * @param offset
1125  * @return modified offset
1126  */
1127 static guint
1128 fUnconfirmedTextMessageRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
1129
1130 /**
1131  * TimeSynchronization-Request ::=  SEQUENCE {
1132  *  BACnetDateTime
1133  * }
1134  * @param tvb
1135  * @param tree
1136  * @param offset
1137  * @return modified offset
1138  */
1139 static guint
1140 fTimeSynchronizationRequest  (tvbuff_t *tvb, proto_tree *tree, guint offset);
1141
1142 /**
1143  * UTCTimeSynchronization-Request ::=  SEQUENCE {
1144  *  BACnetDateTime
1145  * }
1146  * @param tvb
1147  * @param tree
1148  * @param offset
1149  * @return modified offset
1150  */
1151 static guint
1152 fUTCTimeSynchronizationRequest  (tvbuff_t *tvb, proto_tree *tree, guint offset);
1153
1154 /**
1155  * Who-Has-Request ::=  SEQUENCE {
1156  *  limits SEQUENCE {
1157  *      deviceInstanceRangeLowLimit [0] Unsigned (0..4194303),
1158  *      deviceInstanceRangeHighLimit [1] Unsigned (0..4194303)
1159  *      } OPTIONAL,
1160  *  object CHOICE {
1161  *      objectIdentifier [2] BACnetObjectIdentifier,
1162  *      objectName [3] CharacterString
1163  *      }
1164  * }
1165  * @param tvb
1166  * @param tree
1167  * @param offset
1168  * @return modified offset
1169  */
1170 static guint
1171 fWhoHas (tvbuff_t *tvb, proto_tree *tree, guint offset);
1172
1173 /**
1174  * Who-Is-Request ::= SEQUENCE {
1175  *      deviceInstanceRangeLowLimit     [0] Unsigned (0..4194303) OPTIONAL, -- must be used as a pair, see 16.9,
1176  *      deviceInstanceRangeHighLimit    [0] Unsigned (0..4194303) OPTIONAL, -- must be used as a pair, see 16.9,
1177  * }
1178  * @param tvb
1179  * @param tree
1180  * @param offset
1181  * @return modified offset
1182  */
1183 static guint
1184 fWhoIsRequest  (tvbuff_t *tvb, proto_tree *tree, guint offset);
1185
1186 /**
1187  * BACnet-Error ::= CHOICE {
1188  *  addListElement          [8] ChangeList-Error,
1189  *  removeListElement       [9] ChangeList-Error,
1190  *  writePropertyMultiple   [16] WritePropertyMultiple-Error,
1191  *  confirmedPrivatTransfer [18] ConfirmedPrivateTransfer-Error,
1192  *  vtClose                 [22] VTClose-Error,
1193  *  readRange               [26] ObjectAccessService-Error
1194  *                      [default] Error
1195  * }
1196  * @param tvb
1197  * @param tree
1198  * @param offset
1199  * @param service
1200  * @return modified offset
1201  */
1202 static guint
1203 fBACnetError(tvbuff_t *tvb, proto_tree *tree, guint offset, guint service);
1204
1205 /**
1206  * Dissect a BACnetError in a context tag
1207  *
1208  * @param tvb
1209  * @param tree
1210  * @param offset
1211  * @return modified offset
1212  */
1213 static guint fContextTaggedError(tvbuff_t *tvb, proto_tree *tree, guint offset);
1214
1215 /**
1216  * ChangeList-Error ::= SEQUENCE {
1217  *    errorType     [0] Error,
1218  *    firstFailedElementNumber  [1] Unsigned
1219  *    }
1220  * }
1221  * @param tvb
1222  * @param tree
1223  * @param offset
1224  * @return modified offset
1225  */
1226 static guint
1227 fChangeListError(tvbuff_t *tvb, proto_tree *tree, guint offset);
1228
1229 /**
1230  * CreateObject-Error ::= SEQUENCE {
1231  *    errorType     [0] Error,
1232  *    firstFailedElementNumber  [1] Unsigned
1233  *    }
1234  * }
1235  * @param tvb
1236  * @param tree
1237  * @param offset
1238  * @return modified offset
1239  */
1240 static guint
1241 fCreateObjectError(tvbuff_t *tvb, proto_tree *tree, guint offset);
1242
1243 /**
1244  * ConfirmedPrivateTransfer-Error ::= SEQUENCE {
1245  *    errorType     [0] Error,
1246  *    vendorID      [1] Unsigned,
1247  *    serviceNumber [2] Unsigned,
1248  *    errorParameters   [3] ABSTRACT-SYNTAX.&Type OPTIONAL
1249  *    }
1250  * }
1251  * @param tvb
1252  * @param tree
1253  * @param offset
1254  * @return modified offset
1255  */
1256 static guint
1257 fConfirmedPrivateTransferError(tvbuff_t *tvb, proto_tree *tree, guint offset);
1258
1259 /**
1260  * WritePropertyMultiple-Error ::= SEQUENCE {
1261  *    errorType     [0] Error,
1262  *    firstFailedWriteAttempt  [1] Unsigned
1263  *    }
1264  * }
1265  * @param tvb
1266  * @param tree
1267  * @param offset
1268  * @return modified offset
1269  */
1270 static guint
1271 fWritePropertyMultipleError(tvbuff_t *tvb, proto_tree *tree, guint offset);
1272
1273 /**
1274  * VTClose-Error ::= SEQUENCE {
1275  *    errorType     [0] Error,
1276  *    listOfVTSessionIdentifiers  [1] SEQUENCE OF Unsigned8 OPTIONAL
1277  *    }
1278  * }
1279  * @param tvb
1280  * @param tree
1281  * @param offset
1282  * @return modified offset
1283  */
1284 static guint
1285 fVTCloseError(tvbuff_t *tvb, proto_tree *tree, guint offset);
1286
1287 /**
1288  * BACnet Application Types chapter 20.2.1
1289  * @param tvb
1290  * @param tree
1291  * @param offset
1292  * @param label
1293  * @return modified offset
1294  */
1295 static guint
1296 fApplicationTypes   (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
1297
1298 /**
1299  * BACnetActionCommand ::= SEQUENCE {
1300  *  deviceIdentifier    [0] BACnetObjectIdentifier OPTIONAL,
1301  *  objectIdentifier    [1] BACnetObjectIdentifier,
1302  *  propertyIdentifier  [2] BACnetPropertyIdentifier,
1303  *  propertyArrayIndex  [3] Unsigned OPTIONAL, -- used only with array datatype
1304  *  propertyValue       [4] ABSTRACT-SYNTAX.&Type,
1305  *  priority            [5] Unsigned (1..16) OPTIONAL, -- used only when property is commandable
1306  *  postDelay           [6] Unsigned OPTIONAL,
1307  *  quitOnFailure       [7] BOOLEAN,
1308  *  writeSuccessful     [8] BOOLEAN
1309  * }
1310  * @param tvb
1311  * @param tree
1312  * @param offset
1313  * @return modified offset
1314  */
1315 static guint
1316 fActionCommand (tvbuff_t *tvb, proto_tree *tree, guint offset);
1317
1318 /**
1319  * BACnetActionList ::= SEQUENCE {
1320  *  action  [0] SEQUENCE of BACnetActionCommand
1321  * }
1322  * @param tvb
1323  * @param tree
1324  * @param offset
1325  * @return modified offset
1326  */
1327 static guint
1328 fActionList (tvbuff_t *tvb, proto_tree *tree, guint offset);
1329
1330 /** BACnetAddress ::= SEQUENCE {
1331  *  network-number  Unsigned16, -- A value 0 indicates the local network
1332  *  mac-address     OCTET STRING -- A string of length 0 indicates a broadcast
1333  * }
1334  * @param tvb
1335  * @param tree
1336  * @param offset
1337  * @return modified offset
1338  */
1339 static guint
1340 fAddress (tvbuff_t *tvb, proto_tree *tree, guint offset);
1341
1342 /**
1343  * BACnetAddressBinding ::= SEQUENCE {
1344  *      deviceObjectID  BACnetObjectIdentifier
1345  *      deviceAddress   BacnetAddress
1346  * }
1347  * @param tvb
1348  * @param tree
1349  * @param offset
1350  * @return modified offset
1351  */
1352 static guint
1353 fAddressBinding (tvbuff_t *tvb, proto_tree *tree, guint offset);
1354
1355 /**
1356  * BACnetCalendaryEntry ::= CHOICE {
1357  *      date        [0] Date,
1358  *      dateRange   [1] BACnetDateRange,
1359  *  weekNDay    [2] BacnetWeekNday
1360  * }
1361  * @param tvb
1362  * @param tree
1363  * @param offset
1364  * @return modified offset
1365  */
1366 static guint
1367 fCalendaryEntry (tvbuff_t *tvb, proto_tree *tree, guint offset);
1368
1369 #if 0
1370 /**
1371  * BACnetClientCOV ::= CHOICE {
1372  *      real-increment  REAL,
1373  *      default-increment   NULL
1374  * }
1375  * @param tvb
1376  * @param tree
1377  * @param offset
1378  * @return modified offset
1379  */
1380 static guint
1381 fClientCOV (tvbuff_t *tvb, proto_tree *tree, guint offset);
1382 #endif
1383
1384 /**
1385  * BACnetDailySchedule ::= SEQUENCE {
1386  *  day-schedule    [0] SENQUENCE OF BACnetTimeValue
1387  * }
1388  * @param tvb
1389  * @param tree
1390  * @param offset
1391  * @return modified offset
1392  */
1393 static guint
1394 fDailySchedule (tvbuff_t *tvb, proto_tree *tree, guint offset);
1395
1396 /**
1397  * BACnetWeeklySchedule ::= SEQUENCE {
1398  *  week-schedule    SENQUENCE SIZE (7) OF BACnetDailySchedule
1399  * }
1400  * @param tvb
1401  * @param tree
1402  * @param offset
1403  * @return modified offset
1404  */
1405 static guint
1406 fWeeklySchedule (tvbuff_t *tvb, proto_tree *tree, guint offset);
1407
1408 /**
1409  * BACnetDateRange ::= SEQUENCE {
1410  *  StartDate   Date,
1411  *  EndDate     Date
1412  * }
1413  * @param tvb
1414  * @param tree
1415  * @param offset
1416  * @return modified offset
1417  */
1418 static guint
1419 fDateRange (tvbuff_t *tvb, proto_tree *tree, guint offset);
1420
1421 /**
1422  * BACnetDateTime ::= SEQUENCE {
1423  *  date   Date,
1424  *  time   Time
1425  * }
1426  * @param tvb
1427  * @param tree
1428  * @param offset
1429  * @param label
1430  * @return modified offset
1431  */
1432 static guint
1433 fDateTime (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
1434
1435 #if 0
1436 /**
1437  * BACnetDestination ::= SEQUENCE {
1438  *  validDays   BACnetDaysOfWeek,
1439  *  fromTime    Time,
1440  *  toTime      Time,
1441  *  recipient   BACnetRecipient,
1442  *  processIdentifier   Unsigned32,
1443  *  issueConfirmedNotifications BOOLEAN,
1444  *  transitions BACnetEventTransitionBits
1445  * }
1446  * @param tvb
1447  * @param tree
1448  * @param offset
1449  * @return modified offset
1450  */
1451 static guint
1452 fDestination (tvbuff_t *tvb, proto_tree *tree, guint offset);
1453 #endif
1454
1455
1456 /**
1457  * BACnetDeviceObjectPropertyReference ::= SEQUENCE {
1458  *  objectIdentifier    [0] BACnetObjectIdentifier,
1459  *  propertyIdentifier  [1] BACnetPropertyIdentifier,
1460  *  propertyArrayIndex  [2] Unsigend OPTIONAL,
1461  *  deviceIdentifier    [3] BACnetObjectIdentifier OPTIONAL
1462  * }
1463  * @param tvb
1464  * @param tree
1465  * @param offset
1466  * @return modified offset
1467  */
1468 static guint
1469 fDeviceObjectPropertyReference (tvbuff_t *tvb, proto_tree *tree, guint offset);
1470
1471 /**
1472  * BACnetDeviceObjectReference ::= SEQUENCE {
1473  *  deviceIdentifier    [0] BACnetObjectIdentifier OPTIONAL,
1474  *  objectIdentifier    [1] BACnetObjectIdentifier
1475  * }
1476  * @param tvb
1477  * @param tree
1478  * @param offset
1479  * @return modified offset
1480  */
1481 static guint
1482 fDeviceObjectReference (tvbuff_t *tvb, proto_tree *tree, guint offset);
1483
1484 #if 0
1485 /**
1486  * BACnetEventParameter ::= CHOICE {
1487  *      change-of-bitstring [0] SEQUENCE {
1488  *      time-delay [0] Unsigned,
1489  *      bitmask [1] BIT STRING,
1490  *      list-of-bitstring-values [2] SEQUENCE OF BIT STRING
1491  *      },
1492  *  change-of-state [1] SEQUENCE {
1493  *      time-delay [0] Unsigned,
1494  *      list-of-values [1] SEQUENCE OF BACnetPropertyStates
1495  *      },
1496  *   change-of-value [2] SEQUENCE {
1497  *      time-delay [0] Unsigned,
1498  *      cov-criteria [1] CHOICE {
1499  *              bitmask [0] BIT STRING,
1500  *              referenced-property-increment [1] REAL
1501  *                      }
1502  *              },
1503  *      command-failure [3] SEQUENCE {
1504  *              time-delay [0] Unsigned,
1505  *              feedback-property-reference [1] BACnetDeviceObjectPropertyReference
1506  *              },
1507  *      floating-limit [4] SEQUENCE {
1508  *              time-delay [0] Unsigned,
1509  *              setpoint-reference [1] BACnetDeviceObjectPropertyReference,
1510  *              low-diff-limit [2] REAL,
1511  *              high-diff-limit [3] REAL,
1512  *              deadband [4] REAL
1513  *              },
1514  *      out-of-range [5] SEQUENCE {
1515  *              time-delay [0] Unsigned,
1516  *              low-limit [1] REAL,
1517  *              high-limit [2] REAL,
1518  *              deadband [3] REAL
1519  *              },
1520  *      buffer-ready [7] SEQUENCE {
1521  *              notification-threshold [0] Unsigned,
1522  *              previous-notification-count [1] Unsigned32
1523  *              }
1524  *      change-of-life-safety [8] SEQUENCE {
1525  *              time-delay [0] Unsigned,
1526  *              list-of-life-safety-alarm-values [1] SEQUENCE OF BACnetLifeSafetyState,
1527  *              list-of-alarm-values [2] SEQUENCE OF BACnetLifeSafetyState,
1528  *              mode-property-reference [3] BACnetDeviceObjectPropertyReference
1529  *              }
1530  *      }
1531  * @param tvb
1532  * @param tree
1533  * @param offset
1534  * @return modified offset
1535  */
1536 static guint
1537 fEventParameter (tvbuff_t *tvb, proto_tree *tree, guint offset);
1538 #endif
1539
1540
1541
1542 /**
1543  * BACnetLogRecord ::= SEQUENCE {
1544  *      timestamp [0] BACnetDateTime,
1545  *      logDatum [1] CHOICE {
1546  *              log-status [0] BACnetLogStatus,
1547  *              boolean-value [1] BOOLEAN,
1548  *              real-value [2] REAL,
1549  *              enum-value [3] ENUMERATED, -- Optionally limited to 32 bits
1550  *              unsigned-value [4] Unsigned, -- Optionally limited to 32 bits
1551  *              signed-value [5] INTEGER, -- Optionally limited to 32 bits
1552  *              bitstring-value [6] BIT STRING,-- Optionally limited to 32 bits
1553  *              null-value [7] NULL,
1554  *              failure [8] Error,
1555  *              time-change [9] REAL,
1556  *              any-value [10] ABSTRACT-SYNTAX.&Type -- Optional
1557  *              }
1558  *      statusFlags [2] BACnetStatusFlags OPTIONAL
1559  * }
1560  * @param tvb
1561  * @param tree
1562  * @param offset
1563  * @return modified offset
1564  */
1565 static guint
1566 fLogRecord (tvbuff_t *tvb, proto_tree *tree, guint offset);
1567
1568
1569 /**
1570  * BACnetNotificationParameters ::= CHOICE {
1571  *      change-of-bitstring     [0]     SEQUENCE {
1572  *      referenced-bitstring    [0] BIT STRING,
1573  *      status-flags    [1] BACnetStatusFlags
1574  *      },
1575  *  change-of-state [1] SEQUENCE {
1576  *      new-state   [0] BACnetPropertyStatus,
1577  *      status-flags    [1] BACnetStatusFlags
1578  *      },
1579  *  change-of-value [2] SEQUENCE {
1580  *      new-value   [0] CHOICE {
1581  *          changed-bits   [0] BIT STRING,
1582  *          changed-value    [1] REAL
1583  *          },
1584  *      status-flags    [1] BACnetStatusFlags
1585  *      },
1586  *  command-failure [3] SEQUENCE {
1587  *      command-value   [0] ABSTRACT-SYNTAX.&Type, -- depends on ref property
1588  *      status-flags    [1] BACnetStatusFlags
1589  *      feedback-value    [2] ABSTRACT-SYNTAX.&Type -- depends on ref property
1590  *      },
1591  *  floating-limit [4]  SEQUENCE {
1592  *      reference-value   [0] REAL,
1593  *      status-flags    [1] BACnetStatusFlags
1594  *      setpoint-value   [2] REAL,
1595  *      error-limit   [3] REAL
1596  *      },
1597  *  out-of-range [5]    SEQUENCE {
1598  *      exceeding-value   [0] REAL,
1599  *      status-flags    [1] BACnetStatusFlags
1600  *      deadband   [2] REAL,
1601  *      exceeded-limit   [0] REAL
1602  *      },
1603  *  complex-event-type  [6] SEQUENCE OF BACnetPropertyValue,
1604  *  buffer-ready [7]    SEQUENCE {
1605  *      buffer-device   [0] BACnetObjectIdentifier,
1606  *      buffer-object    [1] BACnetObjectIdentifier
1607  *      previous-notification   [2] BACnetDateTime,
1608  *      current-notification   [3] BACnetDateTime
1609  *      },
1610  *  change-of-life-safety [8]   SEQUENCE {
1611  *      new-state   [0] BACnetLifeSafetyState,
1612  *      new-mode    [1] BACnetLifeSafetyState
1613  *      status-flags   [2] BACnetStatusFlags,
1614  *      operation-expected   [3] BACnetLifeSafetyOperation
1615  *      }
1616  * }
1617  * @param tvb
1618  * @param tree
1619  * @param offset
1620  * @return modified offset
1621  */
1622 static guint
1623 fNotificationParameters (tvbuff_t *tvb, proto_tree *tree, guint offset);
1624
1625 /**
1626  * BACnetObjectPropertyReference ::= SEQUENCE {
1627  *      objectIdentifier        [0] BACnetObjectIdentifier,
1628  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
1629  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
1630  * }
1631  * @param tvb
1632  * @param tree
1633  * @param offset
1634  * @return modified offset
1635  */
1636 static guint
1637 fBACnetObjectPropertyReference (tvbuff_t *tvb, proto_tree *tree, guint offset);
1638
1639 #if 0
1640 /**
1641  * BACnetObjectPropertyValue ::= SEQUENCE {
1642  *              objectIdentifier [0] BACnetObjectIdentifier,
1643  *              propertyIdentifier [1] BACnetPropertyIdentifier,
1644  *              propertyArrayIndex [2] Unsigned OPTIONAL, -- used only with array datatype
1645  *                              -- if omitted with an array the entire array is referenced
1646  *              value [3] ABSTRACT-SYNTAX.&Type, --any datatype appropriate for the specified property
1647  *              priority [4] Unsigned (1..16) OPTIONAL
1648  * }
1649  * @param tvb
1650  * @param tree
1651  * @param offset
1652  * @return modified offset
1653  */
1654 static guint
1655 fObjectPropertyValue (tvbuff_t *tvb, proto_tree *tree, guint offset);
1656 #endif
1657
1658 /**
1659  * BACnetPriorityArray ::= SEQUENCE SIZE (16) OF BACnetPriorityValue
1660  * @param tvb
1661  * @param tree
1662  * @param offset
1663  * @return modified offset
1664  */
1665 static guint
1666 fPriorityArray (tvbuff_t *tvb, proto_tree *tree, guint offset);
1667
1668 static guint
1669 fPropertyReference (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 tagoffset, guint8 list);
1670
1671 /**
1672  * BACnetPropertyReference ::= SEQUENCE {
1673  *      propertyIdentifier      [0] BACnetPropertyIdentifier,
1674  *      propertyArrayIndex      [1] Unsigned OPTIONAL, -- used only with array datatype
1675  * }
1676  * @param tvb
1677  * @param tree
1678  * @param offset
1679  * @return modified offset
1680  */
1681 static guint
1682 fBACnetPropertyReference (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 list);
1683
1684 static guint
1685 fBACnetObjectPropertyReference (tvbuff_t *tvb, proto_tree *tree, guint offset);
1686
1687 static guint
1688 fLOPR (tvbuff_t *tvb, proto_tree *tree, guint offset);
1689
1690 static guint
1691 fRestartReason (tvbuff_t *tvb, proto_tree *tree, guint offset);
1692
1693 /**
1694  * BACnetPropertyValue ::= SEQUENCE {
1695  *              PropertyIdentifier [0] BACnetPropertyIdentifier,
1696  *              propertyArrayIndex [1] Unsigned OPTIONAL, -- used only with array datatypes
1697  *                              -- if omitted with an array the entire array is referenced
1698  *              value [2] ABSTRACT-SYNTAX.&Type, -- any datatype appropriate for the specified property
1699  *              priority [3] Unsigned (1..16) OPTIONAL -- used only when property is commandable
1700  * }
1701  * @param tvb
1702  * @param tree
1703  * @param offset
1704  * @return modified offset
1705  */
1706 static guint
1707 fBACnetPropertyValue (tvbuff_t *tvb, proto_tree *tree, guint offset);
1708
1709 static guint
1710 fPropertyValue (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 tagoffset);
1711
1712 /**
1713  * BACnet Application PDUs chapter 21
1714  * BACnetRecipient::= CHOICE {
1715  *      device  [0] BACnetObjectIdentifier
1716  *      address [1] BACnetAddress
1717  * }
1718  * @param tvb
1719  * @param tree
1720  * @param offset
1721  * @return modified offset
1722  */
1723 static guint
1724 fRecipient (tvbuff_t *tvb, proto_tree *tree, guint offset);
1725
1726 /**
1727  * BACnet Application PDUs chapter 21
1728  * BACnetRecipientProcess::= SEQUENCE {
1729  *      recipient       [0] BACnetRecipient
1730  *      processID       [1] Unsigned32
1731  * }
1732  * @param tvb
1733  * @param tree
1734  * @param offset
1735  * @return modified offset
1736  */
1737 static guint
1738 fRecipientProcess (tvbuff_t *tvb, proto_tree *tree, guint offset);
1739
1740 #if 0
1741 /**
1742  * BACnetSessionKey ::= SEQUENCE {
1743  *      sessionKey      OCTET STRING (SIZE(8)), -- 56 bits for key, 8 bits for checksum
1744  *      peerAddress     BACnetAddress
1745  * }
1746  * @param tvb
1747  * @param tree
1748  * @param offset
1749  * @return modified offset
1750  * @todo check if checksum is displayed correctly
1751  */
1752 static guint
1753 fSessionKey (tvbuff_t *tvb, proto_tree *tree, guint offset);
1754 #endif
1755
1756 #if 0
1757 /**
1758  * BACnetSetpointReference ::= SEQUENCE {
1759  *      sessionKey      [0] BACnetObjectPropertyReference OPTIONAL
1760  * }
1761  * @param tvb
1762  * @param tree
1763  * @param offset
1764  * @return modified offset
1765  */
1766 static guint
1767 fSetpointReference (tvbuff_t *tvb, proto_tree *tree, guint offset);
1768 #endif
1769
1770 /**
1771  * BACnetSpecialEvent ::= SEQUENCE {
1772  *      period          CHOICE {
1773  *              calendarEntry           [0] BACnetCalendarEntry,
1774  *              calendarRefernce        [1] BACnetObjectIdentifier
1775  *              },
1776  *              listOfTimeValues        [2] SEQUENCE OF BACnetTimeValue,
1777  *              eventPriority           [3] Unsigned (1..16)
1778  * }
1779  * @param tvb
1780  * @param tree
1781  * @param offset
1782  * @return modified offset
1783  */
1784 static guint
1785 fSpecialEvent (tvbuff_t *tvb, proto_tree *tree, guint offset);
1786
1787 /**
1788  * BACnetTimeStamp ::= CHOICE {
1789  *      time                    [0] Time,
1790  *      sequenceNumber  [1] Unsigned (0..65535),
1791  *      dateTime                [2] BACnetDateTime
1792  * }
1793  * @param tvb
1794  * @param tree
1795  * @param offset
1796  * @param label
1797  * @return modified offset
1798  */
1799 static guint
1800 fTimeStamp (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
1801
1802 /**
1803  * BACnetTimeValue ::= SEQUENCE {
1804  *      time    Time,
1805  *      value   ABSTRACT-SYNTAX.&Type -- any primitive datatype, complex types cannot be decoded
1806  * }
1807  * @param tvb
1808  * @param tree
1809  * @param offset
1810  * @return modified offset
1811  */
1812 static guint
1813 fTimeValue (tvbuff_t *tvb, proto_tree *tree, guint offset);
1814
1815 #if 0
1816 /**
1817  * BACnetVTSession ::= SEQUENCE {
1818  *      local-vtSessionID       Unsigned8,
1819  *      remote-vtSessionID      Unsigned8,
1820  *      remote-vtAddress        BACnetAddress
1821  * }
1822  * @param tvb
1823  * @param tree
1824  * @param offset
1825  * @return modified offset
1826  */
1827 static guint
1828 fVTSession (tvbuff_t *tvb, proto_tree *tree, guint offset);
1829 #endif
1830
1831 /**
1832  * BACnetWeekNDay ::= OCTET STRING (SIZE (3))
1833  * -- first octet month (1..12) January = 1, X'FF' = any month
1834  * -- second octet weekOfMonth where: 1 = days numbered 1-7
1835  * -- 2 = days numbered 8-14
1836  * -- 3 = days numbered 15-21
1837  * -- 4 = days numbered 22-28
1838  * -- 5 = days numbered 29-31
1839  * -- 6 = last 7 days of this month
1840  * -- X'FF' = any week of this month
1841  * -- third octet dayOfWeek (1..7) where 1 = Monday
1842  * -- 7 = Sunday
1843  * -- X'FF' = any day of week
1844  * @param tvb
1845  * @param tree
1846  * @param offset
1847  * @return modified offset
1848  */
1849 static guint
1850 fWeekNDay (tvbuff_t *tvb, proto_tree *tree, guint offset);
1851
1852 /**
1853  * ReadAccessResult ::= SEQUENCE {
1854  *      objectIdentifier        [0] BACnetObjectIdentifier,
1855  *      listOfResults   [1] SEQUENCE OF SEQUENCE {
1856  *              propertyIdentifier      [2] BACnetPropertyIdentifier,
1857  *              propertyArrayIndex      [3] Unsigned OPTIONAL, -- used only with array datatype if omitted with an array the entire array is referenced
1858  *              readResult      CHOICE {
1859  *                      propertyValue   [4] ABSTRACT-SYNTAX.&Type,
1860  *                      propertyAccessError     [5] Error
1861  *              }
1862  *  } OPTIONAL
1863  * }
1864  * @param tvb
1865  * @param tree
1866  * @param offset
1867  * @return modified offset
1868  */
1869 static guint
1870 fReadAccessResult (tvbuff_t *tvb, proto_tree *tree, guint offset);
1871
1872 /**
1873  * ReadAccessSpecification ::= SEQUENCE {
1874  *      objectIdentifier        [0] BACnetObjectIdentifier,
1875  *      listOfPropertyReferences        [1] SEQUENCE OF BACnetPropertyReference
1876  * }
1877  * @param tvb
1878  * @param tree
1879  * @param offset
1880  * @return modified offset
1881  */
1882 static guint
1883 fReadAccessSpecification (tvbuff_t *tvb, proto_tree *subtree, guint offset);
1884
1885 /**
1886  * WriteAccessSpecification ::= SEQUENCE {
1887  *      objectIdentifier        [0] BACnetObjectIdentifier,
1888  *      listOfProperty  [1] SEQUENCE OF BACnetPropertyValue
1889  * }
1890  * @param tvb
1891  * @param tree
1892  * @param offset
1893  * @return modified offset
1894  */
1895 static guint
1896 fWriteAccessSpecification (tvbuff_t *tvb, proto_tree *subtree, guint offset);
1897
1898
1899 /********************************************************* Helper functions *******************************************/
1900
1901 /**
1902  * extracts the tag number from the tag header.
1903  * @param tvb "TestyVirtualBuffer"
1904  * @param offset in actual tvb
1905  * @return Tag Number corresponding to BACnet 20.2.1.2 Tag Number
1906  */
1907 static guint
1908 fTagNo (tvbuff_t *tvb, guint offset);
1909
1910 /**
1911  * splits Tag Header coresponding to 20.2.1 General Rules For BACnet Tags
1912  * @param tvb = "TestyVirtualBuffer"
1913  * @param offset = offset in actual tvb
1914  * @return tag_no BACnet 20.2.1.2 Tag Number
1915  * @return class_tag BACnet 20.2.1.1 Class
1916  * @return lvt BACnet 20.2.1.3 Length/Value/Type
1917  * @return offs = length of this header
1918  */
1919
1920 static guint
1921 fTagHeader (tvbuff_t *tvb, guint offset, guint8 *tag_no, guint8* class_tag, guint32 *lvt);
1922
1923
1924 /**
1925  * adds processID with max 32Bit unsigned Integer Value to tree
1926  * @param tvb
1927  * @param tree
1928  * @param offset
1929  * @return modified offset
1930  */
1931 static guint
1932 fProcessId (tvbuff_t *tvb, proto_tree *tree, guint offset);
1933
1934 /**
1935  * adds timeSpan with max 32Bit unsigned Integer Value to tree
1936  * @param tvb
1937  * @param tree
1938  * @param offset
1939  * @return modified offset
1940  */
1941 static guint
1942 fTimeSpan (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
1943
1944 /**
1945  * BACnet Application PDUs chapter 21
1946  * BACnetPropertyIdentifier::= ENUMERATED {
1947  *       @see bacapp_property_identifier
1948  * }
1949  * @param tvb
1950  * @param tree
1951  * @param offset
1952  * @param tt returnvalue of this item
1953  * @return modified offset
1954  */
1955 static guint
1956 fPropertyIdentifier (tvbuff_t *tvb, proto_tree *tree, guint offset);
1957
1958 /**
1959  * BACnet Application PDUs chapter 21
1960  * BACnetPropertyArrayIndex::= ENUMERATED {
1961  *       @see bacapp_property_array_index
1962  * }
1963  * @param tvb
1964  * @param tree
1965  * @param offset
1966  * @param tt returnvalue of this item
1967  * @return modified offset
1968  */
1969 static guint
1970 fPropertyArrayIndex (tvbuff_t *tvb, proto_tree *tree, guint offset);
1971
1972 /**
1973  * listOfEventSummaries ::= SEQUENCE OF SEQUENCE {
1974  *      objectIdentifier        [0] BACnetObjectIdentifier,
1975  *  eventState  [1] BACnetEventState,
1976  *  acknowledgedTransitions [2] BACnetEventTransitionBits,
1977  *  eventTimeStamps [3] SEQURNCE SIZE (3) OF BACnetTimeStamps,
1978  *  notifyType  [4] BACnetNotifyType,
1979  *  eventEnable [5] BACnetEventTransitionBits,
1980  *  eventPriorities [6] SEQUENCE SIZE (3) OF Unsigned
1981  * }
1982  * @param tvb
1983  * @param tree
1984  * @param offset
1985  * @return modified offset
1986  */
1987 static guint
1988 flistOfEventSummaries (tvbuff_t *tvb, proto_tree *tree, guint offset);
1989
1990 /**
1991  * SelectionCriteria ::= SEQUENCE {
1992  *      propertyIdentifier      [0] BACnetPropertyIdentifier,
1993  *      propertyArrayIndex      [1] Unsigned OPTIONAL, -- used only with array datatype
1994  *  relationSpecifier   [2] ENUMERATED { bacapp_relationSpecifier },
1995  *  comparisonValue     [3] ABSTRACT-SYNTAX.&Type
1996  * }
1997  * @param tvb
1998  * @param tree
1999  * @param offset
2000  * @return modified offset
2001  */
2002 static guint
2003 fSelectionCriteria (tvbuff_t *tvb, proto_tree *tree, guint offset);
2004
2005 /**
2006  * objectSelectionCriteria ::= SEQUENCE {
2007  *      selectionLogic  [0] ENUMERATED { bacapp_selectionLogic },
2008  *      listOfSelectionCriteria [1] SelectionCriteria
2009  * }
2010  * @param tvb
2011  * @param tree
2012  * @param offset
2013  * @return modified offset
2014  */
2015 static guint
2016 fObjectSelectionCriteria (tvbuff_t *tvb, proto_tree *subtree, guint offset);
2017
2018 /**
2019  * BACnet-Error ::= SEQUENCE {
2020  *    error-class ENUMERATED {},
2021  *    error-code  ENUMERATED {}
2022  *    }
2023  * }
2024  * @param tvb
2025  * @param tree
2026  * @param offset
2027  * @return modified offset
2028  */
2029 static guint
2030 fError(tvbuff_t *tvb, proto_tree *tree, guint offset);
2031
2032 /**
2033  * Generic handler for context tagged values.  Mostly for handling
2034  * vendor-defined properties and services.
2035  * @param tvb
2036  * @param tree
2037  * @param offset
2038  * @return modified offset
2039  * @todo beautify this ugly construct
2040  */
2041 static guint
2042 fContextTaggedValue(tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
2043
2044 /**
2045  * realizes some ABSTRACT-SYNTAX.&Type
2046  * @param tvb
2047  * @param tree
2048  * @param offset
2049  * @return modified offset
2050  * @todo beautify this ugly construct
2051  */
2052 static guint
2053 fAbstractSyntaxNType (tvbuff_t *tvb, proto_tree *tree, guint offset);
2054
2055 /**
2056  * register_bacapp
2057  */
2058 void
2059 proto_register_bacapp(void);
2060
2061 /**
2062  * proto_reg_handoff_bacapp
2063  */
2064 void
2065 proto_reg_handoff_bacapp(void);
2066
2067 /**
2068  * converts XXX coded strings to UTF-8
2069  * else 'in' is copied to 'out'
2070  * @param in  -- pointer to string
2071  * @param inbytesleft
2072  * @param out -- pointer to string
2073  * @param outbytesleft
2074  * @param fromcoding
2075  * @return count of modified characters of returned string, -1 for errors
2076  */
2077 guint32
2078 fConvertXXXtoUTF8(gchar *in, gsize *inbytesleft, gchar *out, gsize *outbytesleft, const gchar *fromcoding);
2079
2080 static void
2081 uni_to_string(char * data, gsize str_length, char *dest_buf);
2082
2083 #endif /* __BACAPP_H__ */
2084
2085