dnp3 (C API) 1.1.0
dnp3.h
Go to the documentation of this file.
1// This library is provided under the terms of a non-commercial license.
2//
3// Please refer to the source repository for details:
4//
5// https://github.com/stepfunc/dnp3/blob/master/LICENSE.txt
6//
7// Please contact Step Function I/O if you are interested in commercial license:
8//
9// info@stepfunc.io
10#pragma once
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#define DNP3_VERSION_MAJOR 1
17#define DNP3_VERSION_MINOR 1
18#define DNP3_VERSION_PATCH 0
19#define DNP3_VERSION_STRING "1.1.0"
20
21#include <stdbool.h>
22#include <stdint.h>
23
43
46{
94
99{
100 switch (value)
101 {
102 case DNP3_PARAM_ERROR_OK: return "ok";
103 case DNP3_PARAM_ERROR_INVALID_TIMEOUT: return "invalid_timeout";
104 case DNP3_PARAM_ERROR_NULL_PARAMETER: return "null_parameter";
105 case DNP3_PARAM_ERROR_NO_SUPPORT: return "no_support";
106 case DNP3_PARAM_ERROR_ASSOCIATION_DOES_NOT_EXIST: return "association_does_not_exist";
107 case DNP3_PARAM_ERROR_ASSOCIATION_DUPLICATE_ADDRESS: return "association_duplicate_address";
108 case DNP3_PARAM_ERROR_INVALID_SOCKET_ADDRESS: return "invalid_socket_address";
109 case DNP3_PARAM_ERROR_INVALID_DNP3_ADDRESS: return "invalid_dnp3_address";
110 case DNP3_PARAM_ERROR_INVALID_BUFFER_SIZE: return "invalid_buffer_size";
111 case DNP3_PARAM_ERROR_ADDRESS_FILTER_CONFLICT: return "address_filter_conflict";
112 case DNP3_PARAM_ERROR_SERVER_ALREADY_STARTED: return "server_already_started";
113 case DNP3_PARAM_ERROR_SERVER_BIND_ERROR: return "server_bind_error";
114 case DNP3_PARAM_ERROR_MASTER_ALREADY_SHUTDOWN: return "master_already_shutdown";
115 case DNP3_PARAM_ERROR_RUNTIME_CREATION_FAILURE: return "runtime_creation_failure";
116 case DNP3_PARAM_ERROR_RUNTIME_DESTROYED: return "runtime_destroyed";
117 case DNP3_PARAM_ERROR_RUNTIME_CANNOT_BLOCK_WITHIN_ASYNC: return "runtime_cannot_block_within_async";
118 case DNP3_PARAM_ERROR_LOGGING_ALREADY_CONFIGURED: return "logging_already_configured";
119 case DNP3_PARAM_ERROR_POINT_DOES_NOT_EXIST: return "point_does_not_exist";
120 case DNP3_PARAM_ERROR_INVALID_PEER_CERTIFICATE: return "invalid_peer_certificate";
121 case DNP3_PARAM_ERROR_INVALID_LOCAL_CERTIFICATE: return "invalid_local_certificate";
122 case DNP3_PARAM_ERROR_INVALID_PRIVATE_KEY: return "invalid_private_key";
123 case DNP3_PARAM_ERROR_INVALID_DNS_NAME: return "invalid_dns_name";
124 case DNP3_PARAM_ERROR_OTHER_TLS_ERROR: return "other_tls_error";
125 default: return "unknown param_error value";
126 }
127}
128
129
131#define DNP3_FLAG_ONLINE 0x01
133#define DNP3_FLAG_RESTART 0x02
135#define DNP3_FLAG_COMM_LOST 0x04
137#define DNP3_FLAG_REMOTE_FORCED 0x08
139#define DNP3_FLAG_LOCAL_FORCED 0x10
141#define DNP3_FLAG_CHATTER_FILTER 0x20
143#define DNP3_FLAG_OVER_RANGE 0x20
145#define DNP3_FLAG_DISCONTINUITY 0x40
147#define DNP3_FLAG_REFERENCE_ERR 0x40
148
153{
165
170{
171 switch (value)
172 {
173 case DNP3_LOG_LEVEL_ERROR: return "error";
174 case DNP3_LOG_LEVEL_WARN: return "warn";
175 case DNP3_LOG_LEVEL_INFO: return "info";
176 case DNP3_LOG_LEVEL_DEBUG: return "debug";
177 case DNP3_LOG_LEVEL_TRACE: return "trace";
178 default: return "unknown log_level value";
179 }
180}
181
183
186{
192
197{
198 switch (value)
199 {
200 case DNP3_LOG_OUTPUT_FORMAT_TEXT: return "text";
201 case DNP3_LOG_OUTPUT_FORMAT_JSON: return "json";
202 default: return "unknown log_output_format value";
203 }
204}
205
208{
216
221{
222 switch (value)
223 {
224 case DNP3_TIME_FORMAT_NONE: return "none";
225 case DNP3_TIME_FORMAT_RFC_3339: return "rfc_3339";
226 case DNP3_TIME_FORMAT_SYSTEM: return "system";
227 default: return "unknown time_format value";
228 }
229}
230
233{
245
257{
258 dnp3_logging_config_t _return_value = {
262 true,
263 false
264 };
265 return _return_value;
266}
267
268
270typedef struct dnp3_logger_t
271{
272
277 void (*on_message)(dnp3_log_level_t, const char*, void*);
280 void (*on_destroy)(void* arg);
282 void* ctx;
284
290 void (*on_message)(dnp3_log_level_t, const char*, void*),
291 void (*on_destroy)(void* arg),
292 void* ctx
293)
294{
295 dnp3_logger_t _return_value = {
296 on_message,
297 on_destroy,
298 ctx
299 };
300 return _return_value;
301}
302
312
313
316{
326
331{
332 switch (value)
333 {
334 case DNP3_APP_DECODE_LEVEL_NOTHING: return "nothing";
335 case DNP3_APP_DECODE_LEVEL_HEADER: return "header";
336 case DNP3_APP_DECODE_LEVEL_OBJECT_HEADERS: return "object_headers";
337 case DNP3_APP_DECODE_LEVEL_OBJECT_VALUES: return "object_values";
338 default: return "unknown app_decode_level value";
339 }
340}
341
344{
352
357{
358 switch (value)
359 {
360 case DNP3_TRANSPORT_DECODE_LEVEL_NOTHING: return "nothing";
361 case DNP3_TRANSPORT_DECODE_LEVEL_HEADER: return "header";
362 case DNP3_TRANSPORT_DECODE_LEVEL_PAYLOAD: return "payload";
363 default: return "unknown transport_decode_level value";
364 }
365}
366
369{
377
382{
383 switch (value)
384 {
385 case DNP3_LINK_DECODE_LEVEL_NOTHING: return "nothing";
386 case DNP3_LINK_DECODE_LEVEL_HEADER: return "header";
387 case DNP3_LINK_DECODE_LEVEL_PAYLOAD: return "payload";
388 default: return "unknown link_decode_level value";
389 }
390}
391
394{
402
407{
408 switch (value)
409 {
410 case DNP3_PHYS_DECODE_LEVEL_NOTHING: return "nothing";
411 case DNP3_PHYS_DECODE_LEVEL_LENGTH: return "length";
412 case DNP3_PHYS_DECODE_LEVEL_DATA: return "data";
413 default: return "unknown phys_decode_level value";
414 }
415}
416
418
421{
431
442{
443 dnp3_decode_level_t _return_value = {
448 };
449 return _return_value;
450}
451
462{
463 dnp3_decode_level_t _return_value = {
468 };
469 return _return_value;
470}
471
472
475
477
480{
486
494{
495 dnp3_runtime_config_t _return_value = {
496 0
497 };
498 return _return_value;
499}
500
501
509
515
516
518
521{
523 bool fir;
525 bool fin;
527 bool con;
529 bool uns;
531 uint8_t seq;
533
534
537{
547
552{
553 switch (value)
554 {
555 case DNP3_TRIP_CLOSE_CODE_NUL: return "nul";
556 case DNP3_TRIP_CLOSE_CODE_CLOSE: return "close";
557 case DNP3_TRIP_CLOSE_CODE_TRIP: return "trip";
558 case DNP3_TRIP_CLOSE_CODE_RESERVED: return "reserved";
559 default: return "unknown trip_close_code value";
560 }
561}
562
564typedef enum dnp3_op_type_t
565{
577
581static const char* dnp3_op_type_to_string(dnp3_op_type_t value)
582{
583 switch (value)
584 {
585 case DNP3_OP_TYPE_NUL: return "nul";
586 case DNP3_OP_TYPE_PULSE_ON: return "pulse_on";
587 case DNP3_OP_TYPE_PULSE_OFF: return "pulse_off";
588 case DNP3_OP_TYPE_LATCH_ON: return "latch_on";
589 case DNP3_OP_TYPE_LATCH_OFF: return "latch_off";
590 default: return "unknown op_type value";
591 }
592}
593
595
598{
602 bool clear;
604 bool queue;
608
619{
620 dnp3_control_code_t _return_value = {
621 tcc,
622 clear,
623 false,
624 op_type
625 };
626 return _return_value;
627}
628
639{
640 dnp3_control_code_t _return_value = {
642 false,
643 false,
644 op_type
645 };
646 return _return_value;
647}
648
659{
660 dnp3_control_code_t _return_value = {
661 tcc,
662 false,
663 false,
664 op_type
665 };
666 return _return_value;
667}
668
669
671
674{
678 uint8_t count;
680 uint32_t on_time;
682 uint32_t off_time;
684
691static dnp3_group12_var1_t dnp3_group12_var1_init(dnp3_control_code_t code, uint8_t count, uint32_t on_time, uint32_t off_time)
692{
693 dnp3_group12_var1_t _return_value = {
694 code,
695 count,
696 on_time,
697 off_time
698 };
699 return _return_value;
700}
701
712{
713 dnp3_group12_var1_t _return_value = {
714 code,
715 1,
716 1000,
717 1000
718 };
719 return _return_value;
720}
721
722
723typedef struct dnp3_flags_t dnp3_flags_t;
724
726typedef struct dnp3_flags_t
727{
729 uint8_t value;
731
735static dnp3_flags_t dnp3_flags_init(uint8_t value)
736{
737 dnp3_flags_t _return_value = {
738 value
739 };
740 return _return_value;
741}
742
743
746{
754
759{
760 switch (value)
761 {
762 case DNP3_TIME_QUALITY_SYNCHRONIZED_TIME: return "synchronized_time";
763 case DNP3_TIME_QUALITY_UNSYNCHRONIZED_TIME: return "unsynchronized_time";
764 case DNP3_TIME_QUALITY_INVALID_TIME: return "invalid_time";
765 default: return "unknown time_quality value";
766 }
767}
768
770
772typedef struct dnp3_timestamp_t
773{
775 uint64_t value;
779
788{
789 dnp3_timestamp_t _return_value = {
790 0,
792 };
793 return _return_value;
794}
795
804{
805 dnp3_timestamp_t _return_value = {
806 value,
808 };
809 return _return_value;
810}
811
820{
821 dnp3_timestamp_t _return_value = {
822 value,
824 };
825 return _return_value;
826}
827
828
831{
841
846{
847 switch (value)
848 {
849 case DNP3_DOUBLE_BIT_INTERMEDIATE: return "intermediate";
850 case DNP3_DOUBLE_BIT_DETERMINED_OFF: return "determined_off";
851 case DNP3_DOUBLE_BIT_DETERMINED_ON: return "determined_on";
852 case DNP3_DOUBLE_BIT_INDETERMINATE: return "indeterminate";
853 default: return "unknown double_bit value";
854 }
855}
856
858
861{
863 uint16_t index;
865 bool value;
871
878static dnp3_binary_input_t dnp3_binary_input_init(uint16_t index, bool value, dnp3_flags_t flags, dnp3_timestamp_t time)
879{
880 dnp3_binary_input_t _return_value = {
881 index,
882 value,
883 flags,
884 time
885 };
886 return _return_value;
887}
888
889
892
897
898
900
903{
905 uint16_t index;
913
921{
922 dnp3_double_bit_binary_input_t _return_value = {
923 index,
924 value,
925 flags,
926 time
927 };
928 return _return_value;
929}
930
931
934
939
940
942
945{
947 uint16_t index;
949 bool value;
955
963{
964 dnp3_binary_output_status_t _return_value = {
965 index,
966 value,
967 flags,
968 time
969 };
970 return _return_value;
971}
972
973
976
981
982
983typedef struct dnp3_counter_t dnp3_counter_t;
984
986typedef struct dnp3_counter_t
987{
989 uint16_t index;
991 uint32_t value;
997
1004static dnp3_counter_t dnp3_counter_init(uint16_t index, uint32_t value, dnp3_flags_t flags, dnp3_timestamp_t time)
1005{
1006 dnp3_counter_t _return_value = {
1007 index,
1008 value,
1009 flags,
1010 time
1011 };
1012 return _return_value;
1013}
1014
1015
1018
1023
1024
1026
1029{
1031 uint16_t index;
1033 uint32_t value;
1039
1046static dnp3_frozen_counter_t dnp3_frozen_counter_init(uint16_t index, uint32_t value, dnp3_flags_t flags, dnp3_timestamp_t time)
1047{
1048 dnp3_frozen_counter_t _return_value = {
1049 index,
1050 value,
1051 flags,
1052 time
1053 };
1054 return _return_value;
1055}
1056
1057
1060
1065
1066
1068
1071{
1073 uint16_t index;
1075 double value;
1081
1088static dnp3_analog_input_t dnp3_analog_input_init(uint16_t index, double value, dnp3_flags_t flags, dnp3_timestamp_t time)
1089{
1090 dnp3_analog_input_t _return_value = {
1091 index,
1092 value,
1093 flags,
1094 time
1095 };
1096 return _return_value;
1097}
1098
1099
1102
1107
1108
1110
1113{
1115 uint16_t index;
1117 double value;
1123
1131{
1132 dnp3_analog_output_status_t _return_value = {
1133 index,
1134 value,
1135 flags,
1136 time
1137 };
1138 return _return_value;
1139}
1140
1141
1144
1149
1150
1153
1158
1159
1161
1164{
1166 uint16_t index;
1170
1171
1174
1179
1180
1183{
1193
1198{
1199 switch (value)
1200 {
1201 case DNP3_PORT_STATE_DISABLED: return "disabled";
1202 case DNP3_PORT_STATE_WAIT: return "wait";
1203 case DNP3_PORT_STATE_OPEN: return "open";
1204 case DNP3_PORT_STATE_SHUTDOWN: return "shutdown";
1205 default: return "unknown port_state value";
1206 }
1207}
1208
1211{
1212
1219 void (*on_destroy)(void* arg);
1221 void* ctx;
1223
1229 void (*on_change)(dnp3_port_state_t, void*),
1230 void (*on_destroy)(void* arg),
1231 void* ctx
1232)
1233{
1234 dnp3_port_state_listener_t _return_value = {
1235 on_change,
1236 on_destroy,
1237 ctx
1238 };
1239 return _return_value;
1240}
1241
1244{
1432
1437{
1438 switch (value)
1439 {
1440 case DNP3_VARIATION_GROUP1_VAR0: return "group1_var0";
1441 case DNP3_VARIATION_GROUP1_VAR1: return "group1_var1";
1442 case DNP3_VARIATION_GROUP1_VAR2: return "group1_var2";
1443 case DNP3_VARIATION_GROUP2_VAR0: return "group2_var0";
1444 case DNP3_VARIATION_GROUP2_VAR1: return "group2_var1";
1445 case DNP3_VARIATION_GROUP2_VAR2: return "group2_var2";
1446 case DNP3_VARIATION_GROUP2_VAR3: return "group2_var3";
1447 case DNP3_VARIATION_GROUP3_VAR0: return "group3_var0";
1448 case DNP3_VARIATION_GROUP3_VAR1: return "group3_var1";
1449 case DNP3_VARIATION_GROUP3_VAR2: return "group3_var2";
1450 case DNP3_VARIATION_GROUP4_VAR0: return "group4_var0";
1451 case DNP3_VARIATION_GROUP4_VAR1: return "group4_var1";
1452 case DNP3_VARIATION_GROUP4_VAR2: return "group4_var2";
1453 case DNP3_VARIATION_GROUP4_VAR3: return "group4_var3";
1454 case DNP3_VARIATION_GROUP10_VAR0: return "group10_var0";
1455 case DNP3_VARIATION_GROUP10_VAR1: return "group10_var1";
1456 case DNP3_VARIATION_GROUP10_VAR2: return "group10_var2";
1457 case DNP3_VARIATION_GROUP11_VAR0: return "group11_var0";
1458 case DNP3_VARIATION_GROUP11_VAR1: return "group11_var1";
1459 case DNP3_VARIATION_GROUP11_VAR2: return "group11_var2";
1460 case DNP3_VARIATION_GROUP12_VAR0: return "group12_var0";
1461 case DNP3_VARIATION_GROUP12_VAR1: return "group12_var1";
1462 case DNP3_VARIATION_GROUP20_VAR0: return "group20_var0";
1463 case DNP3_VARIATION_GROUP20_VAR1: return "group20_var1";
1464 case DNP3_VARIATION_GROUP20_VAR2: return "group20_var2";
1465 case DNP3_VARIATION_GROUP20_VAR5: return "group20_var5";
1466 case DNP3_VARIATION_GROUP20_VAR6: return "group20_var6";
1467 case DNP3_VARIATION_GROUP21_VAR0: return "group21_var0";
1468 case DNP3_VARIATION_GROUP21_VAR1: return "group21_var1";
1469 case DNP3_VARIATION_GROUP21_VAR2: return "group21_var2";
1470 case DNP3_VARIATION_GROUP21_VAR5: return "group21_var5";
1471 case DNP3_VARIATION_GROUP21_VAR6: return "group21_var6";
1472 case DNP3_VARIATION_GROUP21_VAR9: return "group21_var9";
1473 case DNP3_VARIATION_GROUP21_VAR10: return "group21_var10";
1474 case DNP3_VARIATION_GROUP22_VAR0: return "group22_var0";
1475 case DNP3_VARIATION_GROUP22_VAR1: return "group22_var1";
1476 case DNP3_VARIATION_GROUP22_VAR2: return "group22_var2";
1477 case DNP3_VARIATION_GROUP22_VAR5: return "group22_var5";
1478 case DNP3_VARIATION_GROUP22_VAR6: return "group22_var6";
1479 case DNP3_VARIATION_GROUP23_VAR0: return "group23_var0";
1480 case DNP3_VARIATION_GROUP23_VAR1: return "group23_var1";
1481 case DNP3_VARIATION_GROUP23_VAR2: return "group23_var2";
1482 case DNP3_VARIATION_GROUP23_VAR5: return "group23_var5";
1483 case DNP3_VARIATION_GROUP23_VAR6: return "group23_var6";
1484 case DNP3_VARIATION_GROUP30_VAR0: return "group30_var0";
1485 case DNP3_VARIATION_GROUP30_VAR1: return "group30_var1";
1486 case DNP3_VARIATION_GROUP30_VAR2: return "group30_var2";
1487 case DNP3_VARIATION_GROUP30_VAR3: return "group30_var3";
1488 case DNP3_VARIATION_GROUP30_VAR4: return "group30_var4";
1489 case DNP3_VARIATION_GROUP30_VAR5: return "group30_var5";
1490 case DNP3_VARIATION_GROUP30_VAR6: return "group30_var6";
1491 case DNP3_VARIATION_GROUP32_VAR0: return "group32_var0";
1492 case DNP3_VARIATION_GROUP32_VAR1: return "group32_var1";
1493 case DNP3_VARIATION_GROUP32_VAR2: return "group32_var2";
1494 case DNP3_VARIATION_GROUP32_VAR3: return "group32_var3";
1495 case DNP3_VARIATION_GROUP32_VAR4: return "group32_var4";
1496 case DNP3_VARIATION_GROUP32_VAR5: return "group32_var5";
1497 case DNP3_VARIATION_GROUP32_VAR6: return "group32_var6";
1498 case DNP3_VARIATION_GROUP32_VAR7: return "group32_var7";
1499 case DNP3_VARIATION_GROUP32_VAR8: return "group32_var8";
1500 case DNP3_VARIATION_GROUP40_VAR0: return "group40_var0";
1501 case DNP3_VARIATION_GROUP40_VAR1: return "group40_var1";
1502 case DNP3_VARIATION_GROUP40_VAR2: return "group40_var2";
1503 case DNP3_VARIATION_GROUP40_VAR3: return "group40_var3";
1504 case DNP3_VARIATION_GROUP40_VAR4: return "group40_var4";
1505 case DNP3_VARIATION_GROUP41_VAR0: return "group41_var0";
1506 case DNP3_VARIATION_GROUP41_VAR1: return "group41_var1";
1507 case DNP3_VARIATION_GROUP41_VAR2: return "group41_var2";
1508 case DNP3_VARIATION_GROUP41_VAR3: return "group41_var3";
1509 case DNP3_VARIATION_GROUP41_VAR4: return "group41_var4";
1510 case DNP3_VARIATION_GROUP42_VAR0: return "group42_var0";
1511 case DNP3_VARIATION_GROUP42_VAR1: return "group42_var1";
1512 case DNP3_VARIATION_GROUP42_VAR2: return "group42_var2";
1513 case DNP3_VARIATION_GROUP42_VAR3: return "group42_var3";
1514 case DNP3_VARIATION_GROUP42_VAR4: return "group42_var4";
1515 case DNP3_VARIATION_GROUP42_VAR5: return "group42_var5";
1516 case DNP3_VARIATION_GROUP42_VAR6: return "group42_var6";
1517 case DNP3_VARIATION_GROUP42_VAR7: return "group42_var7";
1518 case DNP3_VARIATION_GROUP42_VAR8: return "group42_var8";
1519 case DNP3_VARIATION_GROUP50_VAR1: return "group50_var1";
1520 case DNP3_VARIATION_GROUP50_VAR3: return "group50_var3";
1521 case DNP3_VARIATION_GROUP50_VAR4: return "group50_var4";
1522 case DNP3_VARIATION_GROUP51_VAR1: return "group51_var1";
1523 case DNP3_VARIATION_GROUP51_VAR2: return "group51_var2";
1524 case DNP3_VARIATION_GROUP52_VAR1: return "group52_var1";
1525 case DNP3_VARIATION_GROUP52_VAR2: return "group52_var2";
1526 case DNP3_VARIATION_GROUP60_VAR1: return "group60_var1";
1527 case DNP3_VARIATION_GROUP60_VAR2: return "group60_var2";
1528 case DNP3_VARIATION_GROUP60_VAR3: return "group60_var3";
1529 case DNP3_VARIATION_GROUP60_VAR4: return "group60_var4";
1530 case DNP3_VARIATION_GROUP80_VAR1: return "group80_var1";
1531 case DNP3_VARIATION_GROUP110: return "group110";
1532 case DNP3_VARIATION_GROUP111: return "group111";
1533 default: return "unknown variation value";
1534 }
1535}
1536
1538
1543{
1546 uint64_t min_delay;
1549 uint64_t max_delay;
1551
1560{
1561 dnp3_retry_strategy_t _return_value = {
1562 1000,
1563 10000
1564 };
1565 return _return_value;
1566}
1567
1568
1571{
1581
1586{
1587 switch (value)
1588 {
1589 case DNP3_DATA_BITS_FIVE: return "five";
1590 case DNP3_DATA_BITS_SIX: return "six";
1591 case DNP3_DATA_BITS_SEVEN: return "seven";
1592 case DNP3_DATA_BITS_EIGHT: return "eight";
1593 default: return "unknown data_bits value";
1594 }
1595}
1596
1599{
1607
1612{
1613 switch (value)
1614 {
1615 case DNP3_FLOW_CONTROL_NONE: return "none";
1616 case DNP3_FLOW_CONTROL_SOFTWARE: return "software";
1617 case DNP3_FLOW_CONTROL_HARDWARE: return "hardware";
1618 default: return "unknown flow_control value";
1619 }
1620}
1621
1623typedef enum dnp3_parity_t
1624{
1632
1636static const char* dnp3_parity_to_string(dnp3_parity_t value)
1637{
1638 switch (value)
1639 {
1640 case DNP3_PARITY_NONE: return "none";
1641 case DNP3_PARITY_ODD: return "odd";
1642 case DNP3_PARITY_EVEN: return "even";
1643 default: return "unknown parity value";
1644 }
1645}
1646
1649{
1655
1660{
1661 switch (value)
1662 {
1663 case DNP3_STOP_BITS_ONE: return "one";
1664 case DNP3_STOP_BITS_TWO: return "two";
1665 default: return "unknown stop_bits value";
1666 }
1667}
1668
1670
1673{
1675 uint32_t baud_rate;
1685
1697{
1698 dnp3_serial_settings_t _return_value = {
1699 9600,
1704 };
1705 return _return_value;
1706}
1707
1708
1711{
1717
1722{
1723 switch (value)
1724 {
1725 case DNP3_LINK_ERROR_MODE_DISCARD: return "discard";
1726 case DNP3_LINK_ERROR_MODE_CLOSE: return "close";
1727 default: return "unknown link_error_mode value";
1728 }
1729}
1730
1733{
1739
1744{
1745 switch (value)
1746 {
1747 case DNP3_MIN_TLS_VERSION_V12: return "v12";
1748 case DNP3_MIN_TLS_VERSION_V13: return "v13";
1749 default: return "unknown min_tls_version value";
1750 }
1751}
1752
1757{
1769
1774{
1775 switch (value)
1776 {
1777 case DNP3_CERTIFICATE_MODE_AUTHORITY_BASED: return "authority_based";
1778 case DNP3_CERTIFICATE_MODE_SELF_SIGNED: return "self_signed";
1779 default: return "unknown certificate_mode value";
1780 }
1781}
1782
1785{
1853
1858{
1859 switch (value)
1860 {
1861 case DNP3_FUNCTION_CODE_CONFIRM: return "confirm";
1862 case DNP3_FUNCTION_CODE_READ: return "read";
1863 case DNP3_FUNCTION_CODE_WRITE: return "write";
1864 case DNP3_FUNCTION_CODE_SELECT: return "select";
1865 case DNP3_FUNCTION_CODE_OPERATE: return "operate";
1866 case DNP3_FUNCTION_CODE_DIRECT_OPERATE: return "direct_operate";
1867 case DNP3_FUNCTION_CODE_DIRECT_OPERATE_NO_RESPONSE: return "direct_operate_no_response";
1868 case DNP3_FUNCTION_CODE_IMMEDIATE_FREEZE: return "immediate_freeze";
1869 case DNP3_FUNCTION_CODE_IMMEDIATE_FREEZE_NO_RESPONSE: return "immediate_freeze_no_response";
1870 case DNP3_FUNCTION_CODE_FREEZE_CLEAR: return "freeze_clear";
1871 case DNP3_FUNCTION_CODE_FREEZE_CLEAR_NO_RESPONSE: return "freeze_clear_no_response";
1872 case DNP3_FUNCTION_CODE_FREEZE_AT_TIME: return "freeze_at_time";
1873 case DNP3_FUNCTION_CODE_FREEZE_AT_TIME_NO_RESPONSE: return "freeze_at_time_no_response";
1874 case DNP3_FUNCTION_CODE_COLD_RESTART: return "cold_restart";
1875 case DNP3_FUNCTION_CODE_WARM_RESTART: return "warm_restart";
1876 case DNP3_FUNCTION_CODE_INITIALIZE_DATA: return "initialize_data";
1877 case DNP3_FUNCTION_CODE_INITIALIZE_APPLICATION: return "initialize_application";
1878 case DNP3_FUNCTION_CODE_START_APPLICATION: return "start_application";
1879 case DNP3_FUNCTION_CODE_STOP_APPLICATION: return "stop_application";
1880 case DNP3_FUNCTION_CODE_SAVE_CONFIGURATION: return "save_configuration";
1881 case DNP3_FUNCTION_CODE_ENABLE_UNSOLICITED: return "enable_unsolicited";
1882 case DNP3_FUNCTION_CODE_DISABLE_UNSOLICITED: return "disable_unsolicited";
1883 case DNP3_FUNCTION_CODE_ASSIGN_CLASS: return "assign_class";
1884 case DNP3_FUNCTION_CODE_DELAY_MEASURE: return "delay_measure";
1885 case DNP3_FUNCTION_CODE_RECORD_CURRENT_TIME: return "record_current_time";
1886 case DNP3_FUNCTION_CODE_OPEN_FILE: return "open_file";
1887 case DNP3_FUNCTION_CODE_CLOSE_FILE: return "close_file";
1888 case DNP3_FUNCTION_CODE_DELETE_FILE: return "delete_file";
1889 case DNP3_FUNCTION_CODE_GET_FILE_INFO: return "get_file_info";
1890 case DNP3_FUNCTION_CODE_AUTHENTICATE_FILE: return "authenticate_file";
1891 case DNP3_FUNCTION_CODE_ABORT_FILE: return "abort_file";
1892 case DNP3_FUNCTION_CODE_RESPONSE: return "response";
1893 case DNP3_FUNCTION_CODE_UNSOLICITED_RESPONSE: return "unsolicited_response";
1894 default: return "unknown function_code value";
1895 }
1896}
1897
1900{
1906
1911{
1912 switch (value)
1913 {
1914 case DNP3_RESPONSE_FUNCTION_RESPONSE: return "response";
1915 case DNP3_RESPONSE_FUNCTION_UNSOLICITED_RESPONSE: return "unsolicited_response";
1916 default: return "unknown response_function value";
1917 }
1918}
1919
1920typedef struct dnp3_iin1_t dnp3_iin1_t;
1921
1923typedef struct dnp3_iin1_t
1924{
1941} dnp3_iin1_t;
1942
1943
1944typedef struct dnp3_iin2_t dnp3_iin2_t;
1945
1947typedef struct dnp3_iin2_t
1948{
1965} dnp3_iin2_t;
1966
1967
1968typedef struct dnp3_iin_t dnp3_iin_t;
1969
1971typedef struct dnp3_iin_t
1972{
1977} dnp3_iin_t;
1978
1979
1981
1984{
1992
1993
1996{
2014
2019{
2020 switch (value)
2021 {
2022 case DNP3_QUALIFIER_CODE_RANGE8: return "range8";
2023 case DNP3_QUALIFIER_CODE_RANGE16: return "range16";
2024 case DNP3_QUALIFIER_CODE_ALL_OBJECTS: return "all_objects";
2025 case DNP3_QUALIFIER_CODE_COUNT8: return "count8";
2026 case DNP3_QUALIFIER_CODE_COUNT16: return "count16";
2027 case DNP3_QUALIFIER_CODE_COUNT_AND_PREFIX_8: return "count_and_prefix_8";
2028 case DNP3_QUALIFIER_CODE_COUNT_AND_PREFIX_16: return "count_and_prefix_16";
2029 case DNP3_QUALIFIER_CODE_FREE_FORMAT_16: return "free_format_16";
2030 default: return "unknown qualifier_code value";
2031 }
2032}
2033
2035
2038{
2048
2049
2052{
2062
2067{
2068 switch (value)
2069 {
2070 case DNP3_READ_TYPE_STARTUP_INTEGRITY: return "startup_integrity";
2071 case DNP3_READ_TYPE_UNSOLICITED: return "unsolicited";
2072 case DNP3_READ_TYPE_SINGLE_POLL: return "single_poll";
2073 case DNP3_READ_TYPE_PERIODIC_POLL: return "periodic_poll";
2074 default: return "unknown read_type value";
2075 }
2076}
2077
2080{
2081
2087
2093
2099
2105
2111
2117
2123
2129
2135
2143 void (*on_destroy)(void* arg);
2145 void* ctx;
2147
2162 void (*begin_fragment)(dnp3_read_type_t, dnp3_response_header_t, void*),
2163 void (*end_fragment)(dnp3_read_type_t, dnp3_response_header_t, void*),
2164 void (*handle_binary_input)(dnp3_header_info_t, dnp3_binary_input_iterator_t*, void*),
2165 void (*handle_double_bit_binary_input)(dnp3_header_info_t, dnp3_double_bit_binary_input_iterator_t*, void*),
2166 void (*handle_binary_output_status)(dnp3_header_info_t, dnp3_binary_output_status_iterator_t*, void*),
2167 void (*handle_counter)(dnp3_header_info_t, dnp3_counter_iterator_t*, void*),
2168 void (*handle_frozen_counter)(dnp3_header_info_t, dnp3_frozen_counter_iterator_t*, void*),
2169 void (*handle_analog_input)(dnp3_header_info_t, dnp3_analog_input_iterator_t*, void*),
2170 void (*handle_analog_output_status)(dnp3_header_info_t, dnp3_analog_output_status_iterator_t*, void*),
2171 void (*handle_octet_string)(dnp3_header_info_t, dnp3_octet_string_iterator_t*, void*),
2172 void (*on_destroy)(void* arg),
2173 void* ctx
2174)
2175{
2176 dnp3_read_handler_t _return_value = {
2177 begin_fragment,
2178 end_fragment,
2179 handle_binary_input,
2180 handle_double_bit_binary_input,
2181 handle_binary_output_status,
2182 handle_counter,
2183 handle_frozen_counter,
2184 handle_analog_input,
2185 handle_analog_output_status,
2186 handle_octet_string,
2187 on_destroy,
2188 ctx
2189 };
2190 return _return_value;
2191}
2192
2197
2204
2208
2214void dnp3_endpoint_list_add(dnp3_endpoint_list_t* instance, const char* endpoint);
2215
2216
2218
2221{
2223 uint16_t address;
2235
2246{
2247 dnp3_master_channel_config_t _return_value = {
2248 address,
2250 2048,
2251 2048
2252 };
2253 return _return_value;
2254}
2255
2256
2261{
2275
2280{
2281 switch (value)
2282 {
2283 case DNP3_CLIENT_STATE_DISABLED: return "disabled";
2284 case DNP3_CLIENT_STATE_CONNECTING: return "connecting";
2285 case DNP3_CLIENT_STATE_CONNECTED: return "connected";
2286 case DNP3_CLIENT_STATE_WAIT_AFTER_FAILED_CONNECT: return "wait_after_failed_connect";
2287 case DNP3_CLIENT_STATE_WAIT_AFTER_DISCONNECT: return "wait_after_disconnect";
2288 case DNP3_CLIENT_STATE_SHUTDOWN: return "shutdown";
2289 default: return "unknown client_state value";
2290 }
2291}
2292
2295{
2296
2303 void (*on_destroy)(void* arg);
2305 void* ctx;
2307
2313 void (*on_change)(dnp3_client_state_t, void*),
2314 void (*on_destroy)(void* arg),
2315 void* ctx
2316)
2317{
2318 dnp3_client_state_listener_t _return_value = {
2319 on_change,
2320 on_destroy,
2321 ctx
2322 };
2323 return _return_value;
2324}
2325
2332
2334
2337{
2339 const char* dns_name;
2341 const char* peer_cert_path;
2343 const char* local_cert_path;
2345 const char* private_key_path;
2351 const char* password;
2357
2370static dnp3_tls_client_config_t dnp3_tls_client_config_init(const char* dns_name, const char* peer_cert_path, const char* local_cert_path, const char* private_key_path, const char* password)
2371{
2372 dnp3_tls_client_config_t _return_value = {
2373 dns_name,
2374 peer_cert_path,
2375 local_cert_path,
2376 private_key_path,
2377 password,
2380 };
2381 return _return_value;
2382}
2383
2384
2386
2389{
2400
2410{
2411 dnp3_connect_strategy_t _return_value = {
2412 1000,
2413 10000,
2414 1000
2415 };
2416 return _return_value;
2417}
2418
2419
2421typedef enum dnp3_nothing_t
2422{
2426
2431{
2432 switch (value)
2433 {
2434 case DNP3_NOTHING_NOTHING: return "nothing";
2435 default: return "unknown nothing value";
2436 }
2437}
2438
2449
2462
2466
2478
2483
2488
2490
2495{
2497 uint16_t address;
2499
2500typedef struct dnp3_poll_id_t dnp3_poll_id_t;
2501
2505typedef struct dnp3_poll_id_t
2506{
2510 uint64_t id;
2512
2514
2517{
2525
2531static dnp3_event_classes_t dnp3_event_classes_init(bool class1, bool class2, bool class3)
2532{
2533 dnp3_event_classes_t _return_value = {
2534 class1,
2535 class2,
2536 class3
2537 };
2538 return _return_value;
2539}
2540
2550{
2551 dnp3_event_classes_t _return_value = {
2552 true,
2553 true,
2554 true
2555 };
2556 return _return_value;
2557}
2558
2568{
2569 dnp3_event_classes_t _return_value = {
2570 false,
2571 false,
2572 false
2573 };
2574 return _return_value;
2575}
2576
2577
2578typedef struct dnp3_classes_t dnp3_classes_t;
2579
2581typedef struct dnp3_classes_t
2582{
2592
2599static dnp3_classes_t dnp3_classes_init(bool class0, bool class1, bool class2, bool class3)
2600{
2601 dnp3_classes_t _return_value = {
2602 class0,
2603 class1,
2604 class2,
2605 class3
2606 };
2607 return _return_value;
2608}
2609
2620{
2621 dnp3_classes_t _return_value = {
2622 true,
2623 true,
2624 true,
2625 true
2626 };
2627 return _return_value;
2628}
2629
2640{
2641 dnp3_classes_t _return_value = {
2642 false,
2643 false,
2644 false,
2645 false
2646 };
2647 return _return_value;
2648}
2649
2650
2653{
2661
2666{
2667 switch (value)
2668 {
2669 case DNP3_AUTO_TIME_SYNC_NONE: return "none";
2670 case DNP3_AUTO_TIME_SYNC_LAN: return "lan";
2671 case DNP3_AUTO_TIME_SYNC_NON_LAN: return "non_lan";
2672 default: return "unknown auto_time_sync value";
2673 }
2674}
2675
2677
2680{
2708
2724static dnp3_association_config_t dnp3_association_config_init(dnp3_event_classes_t disable_unsol_classes, dnp3_event_classes_t enable_unsol_classes, dnp3_classes_t startup_integrity_classes, dnp3_event_classes_t event_scan_on_events_available)
2725{
2726 dnp3_association_config_t _return_value = {
2727 5000,
2728 disable_unsol_classes,
2729 enable_unsol_classes,
2730 startup_integrity_classes,
2733 60,
2734 true,
2735 event_scan_on_events_available,
2736 16
2737 };
2738 return _return_value;
2739}
2740
2741
2743
2748{
2752 uint64_t value;
2756
2765{
2766 dnp3_utc_timestamp_t _return_value = {
2767 value,
2768 true
2769 };
2770 return _return_value;
2771}
2772
2781{
2782 dnp3_utc_timestamp_t _return_value = {
2783 0,
2784 false
2785 };
2786 return _return_value;
2787}
2788
2789
2792{
2793
2804 void (*on_destroy)(void* arg);
2806 void* ctx;
2808
2814 dnp3_utc_timestamp_t (*get_current_time)(void*),
2815 void (*on_destroy)(void* arg),
2816 void* ctx
2817)
2818{
2819 dnp3_association_handler_t _return_value = {
2820 get_current_time,
2821 on_destroy,
2822 ctx
2823 };
2824 return _return_value;
2825}
2826
2829{
2851
2856{
2857 switch (value)
2858 {
2859 case DNP3_TASK_TYPE_USER_READ: return "user_read";
2860 case DNP3_TASK_TYPE_PERIODIC_POLL: return "periodic_poll";
2861 case DNP3_TASK_TYPE_STARTUP_INTEGRITY: return "startup_integrity";
2862 case DNP3_TASK_TYPE_AUTO_EVENT_SCAN: return "auto_event_scan";
2863 case DNP3_TASK_TYPE_COMMAND: return "command";
2864 case DNP3_TASK_TYPE_CLEAR_RESTART_BIT: return "clear_restart_bit";
2865 case DNP3_TASK_TYPE_ENABLE_UNSOLICITED: return "enable_unsolicited";
2866 case DNP3_TASK_TYPE_DISABLE_UNSOLICITED: return "disable_unsolicited";
2867 case DNP3_TASK_TYPE_TIME_SYNC: return "time_sync";
2868 case DNP3_TASK_TYPE_RESTART: return "restart";
2869 default: return "unknown task_type value";
2870 }
2871}
2872
2875{
2891
2896{
2897 switch (value)
2898 {
2899 case DNP3_TASK_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
2900 case DNP3_TASK_ERROR_BAD_RESPONSE: return "bad_response";
2901 case DNP3_TASK_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
2902 case DNP3_TASK_ERROR_WRITE_ERROR: return "write_error";
2903 case DNP3_TASK_ERROR_NO_CONNECTION: return "no_connection";
2904 case DNP3_TASK_ERROR_SHUTDOWN: return "shutdown";
2905 case DNP3_TASK_ERROR_ASSOCIATION_REMOVED: return "association_removed";
2906 default: return "unknown task_error value";
2907 }
2908}
2909
2912{
2913
2920
2927
2933
2938 void (*unsolicited_response)(bool, uint8_t, void*);
2941 void (*on_destroy)(void* arg);
2943 void* ctx;
2945
2954 void (*task_start)(dnp3_task_type_t, dnp3_function_code_t, uint8_t, void*),
2955 void (*task_success)(dnp3_task_type_t, dnp3_function_code_t, uint8_t, void*),
2956 void (*task_fail)(dnp3_task_type_t, dnp3_task_error_t, void*),
2957 void (*unsolicited_response)(bool, uint8_t, void*),
2958 void (*on_destroy)(void* arg),
2959 void* ctx
2960)
2961{
2962 dnp3_association_information_t _return_value = {
2963 task_start,
2964 task_success,
2965 task_fail,
2966 unsolicited_response,
2967 on_destroy,
2968 ctx
2969 };
2970 return _return_value;
2971}
2972
2977
2981
2990dnp3_request_t* dnp3_request_new_class(bool class0, bool class1, bool class2, bool class3);
2991
2998
3006dnp3_request_t* dnp3_request_new_one_byte_range(dnp3_variation_t variation, uint8_t start, uint8_t stop);
3007
3015dnp3_request_t* dnp3_request_new_two_byte_range(dnp3_variation_t variation, uint16_t start, uint16_t stop);
3016
3024
3032
3036
3042void dnp3_request_add_one_byte_range_header(dnp3_request_t* instance, dnp3_variation_t variation, uint8_t start, uint8_t stop);
3043
3049void dnp3_request_add_two_byte_range_header(dnp3_request_t* instance, dnp3_variation_t variation, uint16_t start, uint16_t stop);
3050
3055
3061
3067
3068
3079
3085
3096
3104
3114
3120
3126
3129{
3147
3152{
3153 switch (value)
3154 {
3155 case DNP3_READ_ERROR_OK: return "ok";
3156 case DNP3_READ_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
3157 case DNP3_READ_ERROR_BAD_RESPONSE: return "bad_response";
3158 case DNP3_READ_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
3159 case DNP3_READ_ERROR_WRITE_ERROR: return "write_error";
3160 case DNP3_READ_ERROR_NO_CONNECTION: return "no_connection";
3161 case DNP3_READ_ERROR_SHUTDOWN: return "shutdown";
3162 case DNP3_READ_ERROR_ASSOCIATION_REMOVED: return "association_removed";
3163 default: return "unknown read_error value";
3164 }
3165}
3166
3167
3170{
3171
3176
3183 void (*on_destroy)(void* arg);
3185 void* ctx;
3187
3194 void (*on_complete)(dnp3_nothing_t, void*),
3195 void (*on_failure)(dnp3_read_error_t, void*),
3196 void (*on_destroy)(void* arg),
3197 void* ctx
3198)
3199{
3200 dnp3_read_task_callback_t _return_value = {
3201 on_complete,
3202 on_failure,
3203 on_destroy,
3204 ctx
3205 };
3206 return _return_value;
3207}
3208
3218
3229
3232
3236
3240
3244
3250
3256
3261void dnp3_command_set_add_g41_v1_u8(dnp3_command_set_t* instance, uint8_t idx, int32_t value);
3262
3267void dnp3_command_set_add_g41_v1_u16(dnp3_command_set_t* instance, uint16_t idx, int32_t value);
3268
3273void dnp3_command_set_add_g41_v2_u8(dnp3_command_set_t* instance, uint8_t idx, int16_t value);
3274
3279void dnp3_command_set_add_g41_v2_u16(dnp3_command_set_t* instance, uint16_t idx, int16_t value);
3280
3285void dnp3_command_set_add_g41_v3_u8(dnp3_command_set_t* instance, uint8_t idx, float value);
3286
3291void dnp3_command_set_add_g41_v3_u16(dnp3_command_set_t* instance, uint16_t idx, float value);
3292
3297void dnp3_command_set_add_g41_v4_u8(dnp3_command_set_t* instance, uint8_t idx, double value);
3298
3303void dnp3_command_set_add_g41_v4_u16(dnp3_command_set_t* instance, uint16_t idx, double value);
3304
3305
3308{
3314
3319{
3320 switch (value)
3321 {
3322 case DNP3_COMMAND_MODE_DIRECT_OPERATE: return "direct_operate";
3323 case DNP3_COMMAND_MODE_SELECT_BEFORE_OPERATE: return "select_before_operate";
3324 default: return "unknown command_mode value";
3325 }
3326}
3327
3330{
3352
3357{
3358 switch (value)
3359 {
3360 case DNP3_COMMAND_ERROR_OK: return "ok";
3361 case DNP3_COMMAND_ERROR_BAD_STATUS: return "bad_status";
3362 case DNP3_COMMAND_ERROR_HEADER_MISMATCH: return "header_mismatch";
3363 case DNP3_COMMAND_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
3364 case DNP3_COMMAND_ERROR_BAD_RESPONSE: return "bad_response";
3365 case DNP3_COMMAND_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
3366 case DNP3_COMMAND_ERROR_WRITE_ERROR: return "write_error";
3367 case DNP3_COMMAND_ERROR_NO_CONNECTION: return "no_connection";
3368 case DNP3_COMMAND_ERROR_SHUTDOWN: return "shutdown";
3369 case DNP3_COMMAND_ERROR_ASSOCIATION_REMOVED: return "association_removed";
3370 default: return "unknown command_error value";
3371 }
3372}
3373
3374
3377{
3378
3383
3390 void (*on_destroy)(void* arg);
3392 void* ctx;
3394
3401 void (*on_complete)(dnp3_nothing_t, void*),
3402 void (*on_failure)(dnp3_command_error_t, void*),
3403 void (*on_destroy)(void* arg),
3404 void* ctx
3405)
3406{
3407 dnp3_command_task_callback_t _return_value = {
3408 on_complete,
3409 on_failure,
3410 on_destroy,
3411 ctx
3412 };
3413 return _return_value;
3414}
3415
3424
3427{
3433
3438{
3439 switch (value)
3440 {
3441 case DNP3_TIME_SYNC_MODE_LAN: return "lan";
3442 case DNP3_TIME_SYNC_MODE_NON_LAN: return "non_lan";
3443 default: return "unknown time_sync_mode value";
3444 }
3445}
3446
3449{
3481
3486{
3487 switch (value)
3488 {
3489 case DNP3_TIME_SYNC_ERROR_OK: return "ok";
3490 case DNP3_TIME_SYNC_ERROR_CLOCK_ROLLBACK: return "clock_rollback";
3491 case DNP3_TIME_SYNC_ERROR_SYSTEM_TIME_NOT_UNIX: return "system_time_not_unix";
3492 case DNP3_TIME_SYNC_ERROR_BAD_OUTSTATION_TIME_DELAY: return "bad_outstation_time_delay";
3493 case DNP3_TIME_SYNC_ERROR_OVERFLOW: return "overflow";
3494 case DNP3_TIME_SYNC_ERROR_STILL_NEEDS_TIME: return "still_needs_time";
3495 case DNP3_TIME_SYNC_ERROR_SYSTEM_TIME_NOT_AVAILABLE: return "system_time_not_available";
3496 case DNP3_TIME_SYNC_ERROR_IIN_ERROR: return "iin_error";
3497 case DNP3_TIME_SYNC_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
3498 case DNP3_TIME_SYNC_ERROR_BAD_RESPONSE: return "bad_response";
3499 case DNP3_TIME_SYNC_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
3500 case DNP3_TIME_SYNC_ERROR_WRITE_ERROR: return "write_error";
3501 case DNP3_TIME_SYNC_ERROR_NO_CONNECTION: return "no_connection";
3502 case DNP3_TIME_SYNC_ERROR_SHUTDOWN: return "shutdown";
3503 case DNP3_TIME_SYNC_ERROR_ASSOCIATION_REMOVED: return "association_removed";
3504 default: return "unknown time_sync_error value";
3505 }
3506}
3507
3508
3511{
3512
3517
3524 void (*on_destroy)(void* arg);
3526 void* ctx;
3528
3535 void (*on_complete)(dnp3_nothing_t, void*),
3536 void (*on_failure)(dnp3_time_sync_error_t, void*),
3537 void (*on_destroy)(void* arg),
3538 void* ctx
3539)
3540{
3541 dnp3_time_sync_task_callback_t _return_value = {
3542 on_complete,
3543 on_failure,
3544 on_destroy,
3545 ctx
3546 };
3547 return _return_value;
3548}
3549
3557
3560{
3578
3583{
3584 switch (value)
3585 {
3586 case DNP3_RESTART_ERROR_OK: return "ok";
3587 case DNP3_RESTART_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
3588 case DNP3_RESTART_ERROR_BAD_RESPONSE: return "bad_response";
3589 case DNP3_RESTART_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
3590 case DNP3_RESTART_ERROR_WRITE_ERROR: return "write_error";
3591 case DNP3_RESTART_ERROR_NO_CONNECTION: return "no_connection";
3592 case DNP3_RESTART_ERROR_SHUTDOWN: return "shutdown";
3593 case DNP3_RESTART_ERROR_ASSOCIATION_REMOVED: return "association_removed";
3594 default: return "unknown restart_error value";
3595 }
3596}
3597
3598
3601{
3602
3606 void (*on_complete)(uint64_t, void*);
3607
3614 void (*on_destroy)(void* arg);
3616 void* ctx;
3618
3625 void (*on_complete)(uint64_t, void*),
3626 void (*on_failure)(dnp3_restart_error_t, void*),
3627 void (*on_destroy)(void* arg),
3628 void* ctx
3629)
3630{
3631 dnp3_restart_task_callback_t _return_value = {
3632 on_complete,
3633 on_failure,
3634 on_destroy,
3635 ctx
3636 };
3637 return _return_value;
3638}
3639
3646
3653
3656{
3676
3681{
3682 switch (value)
3683 {
3684 case DNP3_LINK_STATUS_ERROR_OK: return "ok";
3685 case DNP3_LINK_STATUS_ERROR_UNEXPECTED_RESPONSE: return "unexpected_response";
3686 case DNP3_LINK_STATUS_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
3687 case DNP3_LINK_STATUS_ERROR_BAD_RESPONSE: return "bad_response";
3688 case DNP3_LINK_STATUS_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
3689 case DNP3_LINK_STATUS_ERROR_WRITE_ERROR: return "write_error";
3690 case DNP3_LINK_STATUS_ERROR_NO_CONNECTION: return "no_connection";
3691 case DNP3_LINK_STATUS_ERROR_SHUTDOWN: return "shutdown";
3692 case DNP3_LINK_STATUS_ERROR_ASSOCIATION_REMOVED: return "association_removed";
3693 default: return "unknown link_status_error value";
3694 }
3695}
3696
3697
3700{
3701
3706
3713 void (*on_destroy)(void* arg);
3715 void* ctx;
3717
3724 void (*on_complete)(dnp3_nothing_t, void*),
3725 void (*on_failure)(dnp3_link_status_error_t, void*),
3726 void (*on_destroy)(void* arg),
3727 void* ctx
3728)
3729{
3730 dnp3_link_status_callback_t _return_value = {
3731 on_complete,
3732 on_failure,
3733 on_destroy,
3734 ctx
3735 };
3736 return _return_value;
3737}
3738
3745
3746
3751
3754{
3764
3769{
3770 switch (value)
3771 {
3772 case DNP3_EVENT_CLASS_NONE: return "none";
3773 case DNP3_EVENT_CLASS_CLASS1: return "class1";
3774 case DNP3_EVENT_CLASS_CLASS2: return "class2";
3775 case DNP3_EVENT_CLASS_CLASS3: return "class3";
3776 default: return "unknown event_class value";
3777 }
3778}
3779
3782{
3792
3797{
3798 switch (value)
3799 {
3800 case DNP3_EVENT_MODE_DETECT: return "detect";
3801 case DNP3_EVENT_MODE_FORCE: return "force";
3802 case DNP3_EVENT_MODE_SUPPRESS: return "suppress";
3803 default: return "unknown event_mode value";
3804 }
3805}
3806
3808
3813{
3819
3828{
3829 dnp3_update_options_t _return_value = {
3830 true,
3832 };
3833 return _return_value;
3834}
3835
3844{
3845 dnp3_update_options_t _return_value = {
3846 true,
3848 };
3849 return _return_value;
3850}
3851
3852
3855{
3861
3866{
3867 switch (value)
3868 {
3869 case DNP3_STATIC_BINARY_INPUT_VARIATION_GROUP1_VAR1: return "group1_var1";
3870 case DNP3_STATIC_BINARY_INPUT_VARIATION_GROUP1_VAR2: return "group1_var2";
3871 default: return "unknown static_binary_input_variation value";
3872 }
3873}
3874
3877{
3885
3890{
3891 switch (value)
3892 {
3893 case DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR1: return "group2_var1";
3894 case DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR2: return "group2_var2";
3895 case DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR3: return "group2_var3";
3896 default: return "unknown event_binary_input_variation value";
3897 }
3898}
3899
3901
3904{
3910
3919{
3920 dnp3_binary_input_config_t _return_value = {
3923 };
3924 return _return_value;
3925}
3926
3927
3935
3941
3948
3955
3958{
3964
3969{
3970 switch (value)
3971 {
3974 default: return "unknown static_double_bit_binary_input_variation value";
3975 }
3976}
3977
3980{
3988
3993{
3994 switch (value)
3995 {
3999 default: return "unknown event_double_bit_binary_input_variation value";
4000 }
4001}
4002
4004
4007{
4013
4022{
4026 };
4027 return _return_value;
4028}
4029
4030
4038
4044
4051
4058
4061{
4067
4072{
4073 switch (value)
4074 {
4077 default: return "unknown static_binary_output_status_variation value";
4078 }
4079}
4080
4083{
4089
4094{
4095 switch (value)
4096 {
4099 default: return "unknown event_binary_output_status_variation value";
4100 }
4101}
4102
4104
4107{
4113
4122{
4123 dnp3_binary_output_status_config_t _return_value = {
4126 };
4127 return _return_value;
4128}
4129
4130
4138
4144
4151
4158
4161{
4171
4176{
4177 switch (value)
4178 {
4179 case DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR1: return "group20_var1";
4180 case DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR2: return "group20_var2";
4181 case DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR5: return "group20_var5";
4182 case DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR6: return "group20_var6";
4183 default: return "unknown static_counter_variation value";
4184 }
4185}
4186
4189{
4199
4204{
4205 switch (value)
4206 {
4207 case DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR1: return "group22_var1";
4208 case DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR2: return "group22_var2";
4209 case DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR5: return "group22_var5";
4210 case DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR6: return "group22_var6";
4211 default: return "unknown event_counter_variation value";
4212 }
4213}
4214
4216
4219{
4225 uint32_t deadband;
4227
4237{
4238 dnp3_counter_config_t _return_value = {
4241 0
4242 };
4243 return _return_value;
4244}
4245
4246
4253bool dnp3_database_add_counter(dnp3_database_t* instance, uint16_t index, dnp3_event_class_t point_class, dnp3_counter_config_t config);
4254
4259bool dnp3_database_remove_counter(dnp3_database_t* instance, uint16_t index);
4260
4267
4274
4277{
4291
4296{
4297 switch (value)
4298 {
4299 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR1: return "group21_var1";
4300 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR2: return "group21_var2";
4301 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR5: return "group21_var5";
4302 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR6: return "group21_var6";
4303 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR9: return "group21_var9";
4304 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR10: return "group21_var10";
4305 default: return "unknown static_frozen_counter_variation value";
4306 }
4307}
4308
4311{
4321
4326{
4327 switch (value)
4328 {
4329 case DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR1: return "group23_var1";
4330 case DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR2: return "group23_var2";
4331 case DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR5: return "group23_var5";
4332 case DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR6: return "group23_var6";
4333 default: return "unknown event_frozen_counter_variation value";
4334 }
4335}
4336
4338
4341{
4347 uint32_t deadband;
4349
4359{
4360 dnp3_frozen_counter_config_t _return_value = {
4363 0
4364 };
4365 return _return_value;
4366}
4367
4368
4376
4382
4389
4396
4399{
4413
4418{
4419 switch (value)
4420 {
4421 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR1: return "group30_var1";
4422 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR2: return "group30_var2";
4423 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR3: return "group30_var3";
4424 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR4: return "group30_var4";
4425 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR5: return "group30_var5";
4426 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR6: return "group30_var6";
4427 default: return "unknown static_analog_input_variation value";
4428 }
4429}
4430
4433{
4451
4456{
4457 switch (value)
4458 {
4459 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR1: return "group32_var1";
4460 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR2: return "group32_var2";
4461 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR3: return "group32_var3";
4462 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR4: return "group32_var4";
4463 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR5: return "group32_var5";
4464 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR6: return "group32_var6";
4465 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR7: return "group32_var7";
4466 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR8: return "group32_var8";
4467 default: return "unknown event_analog_input_variation value";
4468 }
4469}
4470
4472
4475{
4481 double deadband;
4483
4493{
4494 dnp3_analog_input_config_t _return_value = {
4497 0
4498 };
4499 return _return_value;
4500}
4501
4502
4510
4516
4523
4530
4533{
4543
4548{
4549 switch (value)
4550 {
4555 default: return "unknown static_analog_output_status_variation value";
4556 }
4557}
4558
4561{
4579
4584{
4585 switch (value)
4586 {
4595 default: return "unknown event_analog_output_status_variation value";
4596 }
4597}
4598
4600
4603{
4609 double deadband;
4611
4621{
4622 dnp3_analog_output_status_config_t _return_value = {
4625 0
4626 };
4627 return _return_value;
4628}
4629
4630
4638
4644
4651
4658
4661
4665
4669
4674
4675
4681bool dnp3_database_add_octet_string(dnp3_database_t* instance, uint16_t index, dnp3_event_class_t point_class);
4682
4688
4696
4697
4700{
4701
4705 void (*execute)(dnp3_database_t*, void*);
4708 void (*on_destroy)(void* arg);
4710 void* ctx;
4712
4718 void (*execute)(dnp3_database_t*, void*),
4719 void (*on_destroy)(void* arg),
4720 void* ctx
4721)
4722{
4723 dnp3_database_transaction_t _return_value = {
4724 execute,
4725 on_destroy,
4726 ctx
4727 };
4728 return _return_value;
4729}
4730
4733
4738
4739
4741
4746{
4748 uint16_t max_binary;
4754 uint16_t max_counter;
4758 uint16_t max_analog;
4764
4775static dnp3_event_buffer_config_t dnp3_event_buffer_config_init(uint16_t max_binary, uint16_t max_double_bit_binary, uint16_t max_binary_output_status, uint16_t max_counter, uint16_t max_frozen_counter, uint16_t max_analog, uint16_t max_analog_output_status, uint16_t max_octet_string)
4776{
4777 dnp3_event_buffer_config_t _return_value = {
4778 max_binary,
4779 max_double_bit_binary,
4780 max_binary_output_status,
4781 max_counter,
4782 max_frozen_counter,
4783 max_analog,
4784 max_analog_output_status,
4785 max_octet_string
4786 };
4787 return _return_value;
4788}
4789
4804{
4805 dnp3_event_buffer_config_t _return_value = {
4806 0,
4807 0,
4808 0,
4809 0,
4810 0,
4811 0,
4812 0,
4813 0
4814 };
4815 return _return_value;
4816}
4817
4818
4820
4823{
4843
4858{
4859 dnp3_class_zero_config_t _return_value = {
4860 true,
4861 true,
4862 true,
4863 true,
4864 true,
4865 true,
4866 true,
4867 false
4868 };
4869 return _return_value;
4870}
4871
4872
4874
4877{
4885
4895{
4896 dnp3_outstation_features_t _return_value = {
4897 false,
4898 true,
4899 true
4900 };
4901 return _return_value;
4902}
4903
4904
4906
4909{
4957
4979static dnp3_outstation_config_t dnp3_outstation_config_init(uint16_t outstation_address, uint16_t master_address, dnp3_event_buffer_config_t event_buffer_config)
4980{
4981 dnp3_outstation_config_t _return_value = {
4982 outstation_address,
4983 master_address,
4984 event_buffer_config,
4985 2048,
4986 2048,
4987 2048,
4989 5000,
4990 5000,
4992 4294967295,
4993 5000,
4994 60000,
4995 64,
4996 65535,
4998 };
4999 return _return_value;
5000}
5001
5002
5005{
5013
5018{
5019 switch (value)
5020 {
5021 case DNP3_RESTART_DELAY_TYPE_NOT_SUPPORTED: return "not_supported";
5022 case DNP3_RESTART_DELAY_TYPE_SECONDS: return "seconds";
5023 case DNP3_RESTART_DELAY_TYPE_MILLI_SECONDS: return "milli_seconds";
5024 default: return "unknown restart_delay_type value";
5025 }
5026}
5027
5029
5034{
5038 uint16_t value;
5040
5049{
5050 dnp3_restart_delay_t _return_value = {
5052 0
5053 };
5054 return _return_value;
5055}
5056
5065{
5066 dnp3_restart_delay_t _return_value = {
5068 value
5069 };
5070 return _return_value;
5071}
5072
5081{
5082 dnp3_restart_delay_t _return_value = {
5084 value
5085 };
5086 return _return_value;
5087}
5088
5089
5092{
5100
5105{
5106 switch (value)
5107 {
5108 case DNP3_WRITE_TIME_RESULT_OK: return "ok";
5109 case DNP3_WRITE_TIME_RESULT_PARAMETER_ERROR: return "parameter_error";
5110 case DNP3_WRITE_TIME_RESULT_NOT_SUPPORTED: return "not_supported";
5111 default: return "unknown write_time_result value";
5112 }
5113}
5114
5117{
5123
5128{
5129 switch (value)
5130 {
5131 case DNP3_FREEZE_TYPE_IMMEDIATE_FREEZE: return "immediate_freeze";
5132 case DNP3_FREEZE_TYPE_FREEZE_AND_CLEAR: return "freeze_and_clear";
5133 default: return "unknown freeze_type value";
5134 }
5135}
5136
5139{
5147
5152{
5153 switch (value)
5154 {
5155 case DNP3_FREEZE_RESULT_OK: return "ok";
5156 case DNP3_FREEZE_RESULT_PARAMETER_ERROR: return "parameter_error";
5157 case DNP3_FREEZE_RESULT_NOT_SUPPORTED: return "not_supported";
5158 default: return "unknown freeze_result value";
5159 }
5160}
5161
5163
5166{
5176
5187{
5188 dnp3_application_iin_t _return_value = {
5189 false,
5190 false,
5191 false,
5192 false
5193 };
5194 return _return_value;
5195}
5196
5197
5200{
5201
5211 uint16_t (*get_processing_delay_ms)(void*);
5212
5218
5223
5230
5237
5244
5255 void (*on_destroy)(void* arg);
5257 void* ctx;
5259
5271 uint16_t (*get_processing_delay_ms)(void*),
5272 dnp3_write_time_result_t (*write_absolute_time)(uint64_t, void*),
5273 dnp3_application_iin_t (*get_application_iin)(void*),
5274 dnp3_restart_delay_t (*cold_restart)(void*),
5275 dnp3_restart_delay_t (*warm_restart)(void*),
5276 dnp3_freeze_result_t (*freeze_counters_all)(dnp3_freeze_type_t, dnp3_database_handle_t*, void*),
5277 dnp3_freeze_result_t (*freeze_counters_range)(uint16_t, uint16_t, dnp3_freeze_type_t, dnp3_database_handle_t*, void*),
5278 void (*on_destroy)(void* arg),
5279 void* ctx
5280)
5281{
5282 dnp3_outstation_application_t _return_value = {
5283 get_processing_delay_ms,
5284 write_absolute_time,
5285 get_application_iin,
5286 cold_restart,
5287 warm_restart,
5288 freeze_counters_all,
5289 freeze_counters_range,
5290 on_destroy,
5291 ctx
5292 };
5293 return _return_value;
5294}
5295
5297
5300{
5306
5307
5310{
5320
5325{
5326 switch (value)
5327 {
5328 case DNP3_BROADCAST_ACTION_PROCESSED: return "processed";
5329 case DNP3_BROADCAST_ACTION_IGNORED_BY_CONFIGURATION: return "ignored_by_configuration";
5330 case DNP3_BROADCAST_ACTION_BAD_OBJECT_HEADERS: return "bad_object_headers";
5331 case DNP3_BROADCAST_ACTION_UNSUPPORTED_FUNCTION: return "unsupported_function";
5332 default: return "unknown broadcast_action value";
5333 }
5334}
5335
5340{
5341
5346
5352
5356 void (*enter_solicited_confirm_wait)(uint8_t, void*);
5357
5361 void (*solicited_confirm_timeout)(uint8_t, void*);
5362
5366 void (*solicited_confirm_received)(uint8_t, void*);
5367
5371
5376 void (*wrong_solicited_confirm_seq)(uint8_t, uint8_t, void*);
5377
5382 void (*unexpected_confirm)(bool, uint8_t, void*);
5383
5387 void (*enter_unsolicited_confirm_wait)(uint8_t, void*);
5388
5393 void (*unsolicited_confirm_timeout)(uint8_t, bool, void*);
5394
5398 void (*unsolicited_confirmed)(uint8_t, void*);
5399
5402 void (*clear_restart_iin)(void*);
5405 void (*on_destroy)(void* arg);
5407 void* ctx;
5409
5426 void (*process_request_from_idle)(dnp3_request_header_t, void*),
5427 void (*broadcast_received)(dnp3_function_code_t, dnp3_broadcast_action_t, void*),
5428 void (*enter_solicited_confirm_wait)(uint8_t, void*),
5429 void (*solicited_confirm_timeout)(uint8_t, void*),
5430 void (*solicited_confirm_received)(uint8_t, void*),
5431 void (*solicited_confirm_wait_new_request)(void*),
5432 void (*wrong_solicited_confirm_seq)(uint8_t, uint8_t, void*),
5433 void (*unexpected_confirm)(bool, uint8_t, void*),
5434 void (*enter_unsolicited_confirm_wait)(uint8_t, void*),
5435 void (*unsolicited_confirm_timeout)(uint8_t, bool, void*),
5436 void (*unsolicited_confirmed)(uint8_t, void*),
5437 void (*clear_restart_iin)(void*),
5438 void (*on_destroy)(void* arg),
5439 void* ctx
5440)
5441{
5442 dnp3_outstation_information_t _return_value = {
5443 process_request_from_idle,
5444 broadcast_received,
5445 enter_solicited_confirm_wait,
5446 solicited_confirm_timeout,
5447 solicited_confirm_received,
5448 solicited_confirm_wait_new_request,
5449 wrong_solicited_confirm_seq,
5450 unexpected_confirm,
5451 enter_unsolicited_confirm_wait,
5452 unsolicited_confirm_timeout,
5453 unsolicited_confirmed,
5454 clear_restart_iin,
5455 on_destroy,
5456 ctx
5457 };
5458 return _return_value;
5459}
5460
5463{
5507
5512{
5513 switch (value)
5514 {
5515 case DNP3_COMMAND_STATUS_SUCCESS: return "success";
5516 case DNP3_COMMAND_STATUS_TIMEOUT: return "timeout";
5517 case DNP3_COMMAND_STATUS_NO_SELECT: return "no_select";
5518 case DNP3_COMMAND_STATUS_FORMAT_ERROR: return "format_error";
5519 case DNP3_COMMAND_STATUS_NOT_SUPPORTED: return "not_supported";
5520 case DNP3_COMMAND_STATUS_ALREADY_ACTIVE: return "already_active";
5521 case DNP3_COMMAND_STATUS_HARDWARE_ERROR: return "hardware_error";
5522 case DNP3_COMMAND_STATUS_LOCAL: return "local";
5523 case DNP3_COMMAND_STATUS_TOO_MANY_OPS: return "too_many_ops";
5524 case DNP3_COMMAND_STATUS_NOT_AUTHORIZED: return "not_authorized";
5525 case DNP3_COMMAND_STATUS_AUTOMATION_INHIBIT: return "automation_inhibit";
5526 case DNP3_COMMAND_STATUS_PROCESSING_LIMITED: return "processing_limited";
5527 case DNP3_COMMAND_STATUS_OUT_OF_RANGE: return "out_of_range";
5528 case DNP3_COMMAND_STATUS_DOWNSTREAM_LOCAL: return "downstream_local";
5529 case DNP3_COMMAND_STATUS_ALREADY_COMPLETE: return "already_complete";
5530 case DNP3_COMMAND_STATUS_BLOCKED: return "blocked";
5531 case DNP3_COMMAND_STATUS_CANCELED: return "canceled";
5532 case DNP3_COMMAND_STATUS_BLOCKED_OTHER_MASTER: return "blocked_other_master";
5533 case DNP3_COMMAND_STATUS_DOWNSTREAM_FAIL: return "downstream_fail";
5534 case DNP3_COMMAND_STATUS_NON_PARTICIPATING: return "non_participating";
5535 case DNP3_COMMAND_STATUS_UNKNOWN: return "unknown";
5536 default: return "unknown command_status value";
5537 }
5538}
5539
5542{
5550
5555{
5556 switch (value)
5557 {
5558 case DNP3_OPERATE_TYPE_SELECT_BEFORE_OPERATE: return "select_before_operate";
5559 case DNP3_OPERATE_TYPE_DIRECT_OPERATE: return "direct_operate";
5560 case DNP3_OPERATE_TYPE_DIRECT_OPERATE_NO_ACK: return "direct_operate_no_ack";
5561 default: return "unknown operate_type value";
5562 }
5563}
5564
5567{
5568
5571 void (*begin_fragment)(void*);
5572
5577
5589
5598
5610
5619
5631
5640
5652
5661
5673
5684 void (*on_destroy)(void* arg);
5686 void* ctx;
5688
5705 void (*begin_fragment)(void*),
5706 void (*end_fragment)(dnp3_database_handle_t*, void*),
5707 dnp3_command_status_t (*select_g12v1)(dnp3_group12_var1_t, uint16_t, dnp3_database_handle_t*, void*),
5709 dnp3_command_status_t (*select_g41v1)(int32_t, uint16_t, dnp3_database_handle_t*, void*),
5710 dnp3_command_status_t (*operate_g41v1)(int32_t, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t*, void*),
5711 dnp3_command_status_t (*select_g41v2)(int16_t, uint16_t, dnp3_database_handle_t*, void*),
5712 dnp3_command_status_t (*operate_g41v2)(int16_t, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t*, void*),
5713 dnp3_command_status_t (*select_g41v3)(float, uint16_t, dnp3_database_handle_t*, void*),
5714 dnp3_command_status_t (*operate_g41v3)(float, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t*, void*),
5715 dnp3_command_status_t (*select_g41v4)(double, uint16_t, dnp3_database_handle_t*, void*),
5716 dnp3_command_status_t (*operate_g41v4)(double, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t*, void*),
5717 void (*on_destroy)(void* arg),
5718 void* ctx
5719)
5720{
5721 dnp3_control_handler_t _return_value = {
5722 begin_fragment,
5723 end_fragment,
5724 select_g12v1,
5725 operate_g12v1,
5726 select_g41v1,
5727 operate_g41v1,
5728 select_g41v2,
5729 operate_g41v2,
5730 select_g41v3,
5731 operate_g41v3,
5732 select_g41v4,
5733 operate_g41v4,
5734 on_destroy,
5735 ctx
5736 };
5737 return _return_value;
5738}
5739
5742{
5748
5753{
5754 switch (value)
5755 {
5756 case DNP3_CONNECTION_STATE_CONNECTED: return "connected";
5757 case DNP3_CONNECTION_STATE_DISCONNECTED: return "disconnected";
5758 default: return "unknown connection_state value";
5759 }
5760}
5761
5764{
5765
5772 void (*on_destroy)(void* arg);
5774 void* ctx;
5776
5782 void (*on_change)(dnp3_connection_state_t, void*),
5783 void (*on_destroy)(void* arg),
5784 void* ctx
5785)
5786{
5787 dnp3_connection_state_listener_t _return_value = {
5788 on_change,
5789 on_destroy,
5790 ctx
5791 };
5792 return _return_value;
5793}
5794
5799
5815
5828
5834
5839
5845
5846
5849
5853
5863
5869
5873
5874
5876
5879{
5881 const char* dns_name;
5883 const char* peer_cert_path;
5885 const char* local_cert_path;
5887 const char* private_key_path;
5893 const char* password;
5899
5912static dnp3_tls_server_config_t dnp3_tls_server_config_init(const char* dns_name, const char* peer_cert_path, const char* local_cert_path, const char* private_key_path, const char* password)
5913{
5914 dnp3_tls_server_config_t _return_value = {
5915 dns_name,
5916 peer_cert_path,
5917 local_cert_path,
5918 private_key_path,
5919 password,
5922 };
5923 return _return_value;
5924}
5925
5926
5933
5943
5954
5970
5975
5979
5980
5983const char* dnp3_version();
5984
5985#ifdef __cplusplus
5986}
5987#endif
dnp3_param_error_t dnp3_database_get_counter(dnp3_database_t *instance, uint16_t index, dnp3_counter_t *out)
Get a Counter point.
struct dnp3_counter_iterator_t dnp3_counter_iterator_t
Iterator of counter.
Definition: dnp3.h:1017
dnp3_double_bit_t
Double-bit binary input value.
Definition: dnp3.h:831
@ DNP3_DOUBLE_BIT_DETERMINED_OFF
Determined to be OFF.
Definition: dnp3.h:835
@ DNP3_DOUBLE_BIT_DETERMINED_ON
Determined to be ON.
Definition: dnp3.h:837
@ DNP3_DOUBLE_BIT_INTERMEDIATE
Transition between conditions.
Definition: dnp3.h:833
@ DNP3_DOUBLE_BIT_INDETERMINATE
Abnormal or custom condition.
Definition: dnp3.h:839
void dnp3_request_add_one_byte_range_header(dnp3_request_t *instance, dnp3_variation_t variation, uint8_t start, uint8_t stop)
Add a one-byte start/stop variation interrogation.
static const char * dnp3_static_binary_output_status_variation_to_string(dnp3_static_binary_output_status_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4071
static const char * dnp3_link_status_error_to_string(dnp3_link_status_error_t value)
Converts the enum to a string.
Definition: dnp3.h:3680
dnp3_param_error_t dnp3_outstation_server_add_outstation(dnp3_outstation_server_t *instance, dnp3_outstation_config_t config, dnp3_outstation_application_t application, dnp3_outstation_information_t information, dnp3_control_handler_t control_handler, dnp3_connection_state_listener_t listener, dnp3_address_filter_t *filter, dnp3_outstation_t **out)
Add an outstation to the server.
dnp3_link_status_error_t
Errors that can occur during a manually initiated link status check. See dnp3_master_channel_check_li...
Definition: dnp3.h:3656
@ DNP3_LINK_STATUS_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:3662
@ DNP3_LINK_STATUS_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:3672
@ DNP3_LINK_STATUS_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:3666
@ DNP3_LINK_STATUS_ERROR_BAD_RESPONSE
response was malformed or contained object headers
Definition: dnp3.h:3664
@ DNP3_LINK_STATUS_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:3674
@ DNP3_LINK_STATUS_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:3670
@ DNP3_LINK_STATUS_ERROR_UNEXPECTED_RESPONSE
There was activity on the link, but it wasn't a LINK_STATUS.
Definition: dnp3.h:3660
@ DNP3_LINK_STATUS_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:3658
@ DNP3_LINK_STATUS_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:3668
dnp3_param_error_t dnp3_runtime_create(dnp3_runtime_config_t config, dnp3_runtime_t **out)
Creates a new runtime for running the protocol stack.
struct dnp3_request_t dnp3_request_t
Custom request.
Definition: dnp3.h:2976
static const char * dnp3_op_type_to_string(dnp3_op_type_t value)
Converts the enum to a string.
Definition: dnp3.h:581
static const char * dnp3_function_code_to_string(dnp3_function_code_t value)
Converts the enum to a string.
Definition: dnp3.h:1857
dnp3_restart_error_t
Errors that can occur during a cold/warm restart operation.
Definition: dnp3.h:3560
@ DNP3_RESTART_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:3562
@ DNP3_RESTART_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:3572
@ DNP3_RESTART_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:3568
@ DNP3_RESTART_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:3570
@ DNP3_RESTART_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:3574
@ DNP3_RESTART_ERROR_BAD_RESPONSE
response was malformed or contained object headers
Definition: dnp3.h:3566
@ DNP3_RESTART_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:3576
@ DNP3_RESTART_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:3564
bool dnp3_database_update_binary_output_status(dnp3_database_t *instance, dnp3_binary_output_status_t value, dnp3_update_options_t options)
Update a Binary Output Status point.
static dnp3_control_code_t dnp3_control_code_from_tcc_and_op_type(dnp3_trip_close_code_t tcc, dnp3_op_type_t op_type)
Initialize a dnp3_control_code_t instance from a dnp3_trip_close_code_t and a dnp3_op_type_t.
Definition: dnp3.h:658
static dnp3_event_buffer_config_t dnp3_event_buffer_config_init(uint16_t max_binary, uint16_t max_double_bit_binary, uint16_t max_binary_output_status, uint16_t max_counter, uint16_t max_frozen_counter, uint16_t max_analog, uint16_t max_analog_output_status, uint16_t max_octet_string)
Fully construct dnp3_event_buffer_config_t specifying the value of each field.
Definition: dnp3.h:4775
void dnp3_command_set_add_g41_v2_u8(dnp3_command_set_t *instance, uint8_t idx, int16_t value)
Add a Analog Output command (signed 16-bit integer) with 1-byte prefix index.
struct dnp3_master_channel_t dnp3_master_channel_t
Represents a communication channel for a master station.
Definition: dnp3.h:2331
static dnp3_link_status_callback_t dnp3_link_status_callback_init(void(*on_complete)(dnp3_nothing_t, void *), void(*on_failure)(dnp3_link_status_error_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:3723
static const char * dnp3_static_analog_input_variation_to_string(dnp3_static_analog_input_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4417
static const char * dnp3_double_bit_to_string(dnp3_double_bit_t value)
Converts the enum to a string.
Definition: dnp3.h:845
dnp3_analog_output_status_t * dnp3_analog_output_status_iterator_next(dnp3_analog_output_status_iterator_t *iter)
returns a pointer to the next value or NULL
static const char * dnp3_event_class_to_string(dnp3_event_class_t value)
Converts the enum to a string.
Definition: dnp3.h:3768
static dnp3_outstation_features_t dnp3_outstation_features_init()
Initialize to default values.
Definition: dnp3.h:4894
static const char * dnp3_time_sync_error_to_string(dnp3_time_sync_error_t value)
Converts the enum to a string.
Definition: dnp3.h:3485
struct dnp3_outstation_t dnp3_outstation_t
Outstation handle.
Definition: dnp3.h:5798
bool dnp3_database_add_octet_string(dnp3_database_t *instance, uint16_t index, dnp3_event_class_t point_class)
Add a new Octet String point.
static const char * dnp3_flow_control_to_string(dnp3_flow_control_t value)
Converts the enum to a string.
Definition: dnp3.h:1611
dnp3_variation_t
Group/Variation.
Definition: dnp3.h:1244
@ DNP3_VARIATION_GROUP30_VAR6
Analog Input - Double-precision floating point with flags.
Definition: dnp3.h:1346
@ DNP3_VARIATION_GROUP42_VAR4
Analog Output Event - 16-bit with time.
Definition: dnp3.h:1394
@ DNP3_VARIATION_GROUP11_VAR2
Binary Output Event - With time.
Definition: dnp3.h:1284
@ DNP3_VARIATION_GROUP1_VAR1
Binary Input - Packed format.
Definition: dnp3.h:1248
@ DNP3_VARIATION_GROUP20_VAR6
Counter - 16-bit without flag.
Definition: dnp3.h:1298
@ DNP3_VARIATION_GROUP40_VAR3
Analog Output Status - Single-precision floating point with flags.
Definition: dnp3.h:1372
@ DNP3_VARIATION_GROUP23_VAR0
Frozen Counter Event - Default variation.
Definition: dnp3.h:1324
@ DNP3_VARIATION_GROUP1_VAR2
Binary Input - With flags.
Definition: dnp3.h:1250
@ DNP3_VARIATION_GROUP41_VAR4
Analog Output - Double-precision floating point.
Definition: dnp3.h:1384
@ DNP3_VARIATION_GROUP22_VAR1
Counter Event - 32-bit with flags.
Definition: dnp3.h:1316
@ DNP3_VARIATION_GROUP32_VAR0
Analog Input Event - Default variation.
Definition: dnp3.h:1348
@ DNP3_VARIATION_GROUP3_VAR2
Double-bit Binary Input - With flags.
Definition: dnp3.h:1264
@ DNP3_VARIATION_GROUP111
Octet String Event.
Definition: dnp3.h:1430
@ DNP3_VARIATION_GROUP21_VAR1
Frozen Counter - 32-bit with flags.
Definition: dnp3.h:1302
@ DNP3_VARIATION_GROUP60_VAR2
Class objects - Class 1 data.
Definition: dnp3.h:1420
@ DNP3_VARIATION_GROUP11_VAR1
Binary Output Event - Without time.
Definition: dnp3.h:1282
@ DNP3_VARIATION_GROUP2_VAR1
Binary Input Event - Without time.
Definition: dnp3.h:1254
@ DNP3_VARIATION_GROUP30_VAR1
Analog Input - 32-bit with flags.
Definition: dnp3.h:1336
@ DNP3_VARIATION_GROUP40_VAR4
Analog Output Status - Double-precision floating point with flags.
Definition: dnp3.h:1374
@ DNP3_VARIATION_GROUP32_VAR8
Analog Input Event - Double-precision floating point with time.
Definition: dnp3.h:1364
@ DNP3_VARIATION_GROUP23_VAR1
Frozen Counter Event - 32-bit with flags.
Definition: dnp3.h:1326
@ DNP3_VARIATION_GROUP11_VAR0
Binary Output Event - Default variation.
Definition: dnp3.h:1280
@ DNP3_VARIATION_GROUP42_VAR6
Analog Output Event - Double-precision floating point without time.
Definition: dnp3.h:1398
@ DNP3_VARIATION_GROUP3_VAR1
Double-bit Binary Input - Packed format.
Definition: dnp3.h:1262
@ DNP3_VARIATION_GROUP60_VAR1
Class objects - Class 0 data.
Definition: dnp3.h:1418
@ DNP3_VARIATION_GROUP23_VAR2
Frozen Counter Event - 16-bit with flags.
Definition: dnp3.h:1328
@ DNP3_VARIATION_GROUP40_VAR0
Analog Output Status - Default variation.
Definition: dnp3.h:1366
@ DNP3_VARIATION_GROUP52_VAR2
Time delay - Fine.
Definition: dnp3.h:1416
@ DNP3_VARIATION_GROUP42_VAR8
Analog Output Event - Double-preicions floating point with time.
Definition: dnp3.h:1402
@ DNP3_VARIATION_GROUP30_VAR5
Analog Input - Single-precision floating point with flags.
Definition: dnp3.h:1344
@ DNP3_VARIATION_GROUP1_VAR0
Binary Input - Default variation.
Definition: dnp3.h:1246
@ DNP3_VARIATION_GROUP40_VAR1
Analog Output Status - 32-bit with flags.
Definition: dnp3.h:1368
@ DNP3_VARIATION_GROUP12_VAR0
Binary Output Command - Control Relay Output Block.
Definition: dnp3.h:1286
@ DNP3_VARIATION_GROUP21_VAR2
Frozen Counter - 16-bit with flags.
Definition: dnp3.h:1304
@ DNP3_VARIATION_GROUP40_VAR2
Analog Output Status - 16-bit with flags.
Definition: dnp3.h:1370
@ DNP3_VARIATION_GROUP20_VAR0
Counter - Default variation.
Definition: dnp3.h:1290
@ DNP3_VARIATION_GROUP4_VAR3
Double-bit Binary Input Event - With relative time.
Definition: dnp3.h:1272
@ DNP3_VARIATION_GROUP22_VAR2
Counter Event - 16-bit with flags.
Definition: dnp3.h:1318
@ DNP3_VARIATION_GROUP32_VAR6
Analog Input Event - Double-precision floating point without time.
Definition: dnp3.h:1360
@ DNP3_VARIATION_GROUP42_VAR0
Analog Output Event - Default variation.
Definition: dnp3.h:1386
@ DNP3_VARIATION_GROUP42_VAR2
Analog Output Event - 16-bit without time.
Definition: dnp3.h:1390
@ DNP3_VARIATION_GROUP30_VAR2
Analog Input - 16-bit with flags.
Definition: dnp3.h:1338
@ DNP3_VARIATION_GROUP22_VAR0
Counter Event - Default variation.
Definition: dnp3.h:1314
@ DNP3_VARIATION_GROUP30_VAR3
Analog Input - 32-bit without flag.
Definition: dnp3.h:1340
@ DNP3_VARIATION_GROUP41_VAR2
Analog Output - 16-bit.
Definition: dnp3.h:1380
@ DNP3_VARIATION_GROUP32_VAR5
Analog Input Event - Single-precision floating point without time.
Definition: dnp3.h:1358
@ DNP3_VARIATION_GROUP20_VAR2
Counter - 16-bit with flags.
Definition: dnp3.h:1294
@ DNP3_VARIATION_GROUP12_VAR1
Binary Output Command - Pattern Control Block.
Definition: dnp3.h:1288
@ DNP3_VARIATION_GROUP41_VAR1
Analog Output - 32-bit.
Definition: dnp3.h:1378
@ DNP3_VARIATION_GROUP50_VAR1
Time and Date - Absolute time.
Definition: dnp3.h:1404
@ DNP3_VARIATION_GROUP52_VAR1
Time delay - Coarse.
Definition: dnp3.h:1414
@ DNP3_VARIATION_GROUP32_VAR3
Analog Input Event - 32-bit with time.
Definition: dnp3.h:1354
@ DNP3_VARIATION_GROUP4_VAR2
Double-bit Binary Input Event - With absolute time.
Definition: dnp3.h:1270
@ DNP3_VARIATION_GROUP21_VAR0
Frozen Counter - Default variation.
Definition: dnp3.h:1300
@ DNP3_VARIATION_GROUP23_VAR6
Frozen Counter Event - 16-bit with flags and time.
Definition: dnp3.h:1332
@ DNP3_VARIATION_GROUP110
Octet String.
Definition: dnp3.h:1428
@ DNP3_VARIATION_GROUP42_VAR7
Analog Output Event - Single-preicions floating point with time.
Definition: dnp3.h:1400
@ DNP3_VARIATION_GROUP42_VAR5
Analog Output Event - Single-precision floating point without time.
Definition: dnp3.h:1396
@ DNP3_VARIATION_GROUP21_VAR5
Frozen Counter - 32-bit with flags and time.
Definition: dnp3.h:1306
@ DNP3_VARIATION_GROUP22_VAR6
Counter Event - 16-bit with flags and time.
Definition: dnp3.h:1322
@ DNP3_VARIATION_GROUP21_VAR6
Frozen Counter - 16-bit with flags and time.
Definition: dnp3.h:1308
@ DNP3_VARIATION_GROUP10_VAR1
Binary Output - Packed format.
Definition: dnp3.h:1276
@ DNP3_VARIATION_GROUP22_VAR5
Counter Event - 32-bit with flags and time.
Definition: dnp3.h:1320
@ DNP3_VARIATION_GROUP2_VAR3
Binary Input Event - With relative time.
Definition: dnp3.h:1258
@ DNP3_VARIATION_GROUP32_VAR1
Analog Input Event - 32-bit without time.
Definition: dnp3.h:1350
@ DNP3_VARIATION_GROUP32_VAR4
Analog Input Event - 16-bit with time.
Definition: dnp3.h:1356
@ DNP3_VARIATION_GROUP2_VAR0
Binary Input Event - Default variation.
Definition: dnp3.h:1252
@ DNP3_VARIATION_GROUP21_VAR10
Frozen Counter - 16-bit without flag.
Definition: dnp3.h:1312
@ DNP3_VARIATION_GROUP51_VAR1
Time and date CTO - Absolute time, synchronized.
Definition: dnp3.h:1410
@ DNP3_VARIATION_GROUP20_VAR5
Counter - 32-bit without flag.
Definition: dnp3.h:1296
@ DNP3_VARIATION_GROUP4_VAR0
Double-bit Binary Input Event - Default variation.
Definition: dnp3.h:1266
@ DNP3_VARIATION_GROUP32_VAR2
Analog Input Event - 16-bit without time.
Definition: dnp3.h:1352
@ DNP3_VARIATION_GROUP10_VAR0
Binary Output - Default variation.
Definition: dnp3.h:1274
@ DNP3_VARIATION_GROUP50_VAR4
Time and Date - Indexed absolute time and long interval.
Definition: dnp3.h:1408
@ DNP3_VARIATION_GROUP60_VAR3
Class objects - Class 2 data.
Definition: dnp3.h:1422
@ DNP3_VARIATION_GROUP80_VAR1
Internal Indications - Packed format.
Definition: dnp3.h:1426
@ DNP3_VARIATION_GROUP30_VAR4
Analog Input - 16-bit without flag.
Definition: dnp3.h:1342
@ DNP3_VARIATION_GROUP51_VAR2
Time and date CTO - Absolute time, unsynchronized.
Definition: dnp3.h:1412
@ DNP3_VARIATION_GROUP32_VAR7
Analog Input Event - Single-precision floating point with time.
Definition: dnp3.h:1362
@ DNP3_VARIATION_GROUP3_VAR0
Double-bit Binary Input - Default variation.
Definition: dnp3.h:1260
@ DNP3_VARIATION_GROUP42_VAR3
Analog Output Event - 32-bit with time.
Definition: dnp3.h:1392
@ DNP3_VARIATION_GROUP20_VAR1
Counter - 32-bit with flags.
Definition: dnp3.h:1292
@ DNP3_VARIATION_GROUP10_VAR2
Binary Output - With flags.
Definition: dnp3.h:1278
@ DNP3_VARIATION_GROUP41_VAR0
Analog Output - Default variation.
Definition: dnp3.h:1376
@ DNP3_VARIATION_GROUP2_VAR2
Binary Input Event - With absolute time.
Definition: dnp3.h:1256
@ DNP3_VARIATION_GROUP23_VAR5
Frozen Counter Event - 32-bit with flags and time.
Definition: dnp3.h:1330
@ DNP3_VARIATION_GROUP41_VAR3
Analog Output - Single-precision floating point.
Definition: dnp3.h:1382
@ DNP3_VARIATION_GROUP42_VAR1
Analog Output Event - 32-bit without time.
Definition: dnp3.h:1388
@ DNP3_VARIATION_GROUP21_VAR9
Frozen Counter - 32-bit without flag.
Definition: dnp3.h:1310
@ DNP3_VARIATION_GROUP50_VAR3
Time and Date - Absolute time at last recorded time.
Definition: dnp3.h:1406
@ DNP3_VARIATION_GROUP30_VAR0
Analog Input - Default variation.
Definition: dnp3.h:1334
@ DNP3_VARIATION_GROUP4_VAR1
Double-bit Binary Input Event - Without time.
Definition: dnp3.h:1268
@ DNP3_VARIATION_GROUP60_VAR4
Class objects - Class 3 data.
Definition: dnp3.h:1424
static dnp3_tls_server_config_t dnp3_tls_server_config_init(const char *dns_name, const char *peer_cert_path, const char *local_cert_path, const char *private_key_path, const char *password)
construct the configuration with defaults
Definition: dnp3.h:5912
void dnp3_request_add_two_byte_limited_count_header(dnp3_request_t *instance, dnp3_variation_t variation, uint16_t count)
Add a two-byte limited count variation interrogation.
static const char * dnp3_event_analog_output_status_variation_to_string(dnp3_event_analog_output_status_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4583
static const char * dnp3_phys_decode_level_to_string(dnp3_phys_decode_level_t value)
Converts the enum to a string.
Definition: dnp3.h:406
dnp3_param_error_t dnp3_database_get_frozen_counter(dnp3_database_t *instance, uint16_t index, dnp3_frozen_counter_t *out)
Get a Frozen Counter point.
static dnp3_event_classes_t dnp3_event_classes_all()
Initialize all classes to true.
Definition: dnp3.h:2549
static dnp3_timestamp_t dnp3_timestamp_synchronized_timestamp(uint64_t value)
Creates a synchronized timestamp struct.
Definition: dnp3.h:803
bool dnp3_database_update_analog_input(dnp3_database_t *instance, dnp3_analog_input_t value, dnp3_update_options_t options)
Update a AnalogInput point.
dnp3_restart_delay_type_t
Type of restart delay value. Used by dnp3_restart_delay_t.
Definition: dnp3.h:5005
@ DNP3_RESTART_DELAY_TYPE_NOT_SUPPORTED
Restart mode not supported.
Definition: dnp3.h:5007
@ DNP3_RESTART_DELAY_TYPE_MILLI_SECONDS
Value is in milliseconds (corresponds to g51v2)
Definition: dnp3.h:5011
@ DNP3_RESTART_DELAY_TYPE_SECONDS
Value is in seconds (corresponds to g51v1)
Definition: dnp3.h:5009
static dnp3_database_transaction_t dnp3_database_transaction_init(void(*execute)(dnp3_database_t *, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:4717
static dnp3_restart_delay_t dnp3_restart_delay_not_supported()
RestartDelay indicating that the request is not supported.
Definition: dnp3.h:5048
static const char * dnp3_link_error_mode_to_string(dnp3_link_error_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:1721
void dnp3_command_set_add_g41_v4_u16(dnp3_command_set_t *instance, uint16_t idx, double value)
Add a Analog Output command (double-precision float) with 2-byte prefix index.
static dnp3_association_information_t dnp3_association_information_init(void(*task_start)(dnp3_task_type_t, dnp3_function_code_t, uint8_t, void *), void(*task_success)(dnp3_task_type_t, dnp3_function_code_t, uint8_t, void *), void(*task_fail)(dnp3_task_type_t, dnp3_task_error_t, void *), void(*unsolicited_response)(bool, uint8_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:2953
static const char * dnp3_event_analog_input_variation_to_string(dnp3_event_analog_input_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4455
struct dnp3_analog_output_status_iterator_t dnp3_analog_output_status_iterator_t
Iterator of analog_output_status.
Definition: dnp3.h:1143
dnp3_octet_string_value_t * dnp3_octet_string_value_create()
Creates an instance of the collection.
void dnp3_outstation_transaction(dnp3_outstation_t *instance, dnp3_database_transaction_t callback)
Acquire a mutex on the underlying database and apply a set of changes as a transaction.
static dnp3_analog_input_t dnp3_analog_input_init(uint16_t index, double value, dnp3_flags_t flags, dnp3_timestamp_t time)
Fully construct dnp3_analog_input_t specifying the value of each field.
Definition: dnp3.h:1088
dnp3_event_binary_output_status_variation_t
Event binary output status variation.
Definition: dnp3.h:4083
@ DNP3_EVENT_BINARY_OUTPUT_STATUS_VARIATION_GROUP11_VAR2
Binary output event - status with time.
Definition: dnp3.h:4087
@ DNP3_EVENT_BINARY_OUTPUT_STATUS_VARIATION_GROUP11_VAR1
Binary output event - status without time.
Definition: dnp3.h:4085
void dnp3_command_set_add_g41_v2_u16(dnp3_command_set_t *instance, uint16_t idx, int16_t value)
Add a Analog Output command (signed 16-bit integer) with 2-byte prefix index.
static dnp3_double_bit_binary_input_t dnp3_double_bit_binary_input_init(uint16_t index, dnp3_double_bit_t value, dnp3_flags_t flags, dnp3_timestamp_t time)
Fully construct dnp3_double_bit_binary_input_t specifying the value of each field.
Definition: dnp3.h:920
dnp3_event_binary_input_variation_t
Event binary input variation.
Definition: dnp3.h:3877
@ DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR2
Binary input event - with absolute time.
Definition: dnp3.h:3881
@ DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR3
Binary input event - with relative time.
Definition: dnp3.h:3883
@ DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR1
Binary input event - without time.
Definition: dnp3.h:3879
const char * dnp3_version()
Get the version of the library as a string.
dnp3_read_type_t
Describes the source of a read event.
Definition: dnp3.h:2052
@ DNP3_READ_TYPE_UNSOLICITED
Unsolicited message.
Definition: dnp3.h:2056
@ DNP3_READ_TYPE_STARTUP_INTEGRITY
Startup integrity poll.
Definition: dnp3.h:2054
@ DNP3_READ_TYPE_SINGLE_POLL
Single poll requested by the user.
Definition: dnp3.h:2058
@ DNP3_READ_TYPE_PERIODIC_POLL
Periodic poll configured by the user.
Definition: dnp3.h:2060
dnp3_param_error_t dnp3_master_channel_add_poll(dnp3_master_channel_t *instance, dnp3_association_id_t id, dnp3_request_t *request, uint64_t period, dnp3_poll_id_t *out)
Add a periodic poll to an association.
static const char * dnp3_min_tls_version_to_string(dnp3_min_tls_version_t value)
Converts the enum to a string.
Definition: dnp3.h:1743
static const char * dnp3_event_double_bit_binary_input_variation_to_string(dnp3_event_double_bit_binary_input_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:3992
uint8_t * dnp3_byte_iterator_next(dnp3_byte_iterator_t *iter)
returns a pointer to the next value or NULL
static dnp3_application_iin_t dnp3_application_iin_init()
Initialize all fields in dnp3_application_iin_t to false.
Definition: dnp3.h:5186
dnp3_param_error_t dnp3_database_get_analog_output_status(dnp3_database_t *instance, uint16_t index, dnp3_analog_output_status_t *out)
Get a Analog Output Status point.
static dnp3_connect_strategy_t dnp3_connect_strategy_init()
Initialize to default values.
Definition: dnp3.h:2409
dnp3_param_error_t dnp3_outstation_server_create_tls_server(dnp3_runtime_t *runtime, dnp3_link_error_mode_t link_error_mode, const char *address, dnp3_tls_server_config_t tls_config, dnp3_outstation_server_t **out)
Create a new TLS server.
dnp3_min_tls_version_t
Minimum TLS version to allow.
Definition: dnp3.h:1733
@ DNP3_MIN_TLS_VERSION_V12
Allow TLS 1.2 and 1.3.
Definition: dnp3.h:1735
@ DNP3_MIN_TLS_VERSION_V13
Only allow TLS 1.3.
Definition: dnp3.h:1737
dnp3_certificate_mode_t
Determines how the certificate(s) presented by the peer are validated.
Definition: dnp3.h:1757
@ DNP3_CERTIFICATE_MODE_SELF_SIGNED
Validates that the peer presents a single certificate which is a byte-for-byte match against the conf...
Definition: dnp3.h:1767
@ DNP3_CERTIFICATE_MODE_AUTHORITY_BASED
Validates the peer certificate against one or more configured trust anchors.
Definition: dnp3.h:1763
static dnp3_association_config_t dnp3_association_config_init(dnp3_event_classes_t disable_unsol_classes, dnp3_event_classes_t enable_unsol_classes, dnp3_classes_t startup_integrity_classes, dnp3_event_classes_t event_scan_on_events_available)
Initialize the configuration with the specified values.
Definition: dnp3.h:2724
static const char * dnp3_command_error_to_string(dnp3_command_error_t value)
Converts the enum to a string.
Definition: dnp3.h:3356
static const char * dnp3_command_mode_to_string(dnp3_command_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:3318
void dnp3_command_set_add_g41_v1_u8(dnp3_command_set_t *instance, uint8_t idx, int32_t value)
Add a Analog Output command (signed 32-bit integer) with 1-byte prefix index.
void dnp3_request_add_all_objects_header(dnp3_request_t *instance, dnp3_variation_t variation)
Add an all objects variation interrogation.
static dnp3_frozen_counter_t dnp3_frozen_counter_init(uint16_t index, uint32_t value, dnp3_flags_t flags, dnp3_timestamp_t time)
Fully construct dnp3_frozen_counter_t specifying the value of each field.
Definition: dnp3.h:1046
dnp3_operate_type_t
Enumeration describing how the master requested the control operation.
Definition: dnp3.h:5542
@ DNP3_OPERATE_TYPE_SELECT_BEFORE_OPERATE
control point was properly selected before the operate request
Definition: dnp3.h:5544
@ DNP3_OPERATE_TYPE_DIRECT_OPERATE
operate the control via a DirectOperate request
Definition: dnp3.h:5546
@ DNP3_OPERATE_TYPE_DIRECT_OPERATE_NO_ACK
operate the control via a DirectOperateNoAck request
Definition: dnp3.h:5548
struct dnp3_octet_string_value_t dnp3_octet_string_value_t
Collection of octet_string_value.
Definition: dnp3.h:4660
dnp3_write_time_result_t
Write time result used by dnp3_outstation_application_t::write_absolute_time.
Definition: dnp3.h:5092
@ DNP3_WRITE_TIME_RESULT_OK
The write time operation succeeded.
Definition: dnp3.h:5094
@ DNP3_WRITE_TIME_RESULT_NOT_SUPPORTED
Writing time is not supported by this outstation (translated to NO_FUNC_CODE_SUPPORT).
Definition: dnp3.h:5098
@ DNP3_WRITE_TIME_RESULT_PARAMETER_ERROR
The request parameters are nonsensical.
Definition: dnp3.h:5096
void dnp3_octet_string_value_add(dnp3_octet_string_value_t *instance, uint8_t value)
Add a value to the collection.
void dnp3_request_add_one_byte_limited_count_header(dnp3_request_t *instance, dnp3_variation_t variation, uint8_t count)
Add a one-byte limited count variation interrogation.
dnp3_param_error_t dnp3_master_channel_read_with_handler(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_request_t *request, dnp3_read_handler_t handler, dnp3_read_task_callback_t callback)
Perform a read on the association.
dnp3_static_binary_output_status_variation_t
Static binary output status variation.
Definition: dnp3.h:4061
@ DNP3_STATIC_BINARY_OUTPUT_STATUS_VARIATION_GROUP10_VAR2
Binary output - output status with flags.
Definition: dnp3.h:4065
@ DNP3_STATIC_BINARY_OUTPUT_STATUS_VARIATION_GROUP10_VAR1
Binary output - packed format.
Definition: dnp3.h:4063
static dnp3_command_task_callback_t dnp3_command_task_callback_init(void(*on_complete)(dnp3_nothing_t, void *), void(*on_failure)(dnp3_command_error_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:3400
static dnp3_utc_timestamp_t dnp3_utc_timestamp_invalid()
Construct an invalid dnp3_utc_timestamp_t.
Definition: dnp3.h:2780
dnp3_param_error_t dnp3_master_channel_demand_poll(dnp3_master_channel_t *instance, dnp3_poll_id_t poll_id)
Demand the immediate execution of a poll previously created with dnp3_master_channel_add_poll.
bool dnp3_database_remove_frozen_counter(dnp3_database_t *instance, uint16_t index)
Remove a Frozen Counter point.
void dnp3_command_set_add_g41_v1_u16(dnp3_command_set_t *instance, uint16_t idx, int32_t value)
Add a Analog Output command (signed 32-bit integer) with 2-byte prefix index.
void dnp3_address_filter_destroy(dnp3_address_filter_t *instance)
Destroy an address filter.
static dnp3_classes_t dnp3_classes_init(bool class0, bool class1, bool class2, bool class3)
Fully construct dnp3_classes_t specifying the value of each field.
Definition: dnp3.h:2599
dnp3_param_error_t dnp3_master_channel_read(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_request_t *request, dnp3_read_task_callback_t callback)
Perform a read on the association.
dnp3_param_error_t dnp3_outstation_create_serial_session_fault_tolerant(dnp3_runtime_t *runtime, const char *serial_path, dnp3_serial_settings_t settings, uint64_t open_retry_delay, dnp3_outstation_config_t config, dnp3_outstation_application_t application, dnp3_outstation_information_t information, dnp3_control_handler_t control_handler, dnp3_outstation_t **out)
Create an outstation instance running on a serial port which is tolerant to the serial port being add...
void dnp3_endpoint_list_add(dnp3_endpoint_list_t *instance, const char *endpoint)
Add an IP endpoint to the list.
dnp3_event_mode_t
Controls how events are processed when updating values in the database.
Definition: dnp3.h:3782
@ DNP3_EVENT_MODE_SUPPRESS
Never produce an event regardless of change.
Definition: dnp3.h:3790
@ DNP3_EVENT_MODE_DETECT
Detect events in a type dependent fashion.
Definition: dnp3.h:3786
@ DNP3_EVENT_MODE_FORCE
Produce an event whether the value has changed or not.
Definition: dnp3.h:3788
bool dnp3_database_add_frozen_counter(dnp3_database_t *instance, uint16_t index, dnp3_event_class_t point_class, dnp3_frozen_counter_config_t config)
Add a new Frozen Counter point.
static const char * dnp3_connection_state_to_string(dnp3_connection_state_t value)
Converts the enum to a string.
Definition: dnp3.h:5752
dnp3_param_error_t
Error type used throughout the library.
Definition: dnp3.h:46
@ DNP3_PARAM_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:48
@ DNP3_PARAM_ERROR_OTHER_TLS_ERROR
Other TLS error.
Definition: dnp3.h:92
@ DNP3_PARAM_ERROR_INVALID_PEER_CERTIFICATE
Invalid peer certificate file.
Definition: dnp3.h:84
@ DNP3_PARAM_ERROR_SERVER_ALREADY_STARTED
Server already started.
Definition: dnp3.h:68
@ DNP3_PARAM_ERROR_INVALID_PRIVATE_KEY
Invalid private key file.
Definition: dnp3.h:88
@ DNP3_PARAM_ERROR_INVALID_TIMEOUT
The supplied timeout value is too small or too large.
Definition: dnp3.h:50
@ DNP3_PARAM_ERROR_ADDRESS_FILTER_CONFLICT
Conflict in the address filter specification.
Definition: dnp3.h:66
@ DNP3_PARAM_ERROR_LOGGING_ALREADY_CONFIGURED
Logging can only be configured once.
Definition: dnp3.h:80
@ DNP3_PARAM_ERROR_INVALID_BUFFER_SIZE
Invalid buffer size.
Definition: dnp3.h:64
@ DNP3_PARAM_ERROR_ASSOCIATION_DOES_NOT_EXIST
The specified association does not exist.
Definition: dnp3.h:56
@ DNP3_PARAM_ERROR_POINT_DOES_NOT_EXIST
Point does not exist.
Definition: dnp3.h:82
@ DNP3_PARAM_ERROR_SERVER_BIND_ERROR
Server failed to bind to the specified port.
Definition: dnp3.h:70
@ DNP3_PARAM_ERROR_RUNTIME_CANNOT_BLOCK_WITHIN_ASYNC
Runtime cannot execute blocking call within asynchronous context.
Definition: dnp3.h:78
@ DNP3_PARAM_ERROR_INVALID_SOCKET_ADDRESS
Invalid socket address.
Definition: dnp3.h:60
@ DNP3_PARAM_ERROR_NO_SUPPORT
Native library was compiled without support for this feature.
Definition: dnp3.h:54
@ DNP3_PARAM_ERROR_ASSOCIATION_DUPLICATE_ADDRESS
Duplicate association address.
Definition: dnp3.h:58
@ DNP3_PARAM_ERROR_RUNTIME_CREATION_FAILURE
Failed to create Tokio runtime.
Definition: dnp3.h:74
@ DNP3_PARAM_ERROR_INVALID_DNP3_ADDRESS
Invalid link-layer DNP3 address.
Definition: dnp3.h:62
@ DNP3_PARAM_ERROR_MASTER_ALREADY_SHUTDOWN
Master was already shutdown.
Definition: dnp3.h:72
@ DNP3_PARAM_ERROR_NULL_PARAMETER
Null parameter.
Definition: dnp3.h:52
@ DNP3_PARAM_ERROR_RUNTIME_DESTROYED
Runtime has already been disposed.
Definition: dnp3.h:76
@ DNP3_PARAM_ERROR_INVALID_LOCAL_CERTIFICATE
Invalid local certificate file.
Definition: dnp3.h:86
@ DNP3_PARAM_ERROR_INVALID_DNS_NAME
Invalid DNS name.
Definition: dnp3.h:90
dnp3_freeze_result_t
Result of a freeze operation.
Definition: dnp3.h:5139
@ DNP3_FREEZE_RESULT_OK
Freeze operation was successful.
Definition: dnp3.h:5141
@ DNP3_FREEZE_RESULT_PARAMETER_ERROR
The request parameters are nonsensical.
Definition: dnp3.h:5143
@ DNP3_FREEZE_RESULT_NOT_SUPPORTED
The demanded freeze operation is not supported by this device.
Definition: dnp3.h:5145
dnp3_port_state_t
State of the serial port.
Definition: dnp3.h:1183
@ DNP3_PORT_STATE_SHUTDOWN
Task has been shut down.
Definition: dnp3.h:1191
@ DNP3_PORT_STATE_WAIT
Waiting to perform an open retry.
Definition: dnp3.h:1187
@ DNP3_PORT_STATE_DISABLED
Disabled until enabled.
Definition: dnp3.h:1185
@ DNP3_PORT_STATE_OPEN
Port is open.
Definition: dnp3.h:1189
dnp3_param_error_t dnp3_master_channel_create_tcp(dnp3_runtime_t *runtime, dnp3_link_error_mode_t link_error_mode, dnp3_master_channel_config_t config, dnp3_endpoint_list_t *endpoints, dnp3_connect_strategy_t connect_strategy, dnp3_client_state_listener_t listener, dnp3_master_channel_t **out)
Create a master channel that connects to the specified TCP endpoint(s)
dnp3_nothing_t
A single value enum which is used as a placeholder for futures that don't return a value.
Definition: dnp3.h:2422
@ DNP3_NOTHING_NOTHING
the only value this enum has
Definition: dnp3.h:2424
dnp3_param_error_t dnp3_master_channel_get_decode_level(dnp3_master_channel_t *instance, dnp3_decode_level_t *out)
Get the decoding level for the channel.
dnp3_phys_decode_level_t
Controls how data transmitted at the physical layer (TCP, serial, etc) is logged.
Definition: dnp3.h:394
@ DNP3_PHYS_DECODE_LEVEL_LENGTH
Log only the length of data that is sent and received.
Definition: dnp3.h:398
@ DNP3_PHYS_DECODE_LEVEL_NOTHING
Log nothing.
Definition: dnp3.h:396
@ DNP3_PHYS_DECODE_LEVEL_DATA
Log the length and the actual data that is sent and received.
Definition: dnp3.h:400
static const char * dnp3_static_frozen_counter_variation_to_string(dnp3_static_frozen_counter_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4295
dnp3_time_format_t
Describes if and how the time will be formatted in log messages.
Definition: dnp3.h:208
@ DNP3_TIME_FORMAT_NONE
Don't format the timestamp as part of the message.
Definition: dnp3.h:210
@ DNP3_TIME_FORMAT_SYSTEM
Format the time in a human readable format e.g. 'Jun 25 14:27:12.955'.
Definition: dnp3.h:214
@ DNP3_TIME_FORMAT_RFC_3339
Format the time using RFC 3339.
Definition: dnp3.h:212
dnp3_param_error_t dnp3_master_channel_create_serial(dnp3_runtime_t *runtime, dnp3_master_channel_config_t config, const char *path, dnp3_serial_settings_t serial_params, uint64_t open_retry_delay, dnp3_port_state_listener_t listener, dnp3_master_channel_t **out)
Create a master channel on the specified serial port.
bool dnp3_database_remove_binary_input(dnp3_database_t *instance, uint16_t index)
Remove a BinaryInput point.
static dnp3_control_handler_t dnp3_control_handler_init(void(*begin_fragment)(void *), void(*end_fragment)(dnp3_database_handle_t *, void *), dnp3_command_status_t(*select_g12v1)(dnp3_group12_var1_t, uint16_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*operate_g12v1)(dnp3_group12_var1_t, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*select_g41v1)(int32_t, uint16_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*operate_g41v1)(int32_t, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*select_g41v2)(int16_t, uint16_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*operate_g41v2)(int16_t, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*select_g41v3)(float, uint16_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*operate_g41v3)(float, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*select_g41v4)(double, uint16_t, dnp3_database_handle_t *, void *), dnp3_command_status_t(*operate_g41v4)(double, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:5704
static dnp3_decode_level_t dnp3_decode_level_nothing()
Initialize log levels to nothing.
Definition: dnp3.h:461
static dnp3_restart_delay_t dnp3_restart_delay_milliseconds(uint16_t value)
RestartDelay with a count of milliseconds.
Definition: dnp3.h:5080
dnp3_time_quality_t
Timestamp quality.
Definition: dnp3.h:746
@ DNP3_TIME_QUALITY_SYNCHRONIZED_TIME
The timestamp is UTC synchronized at the remote device.
Definition: dnp3.h:748
@ DNP3_TIME_QUALITY_INVALID_TIME
Timestamp is not valid, ignore the value and use a local timestamp.
Definition: dnp3.h:752
@ DNP3_TIME_QUALITY_UNSYNCHRONIZED_TIME
The device indicates the timestamp may be not be synchronized.
Definition: dnp3.h:750
dnp3_double_bit_binary_input_t * dnp3_double_bit_binary_input_iterator_next(dnp3_double_bit_binary_input_iterator_t *iter)
returns a pointer to the next value or NULL
dnp3_parity_t
Parity checking modes.
Definition: dnp3.h:1624
@ DNP3_PARITY_EVEN
Parity bit sets even number of 1 bits.
Definition: dnp3.h:1630
@ DNP3_PARITY_ODD
Parity bit sets odd number of 1 bits.
Definition: dnp3.h:1628
@ DNP3_PARITY_NONE
No parity bit.
Definition: dnp3.h:1626
dnp3_transport_decode_level_t
Controls how transmitted and received transport segments are decoded at the INFO log level.
Definition: dnp3.h:344
@ DNP3_TRANSPORT_DECODE_LEVEL_HEADER
Decode the header.
Definition: dnp3.h:348
@ DNP3_TRANSPORT_DECODE_LEVEL_NOTHING
Decode nothing.
Definition: dnp3.h:346
@ DNP3_TRANSPORT_DECODE_LEVEL_PAYLOAD
Decode the header and the raw payload as hexadecimal.
Definition: dnp3.h:350
static dnp3_counter_config_t dnp3_counter_config_init()
Initialize to defaults.
Definition: dnp3.h:4236
dnp3_param_error_t dnp3_outstation_create_serial_session(dnp3_runtime_t *runtime, const char *serial_path, dnp3_serial_settings_t settings, dnp3_outstation_config_t config, dnp3_outstation_application_t application, dnp3_outstation_information_t information, dnp3_control_handler_t control_handler, dnp3_outstation_t **out)
Create an outstation instance running on a serial port.
dnp3_command_error_t
Result of a command.
Definition: dnp3.h:3330
@ DNP3_COMMAND_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:3350
@ DNP3_COMMAND_ERROR_HEADER_MISMATCH
Number of headers or objects in the response didn't match the number in the request.
Definition: dnp3.h:3336
@ DNP3_COMMAND_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:3344
@ DNP3_COMMAND_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:3338
@ DNP3_COMMAND_ERROR_BAD_STATUS
Outstation indicated that a command was not SUCCESS.
Definition: dnp3.h:3334
@ DNP3_COMMAND_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:3346
@ DNP3_COMMAND_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:3348
@ DNP3_COMMAND_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:3342
@ DNP3_COMMAND_ERROR_BAD_RESPONSE
response was malformed or contained object headers
Definition: dnp3.h:3340
@ DNP3_COMMAND_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:3332
static const char * dnp3_freeze_type_to_string(dnp3_freeze_type_t value)
Converts the enum to a string.
Definition: dnp3.h:5127
static dnp3_binary_input_config_t dnp3_binary_input_config_init()
Initialize to defaults.
Definition: dnp3.h:3918
dnp3_broadcast_action_t
Enumeration describing how the outstation processed a broadcast request.
Definition: dnp3.h:5310
@ DNP3_BROADCAST_ACTION_PROCESSED
Outstation processed the broadcast.
Definition: dnp3.h:5312
@ DNP3_BROADCAST_ACTION_UNSUPPORTED_FUNCTION
Outstation ignore the broadcast message b/c the function is not supported via Broadcast.
Definition: dnp3.h:5318
@ DNP3_BROADCAST_ACTION_IGNORED_BY_CONFIGURATION
Outstation ignored the broadcast message b/c it is disabled by configuration.
Definition: dnp3.h:5314
@ DNP3_BROADCAST_ACTION_BAD_OBJECT_HEADERS
Outstation was unable to parse the object headers and ignored the request.
Definition: dnp3.h:5316
static const char * dnp3_log_level_to_string(dnp3_log_level_t value)
Converts the enum to a string.
Definition: dnp3.h:169
dnp3_read_error_t
Errors that can occur during a read operation.
Definition: dnp3.h:3129
@ DNP3_READ_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:3145
@ DNP3_READ_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:3141
@ DNP3_READ_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:3137
@ DNP3_READ_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:3139
@ DNP3_READ_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:3131
@ DNP3_READ_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:3133
@ DNP3_READ_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:3143
@ DNP3_READ_ERROR_BAD_RESPONSE
response was malformed or contained object headers
Definition: dnp3.h:3135
bool dnp3_database_add_double_bit_binary_input(dnp3_database_t *instance, uint16_t index, dnp3_event_class_t point_class, dnp3_double_bit_binary_input_config_t config)
Add a new Double-Bit Binary Input point.
static dnp3_class_zero_config_t dnp3_class_zero_config_init()
Initialize to default values.
Definition: dnp3.h:4857
static const char * dnp3_command_status_to_string(dnp3_command_status_t value)
Converts the enum to a string.
Definition: dnp3.h:5511
dnp3_param_error_t dnp3_master_channel_set_decode_level(dnp3_master_channel_t *instance, dnp3_decode_level_t decode_level)
Set the decoding level for the channel.
static const char * dnp3_read_error_to_string(dnp3_read_error_t value)
Converts the enum to a string.
Definition: dnp3.h:3151
static const char * dnp3_broadcast_action_to_string(dnp3_broadcast_action_t value)
Converts the enum to a string.
Definition: dnp3.h:5324
struct dnp3_binary_input_iterator_t dnp3_binary_input_iterator_t
Iterator of binary_input.
Definition: dnp3.h:891
static const char * dnp3_task_type_to_string(dnp3_task_type_t value)
Converts the enum to a string.
Definition: dnp3.h:2855
static dnp3_analog_input_config_t dnp3_analog_input_config_init()
Initialize to defaults.
Definition: dnp3.h:4492
struct dnp3_address_filter_t dnp3_address_filter_t
Outstation address filter.
Definition: dnp3.h:5848
void dnp3_command_set_destroy(dnp3_command_set_t *instance)
Destroy a set of commands.
dnp3_auto_time_sync_t
Automatic time synchronization configuration.
Definition: dnp3.h:2653
@ DNP3_AUTO_TIME_SYNC_LAN
Perform automatic time sync with Record Current Time (0x18) function code.
Definition: dnp3.h:2657
@ DNP3_AUTO_TIME_SYNC_NONE
Do not perform automatic time sync.
Definition: dnp3.h:2655
@ DNP3_AUTO_TIME_SYNC_NON_LAN
Perform automatic time sync with Delay Measurement (0x17) function code.
Definition: dnp3.h:2659
static const char * dnp3_time_sync_mode_to_string(dnp3_time_sync_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:3437
dnp3_command_status_t
Enumeration received from an outstation in response to command request.
Definition: dnp3.h:5463
@ DNP3_COMMAND_STATUS_ALREADY_ACTIVE
command is all ready in progress or its all ready in that mode (value == 5)
Definition: dnp3.h:5475
@ DNP3_COMMAND_STATUS_DOWNSTREAM_FAIL
command not accepted because the outstation is forwarding the request to another downstream device wh...
Definition: dnp3.h:5501
@ DNP3_COMMAND_STATUS_TOO_MANY_OPS
the command has been done too often and has been throttled (value == 8)
Definition: dnp3.h:5481
@ DNP3_COMMAND_STATUS_SUCCESS
command was accepted, initiated, or queued (value == 0)
Definition: dnp3.h:5465
@ DNP3_COMMAND_STATUS_CANCELED
command not accepted because the operation was cancelled (value == 16)
Definition: dnp3.h:5497
@ DNP3_COMMAND_STATUS_NO_SELECT
command requires being selected before operate, configuration issue (value == 2)
Definition: dnp3.h:5469
@ DNP3_COMMAND_STATUS_NON_PARTICIPATING
(deprecated) indicates the outstation shall not issue or perform the control operation (value == 126)
Definition: dnp3.h:5503
@ DNP3_COMMAND_STATUS_LOCAL
the function governed by the control is in local only control (value == 7)
Definition: dnp3.h:5479
@ DNP3_COMMAND_STATUS_AUTOMATION_INHIBIT
command not accepted because it was prevented or inhibited by a local automation process,...
Definition: dnp3.h:5485
@ DNP3_COMMAND_STATUS_DOWNSTREAM_LOCAL
command not accepted because the outstation is forwarding the request to another downstream device wh...
Definition: dnp3.h:5491
@ DNP3_COMMAND_STATUS_PROCESSING_LIMITED
command not accepted because the device cannot process any more activities than are presently in prog...
Definition: dnp3.h:5487
@ DNP3_COMMAND_STATUS_TIMEOUT
command timed out before completing (value == 1)
Definition: dnp3.h:5467
@ DNP3_COMMAND_STATUS_OUT_OF_RANGE
command not accepted because the value is outside the acceptable range permitted for this point (valu...
Definition: dnp3.h:5489
@ DNP3_COMMAND_STATUS_NOT_AUTHORIZED
the command was rejected because the device denied it or an RTU intercepted it (value == 9)
Definition: dnp3.h:5483
@ DNP3_COMMAND_STATUS_UNKNOWN
captures any value not defined in the enumeration
Definition: dnp3.h:5505
@ DNP3_COMMAND_STATUS_FORMAT_ERROR
bad control code or timing values (value == 3)
Definition: dnp3.h:5471
@ DNP3_COMMAND_STATUS_NOT_SUPPORTED
command is not implemented (value == 4)
Definition: dnp3.h:5473
@ DNP3_COMMAND_STATUS_BLOCKED
command not accepted because the requested function is specifically blocked at the outstation (value ...
Definition: dnp3.h:5495
@ DNP3_COMMAND_STATUS_HARDWARE_ERROR
something is stopping the command, often a local/remote interlock (value == 6)
Definition: dnp3.h:5477
@ DNP3_COMMAND_STATUS_ALREADY_COMPLETE
command not accepted because the outstation has already completed the requested operation (value == 1...
Definition: dnp3.h:5493
@ DNP3_COMMAND_STATUS_BLOCKED_OTHER_MASTER
command not accepted because another master is communicating with the outstation and has exclusive ri...
Definition: dnp3.h:5499
static dnp3_classes_t dnp3_classes_all()
Initialize all classes to true.
Definition: dnp3.h:2619
static dnp3_restart_delay_t dnp3_restart_delay_seconds(uint16_t value)
RestartDelay with a count of seconds.
Definition: dnp3.h:5064
static dnp3_timestamp_t dnp3_timestamp_unsynchronized_timestamp(uint64_t value)
Creates an unsynchronized timestamp struct.
Definition: dnp3.h:819
static dnp3_control_code_t dnp3_control_code_init(dnp3_trip_close_code_t tcc, bool clear, dnp3_op_type_t op_type)
Initialize a dnp3_control_code_t instance.
Definition: dnp3.h:618
dnp3_static_analog_input_variation_t
Static analog variation.
Definition: dnp3.h:4399
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR1
Analog input - 32-bit with flag.
Definition: dnp3.h:4401
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR5
Analog input - single-precision, floating-point with flag.
Definition: dnp3.h:4409
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR2
Analog input - 16-bit with flag.
Definition: dnp3.h:4403
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR4
Analog input - 16-bit without flag.
Definition: dnp3.h:4407
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR6
Analog input - double-precision, floating-point with flag.
Definition: dnp3.h:4411
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR3
Analog input - 32-bit without flag.
Definition: dnp3.h:4405
dnp3_request_t * dnp3_request_new_one_byte_range(dnp3_variation_t variation, uint8_t start, uint8_t stop)
Create a new request asking for range of objects (using 8-bit start/stop).
static dnp3_master_channel_config_t dnp3_master_channel_config_init(uint16_t address)
Initialize dnp3_master_channel_config_t to default values.
Definition: dnp3.h:2245
static dnp3_binary_output_status_t dnp3_binary_output_status_init(uint16_t index, bool value, dnp3_flags_t flags, dnp3_timestamp_t time)
Fully construct dnp3_binary_output_status_t specifying the value of each field.
Definition: dnp3.h:962
dnp3_command_set_t * dnp3_command_set_create()
Create a new set of commands.
dnp3_command_mode_t
Command operation mode.
Definition: dnp3.h:3308
@ DNP3_COMMAND_MODE_SELECT_BEFORE_OPERATE
Perform a Select and Operate (0x03 then 0x04)
Definition: dnp3.h:3312
@ DNP3_COMMAND_MODE_DIRECT_OPERATE
Perform a Direct Operate (0x05)
Definition: dnp3.h:3310
void dnp3_request_destroy(dnp3_request_t *instance)
Destroy a request created with dnp3_request_create or dnp3_request_class_request.
static dnp3_event_buffer_config_t dnp3_event_buffer_config_no_events()
Create a configuration where no events are buffered.
Definition: dnp3.h:4803
dnp3_param_error_t dnp3_master_channel_remove_poll(dnp3_master_channel_t *instance, dnp3_poll_id_t poll_id)
Add a periodic poll to an association.
bool dnp3_database_update_counter(dnp3_database_t *instance, dnp3_counter_t value, dnp3_update_options_t options)
Update a Counter point.
static const char * dnp3_operate_type_to_string(dnp3_operate_type_t value)
Converts the enum to a string.
Definition: dnp3.h:5554
dnp3_param_error_t dnp3_database_get_analog_input(dnp3_database_t *instance, uint16_t index, dnp3_analog_input_t *out)
Get a AnalogInput point.
dnp3_address_filter_t * dnp3_address_filter_any()
Create an address filter that accepts any IP address.
dnp3_param_error_t dnp3_address_filter_create(const char *address, dnp3_address_filter_t **out)
Create an address filter that matches a specific address or wildcards.
static const char * dnp3_static_binary_input_variation_to_string(dnp3_static_binary_input_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:3865
dnp3_time_sync_mode_t
Time synchronization mode.
Definition: dnp3.h:3427
@ DNP3_TIME_SYNC_MODE_NON_LAN
Perform a non-LAN time sync with Delay Measurement (0x17) function code.
Definition: dnp3.h:3431
@ DNP3_TIME_SYNC_MODE_LAN
Perform a LAN time sync with Record Current Time (0x18) function code.
Definition: dnp3.h:3429
dnp3_param_error_t dnp3_address_filter_add(dnp3_address_filter_t *instance, const char *address)
Add an accepted IP address to the filter.
dnp3_param_error_t dnp3_outstation_server_create_tcp_server(dnp3_runtime_t *runtime, dnp3_link_error_mode_t link_error_mode, const char *address, dnp3_outstation_server_t **out)
Create a new TCP server.
static const char * dnp3_task_error_to_string(dnp3_task_error_t value)
Converts the enum to a string.
Definition: dnp3.h:2895
dnp3_param_error_t dnp3_master_channel_synchronize_time(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_time_sync_mode_t mode, dnp3_time_sync_task_callback_t callback)
Asynchronously perform a time sync operation to the association.
dnp3_static_double_bit_binary_input_variation_t
Static double-bit binary input variation.
Definition: dnp3.h:3958
@ DNP3_STATIC_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP3_VAR1
Double-bit binary input - packed format.
Definition: dnp3.h:3960
@ DNP3_STATIC_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP3_VAR2
Double-bit binary input - with flags.
Definition: dnp3.h:3962
dnp3_static_binary_input_variation_t
Static binary input variation.
Definition: dnp3.h:3855
@ DNP3_STATIC_BINARY_INPUT_VARIATION_GROUP1_VAR2
Binary input - with flags.
Definition: dnp3.h:3859
@ DNP3_STATIC_BINARY_INPUT_VARIATION_GROUP1_VAR1
Binary input - packed format.
Definition: dnp3.h:3857
static const char * dnp3_event_mode_to_string(dnp3_event_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:3796
dnp3_event_analog_input_variation_t
Event analog variation.
Definition: dnp3.h:4433
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR4
Analog input event - 16-bit with time.
Definition: dnp3.h:4441
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR8
Analog input event - double-precision, floating-point with time.
Definition: dnp3.h:4449
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR1
Analog input event - 32-bit without time.
Definition: dnp3.h:4435
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR3
Analog input event - 32-bit with time.
Definition: dnp3.h:4439
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR2
Analog input event - 16-bit without time.
Definition: dnp3.h:4437
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR5
Analog input event - single-precision, floating-point without time.
Definition: dnp3.h:4443
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR7
Analog input event - single-precision, floating-point with time.
Definition: dnp3.h:4447
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR6
Analog input event - double-precision, floating-point without time.
Definition: dnp3.h:4445
dnp3_param_error_t dnp3_master_channel_disable(dnp3_master_channel_t *instance)
stop communications
bool dnp3_database_update_binary_input(dnp3_database_t *instance, dnp3_binary_input_t value, dnp3_update_options_t options)
Update a BinaryInput point.
struct dnp3_outstation_server_t dnp3_outstation_server_t
TCP server that listens for connections and routes the messages to outstations.
Definition: dnp3.h:5932
void dnp3_command_set_add_g41_v4_u8(dnp3_command_set_t *instance, uint8_t idx, double value)
Add a Analog Output command (double-precision float) with 1-byte prefix index.
void dnp3_command_set_add_g41_v3_u8(dnp3_command_set_t *instance, uint8_t idx, float value)
Add a Analog Output command (single-precision float) with 1-byte prefix index.
dnp3_trip_close_code_t
Trip-Close Code field, used in conjunction with dnp3_op_type_t to specify a control operation.
Definition: dnp3.h:537
@ DNP3_TRIP_CLOSE_CODE_RESERVED
RESERVED (3)
Definition: dnp3.h:545
@ DNP3_TRIP_CLOSE_CODE_CLOSE
CLOSE (1)
Definition: dnp3.h:541
@ DNP3_TRIP_CLOSE_CODE_TRIP
TRIP (2)
Definition: dnp3.h:543
@ DNP3_TRIP_CLOSE_CODE_NUL
NUL (0)
Definition: dnp3.h:539
dnp3_param_error_t dnp3_database_get_binary_input(dnp3_database_t *instance, uint16_t index, dnp3_binary_input_t *out)
Get a BinaryInput point.
struct dnp3_database_handle_t dnp3_database_handle_t
handle used to perform transactions on the database
Definition: dnp3.h:4732
void dnp3_runtime_destroy(dnp3_runtime_t *instance)
Destroy a runtime.
void dnp3_command_set_finish_header(dnp3_command_set_t *instance)
Finish any partially completed header. This allows for the construction of two headers with the same ...
static dnp3_outstation_information_t dnp3_outstation_information_init(void(*process_request_from_idle)(dnp3_request_header_t, void *), void(*broadcast_received)(dnp3_function_code_t, dnp3_broadcast_action_t, void *), void(*enter_solicited_confirm_wait)(uint8_t, void *), void(*solicited_confirm_timeout)(uint8_t, void *), void(*solicited_confirm_received)(uint8_t, void *), void(*solicited_confirm_wait_new_request)(void *), void(*wrong_solicited_confirm_seq)(uint8_t, uint8_t, void *), void(*unexpected_confirm)(bool, uint8_t, void *), void(*enter_unsolicited_confirm_wait)(uint8_t, void *), void(*unsolicited_confirm_timeout)(uint8_t, bool, void *), void(*unsolicited_confirmed)(uint8_t, void *), void(*clear_restart_iin)(void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:5425
static dnp3_restart_task_callback_t dnp3_restart_task_callback_init(void(*on_complete)(uint64_t, void *), void(*on_failure)(dnp3_restart_error_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:3624
dnp3_request_t * dnp3_request_new_one_byte_limited_count(dnp3_variation_t variation, uint8_t count)
Create a new request asking for a limited count of objects (using 8-bit start/stop).
void dnp3_outstation_server_destroy(dnp3_outstation_server_t *instance)
Gracefully shutdown all the outstations associated to this server, stops the server and release resou...
dnp3_static_counter_variation_t
Static counter variation.
Definition: dnp3.h:4161
@ DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR6
Counter - 16-bit without flag.
Definition: dnp3.h:4169
@ DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR2
Counter - 16-bit with flag.
Definition: dnp3.h:4165
@ DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR5
Counter - 32-bit without flag.
Definition: dnp3.h:4167
@ DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR1
Counter - 32-bit with flag.
Definition: dnp3.h:4163
dnp3_function_code_t
Application layer function code.
Definition: dnp3.h:1785
@ DNP3_FUNCTION_CODE_RESPONSE
Master shall interpret this fragment as an Application Layer response to an ApplicationLayer request ...
Definition: dnp3.h:1849
@ DNP3_FUNCTION_CODE_FREEZE_CLEAR_NO_RESPONSE
Same as FreezeClear but outstation shall not send a response (value == 10)
Definition: dnp3.h:1807
@ DNP3_FUNCTION_CODE_UNSOLICITED_RESPONSE
Master shall interpret this fragment as an unsolicited response that was not prompted by an explicit ...
Definition: dnp3.h:1851
@ DNP3_FUNCTION_CODE_FREEZE_CLEAR
Outstation shall copy the point data values specified by the objects in the request into a separate f...
Definition: dnp3.h:1805
@ DNP3_FUNCTION_CODE_FREEZE_AT_TIME_NO_RESPONSE
Same as FreezeAtTime but outstation shall not send a response (value == 12)
Definition: dnp3.h:1811
@ DNP3_FUNCTION_CODE_IMMEDIATE_FREEZE
Outstation shall copy the point data values specified by the objects in the request to a separate fre...
Definition: dnp3.h:1801
@ DNP3_FUNCTION_CODE_STOP_APPLICATION
Outstation shall stop running the applications specified by the objects in the request (value == 18)
Definition: dnp3.h:1823
@ DNP3_FUNCTION_CODE_ENABLE_UNSOLICITED
Enables outstation to initiate unsolicited responses from points specified by the objects in the requ...
Definition: dnp3.h:1827
@ DNP3_FUNCTION_CODE_RECORD_CURRENT_TIME
Outstation shall save the time when the last octet of this message is received (value == 24)
Definition: dnp3.h:1835
@ DNP3_FUNCTION_CODE_SAVE_CONFIGURATION
This code is deprecated-Do not use for new designs (value == 19)
Definition: dnp3.h:1825
@ DNP3_FUNCTION_CODE_INITIALIZE_DATA
Obsolete-Do not use for new designs (value == 15)
Definition: dnp3.h:1817
@ DNP3_FUNCTION_CODE_CLOSE_FILE
Outstation shall close a file (value == 26)
Definition: dnp3.h:1839
@ DNP3_FUNCTION_CODE_START_APPLICATION
Outstation shall start running the applications specified by the objects in the request (value == 17)
Definition: dnp3.h:1821
@ DNP3_FUNCTION_CODE_FREEZE_AT_TIME
Outstation shall copy the point data values specified by the objects in the request to a separate fre...
Definition: dnp3.h:1809
@ DNP3_FUNCTION_CODE_INITIALIZE_APPLICATION
Outstation shall place the applications specified by the objects in the request into the ready to run...
Definition: dnp3.h:1819
@ DNP3_FUNCTION_CODE_WRITE
Outstation shall store the data specified by the objects in the request (value == 2)
Definition: dnp3.h:1791
@ DNP3_FUNCTION_CODE_OPERATE
Outstation shall activate the output points selected (or armed) by a previous select function code co...
Definition: dnp3.h:1795
@ DNP3_FUNCTION_CODE_WARM_RESTART
Outstation shall reset only portions of the device (value == 14)
Definition: dnp3.h:1815
@ DNP3_FUNCTION_CODE_DELAY_MEASURE
Outstation shall report the time it takes to process and initiate the transmission of its response (v...
Definition: dnp3.h:1833
@ DNP3_FUNCTION_CODE_DELETE_FILE
Outstation shall delete a file (value == 27)
Definition: dnp3.h:1841
@ DNP3_FUNCTION_CODE_ABORT_FILE
Outstation shall abort a file transfer operation (value == 30)
Definition: dnp3.h:1847
@ DNP3_FUNCTION_CODE_SELECT
Outstation shall select (or arm) the output points specified by the objects in the request in prepara...
Definition: dnp3.h:1793
@ DNP3_FUNCTION_CODE_COLD_RESTART
Outstation shall perform a complete reset of all hardware and software in the device (value == 13)
Definition: dnp3.h:1813
@ DNP3_FUNCTION_CODE_ASSIGN_CLASS
Outstation shall assign the events generated by the points specified by the objects in the request to...
Definition: dnp3.h:1831
@ DNP3_FUNCTION_CODE_IMMEDIATE_FREEZE_NO_RESPONSE
Same as ImmediateFreeze but outstation shall not send a response (value == 8)
Definition: dnp3.h:1803
@ DNP3_FUNCTION_CODE_GET_FILE_INFO
Outstation shall retrieve information about a file (value == 28)
Definition: dnp3.h:1843
@ DNP3_FUNCTION_CODE_DIRECT_OPERATE_NO_RESPONSE
Same as DirectOperate but outstation shall not send a response (value == 6)
Definition: dnp3.h:1799
@ DNP3_FUNCTION_CODE_READ
Outstation shall return the data specified by the objects in the request (value == 1)
Definition: dnp3.h:1789
@ DNP3_FUNCTION_CODE_AUTHENTICATE_FILE
Outstation shall return a file authentication key (value == 29)
Definition: dnp3.h:1845
@ DNP3_FUNCTION_CODE_DIRECT_OPERATE
Outstation shall immediately actuate the output points specified by the objects in the request (value...
Definition: dnp3.h:1797
@ DNP3_FUNCTION_CODE_OPEN_FILE
Outstation shall open a file (value == 25)
Definition: dnp3.h:1837
@ DNP3_FUNCTION_CODE_CONFIRM
Master sends this to an outstation to confirm the receipt of an Application Layer fragment (value == ...
Definition: dnp3.h:1787
@ DNP3_FUNCTION_CODE_DISABLE_UNSOLICITED
Prevents outstation from initiating unsolicited responses from points specified by the objects in the...
Definition: dnp3.h:1829
dnp3_client_state_t
State of the client connection.
Definition: dnp3.h:2261
@ DNP3_CLIENT_STATE_CONNECTING
Client is trying to establish a connection to the remote device.
Definition: dnp3.h:2265
@ DNP3_CLIENT_STATE_DISABLED
Client is disabled and idle until enabled.
Definition: dnp3.h:2263
@ DNP3_CLIENT_STATE_CONNECTED
Client is connected to the remote device.
Definition: dnp3.h:2267
@ DNP3_CLIENT_STATE_WAIT_AFTER_DISCONNECT
Client was disconnected, waiting before retrying.
Definition: dnp3.h:2271
@ DNP3_CLIENT_STATE_SHUTDOWN
Client is shutting down.
Definition: dnp3.h:2273
@ DNP3_CLIENT_STATE_WAIT_AFTER_FAILED_CONNECT
Failed to establish a connection, waiting before retrying.
Definition: dnp3.h:2269
static const char * dnp3_restart_error_to_string(dnp3_restart_error_t value)
Converts the enum to a string.
Definition: dnp3.h:3582
static dnp3_retry_strategy_t dnp3_retry_strategy_init()
Initialize to defaults.
Definition: dnp3.h:1559
dnp3_op_type_t
Operation Type field, used in conjunction with dnp3_trip_close_code_t to specify a control operation.
Definition: dnp3.h:565
@ DNP3_OP_TYPE_PULSE_OFF
PULSE_OFF (2)
Definition: dnp3.h:571
@ DNP3_OP_TYPE_LATCH_ON
LATCH_ON (3)
Definition: dnp3.h:573
@ DNP3_OP_TYPE_NUL
NUL (0)
Definition: dnp3.h:567
@ DNP3_OP_TYPE_PULSE_ON
PULSE_ON (1)
Definition: dnp3.h:569
@ DNP3_OP_TYPE_LATCH_OFF
LATCH_OFF(4)
Definition: dnp3.h:575
static dnp3_serial_settings_t dnp3_serial_settings_init()
Initialize to default values.
Definition: dnp3.h:1696
dnp3_param_error_t dnp3_master_channel_create_tls(dnp3_runtime_t *runtime, dnp3_link_error_mode_t link_error_mode, dnp3_master_channel_config_t config, dnp3_endpoint_list_t *endpoints, dnp3_connect_strategy_t connect_strategy, dnp3_client_state_listener_t listener, dnp3_tls_client_config_t tls_config, dnp3_master_channel_t **out)
Create a master channel that connects to the specified TCP endpoint(s) and establish a TLS session wi...
dnp3_request_t * dnp3_request_new_all_objects(dnp3_variation_t variation)
Create a new request asking for all objects of a particular variation.
dnp3_param_error_t dnp3_master_channel_remove_association(dnp3_master_channel_t *instance, dnp3_association_id_t id)
Remove an association from the channel.
static dnp3_connection_state_listener_t dnp3_connection_state_listener_init(void(*on_change)(dnp3_connection_state_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:5781
static const char * dnp3_event_binary_input_variation_to_string(dnp3_event_binary_input_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:3889
bool dnp3_database_update_double_bit_binary_input(dnp3_database_t *instance, dnp3_double_bit_binary_input_t value, dnp3_update_options_t options)
Update a Double-Bit Binary Input point.
static const char * dnp3_log_output_format_to_string(dnp3_log_output_format_t value)
Converts the enum to a string.
Definition: dnp3.h:196
dnp3_param_error_t dnp3_master_channel_check_link_status(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_link_status_callback_t callback)
Asynchronously perform a link status check.
void dnp3_master_channel_destroy(dnp3_master_channel_t *instance)
Shutdown a dnp3_master_channel_t and release all resources.
dnp3_task_error_t
Task error used in dnp3_association_information_t.
Definition: dnp3.h:2875
@ DNP3_TASK_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:2881
@ DNP3_TASK_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:2889
@ DNP3_TASK_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:2877
@ DNP3_TASK_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:2887
@ DNP3_TASK_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:2883
@ DNP3_TASK_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:2885
@ DNP3_TASK_ERROR_BAD_RESPONSE
response was malformed or contained object headers
Definition: dnp3.h:2879
dnp3_link_decode_level_t
Controls how transmitted and received link frames are decoded at the INFO log level.
Definition: dnp3.h:369
@ DNP3_LINK_DECODE_LEVEL_HEADER
Decode the header.
Definition: dnp3.h:373
@ DNP3_LINK_DECODE_LEVEL_PAYLOAD
Decode the header and the raw payload as hexadecimal.
Definition: dnp3.h:375
@ DNP3_LINK_DECODE_LEVEL_NOTHING
Decode nothing.
Definition: dnp3.h:371
static dnp3_event_classes_t dnp3_event_classes_init(bool class1, bool class2, bool class3)
Fully construct dnp3_event_classes_t specifying the value of each field.
Definition: dnp3.h:2531
dnp3_event_class_t
Event class.
Definition: dnp3.h:3754
@ DNP3_EVENT_CLASS_CLASS1
Class 1 event.
Definition: dnp3.h:3758
@ DNP3_EVENT_CLASS_CLASS2
Class 2 event.
Definition: dnp3.h:3760
@ DNP3_EVENT_CLASS_CLASS3
Class 3 event.
Definition: dnp3.h:3762
@ DNP3_EVENT_CLASS_NONE
Does not generate events.
Definition: dnp3.h:3756
static const char * dnp3_static_double_bit_binary_input_variation_to_string(dnp3_static_double_bit_binary_input_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:3968
static const char * dnp3_read_type_to_string(dnp3_read_type_t value)
Converts the enum to a string.
Definition: dnp3.h:2066
static const char * dnp3_static_analog_output_status_variation_to_string(dnp3_static_analog_output_status_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4547
static const char * dnp3_time_quality_to_string(dnp3_time_quality_t value)
Converts the enum to a string.
Definition: dnp3.h:758
static dnp3_port_state_listener_t dnp3_port_state_listener_init(void(*on_change)(dnp3_port_state_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:1228
static const char * dnp3_nothing_to_string(dnp3_nothing_t value)
Converts the enum to a string.
Definition: dnp3.h:2430
dnp3_param_error_t dnp3_database_get_binary_output_status(dnp3_database_t *instance, uint16_t index, dnp3_binary_output_status_t *out)
Get a Binary Output Status point.
struct dnp3_runtime_t dnp3_runtime_t
Handle to the underlying runtime.
Definition: dnp3.h:474
static dnp3_logging_config_t dnp3_logging_config_init()
Initialize the configuration to default values.
Definition: dnp3.h:256
static const char * dnp3_link_decode_level_to_string(dnp3_link_decode_level_t value)
Converts the enum to a string.
Definition: dnp3.h:381
static const char * dnp3_param_error_to_string(dnp3_param_error_t value)
Converts the enum to a string.
Definition: dnp3.h:98
struct dnp3_double_bit_binary_input_iterator_t dnp3_double_bit_binary_input_iterator_t
Iterator of double_bit_binary_input.
Definition: dnp3.h:933
dnp3_param_error_t dnp3_outstation_set_decode_level(dnp3_outstation_t *instance, dnp3_decode_level_t level)
Set decoding log level.
dnp3_param_error_t dnp3_configure_logging(dnp3_logging_config_t config, dnp3_logger_t logger)
Set the callback that will receive all the log messages.
static dnp3_control_code_t dnp3_control_code_from_op_type(dnp3_op_type_t op_type)
Initialize a dnp3_control_code_t instance from a dnp3_op_type_t.
Definition: dnp3.h:638
dnp3_endpoint_list_t * dnp3_endpoint_list_create(const char *main_endpoint)
Create a new list of IP endpoints.
static dnp3_classes_t dnp3_classes_none()
Initialize all classes to false.
Definition: dnp3.h:2639
static const char * dnp3_transport_decode_level_to_string(dnp3_transport_decode_level_t value)
Converts the enum to a string.
Definition: dnp3.h:356
bool dnp3_database_add_analog_output_status(dnp3_database_t *instance, uint16_t index, dnp3_event_class_t point_class, dnp3_analog_output_status_config_t config)
Add a new Analog Output Status point.
void dnp3_request_add_two_byte_range_header(dnp3_request_t *instance, dnp3_variation_t variation, uint16_t start, uint16_t stop)
Add a two-byte start/stop variation interrogation.
dnp3_event_counter_variation_t
Event counter variation.
Definition: dnp3.h:4189
@ DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR5
Counter event - 32-bit with flag and time.
Definition: dnp3.h:4195
@ DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR2
Counter event - 16-bit with flag.
Definition: dnp3.h:4193
@ DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR1
Counter event - 32-bit with flag.
Definition: dnp3.h:4191
@ DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR6
Counter event - 16-bit with flag and time.
Definition: dnp3.h:4197
dnp3_param_error_t dnp3_database_get_double_bit_binary_input(dnp3_database_t *instance, uint16_t index, dnp3_double_bit_binary_input_t *out)
Get a Double-Bit Binary Input point.
void dnp3_endpoint_list_destroy(dnp3_endpoint_list_t *instance)
Destroy a previously allocated endpoint list.
dnp3_static_frozen_counter_variation_t
Static frozen counter variation.
Definition: dnp3.h:4277
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR9
Frozen Counter - 32-bit without flag.
Definition: dnp3.h:4287
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR6
Frozen Counter - 16-bit with flag and time.
Definition: dnp3.h:4285
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR2
Frozen Counter - 16-bit with flag.
Definition: dnp3.h:4281
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR1
Frozen Counter - 32-bit with flag.
Definition: dnp3.h:4279
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR10
Frozen Counter - 16-bit without flag.
Definition: dnp3.h:4289
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR5
Frozen Counter - 32-bit with flag and time.
Definition: dnp3.h:4283
static dnp3_binary_output_status_config_t dnp3_binary_output_status_config_init()
Initialize to defaults.
Definition: dnp3.h:4121
dnp3_param_error_t dnp3_master_channel_enable(dnp3_master_channel_t *instance)
start communications
dnp3_binary_input_t * dnp3_binary_input_iterator_next(dnp3_binary_input_iterator_t *iter)
returns a pointer to the next value or NULL
dnp3_event_double_bit_binary_input_variation_t
Event double-bit binary input variation.
Definition: dnp3.h:3980
@ DNP3_EVENT_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP4_VAR3
Double-bit binary input event - with relative time.
Definition: dnp3.h:3986
@ DNP3_EVENT_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP4_VAR1
Double-bit binary input event - without time.
Definition: dnp3.h:3982
@ DNP3_EVENT_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP4_VAR2
Double-bit binary input event - with absolute time.
Definition: dnp3.h:3984
dnp3_response_function_t
Type of response.
Definition: dnp3.h:1900
@ DNP3_RESPONSE_FUNCTION_UNSOLICITED_RESPONSE
Unsolicited response.
Definition: dnp3.h:1904
@ DNP3_RESPONSE_FUNCTION_RESPONSE
Solicited response.
Definition: dnp3.h:1902
dnp3_counter_t * dnp3_counter_iterator_next(dnp3_counter_iterator_t *iter)
returns a pointer to the next value or NULL
bool dnp3_database_remove_counter(dnp3_database_t *instance, uint16_t index)
Remove a Counter point.
struct dnp3_endpoint_list_t dnp3_endpoint_list_t
List of IP endpoints.
Definition: dnp3.h:2196
static dnp3_client_state_listener_t dnp3_client_state_listener_init(void(*on_change)(dnp3_client_state_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:2312
void dnp3_database_handle_transaction(dnp3_database_handle_t *instance, dnp3_database_transaction_t callback)
Acquire a mutex on the underlying database and apply a set of changes as a transaction.
dnp3_request_t * dnp3_request_create()
Create a new request.
dnp3_event_analog_output_status_variation_t
Event analog output status variation.
Definition: dnp3.h:4561
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR2
Analog output event - 16-bit without time.
Definition: dnp3.h:4565
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR5
Analog output event - single-precision, floating-point without time.
Definition: dnp3.h:4571
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR8
Analog output event - double-precision, floating-point with time.
Definition: dnp3.h:4577
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR7
Analog output event - single-precision, floating-point with time.
Definition: dnp3.h:4575
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR3
Analog output event - 32-bit with time.
Definition: dnp3.h:4567
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR4
Analog output event - 16-bit with time.
Definition: dnp3.h:4569
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR6
Analog output event - double-precision, floating-point without time.
Definition: dnp3.h:4573
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR1
Analog output event - 32-bit without time.
Definition: dnp3.h:4563
static const char * dnp3_restart_delay_type_to_string(dnp3_restart_delay_type_t value)
Converts the enum to a string.
Definition: dnp3.h:5017
static dnp3_outstation_application_t dnp3_outstation_application_init(uint16_t(*get_processing_delay_ms)(void *), dnp3_write_time_result_t(*write_absolute_time)(uint64_t, void *), dnp3_application_iin_t(*get_application_iin)(void *), dnp3_restart_delay_t(*cold_restart)(void *), dnp3_restart_delay_t(*warm_restart)(void *), dnp3_freeze_result_t(*freeze_counters_all)(dnp3_freeze_type_t, dnp3_database_handle_t *, void *), dnp3_freeze_result_t(*freeze_counters_range)(uint16_t, uint16_t, dnp3_freeze_type_t, dnp3_database_handle_t *, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:5270
dnp3_request_t * dnp3_request_new_class(bool class0, bool class1, bool class2, bool class3)
Create a new request asking for classes.
dnp3_time_sync_error_t
Possible errors that can occur during a time synchronization procedure.
Definition: dnp3.h:3449
@ DNP3_TIME_SYNC_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:3473
@ DNP3_TIME_SYNC_ERROR_IIN_ERROR
Outstation indicated an error.
Definition: dnp3.h:3465
@ DNP3_TIME_SYNC_ERROR_OVERFLOW
Overflow in calculation.
Definition: dnp3.h:3459
@ DNP3_TIME_SYNC_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:3467
@ DNP3_TIME_SYNC_ERROR_STILL_NEEDS_TIME
Outstation did not clear the NEED_TIME IIN bit.
Definition: dnp3.h:3461
@ DNP3_TIME_SYNC_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:3451
@ DNP3_TIME_SYNC_ERROR_SYSTEM_TIME_NOT_UNIX
The system time cannot be converted to a Unix timestamp.
Definition: dnp3.h:3455
@ DNP3_TIME_SYNC_ERROR_BAD_RESPONSE
response was malformed or contained object headers
Definition: dnp3.h:3469
@ DNP3_TIME_SYNC_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:3471
@ DNP3_TIME_SYNC_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:3475
@ DNP3_TIME_SYNC_ERROR_BAD_OUTSTATION_TIME_DELAY
Outstation time delay exceeded the response delay.
Definition: dnp3.h:3457
@ DNP3_TIME_SYNC_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:3477
@ DNP3_TIME_SYNC_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:3479
@ DNP3_TIME_SYNC_ERROR_CLOCK_ROLLBACK
Detected a clock rollback.
Definition: dnp3.h:3453
@ DNP3_TIME_SYNC_ERROR_SYSTEM_TIME_NOT_AVAILABLE
System time not available.
Definition: dnp3.h:3463
static dnp3_binary_input_t dnp3_binary_input_init(uint16_t index, bool value, dnp3_flags_t flags, dnp3_timestamp_t time)
Fully construct dnp3_binary_input_t specifying the value of each field.
Definition: dnp3.h:878
static dnp3_analog_output_status_config_t dnp3_analog_output_status_config_init()
Initialize to defaults.
Definition: dnp3.h:4620
static dnp3_read_task_callback_t dnp3_read_task_callback_init(void(*on_complete)(dnp3_nothing_t, void *), void(*on_failure)(dnp3_read_error_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:3193
dnp3_app_decode_level_t
Controls how transmitted and received application-layer fragments are decoded at the INFO log level.
Definition: dnp3.h:316
@ DNP3_APP_DECODE_LEVEL_NOTHING
Decode nothing.
Definition: dnp3.h:318
@ DNP3_APP_DECODE_LEVEL_OBJECT_VALUES
Decode the header, the object headers, and the object values.
Definition: dnp3.h:324
@ DNP3_APP_DECODE_LEVEL_OBJECT_HEADERS
Decode the header and the object headers.
Definition: dnp3.h:322
@ DNP3_APP_DECODE_LEVEL_HEADER
Decode the header-only.
Definition: dnp3.h:320
static const char * dnp3_client_state_to_string(dnp3_client_state_t value)
Converts the enum to a string.
Definition: dnp3.h:2279
bool dnp3_database_add_counter(dnp3_database_t *instance, uint16_t index, dnp3_event_class_t point_class, dnp3_counter_config_t config)
Add a new Counter point.
static const char * dnp3_data_bits_to_string(dnp3_data_bits_t value)
Converts the enum to a string.
Definition: dnp3.h:1585
dnp3_request_t * dnp3_request_new_two_byte_range(dnp3_variation_t variation, uint16_t start, uint16_t stop)
Create a new request asking for range of objects (using 16-bit start/stop).
dnp3_binary_output_status_t * dnp3_binary_output_status_iterator_next(dnp3_binary_output_status_iterator_t *iter)
returns a pointer to the next value or NULL
static dnp3_utc_timestamp_t dnp3_utc_timestamp_valid(uint64_t value)
Construct a valid dnp3_utc_timestamp_t.
Definition: dnp3.h:2764
dnp3_request_t * dnp3_request_new_two_byte_limited_count(dnp3_variation_t variation, uint16_t count)
Create a new request asking for a limited count of objects (using 16-bit start/stop).
static dnp3_logger_t dnp3_logger_init(void(*on_message)(dnp3_log_level_t, const char *, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:289
static dnp3_counter_t dnp3_counter_init(uint16_t index, uint32_t value, dnp3_flags_t flags, dnp3_timestamp_t time)
Fully construct dnp3_counter_t specifying the value of each field.
Definition: dnp3.h:1004
static const char * dnp3_static_counter_variation_to_string(dnp3_static_counter_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4175
dnp3_octet_string_t * dnp3_octet_string_iterator_next(dnp3_octet_string_iterator_t *iter)
returns a pointer to the next value or NULL
bool dnp3_database_remove_octet_string(dnp3_database_t *instance, uint16_t index)
Remove an Octet String point.
void dnp3_outstation_destroy(dnp3_outstation_t *instance)
Free resources of the outstation.
struct dnp3_analog_input_iterator_t dnp3_analog_input_iterator_t
Iterator of analog_input.
Definition: dnp3.h:1101
static const char * dnp3_trip_close_code_to_string(dnp3_trip_close_code_t value)
Converts the enum to a string.
Definition: dnp3.h:551
static dnp3_association_handler_t dnp3_association_handler_init(dnp3_utc_timestamp_t(*get_current_time)(void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:2813
dnp3_static_analog_output_status_variation_t
Static analog output status variation.
Definition: dnp3.h:4533
@ DNP3_STATIC_ANALOG_OUTPUT_STATUS_VARIATION_GROUP40_VAR2
Analog output status - 16-bit with flag.
Definition: dnp3.h:4537
@ DNP3_STATIC_ANALOG_OUTPUT_STATUS_VARIATION_GROUP40_VAR1
Analog output status - 32-bit with flag.
Definition: dnp3.h:4535
@ DNP3_STATIC_ANALOG_OUTPUT_STATUS_VARIATION_GROUP40_VAR3
Analog output status - single-precision, floating-point with flag.
Definition: dnp3.h:4539
@ DNP3_STATIC_ANALOG_OUTPUT_STATUS_VARIATION_GROUP40_VAR4
Analog output status - double-precision, floating-point with flag.
Definition: dnp3.h:4541
dnp3_link_error_mode_t
Controls how errors in parsed link-layer frames are handled. This behavior is configurable for physic...
Definition: dnp3.h:1711
@ DNP3_LINK_ERROR_MODE_DISCARD
Framing errors are discarded. The link-layer parser is reset on any error, and the parser begins scan...
Definition: dnp3.h:1713
@ DNP3_LINK_ERROR_MODE_CLOSE
Framing errors are bubbled up to calling code, closing the session. Suitable for physical layers that...
Definition: dnp3.h:1715
dnp3_stop_bits_t
Number of stop bits.
Definition: dnp3.h:1649
@ DNP3_STOP_BITS_TWO
Two stop bits.
Definition: dnp3.h:1653
@ DNP3_STOP_BITS_ONE
One stop bit.
Definition: dnp3.h:1651
bool dnp3_database_add_analog_input(dnp3_database_t *instance, uint16_t index, dnp3_event_class_t point_class, dnp3_analog_input_config_t config)
Add a new AnalogInput point.
dnp3_event_frozen_counter_variation_t
Event frozen counter variation.
Definition: dnp3.h:4311
@ DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR5
Frozen Counter event - 32-bit with flag and time.
Definition: dnp3.h:4317
@ DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR2
Frozen Counter event - 16-bit with flag.
Definition: dnp3.h:4315
@ DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR6
Frozen Counter event - 16-bit with flag and time.
Definition: dnp3.h:4319
@ DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR1
Frozen Counter event - 32-bit with flag.
Definition: dnp3.h:4313
dnp3_param_error_t dnp3_outstation_server_bind(dnp3_outstation_server_t *instance)
Bind the server to the port and starts listening. Also starts all the outstations associated to it.
static const char * dnp3_write_time_result_to_string(dnp3_write_time_result_t value)
Converts the enum to a string.
Definition: dnp3.h:5104
static const char * dnp3_stop_bits_to_string(dnp3_stop_bits_t value)
Converts the enum to a string.
Definition: dnp3.h:1659
static const char * dnp3_event_binary_output_status_variation_to_string(dnp3_event_binary_output_status_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4093
dnp3_frozen_counter_t * dnp3_frozen_counter_iterator_next(dnp3_frozen_counter_iterator_t *iter)
returns a pointer to the next value or NULL
void dnp3_octet_string_value_destroy(dnp3_octet_string_value_t *instance)
Destroys an instance of the collection.
void dnp3_command_set_add_g12_v1_u16(dnp3_command_set_t *instance, uint16_t idx, dnp3_group12_var1_t header)
Add a CROB with 2-byte prefix index.
bool dnp3_database_update_octet_string(dnp3_database_t *instance, uint16_t index, dnp3_octet_string_value_t *value, dnp3_update_options_t options)
Update an Octet String point.
static const char * dnp3_qualifier_code_to_string(dnp3_qualifier_code_t value)
Converts the enum to a string.
Definition: dnp3.h:2018
struct dnp3_database_t dnp3_database_t
Internal database access.
Definition: dnp3.h:3750
bool dnp3_database_update_frozen_counter(dnp3_database_t *instance, dnp3_frozen_counter_t value, dnp3_update_options_t options)
Update an Frozen Counter point.
static dnp3_tls_client_config_t dnp3_tls_client_config_init(const char *dns_name, const char *peer_cert_path, const char *local_cert_path, const char *private_key_path, const char *password)
construct the configuration with defaults
Definition: dnp3.h:2370
static const char * dnp3_time_format_to_string(dnp3_time_format_t value)
Converts the enum to a string.
Definition: dnp3.h:220
dnp3_freeze_type_t
Freeze operation type.
Definition: dnp3.h:5117
@ DNP3_FREEZE_TYPE_FREEZE_AND_CLEAR
Copy the current value of a counter to the associated point and clear the current value to 0.
Definition: dnp3.h:5121
@ DNP3_FREEZE_TYPE_IMMEDIATE_FREEZE
Copy the current value of a counter to the associated point.
Definition: dnp3.h:5119
static dnp3_runtime_config_t dnp3_runtime_config_init()
Initialize the configuration to default values.
Definition: dnp3.h:493
bool dnp3_database_update_analog_output_status(dnp3_database_t *instance, dnp3_analog_output_status_t value, dnp3_update_options_t options)
Update a Analog Output Status point.
static const char * dnp3_parity_to_string(dnp3_parity_t value)
Converts the enum to a string.
Definition: dnp3.h:1636
dnp3_data_bits_t
Number of bits per character.
Definition: dnp3.h:1571
@ DNP3_DATA_BITS_FIVE
5 bits per character
Definition: dnp3.h:1573
@ DNP3_DATA_BITS_SEVEN
7 bits per character
Definition: dnp3.h:1577
@ DNP3_DATA_BITS_EIGHT
8 bits per character
Definition: dnp3.h:1579
@ DNP3_DATA_BITS_SIX
6 bits per character
Definition: dnp3.h:1575
void dnp3_command_set_add_g12_v1_u8(dnp3_command_set_t *instance, uint8_t idx, dnp3_group12_var1_t header)
Add a CROB with 1-byte prefix index.
static const char * dnp3_port_state_to_string(dnp3_port_state_t value)
Converts the enum to a string.
Definition: dnp3.h:1197
static dnp3_event_classes_t dnp3_event_classes_none()
Initialize all classes to false.
Definition: dnp3.h:2567
static dnp3_double_bit_binary_input_config_t dnp3_double_bit_binary_input_config_init()
Initialize to defaults.
Definition: dnp3.h:4021
dnp3_connection_state_t
Outstation connection state for connection-oriented transports, e.g. TCP.
Definition: dnp3.h:5742
@ DNP3_CONNECTION_STATE_CONNECTED
Connected to the master.
Definition: dnp3.h:5744
@ DNP3_CONNECTION_STATE_DISCONNECTED
Disconnected from the master.
Definition: dnp3.h:5746
dnp3_param_error_t dnp3_master_channel_warm_restart(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_restart_task_callback_t callback)
Asynchronously perform a warm restart operation to the association.
static dnp3_update_options_t dnp3_update_options_detect_event()
Default event detection mode. Updates the static value and automatically detects event.
Definition: dnp3.h:3827
dnp3_analog_input_t * dnp3_analog_input_iterator_next(dnp3_analog_input_iterator_t *iter)
returns a pointer to the next value or NULL
bool dnp3_database_remove_binary_output_status(dnp3_database_t *instance, uint16_t index)
Remove a Binary Output Status point.
static dnp3_update_options_t dnp3_update_options_no_event()
Only update the static value. Usefull during initialization of the database.
Definition: dnp3.h:3843
dnp3_qualifier_code_t
Qualifier code used in the response.
Definition: dnp3.h:1996
@ DNP3_QUALIFIER_CODE_RANGE16
16-bit start stop (0x01)
Definition: dnp3.h:2000
@ DNP3_QUALIFIER_CODE_COUNT16
16-bit count (0x08)
Definition: dnp3.h:2006
@ DNP3_QUALIFIER_CODE_COUNT_AND_PREFIX_16
16-bit count and prefix (0x28)
Definition: dnp3.h:2010
@ DNP3_QUALIFIER_CODE_ALL_OBJECTS
All objects (0x06)
Definition: dnp3.h:2002
@ DNP3_QUALIFIER_CODE_RANGE8
8-bit start stop (0x00)
Definition: dnp3.h:1998
@ DNP3_QUALIFIER_CODE_COUNT_AND_PREFIX_8
8-bit count and prefix (0x17)
Definition: dnp3.h:2008
@ DNP3_QUALIFIER_CODE_FREE_FORMAT_16
16-bit free format (0x5B)
Definition: dnp3.h:2012
@ DNP3_QUALIFIER_CODE_COUNT8
8-bit count (0x07)
Definition: dnp3.h:2004
static dnp3_outstation_config_t dnp3_outstation_config_init(uint16_t outstation_address, uint16_t master_address, dnp3_event_buffer_config_t event_buffer_config)
Initialize to defaults.
Definition: dnp3.h:4979
static const char * dnp3_event_counter_variation_to_string(dnp3_event_counter_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4203
static const char * dnp3_certificate_mode_to_string(dnp3_certificate_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:1773
struct dnp3_frozen_counter_iterator_t dnp3_frozen_counter_iterator_t
Iterator of frozen_counter.
Definition: dnp3.h:1059
static const char * dnp3_app_decode_level_to_string(dnp3_app_decode_level_t value)
Converts the enum to a string.
Definition: dnp3.h:330
struct dnp3_byte_iterator_t dnp3_byte_iterator_t
Iterator of uint8_t.
Definition: dnp3.h:1152
static dnp3_frozen_counter_config_t dnp3_frozen_counter_config_init()
Initialize to defaults.
Definition: dnp3.h:4358
dnp3_param_error_t dnp3_master_channel_cold_restart(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_restart_task_callback_t callback)
Asynchronously perform a cold restart operation to the association.
struct dnp3_binary_output_status_iterator_t dnp3_binary_output_status_iterator_t
Iterator of binary_output_status.
Definition: dnp3.h:975
dnp3_param_error_t dnp3_master_channel_add_association(dnp3_master_channel_t *instance, uint16_t address, dnp3_association_config_t config, dnp3_read_handler_t read_handler, dnp3_association_handler_t association_handler, dnp3_association_information_t association_information, dnp3_association_id_t *out)
Add an association to the channel.
static const char * dnp3_auto_time_sync_to_string(dnp3_auto_time_sync_t value)
Converts the enum to a string.
Definition: dnp3.h:2665
dnp3_task_type_t
Task type used in dnp3_association_information_t.
Definition: dnp3.h:2829
@ DNP3_TASK_TYPE_USER_READ
User-defined read request.
Definition: dnp3.h:2831
@ DNP3_TASK_TYPE_DISABLE_UNSOLICITED
Disable unsolicited startup request.
Definition: dnp3.h:2845
@ DNP3_TASK_TYPE_PERIODIC_POLL
Periodic poll task.
Definition: dnp3.h:2833
@ DNP3_TASK_TYPE_ENABLE_UNSOLICITED
Enable unsolicited startup request.
Definition: dnp3.h:2843
@ DNP3_TASK_TYPE_RESTART
Cold or warm restart task.
Definition: dnp3.h:2849
@ DNP3_TASK_TYPE_COMMAND
Command request.
Definition: dnp3.h:2839
@ DNP3_TASK_TYPE_CLEAR_RESTART_BIT
Clear RESTART IIN bit.
Definition: dnp3.h:2841
@ DNP3_TASK_TYPE_STARTUP_INTEGRITY
Startup integrity scan.
Definition: dnp3.h:2835
@ DNP3_TASK_TYPE_AUTO_EVENT_SCAN
Automatic event scan caused by RESTART IIN bit detection.
Definition: dnp3.h:2837
@ DNP3_TASK_TYPE_TIME_SYNC
Time synchronisation task.
Definition: dnp3.h:2847
dnp3_param_error_t dnp3_master_channel_operate(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_command_mode_t mode, dnp3_command_set_t *command, dnp3_command_task_callback_t callback)
Asynchronously perform a command operation on the association.
static dnp3_group12_var1_t dnp3_group12_var1_init(dnp3_control_code_t code, uint8_t count, uint32_t on_time, uint32_t off_time)
Fully construct dnp3_group12_var1_t specifying the value of each field.
Definition: dnp3.h:691
struct dnp3_octet_string_iterator_t dnp3_octet_string_iterator_t
Iterator of octet_string.
Definition: dnp3.h:1173
static const char * dnp3_response_function_to_string(dnp3_response_function_t value)
Converts the enum to a string.
Definition: dnp3.h:1910
dnp3_log_output_format_t
Describes how each log event is formatted.
Definition: dnp3.h:186
@ DNP3_LOG_OUTPUT_FORMAT_JSON
Output formatted as JSON.
Definition: dnp3.h:190
@ DNP3_LOG_OUTPUT_FORMAT_TEXT
A simple text-based format.
Definition: dnp3.h:188
static const char * dnp3_variation_to_string(dnp3_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:1436
dnp3_log_level_t
Log level.
Definition: dnp3.h:153
@ DNP3_LOG_LEVEL_DEBUG
Debugging log level.
Definition: dnp3.h:161
@ DNP3_LOG_LEVEL_TRACE
Trace log level.
Definition: dnp3.h:163
@ DNP3_LOG_LEVEL_WARN
Warning log level.
Definition: dnp3.h:157
@ DNP3_LOG_LEVEL_ERROR
Error log level.
Definition: dnp3.h:155
@ DNP3_LOG_LEVEL_INFO
Information log level.
Definition: dnp3.h:159
static dnp3_analog_output_status_t dnp3_analog_output_status_init(uint16_t index, double value, dnp3_flags_t flags, dnp3_timestamp_t time)
Fully construct dnp3_analog_output_status_t specifying the value of each field.
Definition: dnp3.h:1130
static const char * dnp3_freeze_result_to_string(dnp3_freeze_result_t value)
Converts the enum to a string.
Definition: dnp3.h:5151
static dnp3_time_sync_task_callback_t dnp3_time_sync_task_callback_init(void(*on_complete)(dnp3_nothing_t, void *), void(*on_failure)(dnp3_time_sync_error_t, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:3534
bool dnp3_database_add_binary_input(dnp3_database_t *instance, uint16_t index, dnp3_event_class_t point_class, dnp3_binary_input_config_t config)
Add a new BinaryInput point.
void dnp3_command_set_add_g41_v3_u16(dnp3_command_set_t *instance, uint16_t idx, float value)
Add a Analog Output command (single-precision float) with 2-byte prefix index.
bool dnp3_database_add_binary_output_status(dnp3_database_t *instance, uint16_t index, dnp3_event_class_t point_class, dnp3_binary_output_status_config_t config)
Add a new Binary Output Status point.
static dnp3_timestamp_t dnp3_timestamp_invalid_timestamp()
Creates an invalid timestamp struct.
Definition: dnp3.h:787
struct dnp3_command_set_t dnp3_command_set_t
Builder type used to construct command requests.
Definition: dnp3.h:3231
dnp3_flow_control_t
Flow control modes.
Definition: dnp3.h:1599
@ DNP3_FLOW_CONTROL_HARDWARE
Flow control using RTS/CTS signals.
Definition: dnp3.h:1605
@ DNP3_FLOW_CONTROL_SOFTWARE
Flow control using XON/XOFF bytes.
Definition: dnp3.h:1603
@ DNP3_FLOW_CONTROL_NONE
No flow control.
Definition: dnp3.h:1601
static const char * dnp3_event_frozen_counter_variation_to_string(dnp3_event_frozen_counter_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:4325
static dnp3_flags_t dnp3_flags_init(uint8_t value)
Fully construct dnp3_flags_t specifying the value of each field.
Definition: dnp3.h:735
bool dnp3_database_remove_analog_input(dnp3_database_t *instance, uint16_t index)
Remove an AnalogInput point.
bool dnp3_database_remove_analog_output_status(dnp3_database_t *instance, uint16_t index)
Remove an Analog Output Status point.
static dnp3_decode_level_t dnp3_decode_level_init()
Initialize log levels to defaults.
Definition: dnp3.h:441
static dnp3_read_handler_t dnp3_read_handler_init(void(*begin_fragment)(dnp3_read_type_t, dnp3_response_header_t, void *), void(*end_fragment)(dnp3_read_type_t, dnp3_response_header_t, void *), void(*handle_binary_input)(dnp3_header_info_t, dnp3_binary_input_iterator_t *, void *), void(*handle_double_bit_binary_input)(dnp3_header_info_t, dnp3_double_bit_binary_input_iterator_t *, void *), void(*handle_binary_output_status)(dnp3_header_info_t, dnp3_binary_output_status_iterator_t *, void *), void(*handle_counter)(dnp3_header_info_t, dnp3_counter_iterator_t *, void *), void(*handle_frozen_counter)(dnp3_header_info_t, dnp3_frozen_counter_iterator_t *, void *), void(*handle_analog_input)(dnp3_header_info_t, dnp3_analog_input_iterator_t *, void *), void(*handle_analog_output_status)(dnp3_header_info_t, dnp3_analog_output_status_iterator_t *, void *), void(*handle_octet_string)(dnp3_header_info_t, dnp3_octet_string_iterator_t *, void *), void(*on_destroy)(void *arg), void *ctx)
Initialize an instance of the interface.
Definition: dnp3.h:2161
static dnp3_group12_var1_t dnp3_group12_var1_from_code(dnp3_control_code_t code)
Construct a dnp3_group12_var1_t from a dnp3_control_code_t.
Definition: dnp3.h:711
bool dnp3_database_remove_double_bit_binary_input(dnp3_database_t *instance, uint16_t index)
Remove a Double-Bit Binary Input point.
Analog configuration.
Definition: dnp3.h:4475
double deadband
Deadband value.
Definition: dnp3.h:4481
dnp3_static_analog_input_variation_t static_variation
Default static variation.
Definition: dnp3.h:4477
dnp3_event_analog_input_variation_t event_variation
Default event variation.
Definition: dnp3.h:4479
analog_input point
Definition: dnp3.h:1071
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:1079
uint16_t index
Point index.
Definition: dnp3.h:1073
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:1077
double value
Point value.
Definition: dnp3.h:1075
Analog Output Status configuration.
Definition: dnp3.h:4603
double deadband
Deadband value.
Definition: dnp3.h:4609
dnp3_static_analog_output_status_variation_t static_variation
Default static variation.
Definition: dnp3.h:4605
dnp3_event_analog_output_status_variation_t event_variation
Default event variation.
Definition: dnp3.h:4607
analog_output_status point
Definition: dnp3.h:1113
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:1121
uint16_t index
Point index.
Definition: dnp3.h:1115
double value
Point value.
Definition: dnp3.h:1117
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:1119
Application-controlled IIN bits.
Definition: dnp3.h:5166
bool local_control
IIN1.5 - Some output points are in local mode.
Definition: dnp3.h:5170
bool device_trouble
IIN1.6 - Device trouble.
Definition: dnp3.h:5172
bool config_corrupt
IIN2.5 - Configuration corrupt.
Definition: dnp3.h:5174
bool need_time
IIN1.4 - Time synchronization is required.
Definition: dnp3.h:5168
Association configuration.
Definition: dnp3.h:2680
dnp3_event_classes_t disable_unsol_classes
Classes to disable unsolicited responses at startup.
Definition: dnp3.h:2685
bool auto_integrity_scan_on_buffer_overflow
Automatic integrity scan when an EVENT_BUFFER_OVERFLOW is detected.
Definition: dnp3.h:2702
uint64_t response_timeout
Timeout for receiving a response on this association.
Definition: dnp3.h:2683
dnp3_auto_time_sync_t auto_time_sync
Automatic time synchronization configuration.
Definition: dnp3.h:2693
uint64_t keep_alive_timeout
Delay of inactivity before sending a REQUEST_LINK_STATUS to the outstation.
Definition: dnp3.h:2700
dnp3_event_classes_t enable_unsol_classes
Classes to enable unsolicited responses at startup.
Definition: dnp3.h:2687
dnp3_event_classes_t event_scan_on_events_available
Classes to automatically send reads when the IIN bit is asserted.
Definition: dnp3.h:2704
dnp3_retry_strategy_t auto_tasks_retry_strategy
Automatic tasks retry strategy.
Definition: dnp3.h:2695
uint16_t max_queued_user_requests
maximum number of user requests (e.g. commands, adhoc reads, etc) that will be queued before back-pre...
Definition: dnp3.h:2706
dnp3_classes_t startup_integrity_classes
Startup integrity classes to ask on master startup and when an outstation restart is detected.
Definition: dnp3.h:2691
Callbacks for a particular outstation association.
Definition: dnp3.h:2792
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:2804
dnp3_utc_timestamp_t(* get_current_time)(void *)
Returns the current time or an invalid time if none is available.
Definition: dnp3.h:2801
void * ctx
Context data.
Definition: dnp3.h:2806
Association identifier.
Definition: dnp3.h:2495
uint16_t address
Outstation address of the association.
Definition: dnp3.h:2497
Informational callbacks about the current state of an outstation association.
Definition: dnp3.h:2912
void(* unsolicited_response)(bool, uint8_t, void *)
Called when an unsolicited response is received.
Definition: dnp3.h:2938
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:2941
void(* task_success)(dnp3_task_type_t, dnp3_function_code_t, uint8_t, void *)
Called when a task successfully completes.
Definition: dnp3.h:2926
void * ctx
Context data.
Definition: dnp3.h:2943
void(* task_start)(dnp3_task_type_t, dnp3_function_code_t, uint8_t, void *)
Called when a new task is started.
Definition: dnp3.h:2919
void(* task_fail)(dnp3_task_type_t, dnp3_task_error_t, void *)
Called when a task fails.
Definition: dnp3.h:2932
Binary Input configuration.
Definition: dnp3.h:3904
dnp3_static_binary_input_variation_t static_variation
Default static variation.
Definition: dnp3.h:3906
dnp3_event_binary_input_variation_t event_variation
Default event variation.
Definition: dnp3.h:3908
binary_input point
Definition: dnp3.h:861
uint16_t index
Point index.
Definition: dnp3.h:863
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:867
bool value
Point value.
Definition: dnp3.h:865
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:869
Binary Output Status configuration.
Definition: dnp3.h:4107
dnp3_event_binary_output_status_variation_t event_variation
Default event variation.
Definition: dnp3.h:4111
dnp3_static_binary_output_status_variation_t static_variation
Default static variation.
Definition: dnp3.h:4109
binary_output_status point
Definition: dnp3.h:945
bool value
Point value.
Definition: dnp3.h:949
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:951
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:953
uint16_t index
Point index.
Definition: dnp3.h:947
Controls which types are reported during a Class 0 read.
Definition: dnp3.h:4823
bool frozen_counter
Include Frozen Counters in Class 0 reads.
Definition: dnp3.h:4833
bool analog_output_status
Include Analog Output Status in Class 0 reads.
Definition: dnp3.h:4837
bool counter
Include Counters in Class 0 reads.
Definition: dnp3.h:4831
bool analog
Include Analog Inputs in Class 0 reads.
Definition: dnp3.h:4835
bool octet_string
Include Binary Inputs in Class 0 reads.
Definition: dnp3.h:4841
bool binary_output_status
Include Binary Output Status in Class 0 reads.
Definition: dnp3.h:4829
bool binary
Include Binary Inputs in Class 0 reads.
Definition: dnp3.h:4825
bool double_bit_binary
Include Double-Bit Binary Inputs in Class 0 reads.
Definition: dnp3.h:4827
Class 0, 1, 2 and 3 config.
Definition: dnp3.h:2582
bool class3
Class 3 events.
Definition: dnp3.h:2590
bool class1
Class 1 events.
Definition: dnp3.h:2586
bool class2
Class 2 events.
Definition: dnp3.h:2588
bool class0
Class 0 (static data)
Definition: dnp3.h:2584
Callback for monitoring the client TCP connection state.
Definition: dnp3.h:2295
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:2303
void(* on_change)(dnp3_client_state_t, void *)
Called when the client state changed.
Definition: dnp3.h:2300
void * ctx
Context data.
Definition: dnp3.h:2305
Handler for command tasks.
Definition: dnp3.h:3377
void(* on_failure)(dnp3_command_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:3387
void * ctx
Context data.
Definition: dnp3.h:3392
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3390
void(* on_complete)(dnp3_nothing_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:3382
Timing parameters for connection attempts.
Definition: dnp3.h:2389
uint64_t max_connect_delay
Maximum delay between two connection attempts.
Definition: dnp3.h:2395
uint64_t min_connect_delay
Minimum delay between two connection attempts, doubles up to the maximum delay.
Definition: dnp3.h:2392
uint64_t reconnect_delay
Delay before attempting a connection after a disconnect.
Definition: dnp3.h:2398
Callback interface for connection state events.
Definition: dnp3.h:5764
void(* on_change)(dnp3_connection_state_t, void *)
Called when the connection state changes.
Definition: dnp3.h:5769
void * ctx
Context data.
Definition: dnp3.h:5774
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5772
CROB (dnp3_group12_var1_t) control code.
Definition: dnp3.h:598
dnp3_op_type_t op_type
This field is used in conjunction with the dnp3_control_code_t::tcc field to specify a control operat...
Definition: dnp3.h:606
bool queue
This field is obsolete and should always be 0.
Definition: dnp3.h:604
dnp3_trip_close_code_t tcc
This field is used in conjunction with dnp3_control_code_t::op_type to specify a control operation.
Definition: dnp3.h:600
bool clear
Support for this field is optional. When the clear bit is set, the device shall remove pending contro...
Definition: dnp3.h:602
APDU Control field.
Definition: dnp3.h:521
bool fin
Final fragment of the message.
Definition: dnp3.h:525
bool uns
Unsolicited response.
Definition: dnp3.h:529
uint8_t seq
Sequence number.
Definition: dnp3.h:531
bool fir
First fragment in the message.
Definition: dnp3.h:523
bool con
Requires confirmation.
Definition: dnp3.h:527
Callbacks for handling controls.
Definition: dnp3.h:5567
dnp3_command_status_t(* operate_g41v2)(int16_t, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *)
Operate a control point.
Definition: dnp3.h:5639
dnp3_command_status_t(* select_g41v3)(float, uint16_t, dnp3_database_handle_t *, void *)
Select an analog output, but do not operate.
Definition: dnp3.h:5651
void * ctx
Context data.
Definition: dnp3.h:5686
dnp3_command_status_t(* operate_g12v1)(dnp3_group12_var1_t, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *)
Operate a control point.
Definition: dnp3.h:5597
dnp3_command_status_t(* select_g41v1)(int32_t, uint16_t, dnp3_database_handle_t *, void *)
Select an analog output, but do not operate.
Definition: dnp3.h:5609
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5684
dnp3_command_status_t(* select_g41v4)(double, uint16_t, dnp3_database_handle_t *, void *)
Select an analog output, but do not operate.
Definition: dnp3.h:5672
void(* end_fragment)(dnp3_database_handle_t *, void *)
Notifies the end of a command fragment.
Definition: dnp3.h:5576
dnp3_command_status_t(* operate_g41v4)(double, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *)
Operate a control point.
Definition: dnp3.h:5681
void(* begin_fragment)(void *)
Notifies the start of a command fragment.
Definition: dnp3.h:5571
dnp3_command_status_t(* operate_g41v3)(float, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *)
Operate a control point.
Definition: dnp3.h:5660
dnp3_command_status_t(* select_g41v2)(int16_t, uint16_t, dnp3_database_handle_t *, void *)
Select an analog output, but do not operate.
Definition: dnp3.h:5630
dnp3_command_status_t(* select_g12v1)(dnp3_group12_var1_t, uint16_t, dnp3_database_handle_t *, void *)
Select a CROB, but do not operate.
Definition: dnp3.h:5588
dnp3_command_status_t(* operate_g41v1)(int32_t, uint16_t, dnp3_operate_type_t, dnp3_database_handle_t *, void *)
Operate a control point.
Definition: dnp3.h:5618
Counter configuration.
Definition: dnp3.h:4219
dnp3_static_counter_variation_t static_variation
Default static variation.
Definition: dnp3.h:4221
dnp3_event_counter_variation_t event_variation
Default event variation.
Definition: dnp3.h:4223
uint32_t deadband
Deadband value.
Definition: dnp3.h:4225
counter point
Definition: dnp3.h:987
uint16_t index
Point index.
Definition: dnp3.h:989
uint32_t value
Point value.
Definition: dnp3.h:991
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:993
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:995
Database transaction interface.
Definition: dnp3.h:4700
void(* execute)(dnp3_database_t *, void *)
Execute a transaction on the provided database.
Definition: dnp3.h:4705
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:4708
void * ctx
Context data.
Definition: dnp3.h:4710
Controls the decoding of transmitted and received data at the application, transport,...
Definition: dnp3.h:421
dnp3_transport_decode_level_t transport
Controls transport segment layer decoding.
Definition: dnp3.h:425
dnp3_phys_decode_level_t physical
Controls the logging of physical layer read/write.
Definition: dnp3.h:429
dnp3_link_decode_level_t link
Controls link frame decoding.
Definition: dnp3.h:427
dnp3_app_decode_level_t application
Controls application fragment decoding.
Definition: dnp3.h:423
Double-Bit Binary Input configuration.
Definition: dnp3.h:4007
dnp3_static_double_bit_binary_input_variation_t static_variation
Default static variation.
Definition: dnp3.h:4009
dnp3_event_double_bit_binary_input_variation_t event_variation
Default event variation.
Definition: dnp3.h:4011
double_bit_binary_input point
Definition: dnp3.h:903
dnp3_double_bit_t value
Point value.
Definition: dnp3.h:907
uint16_t index
Point index.
Definition: dnp3.h:905
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:911
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:909
Maximum number of events for each type.
Definition: dnp3.h:4746
uint16_t max_counter
Maximum number of Counter events (g22)
Definition: dnp3.h:4754
uint16_t max_analog
Maximum number of Analog Input events (g32)
Definition: dnp3.h:4758
uint16_t max_binary
Maximum number of Binary Input events (g2)
Definition: dnp3.h:4748
uint16_t max_binary_output_status
Maximum number of Binary Output Status events (g11)
Definition: dnp3.h:4752
uint16_t max_octet_string
Maximum number of Octet String events (g111)
Definition: dnp3.h:4762
uint16_t max_analog_output_status
Maximum number of Analog Output Status events (g42)
Definition: dnp3.h:4760
uint16_t max_double_bit_binary
Maximum number of Double-Bit Binary Input events (g4)
Definition: dnp3.h:4750
uint16_t max_frozen_counter
Maximum number of Frozen Counter events (g23)
Definition: dnp3.h:4756
Event classes.
Definition: dnp3.h:2517
bool class3
Class 3 events.
Definition: dnp3.h:2523
bool class1
Class 1 events.
Definition: dnp3.h:2519
bool class2
Class 2 events.
Definition: dnp3.h:2521
Collection of individual flag bits represented by an underlying mask value.
Definition: dnp3.h:727
uint8_t value
bit-mask representing a set of individual flag bits
Definition: dnp3.h:729
Frozen Counter configuration.
Definition: dnp3.h:4341
uint32_t deadband
Deadband value.
Definition: dnp3.h:4347
dnp3_event_frozen_counter_variation_t event_variation
Default event variation.
Definition: dnp3.h:4345
dnp3_static_frozen_counter_variation_t static_variation
Default static variation.
Definition: dnp3.h:4343
frozen_counter point
Definition: dnp3.h:1029
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:1037
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:1035
uint16_t index
Point index.
Definition: dnp3.h:1031
uint32_t value
Point value.
Definition: dnp3.h:1033
Control Relay Output Block.
Definition: dnp3.h:674
uint32_t on_time
Duration the output drive remains active (in milliseconds)
Definition: dnp3.h:680
uint32_t off_time
Duration the output drive remains non-active (in milliseconds)
Definition: dnp3.h:682
uint8_t count
Count.
Definition: dnp3.h:678
dnp3_control_code_t code
Control code.
Definition: dnp3.h:676
Information about the object header and specific variation.
Definition: dnp3.h:2038
dnp3_qualifier_code_t qualifier
Qualifier code used in the response.
Definition: dnp3.h:2042
bool is_event
true if the received variation is an event type, false otherwise
Definition: dnp3.h:2044
bool has_flags
true if a flags byte is present on the underlying variation, false otherwise
Definition: dnp3.h:2046
dnp3_variation_t variation
underlying variation in the response
Definition: dnp3.h:2040
First IIN byte.
Definition: dnp3.h:1924
bool class_2_events
Outstation has unreported Class 2 events.
Definition: dnp3.h:1930
bool class_1_events
Outstation has unreported Class 1 events.
Definition: dnp3.h:1928
bool class_3_events
Outstation has unreported Class 3 events.
Definition: dnp3.h:1932
bool broadcast
Broadcast message was received.
Definition: dnp3.h:1926
bool local_control
One or more of the outstation’s points are in local control mode.
Definition: dnp3.h:1936
bool need_time
Outstation requires time synchronization.
Definition: dnp3.h:1934
bool device_trouble
An abnormal, device-specific condition exists in the outstation.
Definition: dnp3.h:1938
bool device_restart
Outstation restarted.
Definition: dnp3.h:1940
Second IIN byte.
Definition: dnp3.h:1948
bool parameter_error
Outstation does not support requested operation for objects in the request.
Definition: dnp3.h:1954
bool object_unknown
Outstation does not support requested operation for objects in the request.
Definition: dnp3.h:1952
bool config_corrupt
The outstation detected corrupt configuration (optional support)
Definition: dnp3.h:1960
bool reserved_1
Reserved for future use - should always be set to 0.
Definition: dnp3.h:1964
bool already_executing
The operation requested is already executing (optional support)
Definition: dnp3.h:1958
bool no_func_code_support
Outstation does not support this function code.
Definition: dnp3.h:1950
bool reserved_2
Reserved for future use - should always be set to 0.
Definition: dnp3.h:1962
bool event_buffer_overflow
An event buffer overflow condition exists in the outstation, and at least one unconfirmed event was l...
Definition: dnp3.h:1956
Pair of IIN bytes.
Definition: dnp3.h:1972
dnp3_iin2_t iin2
Second IIN byte.
Definition: dnp3.h:1976
dnp3_iin1_t iin1
First IIN byte.
Definition: dnp3.h:1974
Logging interface that receives the log messages and writes them somewhere.
Definition: dnp3.h:271
void * ctx
Context data.
Definition: dnp3.h:282
void(* on_message)(dnp3_log_level_t, const char *, void *)
Called when a log message was received and should be logged.
Definition: dnp3.h:277
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:280
Logging configuration options.
Definition: dnp3.h:233
dnp3_time_format_t time_format
optional time format
Definition: dnp3.h:239
bool print_module_info
optionally print the underlying Rust module information to the message string
Definition: dnp3.h:243
dnp3_log_output_format_t output_format
output formatting options
Definition: dnp3.h:237
bool print_level
optionally print the log level as part to the message string
Definition: dnp3.h:241
dnp3_log_level_t level
logging level
Definition: dnp3.h:235
Generic configuration for a MasterChannel.
Definition: dnp3.h:2221
dnp3_decode_level_t decode_level
Decoding level for this master. You can modify this later on with dnp3_master_channel_set_decode_leve...
Definition: dnp3.h:2225
uint16_t address
Local DNP3 data-link address.
Definition: dnp3.h:2223
uint16_t rx_buffer_size
RX buffer size.
Definition: dnp3.h:2233
uint16_t tx_buffer_size
TX buffer size.
Definition: dnp3.h:2229
Octet String point.
Definition: dnp3.h:1164
uint16_t index
Point index.
Definition: dnp3.h:1166
dnp3_byte_iterator_t * value
Point value.
Definition: dnp3.h:1168
Dynamic information required by the outstation from the user application.
Definition: dnp3.h:5200
uint16_t(* get_processing_delay_ms)(void *)
Returns the DELAY_MEASUREMENT delay.
Definition: dnp3.h:5211
dnp3_restart_delay_t(* cold_restart)(void *)
Request that the outstation perform a cold restart (IEEE-1815 2012, p. 58)
Definition: dnp3.h:5229
void * ctx
Context data.
Definition: dnp3.h:5257
dnp3_restart_delay_t(* warm_restart)(void *)
Request that the outstation perform a warm restart (IEEE-1815 2012, p. 58)
Definition: dnp3.h:5236
dnp3_write_time_result_t(* write_absolute_time)(uint64_t, void *)
Handle a write of the absolute time during time synchronization procedures.
Definition: dnp3.h:5217
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5255
dnp3_application_iin_t(* get_application_iin)(void *)
Returns the application-controlled IIN bits.
Definition: dnp3.h:5222
dnp3_freeze_result_t(* freeze_counters_all)(dnp3_freeze_type_t, dnp3_database_handle_t *, void *)
Freeze all the counters.
Definition: dnp3.h:5243
dnp3_freeze_result_t(* freeze_counters_range)(uint16_t, uint16_t, dnp3_freeze_type_t, dnp3_database_handle_t *, void *)
Freeze a range of counters.
Definition: dnp3.h:5252
Outstation configuration.
Definition: dnp3.h:4909
dnp3_decode_level_t decode_level
Decoding level.
Definition: dnp3.h:4929
uint16_t max_controls_per_request
Maximum number of controls in a single request.
Definition: dnp3.h:4953
uint16_t rx_buffer_size
Receive buffer size.
Definition: dnp3.h:4927
uint32_t max_unsolicited_retries
Maximum number of unsolicited retries.
Definition: dnp3.h:4939
uint16_t master_address
Link-layer master address.
Definition: dnp3.h:4913
uint16_t solicited_buffer_size
Solicited response buffer size.
Definition: dnp3.h:4919
uint16_t outstation_address
Link-layer outstation address.
Definition: dnp3.h:4911
dnp3_outstation_features_t features
Optional features.
Definition: dnp3.h:4937
uint64_t confirm_timeout
Confirmation timeout.
Definition: dnp3.h:4932
uint64_t keep_alive_timeout
Delay of inactivity before sending a REQUEST_LINK_STATUS to the master.
Definition: dnp3.h:4947
uint64_t unsolicited_retry_delay
Delay to wait before retrying an unsolicited response.
Definition: dnp3.h:4942
dnp3_class_zero_config_t class_zero
Controls responses to Class 0 reads.
Definition: dnp3.h:4955
uint16_t unsolicited_buffer_size
Unsolicited response buffer size.
Definition: dnp3.h:4923
dnp3_event_buffer_config_t event_buffer_config
Event buffer sizes configuration.
Definition: dnp3.h:4915
uint64_t select_timeout
Select timeout.
Definition: dnp3.h:4935
uint16_t max_read_request_headers
Maximum number of headers that will be processed in a READ request.
Definition: dnp3.h:4951
Optional outstation features that can be enabled or disabled.
Definition: dnp3.h:4877
bool self_address
Respond to the self address.
Definition: dnp3.h:4879
bool unsolicited
Respond to enable/disable unsolicited response and produce unsolicited responses.
Definition: dnp3.h:4883
bool broadcast
Process valid broadcast messages.
Definition: dnp3.h:4881
Informational callbacks that the outstation doesn't rely on to function.
Definition: dnp3.h:5340
void(* clear_restart_iin)(void *)
Master cleared the restart IIN bit.
Definition: dnp3.h:5402
void * ctx
Context data.
Definition: dnp3.h:5407
void(* enter_solicited_confirm_wait)(uint8_t, void *)
Outstation has begun waiting for a solicited confirm.
Definition: dnp3.h:5356
void(* solicited_confirm_timeout)(uint8_t, void *)
Failed to receive a solicited confirm before the timeout occurred.
Definition: dnp3.h:5361
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5405
void(* enter_unsolicited_confirm_wait)(uint8_t, void *)
Outstation has begun waiting for an unsolicited confirm.
Definition: dnp3.h:5387
void(* wrong_solicited_confirm_seq)(uint8_t, uint8_t, void *)
Received a solicited confirm with the wrong sequence number.
Definition: dnp3.h:5376
void(* unexpected_confirm)(bool, uint8_t, void *)
Received a confirm when not expecting one.
Definition: dnp3.h:5382
void(* solicited_confirm_received)(uint8_t, void *)
Received the expected confirm.
Definition: dnp3.h:5366
void(* solicited_confirm_wait_new_request)(void *)
Received a new request while waiting for a solicited confirm, aborting the response series.
Definition: dnp3.h:5370
void(* process_request_from_idle)(dnp3_request_header_t, void *)
Called when a request is processed from the IDLE state.
Definition: dnp3.h:5345
void(* broadcast_received)(dnp3_function_code_t, dnp3_broadcast_action_t, void *)
Called when a broadcast request is received by the outstation.
Definition: dnp3.h:5351
void(* unsolicited_confirm_timeout)(uint8_t, bool, void *)
Failed to receive an unsolicited confirm before the timeout occurred.
Definition: dnp3.h:5393
void(* unsolicited_confirmed)(uint8_t, void *)
Master confirmed an unsolicited message.
Definition: dnp3.h:5398
Poll identifier.
Definition: dnp3.h:2506
uint64_t id
Unique poll id assigned by the association.
Definition: dnp3.h:2510
uint16_t association_id
Outstation address of the association.
Definition: dnp3.h:2508
Callback interface for receiving updates about the state of a serial port.
Definition: dnp3.h:1211
void(* on_change)(dnp3_port_state_t, void *)
Invoked when the serial port changes state.
Definition: dnp3.h:1216
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:1219
void * ctx
Context data.
Definition: dnp3.h:1221
General handler that will receive all values read from the outstation.
Definition: dnp3.h:2080
void(* handle_counter)(dnp3_header_info_t, dnp3_counter_iterator_t *, void *)
Handle counter data.
Definition: dnp3.h:2116
void(* handle_analog_input)(dnp3_header_info_t, dnp3_analog_input_iterator_t *, void *)
Handle analog input data.
Definition: dnp3.h:2128
void * ctx
Context data.
Definition: dnp3.h:2145
void(* handle_analog_output_status)(dnp3_header_info_t, dnp3_analog_output_status_iterator_t *, void *)
Handle analog output status data.
Definition: dnp3.h:2134
void(* handle_frozen_counter)(dnp3_header_info_t, dnp3_frozen_counter_iterator_t *, void *)
Handle frozen counter input data.
Definition: dnp3.h:2122
void(* handle_binary_output_status)(dnp3_header_info_t, dnp3_binary_output_status_iterator_t *, void *)
Handle binary output status data.
Definition: dnp3.h:2110
void(* begin_fragment)(dnp3_read_type_t, dnp3_response_header_t, void *)
Marks the beginning of a fragment.
Definition: dnp3.h:2086
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:2143
void(* handle_binary_input)(dnp3_header_info_t, dnp3_binary_input_iterator_t *, void *)
Handle binary input data.
Definition: dnp3.h:2098
void(* handle_double_bit_binary_input)(dnp3_header_info_t, dnp3_double_bit_binary_input_iterator_t *, void *)
Handle double-bit binary input data.
Definition: dnp3.h:2104
void(* handle_octet_string)(dnp3_header_info_t, dnp3_octet_string_iterator_t *, void *)
Handle octet string data.
Definition: dnp3.h:2140
void(* end_fragment)(dnp3_read_type_t, dnp3_response_header_t, void *)
Marks the end of a fragment.
Definition: dnp3.h:2092
Handler for read tasks.
Definition: dnp3.h:3170
void(* on_complete)(dnp3_nothing_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:3175
void * ctx
Context data.
Definition: dnp3.h:3185
void(* on_failure)(dnp3_read_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:3180
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3183
Application-layer header for requests.
Definition: dnp3.h:5300
dnp3_control_field_t control_field
Control field.
Definition: dnp3.h:5302
dnp3_function_code_t function
Function code.
Definition: dnp3.h:5304
Response header information.
Definition: dnp3.h:1984
dnp3_response_function_t func
Response type.
Definition: dnp3.h:1988
dnp3_control_field_t control_field
Application control field.
Definition: dnp3.h:1986
dnp3_iin_t iin
IIN bytes.
Definition: dnp3.h:1990
Restart delay used by dnp3_outstation_application_t::cold_restart and dnp3_outstation_application_t::...
Definition: dnp3.h:5034
uint16_t value
Expected delay before the outstation comes back online.
Definition: dnp3.h:5038
dnp3_restart_delay_type_t restart_type
Indicates what dnp3_restart_delay_t::value is.
Definition: dnp3.h:5036
Handler for restart tasks.
Definition: dnp3.h:3601
void(* on_failure)(dnp3_restart_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:3611
void * ctx
Context data.
Definition: dnp3.h:3616
void(* on_complete)(uint64_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:3606
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3614
Retry strategy configuration.
Definition: dnp3.h:1543
uint64_t max_delay
Maximum delay between two retries.
Definition: dnp3.h:1549
uint64_t min_delay
Minimum delay between two retries.
Definition: dnp3.h:1546
Runtime configuration.
Definition: dnp3.h:480
uint16_t num_core_threads
Number of runtime threads to spawn. For a guess of the number of CPU cores, use 0.
Definition: dnp3.h:484
Serial port settings.
Definition: dnp3.h:1673
dnp3_flow_control_t flow_control
Type of signalling to use for controlling data transfer.
Definition: dnp3.h:1679
dnp3_stop_bits_t stop_bits
Number of bits to use to signal the end of a character.
Definition: dnp3.h:1683
uint32_t baud_rate
Baud rate (in symbols-per-second)
Definition: dnp3.h:1675
dnp3_data_bits_t data_bits
Number of bits used to represent a character sent on the line.
Definition: dnp3.h:1677
dnp3_parity_t parity
Type of parity to use for error checking.
Definition: dnp3.h:1681
Handler for time synchronization tasks.
Definition: dnp3.h:3511
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3524
void(* on_complete)(dnp3_nothing_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:3516
void(* on_failure)(dnp3_time_sync_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:3521
void * ctx
Context data.
Definition: dnp3.h:3526
Timestamp value.
Definition: dnp3.h:773
uint64_t value
Timestamp value.
Definition: dnp3.h:775
dnp3_time_quality_t quality
Timestamp quality.
Definition: dnp3.h:777
TLS client configuration.
Definition: dnp3.h:2337
const char * private_key_path
Path to the the PEM-encoded private key.
Definition: dnp3.h:2345
const char * dns_name
Expected name to validate in the presented certificate (only in DNP3_CERTIFICATE_MODE_AUTHORITY_BASED...
Definition: dnp3.h:2339
const char * password
Optional password if the private key file is encrypted.
Definition: dnp3.h:2351
dnp3_certificate_mode_t certificate_mode
Certificate validation mode.
Definition: dnp3.h:2355
const char * local_cert_path
Path to the PEM-encoded local certificate.
Definition: dnp3.h:2343
dnp3_min_tls_version_t min_tls_version
Minimum TLS version allowed.
Definition: dnp3.h:2353
const char * peer_cert_path
Path to the PEM-encoded certificate of the peer.
Definition: dnp3.h:2341
TLS server configuration.
Definition: dnp3.h:5879
dnp3_min_tls_version_t min_tls_version
Minimum TLS version allowed.
Definition: dnp3.h:5895
const char * private_key_path
Path to the the PEM-encoded private key.
Definition: dnp3.h:5887
const char * local_cert_path
Path to the PEM-encoded local certificate.
Definition: dnp3.h:5885
const char * dns_name
Expected name to validate in the presented certificate (only in DNP3_CERTIFICATE_MODE_AUTHORITY_BASED...
Definition: dnp3.h:5881
const char * password
Optional password if the private key file is encrypted.
Definition: dnp3.h:5893
dnp3_certificate_mode_t certificate_mode
Certificate validation mode.
Definition: dnp3.h:5897
const char * peer_cert_path
Path to the PEM-encoded certificate of the peer.
Definition: dnp3.h:5883
Options that control how the update is performed.
Definition: dnp3.h:3813
dnp3_event_mode_t event_mode
Determines how/if an event is produced.
Definition: dnp3.h:3817
bool update_static
Optionally bypass updating the static database (the current value)
Definition: dnp3.h:3815
Timestamp value returned by dnp3_association_handler_t::get_current_time.
Definition: dnp3.h:2748
bool is_valid
True if the timestamp is valid, false otherwise.
Definition: dnp3.h:2754
uint64_t value
Value of the timestamp (in milliseconds from UNIX Epoch).
Definition: dnp3.h:2752