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