34 static void DNP3HexDump(uint8_t *data,
int len)
36 for (
int i = 0; i <
len; i++) {
37 printf(
"%02x ", data[i]);
47 DNP3PointList *items =
SCCalloc(1,
sizeof(*items));
63 if (point->
data != NULL) {
84 static int DNP3ReadUint8(
const uint8_t **buf, uint32_t *
len, uint8_t *out)
86 if (*
len < (
int)
sizeof(*out)) {
89 *out = *(uint8_t *)(*buf);
108 static int DNP3ReadUint16(
const uint8_t **buf, uint32_t *
len, uint16_t *out)
110 if (*
len < (
int)
sizeof(*out)) {
114 *buf +=
sizeof(*out);
115 *
len -=
sizeof(*out);
132 static int DNP3ReadUint24(
const uint8_t **buf, uint32_t *
len, uint32_t *out)
134 if (*
len < (
int)(
sizeof(uint8_t) * 3)) {
138 #if __BYTE_ORDER__ == __BIG_ENDIAN
139 *out = ((uint32_t)(*buf)[0] << 16) | ((uint32_t)(*buf)[1] << 8) |
141 #elif __BYTE_ORDER == __LITTLE_ENDIAN
142 *out = ((uint32_t)(*buf)[0]) | ((uint32_t)(*buf)[1] << 8) | ((uint32_t)(*buf)[2] << 16);
164 static int DNP3ReadUint32(
const uint8_t **buf, uint32_t *
len, uint32_t *out)
166 if (*
len < (
int)
sizeof(*out)) {
170 *buf +=
sizeof(*out);
171 *
len -=
sizeof(*out);
188 static int DNP3ReadUint48(
const uint8_t **buf, uint32_t *
len, uint64_t *out)
190 if (*
len < (
int)(
sizeof(uint8_t) * 6)) {
194 #if __BYTE_ORDER__ == __BIG_ENDIAN
195 *out = ((uint64_t)(*buf)[0] << 40) | ((uint64_t)(*buf)[1] << 32) |
196 ((uint64_t)(*buf)[2] << 24) | ((uint64_t)(*buf)[3] << 16) |
197 ((uint64_t)(*buf)[4] << 8) | (uint64_t)(*buf)[5];
198 #elif __BYTE_ORDER == __LITTLE_ENDIAN
199 *out = ((uint64_t)(*buf)[0]) | ((uint64_t)(*buf)[1] << 8) |
200 ((uint64_t)(*buf)[2] << 16) | ((uint64_t)(*buf)[3] << 24) |
201 ((uint64_t)(*buf)[4] << 32) | ((uint64_t)(*buf)[5] << 40);
223 static int DNP3ReadFloat32(
const uint8_t **buf, uint32_t *
len,
float *out)
229 #if __BYTE_ORDER == __LITTLE_ENDIAN
230 *((uint8_t *)out + 0) = (*buf)[0];
231 *((uint8_t *)out + 1) = (*buf)[1];
232 *((uint8_t *)out + 2) = (*buf)[2];
233 *((uint8_t *)out + 3) = (*buf)[3];
235 *((uint8_t *)out + 3) = (*buf)[0];
236 *((uint8_t *)out + 2) = (*buf)[1];
237 *((uint8_t *)out + 1) = (*buf)[2];
238 *((uint8_t *)out + 0) = (*buf)[3];
259 static int DNP3ReadFloat64(
const uint8_t **buf, uint32_t *
len,
double *out)
265 #if __BYTE_ORDER == __LITTLE_ENDIAN
266 *((uint8_t *)out + 0) = (*buf)[0];
267 *((uint8_t *)out + 1) = (*buf)[1];
268 *((uint8_t *)out + 2) = (*buf)[2];
269 *((uint8_t *)out + 3) = (*buf)[3];
270 *((uint8_t *)out + 4) = (*buf)[4];
271 *((uint8_t *)out + 5) = (*buf)[5];
272 *((uint8_t *)out + 6) = (*buf)[6];
273 *((uint8_t *)out + 7) = (*buf)[7];
275 *((uint8_t *)out + 7) = (*buf)[0];
276 *((uint8_t *)out + 6) = (*buf)[1];
277 *((uint8_t *)out + 5) = (*buf)[2];
278 *((uint8_t *)out + 4) = (*buf)[3];
279 *((uint8_t *)out + 3) = (*buf)[4];
280 *((uint8_t *)out + 2) = (*buf)[5];
281 *((uint8_t *)out + 1) = (*buf)[6];
282 *((uint8_t *)out + 0) = (*buf)[7];
293 static int DNP3ReadPrefix(
294 const uint8_t **buf, uint32_t *
len, uint8_t prefix_code, uint32_t *out)
296 uint8_t prefix_len = 0;
298 switch (prefix_code) {
314 if (*
len < (uint32_t)prefix_len) {
318 switch (prefix_len) {
319 case sizeof(uint32_t):
320 if (!DNP3ReadUint32(buf,
len, out)) {
324 case sizeof(uint16_t): {
327 if (!DNP3ReadUint16(buf,
len, &val)) {
333 case sizeof(uint8_t): {
336 if (!DNP3ReadUint8(buf,
len, &val)) {
355 static int DNP3AddPoint(DNP3PointList *list,
void *
object, uint32_t point_index,
356 uint8_t prefix_code, uint32_t prefix)
363 point->
data = object;
365 point->
index = point_index;
366 switch (prefix_code) {
372 point->
index = prefix;
377 point->
size = prefix;
392 static int DNP3DecodeObjectG1V1(
const uint8_t **buf, uint32_t *
len,
393 uint8_t prefix_code, uint32_t start, uint32_t count,
394 DNP3PointList *points)
397 uint32_t bytes = (count / 8) + 1;
399 uint32_t point_index = start;
401 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
405 for (uint32_t i = 0; i < bytes; i++) {
409 if (!DNP3ReadUint8(buf,
len, &octet)) {
413 for (
int j = 0; j < 8 && count; j = j + 1) {
415 object =
SCCalloc(1,
sizeof(*
object));
420 object->state = (octet >> j) & 0x1;
422 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
435 if (
object != NULL) {
441 static int DNP3DecodeObjectG1V2(
const uint8_t **buf, uint32_t *
len,
442 uint8_t prefix_code, uint32_t start, uint32_t count,
443 DNP3PointList *points)
447 uint32_t point_index = start;
449 if (*
len < count/8) {
454 object =
SCCalloc(1,
sizeof(*
object));
459 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
465 if (!DNP3ReadUint8(buf,
len, &octet)) {
468 object->online = (octet >> 0) & 0x1;
469 object->restart = (octet >> 1) & 0x1;
470 object->comm_lost = (octet >> 2) & 0x1;
471 object->remote_forced = (octet >> 3) & 0x1;
472 object->local_forced = (octet >> 4) & 0x1;
473 object->chatter_filter = (octet >> 5) & 0x1;
474 object->reserved = (octet >> 6) & 0x1;
475 object->state = (octet >> 7) & 0x1;
478 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
488 if (
object != NULL) {
495 static int DNP3DecodeObjectG2V1(
const uint8_t **buf, uint32_t *
len,
496 uint8_t prefix_code, uint32_t start, uint32_t count,
497 DNP3PointList *points)
501 uint32_t point_index = start;
503 if (*
len < count/8) {
508 object =
SCCalloc(1,
sizeof(*
object));
513 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
517 if (!DNP3ReadUint8(buf,
len, &object->
state)) {
521 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
531 if (
object != NULL) {
538 static int DNP3DecodeObjectG2V2(
const uint8_t **buf, uint32_t *
len,
539 uint8_t prefix_code, uint32_t start, uint32_t count,
540 DNP3PointList *points)
544 uint32_t point_index = start;
546 if (*
len < count/8) {
551 object =
SCCalloc(1,
sizeof(*
object));
556 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
562 if (!DNP3ReadUint8(buf,
len, &octet)) {
565 object->online = (octet >> 0) & 0x1;
566 object->restart = (octet >> 1) & 0x1;
567 object->comm_lost = (octet >> 2) & 0x1;
568 object->remote_forced = (octet >> 3) & 0x1;
569 object->local_forced = (octet >> 4) & 0x1;
570 object->chatter_filter = (octet >> 5) & 0x1;
571 object->reserved = (octet >> 6) & 0x1;
572 object->state = (octet >> 7) & 0x1;
578 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
588 if (
object != NULL) {
595 static int DNP3DecodeObjectG2V3(
const uint8_t **buf, uint32_t *
len,
596 uint8_t prefix_code, uint32_t start, uint32_t count,
597 DNP3PointList *points)
601 uint32_t point_index = start;
603 if (*
len < count/8) {
608 object =
SCCalloc(1,
sizeof(*
object));
613 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
619 if (!DNP3ReadUint8(buf,
len, &octet)) {
622 object->online = (octet >> 0) & 0x1;
623 object->restart = (octet >> 1) & 0x1;
624 object->comm_lost = (octet >> 2) & 0x1;
625 object->remote_forced = (octet >> 3) & 0x1;
626 object->local_forced = (octet >> 4) & 0x1;
627 object->chatter_filter = (octet >> 5) & 0x1;
628 object->reserved = (octet >> 6) & 0x1;
629 object->state = (octet >> 7) & 0x1;
635 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
645 if (
object != NULL) {
652 static int DNP3DecodeObjectG3V1(
const uint8_t **buf, uint32_t *
len,
653 uint8_t prefix_code, uint32_t start, uint32_t count,
654 DNP3PointList *points)
657 uint32_t bytes = (count / 8) + 1;
659 uint32_t point_index = start;
661 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
665 for (uint32_t i = 0; i < bytes; i++) {
669 if (!DNP3ReadUint8(buf,
len, &octet)) {
673 for (
int j = 0; j < 8 && count; j = j + 2) {
675 object =
SCCalloc(1,
sizeof(*
object));
680 object->state = (octet >> j) & 0x3;
682 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
695 if (
object != NULL) {
701 static int DNP3DecodeObjectG3V2(
const uint8_t **buf, uint32_t *
len,
702 uint8_t prefix_code, uint32_t start, uint32_t count,
703 DNP3PointList *points)
707 uint32_t point_index = start;
709 if (*
len < count/8) {
714 object =
SCCalloc(1,
sizeof(*
object));
719 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
725 if (!DNP3ReadUint8(buf,
len, &octet)) {
728 object->online = (octet >> 0) & 0x1;
729 object->restart = (octet >> 1) & 0x1;
730 object->comm_lost = (octet >> 2) & 0x1;
731 object->remote_forced = (octet >> 3) & 0x1;
732 object->local_forced = (octet >> 4) & 0x1;
733 object->chatter_filter = (octet >> 5) & 0x1;
734 object->state = (octet >> 6) & 0x3;
737 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
747 if (
object != NULL) {
754 static int DNP3DecodeObjectG4V1(
const uint8_t **buf, uint32_t *
len,
755 uint8_t prefix_code, uint32_t start, uint32_t count,
756 DNP3PointList *points)
760 uint32_t point_index = start;
762 if (*
len < count/8) {
767 object =
SCCalloc(1,
sizeof(*
object));
772 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
778 if (!DNP3ReadUint8(buf,
len, &octet)) {
781 object->online = (octet >> 0) & 0x1;
782 object->restart = (octet >> 1) & 0x1;
783 object->comm_lost = (octet >> 2) & 0x1;
784 object->remote_forced = (octet >> 3) & 0x1;
785 object->local_forced = (octet >> 4) & 0x1;
786 object->chatter_filter = (octet >> 5) & 0x1;
787 object->state = (octet >> 6) & 0x3;
790 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
800 if (
object != NULL) {
807 static int DNP3DecodeObjectG4V2(
const uint8_t **buf, uint32_t *
len,
808 uint8_t prefix_code, uint32_t start, uint32_t count,
809 DNP3PointList *points)
813 uint32_t point_index = start;
815 if (*
len < count/8) {
820 object =
SCCalloc(1,
sizeof(*
object));
825 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
831 if (!DNP3ReadUint8(buf,
len, &octet)) {
834 object->online = (octet >> 0) & 0x1;
835 object->restart = (octet >> 1) & 0x1;
836 object->comm_lost = (octet >> 2) & 0x1;
837 object->remote_forced = (octet >> 3) & 0x1;
838 object->local_forced = (octet >> 4) & 0x1;
839 object->chatter_filter = (octet >> 5) & 0x1;
840 object->state = (octet >> 6) & 0x3;
846 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
856 if (
object != NULL) {
863 static int DNP3DecodeObjectG4V3(
const uint8_t **buf, uint32_t *
len,
864 uint8_t prefix_code, uint32_t start, uint32_t count,
865 DNP3PointList *points)
869 uint32_t point_index = start;
871 if (*
len < count/8) {
876 object =
SCCalloc(1,
sizeof(*
object));
881 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
887 if (!DNP3ReadUint8(buf,
len, &octet)) {
890 object->online = (octet >> 0) & 0x1;
891 object->restart = (octet >> 1) & 0x1;
892 object->comm_lost = (octet >> 2) & 0x1;
893 object->remote_forced = (octet >> 3) & 0x1;
894 object->local_forced = (octet >> 4) & 0x1;
895 object->chatter_filter = (octet >> 5) & 0x1;
896 object->state = (octet >> 6) & 0x3;
902 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
912 if (
object != NULL) {
919 static int DNP3DecodeObjectG10V1(
const uint8_t **buf, uint32_t *
len,
920 uint8_t prefix_code, uint32_t start, uint32_t count,
921 DNP3PointList *points)
924 uint32_t bytes = (count / 8) + 1;
926 uint32_t point_index = start;
928 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
932 for (uint32_t i = 0; i < bytes; i++) {
936 if (!DNP3ReadUint8(buf,
len, &octet)) {
940 for (
int j = 0; j < 8 && count; j = j + 1) {
942 object =
SCCalloc(1,
sizeof(*
object));
947 object->state = (octet >> j) & 0x1;
949 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
962 if (
object != NULL) {
968 static int DNP3DecodeObjectG10V2(
const uint8_t **buf, uint32_t *
len,
969 uint8_t prefix_code, uint32_t start, uint32_t count,
970 DNP3PointList *points)
974 uint32_t point_index = start;
976 if (*
len < count/8) {
981 object =
SCCalloc(1,
sizeof(*
object));
986 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
992 if (!DNP3ReadUint8(buf,
len, &octet)) {
995 object->online = (octet >> 0) & 0x1;
996 object->restart = (octet >> 1) & 0x1;
997 object->comm_lost = (octet >> 2) & 0x1;
998 object->remote_forced = (octet >> 3) & 0x1;
999 object->local_forced = (octet >> 4) & 0x1;
1000 object->reserved0 = (octet >> 5) & 0x1;
1001 object->reserved1 = (octet >> 6) & 0x1;
1002 object->state = (octet >> 7) & 0x1;
1005 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1015 if (
object != NULL) {
1022 static int DNP3DecodeObjectG11V1(
const uint8_t **buf, uint32_t *
len,
1023 uint8_t prefix_code, uint32_t start, uint32_t count,
1024 DNP3PointList *points)
1027 uint32_t prefix = 0;
1028 uint32_t point_index = start;
1030 if (*
len < count/8) {
1035 object =
SCCalloc(1,
sizeof(*
object));
1040 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1046 if (!DNP3ReadUint8(buf,
len, &octet)) {
1049 object->online = (octet >> 0) & 0x1;
1050 object->restart = (octet >> 1) & 0x1;
1051 object->comm_lost = (octet >> 2) & 0x1;
1052 object->remote_forced = (octet >> 3) & 0x1;
1053 object->local_forced = (octet >> 4) & 0x1;
1054 object->reserved0 = (octet >> 5) & 0x1;
1055 object->reserved1 = (octet >> 6) & 0x1;
1056 object->state = (octet >> 7) & 0x1;
1059 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1069 if (
object != NULL) {
1076 static int DNP3DecodeObjectG11V2(
const uint8_t **buf, uint32_t *
len,
1077 uint8_t prefix_code, uint32_t start, uint32_t count,
1078 DNP3PointList *points)
1081 uint32_t prefix = 0;
1082 uint32_t point_index = start;
1084 if (*
len < count/8) {
1089 object =
SCCalloc(1,
sizeof(*
object));
1094 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1100 if (!DNP3ReadUint8(buf,
len, &octet)) {
1103 object->online = (octet >> 0) & 0x1;
1104 object->restart = (octet >> 1) & 0x1;
1105 object->comm_lost = (octet >> 2) & 0x1;
1106 object->remote_forced = (octet >> 3) & 0x1;
1107 object->local_forced = (octet >> 4) & 0x1;
1108 object->reserved0 = (octet >> 5) & 0x1;
1109 object->reserved1 = (octet >> 6) & 0x1;
1110 object->state = (octet >> 7) & 0x1;
1116 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1126 if (
object != NULL) {
1133 static int DNP3DecodeObjectG12V1(
const uint8_t **buf, uint32_t *
len,
1134 uint8_t prefix_code, uint32_t start, uint32_t count,
1135 DNP3PointList *points)
1138 uint32_t prefix = 0;
1139 uint32_t point_index = start;
1141 if (*
len < count/8) {
1146 object =
SCCalloc(1,
sizeof(*
object));
1151 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1157 if (!DNP3ReadUint8(buf,
len, &octet)) {
1160 object->op_type = (octet >> 0) & 0xf;
1161 object->qu = (octet >> 4) & 0x1;
1162 object->cr = (octet >> 5) & 0x1;
1163 object->tcc = (octet >> 6) & 0x3;
1165 if (!DNP3ReadUint8(buf,
len, &object->
count)) {
1168 if (!DNP3ReadUint32(buf,
len, &object->
ontime)) {
1171 if (!DNP3ReadUint32(buf,
len, &object->
offtime)) {
1176 if (!DNP3ReadUint8(buf,
len, &octet)) {
1179 object->status_code = (octet >> 0) & 0x7f;
1180 object->reserved = (octet >> 7) & 0x1;
1183 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1193 if (
object != NULL) {
1200 static int DNP3DecodeObjectG12V2(
const uint8_t **buf, uint32_t *
len,
1201 uint8_t prefix_code, uint32_t start, uint32_t count,
1202 DNP3PointList *points)
1205 uint32_t prefix = 0;
1206 uint32_t point_index = start;
1208 if (*
len < count/8) {
1213 object =
SCCalloc(1,
sizeof(*
object));
1218 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1224 if (!DNP3ReadUint8(buf,
len, &octet)) {
1227 object->op_type = (octet >> 0) & 0xf;
1228 object->qu = (octet >> 4) & 0x1;
1229 object->cr = (octet >> 5) & 0x1;
1230 object->tcc = (octet >> 6) & 0x3;
1232 if (!DNP3ReadUint8(buf,
len, &object->
count)) {
1235 if (!DNP3ReadUint32(buf,
len, &object->
ontime)) {
1238 if (!DNP3ReadUint32(buf,
len, &object->
offtime)) {
1243 if (!DNP3ReadUint8(buf,
len, &octet)) {
1246 object->status_code = (octet >> 0) & 0x7f;
1247 object->reserved = (octet >> 7) & 0x1;
1250 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1260 if (
object != NULL) {
1267 static int DNP3DecodeObjectG12V3(
const uint8_t **buf, uint32_t *
len,
1268 uint8_t prefix_code, uint32_t start, uint32_t count,
1269 DNP3PointList *points)
1272 uint32_t bytes = (count / 8) + 1;
1273 uint32_t prefix = 0;
1274 uint32_t point_index = start;
1276 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1280 for (uint32_t i = 0; i < bytes; i++) {
1284 if (!DNP3ReadUint8(buf,
len, &octet)) {
1288 for (
int j = 0; j < 8 && count; j = j + 1) {
1290 object =
SCCalloc(1,
sizeof(*
object));
1295 object->point = (octet >> j) & 0x1;
1297 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1310 if (
object != NULL) {
1316 static int DNP3DecodeObjectG13V1(
const uint8_t **buf, uint32_t *
len,
1317 uint8_t prefix_code, uint32_t start, uint32_t count,
1318 DNP3PointList *points)
1321 uint32_t prefix = 0;
1322 uint32_t point_index = start;
1324 if (*
len < count/8) {
1329 object =
SCCalloc(1,
sizeof(*
object));
1334 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1340 if (!DNP3ReadUint8(buf,
len, &octet)) {
1343 object->status_code = (octet >> 0) & 0x7f;
1344 object->commanded_state = (octet >> 7) & 0x1;
1347 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1357 if (
object != NULL) {
1364 static int DNP3DecodeObjectG13V2(
const uint8_t **buf, uint32_t *
len,
1365 uint8_t prefix_code, uint32_t start, uint32_t count,
1366 DNP3PointList *points)
1369 uint32_t prefix = 0;
1370 uint32_t point_index = start;
1372 if (*
len < count/8) {
1377 object =
SCCalloc(1,
sizeof(*
object));
1382 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1388 if (!DNP3ReadUint8(buf,
len, &octet)) {
1391 object->status_code = (octet >> 0) & 0x7f;
1392 object->commanded_state = (octet >> 7) & 0x1;
1398 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1408 if (
object != NULL) {
1415 static int DNP3DecodeObjectG20V1(
const uint8_t **buf, uint32_t *
len,
1416 uint8_t prefix_code, uint32_t start, uint32_t count,
1417 DNP3PointList *points)
1420 uint32_t prefix = 0;
1421 uint32_t point_index = start;
1423 if (*
len < count/8) {
1428 object =
SCCalloc(1,
sizeof(*
object));
1433 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1439 if (!DNP3ReadUint8(buf,
len, &octet)) {
1442 object->online = (octet >> 0) & 0x1;
1443 object->restart = (octet >> 1) & 0x1;
1444 object->comm_lost = (octet >> 2) & 0x1;
1445 object->remote_forced = (octet >> 3) & 0x1;
1446 object->local_forced = (octet >> 4) & 0x1;
1447 object->rollover = (octet >> 5) & 0x1;
1448 object->discontinuity = (octet >> 6) & 0x1;
1449 object->reserved0 = (octet >> 7) & 0x1;
1451 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
1455 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1465 if (
object != NULL) {
1472 static int DNP3DecodeObjectG20V2(
const uint8_t **buf, uint32_t *
len,
1473 uint8_t prefix_code, uint32_t start, uint32_t count,
1474 DNP3PointList *points)
1477 uint32_t prefix = 0;
1478 uint32_t point_index = start;
1480 if (*
len < count/8) {
1485 object =
SCCalloc(1,
sizeof(*
object));
1490 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1496 if (!DNP3ReadUint8(buf,
len, &octet)) {
1499 object->online = (octet >> 0) & 0x1;
1500 object->restart = (octet >> 1) & 0x1;
1501 object->comm_lost = (octet >> 2) & 0x1;
1502 object->remote_forced = (octet >> 3) & 0x1;
1503 object->local_forced = (octet >> 4) & 0x1;
1504 object->rollover = (octet >> 5) & 0x1;
1505 object->discontinuity = (octet >> 6) & 0x1;
1506 object->reserved0 = (octet >> 7) & 0x1;
1508 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
1512 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1522 if (
object != NULL) {
1529 static int DNP3DecodeObjectG20V3(
const uint8_t **buf, uint32_t *
len,
1530 uint8_t prefix_code, uint32_t start, uint32_t count,
1531 DNP3PointList *points)
1534 uint32_t prefix = 0;
1535 uint32_t point_index = start;
1537 if (*
len < count/8) {
1542 object =
SCCalloc(1,
sizeof(*
object));
1547 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1553 if (!DNP3ReadUint8(buf,
len, &octet)) {
1556 object->online = (octet >> 0) & 0x1;
1557 object->restart = (octet >> 1) & 0x1;
1558 object->comm_lost = (octet >> 2) & 0x1;
1559 object->remote_forced = (octet >> 3) & 0x1;
1560 object->local_forced = (octet >> 4) & 0x1;
1561 object->rollover = (octet >> 5) & 0x1;
1562 object->reserved0 = (octet >> 6) & 0x1;
1563 object->reserved1 = (octet >> 7) & 0x1;
1565 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
1569 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1579 if (
object != NULL) {
1586 static int DNP3DecodeObjectG20V4(
const uint8_t **buf, uint32_t *
len,
1587 uint8_t prefix_code, uint32_t start, uint32_t count,
1588 DNP3PointList *points)
1591 uint32_t prefix = 0;
1592 uint32_t point_index = start;
1594 if (*
len < count/8) {
1599 object =
SCCalloc(1,
sizeof(*
object));
1604 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1610 if (!DNP3ReadUint8(buf,
len, &octet)) {
1613 object->online = (octet >> 0) & 0x1;
1614 object->restart = (octet >> 1) & 0x1;
1615 object->comm_lost = (octet >> 2) & 0x1;
1616 object->remote_forced = (octet >> 3) & 0x1;
1617 object->local_forced = (octet >> 4) & 0x1;
1618 object->rollover = (octet >> 5) & 0x1;
1619 object->reserved0 = (octet >> 6) & 0x1;
1620 object->reserved1 = (octet >> 7) & 0x1;
1622 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
1626 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1636 if (
object != NULL) {
1643 static int DNP3DecodeObjectG20V5(
const uint8_t **buf, uint32_t *
len,
1644 uint8_t prefix_code, uint32_t start, uint32_t count,
1645 DNP3PointList *points)
1648 uint32_t prefix = 0;
1649 uint32_t point_index = start;
1651 if (*
len < count/8) {
1656 object =
SCCalloc(1,
sizeof(*
object));
1661 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1665 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
1669 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1679 if (
object != NULL) {
1686 static int DNP3DecodeObjectG20V6(
const uint8_t **buf, uint32_t *
len,
1687 uint8_t prefix_code, uint32_t start, uint32_t count,
1688 DNP3PointList *points)
1691 uint32_t prefix = 0;
1692 uint32_t point_index = start;
1694 if (*
len < count/8) {
1699 object =
SCCalloc(1,
sizeof(*
object));
1704 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1708 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
1712 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1722 if (
object != NULL) {
1729 static int DNP3DecodeObjectG20V7(
const uint8_t **buf, uint32_t *
len,
1730 uint8_t prefix_code, uint32_t start, uint32_t count,
1731 DNP3PointList *points)
1734 uint32_t prefix = 0;
1735 uint32_t point_index = start;
1737 if (*
len < count/8) {
1742 object =
SCCalloc(1,
sizeof(*
object));
1747 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1751 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
1755 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1765 if (
object != NULL) {
1772 static int DNP3DecodeObjectG20V8(
const uint8_t **buf, uint32_t *
len,
1773 uint8_t prefix_code, uint32_t start, uint32_t count,
1774 DNP3PointList *points)
1777 uint32_t prefix = 0;
1778 uint32_t point_index = start;
1780 if (*
len < count/8) {
1785 object =
SCCalloc(1,
sizeof(*
object));
1790 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1794 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
1798 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1808 if (
object != NULL) {
1815 static int DNP3DecodeObjectG21V1(
const uint8_t **buf, uint32_t *
len,
1816 uint8_t prefix_code, uint32_t start, uint32_t count,
1817 DNP3PointList *points)
1820 uint32_t prefix = 0;
1821 uint32_t point_index = start;
1823 if (*
len < count/8) {
1828 object =
SCCalloc(1,
sizeof(*
object));
1833 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1839 if (!DNP3ReadUint8(buf,
len, &octet)) {
1842 object->online = (octet >> 0) & 0x1;
1843 object->restart = (octet >> 1) & 0x1;
1844 object->comm_lost = (octet >> 2) & 0x1;
1845 object->remote_forced = (octet >> 3) & 0x1;
1846 object->local_forced = (octet >> 4) & 0x1;
1847 object->rollover = (octet >> 5) & 0x1;
1848 object->discontinuity = (octet >> 6) & 0x1;
1849 object->reserved0 = (octet >> 7) & 0x1;
1851 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
1855 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1865 if (
object != NULL) {
1872 static int DNP3DecodeObjectG21V2(
const uint8_t **buf, uint32_t *
len,
1873 uint8_t prefix_code, uint32_t start, uint32_t count,
1874 DNP3PointList *points)
1877 uint32_t prefix = 0;
1878 uint32_t point_index = start;
1880 if (*
len < count/8) {
1885 object =
SCCalloc(1,
sizeof(*
object));
1890 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1896 if (!DNP3ReadUint8(buf,
len, &octet)) {
1899 object->online = (octet >> 0) & 0x1;
1900 object->restart = (octet >> 1) & 0x1;
1901 object->comm_lost = (octet >> 2) & 0x1;
1902 object->remote_forced = (octet >> 3) & 0x1;
1903 object->local_forced = (octet >> 4) & 0x1;
1904 object->rollover = (octet >> 5) & 0x1;
1905 object->discontinuity = (octet >> 6) & 0x1;
1906 object->reserved0 = (octet >> 7) & 0x1;
1908 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
1912 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1922 if (
object != NULL) {
1929 static int DNP3DecodeObjectG21V3(
const uint8_t **buf, uint32_t *
len,
1930 uint8_t prefix_code, uint32_t start, uint32_t count,
1931 DNP3PointList *points)
1934 uint32_t prefix = 0;
1935 uint32_t point_index = start;
1937 if (*
len < count/8) {
1942 object =
SCCalloc(1,
sizeof(*
object));
1947 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
1953 if (!DNP3ReadUint8(buf,
len, &octet)) {
1956 object->online = (octet >> 0) & 0x1;
1957 object->restart = (octet >> 1) & 0x1;
1958 object->comm_lost = (octet >> 2) & 0x1;
1959 object->remote_forced = (octet >> 3) & 0x1;
1960 object->local_forced = (octet >> 4) & 0x1;
1961 object->rollover = (octet >> 5) & 0x1;
1962 object->reserved0 = (octet >> 6) & 0x1;
1963 object->reserved1 = (octet >> 7) & 0x1;
1965 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
1969 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
1979 if (
object != NULL) {
1986 static int DNP3DecodeObjectG21V4(
const uint8_t **buf, uint32_t *
len,
1987 uint8_t prefix_code, uint32_t start, uint32_t count,
1988 DNP3PointList *points)
1991 uint32_t prefix = 0;
1992 uint32_t point_index = start;
1994 if (*
len < count/8) {
1999 object =
SCCalloc(1,
sizeof(*
object));
2004 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2010 if (!DNP3ReadUint8(buf,
len, &octet)) {
2013 object->online = (octet >> 0) & 0x1;
2014 object->restart = (octet >> 1) & 0x1;
2015 object->comm_lost = (octet >> 2) & 0x1;
2016 object->remote_forced = (octet >> 3) & 0x1;
2017 object->local_forced = (octet >> 4) & 0x1;
2018 object->rollover = (octet >> 5) & 0x1;
2019 object->reserved0 = (octet >> 6) & 0x1;
2020 object->reserved1 = (octet >> 7) & 0x1;
2022 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2026 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2036 if (
object != NULL) {
2043 static int DNP3DecodeObjectG21V5(
const uint8_t **buf, uint32_t *
len,
2044 uint8_t prefix_code, uint32_t start, uint32_t count,
2045 DNP3PointList *points)
2048 uint32_t prefix = 0;
2049 uint32_t point_index = start;
2051 if (*
len < count/8) {
2056 object =
SCCalloc(1,
sizeof(*
object));
2061 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2067 if (!DNP3ReadUint8(buf,
len, &octet)) {
2070 object->online = (octet >> 0) & 0x1;
2071 object->restart = (octet >> 1) & 0x1;
2072 object->comm_lost = (octet >> 2) & 0x1;
2073 object->remote_forced = (octet >> 3) & 0x1;
2074 object->local_forced = (octet >> 4) & 0x1;
2075 object->rollover = (octet >> 5) & 0x1;
2076 object->discontinuity = (octet >> 6) & 0x1;
2077 object->reserved1 = (octet >> 7) & 0x1;
2079 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2086 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2096 if (
object != NULL) {
2103 static int DNP3DecodeObjectG21V6(
const uint8_t **buf, uint32_t *
len,
2104 uint8_t prefix_code, uint32_t start, uint32_t count,
2105 DNP3PointList *points)
2108 uint32_t prefix = 0;
2109 uint32_t point_index = start;
2111 if (*
len < count/8) {
2116 object =
SCCalloc(1,
sizeof(*
object));
2121 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2127 if (!DNP3ReadUint8(buf,
len, &octet)) {
2130 object->online = (octet >> 0) & 0x1;
2131 object->restart = (octet >> 1) & 0x1;
2132 object->comm_lost = (octet >> 2) & 0x1;
2133 object->remote_forced = (octet >> 3) & 0x1;
2134 object->local_forced = (octet >> 4) & 0x1;
2135 object->rollover = (octet >> 5) & 0x1;
2136 object->discontinuity = (octet >> 6) & 0x1;
2137 object->reserved1 = (octet >> 7) & 0x1;
2139 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2146 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2156 if (
object != NULL) {
2163 static int DNP3DecodeObjectG21V7(
const uint8_t **buf, uint32_t *
len,
2164 uint8_t prefix_code, uint32_t start, uint32_t count,
2165 DNP3PointList *points)
2168 uint32_t prefix = 0;
2169 uint32_t point_index = start;
2171 if (*
len < count/8) {
2176 object =
SCCalloc(1,
sizeof(*
object));
2181 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2187 if (!DNP3ReadUint8(buf,
len, &octet)) {
2190 object->online = (octet >> 0) & 0x1;
2191 object->restart = (octet >> 1) & 0x1;
2192 object->comm_lost = (octet >> 2) & 0x1;
2193 object->remote_forced = (octet >> 3) & 0x1;
2194 object->local_forced = (octet >> 4) & 0x1;
2195 object->rollover = (octet >> 5) & 0x1;
2196 object->reserved0 = (octet >> 6) & 0x1;
2197 object->reserved1 = (octet >> 7) & 0x1;
2199 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2206 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2216 if (
object != NULL) {
2223 static int DNP3DecodeObjectG21V8(
const uint8_t **buf, uint32_t *
len,
2224 uint8_t prefix_code, uint32_t start, uint32_t count,
2225 DNP3PointList *points)
2228 uint32_t prefix = 0;
2229 uint32_t point_index = start;
2231 if (*
len < count/8) {
2236 object =
SCCalloc(1,
sizeof(*
object));
2241 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2247 if (!DNP3ReadUint8(buf,
len, &octet)) {
2250 object->online = (octet >> 0) & 0x1;
2251 object->restart = (octet >> 1) & 0x1;
2252 object->comm_lost = (octet >> 2) & 0x1;
2253 object->remote_forced = (octet >> 3) & 0x1;
2254 object->local_forced = (octet >> 4) & 0x1;
2255 object->rollover = (octet >> 5) & 0x1;
2256 object->reserved0 = (octet >> 6) & 0x1;
2257 object->reserved1 = (octet >> 7) & 0x1;
2259 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2266 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2276 if (
object != NULL) {
2283 static int DNP3DecodeObjectG21V9(
const uint8_t **buf, uint32_t *
len,
2284 uint8_t prefix_code, uint32_t start, uint32_t count,
2285 DNP3PointList *points)
2288 uint32_t prefix = 0;
2289 uint32_t point_index = start;
2291 if (*
len < count/8) {
2296 object =
SCCalloc(1,
sizeof(*
object));
2301 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2305 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2309 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2319 if (
object != NULL) {
2326 static int DNP3DecodeObjectG21V10(
const uint8_t **buf, uint32_t *
len,
2327 uint8_t prefix_code, uint32_t start, uint32_t count,
2328 DNP3PointList *points)
2331 uint32_t prefix = 0;
2332 uint32_t point_index = start;
2334 if (*
len < count/8) {
2339 object =
SCCalloc(1,
sizeof(*
object));
2344 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2348 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2352 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2362 if (
object != NULL) {
2369 static int DNP3DecodeObjectG21V11(
const uint8_t **buf, uint32_t *
len,
2370 uint8_t prefix_code, uint32_t start, uint32_t count,
2371 DNP3PointList *points)
2374 uint32_t prefix = 0;
2375 uint32_t point_index = start;
2377 if (*
len < count/8) {
2382 object =
SCCalloc(1,
sizeof(*
object));
2387 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2391 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2395 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2405 if (
object != NULL) {
2412 static int DNP3DecodeObjectG21V12(
const uint8_t **buf, uint32_t *
len,
2413 uint8_t prefix_code, uint32_t start, uint32_t count,
2414 DNP3PointList *points)
2417 uint32_t prefix = 0;
2418 uint32_t point_index = start;
2420 if (*
len < count/8) {
2425 object =
SCCalloc(1,
sizeof(*
object));
2430 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2434 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2438 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2448 if (
object != NULL) {
2455 static int DNP3DecodeObjectG22V1(
const uint8_t **buf, uint32_t *
len,
2456 uint8_t prefix_code, uint32_t start, uint32_t count,
2457 DNP3PointList *points)
2460 uint32_t prefix = 0;
2461 uint32_t point_index = start;
2463 if (*
len < count/8) {
2468 object =
SCCalloc(1,
sizeof(*
object));
2473 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2479 if (!DNP3ReadUint8(buf,
len, &octet)) {
2482 object->online = (octet >> 0) & 0x1;
2483 object->restart = (octet >> 1) & 0x1;
2484 object->comm_lost = (octet >> 2) & 0x1;
2485 object->remote_forced = (octet >> 3) & 0x1;
2486 object->local_forced = (octet >> 4) & 0x1;
2487 object->rollover = (octet >> 5) & 0x1;
2488 object->discontinuity = (octet >> 6) & 0x1;
2489 object->reserved0 = (octet >> 7) & 0x1;
2491 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2495 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2505 if (
object != NULL) {
2512 static int DNP3DecodeObjectG22V2(
const uint8_t **buf, uint32_t *
len,
2513 uint8_t prefix_code, uint32_t start, uint32_t count,
2514 DNP3PointList *points)
2517 uint32_t prefix = 0;
2518 uint32_t point_index = start;
2520 if (*
len < count/8) {
2525 object =
SCCalloc(1,
sizeof(*
object));
2530 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2536 if (!DNP3ReadUint8(buf,
len, &octet)) {
2539 object->online = (octet >> 0) & 0x1;
2540 object->restart = (octet >> 1) & 0x1;
2541 object->comm_lost = (octet >> 2) & 0x1;
2542 object->remote_forced = (octet >> 3) & 0x1;
2543 object->local_forced = (octet >> 4) & 0x1;
2544 object->rollover = (octet >> 5) & 0x1;
2545 object->discontinuity = (octet >> 6) & 0x1;
2546 object->reserved0 = (octet >> 7) & 0x1;
2548 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2552 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2562 if (
object != NULL) {
2569 static int DNP3DecodeObjectG22V3(
const uint8_t **buf, uint32_t *
len,
2570 uint8_t prefix_code, uint32_t start, uint32_t count,
2571 DNP3PointList *points)
2574 uint32_t prefix = 0;
2575 uint32_t point_index = start;
2577 if (*
len < count/8) {
2582 object =
SCCalloc(1,
sizeof(*
object));
2587 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2593 if (!DNP3ReadUint8(buf,
len, &octet)) {
2596 object->online = (octet >> 0) & 0x1;
2597 object->restart = (octet >> 1) & 0x1;
2598 object->comm_lost = (octet >> 2) & 0x1;
2599 object->remote_forced = (octet >> 3) & 0x1;
2600 object->local_forced = (octet >> 4) & 0x1;
2601 object->rollover = (octet >> 5) & 0x1;
2602 object->reserved0 = (octet >> 6) & 0x1;
2603 object->reserved1 = (octet >> 7) & 0x1;
2605 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2609 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2619 if (
object != NULL) {
2626 static int DNP3DecodeObjectG22V4(
const uint8_t **buf, uint32_t *
len,
2627 uint8_t prefix_code, uint32_t start, uint32_t count,
2628 DNP3PointList *points)
2631 uint32_t prefix = 0;
2632 uint32_t point_index = start;
2634 if (*
len < count/8) {
2639 object =
SCCalloc(1,
sizeof(*
object));
2644 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2650 if (!DNP3ReadUint8(buf,
len, &octet)) {
2653 object->online = (octet >> 0) & 0x1;
2654 object->restart = (octet >> 1) & 0x1;
2655 object->comm_lost = (octet >> 2) & 0x1;
2656 object->remote_forced = (octet >> 3) & 0x1;
2657 object->local_forced = (octet >> 4) & 0x1;
2658 object->rollover = (octet >> 5) & 0x1;
2659 object->reserved0 = (octet >> 6) & 0x1;
2660 object->reserved1 = (octet >> 7) & 0x1;
2662 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2666 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2676 if (
object != NULL) {
2683 static int DNP3DecodeObjectG22V5(
const uint8_t **buf, uint32_t *
len,
2684 uint8_t prefix_code, uint32_t start, uint32_t count,
2685 DNP3PointList *points)
2688 uint32_t prefix = 0;
2689 uint32_t point_index = start;
2691 if (*
len < count/8) {
2696 object =
SCCalloc(1,
sizeof(*
object));
2701 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2707 if (!DNP3ReadUint8(buf,
len, &octet)) {
2710 object->online = (octet >> 0) & 0x1;
2711 object->restart = (octet >> 1) & 0x1;
2712 object->comm_lost = (octet >> 2) & 0x1;
2713 object->remote_forced = (octet >> 3) & 0x1;
2714 object->local_forced = (octet >> 4) & 0x1;
2715 object->rollover = (octet >> 5) & 0x1;
2716 object->reserved0 = (octet >> 6) & 0x1;
2717 object->reserved1 = (octet >> 7) & 0x1;
2719 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2726 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2736 if (
object != NULL) {
2743 static int DNP3DecodeObjectG22V6(
const uint8_t **buf, uint32_t *
len,
2744 uint8_t prefix_code, uint32_t start, uint32_t count,
2745 DNP3PointList *points)
2748 uint32_t prefix = 0;
2749 uint32_t point_index = start;
2751 if (*
len < count/8) {
2756 object =
SCCalloc(1,
sizeof(*
object));
2761 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2767 if (!DNP3ReadUint8(buf,
len, &octet)) {
2770 object->online = (octet >> 0) & 0x1;
2771 object->restart = (octet >> 1) & 0x1;
2772 object->comm_lost = (octet >> 2) & 0x1;
2773 object->remote_forced = (octet >> 3) & 0x1;
2774 object->local_forced = (octet >> 4) & 0x1;
2775 object->rollover = (octet >> 5) & 0x1;
2776 object->discontinuity = (octet >> 6) & 0x1;
2777 object->reserved0 = (octet >> 7) & 0x1;
2779 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2786 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2796 if (
object != NULL) {
2803 static int DNP3DecodeObjectG22V7(
const uint8_t **buf, uint32_t *
len,
2804 uint8_t prefix_code, uint32_t start, uint32_t count,
2805 DNP3PointList *points)
2808 uint32_t prefix = 0;
2809 uint32_t point_index = start;
2811 if (*
len < count/8) {
2816 object =
SCCalloc(1,
sizeof(*
object));
2821 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2827 if (!DNP3ReadUint8(buf,
len, &octet)) {
2830 object->online = (octet >> 0) & 0x1;
2831 object->restart = (octet >> 1) & 0x1;
2832 object->comm_lost = (octet >> 2) & 0x1;
2833 object->remote_forced = (octet >> 3) & 0x1;
2834 object->local_forced = (octet >> 4) & 0x1;
2835 object->rollover = (octet >> 5) & 0x1;
2836 object->reserved0 = (octet >> 6) & 0x1;
2837 object->reserved1 = (octet >> 7) & 0x1;
2839 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2846 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2856 if (
object != NULL) {
2863 static int DNP3DecodeObjectG22V8(
const uint8_t **buf, uint32_t *
len,
2864 uint8_t prefix_code, uint32_t start, uint32_t count,
2865 DNP3PointList *points)
2868 uint32_t prefix = 0;
2869 uint32_t point_index = start;
2871 if (*
len < count/8) {
2876 object =
SCCalloc(1,
sizeof(*
object));
2881 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2887 if (!DNP3ReadUint8(buf,
len, &octet)) {
2890 object->online = (octet >> 0) & 0x1;
2891 object->restart = (octet >> 1) & 0x1;
2892 object->comm_lost = (octet >> 2) & 0x1;
2893 object->remote_forced = (octet >> 3) & 0x1;
2894 object->local_forced = (octet >> 4) & 0x1;
2895 object->rollover = (octet >> 5) & 0x1;
2896 object->reserved0 = (octet >> 6) & 0x1;
2897 object->reserved1 = (octet >> 7) & 0x1;
2899 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
2906 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2916 if (
object != NULL) {
2923 static int DNP3DecodeObjectG23V1(
const uint8_t **buf, uint32_t *
len,
2924 uint8_t prefix_code, uint32_t start, uint32_t count,
2925 DNP3PointList *points)
2928 uint32_t prefix = 0;
2929 uint32_t point_index = start;
2931 if (*
len < count/8) {
2936 object =
SCCalloc(1,
sizeof(*
object));
2941 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
2947 if (!DNP3ReadUint8(buf,
len, &octet)) {
2950 object->online = (octet >> 0) & 0x1;
2951 object->restart = (octet >> 1) & 0x1;
2952 object->comm_lost = (octet >> 2) & 0x1;
2953 object->remote_forced = (octet >> 3) & 0x1;
2954 object->local_forced = (octet >> 4) & 0x1;
2955 object->rollover = (octet >> 5) & 0x1;
2956 object->discontinuity = (octet >> 6) & 0x1;
2957 object->reserved0 = (octet >> 7) & 0x1;
2959 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
2963 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
2973 if (
object != NULL) {
2980 static int DNP3DecodeObjectG23V2(
const uint8_t **buf, uint32_t *
len,
2981 uint8_t prefix_code, uint32_t start, uint32_t count,
2982 DNP3PointList *points)
2985 uint32_t prefix = 0;
2986 uint32_t point_index = start;
2988 if (*
len < count/8) {
2993 object =
SCCalloc(1,
sizeof(*
object));
2998 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3004 if (!DNP3ReadUint8(buf,
len, &octet)) {
3007 object->online = (octet >> 0) & 0x1;
3008 object->restart = (octet >> 1) & 0x1;
3009 object->comm_lost = (octet >> 2) & 0x1;
3010 object->remote_forced = (octet >> 3) & 0x1;
3011 object->local_forced = (octet >> 4) & 0x1;
3012 object->rollover = (octet >> 5) & 0x1;
3013 object->reserved0 = (octet >> 6) & 0x1;
3014 object->reserved1 = (octet >> 7) & 0x1;
3016 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
3020 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3030 if (
object != NULL) {
3037 static int DNP3DecodeObjectG23V3(
const uint8_t **buf, uint32_t *
len,
3038 uint8_t prefix_code, uint32_t start, uint32_t count,
3039 DNP3PointList *points)
3042 uint32_t prefix = 0;
3043 uint32_t point_index = start;
3045 if (*
len < count/8) {
3050 object =
SCCalloc(1,
sizeof(*
object));
3055 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3061 if (!DNP3ReadUint8(buf,
len, &octet)) {
3064 object->online = (octet >> 0) & 0x1;
3065 object->restart = (octet >> 1) & 0x1;
3066 object->comm_lost = (octet >> 2) & 0x1;
3067 object->remote_forced = (octet >> 3) & 0x1;
3068 object->local_forced = (octet >> 4) & 0x1;
3069 object->rollover = (octet >> 5) & 0x1;
3070 object->reserved0 = (octet >> 6) & 0x1;
3071 object->reserved1 = (octet >> 7) & 0x1;
3073 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
3077 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3087 if (
object != NULL) {
3094 static int DNP3DecodeObjectG23V4(
const uint8_t **buf, uint32_t *
len,
3095 uint8_t prefix_code, uint32_t start, uint32_t count,
3096 DNP3PointList *points)
3099 uint32_t prefix = 0;
3100 uint32_t point_index = start;
3102 if (*
len < count/8) {
3107 object =
SCCalloc(1,
sizeof(*
object));
3112 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3118 if (!DNP3ReadUint8(buf,
len, &octet)) {
3121 object->online = (octet >> 0) & 0x1;
3122 object->restart = (octet >> 1) & 0x1;
3123 object->comm_lost = (octet >> 2) & 0x1;
3124 object->remote_forced = (octet >> 3) & 0x1;
3125 object->local_forced = (octet >> 4) & 0x1;
3126 object->rollover = (octet >> 5) & 0x1;
3127 object->reserved0 = (octet >> 6) & 0x1;
3128 object->reserved1 = (octet >> 7) & 0x1;
3130 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
3134 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3144 if (
object != NULL) {
3151 static int DNP3DecodeObjectG23V5(
const uint8_t **buf, uint32_t *
len,
3152 uint8_t prefix_code, uint32_t start, uint32_t count,
3153 DNP3PointList *points)
3156 uint32_t prefix = 0;
3157 uint32_t point_index = start;
3159 if (*
len < count/8) {
3164 object =
SCCalloc(1,
sizeof(*
object));
3169 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3175 if (!DNP3ReadUint8(buf,
len, &octet)) {
3178 object->online = (octet >> 0) & 0x1;
3179 object->restart = (octet >> 1) & 0x1;
3180 object->comm_lost = (octet >> 2) & 0x1;
3181 object->remote_forced = (octet >> 3) & 0x1;
3182 object->local_forced = (octet >> 4) & 0x1;
3183 object->rollover = (octet >> 5) & 0x1;
3184 object->discontinuity = (octet >> 6) & 0x1;
3185 object->reserved0 = (octet >> 7) & 0x1;
3187 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
3194 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3204 if (
object != NULL) {
3211 static int DNP3DecodeObjectG23V6(
const uint8_t **buf, uint32_t *
len,
3212 uint8_t prefix_code, uint32_t start, uint32_t count,
3213 DNP3PointList *points)
3216 uint32_t prefix = 0;
3217 uint32_t point_index = start;
3219 if (*
len < count/8) {
3224 object =
SCCalloc(1,
sizeof(*
object));
3229 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3235 if (!DNP3ReadUint8(buf,
len, &octet)) {
3238 object->online = (octet >> 0) & 0x1;
3239 object->restart = (octet >> 1) & 0x1;
3240 object->comm_lost = (octet >> 2) & 0x1;
3241 object->remote_forced = (octet >> 3) & 0x1;
3242 object->local_forced = (octet >> 4) & 0x1;
3243 object->rollover = (octet >> 5) & 0x1;
3244 object->discontinuity = (octet >> 6) & 0x1;
3245 object->reserved0 = (octet >> 7) & 0x1;
3247 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
3254 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3264 if (
object != NULL) {
3271 static int DNP3DecodeObjectG23V7(
const uint8_t **buf, uint32_t *
len,
3272 uint8_t prefix_code, uint32_t start, uint32_t count,
3273 DNP3PointList *points)
3276 uint32_t prefix = 0;
3277 uint32_t point_index = start;
3279 if (*
len < count/8) {
3284 object =
SCCalloc(1,
sizeof(*
object));
3289 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3295 if (!DNP3ReadUint8(buf,
len, &octet)) {
3298 object->online = (octet >> 0) & 0x1;
3299 object->restart = (octet >> 1) & 0x1;
3300 object->comm_lost = (octet >> 2) & 0x1;
3301 object->remote_forced = (octet >> 3) & 0x1;
3302 object->local_forced = (octet >> 4) & 0x1;
3303 object->rollover = (octet >> 5) & 0x1;
3304 object->reserved0 = (octet >> 6) & 0x1;
3305 object->reserved1 = (octet >> 7) & 0x1;
3307 if (!DNP3ReadUint32(buf,
len, &object->
count)) {
3314 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3324 if (
object != NULL) {
3331 static int DNP3DecodeObjectG23V8(
const uint8_t **buf, uint32_t *
len,
3332 uint8_t prefix_code, uint32_t start, uint32_t count,
3333 DNP3PointList *points)
3336 uint32_t prefix = 0;
3337 uint32_t point_index = start;
3339 if (*
len < count/8) {
3344 object =
SCCalloc(1,
sizeof(*
object));
3349 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3355 if (!DNP3ReadUint8(buf,
len, &octet)) {
3358 object->online = (octet >> 0) & 0x1;
3359 object->restart = (octet >> 1) & 0x1;
3360 object->comm_lost = (octet >> 2) & 0x1;
3361 object->remote_forced = (octet >> 3) & 0x1;
3362 object->local_forced = (octet >> 4) & 0x1;
3363 object->rollover = (octet >> 5) & 0x1;
3364 object->reserved0 = (octet >> 6) & 0x1;
3365 object->reserved1 = (octet >> 7) & 0x1;
3367 if (!DNP3ReadUint16(buf,
len, &object->
count)) {
3374 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3384 if (
object != NULL) {
3391 static int DNP3DecodeObjectG30V1(
const uint8_t **buf, uint32_t *
len,
3392 uint8_t prefix_code, uint32_t start, uint32_t count,
3393 DNP3PointList *points)
3396 uint32_t prefix = 0;
3397 uint32_t point_index = start;
3399 if (*
len < count/8) {
3404 object =
SCCalloc(1,
sizeof(*
object));
3409 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3415 if (!DNP3ReadUint8(buf,
len, &octet)) {
3418 object->online = (octet >> 0) & 0x1;
3419 object->restart = (octet >> 1) & 0x1;
3420 object->comm_lost = (octet >> 2) & 0x1;
3421 object->remote_forced = (octet >> 3) & 0x1;
3422 object->local_forced = (octet >> 4) & 0x1;
3423 object->over_range = (octet >> 5) & 0x1;
3424 object->reference_err = (octet >> 6) & 0x1;
3425 object->reserved0 = (octet >> 7) & 0x1;
3427 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
3431 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3441 if (
object != NULL) {
3448 static int DNP3DecodeObjectG30V2(
const uint8_t **buf, uint32_t *
len,
3449 uint8_t prefix_code, uint32_t start, uint32_t count,
3450 DNP3PointList *points)
3453 uint32_t prefix = 0;
3454 uint32_t point_index = start;
3456 if (*
len < count/8) {
3461 object =
SCCalloc(1,
sizeof(*
object));
3466 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3472 if (!DNP3ReadUint8(buf,
len, &octet)) {
3475 object->online = (octet >> 0) & 0x1;
3476 object->restart = (octet >> 1) & 0x1;
3477 object->comm_lost = (octet >> 2) & 0x1;
3478 object->remote_forced = (octet >> 3) & 0x1;
3479 object->local_forced = (octet >> 4) & 0x1;
3480 object->over_range = (octet >> 5) & 0x1;
3481 object->reference_err = (octet >> 6) & 0x1;
3482 object->reserved0 = (octet >> 7) & 0x1;
3484 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
3488 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3498 if (
object != NULL) {
3505 static int DNP3DecodeObjectG30V3(
const uint8_t **buf, uint32_t *
len,
3506 uint8_t prefix_code, uint32_t start, uint32_t count,
3507 DNP3PointList *points)
3510 uint32_t prefix = 0;
3511 uint32_t point_index = start;
3513 if (*
len < count/8) {
3518 object =
SCCalloc(1,
sizeof(*
object));
3523 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3527 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&object->
value)) {
3531 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3541 if (
object != NULL) {
3548 static int DNP3DecodeObjectG30V4(
const uint8_t **buf, uint32_t *
len,
3549 uint8_t prefix_code, uint32_t start, uint32_t count,
3550 DNP3PointList *points)
3553 uint32_t prefix = 0;
3554 uint32_t point_index = start;
3556 if (*
len < count/8) {
3561 object =
SCCalloc(1,
sizeof(*
object));
3566 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3570 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&object->
value)) {
3574 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3584 if (
object != NULL) {
3591 static int DNP3DecodeObjectG30V5(
const uint8_t **buf, uint32_t *
len,
3592 uint8_t prefix_code, uint32_t start, uint32_t count,
3593 DNP3PointList *points)
3596 uint32_t prefix = 0;
3597 uint32_t point_index = start;
3599 if (*
len < count/8) {
3604 object =
SCCalloc(1,
sizeof(*
object));
3609 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3615 if (!DNP3ReadUint8(buf,
len, &octet)) {
3618 object->online = (octet >> 0) & 0x1;
3619 object->restart = (octet >> 1) & 0x1;
3620 object->comm_lost = (octet >> 2) & 0x1;
3621 object->remote_forced = (octet >> 3) & 0x1;
3622 object->local_forced = (octet >> 4) & 0x1;
3623 object->over_range = (octet >> 5) & 0x1;
3624 object->reference_err = (octet >> 6) & 0x1;
3625 object->reserved0 = (octet >> 7) & 0x1;
3627 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
3631 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3641 if (
object != NULL) {
3648 static int DNP3DecodeObjectG30V6(
const uint8_t **buf, uint32_t *
len,
3649 uint8_t prefix_code, uint32_t start, uint32_t count,
3650 DNP3PointList *points)
3653 uint32_t prefix = 0;
3654 uint32_t point_index = start;
3656 if (*
len < count/8) {
3661 object =
SCCalloc(1,
sizeof(*
object));
3666 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3672 if (!DNP3ReadUint8(buf,
len, &octet)) {
3675 object->online = (octet >> 0) & 0x1;
3676 object->restart = (octet >> 1) & 0x1;
3677 object->comm_lost = (octet >> 2) & 0x1;
3678 object->remote_forced = (octet >> 3) & 0x1;
3679 object->local_forced = (octet >> 4) & 0x1;
3680 object->over_range = (octet >> 5) & 0x1;
3681 object->reference_err = (octet >> 6) & 0x1;
3682 object->reserved0 = (octet >> 7) & 0x1;
3684 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
3688 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3698 if (
object != NULL) {
3705 static int DNP3DecodeObjectG31V1(
const uint8_t **buf, uint32_t *
len,
3706 uint8_t prefix_code, uint32_t start, uint32_t count,
3707 DNP3PointList *points)
3710 uint32_t prefix = 0;
3711 uint32_t point_index = start;
3713 if (*
len < count/8) {
3718 object =
SCCalloc(1,
sizeof(*
object));
3723 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3729 if (!DNP3ReadUint8(buf,
len, &octet)) {
3732 object->online = (octet >> 0) & 0x1;
3733 object->restart = (octet >> 1) & 0x1;
3734 object->comm_lost = (octet >> 2) & 0x1;
3735 object->remote_forced = (octet >> 3) & 0x1;
3736 object->local_forced = (octet >> 4) & 0x1;
3737 object->over_range = (octet >> 5) & 0x1;
3738 object->reference_err = (octet >> 6) & 0x1;
3739 object->reserved0 = (octet >> 7) & 0x1;
3741 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
3745 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3755 if (
object != NULL) {
3762 static int DNP3DecodeObjectG31V2(
const uint8_t **buf, uint32_t *
len,
3763 uint8_t prefix_code, uint32_t start, uint32_t count,
3764 DNP3PointList *points)
3767 uint32_t prefix = 0;
3768 uint32_t point_index = start;
3770 if (*
len < count/8) {
3775 object =
SCCalloc(1,
sizeof(*
object));
3780 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3786 if (!DNP3ReadUint8(buf,
len, &octet)) {
3789 object->online = (octet >> 0) & 0x1;
3790 object->restart = (octet >> 1) & 0x1;
3791 object->comm_lost = (octet >> 2) & 0x1;
3792 object->remote_forced = (octet >> 3) & 0x1;
3793 object->local_forced = (octet >> 4) & 0x1;
3794 object->over_range = (octet >> 5) & 0x1;
3795 object->reference_err = (octet >> 6) & 0x1;
3796 object->reserved0 = (octet >> 7) & 0x1;
3798 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
3802 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3812 if (
object != NULL) {
3819 static int DNP3DecodeObjectG31V3(
const uint8_t **buf, uint32_t *
len,
3820 uint8_t prefix_code, uint32_t start, uint32_t count,
3821 DNP3PointList *points)
3824 uint32_t prefix = 0;
3825 uint32_t point_index = start;
3827 if (*
len < count/8) {
3832 object =
SCCalloc(1,
sizeof(*
object));
3837 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3843 if (!DNP3ReadUint8(buf,
len, &octet)) {
3846 object->online = (octet >> 0) & 0x1;
3847 object->restart = (octet >> 1) & 0x1;
3848 object->comm_lost = (octet >> 2) & 0x1;
3849 object->remote_forced = (octet >> 3) & 0x1;
3850 object->local_forced = (octet >> 4) & 0x1;
3851 object->over_range = (octet >> 5) & 0x1;
3852 object->reference_err = (octet >> 6) & 0x1;
3853 object->reserved0 = (octet >> 7) & 0x1;
3855 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
3862 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3872 if (
object != NULL) {
3879 static int DNP3DecodeObjectG31V4(
const uint8_t **buf, uint32_t *
len,
3880 uint8_t prefix_code, uint32_t start, uint32_t count,
3881 DNP3PointList *points)
3884 uint32_t prefix = 0;
3885 uint32_t point_index = start;
3887 if (*
len < count/8) {
3892 object =
SCCalloc(1,
sizeof(*
object));
3897 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3903 if (!DNP3ReadUint8(buf,
len, &octet)) {
3906 object->online = (octet >> 0) & 0x1;
3907 object->restart = (octet >> 1) & 0x1;
3908 object->comm_lost = (octet >> 2) & 0x1;
3909 object->remote_forced = (octet >> 3) & 0x1;
3910 object->local_forced = (octet >> 4) & 0x1;
3911 object->over_range = (octet >> 5) & 0x1;
3912 object->reference_err = (octet >> 6) & 0x1;
3913 object->reserved0 = (octet >> 7) & 0x1;
3915 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
3922 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3932 if (
object != NULL) {
3939 static int DNP3DecodeObjectG31V5(
const uint8_t **buf, uint32_t *
len,
3940 uint8_t prefix_code, uint32_t start, uint32_t count,
3941 DNP3PointList *points)
3944 uint32_t prefix = 0;
3945 uint32_t point_index = start;
3947 if (*
len < count/8) {
3952 object =
SCCalloc(1,
sizeof(*
object));
3957 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
3961 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&object->
value)) {
3965 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
3975 if (
object != NULL) {
3982 static int DNP3DecodeObjectG31V6(
const uint8_t **buf, uint32_t *
len,
3983 uint8_t prefix_code, uint32_t start, uint32_t count,
3984 DNP3PointList *points)
3987 uint32_t prefix = 0;
3988 uint32_t point_index = start;
3990 if (*
len < count/8) {
3995 object =
SCCalloc(1,
sizeof(*
object));
4000 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4004 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&object->
value)) {
4008 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4018 if (
object != NULL) {
4025 static int DNP3DecodeObjectG31V7(
const uint8_t **buf, uint32_t *
len,
4026 uint8_t prefix_code, uint32_t start, uint32_t count,
4027 DNP3PointList *points)
4030 uint32_t prefix = 0;
4031 uint32_t point_index = start;
4033 if (*
len < count/8) {
4038 object =
SCCalloc(1,
sizeof(*
object));
4043 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4049 if (!DNP3ReadUint8(buf,
len, &octet)) {
4052 object->online = (octet >> 0) & 0x1;
4053 object->restart = (octet >> 1) & 0x1;
4054 object->comm_lost = (octet >> 2) & 0x1;
4055 object->remote_forced = (octet >> 3) & 0x1;
4056 object->local_forced = (octet >> 4) & 0x1;
4057 object->over_range = (octet >> 5) & 0x1;
4058 object->reference_err = (octet >> 6) & 0x1;
4059 object->reserved0 = (octet >> 7) & 0x1;
4061 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
4065 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4075 if (
object != NULL) {
4082 static int DNP3DecodeObjectG31V8(
const uint8_t **buf, uint32_t *
len,
4083 uint8_t prefix_code, uint32_t start, uint32_t count,
4084 DNP3PointList *points)
4087 uint32_t prefix = 0;
4088 uint32_t point_index = start;
4090 if (*
len < count/8) {
4095 object =
SCCalloc(1,
sizeof(*
object));
4100 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4106 if (!DNP3ReadUint8(buf,
len, &octet)) {
4109 object->online = (octet >> 0) & 0x1;
4110 object->restart = (octet >> 1) & 0x1;
4111 object->comm_lost = (octet >> 2) & 0x1;
4112 object->remote_forced = (octet >> 3) & 0x1;
4113 object->local_forced = (octet >> 4) & 0x1;
4114 object->over_range = (octet >> 5) & 0x1;
4115 object->reference_err = (octet >> 6) & 0x1;
4116 object->reserved0 = (octet >> 7) & 0x1;
4118 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
4122 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4132 if (
object != NULL) {
4139 static int DNP3DecodeObjectG32V1(
const uint8_t **buf, uint32_t *
len,
4140 uint8_t prefix_code, uint32_t start, uint32_t count,
4141 DNP3PointList *points)
4144 uint32_t prefix = 0;
4145 uint32_t point_index = start;
4147 if (*
len < count/8) {
4152 object =
SCCalloc(1,
sizeof(*
object));
4157 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4163 if (!DNP3ReadUint8(buf,
len, &octet)) {
4166 object->online = (octet >> 0) & 0x1;
4167 object->restart = (octet >> 1) & 0x1;
4168 object->comm_lost = (octet >> 2) & 0x1;
4169 object->remote_forced = (octet >> 3) & 0x1;
4170 object->local_forced = (octet >> 4) & 0x1;
4171 object->over_range = (octet >> 5) & 0x1;
4172 object->reference_err = (octet >> 6) & 0x1;
4173 object->reserved0 = (octet >> 7) & 0x1;
4175 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
4179 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4189 if (
object != NULL) {
4196 static int DNP3DecodeObjectG32V2(
const uint8_t **buf, uint32_t *
len,
4197 uint8_t prefix_code, uint32_t start, uint32_t count,
4198 DNP3PointList *points)
4201 uint32_t prefix = 0;
4202 uint32_t point_index = start;
4204 if (*
len < count/8) {
4209 object =
SCCalloc(1,
sizeof(*
object));
4214 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4220 if (!DNP3ReadUint8(buf,
len, &octet)) {
4223 object->online = (octet >> 0) & 0x1;
4224 object->restart = (octet >> 1) & 0x1;
4225 object->comm_lost = (octet >> 2) & 0x1;
4226 object->remote_forced = (octet >> 3) & 0x1;
4227 object->local_forced = (octet >> 4) & 0x1;
4228 object->over_range = (octet >> 5) & 0x1;
4229 object->reference_err = (octet >> 6) & 0x1;
4230 object->reserved0 = (octet >> 7) & 0x1;
4232 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
4236 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4246 if (
object != NULL) {
4253 static int DNP3DecodeObjectG32V3(
const uint8_t **buf, uint32_t *
len,
4254 uint8_t prefix_code, uint32_t start, uint32_t count,
4255 DNP3PointList *points)
4258 uint32_t prefix = 0;
4259 uint32_t point_index = start;
4261 if (*
len < count/8) {
4266 object =
SCCalloc(1,
sizeof(*
object));
4271 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4277 if (!DNP3ReadUint8(buf,
len, &octet)) {
4280 object->online = (octet >> 0) & 0x1;
4281 object->restart = (octet >> 1) & 0x1;
4282 object->comm_lost = (octet >> 2) & 0x1;
4283 object->remote_forced = (octet >> 3) & 0x1;
4284 object->local_forced = (octet >> 4) & 0x1;
4285 object->over_range = (octet >> 5) & 0x1;
4286 object->reference_err = (octet >> 6) & 0x1;
4287 object->reserved0 = (octet >> 7) & 0x1;
4289 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
4296 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4306 if (
object != NULL) {
4313 static int DNP3DecodeObjectG32V4(
const uint8_t **buf, uint32_t *
len,
4314 uint8_t prefix_code, uint32_t start, uint32_t count,
4315 DNP3PointList *points)
4318 uint32_t prefix = 0;
4319 uint32_t point_index = start;
4321 if (*
len < count/8) {
4326 object =
SCCalloc(1,
sizeof(*
object));
4331 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4337 if (!DNP3ReadUint8(buf,
len, &octet)) {
4340 object->online = (octet >> 0) & 0x1;
4341 object->restart = (octet >> 1) & 0x1;
4342 object->comm_lost = (octet >> 2) & 0x1;
4343 object->remote_forced = (octet >> 3) & 0x1;
4344 object->local_forced = (octet >> 4) & 0x1;
4345 object->over_range = (octet >> 5) & 0x1;
4346 object->reference_err = (octet >> 6) & 0x1;
4347 object->reserved0 = (octet >> 7) & 0x1;
4349 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
4356 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4366 if (
object != NULL) {
4373 static int DNP3DecodeObjectG32V5(
const uint8_t **buf, uint32_t *
len,
4374 uint8_t prefix_code, uint32_t start, uint32_t count,
4375 DNP3PointList *points)
4378 uint32_t prefix = 0;
4379 uint32_t point_index = start;
4381 if (*
len < count/8) {
4386 object =
SCCalloc(1,
sizeof(*
object));
4391 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4397 if (!DNP3ReadUint8(buf,
len, &octet)) {
4400 object->online = (octet >> 0) & 0x1;
4401 object->restart = (octet >> 1) & 0x1;
4402 object->comm_lost = (octet >> 2) & 0x1;
4403 object->remote_forced = (octet >> 3) & 0x1;
4404 object->local_forced = (octet >> 4) & 0x1;
4405 object->over_range = (octet >> 5) & 0x1;
4406 object->reference_err = (octet >> 6) & 0x1;
4407 object->reserved0 = (octet >> 7) & 0x1;
4409 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
4413 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4423 if (
object != NULL) {
4430 static int DNP3DecodeObjectG32V6(
const uint8_t **buf, uint32_t *
len,
4431 uint8_t prefix_code, uint32_t start, uint32_t count,
4432 DNP3PointList *points)
4435 uint32_t prefix = 0;
4436 uint32_t point_index = start;
4438 if (*
len < count/8) {
4443 object =
SCCalloc(1,
sizeof(*
object));
4448 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4454 if (!DNP3ReadUint8(buf,
len, &octet)) {
4457 object->online = (octet >> 0) & 0x1;
4458 object->restart = (octet >> 1) & 0x1;
4459 object->comm_lost = (octet >> 2) & 0x1;
4460 object->remote_forced = (octet >> 3) & 0x1;
4461 object->local_forced = (octet >> 4) & 0x1;
4462 object->over_range = (octet >> 5) & 0x1;
4463 object->reference_err = (octet >> 6) & 0x1;
4464 object->reserved0 = (octet >> 7) & 0x1;
4466 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
4470 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4480 if (
object != NULL) {
4487 static int DNP3DecodeObjectG32V7(
const uint8_t **buf, uint32_t *
len,
4488 uint8_t prefix_code, uint32_t start, uint32_t count,
4489 DNP3PointList *points)
4492 uint32_t prefix = 0;
4493 uint32_t point_index = start;
4495 if (*
len < count/8) {
4500 object =
SCCalloc(1,
sizeof(*
object));
4505 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4511 if (!DNP3ReadUint8(buf,
len, &octet)) {
4514 object->online = (octet >> 0) & 0x1;
4515 object->restart = (octet >> 1) & 0x1;
4516 object->comm_lost = (octet >> 2) & 0x1;
4517 object->remote_forced = (octet >> 3) & 0x1;
4518 object->local_forced = (octet >> 4) & 0x1;
4519 object->over_range = (octet >> 5) & 0x1;
4520 object->reference_err = (octet >> 6) & 0x1;
4521 object->reserved0 = (octet >> 7) & 0x1;
4523 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
4530 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4540 if (
object != NULL) {
4547 static int DNP3DecodeObjectG32V8(
const uint8_t **buf, uint32_t *
len,
4548 uint8_t prefix_code, uint32_t start, uint32_t count,
4549 DNP3PointList *points)
4552 uint32_t prefix = 0;
4553 uint32_t point_index = start;
4555 if (*
len < count/8) {
4560 object =
SCCalloc(1,
sizeof(*
object));
4565 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4571 if (!DNP3ReadUint8(buf,
len, &octet)) {
4574 object->online = (octet >> 0) & 0x1;
4575 object->restart = (octet >> 1) & 0x1;
4576 object->comm_lost = (octet >> 2) & 0x1;
4577 object->remote_forced = (octet >> 3) & 0x1;
4578 object->local_forced = (octet >> 4) & 0x1;
4579 object->over_range = (octet >> 5) & 0x1;
4580 object->reference_err = (octet >> 6) & 0x1;
4581 object->reserved0 = (octet >> 7) & 0x1;
4583 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
4590 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4600 if (
object != NULL) {
4607 static int DNP3DecodeObjectG33V1(
const uint8_t **buf, uint32_t *
len,
4608 uint8_t prefix_code, uint32_t start, uint32_t count,
4609 DNP3PointList *points)
4612 uint32_t prefix = 0;
4613 uint32_t point_index = start;
4615 if (*
len < count/8) {
4620 object =
SCCalloc(1,
sizeof(*
object));
4625 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4631 if (!DNP3ReadUint8(buf,
len, &octet)) {
4634 object->online = (octet >> 0) & 0x1;
4635 object->restart = (octet >> 1) & 0x1;
4636 object->comm_lost = (octet >> 2) & 0x1;
4637 object->remote_forced = (octet >> 3) & 0x1;
4638 object->local_forced = (octet >> 4) & 0x1;
4639 object->over_range = (octet >> 5) & 0x1;
4640 object->reference_err = (octet >> 6) & 0x1;
4641 object->reserved0 = (octet >> 7) & 0x1;
4643 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
4647 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4657 if (
object != NULL) {
4664 static int DNP3DecodeObjectG33V2(
const uint8_t **buf, uint32_t *
len,
4665 uint8_t prefix_code, uint32_t start, uint32_t count,
4666 DNP3PointList *points)
4669 uint32_t prefix = 0;
4670 uint32_t point_index = start;
4672 if (*
len < count/8) {
4677 object =
SCCalloc(1,
sizeof(*
object));
4682 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4688 if (!DNP3ReadUint8(buf,
len, &octet)) {
4691 object->online = (octet >> 0) & 0x1;
4692 object->restart = (octet >> 1) & 0x1;
4693 object->comm_lost = (octet >> 2) & 0x1;
4694 object->remote_forced = (octet >> 3) & 0x1;
4695 object->local_forced = (octet >> 4) & 0x1;
4696 object->over_range = (octet >> 5) & 0x1;
4697 object->reference_err = (octet >> 6) & 0x1;
4698 object->reserved0 = (octet >> 7) & 0x1;
4700 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
4704 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4714 if (
object != NULL) {
4721 static int DNP3DecodeObjectG33V3(
const uint8_t **buf, uint32_t *
len,
4722 uint8_t prefix_code, uint32_t start, uint32_t count,
4723 DNP3PointList *points)
4726 uint32_t prefix = 0;
4727 uint32_t point_index = start;
4729 if (*
len < count/8) {
4734 object =
SCCalloc(1,
sizeof(*
object));
4739 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4745 if (!DNP3ReadUint8(buf,
len, &octet)) {
4748 object->online = (octet >> 0) & 0x1;
4749 object->restart = (octet >> 1) & 0x1;
4750 object->comm_lost = (octet >> 2) & 0x1;
4751 object->remote_forced = (octet >> 3) & 0x1;
4752 object->local_forced = (octet >> 4) & 0x1;
4753 object->over_range = (octet >> 5) & 0x1;
4754 object->reference_err = (octet >> 6) & 0x1;
4755 object->reserved0 = (octet >> 7) & 0x1;
4757 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
4764 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4774 if (
object != NULL) {
4781 static int DNP3DecodeObjectG33V4(
const uint8_t **buf, uint32_t *
len,
4782 uint8_t prefix_code, uint32_t start, uint32_t count,
4783 DNP3PointList *points)
4786 uint32_t prefix = 0;
4787 uint32_t point_index = start;
4789 if (*
len < count/8) {
4794 object =
SCCalloc(1,
sizeof(*
object));
4799 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4805 if (!DNP3ReadUint8(buf,
len, &octet)) {
4808 object->online = (octet >> 0) & 0x1;
4809 object->restart = (octet >> 1) & 0x1;
4810 object->comm_lost = (octet >> 2) & 0x1;
4811 object->remote_forced = (octet >> 3) & 0x1;
4812 object->local_forced = (octet >> 4) & 0x1;
4813 object->over_range = (octet >> 5) & 0x1;
4814 object->reference_err = (octet >> 6) & 0x1;
4815 object->reserved0 = (octet >> 7) & 0x1;
4817 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
4824 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4834 if (
object != NULL) {
4841 static int DNP3DecodeObjectG33V5(
const uint8_t **buf, uint32_t *
len,
4842 uint8_t prefix_code, uint32_t start, uint32_t count,
4843 DNP3PointList *points)
4846 uint32_t prefix = 0;
4847 uint32_t point_index = start;
4849 if (*
len < count/8) {
4854 object =
SCCalloc(1,
sizeof(*
object));
4859 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4865 if (!DNP3ReadUint8(buf,
len, &octet)) {
4868 object->online = (octet >> 0) & 0x1;
4869 object->restart = (octet >> 1) & 0x1;
4870 object->comm_lost = (octet >> 2) & 0x1;
4871 object->remote_forced = (octet >> 3) & 0x1;
4872 object->local_forced = (octet >> 4) & 0x1;
4873 object->over_range = (octet >> 5) & 0x1;
4874 object->reference_err = (octet >> 6) & 0x1;
4875 object->reserved0 = (octet >> 7) & 0x1;
4877 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
4881 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4891 if (
object != NULL) {
4898 static int DNP3DecodeObjectG33V6(
const uint8_t **buf, uint32_t *
len,
4899 uint8_t prefix_code, uint32_t start, uint32_t count,
4900 DNP3PointList *points)
4903 uint32_t prefix = 0;
4904 uint32_t point_index = start;
4906 if (*
len < count/8) {
4911 object =
SCCalloc(1,
sizeof(*
object));
4916 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4922 if (!DNP3ReadUint8(buf,
len, &octet)) {
4925 object->online = (octet >> 0) & 0x1;
4926 object->restart = (octet >> 1) & 0x1;
4927 object->comm_lost = (octet >> 2) & 0x1;
4928 object->remote_forced = (octet >> 3) & 0x1;
4929 object->local_forced = (octet >> 4) & 0x1;
4930 object->over_range = (octet >> 5) & 0x1;
4931 object->reference_err = (octet >> 6) & 0x1;
4932 object->reserved0 = (octet >> 7) & 0x1;
4934 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
4938 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
4948 if (
object != NULL) {
4955 static int DNP3DecodeObjectG33V7(
const uint8_t **buf, uint32_t *
len,
4956 uint8_t prefix_code, uint32_t start, uint32_t count,
4957 DNP3PointList *points)
4960 uint32_t prefix = 0;
4961 uint32_t point_index = start;
4963 if (*
len < count/8) {
4968 object =
SCCalloc(1,
sizeof(*
object));
4973 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
4979 if (!DNP3ReadUint8(buf,
len, &octet)) {
4982 object->online = (octet >> 0) & 0x1;
4983 object->restart = (octet >> 1) & 0x1;
4984 object->comm_lost = (octet >> 2) & 0x1;
4985 object->remote_forced = (octet >> 3) & 0x1;
4986 object->local_forced = (octet >> 4) & 0x1;
4987 object->over_range = (octet >> 5) & 0x1;
4988 object->reference_err = (octet >> 6) & 0x1;
4989 object->reserved0 = (octet >> 7) & 0x1;
4991 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
4998 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5008 if (
object != NULL) {
5015 static int DNP3DecodeObjectG33V8(
const uint8_t **buf, uint32_t *
len,
5016 uint8_t prefix_code, uint32_t start, uint32_t count,
5017 DNP3PointList *points)
5020 uint32_t prefix = 0;
5021 uint32_t point_index = start;
5023 if (*
len < count/8) {
5028 object =
SCCalloc(1,
sizeof(*
object));
5033 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5039 if (!DNP3ReadUint8(buf,
len, &octet)) {
5042 object->online = (octet >> 0) & 0x1;
5043 object->restart = (octet >> 1) & 0x1;
5044 object->comm_lost = (octet >> 2) & 0x1;
5045 object->remote_forced = (octet >> 3) & 0x1;
5046 object->local_forced = (octet >> 4) & 0x1;
5047 object->over_range = (octet >> 5) & 0x1;
5048 object->reference_err = (octet >> 6) & 0x1;
5049 object->reserved0 = (octet >> 7) & 0x1;
5051 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
5058 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5068 if (
object != NULL) {
5075 static int DNP3DecodeObjectG34V1(
const uint8_t **buf, uint32_t *
len,
5076 uint8_t prefix_code, uint32_t start, uint32_t count,
5077 DNP3PointList *points)
5080 uint32_t prefix = 0;
5081 uint32_t point_index = start;
5083 if (*
len < count/8) {
5088 object =
SCCalloc(1,
sizeof(*
object));
5093 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5101 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5111 if (
object != NULL) {
5118 static int DNP3DecodeObjectG34V2(
const uint8_t **buf, uint32_t *
len,
5119 uint8_t prefix_code, uint32_t start, uint32_t count,
5120 DNP3PointList *points)
5123 uint32_t prefix = 0;
5124 uint32_t point_index = start;
5126 if (*
len < count/8) {
5131 object =
SCCalloc(1,
sizeof(*
object));
5136 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5144 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5154 if (
object != NULL) {
5161 static int DNP3DecodeObjectG34V3(
const uint8_t **buf, uint32_t *
len,
5162 uint8_t prefix_code, uint32_t start, uint32_t count,
5163 DNP3PointList *points)
5166 uint32_t prefix = 0;
5167 uint32_t point_index = start;
5169 if (*
len < count/8) {
5174 object =
SCCalloc(1,
sizeof(*
object));
5179 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5187 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5197 if (
object != NULL) {
5204 static int DNP3DecodeObjectG40V1(
const uint8_t **buf, uint32_t *
len,
5205 uint8_t prefix_code, uint32_t start, uint32_t count,
5206 DNP3PointList *points)
5209 uint32_t prefix = 0;
5210 uint32_t point_index = start;
5212 if (*
len < count/8) {
5217 object =
SCCalloc(1,
sizeof(*
object));
5222 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5228 if (!DNP3ReadUint8(buf,
len, &octet)) {
5231 object->online = (octet >> 0) & 0x1;
5232 object->restart = (octet >> 1) & 0x1;
5233 object->comm_lost = (octet >> 2) & 0x1;
5234 object->remote_forced = (octet >> 3) & 0x1;
5235 object->local_forced = (octet >> 4) & 0x1;
5236 object->over_range = (octet >> 5) & 0x1;
5237 object->reference_err = (octet >> 6) & 0x1;
5238 object->reserved0 = (octet >> 7) & 0x1;
5240 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
5244 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5254 if (
object != NULL) {
5261 static int DNP3DecodeObjectG40V2(
const uint8_t **buf, uint32_t *
len,
5262 uint8_t prefix_code, uint32_t start, uint32_t count,
5263 DNP3PointList *points)
5266 uint32_t prefix = 0;
5267 uint32_t point_index = start;
5269 if (*
len < count/8) {
5274 object =
SCCalloc(1,
sizeof(*
object));
5279 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5285 if (!DNP3ReadUint8(buf,
len, &octet)) {
5288 object->online = (octet >> 0) & 0x1;
5289 object->restart = (octet >> 1) & 0x1;
5290 object->comm_lost = (octet >> 2) & 0x1;
5291 object->remote_forced = (octet >> 3) & 0x1;
5292 object->local_forced = (octet >> 4) & 0x1;
5293 object->over_range = (octet >> 5) & 0x1;
5294 object->reference_err = (octet >> 6) & 0x1;
5295 object->reserved0 = (octet >> 7) & 0x1;
5297 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
5301 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5311 if (
object != NULL) {
5318 static int DNP3DecodeObjectG40V3(
const uint8_t **buf, uint32_t *
len,
5319 uint8_t prefix_code, uint32_t start, uint32_t count,
5320 DNP3PointList *points)
5323 uint32_t prefix = 0;
5324 uint32_t point_index = start;
5326 if (*
len < count/8) {
5331 object =
SCCalloc(1,
sizeof(*
object));
5336 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5342 if (!DNP3ReadUint8(buf,
len, &octet)) {
5345 object->online = (octet >> 0) & 0x1;
5346 object->restart = (octet >> 1) & 0x1;
5347 object->comm_lost = (octet >> 2) & 0x1;
5348 object->remote_forced = (octet >> 3) & 0x1;
5349 object->local_forced = (octet >> 4) & 0x1;
5350 object->over_range = (octet >> 5) & 0x1;
5351 object->reference_err = (octet >> 6) & 0x1;
5352 object->reserved0 = (octet >> 7) & 0x1;
5354 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
5358 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5368 if (
object != NULL) {
5375 static int DNP3DecodeObjectG40V4(
const uint8_t **buf, uint32_t *
len,
5376 uint8_t prefix_code, uint32_t start, uint32_t count,
5377 DNP3PointList *points)
5380 uint32_t prefix = 0;
5381 uint32_t point_index = start;
5383 if (*
len < count/8) {
5388 object =
SCCalloc(1,
sizeof(*
object));
5393 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5399 if (!DNP3ReadUint8(buf,
len, &octet)) {
5402 object->online = (octet >> 0) & 0x1;
5403 object->restart = (octet >> 1) & 0x1;
5404 object->comm_lost = (octet >> 2) & 0x1;
5405 object->remote_forced = (octet >> 3) & 0x1;
5406 object->local_forced = (octet >> 4) & 0x1;
5407 object->over_range = (octet >> 5) & 0x1;
5408 object->reference_err = (octet >> 6) & 0x1;
5409 object->reserved0 = (octet >> 7) & 0x1;
5411 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
5415 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5425 if (
object != NULL) {
5432 static int DNP3DecodeObjectG41V1(
const uint8_t **buf, uint32_t *
len,
5433 uint8_t prefix_code, uint32_t start, uint32_t count,
5434 DNP3PointList *points)
5437 uint32_t prefix = 0;
5438 uint32_t point_index = start;
5440 if (*
len < count/8) {
5445 object =
SCCalloc(1,
sizeof(*
object));
5450 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5454 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&object->
value)) {
5461 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5471 if (
object != NULL) {
5478 static int DNP3DecodeObjectG41V2(
const uint8_t **buf, uint32_t *
len,
5479 uint8_t prefix_code, uint32_t start, uint32_t count,
5480 DNP3PointList *points)
5483 uint32_t prefix = 0;
5484 uint32_t point_index = start;
5486 if (*
len < count/8) {
5491 object =
SCCalloc(1,
sizeof(*
object));
5496 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5500 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&object->
value)) {
5507 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5517 if (
object != NULL) {
5524 static int DNP3DecodeObjectG41V3(
const uint8_t **buf, uint32_t *
len,
5525 uint8_t prefix_code, uint32_t start, uint32_t count,
5526 DNP3PointList *points)
5529 uint32_t prefix = 0;
5530 uint32_t point_index = start;
5532 if (*
len < count/8) {
5537 object =
SCCalloc(1,
sizeof(*
object));
5542 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5546 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
5553 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5563 if (
object != NULL) {
5570 static int DNP3DecodeObjectG41V4(
const uint8_t **buf, uint32_t *
len,
5571 uint8_t prefix_code, uint32_t start, uint32_t count,
5572 DNP3PointList *points)
5575 uint32_t prefix = 0;
5576 uint32_t point_index = start;
5578 if (*
len < count/8) {
5583 object =
SCCalloc(1,
sizeof(*
object));
5588 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5592 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
5599 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5609 if (
object != NULL) {
5616 static int DNP3DecodeObjectG42V1(
const uint8_t **buf, uint32_t *
len,
5617 uint8_t prefix_code, uint32_t start, uint32_t count,
5618 DNP3PointList *points)
5621 uint32_t prefix = 0;
5622 uint32_t point_index = start;
5624 if (*
len < count/8) {
5629 object =
SCCalloc(1,
sizeof(*
object));
5634 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5640 if (!DNP3ReadUint8(buf,
len, &octet)) {
5643 object->online = (octet >> 0) & 0x1;
5644 object->restart = (octet >> 1) & 0x1;
5645 object->comm_lost = (octet >> 2) & 0x1;
5646 object->remote_forced = (octet >> 3) & 0x1;
5647 object->local_forced = (octet >> 4) & 0x1;
5648 object->over_range = (octet >> 5) & 0x1;
5649 object->reference_err = (octet >> 6) & 0x1;
5650 object->reserved0 = (octet >> 7) & 0x1;
5652 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
5656 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5666 if (
object != NULL) {
5673 static int DNP3DecodeObjectG42V2(
const uint8_t **buf, uint32_t *
len,
5674 uint8_t prefix_code, uint32_t start, uint32_t count,
5675 DNP3PointList *points)
5678 uint32_t prefix = 0;
5679 uint32_t point_index = start;
5681 if (*
len < count/8) {
5686 object =
SCCalloc(1,
sizeof(*
object));
5691 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5697 if (!DNP3ReadUint8(buf,
len, &octet)) {
5700 object->online = (octet >> 0) & 0x1;
5701 object->restart = (octet >> 1) & 0x1;
5702 object->comm_lost = (octet >> 2) & 0x1;
5703 object->remote_forced = (octet >> 3) & 0x1;
5704 object->local_forced = (octet >> 4) & 0x1;
5705 object->over_range = (octet >> 5) & 0x1;
5706 object->reference_err = (octet >> 6) & 0x1;
5707 object->reserved0 = (octet >> 7) & 0x1;
5709 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
5713 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5723 if (
object != NULL) {
5730 static int DNP3DecodeObjectG42V3(
const uint8_t **buf, uint32_t *
len,
5731 uint8_t prefix_code, uint32_t start, uint32_t count,
5732 DNP3PointList *points)
5735 uint32_t prefix = 0;
5736 uint32_t point_index = start;
5738 if (*
len < count/8) {
5743 object =
SCCalloc(1,
sizeof(*
object));
5748 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5754 if (!DNP3ReadUint8(buf,
len, &octet)) {
5757 object->online = (octet >> 0) & 0x1;
5758 object->restart = (octet >> 1) & 0x1;
5759 object->comm_lost = (octet >> 2) & 0x1;
5760 object->remote_forced = (octet >> 3) & 0x1;
5761 object->local_forced = (octet >> 4) & 0x1;
5762 object->over_range = (octet >> 5) & 0x1;
5763 object->reference_err = (octet >> 6) & 0x1;
5764 object->reserved0 = (octet >> 7) & 0x1;
5766 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->value)) {
5773 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5783 if (
object != NULL) {
5790 static int DNP3DecodeObjectG42V4(
const uint8_t **buf, uint32_t *
len,
5791 uint8_t prefix_code, uint32_t start, uint32_t count,
5792 DNP3PointList *points)
5795 uint32_t prefix = 0;
5796 uint32_t point_index = start;
5798 if (*
len < count/8) {
5803 object =
SCCalloc(1,
sizeof(*
object));
5808 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5814 if (!DNP3ReadUint8(buf,
len, &octet)) {
5817 object->online = (octet >> 0) & 0x1;
5818 object->restart = (octet >> 1) & 0x1;
5819 object->comm_lost = (octet >> 2) & 0x1;
5820 object->remote_forced = (octet >> 3) & 0x1;
5821 object->local_forced = (octet >> 4) & 0x1;
5822 object->over_range = (octet >> 5) & 0x1;
5823 object->reference_err = (octet >> 6) & 0x1;
5824 object->reserved0 = (octet >> 7) & 0x1;
5826 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->value)) {
5833 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5843 if (
object != NULL) {
5850 static int DNP3DecodeObjectG42V5(
const uint8_t **buf, uint32_t *
len,
5851 uint8_t prefix_code, uint32_t start, uint32_t count,
5852 DNP3PointList *points)
5855 uint32_t prefix = 0;
5856 uint32_t point_index = start;
5858 if (*
len < count/8) {
5863 object =
SCCalloc(1,
sizeof(*
object));
5868 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5874 if (!DNP3ReadUint8(buf,
len, &octet)) {
5877 object->online = (octet >> 0) & 0x1;
5878 object->restart = (octet >> 1) & 0x1;
5879 object->comm_lost = (octet >> 2) & 0x1;
5880 object->remote_forced = (octet >> 3) & 0x1;
5881 object->local_forced = (octet >> 4) & 0x1;
5882 object->over_range = (octet >> 5) & 0x1;
5883 object->reference_err = (octet >> 6) & 0x1;
5884 object->reserved0 = (octet >> 7) & 0x1;
5886 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
5890 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5900 if (
object != NULL) {
5907 static int DNP3DecodeObjectG42V6(
const uint8_t **buf, uint32_t *
len,
5908 uint8_t prefix_code, uint32_t start, uint32_t count,
5909 DNP3PointList *points)
5912 uint32_t prefix = 0;
5913 uint32_t point_index = start;
5915 if (*
len < count/8) {
5920 object =
SCCalloc(1,
sizeof(*
object));
5925 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5931 if (!DNP3ReadUint8(buf,
len, &octet)) {
5934 object->online = (octet >> 0) & 0x1;
5935 object->restart = (octet >> 1) & 0x1;
5936 object->comm_lost = (octet >> 2) & 0x1;
5937 object->remote_forced = (octet >> 3) & 0x1;
5938 object->local_forced = (octet >> 4) & 0x1;
5939 object->over_range = (octet >> 5) & 0x1;
5940 object->reference_err = (octet >> 6) & 0x1;
5941 object->reserved0 = (octet >> 7) & 0x1;
5943 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
5947 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
5957 if (
object != NULL) {
5964 static int DNP3DecodeObjectG42V7(
const uint8_t **buf, uint32_t *
len,
5965 uint8_t prefix_code, uint32_t start, uint32_t count,
5966 DNP3PointList *points)
5969 uint32_t prefix = 0;
5970 uint32_t point_index = start;
5972 if (*
len < count/8) {
5977 object =
SCCalloc(1,
sizeof(*
object));
5982 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
5988 if (!DNP3ReadUint8(buf,
len, &octet)) {
5991 object->online = (octet >> 0) & 0x1;
5992 object->restart = (octet >> 1) & 0x1;
5993 object->comm_lost = (octet >> 2) & 0x1;
5994 object->remote_forced = (octet >> 3) & 0x1;
5995 object->local_forced = (octet >> 4) & 0x1;
5996 object->over_range = (octet >> 5) & 0x1;
5997 object->reference_err = (octet >> 6) & 0x1;
5998 object->reserved0 = (octet >> 7) & 0x1;
6000 if (!DNP3ReadFloat32(buf,
len, &object->
value)) {
6007 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6017 if (
object != NULL) {
6024 static int DNP3DecodeObjectG42V8(
const uint8_t **buf, uint32_t *
len,
6025 uint8_t prefix_code, uint32_t start, uint32_t count,
6026 DNP3PointList *points)
6029 uint32_t prefix = 0;
6030 uint32_t point_index = start;
6032 if (*
len < count/8) {
6037 object =
SCCalloc(1,
sizeof(*
object));
6042 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6048 if (!DNP3ReadUint8(buf,
len, &octet)) {
6051 object->online = (octet >> 0) & 0x1;
6052 object->restart = (octet >> 1) & 0x1;
6053 object->comm_lost = (octet >> 2) & 0x1;
6054 object->remote_forced = (octet >> 3) & 0x1;
6055 object->local_forced = (octet >> 4) & 0x1;
6056 object->over_range = (octet >> 5) & 0x1;
6057 object->reference_err = (octet >> 6) & 0x1;
6058 object->reserved0 = (octet >> 7) & 0x1;
6060 if (!DNP3ReadFloat64(buf,
len, &object->
value)) {
6067 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6077 if (
object != NULL) {
6084 static int DNP3DecodeObjectG43V1(
const uint8_t **buf, uint32_t *
len,
6085 uint8_t prefix_code, uint32_t start, uint32_t count,
6086 DNP3PointList *points)
6089 uint32_t prefix = 0;
6090 uint32_t point_index = start;
6092 if (*
len < count/8) {
6097 object =
SCCalloc(1,
sizeof(*
object));
6102 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6108 if (!DNP3ReadUint8(buf,
len, &octet)) {
6111 object->status_code = (octet >> 0) & 0x7f;
6112 object->reserved0 = (octet >> 7) & 0x1;
6114 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->commanded_value)) {
6118 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6128 if (
object != NULL) {
6135 static int DNP3DecodeObjectG43V2(
const uint8_t **buf, uint32_t *
len,
6136 uint8_t prefix_code, uint32_t start, uint32_t count,
6137 DNP3PointList *points)
6140 uint32_t prefix = 0;
6141 uint32_t point_index = start;
6143 if (*
len < count/8) {
6148 object =
SCCalloc(1,
sizeof(*
object));
6153 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6159 if (!DNP3ReadUint8(buf,
len, &octet)) {
6162 object->status_code = (octet >> 0) & 0x7f;
6163 object->reserved0 = (octet >> 7) & 0x1;
6165 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->commanded_value)) {
6169 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6179 if (
object != NULL) {
6186 static int DNP3DecodeObjectG43V3(
const uint8_t **buf, uint32_t *
len,
6187 uint8_t prefix_code, uint32_t start, uint32_t count,
6188 DNP3PointList *points)
6191 uint32_t prefix = 0;
6192 uint32_t point_index = start;
6194 if (*
len < count/8) {
6199 object =
SCCalloc(1,
sizeof(*
object));
6204 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6210 if (!DNP3ReadUint8(buf,
len, &octet)) {
6213 object->status_code = (octet >> 0) & 0x7f;
6214 object->reserved0 = (octet >> 7) & 0x1;
6216 if (!DNP3ReadUint32(buf,
len, (uint32_t *)&
object->commanded_value)) {
6223 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6233 if (
object != NULL) {
6240 static int DNP3DecodeObjectG43V4(
const uint8_t **buf, uint32_t *
len,
6241 uint8_t prefix_code, uint32_t start, uint32_t count,
6242 DNP3PointList *points)
6245 uint32_t prefix = 0;
6246 uint32_t point_index = start;
6248 if (*
len < count/8) {
6253 object =
SCCalloc(1,
sizeof(*
object));
6258 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6264 if (!DNP3ReadUint8(buf,
len, &octet)) {
6267 object->status_code = (octet >> 0) & 0x7f;
6268 object->reserved0 = (octet >> 7) & 0x1;
6270 if (!DNP3ReadUint16(buf,
len, (uint16_t *)&
object->commanded_value)) {
6277 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6287 if (
object != NULL) {
6294 static int DNP3DecodeObjectG43V5(
const uint8_t **buf, uint32_t *
len,
6295 uint8_t prefix_code, uint32_t start, uint32_t count,
6296 DNP3PointList *points)
6299 uint32_t prefix = 0;
6300 uint32_t point_index = start;
6302 if (*
len < count/8) {
6307 object =
SCCalloc(1,
sizeof(*
object));
6312 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6318 if (!DNP3ReadUint8(buf,
len, &octet)) {
6321 object->status_code = (octet >> 0) & 0x7f;
6322 object->reserved0 = (octet >> 7) & 0x1;
6328 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6338 if (
object != NULL) {
6345 static int DNP3DecodeObjectG43V6(
const uint8_t **buf, uint32_t *
len,
6346 uint8_t prefix_code, uint32_t start, uint32_t count,
6347 DNP3PointList *points)
6350 uint32_t prefix = 0;
6351 uint32_t point_index = start;
6353 if (*
len < count/8) {
6358 object =
SCCalloc(1,
sizeof(*
object));
6363 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6369 if (!DNP3ReadUint8(buf,
len, &octet)) {
6372 object->status_code = (octet >> 0) & 0x7f;
6373 object->reserved0 = (octet >> 7) & 0x1;
6379 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6389 if (
object != NULL) {
6396 static int DNP3DecodeObjectG43V7(
const uint8_t **buf, uint32_t *
len,
6397 uint8_t prefix_code, uint32_t start, uint32_t count,
6398 DNP3PointList *points)
6401 uint32_t prefix = 0;
6402 uint32_t point_index = start;
6404 if (*
len < count/8) {
6409 object =
SCCalloc(1,
sizeof(*
object));
6414 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6420 if (!DNP3ReadUint8(buf,
len, &octet)) {
6423 object->status_code = (octet >> 0) & 0x7f;
6424 object->reserved0 = (octet >> 7) & 0x1;
6433 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6443 if (
object != NULL) {
6450 static int DNP3DecodeObjectG43V8(
const uint8_t **buf, uint32_t *
len,
6451 uint8_t prefix_code, uint32_t start, uint32_t count,
6452 DNP3PointList *points)
6455 uint32_t prefix = 0;
6456 uint32_t point_index = start;
6458 if (*
len < count/8) {
6463 object =
SCCalloc(1,
sizeof(*
object));
6468 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6474 if (!DNP3ReadUint8(buf,
len, &octet)) {
6477 object->status_code = (octet >> 0) & 0x7f;
6478 object->reserved0 = (octet >> 7) & 0x1;
6487 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6497 if (
object != NULL) {
6504 static int DNP3DecodeObjectG50V1(
const uint8_t **buf, uint32_t *
len,
6505 uint8_t prefix_code, uint32_t start, uint32_t count,
6506 DNP3PointList *points)
6509 uint32_t prefix = 0;
6510 uint32_t point_index = start;
6512 if (*
len < count/8) {
6517 object =
SCCalloc(1,
sizeof(*
object));
6522 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6530 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6540 if (
object != NULL) {
6547 static int DNP3DecodeObjectG50V2(
const uint8_t **buf, uint32_t *
len,
6548 uint8_t prefix_code, uint32_t start, uint32_t count,
6549 DNP3PointList *points)
6552 uint32_t prefix = 0;
6553 uint32_t point_index = start;
6555 if (*
len < count/8) {
6560 object =
SCCalloc(1,
sizeof(*
object));
6565 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6572 if (!DNP3ReadUint32(buf,
len, &object->
interval)) {
6576 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6586 if (
object != NULL) {
6593 static int DNP3DecodeObjectG50V3(
const uint8_t **buf, uint32_t *
len,
6594 uint8_t prefix_code, uint32_t start, uint32_t count,
6595 DNP3PointList *points)
6598 uint32_t prefix = 0;
6599 uint32_t point_index = start;
6601 if (*
len < count/8) {
6606 object =
SCCalloc(1,
sizeof(*
object));
6611 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6619 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6629 if (
object != NULL) {
6636 static int DNP3DecodeObjectG50V4(
const uint8_t **buf, uint32_t *
len,
6637 uint8_t prefix_code, uint32_t start, uint32_t count,
6638 DNP3PointList *points)
6641 uint32_t prefix = 0;
6642 uint32_t point_index = start;
6644 if (*
len < count/8) {
6649 object =
SCCalloc(1,
sizeof(*
object));
6654 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6668 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6678 if (
object != NULL) {
6685 static int DNP3DecodeObjectG51V1(
const uint8_t **buf, uint32_t *
len,
6686 uint8_t prefix_code, uint32_t start, uint32_t count,
6687 DNP3PointList *points)
6690 uint32_t prefix = 0;
6691 uint32_t point_index = start;
6693 if (*
len < count/8) {
6698 object =
SCCalloc(1,
sizeof(*
object));
6703 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6711 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6721 if (
object != NULL) {
6728 static int DNP3DecodeObjectG51V2(
const uint8_t **buf, uint32_t *
len,
6729 uint8_t prefix_code, uint32_t start, uint32_t count,
6730 DNP3PointList *points)
6733 uint32_t prefix = 0;
6734 uint32_t point_index = start;
6736 if (*
len < count/8) {
6741 object =
SCCalloc(1,
sizeof(*
object));
6746 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6754 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6764 if (
object != NULL) {
6771 static int DNP3DecodeObjectG52V1(
const uint8_t **buf, uint32_t *
len,
6772 uint8_t prefix_code, uint32_t start, uint32_t count,
6773 DNP3PointList *points)
6776 uint32_t prefix = 0;
6777 uint32_t point_index = start;
6779 if (*
len < count/8) {
6784 object =
SCCalloc(1,
sizeof(*
object));
6789 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6797 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6807 if (
object != NULL) {
6814 static int DNP3DecodeObjectG52V2(
const uint8_t **buf, uint32_t *
len,
6815 uint8_t prefix_code, uint32_t start, uint32_t count,
6816 DNP3PointList *points)
6819 uint32_t prefix = 0;
6820 uint32_t point_index = start;
6822 if (*
len < count/8) {
6827 object =
SCCalloc(1,
sizeof(*
object));
6832 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6836 if (!DNP3ReadUint16(buf,
len, &object->
delay_ms)) {
6840 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6850 if (
object != NULL) {
6857 static int DNP3DecodeObjectG70V1(
const uint8_t **buf, uint32_t *
len,
6858 uint8_t prefix_code, uint32_t start, uint32_t count,
6859 DNP3PointList *points)
6862 uint32_t prefix = 0;
6863 uint32_t point_index = start;
6865 if (*
len < count/8) {
6870 object =
SCCalloc(1,
sizeof(*
object));
6875 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6903 if (!DNP3ReadUint32(buf,
len, &object->
file_id)) {
6906 if (!DNP3ReadUint32(buf,
len, &object->
owner_id)) {
6909 if (!DNP3ReadUint32(buf,
len, &object->
group_id)) {
6919 if (*len < object->filename_size) {
6924 *buf +=
object->filename_size;
6925 *
len -=
object->filename_size;
6927 object->filename[
object->filename_size] =
'\0';
6932 if (*len < object->data_size) {
6937 *buf +=
object->data_size;
6938 *
len -=
object->data_size;
6940 object->data[
object->data_size] =
'\0';
6942 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
6952 if (
object != NULL) {
6959 static int DNP3DecodeObjectG70V2(
const uint8_t **buf, uint32_t *
len,
6960 uint8_t prefix_code, uint32_t start, uint32_t count,
6961 DNP3PointList *points)
6964 uint32_t prefix = 0;
6965 uint32_t point_index = start;
6967 if (*
len < count/8) {
6972 object =
SCCalloc(1,
sizeof(*
object));
6977 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
6997 if (*len < object->username_size) {
7002 *buf +=
object->username_size;
7003 *
len -=
object->username_size;
7005 object->username[
object->username_size] =
'\0';
7007 if (*len < object->password_size) {
7012 *buf +=
object->password_size;
7013 *
len -=
object->password_size;
7015 object->password[
object->password_size] =
'\0';
7017 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7027 if (
object != NULL) {
7034 static int DNP3DecodeObjectG70V3(
const uint8_t **buf, uint32_t *
len,
7035 uint8_t prefix_code, uint32_t start, uint32_t count,
7036 DNP3PointList *points)
7039 uint32_t prefix = 0;
7040 uint32_t point_index = start;
7042 if (*
len < count/8) {
7047 object =
SCCalloc(1,
sizeof(*
object));
7052 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7062 if (!DNP3ReadUint48(buf,
len, &object->
created)) {
7084 if (*len < object->filename_size) {
7089 *buf +=
object->filename_size;
7090 *
len -=
object->filename_size;
7092 object->filename[
object->filename_size] =
'\0';
7094 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7104 if (
object != NULL) {
7111 static int DNP3DecodeObjectG70V4(
const uint8_t **buf, uint32_t *
len,
7112 uint8_t prefix_code, uint32_t start, uint32_t count,
7113 DNP3PointList *points)
7116 uint32_t prefix = 0;
7117 uint32_t point_index = start;
7124 if (*
len < count/8) {
7129 object =
SCCalloc(1,
sizeof(*
object));
7134 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7158 object->optional_text_len = (uint8_t)(prefix - (
offset - *
len));
7160 if (*len < object->optional_text_len) {
7165 *buf +=
object->optional_text_len;
7166 *
len -=
object->optional_text_len;
7168 object->optional_text[
object->optional_text_len] =
'\0';
7170 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7180 if (
object != NULL) {
7187 static int DNP3DecodeObjectG70V5(
const uint8_t **buf, uint32_t *
len,
7188 uint8_t prefix_code, uint32_t start, uint32_t count,
7189 DNP3PointList *points)
7192 uint32_t prefix = 0;
7193 uint32_t point_index = start;
7200 if (*
len < count/8) {
7205 object =
SCCalloc(1,
sizeof(*
object));
7210 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7225 object->file_data_len = (uint8_t)(prefix - (
offset - *
len));
7227 if (*len < object->file_data_len) {
7232 *buf +=
object->file_data_len;
7233 *
len -=
object->file_data_len;
7235 object->file_data[
object->file_data_len] =
'\0';
7237 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7247 if (
object != NULL) {
7254 static int DNP3DecodeObjectG70V6(
const uint8_t **buf, uint32_t *
len,
7255 uint8_t prefix_code, uint32_t start, uint32_t count,
7256 DNP3PointList *points)
7259 uint32_t prefix = 0;
7260 uint32_t point_index = start;
7267 if (*
len < count/8) {
7272 object =
SCCalloc(1,
sizeof(*
object));
7277 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7295 object->optional_text_len = (uint8_t)(prefix - (
offset - *
len));
7297 if (*len < object->optional_text_len) {
7302 *buf +=
object->optional_text_len;
7303 *
len -=
object->optional_text_len;
7305 object->optional_text[
object->optional_text_len] =
'\0';
7307 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7317 if (
object != NULL) {
7324 static int DNP3DecodeObjectG70V7(
const uint8_t **buf, uint32_t *
len,
7325 uint8_t prefix_code, uint32_t start, uint32_t count,
7326 DNP3PointList *points)
7329 uint32_t prefix = 0;
7330 uint32_t point_index = start;
7332 if (*
len < count/8) {
7337 object =
SCCalloc(1,
sizeof(*
object));
7342 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7368 if (*len < object->filename_size) {
7373 *buf +=
object->filename_size;
7374 *
len -=
object->filename_size;
7376 object->filename[
object->filename_size] =
'\0';
7378 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7388 if (
object != NULL) {
7395 static int DNP3DecodeObjectG70V8(
const uint8_t **buf, uint32_t *
len,
7396 uint8_t prefix_code, uint32_t start, uint32_t count,
7397 DNP3PointList *points)
7400 uint32_t prefix = 0;
7401 uint32_t point_index = start;
7404 if (prefix_code != 5) {
7408 if (*
len < count/8) {
7413 object =
SCCalloc(1,
sizeof(*
object));
7418 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7427 object->file_specification_len = (uint16_t)(prefix - (
offset - *
len));
7429 if (*len < object->file_specification_len) {
7434 *buf +=
object->file_specification_len;
7435 *
len -=
object->file_specification_len;
7437 object->file_specification[
object->file_specification_len] =
'\0';
7439 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7449 if (
object != NULL) {
7456 static int DNP3DecodeObjectG80V1(
const uint8_t **buf, uint32_t *
len,
7457 uint8_t prefix_code, uint32_t start, uint32_t count,
7458 DNP3PointList *points)
7461 uint32_t bytes = (count / 8) + 1;
7462 uint32_t prefix = 0;
7463 uint32_t point_index = start;
7465 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7469 for (uint32_t i = 0; i < bytes; i++) {
7473 if (!DNP3ReadUint8(buf,
len, &octet)) {
7477 for (
int j = 0; j < 8 && count; j = j + 1) {
7479 object =
SCCalloc(1,
sizeof(*
object));
7484 object->state = (octet >> j) & 0x1;
7486 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7499 if (
object != NULL) {
7505 static int DNP3DecodeObjectG81V1(
const uint8_t **buf, uint32_t *
len,
7506 uint8_t prefix_code, uint32_t start, uint32_t count,
7507 DNP3PointList *points)
7510 uint32_t prefix = 0;
7511 uint32_t point_index = start;
7513 if (*
len < count/8) {
7518 object =
SCCalloc(1,
sizeof(*
object));
7523 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7529 if (!DNP3ReadUint8(buf,
len, &octet)) {
7532 object->fill_percentage = (octet >> 0) & 0x7f;
7533 object->overflow_state = (octet >> 7) & 0x1;
7535 if (!DNP3ReadUint8(buf,
len, &object->
group)) {
7542 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7552 if (
object != NULL) {
7559 static int DNP3DecodeObjectG83V1(
const uint8_t **buf, uint32_t *
len,
7560 uint8_t prefix_code, uint32_t start, uint32_t count,
7561 DNP3PointList *points)
7564 uint32_t prefix = 0;
7565 uint32_t point_index = start;
7567 if (*
len < count/8) {
7572 object =
SCCalloc(1,
sizeof(*
object));
7577 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7585 object->vendor_code[4] =
'\0';
7591 if (!DNP3ReadUint16(buf,
len, &object->
length)) {
7594 if (object->
length > 0) {
7595 if (*len < object->length) {
7604 *buf +=
object->length;
7605 *
len -=
object->length;
7608 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7618 if (
object != NULL) {
7628 static int DNP3DecodeObjectG86V2(
const uint8_t **buf, uint32_t *
len,
7629 uint8_t prefix_code, uint32_t start, uint32_t count,
7630 DNP3PointList *points)
7633 uint32_t prefix = 0;
7634 uint32_t point_index = start;
7636 if (*
len < count/8) {
7641 object =
SCCalloc(1,
sizeof(*
object));
7646 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7652 if (!DNP3ReadUint8(buf,
len, &octet)) {
7655 object->rd = (octet >> 0) & 0x1;
7656 object->wr = (octet >> 1) & 0x1;
7657 object->st = (octet >> 2) & 0x1;
7658 object->ev = (octet >> 3) & 0x1;
7659 object->df = (octet >> 4) & 0x1;
7660 object->padding0 = (octet >> 5) & 0x1;
7661 object->padding1 = (octet >> 6) & 0x1;
7662 object->padding2 = (octet >> 7) & 0x1;
7665 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7675 if (
object != NULL) {
7682 static int DNP3DecodeObjectG102V1(
const uint8_t **buf, uint32_t *
len,
7683 uint8_t prefix_code, uint32_t start, uint32_t count,
7684 DNP3PointList *points)
7687 uint32_t prefix = 0;
7688 uint32_t point_index = start;
7690 if (*
len < count/8) {
7695 object =
SCCalloc(1,
sizeof(*
object));
7700 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7704 if (!DNP3ReadUint8(buf,
len, &object->
value)) {
7708 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7718 if (
object != NULL) {
7725 static int DNP3DecodeObjectG120V1(
const uint8_t **buf, uint32_t *
len,
7726 uint8_t prefix_code, uint32_t start, uint32_t count,
7727 DNP3PointList *points)
7730 uint32_t prefix = 0;
7731 uint32_t point_index = start;
7734 if (prefix_code != 5) {
7738 if (*
len < count/8) {
7743 object =
SCCalloc(1,
sizeof(*
object));
7748 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7754 if (!DNP3ReadUint32(buf,
len, &object->
csq)) {
7757 if (!DNP3ReadUint16(buf,
len, &object->
usr)) {
7760 if (!DNP3ReadUint8(buf,
len, &object->
mal)) {
7763 if (!DNP3ReadUint8(buf,
len, &object->
reason)) {
7769 object->challenge_data_len = (uint16_t)(prefix - (
offset - *
len));
7771 if (*len < object->challenge_data_len) {
7780 *buf +=
object->challenge_data_len;
7781 *
len -=
object->challenge_data_len;
7784 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7794 if (
object != NULL) {
7804 static int DNP3DecodeObjectG120V2(
const uint8_t **buf, uint32_t *
len,
7805 uint8_t prefix_code, uint32_t start, uint32_t count,
7806 DNP3PointList *points)
7809 uint32_t prefix = 0;
7810 uint32_t point_index = start;
7813 if (prefix_code != 5) {
7817 if (*
len < count/8) {
7822 object =
SCCalloc(1,
sizeof(*
object));
7827 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7833 if (!DNP3ReadUint32(buf,
len, &object->
csq)) {
7836 if (!DNP3ReadUint16(buf,
len, &object->
usr)) {
7842 object->mac_value_len = (uint16_t)(prefix - (
offset - *
len));
7844 if (*len < object->mac_value_len) {
7853 *buf +=
object->mac_value_len;
7854 *
len -=
object->mac_value_len;
7857 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7867 if (
object != NULL) {
7877 static int DNP3DecodeObjectG120V3(
const uint8_t **buf, uint32_t *
len,
7878 uint8_t prefix_code, uint32_t start, uint32_t count,
7879 DNP3PointList *points)
7882 uint32_t prefix = 0;
7883 uint32_t point_index = start;
7885 if (*
len < count/8) {
7890 object =
SCCalloc(1,
sizeof(*
object));
7895 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7899 if (!DNP3ReadUint32(buf,
len, &object->
csq)) {
7906 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7916 if (
object != NULL) {
7923 static int DNP3DecodeObjectG120V4(
const uint8_t **buf, uint32_t *
len,
7924 uint8_t prefix_code, uint32_t start, uint32_t count,
7925 DNP3PointList *points)
7928 uint32_t prefix = 0;
7929 uint32_t point_index = start;
7931 if (*
len < count/8) {
7936 object =
SCCalloc(1,
sizeof(*
object));
7941 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7949 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
7959 if (
object != NULL) {
7966 static int DNP3DecodeObjectG120V5(
const uint8_t **buf, uint32_t *
len,
7967 uint8_t prefix_code, uint32_t start, uint32_t count,
7968 DNP3PointList *points)
7971 uint32_t prefix = 0;
7972 uint32_t point_index = start;
7975 if (prefix_code != 5) {
7979 if (*
len < count/8) {
7984 object =
SCCalloc(1,
sizeof(*
object));
7989 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
7995 if (!DNP3ReadUint32(buf,
len, &object->
ksq)) {
8007 if (!DNP3ReadUint8(buf,
len, &object->
mal)) {
8014 if (*len < object->challenge_data_len) {
8023 *buf +=
object->challenge_data_len;
8024 *
len -=
object->challenge_data_len;
8029 object->mac_value_len = (uint16_t)(prefix - (
offset - *
len));
8031 if (*len < object->mac_value_len) {
8040 *buf +=
object->mac_value_len;
8041 *
len -=
object->mac_value_len;
8044 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8054 if (
object != NULL) {
8067 static int DNP3DecodeObjectG120V6(
const uint8_t **buf, uint32_t *
len,
8068 uint8_t prefix_code, uint32_t start, uint32_t count,
8069 DNP3PointList *points)
8072 uint32_t prefix = 0;
8073 uint32_t point_index = start;
8076 if (prefix_code != 5) {
8080 if (*
len < count/8) {
8085 object =
SCCalloc(1,
sizeof(*
object));
8090 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8096 if (!DNP3ReadUint24(buf,
len, &object->
ksq)) {
8099 if (!DNP3ReadUint16(buf,
len, &object->
usr)) {
8105 object->wrapped_key_data_len = (uint16_t)(prefix - (
offset - *
len));
8107 if (*len < object->wrapped_key_data_len) {
8116 *buf +=
object->wrapped_key_data_len;
8117 *
len -=
object->wrapped_key_data_len;
8120 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8130 if (
object != NULL) {
8140 static int DNP3DecodeObjectG120V7(
const uint8_t **buf, uint32_t *
len,
8141 uint8_t prefix_code, uint32_t start, uint32_t count,
8142 DNP3PointList *points)
8145 uint32_t prefix = 0;
8146 uint32_t point_index = start;
8149 if (prefix_code != 5) {
8153 if (*
len < count/8) {
8158 object =
SCCalloc(1,
sizeof(*
object));
8163 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8172 if (!DNP3ReadUint16(buf,
len, &object->
usr)) {
8187 object->error_text_len = (uint16_t)(prefix - (
offset - *
len));
8189 if (*len < object->error_text_len) {
8194 *buf +=
object->error_text_len;
8195 *
len -=
object->error_text_len;
8197 object->error_text[
object->error_text_len] =
'\0';
8199 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8209 if (
object != NULL) {
8216 static int DNP3DecodeObjectG120V8(
const uint8_t **buf, uint32_t *
len,
8217 uint8_t prefix_code, uint32_t start, uint32_t count,
8218 DNP3PointList *points)
8221 uint32_t prefix = 0;
8222 uint32_t point_index = start;
8225 if (prefix_code != 5) {
8229 if (*
len < count/8) {
8234 object =
SCCalloc(1,
sizeof(*
object));
8239 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8254 object->certificate_len = (uint16_t)(prefix - (
offset - *
len));
8256 if (*len < object->certificate_len) {
8265 *buf +=
object->certificate_len;
8266 *
len -=
object->certificate_len;
8269 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8279 if (
object != NULL) {
8289 static int DNP3DecodeObjectG120V9(
const uint8_t **buf, uint32_t *
len,
8290 uint8_t prefix_code, uint32_t start, uint32_t count,
8291 DNP3PointList *points)
8294 uint32_t prefix = 0;
8295 uint32_t point_index = start;
8298 if (*
len < count/8) {
8303 object =
SCCalloc(1,
sizeof(*
object));
8308 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8317 object->mac_value_len = (uint16_t)(prefix - (
offset - *
len));
8319 if (*len < object->mac_value_len) {
8328 *buf +=
object->mac_value_len;
8329 *
len -=
object->mac_value_len;
8332 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8342 if (
object != NULL) {
8352 static int DNP3DecodeObjectG120V10(
const uint8_t **buf, uint32_t *
len,
8353 uint8_t prefix_code, uint32_t start, uint32_t count,
8354 DNP3PointList *points)
8357 uint32_t prefix = 0;
8358 uint32_t point_index = start;
8360 if (prefix_code != 5) {
8364 if (*
len < count/8) {
8369 object =
SCCalloc(1,
sizeof(*
object));
8374 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8384 if (!DNP3ReadUint32(buf,
len, &object->
scs)) {
8403 if (*len < object->username_len) {
8408 *buf +=
object->username_len;
8409 *
len -=
object->username_len;
8411 object->username[
object->username_len] =
'\0';
8413 if (*len < object->user_public_key_len) {
8422 *buf +=
object->user_public_key_len;
8423 *
len -=
object->user_public_key_len;
8426 if (*len < object->certification_data_len) {
8435 *buf +=
object->certification_data_len;
8436 *
len -=
object->certification_data_len;
8439 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8449 if (
object != NULL) {
8462 static int DNP3DecodeObjectG120V11(
const uint8_t **buf, uint32_t *
len,
8463 uint8_t prefix_code, uint32_t start, uint32_t count,
8464 DNP3PointList *points)
8467 uint32_t prefix = 0;
8468 uint32_t point_index = start;
8470 if (prefix_code != 5) {
8474 if (*
len < count/8) {
8479 object =
SCCalloc(1,
sizeof(*
object));
8484 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8498 if (*len < object->username_len) {
8503 *buf +=
object->username_len;
8504 *
len -=
object->username_len;
8506 object->username[
object->username_len] =
'\0';
8508 if (*len < object->master_challenge_data_len) {
8517 *buf +=
object->master_challenge_data_len;
8518 *
len -=
object->master_challenge_data_len;
8521 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8531 if (
object != NULL) {
8541 static int DNP3DecodeObjectG120V12(
const uint8_t **buf, uint32_t *
len,
8542 uint8_t prefix_code, uint32_t start, uint32_t count,
8543 DNP3PointList *points)
8546 uint32_t prefix = 0;
8547 uint32_t point_index = start;
8549 if (prefix_code != 5) {
8553 if (*
len < count/8) {
8558 object =
SCCalloc(1,
sizeof(*
object));
8563 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8567 if (!DNP3ReadUint32(buf,
len, &object->
ksq)) {
8577 if (*len < object->challenge_data_len) {
8586 *buf +=
object->challenge_data_len;
8587 *
len -=
object->challenge_data_len;
8590 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8600 if (
object != NULL) {
8610 static int DNP3DecodeObjectG120V13(
const uint8_t **buf, uint32_t *
len,
8611 uint8_t prefix_code, uint32_t start, uint32_t count,
8612 DNP3PointList *points)
8615 uint32_t prefix = 0;
8616 uint32_t point_index = start;
8618 if (prefix_code != 5) {
8622 if (*
len < count/8) {
8627 object =
SCCalloc(1,
sizeof(*
object));
8632 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8636 if (!DNP3ReadUint32(buf,
len, &object->
ksq)) {
8646 if (*len < object->encrypted_update_key_len) {
8655 *buf +=
object->encrypted_update_key_len;
8656 *
len -=
object->encrypted_update_key_len;
8659 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8669 if (
object != NULL) {
8679 static int DNP3DecodeObjectG120V14(
const uint8_t **buf, uint32_t *
len,
8680 uint8_t prefix_code, uint32_t start, uint32_t count,
8681 DNP3PointList *points)
8684 uint32_t prefix = 0;
8685 uint32_t point_index = start;
8688 if (prefix_code != 5) {
8692 if (*
len < count/8) {
8697 object =
SCCalloc(1,
sizeof(*
object));
8702 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8711 object->digital_signature_len = (uint16_t)(prefix - (
offset - *
len));
8713 if (*len < object->digital_signature_len) {
8722 *buf +=
object->digital_signature_len;
8723 *
len -=
object->digital_signature_len;
8726 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8736 if (
object != NULL) {
8746 static int DNP3DecodeObjectG120V15(
const uint8_t **buf, uint32_t *
len,
8747 uint8_t prefix_code, uint32_t start, uint32_t count,
8748 DNP3PointList *points)
8751 uint32_t prefix = 0;
8752 uint32_t point_index = start;
8755 if (prefix_code != 5) {
8759 if (*
len < count/8) {
8764 object =
SCCalloc(1,
sizeof(*
object));
8769 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8778 object->mac_len = (uint16_t)(prefix - (
offset - *
len));
8780 if (*len < object->mac_len) {
8789 *buf +=
object->mac_len;
8790 *
len -=
object->mac_len;
8793 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8803 if (
object != NULL) {
8804 if (object->
mac != NULL) {
8813 static int DNP3DecodeObjectG121V1(
const uint8_t **buf, uint32_t *
len,
8814 uint8_t prefix_code, uint32_t start, uint32_t count,
8815 DNP3PointList *points)
8818 uint32_t prefix = 0;
8819 uint32_t point_index = start;
8821 if (*
len < count/8) {
8826 object =
SCCalloc(1,
sizeof(*
object));
8831 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8837 if (!DNP3ReadUint8(buf,
len, &octet)) {
8840 object->online = (octet >> 0) & 0x1;
8841 object->restart = (octet >> 1) & 0x1;
8842 object->comm_lost = (octet >> 2) & 0x1;
8843 object->remote_forced = (octet >> 3) & 0x1;
8844 object->local_forced = (octet >> 4) & 0x1;
8845 object->reserved0 = (octet >> 5) & 0x1;
8846 object->discontinuity = (octet >> 6) & 0x1;
8847 object->reserved1 = (octet >> 7) & 0x1;
8856 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8866 if (
object != NULL) {
8873 static int DNP3DecodeObjectG122V1(
const uint8_t **buf, uint32_t *
len,
8874 uint8_t prefix_code, uint32_t start, uint32_t count,
8875 DNP3PointList *points)
8878 uint32_t prefix = 0;
8879 uint32_t point_index = start;
8881 if (*
len < count/8) {
8886 object =
SCCalloc(1,
sizeof(*
object));
8891 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8897 if (!DNP3ReadUint8(buf,
len, &octet)) {
8900 object->online = (octet >> 0) & 0x1;
8901 object->restart = (octet >> 1) & 0x1;
8902 object->comm_lost = (octet >> 2) & 0x1;
8903 object->remote_forced = (octet >> 3) & 0x1;
8904 object->local_forced = (octet >> 4) & 0x1;
8905 object->reserved0 = (octet >> 5) & 0x1;
8906 object->discontinuity = (octet >> 6) & 0x1;
8907 object->reserved1 = (octet >> 7) & 0x1;
8916 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8926 if (
object != NULL) {
8933 static int DNP3DecodeObjectG122V2(
const uint8_t **buf, uint32_t *
len,
8934 uint8_t prefix_code, uint32_t start, uint32_t count,
8935 DNP3PointList *points)
8938 uint32_t prefix = 0;
8939 uint32_t point_index = start;
8941 if (*
len < count/8) {
8946 object =
SCCalloc(1,
sizeof(*
object));
8951 if (!DNP3ReadPrefix(buf,
len, prefix_code, &prefix)) {
8957 if (!DNP3ReadUint8(buf,
len, &octet)) {
8960 object->online = (octet >> 0) & 0x1;
8961 object->restart = (octet >> 1) & 0x1;
8962 object->comm_lost = (octet >> 2) & 0x1;
8963 object->remote_forced = (octet >> 3) & 0x1;
8964 object->local_forced = (octet >> 4) & 0x1;
8965 object->reserved0 = (octet >> 5) & 0x1;
8966 object->discontinuity = (octet >> 6) & 0x1;
8967 object->reserved1 = (octet >> 7) & 0x1;
8979 if (!DNP3AddPoint(points,
object, point_index, prefix_code, prefix)) {
8989 if (
object != NULL) {
9092 if (object->
mac != NULL) {
9110 uint32_t *
len, uint8_t prefix_code, uint32_t start,
9111 uint32_t count, DNP3PointList *points)
9117 rc = DNP3DecodeObjectG1V1(buf,
len, prefix_code, start, count,
9121 rc = DNP3DecodeObjectG1V2(buf,
len, prefix_code, start, count,
9125 rc = DNP3DecodeObjectG2V1(buf,
len, prefix_code, start, count,
9129 rc = DNP3DecodeObjectG2V2(buf,
len, prefix_code, start, count,
9133 rc = DNP3DecodeObjectG2V3(buf,
len, prefix_code, start, count,
9137 rc = DNP3DecodeObjectG3V1(buf,
len, prefix_code, start, count,
9141 rc = DNP3DecodeObjectG3V2(buf,
len, prefix_code, start, count,
9145 rc = DNP3DecodeObjectG4V1(buf,
len, prefix_code, start, count,
9149 rc = DNP3DecodeObjectG4V2(buf,
len, prefix_code, start, count,
9153 rc = DNP3DecodeObjectG4V3(buf,
len, prefix_code, start, count,
9157 rc = DNP3DecodeObjectG10V1(buf,
len, prefix_code, start, count,
9161 rc = DNP3DecodeObjectG10V2(buf,
len, prefix_code, start, count,
9165 rc = DNP3DecodeObjectG11V1(buf,
len, prefix_code, start, count,
9169 rc = DNP3DecodeObjectG11V2(buf,
len, prefix_code, start, count,
9173 rc = DNP3DecodeObjectG12V1(buf,
len, prefix_code, start, count,
9177 rc = DNP3DecodeObjectG12V2(buf,
len, prefix_code, start, count,
9181 rc = DNP3DecodeObjectG12V3(buf,
len, prefix_code, start, count,
9185 rc = DNP3DecodeObjectG13V1(buf,
len, prefix_code, start, count,
9189 rc = DNP3DecodeObjectG13V2(buf,
len, prefix_code, start, count,
9193 rc = DNP3DecodeObjectG20V1(buf,
len, prefix_code, start, count,
9197 rc = DNP3DecodeObjectG20V2(buf,
len, prefix_code, start, count,
9201 rc = DNP3DecodeObjectG20V3(buf,
len, prefix_code, start, count,
9205 rc = DNP3DecodeObjectG20V4(buf,
len, prefix_code, start, count,
9209 rc = DNP3DecodeObjectG20V5(buf,
len, prefix_code, start, count,
9213 rc = DNP3DecodeObjectG20V6(buf,
len, prefix_code, start, count,
9217 rc = DNP3DecodeObjectG20V7(buf,
len, prefix_code, start, count,
9221 rc = DNP3DecodeObjectG20V8(buf,
len, prefix_code, start, count,
9225 rc = DNP3DecodeObjectG21V1(buf,
len, prefix_code, start, count,
9229 rc = DNP3DecodeObjectG21V2(buf,
len, prefix_code, start, count,
9233 rc = DNP3DecodeObjectG21V3(buf,
len, prefix_code, start, count,
9237 rc = DNP3DecodeObjectG21V4(buf,
len, prefix_code, start, count,
9241 rc = DNP3DecodeObjectG21V5(buf,
len, prefix_code, start, count,
9245 rc = DNP3DecodeObjectG21V6(buf,
len, prefix_code, start, count,
9249 rc = DNP3DecodeObjectG21V7(buf,
len, prefix_code, start, count,
9253 rc = DNP3DecodeObjectG21V8(buf,
len, prefix_code, start, count,
9257 rc = DNP3DecodeObjectG21V9(buf,
len, prefix_code, start, count,
9261 rc = DNP3DecodeObjectG21V10(buf,
len, prefix_code, start, count,
9265 rc = DNP3DecodeObjectG21V11(buf,
len, prefix_code, start, count,
9269 rc = DNP3DecodeObjectG21V12(buf,
len, prefix_code, start, count,
9273 rc = DNP3DecodeObjectG22V1(buf,
len, prefix_code, start, count,
9277 rc = DNP3DecodeObjectG22V2(buf,
len, prefix_code, start, count,
9281 rc = DNP3DecodeObjectG22V3(buf,
len, prefix_code, start, count,
9285 rc = DNP3DecodeObjectG22V4(buf,
len, prefix_code, start, count,
9289 rc = DNP3DecodeObjectG22V5(buf,
len, prefix_code, start, count,
9293 rc = DNP3DecodeObjectG22V6(buf,
len, prefix_code, start, count,
9297 rc = DNP3DecodeObjectG22V7(buf,
len, prefix_code, start, count,
9301 rc = DNP3DecodeObjectG22V8(buf,
len, prefix_code, start, count,
9305 rc = DNP3DecodeObjectG23V1(buf,
len, prefix_code, start, count,
9309 rc = DNP3DecodeObjectG23V2(buf,
len, prefix_code, start, count,
9313 rc = DNP3DecodeObjectG23V3(buf,
len, prefix_code, start, count,
9317 rc = DNP3DecodeObjectG23V4(buf,
len, prefix_code, start, count,
9321 rc = DNP3DecodeObjectG23V5(buf,
len, prefix_code, start, count,
9325 rc = DNP3DecodeObjectG23V6(buf,
len, prefix_code, start, count,
9329 rc = DNP3DecodeObjectG23V7(buf,
len, prefix_code, start, count,
9333 rc = DNP3DecodeObjectG23V8(buf,
len, prefix_code, start, count,
9337 rc = DNP3DecodeObjectG30V1(buf,
len, prefix_code, start, count,
9341 rc = DNP3DecodeObjectG30V2(buf,
len, prefix_code, start, count,
9345 rc = DNP3DecodeObjectG30V3(buf,
len, prefix_code, start, count,
9349 rc = DNP3DecodeObjectG30V4(buf,
len, prefix_code, start, count,
9353 rc = DNP3DecodeObjectG30V5(buf,
len, prefix_code, start, count,
9357 rc = DNP3DecodeObjectG30V6(buf,
len, prefix_code, start, count,
9361 rc = DNP3DecodeObjectG31V1(buf,
len, prefix_code, start, count,
9365 rc = DNP3DecodeObjectG31V2(buf,
len, prefix_code, start, count,
9369 rc = DNP3DecodeObjectG31V3(buf,
len, prefix_code, start, count,
9373 rc = DNP3DecodeObjectG31V4(buf,
len, prefix_code, start, count,
9377 rc = DNP3DecodeObjectG31V5(buf,
len, prefix_code, start, count,
9381 rc = DNP3DecodeObjectG31V6(buf,
len, prefix_code, start, count,
9385 rc = DNP3DecodeObjectG31V7(buf,
len, prefix_code, start, count,
9389 rc = DNP3DecodeObjectG31V8(buf,
len, prefix_code, start, count,
9393 rc = DNP3DecodeObjectG32V1(buf,
len, prefix_code, start, count,
9397 rc = DNP3DecodeObjectG32V2(buf,
len, prefix_code, start, count,
9401 rc = DNP3DecodeObjectG32V3(buf,
len, prefix_code, start, count,
9405 rc = DNP3DecodeObjectG32V4(buf,
len, prefix_code, start, count,
9409 rc = DNP3DecodeObjectG32V5(buf,
len, prefix_code, start, count,
9413 rc = DNP3DecodeObjectG32V6(buf,
len, prefix_code, start, count,
9417 rc = DNP3DecodeObjectG32V7(buf,
len, prefix_code, start, count,
9421 rc = DNP3DecodeObjectG32V8(buf,
len, prefix_code, start, count,
9425 rc = DNP3DecodeObjectG33V1(buf,
len, prefix_code, start, count,
9429 rc = DNP3DecodeObjectG33V2(buf,
len, prefix_code, start, count,
9433 rc = DNP3DecodeObjectG33V3(buf,
len, prefix_code, start, count,
9437 rc = DNP3DecodeObjectG33V4(buf,
len, prefix_code, start, count,
9441 rc = DNP3DecodeObjectG33V5(buf,
len, prefix_code, start, count,
9445 rc = DNP3DecodeObjectG33V6(buf,
len, prefix_code, start, count,
9449 rc = DNP3DecodeObjectG33V7(buf,
len, prefix_code, start, count,
9453 rc = DNP3DecodeObjectG33V8(buf,
len, prefix_code, start, count,
9457 rc = DNP3DecodeObjectG34V1(buf,
len, prefix_code, start, count,
9461 rc = DNP3DecodeObjectG34V2(buf,
len, prefix_code, start, count,
9465 rc = DNP3DecodeObjectG34V3(buf,
len, prefix_code, start, count,
9469 rc = DNP3DecodeObjectG40V1(buf,
len, prefix_code, start, count,
9473 rc = DNP3DecodeObjectG40V2(buf,
len, prefix_code, start, count,
9477 rc = DNP3DecodeObjectG40V3(buf,
len, prefix_code, start, count,
9481 rc = DNP3DecodeObjectG40V4(buf,
len, prefix_code, start, count,
9485 rc = DNP3DecodeObjectG41V1(buf,
len, prefix_code, start, count,
9489 rc = DNP3DecodeObjectG41V2(buf,
len, prefix_code, start, count,
9493 rc = DNP3DecodeObjectG41V3(buf,
len, prefix_code, start, count,
9497 rc = DNP3DecodeObjectG41V4(buf,
len, prefix_code, start, count,
9501 rc = DNP3DecodeObjectG42V1(buf,
len, prefix_code, start, count,
9505 rc = DNP3DecodeObjectG42V2(buf,
len, prefix_code, start, count,
9509 rc = DNP3DecodeObjectG42V3(buf,
len, prefix_code, start, count,
9513 rc = DNP3DecodeObjectG42V4(buf,
len, prefix_code, start, count,
9517 rc = DNP3DecodeObjectG42V5(buf,
len, prefix_code, start, count,
9521 rc = DNP3DecodeObjectG42V6(buf,
len, prefix_code, start, count,
9525 rc = DNP3DecodeObjectG42V7(buf,
len, prefix_code, start, count,
9529 rc = DNP3DecodeObjectG42V8(buf,
len, prefix_code, start, count,
9533 rc = DNP3DecodeObjectG43V1(buf,
len, prefix_code, start, count,
9537 rc = DNP3DecodeObjectG43V2(buf,
len, prefix_code, start, count,
9541 rc = DNP3DecodeObjectG43V3(buf,
len, prefix_code, start, count,
9545 rc = DNP3DecodeObjectG43V4(buf,
len, prefix_code, start, count,
9549 rc = DNP3DecodeObjectG43V5(buf,
len, prefix_code, start, count,
9553 rc = DNP3DecodeObjectG43V6(buf,
len, prefix_code, start, count,
9557 rc = DNP3DecodeObjectG43V7(buf,
len, prefix_code, start, count,
9561 rc = DNP3DecodeObjectG43V8(buf,
len, prefix_code, start, count,
9565 rc = DNP3DecodeObjectG50V1(buf,
len, prefix_code, start, count,
9569 rc = DNP3DecodeObjectG50V2(buf,
len, prefix_code, start, count,
9573 rc = DNP3DecodeObjectG50V3(buf,
len, prefix_code, start, count,
9577 rc = DNP3DecodeObjectG50V4(buf,
len, prefix_code, start, count,
9581 rc = DNP3DecodeObjectG51V1(buf,
len, prefix_code, start, count,
9585 rc = DNP3DecodeObjectG51V2(buf,
len, prefix_code, start, count,
9589 rc = DNP3DecodeObjectG52V1(buf,
len, prefix_code, start, count,
9593 rc = DNP3DecodeObjectG52V2(buf,
len, prefix_code, start, count,
9597 rc = DNP3DecodeObjectG70V1(buf,
len, prefix_code, start, count,
9601 rc = DNP3DecodeObjectG70V2(buf,
len, prefix_code, start, count,
9605 rc = DNP3DecodeObjectG70V3(buf,
len, prefix_code, start, count,
9609 rc = DNP3DecodeObjectG70V4(buf,
len, prefix_code, start, count,
9613 rc = DNP3DecodeObjectG70V5(buf,
len, prefix_code, start, count,
9617 rc = DNP3DecodeObjectG70V6(buf,
len, prefix_code, start, count,
9621 rc = DNP3DecodeObjectG70V7(buf,
len, prefix_code, start, count,
9625 rc = DNP3DecodeObjectG70V8(buf,
len, prefix_code, start, count,
9629 rc = DNP3DecodeObjectG80V1(buf,
len, prefix_code, start, count,
9633 rc = DNP3DecodeObjectG81V1(buf,
len, prefix_code, start, count,
9637 rc = DNP3DecodeObjectG83V1(buf,
len, prefix_code, start, count,
9641 rc = DNP3DecodeObjectG86V2(buf,
len, prefix_code, start, count,
9645 rc = DNP3DecodeObjectG102V1(buf,
len, prefix_code, start, count,
9649 rc = DNP3DecodeObjectG120V1(buf,
len, prefix_code, start, count,
9653 rc = DNP3DecodeObjectG120V2(buf,
len, prefix_code, start, count,
9657 rc = DNP3DecodeObjectG120V3(buf,
len, prefix_code, start, count,
9661 rc = DNP3DecodeObjectG120V4(buf,
len, prefix_code, start, count,
9665 rc = DNP3DecodeObjectG120V5(buf,
len, prefix_code, start, count,
9669 rc = DNP3DecodeObjectG120V6(buf,
len, prefix_code, start, count,
9673 rc = DNP3DecodeObjectG120V7(buf,
len, prefix_code, start, count,
9677 rc = DNP3DecodeObjectG120V8(buf,
len, prefix_code, start, count,
9681 rc = DNP3DecodeObjectG120V9(buf,
len, prefix_code, start, count,
9685 rc = DNP3DecodeObjectG120V10(buf,
len, prefix_code, start, count,
9689 rc = DNP3DecodeObjectG120V11(buf,
len, prefix_code, start, count,
9693 rc = DNP3DecodeObjectG120V12(buf,
len, prefix_code, start, count,
9697 rc = DNP3DecodeObjectG120V13(buf,
len, prefix_code, start, count,
9701 rc = DNP3DecodeObjectG120V14(buf,
len, prefix_code, start, count,
9705 rc = DNP3DecodeObjectG120V15(buf,
len, prefix_code, start, count,
9709 rc = DNP3DecodeObjectG121V1(buf,
len, prefix_code, start, count,
9713 rc = DNP3DecodeObjectG122V1(buf,
len, prefix_code, start, count,
9717 rc = DNP3DecodeObjectG122V2(buf,
len, prefix_code, start, count,