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