suricata
output-json-dnp3-objects.c
Go to the documentation of this file.
1 /* Copyright (C) 2015 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * DO NOT EDIT. THIS FILE IS AUTO-GENERATED.
20  *
21  * Generated by command:
22  * ./scripts/dnp3-gen/dnp3-gen.py
23  */
24 
25 #include "suricata-common.h"
26 
27 #include "util-crypt.h"
28 
29 #include "app-layer-dnp3.h"
30 #include "app-layer-dnp3-objects.h"
32 #include "output-json.h"
33 
34 #ifdef HAVE_LIBJANSSON
35 
36 void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
37  DNP3Point *point)
38 {
39 
40  switch (DNP3_OBJECT_CODE(object->group, object->variation)) {
41  case DNP3_OBJECT_CODE(1, 1): {
42  DNP3ObjectG1V1 *data = point->data;
43  json_object_set_new(js, "state",
44  json_integer(data->state));
45  break;
46  }
47  case DNP3_OBJECT_CODE(1, 2): {
48  DNP3ObjectG1V2 *data = point->data;
49  json_object_set_new(js, "online",
50  json_integer(data->online));
51  json_object_set_new(js, "restart",
52  json_integer(data->restart));
53  json_object_set_new(js, "comm_lost",
54  json_integer(data->comm_lost));
55  json_object_set_new(js, "remote_forced",
56  json_integer(data->remote_forced));
57  json_object_set_new(js, "local_forced",
58  json_integer(data->local_forced));
59  json_object_set_new(js, "chatter_filter",
60  json_integer(data->chatter_filter));
61  json_object_set_new(js, "reserved",
62  json_integer(data->reserved));
63  json_object_set_new(js, "state",
64  json_integer(data->state));
65  break;
66  }
67  case DNP3_OBJECT_CODE(2, 1): {
68  DNP3ObjectG2V1 *data = point->data;
69  json_object_set_new(js, "state",
70  json_integer(data->state));
71  break;
72  }
73  case DNP3_OBJECT_CODE(2, 2): {
74  DNP3ObjectG2V2 *data = point->data;
75  json_object_set_new(js, "online",
76  json_integer(data->online));
77  json_object_set_new(js, "restart",
78  json_integer(data->restart));
79  json_object_set_new(js, "comm_lost",
80  json_integer(data->comm_lost));
81  json_object_set_new(js, "remote_forced",
82  json_integer(data->remote_forced));
83  json_object_set_new(js, "local_forced",
84  json_integer(data->local_forced));
85  json_object_set_new(js, "chatter_filter",
86  json_integer(data->chatter_filter));
87  json_object_set_new(js, "reserved",
88  json_integer(data->reserved));
89  json_object_set_new(js, "state",
90  json_integer(data->state));
91  json_object_set_new(js, "timestamp",
92  json_integer(data->timestamp));
93  break;
94  }
95  case DNP3_OBJECT_CODE(2, 3): {
96  DNP3ObjectG2V3 *data = point->data;
97  json_object_set_new(js, "online",
98  json_integer(data->online));
99  json_object_set_new(js, "restart",
100  json_integer(data->restart));
101  json_object_set_new(js, "comm_lost",
102  json_integer(data->comm_lost));
103  json_object_set_new(js, "remote_forced",
104  json_integer(data->remote_forced));
105  json_object_set_new(js, "local_forced",
106  json_integer(data->local_forced));
107  json_object_set_new(js, "chatter_filter",
108  json_integer(data->chatter_filter));
109  json_object_set_new(js, "reserved",
110  json_integer(data->reserved));
111  json_object_set_new(js, "state",
112  json_integer(data->state));
113  json_object_set_new(js, "timestamp",
114  json_integer(data->timestamp));
115  break;
116  }
117  case DNP3_OBJECT_CODE(3, 1): {
118  DNP3ObjectG3V1 *data = point->data;
119  json_object_set_new(js, "state",
120  json_integer(data->state));
121  break;
122  }
123  case DNP3_OBJECT_CODE(3, 2): {
124  DNP3ObjectG3V2 *data = point->data;
125  json_object_set_new(js, "online",
126  json_integer(data->online));
127  json_object_set_new(js, "restart",
128  json_integer(data->restart));
129  json_object_set_new(js, "comm_lost",
130  json_integer(data->comm_lost));
131  json_object_set_new(js, "remote_forced",
132  json_integer(data->remote_forced));
133  json_object_set_new(js, "local_forced",
134  json_integer(data->local_forced));
135  json_object_set_new(js, "chatter_filter",
136  json_integer(data->chatter_filter));
137  json_object_set_new(js, "state",
138  json_integer(data->state));
139  break;
140  }
141  case DNP3_OBJECT_CODE(4, 1): {
142  DNP3ObjectG4V1 *data = point->data;
143  json_object_set_new(js, "online",
144  json_integer(data->online));
145  json_object_set_new(js, "restart",
146  json_integer(data->restart));
147  json_object_set_new(js, "comm_lost",
148  json_integer(data->comm_lost));
149  json_object_set_new(js, "remote_forced",
150  json_integer(data->remote_forced));
151  json_object_set_new(js, "local_forced",
152  json_integer(data->local_forced));
153  json_object_set_new(js, "chatter_filter",
154  json_integer(data->chatter_filter));
155  json_object_set_new(js, "state",
156  json_integer(data->state));
157  break;
158  }
159  case DNP3_OBJECT_CODE(4, 2): {
160  DNP3ObjectG4V2 *data = point->data;
161  json_object_set_new(js, "online",
162  json_integer(data->online));
163  json_object_set_new(js, "restart",
164  json_integer(data->restart));
165  json_object_set_new(js, "comm_lost",
166  json_integer(data->comm_lost));
167  json_object_set_new(js, "remote_forced",
168  json_integer(data->remote_forced));
169  json_object_set_new(js, "local_forced",
170  json_integer(data->local_forced));
171  json_object_set_new(js, "chatter_filter",
172  json_integer(data->chatter_filter));
173  json_object_set_new(js, "state",
174  json_integer(data->state));
175  json_object_set_new(js, "timestamp",
176  json_integer(data->timestamp));
177  break;
178  }
179  case DNP3_OBJECT_CODE(4, 3): {
180  DNP3ObjectG4V3 *data = point->data;
181  json_object_set_new(js, "online",
182  json_integer(data->online));
183  json_object_set_new(js, "restart",
184  json_integer(data->restart));
185  json_object_set_new(js, "comm_lost",
186  json_integer(data->comm_lost));
187  json_object_set_new(js, "remote_forced",
188  json_integer(data->remote_forced));
189  json_object_set_new(js, "local_forced",
190  json_integer(data->local_forced));
191  json_object_set_new(js, "chatter_filter",
192  json_integer(data->chatter_filter));
193  json_object_set_new(js, "state",
194  json_integer(data->state));
195  json_object_set_new(js, "relative_time_ms",
196  json_integer(data->relative_time_ms));
197  break;
198  }
199  case DNP3_OBJECT_CODE(10, 1): {
200  DNP3ObjectG10V1 *data = point->data;
201  json_object_set_new(js, "state",
202  json_integer(data->state));
203  break;
204  }
205  case DNP3_OBJECT_CODE(10, 2): {
206  DNP3ObjectG10V2 *data = point->data;
207  json_object_set_new(js, "online",
208  json_integer(data->online));
209  json_object_set_new(js, "restart",
210  json_integer(data->restart));
211  json_object_set_new(js, "comm_lost",
212  json_integer(data->comm_lost));
213  json_object_set_new(js, "remote_forced",
214  json_integer(data->remote_forced));
215  json_object_set_new(js, "local_forced",
216  json_integer(data->local_forced));
217  json_object_set_new(js, "reserved0",
218  json_integer(data->reserved0));
219  json_object_set_new(js, "reserved1",
220  json_integer(data->reserved1));
221  json_object_set_new(js, "state",
222  json_integer(data->state));
223  break;
224  }
225  case DNP3_OBJECT_CODE(11, 1): {
226  DNP3ObjectG11V1 *data = point->data;
227  json_object_set_new(js, "online",
228  json_integer(data->online));
229  json_object_set_new(js, "restart",
230  json_integer(data->restart));
231  json_object_set_new(js, "comm_lost",
232  json_integer(data->comm_lost));
233  json_object_set_new(js, "remote_forced",
234  json_integer(data->remote_forced));
235  json_object_set_new(js, "local_forced",
236  json_integer(data->local_forced));
237  json_object_set_new(js, "reserved0",
238  json_integer(data->reserved0));
239  json_object_set_new(js, "reserved1",
240  json_integer(data->reserved1));
241  json_object_set_new(js, "state",
242  json_integer(data->state));
243  break;
244  }
245  case DNP3_OBJECT_CODE(11, 2): {
246  DNP3ObjectG11V2 *data = point->data;
247  json_object_set_new(js, "online",
248  json_integer(data->online));
249  json_object_set_new(js, "restart",
250  json_integer(data->restart));
251  json_object_set_new(js, "comm_lost",
252  json_integer(data->comm_lost));
253  json_object_set_new(js, "remote_forced",
254  json_integer(data->remote_forced));
255  json_object_set_new(js, "local_forced",
256  json_integer(data->local_forced));
257  json_object_set_new(js, "reserved0",
258  json_integer(data->reserved0));
259  json_object_set_new(js, "reserved1",
260  json_integer(data->reserved1));
261  json_object_set_new(js, "state",
262  json_integer(data->state));
263  json_object_set_new(js, "timestamp",
264  json_integer(data->timestamp));
265  break;
266  }
267  case DNP3_OBJECT_CODE(12, 1): {
268  DNP3ObjectG12V1 *data = point->data;
269  json_object_set_new(js, "op_type",
270  json_integer(data->op_type));
271  json_object_set_new(js, "qu",
272  json_integer(data->qu));
273  json_object_set_new(js, "cr",
274  json_integer(data->cr));
275  json_object_set_new(js, "tcc",
276  json_integer(data->tcc));
277  json_object_set_new(js, "count",
278  json_integer(data->count));
279  json_object_set_new(js, "ontime",
280  json_integer(data->ontime));
281  json_object_set_new(js, "offtime",
282  json_integer(data->offtime));
283  json_object_set_new(js, "status_code",
284  json_integer(data->status_code));
285  json_object_set_new(js, "reserved",
286  json_integer(data->reserved));
287  break;
288  }
289  case DNP3_OBJECT_CODE(12, 2): {
290  DNP3ObjectG12V2 *data = point->data;
291  json_object_set_new(js, "op_type",
292  json_integer(data->op_type));
293  json_object_set_new(js, "qu",
294  json_integer(data->qu));
295  json_object_set_new(js, "cr",
296  json_integer(data->cr));
297  json_object_set_new(js, "tcc",
298  json_integer(data->tcc));
299  json_object_set_new(js, "count",
300  json_integer(data->count));
301  json_object_set_new(js, "ontime",
302  json_integer(data->ontime));
303  json_object_set_new(js, "offtime",
304  json_integer(data->offtime));
305  json_object_set_new(js, "status_code",
306  json_integer(data->status_code));
307  json_object_set_new(js, "reserved",
308  json_integer(data->reserved));
309  break;
310  }
311  case DNP3_OBJECT_CODE(12, 3): {
312  DNP3ObjectG12V3 *data = point->data;
313  json_object_set_new(js, "point",
314  json_integer(data->point));
315  break;
316  }
317  case DNP3_OBJECT_CODE(13, 1): {
318  DNP3ObjectG13V1 *data = point->data;
319  json_object_set_new(js, "status_code",
320  json_integer(data->status_code));
321  json_object_set_new(js, "commanded_state",
322  json_integer(data->commanded_state));
323  break;
324  }
325  case DNP3_OBJECT_CODE(13, 2): {
326  DNP3ObjectG13V2 *data = point->data;
327  json_object_set_new(js, "status_code",
328  json_integer(data->status_code));
329  json_object_set_new(js, "commanded_state",
330  json_integer(data->commanded_state));
331  json_object_set_new(js, "timestamp",
332  json_integer(data->timestamp));
333  break;
334  }
335  case DNP3_OBJECT_CODE(20, 1): {
336  DNP3ObjectG20V1 *data = point->data;
337  json_object_set_new(js, "online",
338  json_integer(data->online));
339  json_object_set_new(js, "restart",
340  json_integer(data->restart));
341  json_object_set_new(js, "comm_lost",
342  json_integer(data->comm_lost));
343  json_object_set_new(js, "remote_forced",
344  json_integer(data->remote_forced));
345  json_object_set_new(js, "local_forced",
346  json_integer(data->local_forced));
347  json_object_set_new(js, "rollover",
348  json_integer(data->rollover));
349  json_object_set_new(js, "discontinuity",
350  json_integer(data->discontinuity));
351  json_object_set_new(js, "reserved0",
352  json_integer(data->reserved0));
353  json_object_set_new(js, "count",
354  json_integer(data->count));
355  break;
356  }
357  case DNP3_OBJECT_CODE(20, 2): {
358  DNP3ObjectG20V2 *data = point->data;
359  json_object_set_new(js, "online",
360  json_integer(data->online));
361  json_object_set_new(js, "restart",
362  json_integer(data->restart));
363  json_object_set_new(js, "comm_lost",
364  json_integer(data->comm_lost));
365  json_object_set_new(js, "remote_forced",
366  json_integer(data->remote_forced));
367  json_object_set_new(js, "local_forced",
368  json_integer(data->local_forced));
369  json_object_set_new(js, "rollover",
370  json_integer(data->rollover));
371  json_object_set_new(js, "discontinuity",
372  json_integer(data->discontinuity));
373  json_object_set_new(js, "reserved0",
374  json_integer(data->reserved0));
375  json_object_set_new(js, "count",
376  json_integer(data->count));
377  break;
378  }
379  case DNP3_OBJECT_CODE(20, 3): {
380  DNP3ObjectG20V3 *data = point->data;
381  json_object_set_new(js, "online",
382  json_integer(data->online));
383  json_object_set_new(js, "restart",
384  json_integer(data->restart));
385  json_object_set_new(js, "comm_lost",
386  json_integer(data->comm_lost));
387  json_object_set_new(js, "remote_forced",
388  json_integer(data->remote_forced));
389  json_object_set_new(js, "local_forced",
390  json_integer(data->local_forced));
391  json_object_set_new(js, "rollover",
392  json_integer(data->rollover));
393  json_object_set_new(js, "reserved0",
394  json_integer(data->reserved0));
395  json_object_set_new(js, "reserved1",
396  json_integer(data->reserved1));
397  json_object_set_new(js, "count",
398  json_integer(data->count));
399  break;
400  }
401  case DNP3_OBJECT_CODE(20, 4): {
402  DNP3ObjectG20V4 *data = point->data;
403  json_object_set_new(js, "online",
404  json_integer(data->online));
405  json_object_set_new(js, "restart",
406  json_integer(data->restart));
407  json_object_set_new(js, "comm_lost",
408  json_integer(data->comm_lost));
409  json_object_set_new(js, "remote_forced",
410  json_integer(data->remote_forced));
411  json_object_set_new(js, "local_forced",
412  json_integer(data->local_forced));
413  json_object_set_new(js, "rollover",
414  json_integer(data->rollover));
415  json_object_set_new(js, "reserved0",
416  json_integer(data->reserved0));
417  json_object_set_new(js, "reserved1",
418  json_integer(data->reserved1));
419  json_object_set_new(js, "count",
420  json_integer(data->count));
421  break;
422  }
423  case DNP3_OBJECT_CODE(20, 5): {
424  DNP3ObjectG20V5 *data = point->data;
425  json_object_set_new(js, "count",
426  json_integer(data->count));
427  break;
428  }
429  case DNP3_OBJECT_CODE(20, 6): {
430  DNP3ObjectG20V6 *data = point->data;
431  json_object_set_new(js, "count",
432  json_integer(data->count));
433  break;
434  }
435  case DNP3_OBJECT_CODE(20, 7): {
436  DNP3ObjectG20V7 *data = point->data;
437  json_object_set_new(js, "count",
438  json_integer(data->count));
439  break;
440  }
441  case DNP3_OBJECT_CODE(20, 8): {
442  DNP3ObjectG20V8 *data = point->data;
443  json_object_set_new(js, "count",
444  json_integer(data->count));
445  break;
446  }
447  case DNP3_OBJECT_CODE(21, 1): {
448  DNP3ObjectG21V1 *data = point->data;
449  json_object_set_new(js, "online",
450  json_integer(data->online));
451  json_object_set_new(js, "restart",
452  json_integer(data->restart));
453  json_object_set_new(js, "comm_lost",
454  json_integer(data->comm_lost));
455  json_object_set_new(js, "remote_forced",
456  json_integer(data->remote_forced));
457  json_object_set_new(js, "local_forced",
458  json_integer(data->local_forced));
459  json_object_set_new(js, "rollover",
460  json_integer(data->rollover));
461  json_object_set_new(js, "discontinuity",
462  json_integer(data->discontinuity));
463  json_object_set_new(js, "reserved0",
464  json_integer(data->reserved0));
465  json_object_set_new(js, "count",
466  json_integer(data->count));
467  break;
468  }
469  case DNP3_OBJECT_CODE(21, 2): {
470  DNP3ObjectG21V2 *data = point->data;
471  json_object_set_new(js, "online",
472  json_integer(data->online));
473  json_object_set_new(js, "restart",
474  json_integer(data->restart));
475  json_object_set_new(js, "comm_lost",
476  json_integer(data->comm_lost));
477  json_object_set_new(js, "remote_forced",
478  json_integer(data->remote_forced));
479  json_object_set_new(js, "local_forced",
480  json_integer(data->local_forced));
481  json_object_set_new(js, "rollover",
482  json_integer(data->rollover));
483  json_object_set_new(js, "discontinuity",
484  json_integer(data->discontinuity));
485  json_object_set_new(js, "reserved0",
486  json_integer(data->reserved0));
487  json_object_set_new(js, "count",
488  json_integer(data->count));
489  break;
490  }
491  case DNP3_OBJECT_CODE(21, 3): {
492  DNP3ObjectG21V3 *data = point->data;
493  json_object_set_new(js, "online",
494  json_integer(data->online));
495  json_object_set_new(js, "restart",
496  json_integer(data->restart));
497  json_object_set_new(js, "comm_lost",
498  json_integer(data->comm_lost));
499  json_object_set_new(js, "remote_forced",
500  json_integer(data->remote_forced));
501  json_object_set_new(js, "local_forced",
502  json_integer(data->local_forced));
503  json_object_set_new(js, "rollover",
504  json_integer(data->rollover));
505  json_object_set_new(js, "reserved0",
506  json_integer(data->reserved0));
507  json_object_set_new(js, "reserved1",
508  json_integer(data->reserved1));
509  json_object_set_new(js, "count",
510  json_integer(data->count));
511  break;
512  }
513  case DNP3_OBJECT_CODE(21, 4): {
514  DNP3ObjectG21V4 *data = point->data;
515  json_object_set_new(js, "online",
516  json_integer(data->online));
517  json_object_set_new(js, "restart",
518  json_integer(data->restart));
519  json_object_set_new(js, "comm_lost",
520  json_integer(data->comm_lost));
521  json_object_set_new(js, "remote_forced",
522  json_integer(data->remote_forced));
523  json_object_set_new(js, "local_forced",
524  json_integer(data->local_forced));
525  json_object_set_new(js, "rollover",
526  json_integer(data->rollover));
527  json_object_set_new(js, "reserved0",
528  json_integer(data->reserved0));
529  json_object_set_new(js, "reserved1",
530  json_integer(data->reserved1));
531  json_object_set_new(js, "count",
532  json_integer(data->count));
533  break;
534  }
535  case DNP3_OBJECT_CODE(21, 5): {
536  DNP3ObjectG21V5 *data = point->data;
537  json_object_set_new(js, "online",
538  json_integer(data->online));
539  json_object_set_new(js, "restart",
540  json_integer(data->restart));
541  json_object_set_new(js, "comm_lost",
542  json_integer(data->comm_lost));
543  json_object_set_new(js, "remote_forced",
544  json_integer(data->remote_forced));
545  json_object_set_new(js, "local_forced",
546  json_integer(data->local_forced));
547  json_object_set_new(js, "rollover",
548  json_integer(data->rollover));
549  json_object_set_new(js, "discontinuity",
550  json_integer(data->discontinuity));
551  json_object_set_new(js, "reserved1",
552  json_integer(data->reserved1));
553  json_object_set_new(js, "count",
554  json_integer(data->count));
555  json_object_set_new(js, "timestamp",
556  json_integer(data->timestamp));
557  break;
558  }
559  case DNP3_OBJECT_CODE(21, 6): {
560  DNP3ObjectG21V6 *data = point->data;
561  json_object_set_new(js, "online",
562  json_integer(data->online));
563  json_object_set_new(js, "restart",
564  json_integer(data->restart));
565  json_object_set_new(js, "comm_lost",
566  json_integer(data->comm_lost));
567  json_object_set_new(js, "remote_forced",
568  json_integer(data->remote_forced));
569  json_object_set_new(js, "local_forced",
570  json_integer(data->local_forced));
571  json_object_set_new(js, "rollover",
572  json_integer(data->rollover));
573  json_object_set_new(js, "discontinuity",
574  json_integer(data->discontinuity));
575  json_object_set_new(js, "reserved1",
576  json_integer(data->reserved1));
577  json_object_set_new(js, "count",
578  json_integer(data->count));
579  json_object_set_new(js, "timestamp",
580  json_integer(data->timestamp));
581  break;
582  }
583  case DNP3_OBJECT_CODE(21, 7): {
584  DNP3ObjectG21V7 *data = point->data;
585  json_object_set_new(js, "online",
586  json_integer(data->online));
587  json_object_set_new(js, "restart",
588  json_integer(data->restart));
589  json_object_set_new(js, "comm_lost",
590  json_integer(data->comm_lost));
591  json_object_set_new(js, "remote_forced",
592  json_integer(data->remote_forced));
593  json_object_set_new(js, "local_forced",
594  json_integer(data->local_forced));
595  json_object_set_new(js, "rollover",
596  json_integer(data->rollover));
597  json_object_set_new(js, "reserved0",
598  json_integer(data->reserved0));
599  json_object_set_new(js, "reserved1",
600  json_integer(data->reserved1));
601  json_object_set_new(js, "count",
602  json_integer(data->count));
603  json_object_set_new(js, "timestamp",
604  json_integer(data->timestamp));
605  break;
606  }
607  case DNP3_OBJECT_CODE(21, 8): {
608  DNP3ObjectG21V8 *data = point->data;
609  json_object_set_new(js, "online",
610  json_integer(data->online));
611  json_object_set_new(js, "restart",
612  json_integer(data->restart));
613  json_object_set_new(js, "comm_lost",
614  json_integer(data->comm_lost));
615  json_object_set_new(js, "remote_forced",
616  json_integer(data->remote_forced));
617  json_object_set_new(js, "local_forced",
618  json_integer(data->local_forced));
619  json_object_set_new(js, "rollover",
620  json_integer(data->rollover));
621  json_object_set_new(js, "reserved0",
622  json_integer(data->reserved0));
623  json_object_set_new(js, "reserved1",
624  json_integer(data->reserved1));
625  json_object_set_new(js, "count",
626  json_integer(data->count));
627  json_object_set_new(js, "timestamp",
628  json_integer(data->timestamp));
629  break;
630  }
631  case DNP3_OBJECT_CODE(21, 9): {
632  DNP3ObjectG21V9 *data = point->data;
633  json_object_set_new(js, "count",
634  json_integer(data->count));
635  break;
636  }
637  case DNP3_OBJECT_CODE(21, 10): {
638  DNP3ObjectG21V10 *data = point->data;
639  json_object_set_new(js, "count",
640  json_integer(data->count));
641  break;
642  }
643  case DNP3_OBJECT_CODE(21, 11): {
644  DNP3ObjectG21V11 *data = point->data;
645  json_object_set_new(js, "count",
646  json_integer(data->count));
647  break;
648  }
649  case DNP3_OBJECT_CODE(21, 12): {
650  DNP3ObjectG21V12 *data = point->data;
651  json_object_set_new(js, "count",
652  json_integer(data->count));
653  break;
654  }
655  case DNP3_OBJECT_CODE(22, 1): {
656  DNP3ObjectG22V1 *data = point->data;
657  json_object_set_new(js, "online",
658  json_integer(data->online));
659  json_object_set_new(js, "restart",
660  json_integer(data->restart));
661  json_object_set_new(js, "comm_lost",
662  json_integer(data->comm_lost));
663  json_object_set_new(js, "remote_forced",
664  json_integer(data->remote_forced));
665  json_object_set_new(js, "local_forced",
666  json_integer(data->local_forced));
667  json_object_set_new(js, "rollover",
668  json_integer(data->rollover));
669  json_object_set_new(js, "discontinuity",
670  json_integer(data->discontinuity));
671  json_object_set_new(js, "reserved0",
672  json_integer(data->reserved0));
673  json_object_set_new(js, "count",
674  json_integer(data->count));
675  break;
676  }
677  case DNP3_OBJECT_CODE(22, 2): {
678  DNP3ObjectG22V2 *data = point->data;
679  json_object_set_new(js, "online",
680  json_integer(data->online));
681  json_object_set_new(js, "restart",
682  json_integer(data->restart));
683  json_object_set_new(js, "comm_lost",
684  json_integer(data->comm_lost));
685  json_object_set_new(js, "remote_forced",
686  json_integer(data->remote_forced));
687  json_object_set_new(js, "local_forced",
688  json_integer(data->local_forced));
689  json_object_set_new(js, "rollover",
690  json_integer(data->rollover));
691  json_object_set_new(js, "discontinuity",
692  json_integer(data->discontinuity));
693  json_object_set_new(js, "reserved0",
694  json_integer(data->reserved0));
695  json_object_set_new(js, "count",
696  json_integer(data->count));
697  break;
698  }
699  case DNP3_OBJECT_CODE(22, 3): {
700  DNP3ObjectG22V3 *data = point->data;
701  json_object_set_new(js, "online",
702  json_integer(data->online));
703  json_object_set_new(js, "restart",
704  json_integer(data->restart));
705  json_object_set_new(js, "comm_lost",
706  json_integer(data->comm_lost));
707  json_object_set_new(js, "remote_forced",
708  json_integer(data->remote_forced));
709  json_object_set_new(js, "local_forced",
710  json_integer(data->local_forced));
711  json_object_set_new(js, "rollover",
712  json_integer(data->rollover));
713  json_object_set_new(js, "reserved0",
714  json_integer(data->reserved0));
715  json_object_set_new(js, "reserved1",
716  json_integer(data->reserved1));
717  json_object_set_new(js, "count",
718  json_integer(data->count));
719  break;
720  }
721  case DNP3_OBJECT_CODE(22, 4): {
722  DNP3ObjectG22V4 *data = point->data;
723  json_object_set_new(js, "online",
724  json_integer(data->online));
725  json_object_set_new(js, "restart",
726  json_integer(data->restart));
727  json_object_set_new(js, "comm_lost",
728  json_integer(data->comm_lost));
729  json_object_set_new(js, "remote_forced",
730  json_integer(data->remote_forced));
731  json_object_set_new(js, "local_forced",
732  json_integer(data->local_forced));
733  json_object_set_new(js, "rollover",
734  json_integer(data->rollover));
735  json_object_set_new(js, "reserved0",
736  json_integer(data->reserved0));
737  json_object_set_new(js, "reserved1",
738  json_integer(data->reserved1));
739  json_object_set_new(js, "count",
740  json_integer(data->count));
741  break;
742  }
743  case DNP3_OBJECT_CODE(22, 5): {
744  DNP3ObjectG22V5 *data = point->data;
745  json_object_set_new(js, "online",
746  json_integer(data->online));
747  json_object_set_new(js, "restart",
748  json_integer(data->restart));
749  json_object_set_new(js, "comm_lost",
750  json_integer(data->comm_lost));
751  json_object_set_new(js, "remote_forced",
752  json_integer(data->remote_forced));
753  json_object_set_new(js, "local_forced",
754  json_integer(data->local_forced));
755  json_object_set_new(js, "rollover",
756  json_integer(data->rollover));
757  json_object_set_new(js, "reserved0",
758  json_integer(data->reserved0));
759  json_object_set_new(js, "reserved1",
760  json_integer(data->reserved1));
761  json_object_set_new(js, "count",
762  json_integer(data->count));
763  json_object_set_new(js, "timestamp",
764  json_integer(data->timestamp));
765  break;
766  }
767  case DNP3_OBJECT_CODE(22, 6): {
768  DNP3ObjectG22V6 *data = point->data;
769  json_object_set_new(js, "online",
770  json_integer(data->online));
771  json_object_set_new(js, "restart",
772  json_integer(data->restart));
773  json_object_set_new(js, "comm_lost",
774  json_integer(data->comm_lost));
775  json_object_set_new(js, "remote_forced",
776  json_integer(data->remote_forced));
777  json_object_set_new(js, "local_forced",
778  json_integer(data->local_forced));
779  json_object_set_new(js, "rollover",
780  json_integer(data->rollover));
781  json_object_set_new(js, "discontinuity",
782  json_integer(data->discontinuity));
783  json_object_set_new(js, "reserved0",
784  json_integer(data->reserved0));
785  json_object_set_new(js, "count",
786  json_integer(data->count));
787  json_object_set_new(js, "timestamp",
788  json_integer(data->timestamp));
789  break;
790  }
791  case DNP3_OBJECT_CODE(22, 7): {
792  DNP3ObjectG22V7 *data = point->data;
793  json_object_set_new(js, "online",
794  json_integer(data->online));
795  json_object_set_new(js, "restart",
796  json_integer(data->restart));
797  json_object_set_new(js, "comm_lost",
798  json_integer(data->comm_lost));
799  json_object_set_new(js, "remote_forced",
800  json_integer(data->remote_forced));
801  json_object_set_new(js, "local_forced",
802  json_integer(data->local_forced));
803  json_object_set_new(js, "rollover",
804  json_integer(data->rollover));
805  json_object_set_new(js, "reserved0",
806  json_integer(data->reserved0));
807  json_object_set_new(js, "reserved1",
808  json_integer(data->reserved1));
809  json_object_set_new(js, "count",
810  json_integer(data->count));
811  json_object_set_new(js, "timestamp",
812  json_integer(data->timestamp));
813  break;
814  }
815  case DNP3_OBJECT_CODE(22, 8): {
816  DNP3ObjectG22V8 *data = point->data;
817  json_object_set_new(js, "online",
818  json_integer(data->online));
819  json_object_set_new(js, "restart",
820  json_integer(data->restart));
821  json_object_set_new(js, "comm_lost",
822  json_integer(data->comm_lost));
823  json_object_set_new(js, "remote_forced",
824  json_integer(data->remote_forced));
825  json_object_set_new(js, "local_forced",
826  json_integer(data->local_forced));
827  json_object_set_new(js, "rollover",
828  json_integer(data->rollover));
829  json_object_set_new(js, "reserved0",
830  json_integer(data->reserved0));
831  json_object_set_new(js, "reserved1",
832  json_integer(data->reserved1));
833  json_object_set_new(js, "count",
834  json_integer(data->count));
835  json_object_set_new(js, "timestamp",
836  json_integer(data->timestamp));
837  break;
838  }
839  case DNP3_OBJECT_CODE(23, 1): {
840  DNP3ObjectG23V1 *data = point->data;
841  json_object_set_new(js, "online",
842  json_integer(data->online));
843  json_object_set_new(js, "restart",
844  json_integer(data->restart));
845  json_object_set_new(js, "comm_lost",
846  json_integer(data->comm_lost));
847  json_object_set_new(js, "remote_forced",
848  json_integer(data->remote_forced));
849  json_object_set_new(js, "local_forced",
850  json_integer(data->local_forced));
851  json_object_set_new(js, "rollover",
852  json_integer(data->rollover));
853  json_object_set_new(js, "discontinuity",
854  json_integer(data->discontinuity));
855  json_object_set_new(js, "reserved0",
856  json_integer(data->reserved0));
857  json_object_set_new(js, "count",
858  json_integer(data->count));
859  break;
860  }
861  case DNP3_OBJECT_CODE(23, 2): {
862  DNP3ObjectG23V2 *data = point->data;
863  json_object_set_new(js, "online",
864  json_integer(data->online));
865  json_object_set_new(js, "restart",
866  json_integer(data->restart));
867  json_object_set_new(js, "comm_lost",
868  json_integer(data->comm_lost));
869  json_object_set_new(js, "remote_forced",
870  json_integer(data->remote_forced));
871  json_object_set_new(js, "local_forced",
872  json_integer(data->local_forced));
873  json_object_set_new(js, "rollover",
874  json_integer(data->rollover));
875  json_object_set_new(js, "reserved0",
876  json_integer(data->reserved0));
877  json_object_set_new(js, "reserved1",
878  json_integer(data->reserved1));
879  json_object_set_new(js, "count",
880  json_integer(data->count));
881  break;
882  }
883  case DNP3_OBJECT_CODE(23, 3): {
884  DNP3ObjectG23V3 *data = point->data;
885  json_object_set_new(js, "online",
886  json_integer(data->online));
887  json_object_set_new(js, "restart",
888  json_integer(data->restart));
889  json_object_set_new(js, "comm_lost",
890  json_integer(data->comm_lost));
891  json_object_set_new(js, "remote_forced",
892  json_integer(data->remote_forced));
893  json_object_set_new(js, "local_forced",
894  json_integer(data->local_forced));
895  json_object_set_new(js, "rollover",
896  json_integer(data->rollover));
897  json_object_set_new(js, "reserved0",
898  json_integer(data->reserved0));
899  json_object_set_new(js, "reserved1",
900  json_integer(data->reserved1));
901  json_object_set_new(js, "count",
902  json_integer(data->count));
903  break;
904  }
905  case DNP3_OBJECT_CODE(23, 4): {
906  DNP3ObjectG23V4 *data = point->data;
907  json_object_set_new(js, "online",
908  json_integer(data->online));
909  json_object_set_new(js, "restart",
910  json_integer(data->restart));
911  json_object_set_new(js, "comm_lost",
912  json_integer(data->comm_lost));
913  json_object_set_new(js, "remote_forced",
914  json_integer(data->remote_forced));
915  json_object_set_new(js, "local_forced",
916  json_integer(data->local_forced));
917  json_object_set_new(js, "rollover",
918  json_integer(data->rollover));
919  json_object_set_new(js, "reserved0",
920  json_integer(data->reserved0));
921  json_object_set_new(js, "reserved1",
922  json_integer(data->reserved1));
923  json_object_set_new(js, "count",
924  json_integer(data->count));
925  break;
926  }
927  case DNP3_OBJECT_CODE(23, 5): {
928  DNP3ObjectG23V5 *data = point->data;
929  json_object_set_new(js, "online",
930  json_integer(data->online));
931  json_object_set_new(js, "restart",
932  json_integer(data->restart));
933  json_object_set_new(js, "comm_lost",
934  json_integer(data->comm_lost));
935  json_object_set_new(js, "remote_forced",
936  json_integer(data->remote_forced));
937  json_object_set_new(js, "local_forced",
938  json_integer(data->local_forced));
939  json_object_set_new(js, "rollover",
940  json_integer(data->rollover));
941  json_object_set_new(js, "discontinuity",
942  json_integer(data->discontinuity));
943  json_object_set_new(js, "reserved0",
944  json_integer(data->reserved0));
945  json_object_set_new(js, "count",
946  json_integer(data->count));
947  json_object_set_new(js, "timestamp",
948  json_integer(data->timestamp));
949  break;
950  }
951  case DNP3_OBJECT_CODE(23, 6): {
952  DNP3ObjectG23V6 *data = point->data;
953  json_object_set_new(js, "online",
954  json_integer(data->online));
955  json_object_set_new(js, "restart",
956  json_integer(data->restart));
957  json_object_set_new(js, "comm_lost",
958  json_integer(data->comm_lost));
959  json_object_set_new(js, "remote_forced",
960  json_integer(data->remote_forced));
961  json_object_set_new(js, "local_forced",
962  json_integer(data->local_forced));
963  json_object_set_new(js, "rollover",
964  json_integer(data->rollover));
965  json_object_set_new(js, "discontinuity",
966  json_integer(data->discontinuity));
967  json_object_set_new(js, "reserved0",
968  json_integer(data->reserved0));
969  json_object_set_new(js, "count",
970  json_integer(data->count));
971  json_object_set_new(js, "timestamp",
972  json_integer(data->timestamp));
973  break;
974  }
975  case DNP3_OBJECT_CODE(23, 7): {
976  DNP3ObjectG23V7 *data = point->data;
977  json_object_set_new(js, "online",
978  json_integer(data->online));
979  json_object_set_new(js, "restart",
980  json_integer(data->restart));
981  json_object_set_new(js, "comm_lost",
982  json_integer(data->comm_lost));
983  json_object_set_new(js, "remote_forced",
984  json_integer(data->remote_forced));
985  json_object_set_new(js, "local_forced",
986  json_integer(data->local_forced));
987  json_object_set_new(js, "rollover",
988  json_integer(data->rollover));
989  json_object_set_new(js, "reserved0",
990  json_integer(data->reserved0));
991  json_object_set_new(js, "reserved1",
992  json_integer(data->reserved1));
993  json_object_set_new(js, "count",
994  json_integer(data->count));
995  json_object_set_new(js, "timestamp",
996  json_integer(data->timestamp));
997  break;
998  }
999  case DNP3_OBJECT_CODE(23, 8): {
1000  DNP3ObjectG23V8 *data = point->data;
1001  json_object_set_new(js, "online",
1002  json_integer(data->online));
1003  json_object_set_new(js, "restart",
1004  json_integer(data->restart));
1005  json_object_set_new(js, "comm_lost",
1006  json_integer(data->comm_lost));
1007  json_object_set_new(js, "remote_forced",
1008  json_integer(data->remote_forced));
1009  json_object_set_new(js, "local_forced",
1010  json_integer(data->local_forced));
1011  json_object_set_new(js, "rollover",
1012  json_integer(data->rollover));
1013  json_object_set_new(js, "reserved0",
1014  json_integer(data->reserved0));
1015  json_object_set_new(js, "reserved1",
1016  json_integer(data->reserved1));
1017  json_object_set_new(js, "count",
1018  json_integer(data->count));
1019  json_object_set_new(js, "timestamp",
1020  json_integer(data->timestamp));
1021  break;
1022  }
1023  case DNP3_OBJECT_CODE(30, 1): {
1024  DNP3ObjectG30V1 *data = point->data;
1025  json_object_set_new(js, "online",
1026  json_integer(data->online));
1027  json_object_set_new(js, "restart",
1028  json_integer(data->restart));
1029  json_object_set_new(js, "comm_lost",
1030  json_integer(data->comm_lost));
1031  json_object_set_new(js, "remote_forced",
1032  json_integer(data->remote_forced));
1033  json_object_set_new(js, "local_forced",
1034  json_integer(data->local_forced));
1035  json_object_set_new(js, "over_range",
1036  json_integer(data->over_range));
1037  json_object_set_new(js, "reference_err",
1038  json_integer(data->reference_err));
1039  json_object_set_new(js, "reserved0",
1040  json_integer(data->reserved0));
1041  json_object_set_new(js, "value",
1042  json_integer(data->value));
1043  break;
1044  }
1045  case DNP3_OBJECT_CODE(30, 2): {
1046  DNP3ObjectG30V2 *data = point->data;
1047  json_object_set_new(js, "online",
1048  json_integer(data->online));
1049  json_object_set_new(js, "restart",
1050  json_integer(data->restart));
1051  json_object_set_new(js, "comm_lost",
1052  json_integer(data->comm_lost));
1053  json_object_set_new(js, "remote_forced",
1054  json_integer(data->remote_forced));
1055  json_object_set_new(js, "local_forced",
1056  json_integer(data->local_forced));
1057  json_object_set_new(js, "over_range",
1058  json_integer(data->over_range));
1059  json_object_set_new(js, "reference_err",
1060  json_integer(data->reference_err));
1061  json_object_set_new(js, "reserved0",
1062  json_integer(data->reserved0));
1063  json_object_set_new(js, "value",
1064  json_integer(data->value));
1065  break;
1066  }
1067  case DNP3_OBJECT_CODE(30, 3): {
1068  DNP3ObjectG30V3 *data = point->data;
1069  json_object_set_new(js, "value",
1070  json_integer(data->value));
1071  break;
1072  }
1073  case DNP3_OBJECT_CODE(30, 4): {
1074  DNP3ObjectG30V4 *data = point->data;
1075  json_object_set_new(js, "value",
1076  json_integer(data->value));
1077  break;
1078  }
1079  case DNP3_OBJECT_CODE(30, 5): {
1080  DNP3ObjectG30V5 *data = point->data;
1081  json_object_set_new(js, "online",
1082  json_integer(data->online));
1083  json_object_set_new(js, "restart",
1084  json_integer(data->restart));
1085  json_object_set_new(js, "comm_lost",
1086  json_integer(data->comm_lost));
1087  json_object_set_new(js, "remote_forced",
1088  json_integer(data->remote_forced));
1089  json_object_set_new(js, "local_forced",
1090  json_integer(data->local_forced));
1091  json_object_set_new(js, "over_range",
1092  json_integer(data->over_range));
1093  json_object_set_new(js, "reference_err",
1094  json_integer(data->reference_err));
1095  json_object_set_new(js, "reserved0",
1096  json_integer(data->reserved0));
1097  json_object_set_new(js, "value",
1098  json_real(data->value));
1099  break;
1100  }
1101  case DNP3_OBJECT_CODE(30, 6): {
1102  DNP3ObjectG30V6 *data = point->data;
1103  json_object_set_new(js, "online",
1104  json_integer(data->online));
1105  json_object_set_new(js, "restart",
1106  json_integer(data->restart));
1107  json_object_set_new(js, "comm_lost",
1108  json_integer(data->comm_lost));
1109  json_object_set_new(js, "remote_forced",
1110  json_integer(data->remote_forced));
1111  json_object_set_new(js, "local_forced",
1112  json_integer(data->local_forced));
1113  json_object_set_new(js, "over_range",
1114  json_integer(data->over_range));
1115  json_object_set_new(js, "reference_err",
1116  json_integer(data->reference_err));
1117  json_object_set_new(js, "reserved0",
1118  json_integer(data->reserved0));
1119  json_object_set_new(js, "value",
1120  json_real(data->value));
1121  break;
1122  }
1123  case DNP3_OBJECT_CODE(31, 1): {
1124  DNP3ObjectG31V1 *data = point->data;
1125  json_object_set_new(js, "online",
1126  json_integer(data->online));
1127  json_object_set_new(js, "restart",
1128  json_integer(data->restart));
1129  json_object_set_new(js, "comm_lost",
1130  json_integer(data->comm_lost));
1131  json_object_set_new(js, "remote_forced",
1132  json_integer(data->remote_forced));
1133  json_object_set_new(js, "local_forced",
1134  json_integer(data->local_forced));
1135  json_object_set_new(js, "over_range",
1136  json_integer(data->over_range));
1137  json_object_set_new(js, "reference_err",
1138  json_integer(data->reference_err));
1139  json_object_set_new(js, "reserved0",
1140  json_integer(data->reserved0));
1141  json_object_set_new(js, "value",
1142  json_integer(data->value));
1143  break;
1144  }
1145  case DNP3_OBJECT_CODE(31, 2): {
1146  DNP3ObjectG31V2 *data = point->data;
1147  json_object_set_new(js, "online",
1148  json_integer(data->online));
1149  json_object_set_new(js, "restart",
1150  json_integer(data->restart));
1151  json_object_set_new(js, "comm_lost",
1152  json_integer(data->comm_lost));
1153  json_object_set_new(js, "remote_forced",
1154  json_integer(data->remote_forced));
1155  json_object_set_new(js, "local_forced",
1156  json_integer(data->local_forced));
1157  json_object_set_new(js, "over_range",
1158  json_integer(data->over_range));
1159  json_object_set_new(js, "reference_err",
1160  json_integer(data->reference_err));
1161  json_object_set_new(js, "reserved0",
1162  json_integer(data->reserved0));
1163  json_object_set_new(js, "value",
1164  json_integer(data->value));
1165  break;
1166  }
1167  case DNP3_OBJECT_CODE(31, 3): {
1168  DNP3ObjectG31V3 *data = point->data;
1169  json_object_set_new(js, "online",
1170  json_integer(data->online));
1171  json_object_set_new(js, "restart",
1172  json_integer(data->restart));
1173  json_object_set_new(js, "comm_lost",
1174  json_integer(data->comm_lost));
1175  json_object_set_new(js, "remote_forced",
1176  json_integer(data->remote_forced));
1177  json_object_set_new(js, "local_forced",
1178  json_integer(data->local_forced));
1179  json_object_set_new(js, "over_range",
1180  json_integer(data->over_range));
1181  json_object_set_new(js, "reference_err",
1182  json_integer(data->reference_err));
1183  json_object_set_new(js, "reserved0",
1184  json_integer(data->reserved0));
1185  json_object_set_new(js, "value",
1186  json_integer(data->value));
1187  json_object_set_new(js, "timestamp",
1188  json_integer(data->timestamp));
1189  break;
1190  }
1191  case DNP3_OBJECT_CODE(31, 4): {
1192  DNP3ObjectG31V4 *data = point->data;
1193  json_object_set_new(js, "online",
1194  json_integer(data->online));
1195  json_object_set_new(js, "restart",
1196  json_integer(data->restart));
1197  json_object_set_new(js, "comm_lost",
1198  json_integer(data->comm_lost));
1199  json_object_set_new(js, "remote_forced",
1200  json_integer(data->remote_forced));
1201  json_object_set_new(js, "local_forced",
1202  json_integer(data->local_forced));
1203  json_object_set_new(js, "over_range",
1204  json_integer(data->over_range));
1205  json_object_set_new(js, "reference_err",
1206  json_integer(data->reference_err));
1207  json_object_set_new(js, "reserved0",
1208  json_integer(data->reserved0));
1209  json_object_set_new(js, "value",
1210  json_integer(data->value));
1211  json_object_set_new(js, "timestamp",
1212  json_integer(data->timestamp));
1213  break;
1214  }
1215  case DNP3_OBJECT_CODE(31, 5): {
1216  DNP3ObjectG31V5 *data = point->data;
1217  json_object_set_new(js, "value",
1218  json_integer(data->value));
1219  break;
1220  }
1221  case DNP3_OBJECT_CODE(31, 6): {
1222  DNP3ObjectG31V6 *data = point->data;
1223  json_object_set_new(js, "value",
1224  json_integer(data->value));
1225  break;
1226  }
1227  case DNP3_OBJECT_CODE(31, 7): {
1228  DNP3ObjectG31V7 *data = point->data;
1229  json_object_set_new(js, "online",
1230  json_integer(data->online));
1231  json_object_set_new(js, "restart",
1232  json_integer(data->restart));
1233  json_object_set_new(js, "comm_lost",
1234  json_integer(data->comm_lost));
1235  json_object_set_new(js, "remote_forced",
1236  json_integer(data->remote_forced));
1237  json_object_set_new(js, "local_forced",
1238  json_integer(data->local_forced));
1239  json_object_set_new(js, "over_range",
1240  json_integer(data->over_range));
1241  json_object_set_new(js, "reference_err",
1242  json_integer(data->reference_err));
1243  json_object_set_new(js, "reserved0",
1244  json_integer(data->reserved0));
1245  json_object_set_new(js, "value",
1246  json_real(data->value));
1247  break;
1248  }
1249  case DNP3_OBJECT_CODE(31, 8): {
1250  DNP3ObjectG31V8 *data = point->data;
1251  json_object_set_new(js, "online",
1252  json_integer(data->online));
1253  json_object_set_new(js, "restart",
1254  json_integer(data->restart));
1255  json_object_set_new(js, "comm_lost",
1256  json_integer(data->comm_lost));
1257  json_object_set_new(js, "remote_forced",
1258  json_integer(data->remote_forced));
1259  json_object_set_new(js, "local_forced",
1260  json_integer(data->local_forced));
1261  json_object_set_new(js, "over_range",
1262  json_integer(data->over_range));
1263  json_object_set_new(js, "reference_err",
1264  json_integer(data->reference_err));
1265  json_object_set_new(js, "reserved0",
1266  json_integer(data->reserved0));
1267  json_object_set_new(js, "value",
1268  json_real(data->value));
1269  break;
1270  }
1271  case DNP3_OBJECT_CODE(32, 1): {
1272  DNP3ObjectG32V1 *data = point->data;
1273  json_object_set_new(js, "online",
1274  json_integer(data->online));
1275  json_object_set_new(js, "restart",
1276  json_integer(data->restart));
1277  json_object_set_new(js, "comm_lost",
1278  json_integer(data->comm_lost));
1279  json_object_set_new(js, "remote_forced",
1280  json_integer(data->remote_forced));
1281  json_object_set_new(js, "local_forced",
1282  json_integer(data->local_forced));
1283  json_object_set_new(js, "over_range",
1284  json_integer(data->over_range));
1285  json_object_set_new(js, "reference_err",
1286  json_integer(data->reference_err));
1287  json_object_set_new(js, "reserved0",
1288  json_integer(data->reserved0));
1289  json_object_set_new(js, "value",
1290  json_integer(data->value));
1291  break;
1292  }
1293  case DNP3_OBJECT_CODE(32, 2): {
1294  DNP3ObjectG32V2 *data = point->data;
1295  json_object_set_new(js, "online",
1296  json_integer(data->online));
1297  json_object_set_new(js, "restart",
1298  json_integer(data->restart));
1299  json_object_set_new(js, "comm_lost",
1300  json_integer(data->comm_lost));
1301  json_object_set_new(js, "remote_forced",
1302  json_integer(data->remote_forced));
1303  json_object_set_new(js, "local_forced",
1304  json_integer(data->local_forced));
1305  json_object_set_new(js, "over_range",
1306  json_integer(data->over_range));
1307  json_object_set_new(js, "reference_err",
1308  json_integer(data->reference_err));
1309  json_object_set_new(js, "reserved0",
1310  json_integer(data->reserved0));
1311  json_object_set_new(js, "value",
1312  json_integer(data->value));
1313  break;
1314  }
1315  case DNP3_OBJECT_CODE(32, 3): {
1316  DNP3ObjectG32V3 *data = point->data;
1317  json_object_set_new(js, "online",
1318  json_integer(data->online));
1319  json_object_set_new(js, "restart",
1320  json_integer(data->restart));
1321  json_object_set_new(js, "comm_lost",
1322  json_integer(data->comm_lost));
1323  json_object_set_new(js, "remote_forced",
1324  json_integer(data->remote_forced));
1325  json_object_set_new(js, "local_forced",
1326  json_integer(data->local_forced));
1327  json_object_set_new(js, "over_range",
1328  json_integer(data->over_range));
1329  json_object_set_new(js, "reference_err",
1330  json_integer(data->reference_err));
1331  json_object_set_new(js, "reserved0",
1332  json_integer(data->reserved0));
1333  json_object_set_new(js, "value",
1334  json_integer(data->value));
1335  json_object_set_new(js, "timestamp",
1336  json_integer(data->timestamp));
1337  break;
1338  }
1339  case DNP3_OBJECT_CODE(32, 4): {
1340  DNP3ObjectG32V4 *data = point->data;
1341  json_object_set_new(js, "online",
1342  json_integer(data->online));
1343  json_object_set_new(js, "restart",
1344  json_integer(data->restart));
1345  json_object_set_new(js, "comm_lost",
1346  json_integer(data->comm_lost));
1347  json_object_set_new(js, "remote_forced",
1348  json_integer(data->remote_forced));
1349  json_object_set_new(js, "local_forced",
1350  json_integer(data->local_forced));
1351  json_object_set_new(js, "over_range",
1352  json_integer(data->over_range));
1353  json_object_set_new(js, "reference_err",
1354  json_integer(data->reference_err));
1355  json_object_set_new(js, "reserved0",
1356  json_integer(data->reserved0));
1357  json_object_set_new(js, "value",
1358  json_integer(data->value));
1359  json_object_set_new(js, "timestamp",
1360  json_integer(data->timestamp));
1361  break;
1362  }
1363  case DNP3_OBJECT_CODE(32, 5): {
1364  DNP3ObjectG32V5 *data = point->data;
1365  json_object_set_new(js, "online",
1366  json_integer(data->online));
1367  json_object_set_new(js, "restart",
1368  json_integer(data->restart));
1369  json_object_set_new(js, "comm_lost",
1370  json_integer(data->comm_lost));
1371  json_object_set_new(js, "remote_forced",
1372  json_integer(data->remote_forced));
1373  json_object_set_new(js, "local_forced",
1374  json_integer(data->local_forced));
1375  json_object_set_new(js, "over_range",
1376  json_integer(data->over_range));
1377  json_object_set_new(js, "reference_err",
1378  json_integer(data->reference_err));
1379  json_object_set_new(js, "reserved0",
1380  json_integer(data->reserved0));
1381  json_object_set_new(js, "value",
1382  json_real(data->value));
1383  break;
1384  }
1385  case DNP3_OBJECT_CODE(32, 6): {
1386  DNP3ObjectG32V6 *data = point->data;
1387  json_object_set_new(js, "online",
1388  json_integer(data->online));
1389  json_object_set_new(js, "restart",
1390  json_integer(data->restart));
1391  json_object_set_new(js, "comm_lost",
1392  json_integer(data->comm_lost));
1393  json_object_set_new(js, "remote_forced",
1394  json_integer(data->remote_forced));
1395  json_object_set_new(js, "local_forced",
1396  json_integer(data->local_forced));
1397  json_object_set_new(js, "over_range",
1398  json_integer(data->over_range));
1399  json_object_set_new(js, "reference_err",
1400  json_integer(data->reference_err));
1401  json_object_set_new(js, "reserved0",
1402  json_integer(data->reserved0));
1403  json_object_set_new(js, "value",
1404  json_real(data->value));
1405  break;
1406  }
1407  case DNP3_OBJECT_CODE(32, 7): {
1408  DNP3ObjectG32V7 *data = point->data;
1409  json_object_set_new(js, "online",
1410  json_integer(data->online));
1411  json_object_set_new(js, "restart",
1412  json_integer(data->restart));
1413  json_object_set_new(js, "comm_lost",
1414  json_integer(data->comm_lost));
1415  json_object_set_new(js, "remote_forced",
1416  json_integer(data->remote_forced));
1417  json_object_set_new(js, "local_forced",
1418  json_integer(data->local_forced));
1419  json_object_set_new(js, "over_range",
1420  json_integer(data->over_range));
1421  json_object_set_new(js, "reference_err",
1422  json_integer(data->reference_err));
1423  json_object_set_new(js, "reserved0",
1424  json_integer(data->reserved0));
1425  json_object_set_new(js, "value",
1426  json_real(data->value));
1427  json_object_set_new(js, "timestamp",
1428  json_integer(data->timestamp));
1429  break;
1430  }
1431  case DNP3_OBJECT_CODE(32, 8): {
1432  DNP3ObjectG32V8 *data = point->data;
1433  json_object_set_new(js, "online",
1434  json_integer(data->online));
1435  json_object_set_new(js, "restart",
1436  json_integer(data->restart));
1437  json_object_set_new(js, "comm_lost",
1438  json_integer(data->comm_lost));
1439  json_object_set_new(js, "remote_forced",
1440  json_integer(data->remote_forced));
1441  json_object_set_new(js, "local_forced",
1442  json_integer(data->local_forced));
1443  json_object_set_new(js, "over_range",
1444  json_integer(data->over_range));
1445  json_object_set_new(js, "reference_err",
1446  json_integer(data->reference_err));
1447  json_object_set_new(js, "reserved0",
1448  json_integer(data->reserved0));
1449  json_object_set_new(js, "value",
1450  json_real(data->value));
1451  json_object_set_new(js, "timestamp",
1452  json_integer(data->timestamp));
1453  break;
1454  }
1455  case DNP3_OBJECT_CODE(33, 1): {
1456  DNP3ObjectG33V1 *data = point->data;
1457  json_object_set_new(js, "online",
1458  json_integer(data->online));
1459  json_object_set_new(js, "restart",
1460  json_integer(data->restart));
1461  json_object_set_new(js, "comm_lost",
1462  json_integer(data->comm_lost));
1463  json_object_set_new(js, "remote_forced",
1464  json_integer(data->remote_forced));
1465  json_object_set_new(js, "local_forced",
1466  json_integer(data->local_forced));
1467  json_object_set_new(js, "over_range",
1468  json_integer(data->over_range));
1469  json_object_set_new(js, "reference_err",
1470  json_integer(data->reference_err));
1471  json_object_set_new(js, "reserved0",
1472  json_integer(data->reserved0));
1473  json_object_set_new(js, "value",
1474  json_integer(data->value));
1475  break;
1476  }
1477  case DNP3_OBJECT_CODE(33, 2): {
1478  DNP3ObjectG33V2 *data = point->data;
1479  json_object_set_new(js, "online",
1480  json_integer(data->online));
1481  json_object_set_new(js, "restart",
1482  json_integer(data->restart));
1483  json_object_set_new(js, "comm_lost",
1484  json_integer(data->comm_lost));
1485  json_object_set_new(js, "remote_forced",
1486  json_integer(data->remote_forced));
1487  json_object_set_new(js, "local_forced",
1488  json_integer(data->local_forced));
1489  json_object_set_new(js, "over_range",
1490  json_integer(data->over_range));
1491  json_object_set_new(js, "reference_err",
1492  json_integer(data->reference_err));
1493  json_object_set_new(js, "reserved0",
1494  json_integer(data->reserved0));
1495  json_object_set_new(js, "value",
1496  json_integer(data->value));
1497  break;
1498  }
1499  case DNP3_OBJECT_CODE(33, 3): {
1500  DNP3ObjectG33V3 *data = point->data;
1501  json_object_set_new(js, "online",
1502  json_integer(data->online));
1503  json_object_set_new(js, "restart",
1504  json_integer(data->restart));
1505  json_object_set_new(js, "comm_lost",
1506  json_integer(data->comm_lost));
1507  json_object_set_new(js, "remote_forced",
1508  json_integer(data->remote_forced));
1509  json_object_set_new(js, "local_forced",
1510  json_integer(data->local_forced));
1511  json_object_set_new(js, "over_range",
1512  json_integer(data->over_range));
1513  json_object_set_new(js, "reference_err",
1514  json_integer(data->reference_err));
1515  json_object_set_new(js, "reserved0",
1516  json_integer(data->reserved0));
1517  json_object_set_new(js, "value",
1518  json_integer(data->value));
1519  json_object_set_new(js, "timestamp",
1520  json_integer(data->timestamp));
1521  break;
1522  }
1523  case DNP3_OBJECT_CODE(33, 4): {
1524  DNP3ObjectG33V4 *data = point->data;
1525  json_object_set_new(js, "online",
1526  json_integer(data->online));
1527  json_object_set_new(js, "restart",
1528  json_integer(data->restart));
1529  json_object_set_new(js, "comm_lost",
1530  json_integer(data->comm_lost));
1531  json_object_set_new(js, "remote_forced",
1532  json_integer(data->remote_forced));
1533  json_object_set_new(js, "local_forced",
1534  json_integer(data->local_forced));
1535  json_object_set_new(js, "over_range",
1536  json_integer(data->over_range));
1537  json_object_set_new(js, "reference_err",
1538  json_integer(data->reference_err));
1539  json_object_set_new(js, "reserved0",
1540  json_integer(data->reserved0));
1541  json_object_set_new(js, "value",
1542  json_integer(data->value));
1543  json_object_set_new(js, "timestamp",
1544  json_integer(data->timestamp));
1545  break;
1546  }
1547  case DNP3_OBJECT_CODE(33, 5): {
1548  DNP3ObjectG33V5 *data = point->data;
1549  json_object_set_new(js, "online",
1550  json_integer(data->online));
1551  json_object_set_new(js, "restart",
1552  json_integer(data->restart));
1553  json_object_set_new(js, "comm_lost",
1554  json_integer(data->comm_lost));
1555  json_object_set_new(js, "remote_forced",
1556  json_integer(data->remote_forced));
1557  json_object_set_new(js, "local_forced",
1558  json_integer(data->local_forced));
1559  json_object_set_new(js, "over_range",
1560  json_integer(data->over_range));
1561  json_object_set_new(js, "reference_err",
1562  json_integer(data->reference_err));
1563  json_object_set_new(js, "reserved0",
1564  json_integer(data->reserved0));
1565  json_object_set_new(js, "value",
1566  json_real(data->value));
1567  break;
1568  }
1569  case DNP3_OBJECT_CODE(33, 6): {
1570  DNP3ObjectG33V6 *data = point->data;
1571  json_object_set_new(js, "online",
1572  json_integer(data->online));
1573  json_object_set_new(js, "restart",
1574  json_integer(data->restart));
1575  json_object_set_new(js, "comm_lost",
1576  json_integer(data->comm_lost));
1577  json_object_set_new(js, "remote_forced",
1578  json_integer(data->remote_forced));
1579  json_object_set_new(js, "local_forced",
1580  json_integer(data->local_forced));
1581  json_object_set_new(js, "over_range",
1582  json_integer(data->over_range));
1583  json_object_set_new(js, "reference_err",
1584  json_integer(data->reference_err));
1585  json_object_set_new(js, "reserved0",
1586  json_integer(data->reserved0));
1587  json_object_set_new(js, "value",
1588  json_real(data->value));
1589  break;
1590  }
1591  case DNP3_OBJECT_CODE(33, 7): {
1592  DNP3ObjectG33V7 *data = point->data;
1593  json_object_set_new(js, "online",
1594  json_integer(data->online));
1595  json_object_set_new(js, "restart",
1596  json_integer(data->restart));
1597  json_object_set_new(js, "comm_lost",
1598  json_integer(data->comm_lost));
1599  json_object_set_new(js, "remote_forced",
1600  json_integer(data->remote_forced));
1601  json_object_set_new(js, "local_forced",
1602  json_integer(data->local_forced));
1603  json_object_set_new(js, "over_range",
1604  json_integer(data->over_range));
1605  json_object_set_new(js, "reference_err",
1606  json_integer(data->reference_err));
1607  json_object_set_new(js, "reserved0",
1608  json_integer(data->reserved0));
1609  json_object_set_new(js, "value",
1610  json_real(data->value));
1611  json_object_set_new(js, "timestamp",
1612  json_integer(data->timestamp));
1613  break;
1614  }
1615  case DNP3_OBJECT_CODE(33, 8): {
1616  DNP3ObjectG33V8 *data = point->data;
1617  json_object_set_new(js, "online",
1618  json_integer(data->online));
1619  json_object_set_new(js, "restart",
1620  json_integer(data->restart));
1621  json_object_set_new(js, "comm_lost",
1622  json_integer(data->comm_lost));
1623  json_object_set_new(js, "remote_forced",
1624  json_integer(data->remote_forced));
1625  json_object_set_new(js, "local_forced",
1626  json_integer(data->local_forced));
1627  json_object_set_new(js, "over_range",
1628  json_integer(data->over_range));
1629  json_object_set_new(js, "reference_err",
1630  json_integer(data->reference_err));
1631  json_object_set_new(js, "reserved0",
1632  json_integer(data->reserved0));
1633  json_object_set_new(js, "value",
1634  json_real(data->value));
1635  json_object_set_new(js, "timestamp",
1636  json_integer(data->timestamp));
1637  break;
1638  }
1639  case DNP3_OBJECT_CODE(34, 1): {
1640  DNP3ObjectG34V1 *data = point->data;
1641  json_object_set_new(js, "deadband_value",
1642  json_integer(data->deadband_value));
1643  break;
1644  }
1645  case DNP3_OBJECT_CODE(34, 2): {
1646  DNP3ObjectG34V2 *data = point->data;
1647  json_object_set_new(js, "deadband_value",
1648  json_integer(data->deadband_value));
1649  break;
1650  }
1651  case DNP3_OBJECT_CODE(34, 3): {
1652  DNP3ObjectG34V3 *data = point->data;
1653  json_object_set_new(js, "deadband_value",
1654  json_real(data->deadband_value));
1655  break;
1656  }
1657  case DNP3_OBJECT_CODE(40, 1): {
1658  DNP3ObjectG40V1 *data = point->data;
1659  json_object_set_new(js, "online",
1660  json_integer(data->online));
1661  json_object_set_new(js, "restart",
1662  json_integer(data->restart));
1663  json_object_set_new(js, "comm_lost",
1664  json_integer(data->comm_lost));
1665  json_object_set_new(js, "remote_forced",
1666  json_integer(data->remote_forced));
1667  json_object_set_new(js, "local_forced",
1668  json_integer(data->local_forced));
1669  json_object_set_new(js, "over_range",
1670  json_integer(data->over_range));
1671  json_object_set_new(js, "reference_err",
1672  json_integer(data->reference_err));
1673  json_object_set_new(js, "reserved0",
1674  json_integer(data->reserved0));
1675  json_object_set_new(js, "value",
1676  json_integer(data->value));
1677  break;
1678  }
1679  case DNP3_OBJECT_CODE(40, 2): {
1680  DNP3ObjectG40V2 *data = point->data;
1681  json_object_set_new(js, "online",
1682  json_integer(data->online));
1683  json_object_set_new(js, "restart",
1684  json_integer(data->restart));
1685  json_object_set_new(js, "comm_lost",
1686  json_integer(data->comm_lost));
1687  json_object_set_new(js, "remote_forced",
1688  json_integer(data->remote_forced));
1689  json_object_set_new(js, "local_forced",
1690  json_integer(data->local_forced));
1691  json_object_set_new(js, "over_range",
1692  json_integer(data->over_range));
1693  json_object_set_new(js, "reference_err",
1694  json_integer(data->reference_err));
1695  json_object_set_new(js, "reserved0",
1696  json_integer(data->reserved0));
1697  json_object_set_new(js, "value",
1698  json_integer(data->value));
1699  break;
1700  }
1701  case DNP3_OBJECT_CODE(40, 3): {
1702  DNP3ObjectG40V3 *data = point->data;
1703  json_object_set_new(js, "online",
1704  json_integer(data->online));
1705  json_object_set_new(js, "restart",
1706  json_integer(data->restart));
1707  json_object_set_new(js, "comm_lost",
1708  json_integer(data->comm_lost));
1709  json_object_set_new(js, "remote_forced",
1710  json_integer(data->remote_forced));
1711  json_object_set_new(js, "local_forced",
1712  json_integer(data->local_forced));
1713  json_object_set_new(js, "over_range",
1714  json_integer(data->over_range));
1715  json_object_set_new(js, "reference_err",
1716  json_integer(data->reference_err));
1717  json_object_set_new(js, "reserved0",
1718  json_integer(data->reserved0));
1719  json_object_set_new(js, "value",
1720  json_real(data->value));
1721  break;
1722  }
1723  case DNP3_OBJECT_CODE(40, 4): {
1724  DNP3ObjectG40V4 *data = point->data;
1725  json_object_set_new(js, "online",
1726  json_integer(data->online));
1727  json_object_set_new(js, "restart",
1728  json_integer(data->restart));
1729  json_object_set_new(js, "comm_lost",
1730  json_integer(data->comm_lost));
1731  json_object_set_new(js, "remote_forced",
1732  json_integer(data->remote_forced));
1733  json_object_set_new(js, "local_forced",
1734  json_integer(data->local_forced));
1735  json_object_set_new(js, "over_range",
1736  json_integer(data->over_range));
1737  json_object_set_new(js, "reference_err",
1738  json_integer(data->reference_err));
1739  json_object_set_new(js, "reserved0",
1740  json_integer(data->reserved0));
1741  json_object_set_new(js, "value",
1742  json_real(data->value));
1743  break;
1744  }
1745  case DNP3_OBJECT_CODE(41, 1): {
1746  DNP3ObjectG41V1 *data = point->data;
1747  json_object_set_new(js, "value",
1748  json_integer(data->value));
1749  json_object_set_new(js, "control_status",
1750  json_integer(data->control_status));
1751  break;
1752  }
1753  case DNP3_OBJECT_CODE(41, 2): {
1754  DNP3ObjectG41V2 *data = point->data;
1755  json_object_set_new(js, "value",
1756  json_integer(data->value));
1757  json_object_set_new(js, "control_status",
1758  json_integer(data->control_status));
1759  break;
1760  }
1761  case DNP3_OBJECT_CODE(41, 3): {
1762  DNP3ObjectG41V3 *data = point->data;
1763  json_object_set_new(js, "value",
1764  json_real(data->value));
1765  json_object_set_new(js, "control_status",
1766  json_integer(data->control_status));
1767  break;
1768  }
1769  case DNP3_OBJECT_CODE(41, 4): {
1770  DNP3ObjectG41V4 *data = point->data;
1771  json_object_set_new(js, "value",
1772  json_real(data->value));
1773  json_object_set_new(js, "control_status",
1774  json_integer(data->control_status));
1775  break;
1776  }
1777  case DNP3_OBJECT_CODE(42, 1): {
1778  DNP3ObjectG42V1 *data = point->data;
1779  json_object_set_new(js, "online",
1780  json_integer(data->online));
1781  json_object_set_new(js, "restart",
1782  json_integer(data->restart));
1783  json_object_set_new(js, "comm_lost",
1784  json_integer(data->comm_lost));
1785  json_object_set_new(js, "remote_forced",
1786  json_integer(data->remote_forced));
1787  json_object_set_new(js, "local_forced",
1788  json_integer(data->local_forced));
1789  json_object_set_new(js, "over_range",
1790  json_integer(data->over_range));
1791  json_object_set_new(js, "reference_err",
1792  json_integer(data->reference_err));
1793  json_object_set_new(js, "reserved0",
1794  json_integer(data->reserved0));
1795  json_object_set_new(js, "value",
1796  json_integer(data->value));
1797  break;
1798  }
1799  case DNP3_OBJECT_CODE(42, 2): {
1800  DNP3ObjectG42V2 *data = point->data;
1801  json_object_set_new(js, "online",
1802  json_integer(data->online));
1803  json_object_set_new(js, "restart",
1804  json_integer(data->restart));
1805  json_object_set_new(js, "comm_lost",
1806  json_integer(data->comm_lost));
1807  json_object_set_new(js, "remote_forced",
1808  json_integer(data->remote_forced));
1809  json_object_set_new(js, "local_forced",
1810  json_integer(data->local_forced));
1811  json_object_set_new(js, "over_range",
1812  json_integer(data->over_range));
1813  json_object_set_new(js, "reference_err",
1814  json_integer(data->reference_err));
1815  json_object_set_new(js, "reserved0",
1816  json_integer(data->reserved0));
1817  json_object_set_new(js, "value",
1818  json_integer(data->value));
1819  break;
1820  }
1821  case DNP3_OBJECT_CODE(42, 3): {
1822  DNP3ObjectG42V3 *data = point->data;
1823  json_object_set_new(js, "online",
1824  json_integer(data->online));
1825  json_object_set_new(js, "restart",
1826  json_integer(data->restart));
1827  json_object_set_new(js, "comm_lost",
1828  json_integer(data->comm_lost));
1829  json_object_set_new(js, "remote_forced",
1830  json_integer(data->remote_forced));
1831  json_object_set_new(js, "local_forced",
1832  json_integer(data->local_forced));
1833  json_object_set_new(js, "over_range",
1834  json_integer(data->over_range));
1835  json_object_set_new(js, "reference_err",
1836  json_integer(data->reference_err));
1837  json_object_set_new(js, "reserved0",
1838  json_integer(data->reserved0));
1839  json_object_set_new(js, "value",
1840  json_integer(data->value));
1841  json_object_set_new(js, "timestamp",
1842  json_integer(data->timestamp));
1843  break;
1844  }
1845  case DNP3_OBJECT_CODE(42, 4): {
1846  DNP3ObjectG42V4 *data = point->data;
1847  json_object_set_new(js, "online",
1848  json_integer(data->online));
1849  json_object_set_new(js, "restart",
1850  json_integer(data->restart));
1851  json_object_set_new(js, "comm_lost",
1852  json_integer(data->comm_lost));
1853  json_object_set_new(js, "remote_forced",
1854  json_integer(data->remote_forced));
1855  json_object_set_new(js, "local_forced",
1856  json_integer(data->local_forced));
1857  json_object_set_new(js, "over_range",
1858  json_integer(data->over_range));
1859  json_object_set_new(js, "reference_err",
1860  json_integer(data->reference_err));
1861  json_object_set_new(js, "reserved0",
1862  json_integer(data->reserved0));
1863  json_object_set_new(js, "value",
1864  json_integer(data->value));
1865  json_object_set_new(js, "timestamp",
1866  json_integer(data->timestamp));
1867  break;
1868  }
1869  case DNP3_OBJECT_CODE(42, 5): {
1870  DNP3ObjectG42V5 *data = point->data;
1871  json_object_set_new(js, "online",
1872  json_integer(data->online));
1873  json_object_set_new(js, "restart",
1874  json_integer(data->restart));
1875  json_object_set_new(js, "comm_lost",
1876  json_integer(data->comm_lost));
1877  json_object_set_new(js, "remote_forced",
1878  json_integer(data->remote_forced));
1879  json_object_set_new(js, "local_forced",
1880  json_integer(data->local_forced));
1881  json_object_set_new(js, "over_range",
1882  json_integer(data->over_range));
1883  json_object_set_new(js, "reference_err",
1884  json_integer(data->reference_err));
1885  json_object_set_new(js, "reserved0",
1886  json_integer(data->reserved0));
1887  json_object_set_new(js, "value",
1888  json_real(data->value));
1889  break;
1890  }
1891  case DNP3_OBJECT_CODE(42, 6): {
1892  DNP3ObjectG42V6 *data = point->data;
1893  json_object_set_new(js, "online",
1894  json_integer(data->online));
1895  json_object_set_new(js, "restart",
1896  json_integer(data->restart));
1897  json_object_set_new(js, "comm_lost",
1898  json_integer(data->comm_lost));
1899  json_object_set_new(js, "remote_forced",
1900  json_integer(data->remote_forced));
1901  json_object_set_new(js, "local_forced",
1902  json_integer(data->local_forced));
1903  json_object_set_new(js, "over_range",
1904  json_integer(data->over_range));
1905  json_object_set_new(js, "reference_err",
1906  json_integer(data->reference_err));
1907  json_object_set_new(js, "reserved0",
1908  json_integer(data->reserved0));
1909  json_object_set_new(js, "value",
1910  json_real(data->value));
1911  break;
1912  }
1913  case DNP3_OBJECT_CODE(42, 7): {
1914  DNP3ObjectG42V7 *data = point->data;
1915  json_object_set_new(js, "online",
1916  json_integer(data->online));
1917  json_object_set_new(js, "restart",
1918  json_integer(data->restart));
1919  json_object_set_new(js, "comm_lost",
1920  json_integer(data->comm_lost));
1921  json_object_set_new(js, "remote_forced",
1922  json_integer(data->remote_forced));
1923  json_object_set_new(js, "local_forced",
1924  json_integer(data->local_forced));
1925  json_object_set_new(js, "over_range",
1926  json_integer(data->over_range));
1927  json_object_set_new(js, "reference_err",
1928  json_integer(data->reference_err));
1929  json_object_set_new(js, "reserved0",
1930  json_integer(data->reserved0));
1931  json_object_set_new(js, "value",
1932  json_real(data->value));
1933  json_object_set_new(js, "timestamp",
1934  json_integer(data->timestamp));
1935  break;
1936  }
1937  case DNP3_OBJECT_CODE(42, 8): {
1938  DNP3ObjectG42V8 *data = point->data;
1939  json_object_set_new(js, "online",
1940  json_integer(data->online));
1941  json_object_set_new(js, "restart",
1942  json_integer(data->restart));
1943  json_object_set_new(js, "comm_lost",
1944  json_integer(data->comm_lost));
1945  json_object_set_new(js, "remote_forced",
1946  json_integer(data->remote_forced));
1947  json_object_set_new(js, "local_forced",
1948  json_integer(data->local_forced));
1949  json_object_set_new(js, "over_range",
1950  json_integer(data->over_range));
1951  json_object_set_new(js, "reference_err",
1952  json_integer(data->reference_err));
1953  json_object_set_new(js, "reserved0",
1954  json_integer(data->reserved0));
1955  json_object_set_new(js, "value",
1956  json_real(data->value));
1957  json_object_set_new(js, "timestamp",
1958  json_integer(data->timestamp));
1959  break;
1960  }
1961  case DNP3_OBJECT_CODE(43, 1): {
1962  DNP3ObjectG43V1 *data = point->data;
1963  json_object_set_new(js, "status_code",
1964  json_integer(data->status_code));
1965  json_object_set_new(js, "reserved0",
1966  json_integer(data->reserved0));
1967  json_object_set_new(js, "commanded_value",
1968  json_integer(data->commanded_value));
1969  break;
1970  }
1971  case DNP3_OBJECT_CODE(43, 2): {
1972  DNP3ObjectG43V2 *data = point->data;
1973  json_object_set_new(js, "status_code",
1974  json_integer(data->status_code));
1975  json_object_set_new(js, "reserved0",
1976  json_integer(data->reserved0));
1977  json_object_set_new(js, "commanded_value",
1978  json_integer(data->commanded_value));
1979  break;
1980  }
1981  case DNP3_OBJECT_CODE(43, 3): {
1982  DNP3ObjectG43V3 *data = point->data;
1983  json_object_set_new(js, "status_code",
1984  json_integer(data->status_code));
1985  json_object_set_new(js, "reserved0",
1986  json_integer(data->reserved0));
1987  json_object_set_new(js, "commanded_value",
1988  json_integer(data->commanded_value));
1989  json_object_set_new(js, "timestamp",
1990  json_integer(data->timestamp));
1991  break;
1992  }
1993  case DNP3_OBJECT_CODE(43, 4): {
1994  DNP3ObjectG43V4 *data = point->data;
1995  json_object_set_new(js, "status_code",
1996  json_integer(data->status_code));
1997  json_object_set_new(js, "reserved0",
1998  json_integer(data->reserved0));
1999  json_object_set_new(js, "commanded_value",
2000  json_integer(data->commanded_value));
2001  json_object_set_new(js, "timestamp",
2002  json_integer(data->timestamp));
2003  break;
2004  }
2005  case DNP3_OBJECT_CODE(43, 5): {
2006  DNP3ObjectG43V5 *data = point->data;
2007  json_object_set_new(js, "status_code",
2008  json_integer(data->status_code));
2009  json_object_set_new(js, "reserved0",
2010  json_integer(data->reserved0));
2011  json_object_set_new(js, "commanded_value",
2012  json_real(data->commanded_value));
2013  break;
2014  }
2015  case DNP3_OBJECT_CODE(43, 6): {
2016  DNP3ObjectG43V6 *data = point->data;
2017  json_object_set_new(js, "status_code",
2018  json_integer(data->status_code));
2019  json_object_set_new(js, "reserved0",
2020  json_integer(data->reserved0));
2021  json_object_set_new(js, "commanded_value",
2022  json_real(data->commanded_value));
2023  break;
2024  }
2025  case DNP3_OBJECT_CODE(43, 7): {
2026  DNP3ObjectG43V7 *data = point->data;
2027  json_object_set_new(js, "status_code",
2028  json_integer(data->status_code));
2029  json_object_set_new(js, "reserved0",
2030  json_integer(data->reserved0));
2031  json_object_set_new(js, "commanded_value",
2032  json_real(data->commanded_value));
2033  json_object_set_new(js, "timestamp",
2034  json_integer(data->timestamp));
2035  break;
2036  }
2037  case DNP3_OBJECT_CODE(43, 8): {
2038  DNP3ObjectG43V8 *data = point->data;
2039  json_object_set_new(js, "status_code",
2040  json_integer(data->status_code));
2041  json_object_set_new(js, "reserved0",
2042  json_integer(data->reserved0));
2043  json_object_set_new(js, "commanded_value",
2044  json_real(data->commanded_value));
2045  json_object_set_new(js, "timestamp",
2046  json_integer(data->timestamp));
2047  break;
2048  }
2049  case DNP3_OBJECT_CODE(50, 1): {
2050  DNP3ObjectG50V1 *data = point->data;
2051  json_object_set_new(js, "timestamp",
2052  json_integer(data->timestamp));
2053  break;
2054  }
2055  case DNP3_OBJECT_CODE(50, 2): {
2056  DNP3ObjectG50V2 *data = point->data;
2057  json_object_set_new(js, "timestamp",
2058  json_integer(data->timestamp));
2059  json_object_set_new(js, "interval",
2060  json_integer(data->interval));
2061  break;
2062  }
2063  case DNP3_OBJECT_CODE(50, 3): {
2064  DNP3ObjectG50V3 *data = point->data;
2065  json_object_set_new(js, "timestamp",
2066  json_integer(data->timestamp));
2067  break;
2068  }
2069  case DNP3_OBJECT_CODE(50, 4): {
2070  DNP3ObjectG50V4 *data = point->data;
2071  json_object_set_new(js, "timestamp",
2072  json_integer(data->timestamp));
2073  json_object_set_new(js, "interval_count",
2074  json_integer(data->interval_count));
2075  json_object_set_new(js, "interval_units",
2076  json_integer(data->interval_units));
2077  break;
2078  }
2079  case DNP3_OBJECT_CODE(51, 1): {
2080  DNP3ObjectG51V1 *data = point->data;
2081  json_object_set_new(js, "timestamp",
2082  json_integer(data->timestamp));
2083  break;
2084  }
2085  case DNP3_OBJECT_CODE(51, 2): {
2086  DNP3ObjectG51V2 *data = point->data;
2087  json_object_set_new(js, "timestamp",
2088  json_integer(data->timestamp));
2089  break;
2090  }
2091  case DNP3_OBJECT_CODE(52, 1): {
2092  DNP3ObjectG52V1 *data = point->data;
2093  json_object_set_new(js, "delay_secs",
2094  json_integer(data->delay_secs));
2095  break;
2096  }
2097  case DNP3_OBJECT_CODE(52, 2): {
2098  DNP3ObjectG52V2 *data = point->data;
2099  json_object_set_new(js, "delay_ms",
2100  json_integer(data->delay_ms));
2101  break;
2102  }
2103  case DNP3_OBJECT_CODE(70, 1): {
2104  DNP3ObjectG70V1 *data = point->data;
2105  json_object_set_new(js, "filename_size",
2106  json_integer(data->filename_size));
2107  json_object_set_new(js, "filetype_code",
2108  json_integer(data->filetype_code));
2109  json_object_set_new(js, "attribute_code",
2110  json_integer(data->attribute_code));
2111  json_object_set_new(js, "start_record",
2112  json_integer(data->start_record));
2113  json_object_set_new(js, "end_record",
2114  json_integer(data->end_record));
2115  json_object_set_new(js, "file_size",
2116  json_integer(data->file_size));
2117  json_object_set_new(js, "created_timestamp",
2118  json_integer(data->created_timestamp));
2119  json_object_set_new(js, "permission",
2120  json_integer(data->permission));
2121  json_object_set_new(js, "file_id",
2122  json_integer(data->file_id));
2123  json_object_set_new(js, "owner_id",
2124  json_integer(data->owner_id));
2125  json_object_set_new(js, "group_id",
2126  json_integer(data->group_id));
2127  json_object_set_new(js, "file_function_code",
2128  json_integer(data->file_function_code));
2129  json_object_set_new(js, "status_code",
2130  json_integer(data->status_code));
2131  if (data->filename_size > 0) {
2132  /* First create a null terminated string as not all versions
2133  * of jansson have json_stringn. */
2134  char tmpbuf[data->filename_size + 1];
2135  memcpy(tmpbuf, data->filename, data->filename_size);
2136  tmpbuf[data->filename_size] = '\0';
2137  json_object_set_new(js, "filename", SCJsonString(tmpbuf));
2138  } else {
2139  json_object_set_new(js, "filename", json_string(""));
2140  }
2141  json_object_set_new(js, "data_size",
2142  json_integer(data->data_size));
2143  if (data->data_size > 0) {
2144  /* First create a null terminated string as not all versions
2145  * of jansson have json_stringn. */
2146  char tmpbuf[data->data_size + 1];
2147  memcpy(tmpbuf, data->data, data->data_size);
2148  tmpbuf[data->data_size] = '\0';
2149  json_object_set_new(js, "data", SCJsonString(tmpbuf));
2150  } else {
2151  json_object_set_new(js, "data", json_string(""));
2152  }
2153  break;
2154  }
2155  case DNP3_OBJECT_CODE(70, 2): {
2156  DNP3ObjectG70V2 *data = point->data;
2157  json_object_set_new(js, "username_offset",
2158  json_integer(data->username_offset));
2159  json_object_set_new(js, "username_size",
2160  json_integer(data->username_size));
2161  json_object_set_new(js, "password_offset",
2162  json_integer(data->password_offset));
2163  json_object_set_new(js, "password_size",
2164  json_integer(data->password_size));
2165  json_object_set_new(js, "authentication_key",
2166  json_integer(data->authentication_key));
2167  if (data->username_size > 0) {
2168  /* First create a null terminated string as not all versions
2169  * of jansson have json_stringn. */
2170  char tmpbuf[data->username_size + 1];
2171  memcpy(tmpbuf, data->username, data->username_size);
2172  tmpbuf[data->username_size] = '\0';
2173  json_object_set_new(js, "username", SCJsonString(tmpbuf));
2174  } else {
2175  json_object_set_new(js, "username", json_string(""));
2176  }
2177  if (data->password_size > 0) {
2178  /* First create a null terminated string as not all versions
2179  * of jansson have json_stringn. */
2180  char tmpbuf[data->password_size + 1];
2181  memcpy(tmpbuf, data->password, data->password_size);
2182  tmpbuf[data->password_size] = '\0';
2183  json_object_set_new(js, "password", SCJsonString(tmpbuf));
2184  } else {
2185  json_object_set_new(js, "password", json_string(""));
2186  }
2187  break;
2188  }
2189  case DNP3_OBJECT_CODE(70, 3): {
2190  DNP3ObjectG70V3 *data = point->data;
2191  json_object_set_new(js, "filename_offset",
2192  json_integer(data->filename_offset));
2193  json_object_set_new(js, "filename_size",
2194  json_integer(data->filename_size));
2195  json_object_set_new(js, "created",
2196  json_integer(data->created));
2197  json_object_set_new(js, "permissions",
2198  json_integer(data->permissions));
2199  json_object_set_new(js, "authentication_key",
2200  json_integer(data->authentication_key));
2201  json_object_set_new(js, "file_size",
2202  json_integer(data->file_size));
2203  json_object_set_new(js, "operational_mode",
2204  json_integer(data->operational_mode));
2205  json_object_set_new(js, "maximum_block_size",
2206  json_integer(data->maximum_block_size));
2207  json_object_set_new(js, "request_id",
2208  json_integer(data->request_id));
2209  if (data->filename_size > 0) {
2210  /* First create a null terminated string as not all versions
2211  * of jansson have json_stringn. */
2212  char tmpbuf[data->filename_size + 1];
2213  memcpy(tmpbuf, data->filename, data->filename_size);
2214  tmpbuf[data->filename_size] = '\0';
2215  json_object_set_new(js, "filename", SCJsonString(tmpbuf));
2216  } else {
2217  json_object_set_new(js, "filename", json_string(""));
2218  }
2219  break;
2220  }
2221  case DNP3_OBJECT_CODE(70, 4): {
2222  DNP3ObjectG70V4 *data = point->data;
2223  json_object_set_new(js, "file_handle",
2224  json_integer(data->file_handle));
2225  json_object_set_new(js, "file_size",
2226  json_integer(data->file_size));
2227  json_object_set_new(js, "maximum_block_size",
2228  json_integer(data->maximum_block_size));
2229  json_object_set_new(js, "request_id",
2230  json_integer(data->request_id));
2231  json_object_set_new(js, "status_code",
2232  json_integer(data->status_code));
2233  if (data->optional_text_len > 0) {
2234  /* First create a null terminated string as not all versions
2235  * of jansson have json_stringn. */
2236  char tmpbuf[data->optional_text_len + 1];
2237  memcpy(tmpbuf, data->optional_text, data->optional_text_len);
2238  tmpbuf[data->optional_text_len] = '\0';
2239  json_object_set_new(js, "optional_text", SCJsonString(tmpbuf));
2240  } else {
2241  json_object_set_new(js, "optional_text", json_string(""));
2242  }
2243  break;
2244  }
2245  case DNP3_OBJECT_CODE(70, 5): {
2246  DNP3ObjectG70V5 *data = point->data;
2247  json_object_set_new(js, "file_handle",
2248  json_integer(data->file_handle));
2249  json_object_set_new(js, "block_number",
2250  json_integer(data->block_number));
2251  if (data->file_data_len > 0) {
2252  /* First create a null terminated string as not all versions
2253  * of jansson have json_stringn. */
2254  char tmpbuf[data->file_data_len + 1];
2255  memcpy(tmpbuf, data->file_data, data->file_data_len);
2256  tmpbuf[data->file_data_len] = '\0';
2257  json_object_set_new(js, "file_data", SCJsonString(tmpbuf));
2258  } else {
2259  json_object_set_new(js, "file_data", json_string(""));
2260  }
2261  break;
2262  }
2263  case DNP3_OBJECT_CODE(70, 6): {
2264  DNP3ObjectG70V6 *data = point->data;
2265  json_object_set_new(js, "file_handle",
2266  json_integer(data->file_handle));
2267  json_object_set_new(js, "block_number",
2268  json_integer(data->block_number));
2269  json_object_set_new(js, "status_code",
2270  json_integer(data->status_code));
2271  if (data->optional_text_len > 0) {
2272  /* First create a null terminated string as not all versions
2273  * of jansson have json_stringn. */
2274  char tmpbuf[data->optional_text_len + 1];
2275  memcpy(tmpbuf, data->optional_text, data->optional_text_len);
2276  tmpbuf[data->optional_text_len] = '\0';
2277  json_object_set_new(js, "optional_text", SCJsonString(tmpbuf));
2278  } else {
2279  json_object_set_new(js, "optional_text", json_string(""));
2280  }
2281  break;
2282  }
2283  case DNP3_OBJECT_CODE(70, 7): {
2284  DNP3ObjectG70V7 *data = point->data;
2285  json_object_set_new(js, "filename_offset",
2286  json_integer(data->filename_offset));
2287  json_object_set_new(js, "filename_size",
2288  json_integer(data->filename_size));
2289  json_object_set_new(js, "file_type",
2290  json_integer(data->file_type));
2291  json_object_set_new(js, "file_size",
2292  json_integer(data->file_size));
2293  json_object_set_new(js, "created_timestamp",
2294  json_integer(data->created_timestamp));
2295  json_object_set_new(js, "permissions",
2296  json_integer(data->permissions));
2297  json_object_set_new(js, "request_id",
2298  json_integer(data->request_id));
2299  if (data->filename_size > 0) {
2300  /* First create a null terminated string as not all versions
2301  * of jansson have json_stringn. */
2302  char tmpbuf[data->filename_size + 1];
2303  memcpy(tmpbuf, data->filename, data->filename_size);
2304  tmpbuf[data->filename_size] = '\0';
2305  json_object_set_new(js, "filename", SCJsonString(tmpbuf));
2306  } else {
2307  json_object_set_new(js, "filename", json_string(""));
2308  }
2309  break;
2310  }
2311  case DNP3_OBJECT_CODE(70, 8): {
2312  DNP3ObjectG70V8 *data = point->data;
2313  if (data->file_specification_len > 0) {
2314  /* First create a null terminated string as not all versions
2315  * of jansson have json_stringn. */
2316  char tmpbuf[data->file_specification_len + 1];
2317  memcpy(tmpbuf, data->file_specification, data->file_specification_len);
2318  tmpbuf[data->file_specification_len] = '\0';
2319  json_object_set_new(js, "file_specification", SCJsonString(tmpbuf));
2320  } else {
2321  json_object_set_new(js, "file_specification", json_string(""));
2322  }
2323  break;
2324  }
2325  case DNP3_OBJECT_CODE(80, 1): {
2326  DNP3ObjectG80V1 *data = point->data;
2327  json_object_set_new(js, "state",
2328  json_integer(data->state));
2329  break;
2330  }
2331  case DNP3_OBJECT_CODE(81, 1): {
2332  DNP3ObjectG81V1 *data = point->data;
2333  json_object_set_new(js, "fill_percentage",
2334  json_integer(data->fill_percentage));
2335  json_object_set_new(js, "overflow_state",
2336  json_integer(data->overflow_state));
2337  json_object_set_new(js, "group",
2338  json_integer(data->group));
2339  json_object_set_new(js, "variation",
2340  json_integer(data->variation));
2341  break;
2342  }
2343  case DNP3_OBJECT_CODE(83, 1): {
2344  DNP3ObjectG83V1 *data = point->data;
2345  json_object_set_new(js, "data->vendor_code", SCJsonString(data->vendor_code));
2346  json_object_set_new(js, "object_id",
2347  json_integer(data->object_id));
2348  json_object_set_new(js, "length",
2349  json_integer(data->length));
2350  unsigned long data_objects_b64_len = data->length * 2;
2351  uint8_t data_objects_b64[data_objects_b64_len];
2352  Base64Encode(data->data_objects, data->length,
2353  data_objects_b64, &data_objects_b64_len);
2354  json_object_set_new(js, "data->data_objects",
2355  json_string((char *)data_objects_b64));
2356  break;
2357  }
2358  case DNP3_OBJECT_CODE(86, 2): {
2359  DNP3ObjectG86V2 *data = point->data;
2360  json_object_set_new(js, "rd",
2361  json_integer(data->rd));
2362  json_object_set_new(js, "wr",
2363  json_integer(data->wr));
2364  json_object_set_new(js, "st",
2365  json_integer(data->st));
2366  json_object_set_new(js, "ev",
2367  json_integer(data->ev));
2368  json_object_set_new(js, "df",
2369  json_integer(data->df));
2370  json_object_set_new(js, "padding0",
2371  json_integer(data->padding0));
2372  json_object_set_new(js, "padding1",
2373  json_integer(data->padding1));
2374  json_object_set_new(js, "padding2",
2375  json_integer(data->padding2));
2376  break;
2377  }
2378  case DNP3_OBJECT_CODE(102, 1): {
2379  DNP3ObjectG102V1 *data = point->data;
2380  json_object_set_new(js, "value",
2381  json_integer(data->value));
2382  break;
2383  }
2384  case DNP3_OBJECT_CODE(120, 1): {
2385  DNP3ObjectG120V1 *data = point->data;
2386  json_object_set_new(js, "csq",
2387  json_integer(data->csq));
2388  json_object_set_new(js, "usr",
2389  json_integer(data->usr));
2390  json_object_set_new(js, "mal",
2391  json_integer(data->mal));
2392  json_object_set_new(js, "reason",
2393  json_integer(data->reason));
2394  unsigned long challenge_data_b64_len = data->challenge_data_len * 2;
2395  uint8_t challenge_data_b64[challenge_data_b64_len];
2397  challenge_data_b64, &challenge_data_b64_len);
2398  json_object_set_new(js, "data->challenge_data",
2399  json_string((char *)challenge_data_b64));
2400  break;
2401  }
2402  case DNP3_OBJECT_CODE(120, 2): {
2403  DNP3ObjectG120V2 *data = point->data;
2404  json_object_set_new(js, "csq",
2405  json_integer(data->csq));
2406  json_object_set_new(js, "usr",
2407  json_integer(data->usr));
2408  unsigned long mac_value_b64_len = data->mac_value_len * 2;
2409  uint8_t mac_value_b64[mac_value_b64_len];
2410  Base64Encode(data->mac_value, data->mac_value_len,
2411  mac_value_b64, &mac_value_b64_len);
2412  json_object_set_new(js, "data->mac_value",
2413  json_string((char *)mac_value_b64));
2414  break;
2415  }
2416  case DNP3_OBJECT_CODE(120, 3): {
2417  DNP3ObjectG120V3 *data = point->data;
2418  json_object_set_new(js, "csq",
2419  json_integer(data->csq));
2420  json_object_set_new(js, "user_number",
2421  json_integer(data->user_number));
2422  break;
2423  }
2424  case DNP3_OBJECT_CODE(120, 4): {
2425  DNP3ObjectG120V4 *data = point->data;
2426  json_object_set_new(js, "user_number",
2427  json_integer(data->user_number));
2428  break;
2429  }
2430  case DNP3_OBJECT_CODE(120, 5): {
2431  DNP3ObjectG120V5 *data = point->data;
2432  json_object_set_new(js, "ksq",
2433  json_integer(data->ksq));
2434  json_object_set_new(js, "user_number",
2435  json_integer(data->user_number));
2436  json_object_set_new(js, "key_wrap_alg",
2437  json_integer(data->key_wrap_alg));
2438  json_object_set_new(js, "key_status",
2439  json_integer(data->key_status));
2440  json_object_set_new(js, "mal",
2441  json_integer(data->mal));
2442  json_object_set_new(js, "challenge_data_len",
2443  json_integer(data->challenge_data_len));
2444  unsigned long challenge_data_b64_len = data->challenge_data_len * 2;
2445  uint8_t challenge_data_b64[challenge_data_b64_len];
2447  challenge_data_b64, &challenge_data_b64_len);
2448  json_object_set_new(js, "data->challenge_data",
2449  json_string((char *)challenge_data_b64));
2450  unsigned long mac_value_b64_len = data->mac_value_len * 2;
2451  uint8_t mac_value_b64[mac_value_b64_len];
2452  Base64Encode(data->mac_value, data->mac_value_len,
2453  mac_value_b64, &mac_value_b64_len);
2454  json_object_set_new(js, "data->mac_value",
2455  json_string((char *)mac_value_b64));
2456  break;
2457  }
2458  case DNP3_OBJECT_CODE(120, 6): {
2459  DNP3ObjectG120V6 *data = point->data;
2460  json_object_set_new(js, "ksq",
2461  json_integer(data->ksq));
2462  json_object_set_new(js, "usr",
2463  json_integer(data->usr));
2464  unsigned long wrapped_key_data_b64_len = data->wrapped_key_data_len * 2;
2465  uint8_t wrapped_key_data_b64[wrapped_key_data_b64_len];
2467  wrapped_key_data_b64, &wrapped_key_data_b64_len);
2468  json_object_set_new(js, "data->wrapped_key_data",
2469  json_string((char *)wrapped_key_data_b64));
2470  break;
2471  }
2472  case DNP3_OBJECT_CODE(120, 7): {
2473  DNP3ObjectG120V7 *data = point->data;
2474  json_object_set_new(js, "sequence_number",
2475  json_integer(data->sequence_number));
2476  json_object_set_new(js, "usr",
2477  json_integer(data->usr));
2478  json_object_set_new(js, "association_id",
2479  json_integer(data->association_id));
2480  json_object_set_new(js, "error_code",
2481  json_integer(data->error_code));
2482  json_object_set_new(js, "time_of_error",
2483  json_integer(data->time_of_error));
2484  if (data->error_text_len > 0) {
2485  /* First create a null terminated string as not all versions
2486  * of jansson have json_stringn. */
2487  char tmpbuf[data->error_text_len + 1];
2488  memcpy(tmpbuf, data->error_text, data->error_text_len);
2489  tmpbuf[data->error_text_len] = '\0';
2490  json_object_set_new(js, "error_text", SCJsonString(tmpbuf));
2491  } else {
2492  json_object_set_new(js, "error_text", json_string(""));
2493  }
2494  break;
2495  }
2496  case DNP3_OBJECT_CODE(120, 8): {
2497  DNP3ObjectG120V8 *data = point->data;
2498  json_object_set_new(js, "key_change_method",
2499  json_integer(data->key_change_method));
2500  json_object_set_new(js, "certificate_type",
2501  json_integer(data->certificate_type));
2502  unsigned long certificate_b64_len = data->certificate_len * 2;
2503  uint8_t certificate_b64[certificate_b64_len];
2505  certificate_b64, &certificate_b64_len);
2506  json_object_set_new(js, "data->certificate",
2507  json_string((char *)certificate_b64));
2508  break;
2509  }
2510  case DNP3_OBJECT_CODE(120, 9): {
2511  DNP3ObjectG120V9 *data = point->data;
2512  unsigned long mac_value_b64_len = data->mac_value_len * 2;
2513  uint8_t mac_value_b64[mac_value_b64_len];
2514  Base64Encode(data->mac_value, data->mac_value_len,
2515  mac_value_b64, &mac_value_b64_len);
2516  json_object_set_new(js, "data->mac_value",
2517  json_string((char *)mac_value_b64));
2518  break;
2519  }
2520  case DNP3_OBJECT_CODE(120, 10): {
2521  DNP3ObjectG120V10 *data = point->data;
2522  json_object_set_new(js, "key_change_method",
2523  json_integer(data->key_change_method));
2524  json_object_set_new(js, "operation",
2525  json_integer(data->operation));
2526  json_object_set_new(js, "scs",
2527  json_integer(data->scs));
2528  json_object_set_new(js, "user_role",
2529  json_integer(data->user_role));
2530  json_object_set_new(js, "user_role_expiry_interval",
2531  json_integer(data->user_role_expiry_interval));
2532  json_object_set_new(js, "username_len",
2533  json_integer(data->username_len));
2534  json_object_set_new(js, "user_public_key_len",
2535  json_integer(data->user_public_key_len));
2536  json_object_set_new(js, "certification_data_len",
2537  json_integer(data->certification_data_len));
2538  if (data->username_len > 0) {
2539  /* First create a null terminated string as not all versions
2540  * of jansson have json_stringn. */
2541  char tmpbuf[data->username_len + 1];
2542  memcpy(tmpbuf, data->username, data->username_len);
2543  tmpbuf[data->username_len] = '\0';
2544  json_object_set_new(js, "username", SCJsonString(tmpbuf));
2545  } else {
2546  json_object_set_new(js, "username", json_string(""));
2547  }
2548  unsigned long user_public_key_b64_len = data->user_public_key_len * 2;
2549  uint8_t user_public_key_b64[user_public_key_b64_len];
2551  user_public_key_b64, &user_public_key_b64_len);
2552  json_object_set_new(js, "data->user_public_key",
2553  json_string((char *)user_public_key_b64));
2554  unsigned long certification_data_b64_len = data->certification_data_len * 2;
2555  uint8_t certification_data_b64[certification_data_b64_len];
2557  certification_data_b64, &certification_data_b64_len);
2558  json_object_set_new(js, "data->certification_data",
2559  json_string((char *)certification_data_b64));
2560  break;
2561  }
2562  case DNP3_OBJECT_CODE(120, 11): {
2563  DNP3ObjectG120V11 *data = point->data;
2564  json_object_set_new(js, "key_change_method",
2565  json_integer(data->key_change_method));
2566  json_object_set_new(js, "username_len",
2567  json_integer(data->username_len));
2568  json_object_set_new(js, "master_challenge_data_len",
2569  json_integer(data->master_challenge_data_len));
2570  if (data->username_len > 0) {
2571  /* First create a null terminated string as not all versions
2572  * of jansson have json_stringn. */
2573  char tmpbuf[data->username_len + 1];
2574  memcpy(tmpbuf, data->username, data->username_len);
2575  tmpbuf[data->username_len] = '\0';
2576  json_object_set_new(js, "username", SCJsonString(tmpbuf));
2577  } else {
2578  json_object_set_new(js, "username", json_string(""));
2579  }
2580  unsigned long master_challenge_data_b64_len = data->master_challenge_data_len * 2;
2581  uint8_t master_challenge_data_b64[master_challenge_data_b64_len];
2583  master_challenge_data_b64, &master_challenge_data_b64_len);
2584  json_object_set_new(js, "data->master_challenge_data",
2585  json_string((char *)master_challenge_data_b64));
2586  break;
2587  }
2588  case DNP3_OBJECT_CODE(120, 12): {
2589  DNP3ObjectG120V12 *data = point->data;
2590  json_object_set_new(js, "ksq",
2591  json_integer(data->ksq));
2592  json_object_set_new(js, "user_number",
2593  json_integer(data->user_number));
2594  json_object_set_new(js, "challenge_data_len",
2595  json_integer(data->challenge_data_len));
2596  unsigned long challenge_data_b64_len = data->challenge_data_len * 2;
2597  uint8_t challenge_data_b64[challenge_data_b64_len];
2599  challenge_data_b64, &challenge_data_b64_len);
2600  json_object_set_new(js, "data->challenge_data",
2601  json_string((char *)challenge_data_b64));
2602  break;
2603  }
2604  case DNP3_OBJECT_CODE(120, 13): {
2605  DNP3ObjectG120V13 *data = point->data;
2606  json_object_set_new(js, "ksq",
2607  json_integer(data->ksq));
2608  json_object_set_new(js, "user_number",
2609  json_integer(data->user_number));
2610  json_object_set_new(js, "encrypted_update_key_len",
2611  json_integer(data->encrypted_update_key_len));
2612  unsigned long encrypted_update_key_data_b64_len = data->encrypted_update_key_len * 2;
2613  uint8_t encrypted_update_key_data_b64[encrypted_update_key_data_b64_len];
2615  encrypted_update_key_data_b64, &encrypted_update_key_data_b64_len);
2616  json_object_set_new(js, "data->encrypted_update_key_data",
2617  json_string((char *)encrypted_update_key_data_b64));
2618  break;
2619  }
2620  case DNP3_OBJECT_CODE(120, 14): {
2621  DNP3ObjectG120V14 *data = point->data;
2622  unsigned long digital_signature_b64_len = data->digital_signature_len * 2;
2623  uint8_t digital_signature_b64[digital_signature_b64_len];
2625  digital_signature_b64, &digital_signature_b64_len);
2626  json_object_set_new(js, "data->digital_signature",
2627  json_string((char *)digital_signature_b64));
2628  break;
2629  }
2630  case DNP3_OBJECT_CODE(120, 15): {
2631  DNP3ObjectG120V15 *data = point->data;
2632  unsigned long mac_b64_len = data->mac_len * 2;
2633  uint8_t mac_b64[mac_b64_len];
2634  Base64Encode(data->mac, data->mac_len,
2635  mac_b64, &mac_b64_len);
2636  json_object_set_new(js, "data->mac",
2637  json_string((char *)mac_b64));
2638  break;
2639  }
2640  case DNP3_OBJECT_CODE(121, 1): {
2641  DNP3ObjectG121V1 *data = point->data;
2642  json_object_set_new(js, "online",
2643  json_integer(data->online));
2644  json_object_set_new(js, "restart",
2645  json_integer(data->restart));
2646  json_object_set_new(js, "comm_lost",
2647  json_integer(data->comm_lost));
2648  json_object_set_new(js, "remote_forced",
2649  json_integer(data->remote_forced));
2650  json_object_set_new(js, "local_forced",
2651  json_integer(data->local_forced));
2652  json_object_set_new(js, "reserved0",
2653  json_integer(data->reserved0));
2654  json_object_set_new(js, "discontinuity",
2655  json_integer(data->discontinuity));
2656  json_object_set_new(js, "reserved1",
2657  json_integer(data->reserved1));
2658  json_object_set_new(js, "association_id",
2659  json_integer(data->association_id));
2660  json_object_set_new(js, "count_value",
2661  json_integer(data->count_value));
2662  break;
2663  }
2664  case DNP3_OBJECT_CODE(122, 1): {
2665  DNP3ObjectG122V1 *data = point->data;
2666  json_object_set_new(js, "online",
2667  json_integer(data->online));
2668  json_object_set_new(js, "restart",
2669  json_integer(data->restart));
2670  json_object_set_new(js, "comm_lost",
2671  json_integer(data->comm_lost));
2672  json_object_set_new(js, "remote_forced",
2673  json_integer(data->remote_forced));
2674  json_object_set_new(js, "local_forced",
2675  json_integer(data->local_forced));
2676  json_object_set_new(js, "reserved0",
2677  json_integer(data->reserved0));
2678  json_object_set_new(js, "discontinuity",
2679  json_integer(data->discontinuity));
2680  json_object_set_new(js, "reserved1",
2681  json_integer(data->reserved1));
2682  json_object_set_new(js, "association_id",
2683  json_integer(data->association_id));
2684  json_object_set_new(js, "count_value",
2685  json_integer(data->count_value));
2686  break;
2687  }
2688  case DNP3_OBJECT_CODE(122, 2): {
2689  DNP3ObjectG122V2 *data = point->data;
2690  json_object_set_new(js, "online",
2691  json_integer(data->online));
2692  json_object_set_new(js, "restart",
2693  json_integer(data->restart));
2694  json_object_set_new(js, "comm_lost",
2695  json_integer(data->comm_lost));
2696  json_object_set_new(js, "remote_forced",
2697  json_integer(data->remote_forced));
2698  json_object_set_new(js, "local_forced",
2699  json_integer(data->local_forced));
2700  json_object_set_new(js, "reserved0",
2701  json_integer(data->reserved0));
2702  json_object_set_new(js, "discontinuity",
2703  json_integer(data->discontinuity));
2704  json_object_set_new(js, "reserved1",
2705  json_integer(data->reserved1));
2706  json_object_set_new(js, "association_id",
2707  json_integer(data->association_id));
2708  json_object_set_new(js, "count_value",
2709  json_integer(data->count_value));
2710  json_object_set_new(js, "timestamp",
2711  json_integer(data->timestamp));
2712  break;
2713  }
2714  default:
2715  SCLogDebug("Unknown object: %d:%d", object->group,
2716  object->variation);
2717  break;
2718  }
2719 
2720 }
2721 
2722 #endif /* HAVE_LIBJANSSON */
#define DNP3_OBJECT_CODE(group, variation)
#define SCLogDebug(...)
Definition: util-debug.h:335
Struct to hold the list of decoded objects.
DNP3 object point.
uint8_t variation
int Base64Encode(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen)
Definition: util-crypt.c:272