debdeca4a7d528508153dbe84e6cc5cfe4ab132c
[obnox/wireshark/wip.git] / epan / dissectors / packet-bacapp.c
1 /* packet-bacapp.c
2  * Routines for BACnet (APDU) dissection
3  * Copyright 2001, Hartmut Mueller <hartmut[AT]abmlinux.org>, FH Dortmund
4  * Enhanced by Steve Karg, 2005, <skarg[AT]users.sourceforge.net>, Atlanta
5  * Enhanced by Herbert Lischka, 2005, <lischka[AT]kieback-peter.de>, Berlin
6  *
7  * $Id$
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald[AT]wireshark.org>
11  * Copyright 1998 Gerald Combs
12  *
13  * Copied from README.developer,v 1.23
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28  */
29
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
33
34 #include <stdlib.h>
35 #include <string.h>
36
37 #include <glib.h>
38
39 #include <epan/packet.h>
40 #include <epan/reassemble.h>
41 #include <epan/expert.h>
42
43 /* formerly bacapp.h  contains definitions and forward declarations */
44
45 #ifndef FAULT
46 #define FAULT                   proto_tree_add_text(subtree, tvb, offset, tvb_length(tvb) - offset, "something is going wrong here !!"); \
47         offset = tvb_length(tvb);
48 #endif
49
50 /* BACnet PDU Types */
51 #define BACAPP_TYPE_CONFIRMED_SERVICE_REQUEST 0
52 #define BACAPP_TYPE_UNCONFIRMED_SERVICE_REQUEST 1
53 #define BACAPP_TYPE_SIMPLE_ACK 2
54 #define BACAPP_TYPE_COMPLEX_ACK 3
55 #define BACAPP_TYPE_SEGMENT_ACK 4
56 #define BACAPP_TYPE_ERROR 5
57 #define BACAPP_TYPE_REJECT 6
58 #define BACAPP_TYPE_ABORT 7
59 #define MAX_BACAPP_TYPE 8
60
61 #define BACAPP_SEGMENTED_REQUEST 0x08
62 #define BACAPP_MORE_SEGMENTS 0x04
63 #define BACAPP_SEGMENTED_RESPONSE 0x02
64 #define BACAPP_SEGMENT_NAK 0x02
65 #define BACAPP_SENT_BY 0x01
66
67
68 /**
69  * dissect_bacapp ::= CHOICE {
70  *  confirmed-request-PDU       [0] BACnet-Confirmed-Request-PDU,
71  *  unconfirmed-request-PDU     [1] BACnet-Unconfirmed-Request-PDU,
72  *  simpleACK-PDU               [2] BACnet-SimpleACK-PDU,
73  *  complexACK-PDU              [3] BACnet-ComplexACK-PDU,
74  *  segmentACK-PDU              [4] BACnet-SegmentACK-PDU,
75  *  error-PDU                   [5] BACnet-Error-PDU,
76  *  reject-PDU                  [6] BACnet-Reject-PDU,
77  *  abort-PDU                   [7] BACnet-Abort-PDU
78  * }
79  * @param tvb
80  * @param pinfo
81  * @param tree
82  **/
83 static void
84 dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
85
86 /**
87  * ConfirmedRequest-PDU ::= SEQUENCE {
88  *      pdu-type                                        [0] Unsigned (0..15), -- 0 for this PDU Type
89  *  segmentedMessage                    [1] BOOLEAN,
90  *  moreFollows                                 [2] BOOLEAN,
91  *  segmented-response-accepted [3] BOOLEAN,
92  *  reserved                                    [4] Unsigned (0..3), -- must be set zero
93  *  max-segments-accepted               [5] Unsigned (0..7), -- as per 20.1.2.4
94  *  max-APDU-length-accepted    [5] Unsigned (0..15), -- as per 20.1.2.5
95  *  invokeID                                    [6] Unsigned (0..255),
96  *  sequence-number                             [7] Unsigned (0..255) OPTIONAL, -- only if segmented msg
97  *  proposed-window-size                [8] Unsigned (0..127) OPTIONAL, -- only if segmented msg
98  *  service-choice                              [9] BACnetConfirmedServiceChoice,
99  *  service-request                             [10] BACnet-Confirmed-Service-Request OPTIONAL
100  * }
101  * @param tvb
102  * @param pinfo
103  * @param tree
104  * @param offset
105  * @return modified offset
106  */
107 static guint
108 fConfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
109
110 /**
111  * @param tvb
112  * @param pinfo
113  * @param tree
114  * @param offset
115  * @param ack - indocates whether working on request or ack
116  * @param svc - output variable to return service choice
117  * @param tt  - output varable to return service choice item
118  * @return modified offset
119  */
120 static guint
121 fStartConfirmed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 ack,
122                                 gint *svc, proto_item **tt);
123
124 /**
125  * Unconfirmed-Request-PDU ::= SEQUENCE {
126  *      pdu-type                [0] Unsigned (0..15), -- 1 for this PDU type
127  *  reserved            [1] Unsigned (0..15), -- must be set zero
128  *  service-choice      [2] BACnetUnconfirmedServiceChoice,
129  *  service-request     [3] BACnetUnconfirmedServiceRequest -- Context-specific tags 0..3 are NOT used in header encoding
130  * }
131  * @param tvb
132  * @param pinfo
133  * @param tree
134  * @param offset
135  * @return modified offset
136  */
137 static guint
138 fUnconfirmedRequestPDU(tvbuff_t *tvb, packet_info *pinfo, 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 pinfo
149  * @param tree
150  * @param offset
151  * @return modified offset
152  */
153 static guint
154 fSimpleAckPDU(tvbuff_t *tvb, packet_info *pinfo, 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 pinfo
170  * @param tree
171  * @param offset
172  * @return modified offset
173  */
174 static guint
175 fComplexAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
176
177 /**
178  * SegmentACK-PDU ::= SEQUENCE {
179  *      pdu-type                                [0] Unsigned (0..15), -- 4 for this PDU Type
180  *  reserved                            [1] Unsigned (0..3), -- must be set zero
181  *  negative-ACK                        [2] BOOLEAN,
182  *  server                                      [3] BOOLEAN,
183  *  original-invokeID           [4] Unsigned (0..255),
184  *  sequence-number                     [5] Unsigned (0..255),
185  *  actual-window-size          [6] Unsigned (0..127)
186  * }
187  * @param tvb
188  * @param pinfo
189  * @param tree
190  * @param offset
191  * @return modified offset
192  */
193 static guint
194 fSegmentAckPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
195
196 /**
197  * Error-PDU ::= SEQUENCE {
198  *      pdu-type                                [0] Unsigned (0..15), -- 5 for this PDU Type
199  *  reserved                            [1] Unsigned (0..3), -- must be set zero
200  *  original-invokeID           [2] Unsigned (0..255),
201  *  error-choice                        [3] BACnetConfirmedServiceChoice,
202  *  error                                       [4] BACnet-Error
203  * }
204  * @param tvb
205  * @param pinfo
206  * @param tree
207  * @param offset
208  * @return modified offset
209  */
210 static guint
211 fErrorPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
212
213 /**
214  * Reject-PDU ::= SEQUENCE {
215  *      pdu-type                                [0] Unsigned (0..15), -- 6 for this PDU Type
216  *  reserved                            [1] Unsigned (0..3), -- must be set zero
217  *  original-invokeID           [2] Unsigned (0..255),
218  *  reject-reason                       [3] BACnetRejectReason
219  * }
220  * @param tvb
221  * @param pinfo
222  * @param tree
223  * @param offset
224  * @return modified offset
225  */
226 static guint
227 fRejectPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
228
229 /**
230  * Abort-PDU ::= SEQUENCE {
231  *      pdu-type                                [0] Unsigned (0..15), -- 7 for this PDU Type
232  *  reserved                            [1] Unsigned (0..3), -- must be set zero
233  *  server                                      [2] BOOLEAN,
234  *  original-invokeID           [3] Unsigned (0..255),
235  *  abort-reason                        [4] BACnetAbortReason
236  * }
237  * @param tvb
238  * @param pinfo
239  * @param tree
240  * @param offset
241  * @return modified offset
242  */
243 static guint
244 fAbortPDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
245
246 /**
247  * 20.2.4, adds the label with max 64Bit unsigned Integer Value to tree
248  * @param tvb
249  * @param tree
250  * @param offset
251  * @param label
252  * @return modified offset
253  */
254 static guint
255 fUnsignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
256
257 /**
258  * 20.2.5, adds the label with max 64Bit signed Integer Value to tree
259  * @param tvb
260  * @param tree
261  * @param offset
262  * @param label
263  * @return modified offset
264  */
265 static guint
266 fSignedTag (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
267
268 /**
269  * 20.2.8, adds the label with Octet String to tree; if lvt == 0 then lvt = restOfFrame
270  * @param tvb
271  * @param tree
272  * @param offset
273  * @param label
274  * @param lvt length of String
275  * @return modified offset
276  */
277 static guint
278 fOctetString (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label, guint32 lvt);
279
280 /**
281  * 20.2.12, adds the label with Date Value to tree
282  * @param tvb
283  * @param tree
284  * @param offset
285  * @param label
286  * @return modified offset
287  */
288 static guint
289 fDate    (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
290
291 /**
292  * 20.2.13, adds the label with Time Value to tree
293  * @param tvb
294  * @param tree
295  * @param offset
296  * @param label
297  * @return modified offset
298  */
299 static guint
300 fTime (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
301
302 /**
303  * 20.2.14, adds Object Identifier to tree
304  * use BIG ENDIAN: Bits 31..22 Object Type, Bits 21..0 Instance Number
305  * @param tvb
306  * @param pinfo
307  * @param tree
308  * @param offset
309  * @return modified offset
310  */
311 static guint
312 fObjectIdentifier (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
313
314 /**
315  * BACnet-Confirmed-Service-Request ::= CHOICE {
316  * }
317  * @param tvb
318  * @param pinfo
319  * @param tree
320  * @param offset
321  * @param service_choice
322  * @return offset
323  */
324 static guint
325 fConfirmedServiceRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice);
326
327 /**
328  * BACnet-Confirmed-Service-ACK ::= CHOICE {
329  * }
330  * @param tvb
331  * @param pinfo
332  * @param tree
333  * @param offset
334  * @param service_choice
335  * @return offset
336  */
337 static guint
338 fConfirmedServiceAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice);
339
340 /**
341  * AcknowledgeAlarm-Request ::= SEQUENCE {
342  *      acknowledgingProcessIdentifier  [0]     Unsigned32,
343  *      eventObjectIdentifier   [1] BACnetObjectIdentifer,
344  *      eventStateAcknowledge   [2] BACnetEventState,
345  *      timeStamp       [3] BACnetTimeStamp,
346  *      acknowledgementSource   [4] Character String,
347  *  timeOfAcknowledgement       [5] BACnetTimeStamp
348  * }
349  * @param tvb
350  * @param pinfo
351  * @param tree
352  * @param offset
353  * @return modified offset
354  */
355 static guint
356 fAcknowledgeAlarmRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
357
358 /**
359  * ConfirmedCOVNotification-Request ::= SEQUENCE {
360  *      subscriberProcessIdentifier     [0]     Unsigned32,
361  *      initiatingDeviceIdentifier      [1] BACnetObjectIdentifer,
362  *      monitoredObjectIdentifier       [2] BACnetObjectIdentifer,
363  *      timeRemaining   [3] unsigned,
364  *      listOfValues    [4] SEQUENCE OF BACnetPropertyValues
365  * }
366  * @param tvb
367  * @param pinfo
368  * @param tree
369  * @param offset
370  * @return modified offset
371  */
372 static guint
373 fConfirmedCOVNotificationRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
374
375 /**
376  * ConfirmedEventNotification-Request ::= SEQUENCE {
377  *      ProcessIdentifier       [0]     Unsigned32,
378  *      initiatingDeviceIdentifier      [1] BACnetObjectIdentifer,
379  *      eventObjectIdentifier   [2] BACnetObjectIdentifer,
380  *      timeStamp       [3] BACnetTimeStamp,
381  *      notificationClass       [4] unsigned,
382  *      priority        [5] unsigned8,
383  *      eventType       [6] BACnetEventType,
384  *      messageText     [7] CharacterString OPTIONAL,
385  *      notifyType      [8] BACnetNotifyType,
386  *      ackRequired     [9] BOOLEAN OPTIONAL,
387  *      fromState       [10] BACnetEventState OPTIONAL,
388  *      toState [11] BACnetEventState,
389  *      eventValues     [12] BACnetNotificationParameters OPTIONAL
390  * }
391  * @param tvb
392  * @param pinfo
393  * @param tree
394  * @param offset
395  * @return modified offset
396  */
397 static guint
398 fConfirmedEventNotificationRequest (tvbuff_t *tvb, packet_info *pinfo,  proto_tree *tree, guint offset);
399
400 /**
401  * GetAlarmSummary-ACK ::= SEQUENCE OF SEQUENCE {
402  *      objectIdentifier        BACnetObjectIdentifer,
403  *      alarmState      BACnetEventState,
404  *      acknowledgedTransitions  BACnetEventTransitionBits
405  * }
406  * @param tvb
407  * @param pinfo
408  * @param tree
409  * @param offset
410  * @return modified offset
411  */
412 static guint
413 fGetAlarmSummaryAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
414
415 /**
416  * GetEnrollmentSummary-Request ::= SEQUENCE {
417  *      acknowledgmentFilter    [0]     ENUMERATED {
418  *      all (0),
419  *      acked   (1),
420  *      not-acked   (2)
421  *      },
422  *      enrollmentFilter        [1] BACnetRecipientProcess OPTIONAL,
423  *      eventStateFilter        [2] ENUMERATED {
424  *      offnormal   (0),
425  *      fault   (1),
426  *      normal  (2),
427  *      all (3),
428  *      active  (4)
429  *      },
430  *      eventTypeFilter [3] BACnetEventType OPTIONAL,
431  *      priorityFilter  [4] SEQUENCE {
432  *      minPriority [0] Unsigned8,
433  *      maxPriority [1] Unsigned8
434  *      } OPTIONAL,
435  *  notificationClassFilter     [5] Unsigned OPTIONAL
436  * }
437  * @param tvb
438  * @param pinfo
439  * @param tree
440  * @param offset
441  * @return modified offset
442  */
443 static guint
444 fGetEnrollmentSummaryRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
445
446 /**
447  * GetEnrollmentSummary-ACK ::= SEQUENCE OF SEQUENCE {
448  *      objectIdentifier        BACnetObjectIdentifer,
449  *      eventType       BACnetEventType,
450  *      eventState      BACnetEventState,
451  *      priority    Unsigned8,
452  *  notificationClass   Unsigned OPTIONAL
453  * }
454  * @param tvb
455  * @param pinfo
456  * @param tree
457  * @param offset
458  * @return modified offset
459  */
460 static guint
461 fGetEnrollmentSummaryAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
462
463 /**
464  * GetEventInformation-Request ::= SEQUENCE {
465  *      lastReceivedObjectIdentifier    [0] BACnetObjectIdentifer
466  * }
467  * @param tvb
468  * @param pinfo
469  * @param tree
470  * @param offset
471  * @return modified offset
472  */
473 static guint
474 fGetEventInformationRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
475
476 /**
477  * GetEventInformation-ACK ::= SEQUENCE {
478  *      listOfEventSummaries    [0] listOfEventSummaries,
479  *  moreEvents  [1] BOOLEAN
480  * }
481  * @param tvb
482  * @param pinfo
483  * @param tree
484  * @param offset
485  * @return modified offset
486  */
487 static guint
488 fGetEventInformationACK (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
489
490 /**
491  * LifeSafetyOperation-Request ::= SEQUENCE {
492  *      requestingProcessIdentifier     [0]     Unsigned32
493  *      requestingSource        [1] CharacterString
494  *      request [2] BACnetLifeSafetyOperation
495  *      objectIdentifier        [3] BACnetObjectIdentifier OPTIONAL
496  * }
497  * @param tvb
498  * @param pinfo
499  * @param tree
500  * @param offset
501  * @return modified offset
502  */
503 static guint
504 fLifeSafetyOperationRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label);
505
506 /**
507  * SubscribeCOV-Request ::= SEQUENCE {
508  *      subscriberProcessIdentifier     [0]     Unsigned32
509  *      monitoredObjectIdentifier       [1] BACnetObjectIdentifier
510  *      issueConfirmedNotifications     [2] BOOLEAN OPTIONAL
511  *      lifetime        [3] Unsigned OPTIONAL
512  * }
513  * @param tvb
514  * @param pinfo
515  * @param tree
516  * @param offset
517  * @param label
518  * @param src
519  * @return modified offset
520  */
521 static guint
522 fSubscribeCOVRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
523
524 /**
525  * SubscribeCOVProperty-Request ::= SEQUENCE {
526  *      subscriberProcessIdentifier     [0]     Unsigned32
527  *      monitoredObjectIdentifier       [1] BACnetObjectIdentifier
528  *      issueConfirmedNotifications     [2] BOOLEAN OPTIONAL
529  *      lifetime        [3] Unsigned OPTIONAL
530  *      monitoredPropertyIdentifier     [4] BACnetPropertyReference OPTIONAL
531  *      covIncrement    [5] Unsigned OPTIONAL
532  * }
533  * @param tvb
534  * @param pinfo
535  * @param tree
536  * @param offset
537  * @return modified offset
538  */
539 static guint
540 fSubscribeCOVPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
541
542 /**
543  * AtomicReadFile-Request ::= SEQUENCE {
544  *      fileIdentifier  BACnetObjectIdentifier,
545  *  accessMethod        CHOICE {
546  *      streamAccess    [0] SEQUENCE {
547  *              fileStartPosition       INTEGER,
548  *                      requestedOctetCount     Unsigned
549  *                      },
550  *              recordAccess    [1] SEQUENCE {
551  *                      fileStartRecord INTEGER,
552  *                      requestedRecordCount    Unsigned
553  *                      }
554  *              }
555  * }
556  * @param tvb
557  * @param pinfo
558  * @param tree
559  * @param offset
560  * @return modified offset
561  */
562 static guint
563 fAtomicReadFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
564
565 /**
566  * AtomicWriteFile-ACK ::= SEQUENCE {
567  *      endOfFile       BOOLEAN,
568  *  accessMethod        CHOICE {
569  *      streamAccess    [0] SEQUENCE {
570  *              fileStartPosition       INTEGER,
571  *                      fileData        OCTET STRING
572  *                      },
573  *              recordAccess    [1] SEQUENCE {
574  *                      fileStartRecord INTEGER,
575  *                      returnedRecordCount     Unsigned,
576  *                      fileRecordData  SEQUENCE OF OCTET STRING
577  *                      }
578  *              }
579  * }
580  * @param tvb
581  * @param pinfo
582  * @param tree
583  * @param offset
584  * @return modified offset
585  */
586 static guint
587 fAtomicReadFileAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
588
589 /**
590  * AtomicWriteFile-Request ::= SEQUENCE {
591  *      fileIdentifier  BACnetObjectIdentifier,
592  *  accessMethod        CHOICE {
593  *      streamAccess    [0] SEQUENCE {
594  *              fileStartPosition       INTEGER,
595  *                      fileData        OCTET STRING
596  *                      },
597  *              recordAccess    [1] SEQUENCE {
598  *                      fileStartRecord INTEGER,
599  *                      recordCount     Unsigned,
600  *                      fileRecordData  SEQUENCE OF OCTET STRING
601  *                      }
602  *              }
603  * }
604  * @param tvb
605  * @param pinfo
606  * @param tree
607  * @param offset
608  * @return modified offset
609  */
610 static guint
611 fAtomicWriteFileRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
612
613 /**
614  * AtomicWriteFile-ACK ::= SEQUENCE {
615  *              fileStartPosition       [0] INTEGER,
616  *              fileStartRecord [1] INTEGER,
617  * }
618  * @param tvb
619  * @param tree
620  * @param offset
621  * @return modified offset
622  */
623 static guint
624 fAtomicWriteFileAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
625
626 /**
627  * AddListElement-Request ::= SEQUENCE {
628  *      objectIdentifier        [0] BACnetObjectIdentifier,
629  *  propertyIdentifier  [1] BACnetPropertyIdentifier,
630  *  propertyArrayIndex  [2] Unsigned OPTIONAL, -- used only with array datatype
631  *  listOfElements  [3] ABSTRACT-SYNTAX.&Type
632  * }
633  * @param tvb
634  * @param pinfo
635  * @param tree
636  * @param offset
637  * @return modified offset
638  */
639 static guint
640 fAddListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
641
642 /**
643  * CreateObject-Request ::= SEQUENCE {
644  *      objectSpecifier [0] ObjectSpecifier,
645  *  listOfInitialValues [1] SEQUENCE OF BACnetPropertyValue OPTIONAL
646  * }
647  * @param tvb
648  * @param pinfo
649  * @param tree
650  * @param offset
651  * @return modified offset
652  */
653 static guint
654 fCreateObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset);
655
656 /**
657  * CreateObject-Request ::= BACnetObjectIdentifier
658  * @param tvb
659  * @param pinfo
660  * @param tree
661  * @param offset
662  * @return modified offset
663  */
664 static guint
665 fCreateObjectAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
666
667 /**
668  * DeleteObject-Request ::= SEQUENCE {
669  *      ObjectIdentifier        BACnetObjectIdentifer
670  * }
671  * @param tvb
672  * @param pinfo
673  * @param tree
674  * @param offset
675  * @return modified offset
676  */
677 static guint
678 fDeleteObjectRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
679
680 /**
681  * ReadProperty-Request ::= SEQUENCE {
682  *      objectIdentifier        [0]     BACnetObjectIdentifier,
683  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
684  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
685  * }
686  * @param tvb
687  * @param pinfo
688  * @param tree
689  * @param offset
690  * @return modified offset
691  */
692 static guint
693 fReadPropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
694
695 /**
696  * ReadProperty-ACK ::= SEQUENCE {
697  *      objectIdentifier        [0]     BACnetObjectIdentifier,
698  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
699  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
700  *      propertyValue   [3] ABSTRACT-SYNTAX.&Type
701  * }
702  * @param tvb
703  * @param pinfo
704  * @param tree
705  * @param offset
706  * @return modified offset
707  */
708 static guint
709 fReadPropertyAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
710
711 /**
712  * ReadPropertyConditional-Request ::= SEQUENCE {
713  *      objectSelectionCriteria [0] objectSelectionCriteria,
714  *      listOfPropertyReferences        [1] SEQUENCE OF BACnetPropertyReference OPTIONAL
715  * }
716  * @param tvb
717  * @param pinfo
718  * @param tree
719  * @param offset
720  * @return modified offset
721  */
722 static guint
723 fReadPropertyConditionalRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset);
724
725 /**
726  * ReadPropertyConditional-ACK ::= SEQUENCE {
727  *      listOfPReadAccessResults        SEQUENCE OF ReadAccessResult OPTIONAL
728  * }
729  * @param tvb
730  * @param pinfo
731  * @param tree
732  * @param offset
733  * @return modified offset
734  */
735 static guint
736 fReadPropertyConditionalAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
737
738 /**
739  * ReadPropertyMultiple-Request ::= SEQUENCE {
740  *  listOfReadAccessSpecs       SEQUENCE OF ReadAccessSpecification
741  * }
742  * @param tvb
743  * @param pinfo
744  * @param tree
745  * @param offset
746  * @return offset modified
747  */
748 static guint
749 fReadPropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset);
750
751 /**
752  * ReadPropertyMultiple-Ack ::= SEQUENCE {
753  *  listOfReadAccessResults     SEQUENCE OF ReadAccessResult
754  * }
755  * @param tvb
756  * @parma pinfo
757  * @param tree
758  * @param offset
759  * @return offset modified
760  */
761 static guint
762 fReadPropertyMultipleAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
763
764 /**
765  * ReadRange-Request ::= SEQUENCE {
766  *      objectIdentifier        [0] BACnetObjectIdentifier,
767  *  propertyIdentifier  [1] BACnetPropertyIdentifier,
768  *  propertyArrayIndex  [2] Unsigned OPTIONAL, -- used only with array datatype
769  *      range   CHOICE {
770  *              byPosition      [3] SEQUENCE {
771  *                      referencedIndex Unsigned,
772  *                      count INTEGER
773  *                      },
774  *              byTime  [4] SEQUENCE {
775  *                      referenceTime BACnetDateTime,
776  *                      count INTEGER
777  *                      },
778  *              timeRange       [5] SEQUENCE {
779  *                      beginningTime BACnetDateTime,
780  *                      endingTime BACnetDateTime
781  *                      },
782  *              } OPTIONAL
783  * }
784  * @param tvb
785  * @param pinfo
786  * @param tree
787  * @param offset
788  * @return modified offset
789  */
790 static guint
791 fReadRangeRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
792
793 /**
794  * ReadRange-ACK ::= SEQUENCE {
795  *      objectIdentifier        [0] BACnetObjectIdentifier,
796  *  propertyIdentifier  [1] BACnetPropertyIdentifier,
797  *  propertyArrayIndex  [2] Unsigned OPTIONAL, -- used only with array datatype
798  *  resultFlags [3] BACnetResultFlags,
799  *  itemCount   [4] Unsigned,
800  *  itemData    [5] SEQUENCE OF ABSTRACT-SYNTAX.&Type
801  * }
802  * @param tvb
803  * @param pinfo
804  * @param tree
805  * @param offset
806  * @return modified offset
807  */
808 static guint
809 fReadRangeAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
810
811 /**
812  * RemoveListElement-Request ::= SEQUENCE {
813  *      objectIdentifier        [0]     BACnetObjectIdentifier,
814  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
815  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
816  *      listOfElements  [3] ABSTRACT-SYNTAX.&Type
817  * }
818  * @param tvb
819  * @param pinfo
820  * @param tree
821  * @param offset
822  * @return modified offset
823  */
824 static guint
825 fRemoveListElementRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
826
827 /**
828  * WriteProperty-Request ::= SEQUENCE {
829  *      objectIdentifier        [0]     BACnetObjectIdentifier,
830  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
831  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
832  *      propertyValue   [3] ABSTRACT-SYNTAX.&Type
833  *  priority    [4] Unsigned8 (1..16) OPTIONAL --used only when property is commandable
834  * }
835  * @param tvb
836  * @param pinfo
837  * @param tree
838  * @param offset
839  * @return modified offset
840  */
841 static guint
842 fWritePropertyRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
843
844 /**
845  * WritePropertyMultiple-Request ::= SEQUENCE {
846  *      listOfWriteAccessSpecifications SEQUENCE OF WriteAccessSpecification
847  * }
848  * @param tvb
849  * @param pinfo
850  * @param tree
851  * @param offset
852  * @return modified offset
853  */
854 static guint
855 fWritePropertyMultipleRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
856
857 /**
858  * DeviceCommunicationControl-Request ::= SEQUENCE {
859  *      timeDuration    [0] Unsigned16 OPTIONAL,
860  *  enable-disable      [1] ENUMERATED {
861  *              enable (0),
862  *              disable (1)
863  *              },
864  *  password    [2] CharacterString (SIZE(1..20)) OPTIONAL
865  * }
866  * @param tvb
867  * @param tree
868  * @param offset
869  * @return modified offset
870  */
871 static guint
872 fDeviceCommunicationControlRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
873
874 /**
875  * ConfirmedPrivateTransfer-Request ::= SEQUENCE {
876  *      vendorID        [0]     Unsigned,
877  *      serviceNumber   [1] Unsigned,
878  *      serviceParameters       [2] ABSTRACT-SYNTAX.&Type OPTIONAL
879  * }
880  * @param tvb
881  * @param pinfo
882  * @param tree
883  * @param offset
884  * @return modified offset
885  */
886 static guint
887 fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
888
889 /**
890  * ConfirmedPrivateTransfer-ACK ::= SEQUENCE {
891  *      vendorID        [0]     Unsigned,
892  *      serviceNumber   [1] Unsigned,
893  *      resultBlock     [2] ABSTRACT-SYNTAX.&Type OPTIONAL
894  * }
895  * @param tvb
896  * @param pinfo
897  * @param tree
898  * @param offset
899  * @return modified offset
900  */
901 static guint
902 fConfirmedPrivateTransferAck(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
903
904 /**
905  * ConfirmedTextMessage-Request ::=  SEQUENCE {
906  *  textMessageSourceDevice [0] BACnetObjectIdentifier,
907  *  messageClass [1] CHOICE {
908  *      numeric [0] Unsigned,
909  *      character [1] CharacterString
910  *      } OPTIONAL,
911  *  messagePriority [2] ENUMERATED {
912  *      normal (0),
913  *      urgent (1)
914  *      },
915  *  message [3] CharacterString
916  * }
917  * @param tvb
918  * @param pinfo
919  * @param tree
920  * @param offset
921  * @return modified offset
922  */
923 static guint
924 fConfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
925
926 /**
927  * ReinitializeDevice-Request ::= SEQUENCE {
928  *  reinitializedStateOfDevice  [0] ENUMERATED {
929  *              coldstart (0),
930  *              warmstart (1),
931  *              startbackup (2),
932  *              endbackup (3),
933  *              startrestore (4),
934  *              endrestore (5),
935  *              abortrestor (6)
936  *              },
937  *  password    [1] CharacterString (SIZE(1..20)) OPTIONAL
938  * }
939  * @param tvb
940  * @param tree
941  * @param offset
942  * @return modified offset
943  */
944 static guint
945 fReinitializeDeviceRequest(tvbuff_t *tvb, proto_tree *tree, guint offset);
946
947 /**
948  * VTOpen-Request ::= SEQUENCE {
949  *  vtClass     BACnetVTClass,
950  *  localVTSessionIdentifier    Unsigned8
951  * }
952  * @param tvb
953  * @param pinfo
954  * @param tree
955  * @param offset
956  * @return modified offset
957  */
958 static guint
959 fVtOpenRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
960
961 /**
962  * VTOpen-ACK ::= SEQUENCE {
963  *  remoteVTSessionIdentifier   Unsigned8
964  * }
965  * @param tvb
966  * @param pinfo
967  * @param tree
968  * @param offset
969  * @return modified offset
970  */
971 static guint
972 fVtOpenAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
973
974 /**
975  * VTClose-Request ::= SEQUENCE {
976  *  listOfRemoteVTSessionIdentifiers    SEQUENCE OF Unsigned8
977  * }
978  * @param tvb
979  * @param pinfo
980  * @param tree
981  * @param offset
982  * @return modified offset
983  */
984 static guint
985 fVtCloseRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
986
987 /**
988  * VTData-Request ::= SEQUENCE {
989  *  vtSessionIdentifier Unsigned8,
990  *  vtNewData   OCTET STRING,
991  *  vtDataFlag  Unsigned (0..1)
992  * }
993  * @param tvb
994  * @param pinfo
995  * @param tree
996  * @param offset
997  * @return modified offset
998  */
999 static guint
1000 fVtDataRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1001
1002 /**
1003  * VTData-ACK ::= SEQUENCE {
1004  *  allNewDataAccepted  [0] BOOLEAN,
1005  *  acceptedOctetCount  [1] Unsigned OPTIONAL -- present only if allNewDataAccepted = FALSE
1006  * }
1007  * @param tvb
1008  * @param tree
1009  * @param offset
1010  * @return modified offset
1011  */
1012 static guint
1013 fVtDataAck (tvbuff_t *tvb, proto_tree *tree, guint offset);
1014
1015 /**
1016  * Authenticate-Request ::= SEQUENCE {
1017  *  pseudoRandomNumber  [0] Unsigned32,
1018  *  excpectedInvokeID   [1] Unsigned8 OPTIONAL,
1019  *  operatorName        [2] CharacterString OPTIONAL,
1020  *  operatorPassword    [3] CharacterString (SIZE(1..20)) OPTIONAL,
1021  *  startEncypheredSession      [4] BOOLEAN OPTIONAL
1022  * }
1023  * @param tvb
1024  * @param tree
1025  * @param offset
1026  * @return modified offset
1027  */
1028 static guint
1029 fAuthenticateRequest (tvbuff_t *tvb, proto_tree *tree, guint offset);
1030
1031 /**
1032  * Authenticate-ACK ::= SEQUENCE {
1033  *  modifiedRandomNumber        Unsigned32,
1034  * }
1035  * @param tvb
1036  * @param pinfo
1037  * @param tree
1038  * @param offset
1039  * @return modified offset
1040  */
1041 static guint
1042 fAuthenticateAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1043
1044 /**
1045  * RequestKey-Request ::= SEQUENCE {
1046  *  requestingDeviceIdentifier  BACnetObjectIdentifier,
1047  *  requestingDeviceAddress     BACnetAddress,
1048  *  remoteDeviceIdentifier      BACnetObjectIdentifier,
1049  *  remoteDeviceAddress BACnetAddress
1050  * }
1051  * @param tvb
1052  * @param pinfo
1053  * @param tree
1054  * @param offset
1055  * @return modified offset
1056  */
1057 static guint
1058 fRequestKeyRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1059
1060 /**
1061  * Unconfirmed-Service-Request ::= CHOICE {
1062  * }
1063  * @param tvb
1064  * @param pinfo
1065  * @param tree
1066  * @param offset
1067  * @param service_choice
1068  * @return modified offset
1069  */
1070 static guint
1071 fUnconfirmedServiceRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gint service_choice);
1072
1073 /**
1074  * UnconfirmedCOVNotification-Request ::= SEQUENCE {
1075  *      subscriberProcessIdentifier     [0]     Unsigned32,
1076  *      initiatingDeviceIdentifier      [1] BACnetObjectIdentifer,
1077  *      monitoredObjectIdentifier       [2] BACnetObjectIdentifer,
1078  *      timeRemaining   [3] unsigned,
1079  *      listOfValues    [4] SEQUENCE OF BACnetPropertyValues
1080  * }
1081  * @param tvb
1082  * @param pinfo
1083  * @param tree
1084  * @param offset
1085  * @return modified offset
1086  */
1087 static guint
1088 fUnconfirmedCOVNotificationRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1089
1090 /**
1091  * UnconfirmedEventNotification-Request ::= SEQUENCE {
1092  *      ProcessIdentifier       [0]     Unsigned32,
1093  *      initiatingDeviceIdentifier      [1] BACnetObjectIdentifer,
1094  *      eventObjectIdentifier   [2] BACnetObjectIdentifer,
1095  *      timeStamp       [3] BACnetTimeStamp,
1096  *      notificationClass       [4] unsigned,
1097  *      priority        [5] unsigned8,
1098  *      eventType       [6] BACnetEventType,
1099  *      messageText     [7] CharacterString OPTIONAL,
1100  *      notifyType      [8] BACnetNotifyType,
1101  *      ackRequired     [9] BOOLEAN OPTIONAL,
1102  *      fromState       [10] BACnetEventState OPTIONAL,
1103  *      toState [11] BACnetEventState,
1104  *      eventValues     [12] BACnetNotificationParameters OPTIONAL
1105  * }
1106  * @param tvb
1107  * @param pinfo
1108  * @param tree
1109  * @param offset
1110  * @return modified offset
1111  */
1112 static guint
1113 fUnconfirmedEventNotificationRequest (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1114
1115 /**
1116  * I-Am-Request ::= SEQUENCE {
1117  *      aAmDeviceIdentifier     BACnetObjectIdentifier,
1118  *  maxAPDULengthAccepted       Unsigned,
1119  *      segmentationSupported   BACnetSegmentation,
1120  *      vendorID        Unsigned
1121  * }
1122  * @param tvb
1123  * @param pinfo
1124  * @param tree
1125  * @param offset
1126  * @return modified offset
1127  */
1128 static guint
1129 fIAmRequest  (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1130
1131
1132 /**
1133  * I-Have-Request ::= SEQUENCE {
1134  *      deviceIdentifier        BACnetObjectIdentifier,
1135  *  objectIdentifier    BACnetObjectIdentifier,
1136  *      objectName      CharacterString
1137  * }
1138  * @param tvb
1139  * @param pinfo
1140  * @param tree
1141  * @param offset
1142  * @return modified offset
1143  */
1144 static guint
1145 fIHaveRequest  (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1146
1147 /**
1148  * UnconfirmedPrivateTransfer-Request ::= SEQUENCE {
1149  *      vendorID        [0]     Unsigned,
1150  *      serviceNumber   [1] Unsigned,
1151  *      serviceParameters       [2] ABSTRACT-SYNTAX.&Type OPTIONAL
1152  * }
1153  * @param tvb
1154  * @param pinfo
1155  * @param tree
1156  * @param offset
1157  * @return modified offset
1158  */
1159 static guint
1160 fUnconfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1161
1162 /**
1163  * UnconfirmedTextMessage-Request ::=  SEQUENCE {
1164  *  textMessageSourceDevice [0] BACnetObjectIdentifier,
1165  *  messageClass [1] CHOICE {
1166  *      numeric [0] Unsigned,
1167  *      character [1] CharacterString
1168  *      } OPTIONAL,
1169  *  messagePriority [2] ENUMERATED {
1170  *      normal (0),
1171  *      urgent (1)
1172  *      },
1173  *  message [3] CharacterString
1174  * }
1175  * @param tvb
1176  * @param pinfo
1177  * @param tree
1178  * @param offset
1179  * @return modified offset
1180  */
1181 static guint
1182 fUnconfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1183
1184 /**
1185  * TimeSynchronization-Request ::=  SEQUENCE {
1186  *  BACnetDateTime
1187  * }
1188  * @param tvb
1189  * @param tree
1190  * @param offset
1191  * @return modified offset
1192  */
1193 static guint
1194 fTimeSynchronizationRequest  (tvbuff_t *tvb, proto_tree *tree, guint offset);
1195
1196 /**
1197  * UTCTimeSynchronization-Request ::=  SEQUENCE {
1198  *  BACnetDateTime
1199  * }
1200  * @param tvb
1201  * @param tree
1202  * @param offset
1203  * @return modified offset
1204  */
1205 static guint
1206 fUTCTimeSynchronizationRequest  (tvbuff_t *tvb, proto_tree *tree, guint offset);
1207
1208 /**
1209  * Who-Has-Request ::=  SEQUENCE {
1210  *  limits SEQUENCE {
1211  *      deviceInstanceRangeLowLimit [0] Unsigned (0..4194303),
1212  *      deviceInstanceRangeHighLimit [1] Unsigned (0..4194303)
1213  *      } OPTIONAL,
1214  *  object CHOICE {
1215  *      objectIdentifier [2] BACnetObjectIdentifier,
1216  *      objectName [3] CharacterString
1217  *      }
1218  * }
1219  * @param tvb
1220  * @param pinfo
1221  * @param tree
1222  * @param offset
1223  * @return modified offset
1224  */
1225 static guint
1226 fWhoHas (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1227
1228 /**
1229  * Who-Is-Request ::= SEQUENCE {
1230  *      deviceInstanceRangeLowLimit     [0] Unsigned (0..4194303) OPTIONAL, -- must be used as a pair, see 16.9,
1231  *      deviceInstanceRangeHighLimit    [0] Unsigned (0..4194303) OPTIONAL, -- must be used as a pair, see 16.9,
1232  * }
1233  * @param tvb
1234  * @param tree
1235  * @param offset
1236  * @return modified offset
1237  */
1238 static guint
1239 fWhoIsRequest  (tvbuff_t *tvb, proto_tree *tree, guint offset);
1240
1241 /**
1242  * BACnet-Error ::= CHOICE {
1243  *  addListElement          [8] ChangeList-Error,
1244  *  removeListElement       [9] ChangeList-Error,
1245  *  writePropertyMultiple   [16] WritePropertyMultiple-Error,
1246  *  confirmedPrivatTransfer [18] ConfirmedPrivateTransfer-Error,
1247  *  vtClose                 [22] VTClose-Error,
1248  *  readRange               [26] ObjectAccessService-Error
1249  *                      [default] Error
1250  * }
1251  * @param tvb
1252  * @param pinfo
1253  * @param tree
1254  * @param offset
1255  * @param service
1256  * @return modified offset
1257  */
1258 static guint
1259 fBACnetError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint service);
1260
1261 /**
1262  * Dissect a BACnetError in a context tag
1263  *
1264  * @param tvb
1265  * @param pinfo
1266  * @param tree
1267  * @param offset
1268  * @return modified offset
1269  */
1270 static guint fContextTaggedError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1271
1272 /**
1273  * ChangeList-Error ::= SEQUENCE {
1274  *    errorType     [0] Error,
1275  *    firstFailedElementNumber  [1] Unsigned
1276  *    }
1277  * }
1278  * @param tvb
1279  * @param pinfo
1280  * @param tree
1281  * @param offset
1282  * @return modified offset
1283  */
1284 static guint
1285 fChangeListError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1286
1287 /**
1288  * CreateObject-Error ::= SEQUENCE {
1289  *    errorType     [0] Error,
1290  *    firstFailedElementNumber  [1] Unsigned
1291  *    }
1292  * }
1293  * @param tvb
1294  * @param pinfo
1295  * @param tree
1296  * @param offset
1297  * @return modified offset
1298  */
1299 static guint
1300 fCreateObjectError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1301
1302 /**
1303  * ConfirmedPrivateTransfer-Error ::= SEQUENCE {
1304  *    errorType     [0] Error,
1305  *    vendorID      [1] Unsigned,
1306  *    serviceNumber [2] Unsigned,
1307  *    errorParameters   [3] ABSTRACT-SYNTAX.&Type OPTIONAL
1308  *    }
1309  * }
1310  * @param tvb
1311  * @param pinfo
1312  * @param tree
1313  * @param offset
1314  * @return modified offset
1315  */
1316 static guint
1317 fConfirmedPrivateTransferError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1318
1319 /**
1320  * WritePropertyMultiple-Error ::= SEQUENCE {
1321  *    errorType     [0] Error,
1322  *    firstFailedWriteAttempt  [1] Unsigned
1323  *    }
1324  * }
1325  * @param tvb
1326  * @pram pinfo
1327  * @param tree
1328  * @param offset
1329  * @return modified offset
1330  */
1331 static guint
1332 fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1333
1334 /**
1335  * VTClose-Error ::= SEQUENCE {
1336  *    errorType     [0] Error,
1337  *    listOfVTSessionIdentifiers  [1] SEQUENCE OF Unsigned8 OPTIONAL
1338  *    }
1339  * }
1340  * @param tvb
1341  * @param pinfo
1342  * @param tree
1343  * @param offset
1344  * @return modified offset
1345  */
1346 static guint
1347 fVTCloseError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1348
1349 /**
1350  * BACnet Application Types chapter 20.2.1
1351  * @param tvb
1352  * @param pinfo
1353  * @param tree
1354  * @param offset
1355  * @param label
1356  * @return modified offset
1357  */
1358 static guint
1359 fApplicationTypes   (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const gchar *label);
1360
1361 /**
1362  * BACnetActionCommand ::= SEQUENCE {
1363  *  deviceIdentifier    [0] BACnetObjectIdentifier OPTIONAL,
1364  *  objectIdentifier    [1] BACnetObjectIdentifier,
1365  *  propertyIdentifier  [2] BACnetPropertyIdentifier,
1366  *  propertyArrayIndex  [3] Unsigned OPTIONAL, -- used only with array datatype
1367  *  propertyValue       [4] ABSTRACT-SYNTAX.&Type,
1368  *  priority            [5] Unsigned (1..16) OPTIONAL, -- used only when property is commandable
1369  *  postDelay           [6] Unsigned OPTIONAL,
1370  *  quitOnFailure       [7] BOOLEAN,
1371  *  writeSuccessful     [8] BOOLEAN
1372  * }
1373  * @param tvb
1374  * @param pinfo
1375  * @param tree
1376  * @param offset
1377  * @param matching tag number
1378  * @return modified offset
1379  */
1380 static guint
1381 fActionCommand (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tag_match);
1382
1383 /**
1384  * BACnetActionList ::= SEQUENCE {
1385  *  action  [0] SEQUENCE of BACnetActionCommand
1386  * }
1387  * @param tvb
1388  * @param pinfo
1389  * @param tree
1390  * @param offset
1391  * @return modified offset
1392  */
1393 static guint
1394 fActionList (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1395
1396 /** BACnetAddress ::= SEQUENCE {
1397  *  network-number  Unsigned16, -- A value 0 indicates the local network
1398  *  mac-address     OCTET STRING -- A string of length 0 indicates a broadcast
1399  * }
1400  * @param tvb
1401  * @param tree
1402  * @param offset
1403  * @return modified offset
1404  */
1405 static guint
1406 fAddress (tvbuff_t *tvb, proto_tree *tree, guint offset);
1407
1408 /**
1409  * BACnetAddressBinding ::= SEQUENCE {
1410  *      deviceObjectID  BACnetObjectIdentifier
1411  *      deviceAddress   BacnetAddress
1412  * }
1413  * @param tvb
1414  * @param pinfo
1415  * @param tree
1416  * @param offset
1417  * @return modified offset
1418  */
1419 static guint
1420 fAddressBinding (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1421
1422 /**
1423  * BACnetCalendaryEntry ::= CHOICE {
1424  *      date        [0] Date,
1425  *      dateRange   [1] BACnetDateRange,
1426  *  weekNDay    [2] BacnetWeekNday
1427  * }
1428  * @param tvb
1429  * @param tree
1430  * @param offset
1431  * @return modified offset
1432  */
1433 static guint
1434 fCalendaryEntry (tvbuff_t *tvb, proto_tree *tree, guint offset);
1435
1436 /**
1437  * BACnetClientCOV ::= CHOICE {
1438  *      real-increment  REAL,
1439  *      default-increment   NULL
1440  * }
1441  * @param tvb
1442  * @param tree
1443  * @param offset
1444  * @return modified offset
1445  */
1446 static guint
1447 fClientCOV (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1448
1449
1450 /**
1451  * BACnetDailySchedule ::= SEQUENCE {
1452  *  day-schedule    [0] SENQUENCE OF BACnetTimeValue
1453  * }
1454  * @param tvb
1455  * @param pinfo
1456  * @param tree
1457  * @param offset
1458  * @return modified offset
1459  */
1460 static guint
1461 fDailySchedule (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1462
1463 /**
1464  * BACnetWeeklySchedule ::= SEQUENCE {
1465  *  week-schedule    SENQUENCE SIZE (7) OF BACnetDailySchedule
1466  * }
1467  * @param tvb
1468  * @param pinfo
1469  * @param tree
1470  * @param offset
1471  * @return modified offset
1472  */
1473 static guint
1474 fWeeklySchedule (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1475
1476 /**
1477  * BACnetDateRange ::= SEQUENCE {
1478  *  StartDate   Date,
1479  *  EndDate     Date
1480  * }
1481  * @param tvb
1482  * @param tree
1483  * @param offset
1484  * @return modified offset
1485  */
1486 static guint
1487 fDateRange (tvbuff_t *tvb, proto_tree *tree, guint offset);
1488
1489 /**
1490  * BACnetDateTime ::= SEQUENCE {
1491  *  date   Date,
1492  *  time   Time
1493  * }
1494  * @param tvb
1495  * @param tree
1496  * @param offset
1497  * @param label
1498  * @return modified offset
1499  */
1500 static guint
1501 fDateTime (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
1502
1503 /**
1504  * BACnetDestination ::= SEQUENCE {
1505  *  validDays   BACnetDaysOfWeek,
1506  *  fromTime    Time,
1507  *  toTime      Time,
1508  *  recipient   BACnetRecipient,
1509  *  processIdentifier   Unsigned32,
1510  *  issueConfirmedNotifications BOOLEAN,
1511  *  transitions BACnetEventTransitionBits
1512  * }
1513  * @param tvb
1514  * @param pinfo
1515  * @param tree
1516  * @param offset
1517  * @return modified offset
1518  */
1519 static guint
1520 fDestination (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1521
1522 /**
1523  * BACnetDeviceObjectPropertyReference ::= SEQUENCE {
1524  *  objectIdentifier    [0] BACnetObjectIdentifier,
1525  *  propertyIdentifier  [1] BACnetPropertyIdentifier,
1526  *  propertyArrayIndex  [2] Unsigend OPTIONAL,
1527  *  deviceIdentifier    [3] BACnetObjectIdentifier OPTIONAL
1528  * }
1529  * @param tvb
1530  * @param pinfo
1531  * @param tree
1532  * @param offset
1533  * @return modified offset
1534  */
1535 static guint
1536 fDeviceObjectPropertyReference (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1537
1538 /**
1539  * BACnetDeviceObjectReference ::= SEQUENCE {
1540  *  deviceIdentifier    [0] BACnetObjectIdentifier OPTIONAL,
1541  *  objectIdentifier    [1] BACnetObjectIdentifier
1542  * }
1543  * @param tvb
1544  * @param pinfo
1545  * @param tree
1546  * @param offset
1547  * @return modified offset
1548  */
1549 static guint
1550 fDeviceObjectReference (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1551
1552 #if 0
1553 /**
1554  * BACnetEventParameter ::= CHOICE {
1555  *      change-of-bitstring [0] SEQUENCE {
1556  *      time-delay [0] Unsigned,
1557  *      bitmask [1] BIT STRING,
1558  *      list-of-bitstring-values [2] SEQUENCE OF BIT STRING
1559  *      },
1560  *  change-of-state [1] SEQUENCE {
1561  *      time-delay [0] Unsigned,
1562  *      list-of-values [1] SEQUENCE OF BACnetPropertyStates
1563  *      },
1564  *   change-of-value [2] SEQUENCE {
1565  *      time-delay [0] Unsigned,
1566  *      cov-criteria [1] CHOICE {
1567  *              bitmask [0] BIT STRING,
1568  *              referenced-property-increment [1] REAL
1569  *                      }
1570  *              },
1571  *      command-failure [3] SEQUENCE {
1572  *              time-delay [0] Unsigned,
1573  *              feedback-property-reference [1] BACnetDeviceObjectPropertyReference
1574  *              },
1575  *      floating-limit [4] SEQUENCE {
1576  *              time-delay [0] Unsigned,
1577  *              setpoint-reference [1] BACnetDeviceObjectPropertyReference,
1578  *              low-diff-limit [2] REAL,
1579  *              high-diff-limit [3] REAL,
1580  *              deadband [4] REAL
1581  *              },
1582  *      out-of-range [5] SEQUENCE {
1583  *              time-delay [0] Unsigned,
1584  *              low-limit [1] REAL,
1585  *              high-limit [2] REAL,
1586  *              deadband [3] REAL
1587  *              },
1588  *      buffer-ready [7] SEQUENCE {
1589  *              notification-threshold [0] Unsigned,
1590  *              previous-notification-count [1] Unsigned32
1591  *              }
1592  *      change-of-life-safety [8] SEQUENCE {
1593  *              time-delay [0] Unsigned,
1594  *              list-of-life-safety-alarm-values [1] SEQUENCE OF BACnetLifeSafetyState,
1595  *              list-of-alarm-values [2] SEQUENCE OF BACnetLifeSafetyState,
1596  *              mode-property-reference [3] BACnetDeviceObjectPropertyReference
1597  *              }
1598  *      }
1599  * @param tvb
1600  * @param tree
1601  * @param offset
1602  * @return modified offset
1603  */
1604 static guint
1605 fEventParameter (tvbuff_t *tvb, proto_tree *tree, guint offset);
1606 #endif
1607
1608
1609
1610 /**
1611  * BACnetLogRecord ::= SEQUENCE {
1612  *      timestamp [0] BACnetDateTime,
1613  *      logDatum [1] CHOICE {
1614  *              log-status [0] BACnetLogStatus,
1615  *              boolean-value [1] BOOLEAN,
1616  *              real-value [2] REAL,
1617  *              enum-value [3] ENUMERATED, -- Optionally limited to 32 bits
1618  *              unsigned-value [4] Unsigned, -- Optionally limited to 32 bits
1619  *              signed-value [5] INTEGER, -- Optionally limited to 32 bits
1620  *              bitstring-value [6] BIT STRING,-- Optionally limited to 32 bits
1621  *              null-value [7] NULL,
1622  *              failure [8] Error,
1623  *              time-change [9] REAL,
1624  *              any-value [10] ABSTRACT-SYNTAX.&Type -- Optional
1625  *              }
1626  *      statusFlags [2] BACnetStatusFlags OPTIONAL
1627  * }
1628  * @param tvb
1629  * @param pinfo
1630  * @param tree
1631  * @param offset
1632  * @return modified offset
1633  */
1634 static guint
1635 fLogRecord (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1636
1637
1638 /**
1639  * BACnetNotificationParameters ::= CHOICE {
1640  *      change-of-bitstring     [0]     SEQUENCE {
1641  *      referenced-bitstring    [0] BIT STRING,
1642  *      status-flags    [1] BACnetStatusFlags
1643  *      },
1644  *  change-of-state [1] SEQUENCE {
1645  *      new-state   [0] BACnetPropertyStatus,
1646  *      status-flags    [1] BACnetStatusFlags
1647  *      },
1648  *  change-of-value [2] SEQUENCE {
1649  *      new-value   [0] CHOICE {
1650  *          changed-bits   [0] BIT STRING,
1651  *          changed-value    [1] REAL
1652  *          },
1653  *      status-flags    [1] BACnetStatusFlags
1654  *      },
1655  *  command-failure [3] SEQUENCE {
1656  *      command-value   [0] ABSTRACT-SYNTAX.&Type, -- depends on ref property
1657  *      status-flags    [1] BACnetStatusFlags
1658  *      feedback-value    [2] ABSTRACT-SYNTAX.&Type -- depends on ref property
1659  *      },
1660  *  floating-limit [4]  SEQUENCE {
1661  *      reference-value   [0] REAL,
1662  *      status-flags    [1] BACnetStatusFlags
1663  *      setpoint-value   [2] REAL,
1664  *      error-limit   [3] REAL
1665  *      },
1666  *  out-of-range [5]    SEQUENCE {
1667  *      exceeding-value   [0] REAL,
1668  *      status-flags    [1] BACnetStatusFlags
1669  *      deadband   [2] REAL,
1670  *      exceeded-limit   [0] REAL
1671  *      },
1672  *  complex-event-type  [6] SEQUENCE OF BACnetPropertyValue,
1673  *  buffer-ready [7]    SEQUENCE {
1674  *      buffer-device   [0] BACnetObjectIdentifier,
1675  *      buffer-object    [1] BACnetObjectIdentifier
1676  *      previous-notification   [2] BACnetDateTime,
1677  *      current-notification   [3] BACnetDateTime
1678  *      },
1679  *  change-of-life-safety [8]   SEQUENCE {
1680  *      new-state   [0] BACnetLifeSafetyState,
1681  *      new-mode    [1] BACnetLifeSafetyState
1682  *      status-flags   [2] BACnetStatusFlags,
1683  *      operation-expected   [3] BACnetLifeSafetyOperation
1684  *      }
1685  * }
1686  * @param tvb
1687  * @param pinfo
1688  * @param tree
1689  * @param offset
1690  * @return modified offset
1691  */
1692 static guint
1693 fNotificationParameters (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1694
1695 /**
1696  * BACnetObjectPropertyReference ::= SEQUENCE {
1697  *      objectIdentifier        [0] BACnetObjectIdentifier,
1698  *      propertyIdentifier      [1] BACnetPropertyIdentifier,
1699  *      propertyArrayIndex      [2] Unsigned OPTIONAL, -- used only with array datatype
1700  * }
1701  * @param tvb
1702  * @param pinfo
1703  * @param tree
1704  * @param offset
1705  * @return modified offset
1706  */
1707 static guint
1708 fBACnetObjectPropertyReference (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1709
1710 #if 0
1711 /**
1712  * BACnetObjectPropertyValue ::= SEQUENCE {
1713  *              objectIdentifier [0] BACnetObjectIdentifier,
1714  *              propertyIdentifier [1] BACnetPropertyIdentifier,
1715  *              propertyArrayIndex [2] Unsigned OPTIONAL, -- used only with array datatype
1716  *                              -- if omitted with an array the entire array is referenced
1717  *              value [3] ABSTRACT-SYNTAX.&Type, --any datatype appropriate for the specified property
1718  *              priority [4] Unsigned (1..16) OPTIONAL
1719  * }
1720  * @param tvb
1721  * @param tree
1722  * @param offset
1723  * @return modified offset
1724  */
1725 static guint
1726 fObjectPropertyValue (tvbuff_t *tvb, proto_tree *tree, guint offset);
1727 #endif
1728
1729 /**
1730  * BACnetPriorityArray ::= SEQUENCE SIZE (16) OF BACnetPriorityValue
1731  * @param tvb
1732  * @param pinfo
1733  * @param tree
1734  * @param offset
1735  * @return modified offset
1736  */
1737 static guint
1738 fPriorityArray (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1739
1740 static guint
1741 fPropertyReference (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tagoffset, guint8 list);
1742
1743 /**
1744  * BACnetPropertyReference ::= SEQUENCE {
1745  *      propertyIdentifier      [0] BACnetPropertyIdentifier,
1746  *      propertyArrayIndex      [1] Unsigned OPTIONAL, -- used only with array datatype
1747  * }
1748  * @param tvb
1749  * @param pinfo
1750  * @param tree
1751  * @param offset
1752  * @return modified offset
1753  */
1754 static guint
1755 fBACnetPropertyReference (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 list);
1756
1757 /* static guint
1758 fBACnetObjectPropertyReference (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset); */
1759
1760 static guint
1761 fLOPR (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1762
1763 static guint
1764 fRestartReason (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1765
1766 /**
1767  * BACnetPropertyValue ::= SEQUENCE {
1768  *              PropertyIdentifier [0] BACnetPropertyIdentifier,
1769  *              propertyArrayIndex [1] Unsigned OPTIONAL, -- used only with array datatypes
1770  *                              -- if omitted with an array the entire array is referenced
1771  *              value [2] ABSTRACT-SYNTAX.&Type, -- any datatype appropriate for the specified property
1772  *              priority [3] Unsigned (1..16) OPTIONAL -- used only when property is commandable
1773  * }
1774  * @param tvb
1775  * @param pinfo
1776  * @param tree
1777  * @param offset
1778  * @return modified offset
1779  */
1780 static guint
1781 fBACnetPropertyValue (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1782
1783 static guint
1784 fPropertyValue (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint8 tagoffset);
1785
1786 /**
1787  * BACnet Application PDUs chapter 21
1788  * BACnetRecipient::= CHOICE {
1789  *      device  [0] BACnetObjectIdentifier
1790  *      address [1] BACnetAddress
1791  * }
1792  * @param tvb
1793  * @param pinfo
1794  * @param tree
1795  * @param offset
1796  * @return modified offset
1797  */
1798 static guint
1799 fRecipient (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1800
1801 /**
1802  * BACnet Application PDUs chapter 21
1803  * BACnetRecipientProcess::= SEQUENCE {
1804  *      recipient       [0] BACnetRecipient
1805  *      processID       [1] Unsigned32
1806  * }
1807  * @param tvb
1808  * @param pinfo
1809  * @param tree
1810  * @param offset
1811  * @return modified offset
1812  */
1813 static guint
1814 fRecipientProcess (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1815
1816 #if 0
1817 /**
1818  * BACnetSessionKey ::= SEQUENCE {
1819  *      sessionKey      OCTET STRING (SIZE(8)), -- 56 bits for key, 8 bits for checksum
1820  *      peerAddress     BACnetAddress
1821  * }
1822  * @param tvb
1823  * @param tree
1824  * @param offset
1825  * @return modified offset
1826  * @todo check if checksum is displayed correctly
1827  */
1828 static guint
1829 fSessionKey (tvbuff_t *tvb, proto_tree *tree, guint offset);
1830 #endif
1831
1832 /**
1833  * BACnetSpecialEvent ::= SEQUENCE {
1834  *      period          CHOICE {
1835  *              calendarEntry           [0] BACnetCalendarEntry,
1836  *              calendarRefernce        [1] BACnetObjectIdentifier
1837  *              },
1838  *              listOfTimeValues        [2] SEQUENCE OF BACnetTimeValue,
1839  *              eventPriority           [3] Unsigned (1..16)
1840  * }
1841  * @param tvb
1842  * @param pinfo
1843  * @param tree
1844  * @param offset
1845  * @return modified offset
1846  */
1847 static guint
1848 fSpecialEvent (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1849
1850 /**
1851  * BACnetTimeStamp ::= CHOICE {
1852  *      time                    [0] Time,
1853  *      sequenceNumber  [1] Unsigned (0..65535),
1854  *      dateTime                [2] BACnetDateTime
1855  * }
1856  * @param tvb
1857  * @param tree
1858  * @param offset
1859  * @param label
1860  * @return modified offset
1861  */
1862 static guint
1863 fTimeStamp (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
1864
1865 /**
1866  * BACnetTimeValue ::= SEQUENCE {
1867  *      time    Time,
1868  *      value   ABSTRACT-SYNTAX.&Type -- any primitive datatype, complex types cannot be decoded
1869  * }
1870  * @param tvb
1871  * @param pinfo
1872  * @param tree
1873  * @param offset
1874  * @return modified offset
1875  */
1876 static guint
1877 fTimeValue (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1878
1879 #if 0
1880 /**
1881  * BACnetVTSession ::= SEQUENCE {
1882  *      local-vtSessionID       Unsigned8,
1883  *      remote-vtSessionID      Unsigned8,
1884  *      remote-vtAddress        BACnetAddress
1885  * }
1886  * @param tvb
1887  * @param tree
1888  * @param offset
1889  * @return modified offset
1890  */
1891 static guint
1892 fVTSession (tvbuff_t *tvb, proto_tree *tree, guint offset);
1893 #endif
1894
1895 /**
1896  * BACnetWeekNDay ::= OCTET STRING (SIZE (3))
1897  * -- first octet month (1..12) January = 1, X'FF' = any month
1898  * -- second octet weekOfMonth where: 1 = days numbered 1-7
1899  * -- 2 = days numbered 8-14
1900  * -- 3 = days numbered 15-21
1901  * -- 4 = days numbered 22-28
1902  * -- 5 = days numbered 29-31
1903  * -- 6 = last 7 days of this month
1904  * -- X'FF' = any week of this month
1905  * -- third octet dayOfWeek (1..7) where 1 = Monday
1906  * -- 7 = Sunday
1907  * -- X'FF' = any day of week
1908  * @param tvb
1909  * @param tree
1910  * @param offset
1911  * @return modified offset
1912  */
1913 static guint
1914 fWeekNDay (tvbuff_t *tvb, proto_tree *tree, guint offset);
1915
1916 /**
1917  * ReadAccessResult ::= SEQUENCE {
1918  *      objectIdentifier        [0] BACnetObjectIdentifier,
1919  *      listOfResults   [1] SEQUENCE OF SEQUENCE {
1920  *              propertyIdentifier      [2] BACnetPropertyIdentifier,
1921  *              propertyArrayIndex      [3] Unsigned OPTIONAL, -- used only with array datatype if omitted with an array the entire array is referenced
1922  *              readResult      CHOICE {
1923  *                      propertyValue   [4] ABSTRACT-SYNTAX.&Type,
1924  *                      propertyAccessError     [5] Error
1925  *              }
1926  *  } OPTIONAL
1927  * }
1928  * @param tvb
1929  * @param pinfo
1930  * @param tree
1931  * @param offset
1932  * @return modified offset
1933  */
1934 static guint
1935 fReadAccessResult (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
1936
1937 /**
1938  * ReadAccessSpecification ::= SEQUENCE {
1939  *      objectIdentifier        [0] BACnetObjectIdentifier,
1940  *      listOfPropertyReferences        [1] SEQUENCE OF BACnetPropertyReference
1941  * }
1942  * @param tvb
1943  * @param pinfo
1944  * @param tree
1945  * @param offset
1946  * @return modified offset
1947  */
1948 static guint
1949 fReadAccessSpecification (tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset);
1950
1951 /**
1952  * WriteAccessSpecification ::= SEQUENCE {
1953  *      objectIdentifier        [0] BACnetObjectIdentifier,
1954  *      listOfProperty  [1] SEQUENCE OF BACnetPropertyValue
1955  * }
1956  * @param tvb
1957  * @param pinfo
1958  * @param tree
1959  * @param offset
1960  * @return modified offset
1961  */
1962 static guint
1963 fWriteAccessSpecification (tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset);
1964
1965
1966 /********************************************************* Helper functions *******************************************/
1967
1968 /**
1969  * extracts the tag number from the tag header.
1970  * @param tvb "TestyVirtualBuffer"
1971  * @param offset in actual tvb
1972  * @return Tag Number corresponding to BACnet 20.2.1.2 Tag Number
1973  */
1974 static guint
1975 fTagNo (tvbuff_t *tvb, guint offset);
1976
1977 /**
1978  * splits Tag Header coresponding to 20.2.1 General Rules For BACnet Tags
1979  * @param tvb = "TestyVirtualBuffer"
1980  * @param offset = offset in actual tvb
1981  * @return tag_no BACnet 20.2.1.2 Tag Number
1982  * @return class_tag BACnet 20.2.1.1 Class
1983  * @return lvt BACnet 20.2.1.3 Length/Value/Type
1984  * @return offs = length of this header
1985  */
1986
1987 static guint
1988 fTagHeader (tvbuff_t *tvb, guint offset, guint8 *tag_no, guint8* class_tag, guint32 *lvt);
1989
1990
1991 /**
1992  * adds processID with max 32Bit unsigned Integer Value to tree
1993  * @param tvb
1994  * @param tree
1995  * @param offset
1996  * @return modified offset
1997  */
1998 static guint
1999 fProcessId (tvbuff_t *tvb, proto_tree *tree, guint offset);
2000
2001 /**
2002  * adds timeSpan with max 32Bit unsigned Integer Value to tree
2003  * @param tvb
2004  * @param tree
2005  * @param offset
2006  * @return modified offset
2007  */
2008 static guint
2009 fTimeSpan (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
2010
2011 /**
2012  * BACnet Application PDUs chapter 21
2013  * BACnetPropertyIdentifier::= ENUMERATED {
2014  *       @see bacapp_property_identifier
2015  * }
2016  * @param tvb
2017  * @param pinfo
2018  * @param tree
2019  * @param offset
2020  * @param tt returnvalue of this item
2021  * @return modified offset
2022  */
2023 static guint
2024 fPropertyIdentifier (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
2025
2026 /**
2027  * BACnet Application PDUs chapter 21
2028  * BACnetPropertyArrayIndex::= ENUMERATED {
2029  *       @see bacapp_property_array_index
2030  * }
2031  * @param tvb
2032  * @param tree
2033  * @param offset
2034  * @param tt returnvalue of this item
2035  * @return modified offset
2036  */
2037 static guint
2038 fPropertyArrayIndex (tvbuff_t *tvb, proto_tree *tree, guint offset);
2039
2040 /**
2041  * listOfEventSummaries ::= SEQUENCE OF SEQUENCE {
2042  *      objectIdentifier        [0] BACnetObjectIdentifier,
2043  *  eventState  [1] BACnetEventState,
2044  *  acknowledgedTransitions [2] BACnetEventTransitionBits,
2045  *  eventTimeStamps [3] SEQURNCE SIZE (3) OF BACnetTimeStamps,
2046  *  notifyType  [4] BACnetNotifyType,
2047  *  eventEnable [5] BACnetEventTransitionBits,
2048  *  eventPriorities [6] SEQUENCE SIZE (3) OF Unsigned
2049  * }
2050  * @param tvb
2051  * @param pinfo
2052  * @param tree
2053  * @param offset
2054  * @return modified offset
2055  */
2056 static guint
2057 flistOfEventSummaries (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
2058
2059 /**
2060  * SelectionCriteria ::= SEQUENCE {
2061  *      propertyIdentifier      [0] BACnetPropertyIdentifier,
2062  *      propertyArrayIndex      [1] Unsigned OPTIONAL, -- used only with array datatype
2063  *  relationSpecifier   [2] ENUMERATED { bacapp_relationSpecifier },
2064  *  comparisonValue     [3] ABSTRACT-SYNTAX.&Type
2065  * }
2066  * @param tvb
2067  * @param pinfo
2068  * @param tree
2069  * @param offset
2070  * @return modified offset
2071  */
2072 static guint
2073 fSelectionCriteria (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
2074
2075 /**
2076  * objectSelectionCriteria ::= SEQUENCE {
2077  *      selectionLogic  [0] ENUMERATED { bacapp_selectionLogic },
2078  *      listOfSelectionCriteria [1] SelectionCriteria
2079  * }
2080  * @param tvb
2081  * @param pinfo
2082  * @param tree
2083  * @param offset
2084  * @return modified offset
2085  */
2086 static guint
2087 fObjectSelectionCriteria (tvbuff_t *tvb, packet_info *pinfo, proto_tree *subtree, guint offset);
2088
2089 /**
2090  * BACnet-Error ::= SEQUENCE {
2091  *    error-class ENUMERATED {},
2092  *    error-code  ENUMERATED {}
2093  *    }
2094  * }
2095  * @param tvb
2096  * @param pinfo
2097  * @param tree
2098  * @param offset
2099  * @return modified offset
2100  */
2101 static guint
2102 fError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
2103
2104 /**
2105  * Generic handler for context tagged values.  Mostly for handling
2106  * vendor-defined properties and services.
2107  * @param tvb
2108  * @param tree
2109  * @param offset
2110  * @return modified offset
2111  * @todo beautify this ugly construct
2112  */
2113 static guint
2114 fContextTaggedValue(tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label);
2115
2116 /**
2117  * realizes some ABSTRACT-SYNTAX.&Type
2118  * @param tvb
2119  * @param pinfo
2120  * @param tree
2121  * @param offset
2122  * @return modified offset
2123  * @todo beautify this ugly construct
2124  */
2125 static guint
2126 fAbstractSyntaxNType (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset);
2127
2128
2129 static guint
2130 fBitStringTagVS (tvbuff_t *tvb, proto_tree *tree, guint offset, const gchar *label,
2131         const value_string *src);
2132
2133 /**
2134  * register_bacapp
2135  */
2136 void
2137 proto_register_bacapp(void);
2138
2139 /**
2140  * proto_reg_handoff_bacapp
2141  */
2142 void
2143 proto_reg_handoff_bacapp(void);
2144
2145 /**
2146  * converts XXX coded strings to UTF-8
2147  * else 'in' is copied to 'out'
2148  * @param in  -- pointer to string
2149  * @param inbytesleft
2150  * @param out -- pointer to string
2151  * @param outbytesleft
2152  * @param fromcoding
2153  * @return count of modified characters of returned string, -1 for errors
2154  */
2155 static guint32
2156 fConvertXXXtoUTF8(gchar *in, gsize *inbytesleft, gchar *out, gsize *outbytesleft, const gchar *fromcoding);
2157
2158 static void
2159 uni_to_string(char * data, gsize str_length, char *dest_buf);
2160
2161 /* <<<< formerly bacapp.h */
2162
2163 /* some hashes for segmented messages */
2164 static GHashTable *msg_fragment_table = NULL;
2165 static GHashTable *msg_reassembled_table = NULL;
2166
2167 /* some necessary forward function prototypes */
2168 static guint
2169 fApplicationTypesEnumerated (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset,
2170         const gchar *label, const value_string *vs);
2171
2172 static const char *bacapp_unknown_service_str = "unknown service";
2173 static const char *ASHRAE_Reserved_Fmt = "(%d) Reserved for Use by ASHRAE";
2174 static const char *Vendor_Proprietary_Fmt = "(%d) Vendor Proprietary Value";
2175
2176 static const value_string
2177 BACnetTypeName[] = {
2178         {0, "Confirmed-REQ"},
2179         {1, "Unconfirmed-REQ"},
2180         {2, "Simple-ACK"},
2181         {3, "Complex-ACK"},
2182         {4, "Segment-ACK"},
2183         {5, "Error"},
2184         {6, "Reject"},
2185         {7, "Abort"},
2186         {0, NULL }
2187 };
2188
2189 static const true_false_string segments_follow = {
2190         "Segmented Request",
2191         "Unsegmented Request"
2192 };
2193
2194 static const true_false_string more_follow = {
2195         "More Segments Follow",
2196         "No More Segments Follow"
2197 };
2198
2199 static const true_false_string segmented_accept = {
2200         "Segmented Response accepted",
2201         "Segmented Response not accepted"
2202 };
2203
2204 static const true_false_string
2205 BACnetTagClass = {
2206         "Context Specific Tag",
2207         "Application Tag"
2208 };
2209
2210 static const value_string
2211 BACnetMaxSegmentsAccepted [] = {
2212         {0,"Unspecified"},
2213         {1,"2 segments"},
2214         {2,"4 segments"},
2215         {3,"8 segments"},
2216         {4,"16 segments"},
2217         {5,"32 segments"},
2218         {6,"64 segments"},
2219         {7,"Greater than 64 segments"},
2220         {0,NULL }
2221 };
2222
2223 static const value_string
2224 BACnetMaxAPDULengthAccepted [] = {
2225         {0,"Up to MinimumMessageSize (50 octets)"},
2226         {1,"Up to 128 octets"},
2227         {2,"Up to 206 octets (fits in a LonTalk frame)"},
2228         {3,"Up to 480 octets (fits in an ARCNET frame)"},
2229         {4,"Up to 1024 octets"},
2230         {5,"Up to 1476 octets (fits in an ISO 8802-3 frame)"},
2231         {6,"reserved by ASHRAE"},
2232         {7,"reserved by ASHRAE"},
2233         {8,"reserved by ASHRAE"},
2234         {9,"reserved by ASHRAE"},
2235         {10,"reserved by ASHRAE"},
2236         {11,"reserved by ASHRAE"},
2237         {12,"reserved by ASHRAE"},
2238         {13,"reserved by ASHRAE"},
2239         {14,"reserved by ASHRAE"},
2240         {15,"reserved by ASHRAE"},
2241         {0,NULL}
2242 };
2243
2244 static const value_string
2245 BACnetRejectReason [] = {
2246         {0,"other"},
2247         {1,"buffer-overflow"},
2248         {2,"inconsistent-parameters"},
2249         {3,"invalid-parameter-data-type"},
2250         {4,"invalid-tag"},
2251         {5,"missing-required-parameter"},
2252         {6,"parameter-out-of-range"},
2253         {7,"too-many-arguments"},
2254         {8,"undefined-enumeration"},
2255         {9,"unrecognized-service"},
2256         {0,NULL}
2257 };
2258
2259 static const value_string
2260 BACnetRestartReason [] = {
2261         {0,"unknown"},
2262         {1,"coldstart"},
2263         {2,"warmstart"},
2264         {3,"detected-power-lost"},
2265         {4,"detected-powered-off"},
2266         {5,"hardware-watchdog"},
2267         {6,"software-watchdog"},
2268         {7,"suspended"},
2269         {0,NULL}
2270 };
2271
2272 static const value_string
2273 BACnetApplicationTagNumber [] = {
2274         {0,"Null"},
2275         {1,"Boolean"},
2276         {2,"Unsigned Integer"},
2277         {3,"Signed Integer (2's complement notation)"},
2278         {4,"Real (ANSI/IEE-754 floating point)"},
2279         {5,"Double (ANSI/IEE-754 double precision floating point)"},
2280         {6,"Octet String"},
2281         {7,"Character String"},
2282         {8,"Bit String"},
2283         {9,"Enumerated"},
2284         {10,"Date"},
2285         {11,"Time"},
2286         {12,"BACnetObjectIdentifier"},
2287         {13,"reserved by ASHRAE"},
2288         {14,"reserved by ASHRAE"},
2289         {15,"reserved by ASHRAE"},
2290         {0,NULL}
2291 };
2292
2293 static const value_string
2294 BACnetAction [] = {
2295         {0,"direct"},
2296         {1,"reverse"},
2297         {0,NULL}
2298 };
2299
2300 static const value_string
2301 BACnetFileAccessMethod [] = {
2302         {0,"record-access"},
2303         {1,"stream-access"},
2304         {0,NULL}
2305 };
2306
2307 /* For some reason, BACnet defines the choice parameter
2308    in the file read and write services backwards from the
2309    BACnetFileAccessMethod enumeration.
2310 */
2311 static const value_string
2312 BACnetFileAccessOption [] = {
2313         {0,"stream access"},
2314         {1,"record access"},
2315         {0,NULL}
2316 };
2317
2318 static const value_string
2319 BACnetFileStartOption [] = {
2320         {0, "File Start Position: "},
2321         {1, "File Start Record: "},
2322         {0, NULL}
2323 };
2324
2325 static const value_string
2326 BACnetFileRequestCount [] = {
2327         {0, "Requested Octet Count: "},
2328         {1, "Requested Record Count: "},
2329         {0, NULL}
2330 };
2331
2332 static const value_string
2333 BACnetFileWriteInfo [] = {
2334         {0, "File Data: "},
2335         {1, "Record Count: "},
2336         {0, NULL}
2337 };
2338
2339 static const value_string
2340 BACnetAbortReason [] = {
2341         {0,"other"},
2342         {1,"buffer-overflow"},
2343         {2,"invalid-apdu-in-this-state"},
2344         {3,"preempted-by-higher-priority-task"},
2345         {4,"segmentation-not-supported"},
2346         {0,NULL}
2347 };
2348
2349 static const value_string
2350 BACnetLifeSafetyMode [] = {
2351         {0,"off"},
2352         {1,"on"},
2353         {2,"test"},
2354         {3,"manned"},
2355         {4,"unmanned"},
2356         {5,"armed"},
2357         {6,"disarmed"},
2358         {7,"prearmed"},
2359         {8,"slow"},
2360         {9,"fast"},
2361         {10,"disconnected"},
2362         {11,"enabled"},
2363         {12,"disabled"},
2364         {13,"atomic-release-disabled"},
2365         {14,"default"},
2366         {0,NULL}
2367 /* Enumerated values 0-255 are reserved for definition by ASHRAE.
2368    Enumerated values 256-65535 may be used by others subject to
2369    procedures and constraints described in Clause 23. */
2370 };
2371
2372 static const value_string
2373 BACnetLifeSafetyOperation [] = {
2374         {0,"none"},
2375         {1,"silence"},
2376         {2,"silence-audible"},
2377         {3,"silence-visual"},
2378         {4,"reset"},
2379         {5,"reset-alarm"},
2380         {6,"reset-fault"},
2381         {7,"unsilence"},
2382         {8,"unsilence-audible"},
2383         {9,"unsilence-visual"},
2384         {0,NULL}
2385 /* Enumerated values 0-63 are reserved for definition by ASHRAE.
2386    Enumerated values 64-65535 may be used by others subject to
2387    procedures and constraints described in Clause 23. */
2388 };
2389
2390 static const value_string
2391 BACnetLimitEnable [] = {
2392         {0,"lowLimitEnable"},
2393         {1,"highLimitEnable"},
2394         {0,NULL}
2395 };
2396
2397 static const value_string
2398 BACnetLifeSafetyState [] = {
2399         {0,"quiet"},
2400         {1,"pre-alarm"},
2401         {2,"alarm"},
2402         {3,"fault"},
2403         {4,"fault-pre-alarm"},
2404         {5,"fault-alarm"},
2405         {6,"not-ready"},
2406         {7,"active"},
2407         {8,"tamper"},
2408         {9,"test-alarm"},
2409         {10,"test-active"},
2410         {11,"test-fault"},
2411         {12,"test-fault-alarm"},
2412         {13,"holdup"},
2413         {14,"duress"},
2414         {15,"tamper-alarm"},
2415         {16,"abnormal"},
2416         {17,"emergency-power"},
2417         {18,"delayed"},
2418         {19,"blocked"},
2419         {20,"local-alarm"},
2420         {21,"general-alarm"},
2421         {22,"supervisory"},
2422         {23,"test-supervisory"},
2423         {0,NULL}
2424 /* Enumerated values 0-255 are reserved for definition by ASHRAE.
2425    Enumerated values 256-65535 may be used by others subject to
2426    procedures and constraints described in Clause 23. */
2427 };
2428
2429 static const value_string
2430 BACnetConfirmedServiceChoice [] = {
2431         {0,"acknowledgeAlarm"},
2432         {1,"confirmedCOVNotification"},
2433         {2,"confirmedEventNotification"},
2434         {3,"getAlarmSummary"},
2435         {4,"getEnrollmentSummary"},
2436         {5,"subscribeCOV"},
2437         {6,"atomicReadFile"},
2438         {7,"atomicWriteFile"},
2439         {8,"addListElement"},
2440         {9,"removeListElement"},
2441         {10,"createObject"},
2442         {11,"deleteObject"},
2443         {12,"readProperty"},
2444         {13,"readPropertyConditional"},
2445         {14,"readPropertyMultiple"},
2446         {15,"writeProperty"},
2447         {16,"writePropertyMultiple"},
2448         {17,"deviceCommunicationControl"},
2449         {18,"confirmedPrivateTransfer"},
2450         {19,"confirmedTextMessage"},
2451         {20,"reinitializeDevice"},
2452         {21,"vtOpen"},
2453         {22,"vtClose"},
2454         {23,"vtData"},
2455         {24,"authenticate"},
2456         {25,"requestKey"},
2457         {26,"readRange"},
2458         {27,"lifeSafetyOperation"},
2459         {28,"subscribeCOVProperty"},
2460         {29,"getEventInformation"},
2461         {30,"reserved by ASHRAE"},
2462         {0, NULL}
2463 };
2464
2465 static const value_string
2466 BACnetReliability [] = {
2467         {0,"no-fault-detected"},
2468         {1,"no-sensor"},
2469         {2,"over-range"},
2470         {3,"under-range"},
2471         {4,"open-loop"},
2472         {5,"shorted-loop"},
2473         {6,"no-output"},
2474         {7,"unreliable-other"},
2475         {8,"process-error"},
2476         {9,"multi-state-fault"},
2477         {0,NULL}
2478 };
2479
2480 static const value_string
2481 BACnetUnconfirmedServiceChoice [] = {
2482         {0,"i-Am"},
2483         {1,"i-Have"},
2484         {2,"unconfirmedCOVNotification"},
2485         {3,"unconfirmedEventNotification"},
2486         {4,"unconfirmedPrivateTransfer"},
2487         {5,"unconfirmedTextMessage"},
2488         {6,"timeSynchronization"},
2489         {7,"who-Has"},
2490         {8,"who-Is"},
2491         {9,"utcTimeSynchonization"},
2492         {0,NULL}
2493 };
2494
2495 static const value_string
2496 BACnetUnconfirmedServiceRequest [] = {
2497         {0,"i-Am-Request"},
2498         {1,"i-Have-Request"},
2499         {2,"unconfirmedCOVNotification-Request"},
2500         {3,"unconfirmedEventNotification-Request"},
2501         {4,"unconfirmedPrivateTransfer-Request"},
2502         {5,"unconfirmedTextMessage-Request"},
2503         {6,"timeSynchronization-Request"},
2504         {7,"who-Has-Request"},
2505         {8,"who-Is-Request"},
2506         {9,"utcTimeSynchonization-Request"},
2507         {0,NULL}
2508 };
2509
2510 static const value_string
2511 BACnetObjectType [] = {
2512         {0,"analog-input"},
2513         {1,"analog-output"},
2514         {2,"analog-value"},
2515         {3,"binary-input"},
2516         {4,"binary-output"},
2517         {5,"binary-value"},
2518         {6,"calendar"},
2519         {7,"command"},
2520         {8,"device"},
2521         {9,"event-enrollment"},
2522         {10,"file"},
2523         {11,"group"},
2524         {12,"loop"},
2525         {13,"multi-state-input"},
2526         {14,"multi-state-output"},
2527         {15,"notification-class"},
2528         {16,"program"},
2529         {17,"schedule"},
2530         {18,"averaging"},
2531         {19,"multi-state-value"},
2532         {20,"trend-log"},
2533         {21,"life-safety-point"},
2534         {22,"life-safety-zone"},
2535         {23,"accumulator"},
2536         {24,"pulse-converter"},
2537         {25,"event-log"},
2538         {26,"global-group"},
2539         {27,"trend-log-multiple"},
2540         {28,"load-control"},
2541         {29,"structured-view"},
2542         {30,"access-door"},             /* 30-37 added with addanda 135-2008j */
2543         {32,"access-credential"},
2544         {33,"access-point"},
2545         {34,"access-rights"},
2546         {35,"access-user"},
2547         {36,"access-zone"},
2548         {37,"credential-data-input"},
2549         {39,"bitstring-value"},         /* 39-50 added with addenda 135-2008w */
2550         {40,"characterstring-value"},
2551         {41,"date-pattern-value"},
2552         {42,"date-value"},
2553         {43,"datetime-pattern-value"},
2554         {44,"datetime-value"},
2555         {45,"integer-value"},
2556         {46,"large-analog-value"},
2557         {47,"octetstring-value"},
2558         {48,"positive-Integer-value"},
2559         {49,"time-pattern-value"},
2560         {50,"time-value"},
2561         {0, NULL}
2562 /* Enumerated values 0-127 are reserved for definition by ASHRAE.
2563    Enumerated values 128-1023 may be used by others subject to
2564    the procedures and constraints described in Clause 23. */
2565 };
2566
2567 static const value_string
2568 BACnetEngineeringUnits [] = {
2569         {0,"Sq Meters"},
2570         {1,"Sq Feet"},
2571         {2,"Milliamperes"},
2572         {3,"Amperes"},
2573         {4,"Ohms"},
2574         {5,"Volts"},
2575         {6,"Kilovolts"},
2576         {7,"Megavolts"},
2577         {8,"Volt Amperes"},
2578         {9,"Kilovolt Amperes"},
2579         {10,"Megavolt Amperes"},
2580         {11,"Volt Amperes Reactive"},
2581         {12,"Kilovolt Amperes Reactive"},
2582         {13,"Megavolt Amperes Reactive"},
2583         {14,"Degrees Phase"},
2584         {15,"Power Factor"},
2585         {16,"Joules"},
2586         {17,"Kilojoules"},
2587         {18,"Watt Hours"},
2588         {19,"Kilowatt Hours"},
2589         {20,"BTUs"},
2590         {21,"Therms"},
2591         {22,"Ton Hours"},
2592         {23,"Joules Per Kg Dry Air"},
2593         {24,"BTUs Per Pound Dry Air"},
2594         {25,"Cycles Per Hour"},
2595         {26,"Cycles Per Minute"},
2596         {27,"Hertz"},
2597         {28,"Grams Of Water Per Kilogram Dry Air"},
2598         {29,"Relative Humidity"},
2599         {30,"Millimeters"},
2600         {31,"Meters"},
2601         {32,"Inches"},
2602         {33,"Feed"},
2603         {34,"Watts Per Sq Foot"},
2604         {35,"Watts Per Sq meter"},
2605         {36,"Lumens"},
2606         {37,"Lux"},
2607         {38,"Foot Candles"},
2608         {39,"Kilograms"},
2609         {40,"Pounds Mass"},
2610         {41,"Tons"},
2611         {42,"Kgs per Second"},
2612         {43,"Kgs Per Minute"},
2613         {44,"Kgs Per Hour"},
2614         {45,"Pounds Mass Per Minute"},
2615         {46,"Pounds Mass Per Hour"},
2616         {47,"Watt"},
2617         {48,"Kilowatts"},
2618         {49,"Megawatts"},
2619         {50,"BTUs Per Hour"},
2620         {51,"Horsepower"},
2621         {52,"Tons Refrigeration"},
2622         {53,"Pascals"},
2623         {54,"Kilopascals"},
2624         {55,"Bars"},
2625         {56,"Pounds Force Per Square Inch"},
2626         {57,"Centimeters Of Water"},
2627         {58,"Inches Of Water"},
2628         {59,"Millimeters Of Mercury"},
2629         {60,"Centimeters Of Mercury"},
2630         {61,"Inches Of Mercury"},
2631         {62,"Degrees Celsius"},
2632         {63,"Degrees Kelvin"},
2633         {64,"Degrees Fahrenheit"},
2634         {65,"Degree Days Celsius"},
2635         {66,"Degree Days Fahrenheit"},
2636         {67,"Years"},
2637         {68,"Months"},
2638         {69,"Weeks"},
2639         {70,"Days"},
2640         {71,"Hours"},
2641         {72,"Minutes"},
2642         {73,"Seconds"},
2643         {74,"Meters Per Second"},
2644         {75,"Kilometers Per Hour"},
2645         {76,"Feed Per Second"},
2646         {77,"Feet Per Minute"},
2647         {78,"Miles Per Hour"},
2648         {79,"Cubic Feet"},
2649         {80,"Cubic Meters"},
2650         {81,"Imperial Gallons"},
2651         {82,"Liters"},
2652         {83,"US Gallons"},
2653         {84,"Cubic Feet Per Minute"},
2654         {85,"Cubic Meters Per Second"},
2655         {86,"Imperial Gallons Per Minute"},
2656         {87,"Liters Per Second"},
2657         {88,"Liters Per Minute"},
2658         {89,"US Gallons Per Minute"},
2659         {90,"Degrees Angular"},
2660         {91,"Degrees Celsius Per Hour"},
2661         {92,"Degrees Celsius Per Minute"},
2662         {93,"Degrees Fahrenheit Per Hour"},
2663         {94,"Degrees Fahrenheit Per Minute"},
2664         {95,"No Units"},
2665         {96,"Parts Per Million"},
2666         {97,"Parts Per Billion"},
2667         {98,"Percent"},
2668         {99,"Pecent Per Second"},
2669         {100,"Per Minute"},
2670         {101,"Per Second"},
2671         {102,"Psi Per Degree Fahrenheit"},
2672         {103,"Radians"},
2673         {104,"Revolutions Per Min"},
2674         {105,"Currency1"},
2675         {106,"Currency2"},
2676         {107,"Currency3"},
2677         {108,"Currency4"},
2678         {109,"Currency5"},
2679         {110,"Currency6"},
2680         {111,"Currency7"},
2681         {112,"Currency8"},
2682         {113,"Currency9"},
2683         {114,"Currency10"},
2684         {115,"Sq Inches"},
2685         {116,"Sq Centimeters"},
2686         {117,"BTUs Per Pound"},
2687         {118,"Centimeters"},
2688         {119,"Pounds Mass Per Second"},
2689         {120,"Delta Degrees Fahrenheit"},
2690         {121,"Delta Degrees Kelvin"},
2691         {122,"Kilohms"},
2692         {123,"Megohms"},
2693         {124,"Millivolts"},
2694         {125,"Kilojoules Per Kg"},
2695         {126,"Megajoules"},
2696         {127,"Joules Per Degree Kelvin"},
2697         {128,"Joules Per Kg Degree Kelvin"},
2698         {129,"Kilohertz"},
2699         {130,"Megahertz"},
2700         {131,"Per Hour"},
2701         {132,"Milliwatts"},
2702         {133,"Hectopascals"},
2703         {134,"Millibars"},
2704         {135,"Cubic Meters Per Hour"},
2705         {136,"Liters Per Hour"},
2706         {137,"KWatt Hours Per Square Meter"},
2707         {138,"KWatt Hours Per Square Foot"},
2708         {139,"Megajoules Per Square Meter"},
2709         {140,"Megajoules Per Square Foot"},
2710         {141,"Watts Per Sq Meter Degree Kelvin"},
2711         {142,"Cubic Feet Per Second"},
2712         {143,"Percent Obstruction Per Foot"},
2713         {144,"Percent Obstruction Per Meter"},
2714         {145,"milliohms"},
2715         {146,"megawatt-hours"},
2716         {147,"kilo-btus"},
2717         {148,"mega-btus"},
2718         {149,"kilojoules-per-kilogram-dry-air"},
2719         {150,"megajoules-per-kilogram-dry-air"},
2720         {151,"kilojoules-per-degree-Kelvin"},
2721         {152,"megajoules-per-degree-Kelvin"},
2722         {153,"newton"},
2723         {154,"grams-per-second"},
2724         {155,"grams-per-minute"},
2725         {156,"tons-per-hour"},
2726         {157,"kilo-btus-per-hour"},
2727         {158,"hundredths-seconds"},
2728         {159,"milliseconds"},
2729         {160,"newton-meters"},
2730         {161,"millimeters-per-second"},
2731         {162,"millimeters-per-minute"},
2732         {163,"meters-per-minute"},
2733         {164,"meters-per-hour"},
2734         {165,"cubic-meters-per-minute"},
2735         {166,"meters-per-second-per-second"},
2736         {167,"amperes-per-meter"},
2737         {168,"amperes-per-square-meter"},
2738         {169,"ampere-square-meters"},
2739         {170,"farads"},
2740         {171,"henrys"},
2741         {172,"ohm-meters"},
2742         {173,"siemens"},
2743         {174,"siemens-per-meter"},
2744         {175,"teslas"},
2745         {176,"volts-per-degree-Kelvin"},
2746         {177,"volts-per-meter"},
2747         {178,"webers"},
2748         {179,"candelas"},
2749         {180,"candelas-per-square-meter"},
2750         {181,"degrees-Kelvin-per-hour"},
2751         {182,"degrees-Kelvin-per-minute"},
2752         {183,"joule-seconds"},
2753         {184,"radians-per-second"},
2754         {185,"square-meters-per-Newton"},
2755         {186,"kilograms-per-cubic-meter"},
2756         {187,"newton-seconds"},
2757         {188,"newtons-per-meter"},
2758         {189,"watts-per-meter-per-degree-Kelvin"},
2759         {0,NULL}
2760 /* Enumerated values 0-255 are reserved for definition by ASHRAE.
2761    Enumerated values 256-65535 may be used by others subject to
2762    the procedures and constraints described in Clause 23. */
2763 };
2764
2765 static const value_string
2766 BACnetErrorCode [] = {
2767         {0,"other"},
2768         {1,"authentication-failed"},
2769         {2,"configuration-in-progress"},
2770         {3,"device-busy"},
2771         {4,"dynamic-creation-not-supported"},
2772         {5,"file-access-denied"},
2773         {6,"incompatible-security-levels"},
2774         {7,"inconsistent-parameters"},
2775         {8,"inconsistent-selection-criterion"},
2776         {9,"invalid-data-type"},
2777         {10,"invalid-file-access-method"},
2778         {11,"invalid-file-start-position"},
2779         {12,"invalid-operator-name"},
2780         {13,"invalid-parameter-data-type"},
2781         {14,"invalid-time-stamp"},
2782         {15,"key-generation-error"},
2783         {16,"missing-required-parameter"},
2784         {17,"no-objects-of-specified-type"},
2785         {18,"no-space-for-object"},
2786         {19,"no-space-to-add-list-element"},
2787         {20,"no-space-to-write-property"},
2788         {21,"no-vt-sessions-available"},
2789         {22,"property-is-not-a-list"},
2790         {23,"object-deletion-not-permitted"},
2791         {24,"object-identifier-already-exists"},
2792         {25,"operational-problem"},
2793         {26,"password-failure"},
2794         {27,"read-access-denied"},
2795         {28,"security-not-supported"},
2796         {29,"service-request-denied"},
2797         {30,"timeout"},
2798         {31,"unknown-object"},
2799         {32,"unknown-property"},
2800         {33,"removed enumeration"},
2801         {34,"unknown-vt-class"},
2802         {35,"unknown-vt-session"},
2803         {36,"unsupported-object-type"},
2804         {37,"value-out-of-range"},
2805         {38,"vt-session-already-closed"},
2806         {39,"vt-session-termination-failure"},
2807         {40,"write-access-denied"},
2808         {41,"character-set-not-supported"},
2809         {42,"invalid-array-index"},
2810         {43,"cov-subscription-failed"},
2811         {44,"not-cov-property"},
2812         {45,"optional-functionality-not-supported"},
2813         {46,"invalid-configuration-data"},
2814         {47,"datatype-not-supported"},
2815         {48,"duplicate-name"},
2816         {49,"duplicate-object-id"},
2817         {50,"property-is-not-an-array"},
2818         {73,"invalid-event-state"},
2819         {74,"no-alarm-configured"},
2820         {0, NULL}
2821 /* Enumerated values 0-255 are reserved for definition by ASHRAE.
2822    Enumerated values 256-65535 may be used by others subject to the
2823    procedures and constraints described in Clause 23. */
2824 };
2825
2826 static const value_string
2827 BACnetPropertyIdentifier [] = {
2828         {0,"acked-transition"},
2829         {1,"ack-required"},
2830         {2,"action"},
2831         {3,"action-text"},
2832         {4,"active-text"},
2833         {5,"active-vt-session"},
2834         {6,"alarm-value"},
2835         {7,"alarm-values"},
2836         {8,"all"},
2837         {9,"all-write-successful"},
2838         {10,"apdu-segment-timeout"},
2839         {11,"apdu-timeout"},
2840         {12,"application-software-version"},
2841         {13,"archive"},
2842         {14,"bias"},
2843         {15,"change-of-state-count"},
2844         {16,"change-of-state-time"},
2845         {17,"notification-class"},
2846         {18,"the property in this place was deleted"},
2847         {19,"controlled-variable-reference"},
2848         {20,"controlled-variable-units"},
2849         {21,"controlled-variable-value"},
2850         {22,"cov-increment"},
2851         {23,"datelist"},
2852         {24,"daylights-savings-status"},
2853         {25,"deadband"},
2854         {26,"derivative-constant"},
2855         {27,"derivative-constant-units"},
2856         {28,"description"},
2857         {29,"description-of-halt"},
2858         {30,"device-address-binding"},
2859         {31,"device-type"},
2860         {32,"effective-period"},
2861         {33,"elapsed-active-time"},
2862         {34,"error-limit"},
2863         {35,"event-enable"},
2864         {36,"event-state"},
2865         {37,"event-type"},
2866         {38,"exception-schedule"},
2867         {39,"fault-values"},
2868         {40,"feedback-value"},
2869         {41,"file-access-method"},
2870         {42,"file-size"},
2871         {43,"file-type"},
2872         {44,"firmware-revision"},
2873         {45,"high-limit"},
2874         {46,"inactive-text"},
2875         {47,"in-progress"},
2876         {48,"instance-of"},
2877         {49,"integral-constant"},
2878         {50,"integral-constant-units"},
2879         {51,"issue-confirmed-notifications"},
2880         {52,"limit-enable"},
2881         {53,"list-of-group-members"},
2882         {54,"list-of-object-property-references"},
2883         {55,"list-of-session-keys"},
2884         {56,"local-date"},
2885         {57,"local-time"},
2886         {58,"location"},
2887         {59,"low-limit"},
2888         {60,"manipulated-variable-reference"},
2889         {61,"maximum-output"},
2890         {62,"max-apdu-length-accepted"},
2891         {63,"max-info-frames"},
2892         {64,"max-master"},
2893         {65,"max-pres-value"},
2894         {66,"minimum-off-time"},
2895         {67,"minimum-on-time"},
2896         {68,"minimum-output"},
2897         {69,"min-pres-value"},
2898         {70,"model-name"},
2899         {71,"modification-date"},
2900         {72,"notify-type"},
2901         {73,"number-of-APDU-retries"},
2902         {74,"number-of-states"},
2903         {75,"object-identifier"},
2904         {76,"object-list"},
2905         {77,"object-name"},
2906         {78,"object-property-reference"},
2907         {79,"object-type"},
2908         {80,"optional"},
2909         {81,"out-of-service"},
2910         {82,"output-units"},
2911         {83,"event-parameters"},
2912         {84,"polarity"},
2913         {85,"present-value"},
2914         {86,"priority"},
2915         {87,"priority-array"},
2916         {88,"priority-for-writing"},
2917         {89,"process-identifier"},
2918         {90,"program-change"},
2919         {91,"program-location"},
2920         {92,"program-state"},
2921         {93,"proportional-constant"},
2922         {94,"proportional-constant-units"},
2923         {95,"protocol-conformance-class"},
2924         {96,"protocol-object-types-supported"},
2925         {97,"protocol-services-supported"},
2926         {98,"protocol-version"},
2927         {99,"read-only"},
2928         {100,"reason-for-halt"},
2929         {101,"recipient"},
2930         {102,"recipient-list"},
2931         {103,"reliability"},
2932         {104,"relinquish-default"},
2933         {105,"required"},
2934         {106,"resolution"},
2935         {107,"segmentation-supported"},
2936         {108,"setpoint"},
2937         {109,"setpoint-reference"},
2938         {110,"state-text"},
2939         {111,"status-flags"},
2940         {112,"system-status"},
2941         {113,"time-delay"},
2942         {114,"time-of-active-time-reset"},
2943         {115,"time-of-state-count-reset"},
2944         {116,"time-synchronization-recipients"},
2945         {117,"units"},
2946         {118,"update-interval"},
2947         {119,"utc-offset"},
2948         {120,"vendor-identifier"},
2949         {121,"vendor-name"},
2950         {122,"vt-class-supported"},
2951         {123,"weekly-schedule"},
2952         {124,"attempted-samples"},
2953         {125,"average-value"},
2954         {126,"buffer-size"},
2955         {127,"client-cov-increment"},
2956         {128,"cov-resubscription-interval"},
2957         {129,"current-notify-time"},
2958         {130,"event-time-stamp"},
2959         {131,"log-buffer"},
2960         {132,"log-device-object-property"},
2961         {133,"enable"}, /* per ANSI/ASHRAE 135-2004 addendum B */
2962         {134,"log-interval"},
2963         {135,"maximum-value"},
2964         {136,"minimum-value"},
2965         {137,"notification-threshold"},
2966         {138,"previous-notify-time"},
2967         {139,"protocol-revision"},
2968         {140,"records-since-notification"},
2969         {141,"record-count"},
2970         {142,"start-time"},
2971         {143,"stop-time"},
2972         {144,"stop-when-full"},
2973         {145,"total-record-count"},
2974         {146,"valid-samples"},
2975         {147,"window-interval"},
2976         {148,"window-samples"},
2977         {149,"maximum-value-time-stamp"},
2978         {150,"minimum-value-time-stamp"},
2979         {151,"variance-value"},
2980         {152,"active-cov-subscriptions"},
2981         {153,"backup-failure-timeout"},
2982         {154,"configuration-files"},
2983         {155,"database-revision"},
2984         {156,"direct-reading"},
2985         {157,"last-restore-time"},
2986         {158,"maintenance-required"},
2987         {159,"member-of"},
2988         {160,"mode"},
2989         {161,"operation-expected"},
2990         {162,"setting"},
2991         {163,"silenced"},
2992         {164,"tracking-value"},
2993         {165,"zone-members"},
2994         {166,"life-safety-alarm-values"},
2995         {167,"max-segments-accepted"},
2996         {168,"profile-name"},
2997         {169,"auto-slave-discovery"},
2998         {170,"manual-slave-address-binding"},
2999         {171,"slave-address-binding"},
3000         {172,"slave-proxy-enable"},
3001         {173,"last-notify-record"},             /* bug 4117 */
3002         {174,"schedule-default"},
3003         {175,"accepted-modes"},
3004         {176,"adjust-value"},
3005         {177,"count"},
3006         {178,"count-before-change"},
3007         {179,"count-change-time"},
3008         {180,"cov-period"},
3009         {181,"input-reference"},
3010         {182,"limit-monitoring-interval"},
3011         {183,"logging-device"},
3012         {184,"logging-record"},
3013         {185,"prescale"},
3014         {186,"pulse-rate"},
3015         {187,"scale"},
3016         {188,"scale-factor"},
3017         {189,"update-time"},
3018         {190,"value-before-change"},
3019         {191,"value-set"},
3020         {192,"value-change-time"},
3021         {193,"align-intervals"},
3022         {194,"group-member-names"},
3023         {195,"interval-offset"},
3024         {196,"last-restart-reason"},
3025         {197,"logging-type"},
3026         {198,"member-status-flags"},
3027         {199,"notification-period"},
3028         {200,"previous-notify-record"},
3029         {201,"requested-update-interval"},
3030         {202,"restart-notification-recipients"},
3031         {203,"time-of-device-restart"},
3032         {204,"time-synchronization-recipients"},
3033         {205,"trigger"},
3034         {206,"UTC-time-synchronization-recipients"},
3035         {207,"node-subtype"},
3036         {208,"node-type"},
3037         {209,"structured-object-list"},
3038         {210,"subordinate-annotations"},
3039         {211,"subordinate-list"},
3040         {212,"actual-shed-level"},
3041         {213,"duty-window"},
3042         {214,"expected-shed-level"},
3043         {215,"full-duty-baseline"},
3044         {216,"node-subtype"},
3045         {217,"node-type"},
3046         {218,"requested-shed-level"},
3047         {219,"shed-duration"},
3048         {220,"shed-level-descriptions"},
3049         {221,"shed-levels"},
3050         {222,"state-description"},
3051         {226,"door-alarm-state"},
3052         {227,"door-extended-pulse-time"},
3053         {228,"door-members"},
3054         {229,"door-open-too-long-time"},
3055         {230,"door-pulse-time"},
3056         {231,"door-status"},
3057         {232,"door-unlock-delay-time"},
3058         {233,"lock-status"},
3059         {234,"masked-alarm-values"},
3060         {235,"secured-status"},
3061         {244,"absentee-limit"},         /* added with addenda 135-2008j */
3062         {245,"access-alarm-events"},
3063         {246,"access-doors"},
3064         {247,"access-event"},
3065         {248,"access-event-authentication-factor"},
3066         {249,"access-event-credential"},
3067         {250,"access-event-time"},
3068         {251,"access-transaction-events"},
3069         {252,"accompaniment"},
3070         {253,"accompaniment-time"},
3071         {254,"activation-time"},
3072         {255,"active-authentication-policy"},
3073         {256,"assigned-access-rights"},
3074         {257,"authentication-factors"},
3075         {258,"authentication-policy-list"},
3076         {259,"authentication-policy-names"},
3077         {260,"authentication-status"},
3078         {261,"authorization-mode"},
3079         {262,"belongs-to"},
3080         {263,"credential-disable"},
3081         {264,"credential-status"},
3082         {265,"credentials"},
3083         {266,"credentials-in-zone"},
3084         {267,"days-remaining"},
3085         {268,"entry-points"},
3086         {269,"exit-points"},
3087         {270,"expiry-time"},
3088         {271,"extended-time-enable"},
3089         {272,"failed-attempt-events"},
3090         {273,"failed-attempts"},
3091         {274,"failed-attempts-time"},
3092         {275,"last-access-event"},
3093         {276,"last-access-point"},
3094         {277,"last-credential-added"},
3095         {278,"last-credential-added-time"},
3096         {279,"last-credential-removed"},
3097         {280,"last-credential-removed-time"},
3098         {281,"last-use-time"},
3099         {282,"lockout"},
3100         {283,"lockout-relinquish-time"},
3101         {284,"master-exemption"},
3102         {285,"max-failed-attempts"},
3103         {286,"members"},
3104         {287,"muster-point"},
3105         {288,"negative-access-rules"},
3106         {289,"number-of-authentication-policies"},
3107         {290,"occupancy-count"},
3108         {291,"occupancy-count-adjust"},
3109         {292,"occupancy-count-enable"},
3110         {293,"occupancy-exemption"},
3111         {294,"occupancy-lower-limit"},
3112         {295,"occupancy-lower-limit-enforced"},
3113         {296,"occupancy-state"},
3114         {297,"occupancy-upper-limit"},
3115         {298,"occupancy-upper-limit-enforced"},
3116         {299,"passback-exemption"},
3117         {300,"passback-mode"},
3118         {301,"passback-timeout"},
3119         {302,"positive-access-rules"},
3120         {303,"reason-for-disable"},
3121         {304,"supported-formats"},
3122         {305,"supported-format-classes"},
3123         {306,"threat-authority"},
3124         {307,"threat-level"},
3125         {308,"trace-flag"},
3126         {309,"transaction-notification-class"},
3127         {310,"user-external-identifier"},
3128         {311,"user-information-reference"},
3129         /* enumeration values 312-316 reserved for future addenda */
3130         {317,"user-name"},
3131         {318,"user-type"},
3132         {319,"uses-remaining"},
3133         {320,"zone-from"},
3134         {321,"zone-to"},
3135         {322,"access-event-tag"},
3136         {323,"global-identifier"},
3137         /* enumeration values 324-325 reserved for future addenda */
3138         {326,"verification-time"},
3139         {342,"bit-mask"},               /* addenda 135-2008w */
3140         {343,"bit-text"},
3141         {344,"is-utc"},
3142         {0, NULL}
3143 /* Enumerated values 0-511 are reserved for definition by ASHRAE.
3144    Enumerated values 512-4194303 may be used by others subject to
3145    the procedures and constraints described in Clause 23. */
3146 };
3147
3148 static const value_string
3149 BACnetBinaryPV [] = {
3150         {0,"inactive"},
3151         {1,"active"},
3152         {0,NULL}
3153 };
3154
3155
3156 #define ANSI_X34 0
3157 #define IBM_MS_DBCS 1
3158 #define JIS_C_6226 2
3159 #define ISO_10646_UCS4 3
3160 #define ISO_10646_UCS2 4
3161 #define ISO_18859_1 5
3162 static const value_string
3163 BACnetCharacterSet [] = {
3164         {ANSI_X34,      "ANSI X3.4 / UTF-8 (since 2010)"},
3165         {IBM_MS_DBCS,   "IBM/Microsoft DBCS"},
3166         {JIS_C_6226,    "JIS C 6226"},
3167         {ISO_10646_UCS4, "ISO 10646(UCS-4)"},
3168         {ISO_10646_UCS2, "ISO 10646(UCS-2)"},
3169         {ISO_18859_1,   "ISO 18859-1"},
3170         {0,             NULL}
3171 };
3172
3173 static const value_string
3174 BACnetStatusFlags [] = {
3175         {0,"in-alarm"},
3176         {1,"fault"},
3177         {2,"overridden"},
3178         {3,"out-of-service"},
3179         {0,NULL}
3180 };
3181
3182 static const value_string
3183 BACnetMessagePriority [] = {
3184         {0,"normal"},
3185         {1,"urgent"},
3186         {0,NULL}
3187 };
3188
3189 static const value_string
3190 BACnetAcknowledgementFilter [] = {
3191         {0,"all"},
3192         {1,"acked"},
3193         {2,"not-acked"},
3194         {0,NULL}
3195 };
3196
3197 static const value_string
3198 BACnetResultFlags [] = {
3199         {0,"firstitem"},
3200         {1,"lastitem"},
3201         {2,"moreitems"},
3202         {0,NULL}
3203 };
3204
3205 static const value_string
3206 BACnetRelationSpecifier [] = {
3207         {0,"equal"},
3208         {1,"not-equal"},
3209         {2,"less-than"},
3210         {3,"greater-than"},
3211         {4,"less-than-or-equal"},
3212         {5,"greater-than-or-equal"},
3213         {0,NULL}
3214 };
3215
3216 static const value_string
3217 BACnetSelectionLogic [] = {
3218         {0,"and"},
3219         {1,"or"},
3220         {2,"all"},
3221         {0,NULL}
3222 };
3223
3224 static const value_string
3225 BACnetEventStateFilter [] = {
3226         {0,"offnormal"},
3227         {1,"fault"},
3228         {2,"normal"},
3229         {3,"all"},
3230         {4,"active"},
3231         {0,NULL}
3232 };
3233
3234 static const value_string
3235 BACnetEventTransitionBits [] = {
3236         {0,"to-offnormal"},
3237         {1,"to-fault"},
3238         {2,"to-normal"},
3239         {0,NULL}
3240 };
3241
3242 static const value_string
3243 BACnetSegmentation [] = {
3244         {0,"segmented-both"},
3245         {1,"segmented-transmit"},
3246         {2,"segmented-receive"},
3247         {3,"no-segmentation"},
3248         {0,NULL}
3249 };
3250
3251 static const value_string
3252 BACnetSilencedState [] = {
3253         {0,"unsilenced"},
3254         {1,"audible-silenced"},
3255         {2,"visible-silenced"},
3256         {3,"all-silenced"},
3257         {0,NULL}
3258 };
3259
3260 static const value_string
3261 BACnetDeviceStatus [] = {
3262         {0,"operational"},
3263         {1,"operational-read-only"},
3264         {2,"download-required"},
3265         {3,"download-in-progress"},
3266         {4,"non-operational"},
3267         {5,"backup-in-progress"},
3268         {0,NULL}
3269 };
3270
3271 static const value_string
3272 BACnetEnableDisable [] = {
3273         {0,"enable"},
3274         {1,"disable"},
3275         {2,"disable-initiation"},
3276         {0,NULL}
3277 };
3278
3279 static const value_string
3280 months [] = {
3281         {1,"January" },
3282         {2,"February" },
3283         {3,"March" },
3284         {4,"April" },
3285         {5,"May" },
3286         {6,"June" },
3287         {7,"July" },
3288         {8,"August" },
3289         {9,"September" },
3290         {10,"October" },
3291         {11,"November" },
3292         {12,"December" },
3293         {255,"any month" },
3294         {0,NULL }
3295 };
3296
3297 static const value_string
3298 weekofmonth [] = {
3299         {1,"days numbered 1-7" },
3300         {2,"days numbered 8-14" },
3301         {3,"days numbered 15-21" },
3302         {4,"days numbered 22-28" },
3303         {5,"days numbered 29-31" },
3304         {6,"last 7 days of this month" },
3305         {255,"any week of this month" },
3306         {0,NULL }
3307 };
3308
3309 /* note: notification class object recipient-list uses
3310    different day-of-week enum */
3311 static const value_string
3312 day_of_week [] = {
3313         {1,"Monday" },
3314         {2,"Tuesday" },
3315         {3,"Wednesday" },
3316         {4,"Thursday" },
3317         {5,"Friday" },
3318         {6,"Saturday" },
3319         {7,"Sunday" },
3320         {255,"any day of week" },
3321         {0,NULL }
3322 };
3323
3324 static const value_string
3325 BACnetErrorClass [] = {
3326         {0,"device" },
3327         {1,"object" },
3328         {2,"property" },
3329         {3,"resources" },
3330         {4,"security" },
3331         {5,"services" },
3332         {6,"vt" },
3333         {0,NULL }
3334 /* Enumerated values 0-63 are reserved for definition by ASHRAE.
3335    Enumerated values64-65535 may be used by others subject to
3336    the procedures and constraints described in Clause 23. */
3337 };
3338
3339 static const value_string
3340 BACnetVTClass [] = {
3341         {0,"default-terminal" },
3342         {1,"ansi-x3-64" },
3343         {2,"dec-vt52" },
3344         {3,"dec-vt100" },
3345         {4,"dec-vt200" },
3346         {5,"hp-700-94" },
3347         {6,"ibm-3130" },
3348         {0,NULL }
3349 };
3350
3351 static const value_string
3352 BACnetEventType [] = {
3353         {0,"change-of-bitstring" },
3354         {1,"change-of-state" },
3355         {2,"change-of-value" },
3356         {3,"command-failure" },
3357         {4,"floating-limit" },
3358         {5,"out-of-range" },
3359         {6,"complex-event-type" },
3360         {7,"buffer-ready" },
3361         {8,"change-of-life-safety" },
3362         {9,"extended" },
3363         {10,"buffer-ready" },
3364         {11,"unsigned-range" },
3365         {14,"double-out-of-range"},             /* added with addenda 135-2008w */
3366         {15,"signed-out-of-range"},
3367         {16,"unsigned-out-of-range"},
3368         {17,"change-of-characterstring"},
3369         {0,NULL }
3370 /* Enumerated values 0-63 are reserved for definition by ASHRAE.
3371    Enumerated values 64-65535 may be used by others subject to
3372    the procedures and constraints described in Clause 23.
3373    It is expected that these enumerated values will correspond
3374    to the use of the complex-event-type CHOICE [6] of the
3375    BACnetNotificationParameters production. */
3376 };
3377
3378 static const value_string
3379 BACnetEventState [] = {
3380         {0,"normal" },
3381         {1,"fault" },
3382         {2,"offnormal" },
3383         {3,"high-limit" },
3384         {4,"low-limit" },
3385         {5,"life-safety-alarm" },
3386         {0,NULL }
3387 /* Enumerated values 0-63 are reserved for definition by ASHRAE.
3388    Enumerated values 64-65535 may be used by others subject to
3389    the procedures and constraints described in Clause 23.  */
3390 };
3391
3392 static const value_string
3393 BACnetLogStatus [] = {
3394         {0,"log-disabled" },
3395         {1,"buffer-purged" },
3396         {0,NULL }
3397 };
3398
3399 static const value_string
3400 BACnetMaintenance [] = {
3401         {0,"none" },
3402         {1,"periodic-test" },
3403         {2,"need-service-operational" },
3404         {3,"need-service-inoperative" },
3405         {0,NULL }
3406 };
3407
3408 static const value_string
3409 BACnetNotifyType [] = {
3410         {0,"alarm" },
3411         {1,"event" },
3412         {2,"ack-notification" },
3413         {0,NULL }
3414 };
3415
3416 static const value_string
3417 BACnetServicesSupported [] = {
3418         {0,"acknowledgeAlarm"},
3419         {1,"confirmedCOVNotification"},
3420         {2,"confirmedEventNotification"},
3421         {3,"getAlarmSummary"},
3422         {4,"getEnrollmentSummary"},
3423         {5,"subscribeCOV"},
3424         {6,"atomicReadFile"},
3425         {7,"atomicWriteFile"},
3426         {8,"addListElement"},
3427         {9,"removeListElement"},
3428         {10,"createObject"},
3429         {11,"deleteObject"},
3430         {12,"readProperty"},
3431         {13,"readPropertyConditional"},
3432         {14,"readPropertyMultiple"},
3433         {15,"writeProperty"},
3434         {16,"writePropertyMultiple"},
3435         {17,"deviceCommunicationControl"},
3436         {18,"confirmedPrivateTransfer"},
3437         {19,"confirmedTextMessage"},
3438         {20,"reinitializeDevice"},
3439         {21,"vtOpen"},
3440         {22,"vtClose"},
3441         {23,"vtData"},
3442         {24,"authenticate"},
3443         {25,"requestKey"},
3444         {26,"i-Am"},
3445         {27,"i-Have"},
3446         {28,"unconfirmedCOVNotification"},
3447         {29,"unconfirmedEventNotification"},
3448         {30,"unconfirmedPrivateTransfer"},
3449         {31,"unconfirmedTextMessage"},
3450         {32,"timeSynchronization"},
3451         {33,"who-Has"},
3452         {34,"who-Is"},
3453         {35,"readRange"},
3454         {36,"utcTimeSynchronization"},
3455         {37,"lifeSafetyOperation"},
3456         {38,"subscribeCOVProperty"},
3457         {39,"getEventInformation"},
3458         {0, NULL}
3459 };
3460
3461 static const value_string
3462 BACnetPropertyStates [] = {
3463         {0,"boolean-value"},
3464         {1,"binary-value"},
3465         {2,"event-type"},
3466         {3,"polarity"},
3467         {4,"program-change"},
3468         {5,"program-state"},
3469         {6,"reason-for-halt"},
3470         {7,"reliability"},
3471         {8,"state"},
3472         {9,"system-status"},
3473         {10,"units"},
3474         {11,"unsigned-value"},
3475         {12,"life-safety-mode"},
3476         {13,"life-safety-state"},
3477         {14,"door-alarm-state"},
3478         {0,NULL}
3479 /* Tag values 0-63 are reserved for definition by ASHRAE.
3480    Tag values of 64-254 may be used by others to accommodate
3481    vendor specific properties that have discrete or enumerated values,
3482    subject to the constraints described in Clause 23. */
3483 };
3484
3485 static const value_string
3486 BACnetProgramError [] = {
3487         {0,"normal"},
3488         {1,"load-failed"},
3489         {2,"internal"},
3490         {3,"program"},
3491         {4,"other"},
3492         {0,NULL}
3493 /* Enumerated values 0-63 are reserved for definition by ASHRAE.
3494    Enumerated values 64-65535 may be used by others subject to
3495    the procedures and constraints described in Clause 23. */
3496 };
3497
3498 static const value_string
3499 BACnetProgramRequest [] = {
3500         {0,"ready"},
3501         {1,"load"},
3502         {2,"run"},
3503         {3,"halt"},
3504         {4,"restart"},
3505         {4,"unload"},
3506         {0,NULL}
3507 };
3508
3509 static const value_string
3510 BACnetProgramState [] = {
3511         {0,"idle"},
3512         {1,"loading"},
3513         {2,"running"},
3514         {3,"waiting"},
3515         {4,"halted"},
3516         {4,"unloading"},
3517         {0,NULL}
3518 };
3519
3520 static const value_string
3521 BACnetReinitializedStateOfDevice [] = {
3522         {0,"coldstart"},
3523         {1,"warmstart"},
3524         {2,"startbackup"},
3525         {3,"endbackup"},
3526         {4,"startrestore"},
3527         {5,"endrestore"},
3528         {6,"abortrestore"},
3529         {0,NULL}
3530 };
3531
3532 static const value_string
3533 BACnetPolarity [] = {
3534         {0,"normal"},
3535         {1,"reverse"},
3536         {0,NULL}
3537 };
3538
3539 static const value_string
3540 BACnetTagNames[] = {
3541         { 5, "Extended Value" },
3542         { 6, "Opening Tag" },
3543         { 7, "Closing Tag" },
3544         { 0, NULL }
3545 };
3546
3547 static const value_string
3548 BACnetReadRangeOptions[] = {
3549         { 3, "range byPosition" },
3550         { 4, "range byTime" },
3551         { 5, "range timeRange" },
3552         { 6, "range bySequenceNumber" },
3553         { 7, "range byTime" },
3554         { 0, NULL }
3555 };
3556
3557 /* Present_Value for Load Control Object */
3558 static const value_string
3559 BACnetShedState[] = {
3560         { 0, "shed-inactive" },
3561         { 1, "shed-request-pending" },
3562         { 2, "shed-compliant" },
3563         { 3, "shed-non-compliant" },
3564         { 0, NULL }
3565 };
3566
3567 static const value_string
3568 BACnetVendorIdentifiers [] = {
3569         { 0, "ASHRAE" },
3570         { 1, "NIST" },
3571         { 2, "The Trane Company" },
3572         { 3, "McQuay International" },
3573         { 4, "PolarSoft" },
3574         { 5, "Johnson Controls, Inc." },
3575         { 6, "American Auto-Matrix" },
3576         { 7, "Siemens Building Technologies, Ltd., Landis & Staefa Division Europe" },
3577         { 8, "Delta Controls" },
3578         { 9, "Siemens Building Technologies, Inc." },
3579         { 10, "Tour Andover Controls Corporation" },
3580         { 11, "TAC" },
3581         { 12, "Orion Analysis Corporation" },
3582         { 13, "Teletrol Systems Inc." },
3583         { 14, "Cimetrics Technology" },
3584         { 15, "Cornell University" },
3585         { 16, "United Technologies Carrier" },
3586         { 17, "Honeywell Inc." },
3587         { 18, "Alerton / Honeywell" },
3588         { 19, "TAC AB" },
3589         { 20, "Hewlett-Packard Company" },
3590         { 21, "Dorsette's Inc." },
3591         { 22, "Cerberus AG" },
3592         { 23, "York Controls Group" },
3593         { 24, "Automated Logic Corporation" },
3594         { 25, "CSI Control Systems International" },
3595         { 26, "Phoenix Controls Corporation" },
3596         { 27, "Innovex Technologies, Inc." },
3597         { 28, "KMC Controls, Inc." },
3598         { 29, "Xn Technologies, Inc." },
3599         { 30, "Hyundai Information Technology Co., Ltd." },
3600         { 31, "Tokimec Inc." },
3601         { 32, "Simplex" },
3602         { 33, "North Communications Limited" },
3603         { 34, "Notifier" },
3604         { 35, "Reliable Controls Corporation" },
3605         { 36, "Tridium Inc." },
3606         { 37, "Sierra Monitor Corp." },
3607         { 38, "Silicon Energy" },
3608         { 39, "Kieback & Peter GmbH & Co KG" },
3609         { 40, "Anacon Systems, Inc." },
3610         { 41, "Systems Controls & Instruments, LLC" },
3611         { 42, "Lithonia Lighting" },
3612         { 43, "Micropower Manufacturing" },
3613         { 44, "Matrix Controls" },
3614         { 45, "METALAIRE" },
3615         { 46, "ESS Engineering" },
3616         { 47, "Sphere Systems Pty Ltd." },
3617         { 48, "Walker Technologies Corporation" },
3618         { 49, "H I Solutions, Inc." },
3619         { 50, "MBS GmbH" },
3620         { 51, "SAMSON AG" },
3621         { 52, "Badger Meter Inc." },
3622         { 53, "DAIKIN Industries Ltd." },
3623         { 54, "NARA Controls Inc." },
3624         { 55, "Mammoth Inc." },
3625         { 56, "Liebert Corporation" },
3626         { 57, "SEMCO Incorporated" },
3627         { 58, "Air Monitor Corporation" },
3628         { 59, "TRIATEK, Inc." },
3629         { 60, "NexLight" },
3630         { 61, "Multistack" },
3631         { 62, "TSI Incorporated" },
3632         { 63, "Weather-Rite, Inc." },
3633         { 64, "Dunham-Bush" },
3634         { 65, "Reliance Electric" },
3635         { 66, "LCS Inc." },
3636         { 67, "Regulator Australia PTY Ltd." },
3637         { 68, "Touch-Plate Lighting Controls" },
3638         { 69, "Amann GmbH" },
3639         { 70, "RLE Technologies" },
3640         { 71, "Cardkey Systems" },
3641         { 72, "SECOM Co., Ltd." },
3642         { 73, "ABB Gebaudetechnik AG Bereich NetServ" },
3643         { 74, "KNX Association cvba" },
3644         { 75, "Institute of Electrical Installation Engineers of Japan (IEIEJ)" },
3645         { 76, "Nohmi Bosai, Ltd." },
3646         { 77, "Carel S.p.A." },
3647         { 78, "AirSense Technology, Inc." },
3648         { 79, "Hochiki Corporation" },
3649         { 80, "Fr. Sauter AG" },
3650         { 81, "Matsushita Electric Works, Ltd." },
3651         { 82, "Mitsubishi Electric Corporation, Inazawa Works" },
3652         { 83, "Mitsubishi Heavy Industries, Ltd." },
3653         { 84, "ITT Bell & Gossett" },
3654         { 85, "Yamatake Building Systems Co., Ltd." },
3655         { 86, "The Watt Stopper, Inc." },
3656         { 87, "Aichi Tokei Denki Co., Ltd." },
3657         { 88, "Activation Technologies, LLC" },
3658         { 89, "Saia-Burgess Controls, Ltd." },
3659         { 90, "Hitachi, Ltd." },
3660         { 91, "Novar Corp./Trend Control Systems Ltd." },
3661         { 92, "Mitsubishi Electric Lighting Corporation" },
3662         { 93, "Argus Control Systems, Ltd." },
3663         { 94, "Kyuki Corporation" },
3664         { 95, "Richards-Zeta Building Intelligence, Inc." },
3665         { 96, "Scientech R&D, Inc." },
3666         { 97, "VCI Controls, Inc." },
3667         { 98, "Toshiba Corporation" },
3668         { 99, "Mitsubishi Electric Corporation Air Conditioning & Refrigeration Systems Works" },
3669         { 100, "Custom Mechanical Equipment, LLC" },
3670         { 101, "ClimateMaster" },
3671         { 102, "ICP Panel-Tec, Inc." },
3672         { 103, "D-Tek Controls" },
3673         { 104, "NEC Engineering, Ltd." },
3674         { 105, "PRIVA BV" },
3675         { 106, "Meidensha Corporation" },
3676         { 107, "JCI Systems Integration Services" },
3677         { 108, "Freedom Corporation" },
3678         { 109, "Neuberger Gebaudeautomation GmbH" },
3679         { 110, "Sitronix" },
3680         { 111, "Leviton Manufacturing" },
3681         { 112, "Fujitsu Limited" },
3682         { 113, "Emerson Network Power" },
3683         { 114, "S. A. Armstrong, Ltd." },
3684         { 115, "Visonet AG" },
3685         { 116, "M&M Systems, Inc." },
3686         { 117, "Custom Software Engineering" },
3687         { 118, "Nittan Company, Limited" },
3688         { 119, "Elutions Inc. (Wizcon Systems SAS)" },
3689         { 120, "Pacom Systems Pty., Ltd." },
3690         { 121, "Unico, Inc." },
3691         { 122, "Ebtron, Inc." },
3692         { 123, "Scada Engine" },
3693         { 124, "AC Technology Corporation" },
3694         { 125, "Eagle Technology" },
3695         { 126, "Data Aire, Inc." },
3696         { 127, "ABB, Inc." },
3697         { 128, "Transbit Sp. z o. o." },
3698         { 129, "Toshiba Carrier Corporation" },
3699         { 130, "Shenzhen Junzhi Hi-Tech Co., Ltd." },
3700         { 131, "Tokai Soft" },
3701         { 132, "Lumisys" },
3702         { 133, "Veris Industries" },
3703         { 134, "Centaurus Prime" },
3704         { 135, "Sand Network Systems" },
3705         { 136, "Regulvar, Inc." },
3706         { 137, "Fastek International, Ltd." },
3707         { 138, "PowerCold Comfort Air Solutions, Inc." },
3708         { 139, "I Controls" },
3709         { 140, "Viconics Electronics, Inc." },
3710         { 141, "Yaskawa Electric America, Inc." },
3711         { 142, "Plueth Regelsysteme" },
3712         { 143, "Digitale Mess- und Steuersysteme AG" },
3713         { 144, "Fujitsu General Limited" },
3714         { 145, "Project Engineering S.r.l." },
3715         { 146, "Sanyo Electric Co., Ltd." },
3716         { 147, "Integrated Information Systems, Inc." },
3717         { 148, "Temco Controls, Ltd." },
3718         { 149, "Airtek Technologies, Inc." },
3719         { 150, "Advantech Corporation" },
3720         { 151, "Titan Products, Ltd." },
3721         { 152, "Regel Partners" },
3722         { 153, "National Environmental Product" },
3723         { 154, "Unitec Corporation" },
3724         { 155, "Kanden Engineering Company" },
3725         { 156, "Messner Gebaudetechnik GmbH" },
3726         { 157, "Integrated.CH" },
3727         { 158, "EH Price Limited" },
3728         { 159, "SE-Elektronic GmbH" },
3729         { 160, "Rockwell Automation" },
3730         { 161, "Enflex Corp." },
3731         { 162, "ASI Controls" },
3732         { 163, "SysMik GmbH Dresden" },
3733         { 164, "HSC Regelungstechnik GmbH" },
3734         { 165, "Smart Temp Australia Pty. Ltd." },
3735         { 166, "PCI Lighting Control Systems" },
3736         { 167, "Duksan Mecasys Co., Ltd." },
3737         { 168, "Fuji IT Co., Ltd." },
3738         { 169, "Vacon Plc" },
3739         { 170, "Leader Controls" },
3740         { 171, "Cylon Controls, Ltd." },
3741         { 172, "Compas" },
3742         { 173, "Mitsubishi Electric Building Techno-Service Co., Ltd." },
3743         { 174, "Building Control Integrators" },
3744         { 175, "ITG Worldwide (M) Sdn Bhd" },
3745         { 176, "Lutron Electronics Co., Inc." },
3746         { 177, "Cooper-Atkins Corporation" },
3747         { 178, "LOYTEC Electronics GmbH" },
3748         { 179, "ProLon" },
3749         { 180, "Mega Controls Limited" },
3750         { 181, "Micro Control Systems, Inc." },
3751         { 182, "Kiyon, Inc." },
3752         { 183, "Dust Networks" },
3753         { 184, "Advanced Building Automation Systems" },
3754         { 185, "Hermos AG" },
3755         { 186, "CEZIM" },
3756         { 187, "Softing" },
3757         { 188, "Lynxspring" },
3758         { 189, "Schneider Toshiba Inverter Europe" },
3759         { 190, "Danfoss Drives A/S" },
3760         { 191, "Eaton Corporation" },
3761         { 192, "Matyca S.A." },
3762         { 193, "Botech AB" },
3763         { 194, "Noveo, Inc." },
3764         { 195, "AMEV" },
3765         { 196, "Yokogawa Electric Corporation" },
3766         { 197, "GFR Gesellschaft fur Regelungstechnik" },
3767         { 198, "Exact Logic" },
3768         { 199, "Mass Electronics Pty Ltd dba Innotech Control Systems Australia" },
3769         { 200, "Kandenko Co., Ltd." },
3770         { 201, "DTF, Daten-Technik Fries" },
3771         { 202, "Klimasoft, Ltd." },
3772         { 203, "Toshiba Schneider Inverter Corporation" },
3773         { 204, "Control Applications, Ltd." },
3774         { 205, "KDT Systems Co., Ltd." },
3775         { 206, "Onicon Incorporated" },
3776         { 207, "Automation Displays, Inc." },
3777         { 208, "Control Solutions, Inc." },
3778         { 209, "Remsdaq Limited" },
3779         { 210, "NTT Facilities, Inc." },
3780         { 211, "VIPA GmbH" },
3781         { 212, "TSC21 Association of Japan" },
3782         { 213, "BBP Energie Ltee" },
3783         { 214, "HRW Limited" },
3784         { 215, "Lighting Control & Design, Inc." },
3785         { 216, "Mercy Electronic and Electrical Industries" },
3786         { 217, "Samsung SDS Co., Ltd" },
3787         { 218, "Impact Facility Solutions, Inc." },
3788         { 219, "Aircuity" },
3789         { 220, "Control Techniques, Ltd." },
3790         { 221, "Evolve Control Systems, LLC" },
3791         { 222, "WAGO Kontakttechnik GmbH & Co. KG" },
3792         { 223, "Cerus Industrial" },
3793         { 224, "Chloride Power Protection Company" },
3794         { 225, "Computrols, Inc." },
3795         { 226, "Phoenix Contact GmbH & Co. KG" },
3796         { 227, "Grundfos Management A/S" },
3797         { 228, "Ridder Drive Systems" },
3798         { 229, "Soft Device SDN BHD" },
3799         { 230, "Integrated Control Technology Limited" },
3800         { 231, "AIRxpert Systems, Inc." },
3801         { 232, "Microtrol Limited" },
3802         { 233, "Red Lion Controls" },
3803         { 234, "Digital Electronics Corporation" },
3804         { 235, "Ennovatis GmbH" },
3805         { 236, "Serotonin Software Technologies, Inc." },
3806         { 237, "LS Industrial Systems Co., Ltd." },
3807         { 238, "Square D Company" },
3808         { 239, "S Squared Innovations, Inc." },
3809         { 240, "Aricent Ltd." },
3810         { 241, "EtherMetrics, LLC" },
3811         { 242, "Industrial Control Communications, Inc." },
3812         { 243, "Paragon Controls, Inc." },
3813         { 244, "A. O. Smith Corporation" },
3814         { 245, "Contemporary Control Systems, Inc." },
3815         { 246, "Intesis Software SL" },
3816         { 247, "Ingenieurgesellschaft N. Hartleb mbH" },
3817         { 248, "Heat-Timer Corporation" },
3818         { 249, "Ingrasys Technology, Inc." },
3819         { 250, "Costerm Building Automation" },
3820         { 251, "Wilo AG" },
3821         { 252, "Embedia Technologies Corp." },
3822         { 253, "Technilog" },
3823         { 254, "HR Controls Ltd. & Co. KG" },
3824         { 255, "Lennox International, Inc." },
3825         { 256, "RK-Tec Rauchklappen-Steuerungssysteme GmbH & Co. KG" },
3826         { 257, "Thermomax, Ltd." },
3827         { 258, "ELCON Electronic Control, Ltd." },
3828         { 259, "Larmia Control AB" },
3829         { 260, "BACnet Stack at SourceForge" },
3830         { 261, "G4S Security Services A/S" },
3831         { 262, "Sitek S.p.A." },
3832         { 263, "Cristal Controles" },
3833         { 264, "Regin AB" },
3834         { 265, "Dimension Software, Inc. " },
3835         { 266, "SynapSense Corporation" },
3836         { 267, "Beijing Nantree Electronic Co., Ltd." },
3837         { 268, "Camus Hydronics Ltd." },
3838         { 269, "Kawasaki Heavy Industries, Ltd. " },
3839         { 270, "Critical Environment Technologies" },
3840         { 271, "ILSHIN IBS Co., Ltd." },
3841         { 272, "ELESTA Energy Control AG" },
3842         { 273, "KROPMAN Installatietechniek" },
3843         { 274, "Baldor Electric Company" },
3844         { 275, "INGA mbH" },
3845         { 276, "GE Consumer & Industrial" },
3846         { 277, "Functional Devices, Inc." },
3847         { 278, "ESAC" },
3848         { 279, "M-System Co., Ltd." },
3849         { 280, "Yokota Co., Ltd." },
3850         { 281, "Hitranse Technology Co., LTD" },
3851         { 282, "Federspiel Controls" },
3852         { 283, "Kele, Inc." },
3853         { 284, "Opera Electronics, Inc." },
3854         { 285, "Gentec" },
3855         { 286, "Embedded Science Labs, LLC" },
3856         { 287, "Parker Hannifin Corporation" },
3857         { 288, "MaCaPS International Limited" },
3858         { 289, "Link4 Corporation" },
3859         { 290, "Romutec Steuer-u. Regelsysteme GmbH" },
3860         { 291, "Pribusin, Inc." },
3861         { 292, "Advantage Controls" },
3862         { 293, "Critical Room Control" },
3863         { 294, "LEGRAND" },
3864         { 295, "Tongdy Control Technology Co., Ltd." },
3865         { 296, "ISSARO Integrierte Systemtechnik" },
3866         { 297, "Pro-Dev Industries" },
3867         { 298, "DRI-STEEM" },
3868         { 299, "Creative Electronic GmbH" },
3869         { 300, "Swegon AB" },
3870         { 301, "Jan Brachacek" },
3871         { 302, "Hitachi Appliances, Inc." },
3872         { 303, "Real Time Automation, Inc." },
3873         { 304, "ITEC Hankyu-Hanshin Co." },
3874         { 305, "Cyrus E&M Engineering Co., Ltd." },
3875         { 306, "Racine Federated, Inc." },
3876         { 307, "Verari Systems, Inc." },
3877         { 308, "Elesta GmbH Building Automation" },
3878         { 309, "Securiton" },
3879         { 310, "OSlsoft, Inc." },
3880         { 311, "Hanazeder Electronic GmbH" },
3881         { 312, "Honeywell Security Deutschland, Novar GmbH" },
3882         { 313, "Siemens Energy & Automation, Inc." },
3883         { 314, "ETM Professional Control GmbH" },
3884         { 315, "Meitav-tec, Ltd." },
3885         { 316, "Janitza Electronics GmbH" },
3886         { 317, "MKS Nordhausen" },
3887         { 318, "De Gier Drive Systems B.V." },
3888         { 319, "Cypress Envirosystems" },
3889         { 320, "SMARTron s.r.o." },
3890         { 321, "Verari Systems, Inc." },
3891         { 322, "K-W Electronic Service, Inc." },
3892         { 323, "ALFA-SMART Energy Management" },
3893         { 324, "Telkonet, Inc." },
3894         { 325, "Securiton GmbH" },
3895         { 326, "Cemtrex, Inc." },
3896         { 327, "Performance Technologies, Inc." },
3897         { 328, "Xtralis (Aust) Pty Ltd" },
3898         { 329, "TROX GmbH" },
3899         { 330, "Beijing Hysine Technology Co., Ltd" },
3900         { 331, "RCK Controls, Inc." },
3901         { 332, "ACELIA" },
3902         { 333, "Novar/Honeywell" },
3903         { 334, "The S4 Group, Inc." },
3904         { 335, "Schneider Electric" },
3905         { 336, "LHA Systems" },
3906         { 337, "GHM engineering Group, Inc." },
3907         { 338, "Cllimalux S.A." },
3908         { 339, "VAISALA Oyj" },
3909         { 340, "COMPLEX (Beijing) Technology, Co., LTD." },
3910         { 342, "POWERPEG NSI Limited" },
3911         { 343, "BACnet Interoperability Testing Services, Inc." },
3912         { 344, "Teco a.s." },
3913         { 0, NULL }
3914 };
3915
3916 static int proto_bacapp = -1;
3917 static int hf_bacapp_type = -1;
3918 static int hf_bacapp_pduflags = -1;
3919 static int hf_bacapp_SEG = -1;
3920 static int hf_bacapp_MOR = -1;
3921 static int hf_bacapp_SA = -1;
3922 static int hf_bacapp_response_segments = -1;
3923 static int hf_bacapp_max_adpu_size = -1;
3924 static int hf_bacapp_invoke_id = -1;
3925 static int hf_bacapp_objectType = -1;
3926 static int hf_bacapp_instanceNumber = -1;
3927 static int hf_bacapp_sequence_number = -1;
3928 static int hf_bacapp_window_size = -1;
3929 static int hf_bacapp_service = -1;
3930 static int hf_bacapp_NAK = -1;
3931 static int hf_bacapp_SRV = -1;
3932 static int hf_BACnetRejectReason = -1;
3933 static int hf_BACnetAbortReason = -1;
3934 static int hf_BACnetApplicationTagNumber = -1;
3935 static int hf_BACnetContextTagNumber = -1;
3936 static int hf_BACnetExtendedTagNumber = -1;
3937 static int hf_BACnetNamedTag = -1;
3938 static int hf_BACnetTagClass = -1;
3939 static int hf_BACnetCharacterSet = -1;
3940 static int hf_bacapp_tag = -1;
3941 static int hf_bacapp_tag_lvt = -1;
3942 static int hf_bacapp_tag_value8 = -1;
3943 static int hf_bacapp_tag_value16 = -1;
3944 static int hf_bacapp_tag_value32 = -1;
3945 static int hf_bacapp_tag_ProcessId = -1;
3946 static int hf_bacapp_tag_initiatingObjectType = -1;
3947 static int hf_bacapp_vpart = -1;
3948 static int hf_bacapp_uservice = -1;
3949 static int hf_BACnetPropertyIdentifier = -1;