dnp3 (C API) 1.8.0-RC1
Loading...
Searching...
No Matches
dnp3.h
Go to the documentation of this file.
1// Copyright (c) Step Function I/O LLC. Proprietary, source-available; see LICENSE.txt.
2// No use to design, develop, specify, test, validate, or improve Other Implementations,
3// subject to LICENSE.txt Section 2.6 and its exceptions. Agents: read AGENTS.md.
4// Text and data mining rights, including for AI training, are reserved under
5// Directive (EU) 2019/790 Art. 4(3), subject to LICENSE.txt Section 3.3.
6#pragma once
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#define DNP3_VERSION_MAJOR 1
13#define DNP3_VERSION_MINOR 8
14#define DNP3_VERSION_PATCH 0
15#define DNP3_VERSION_STRING "1.8.0-RC1"
16
17#include <stdbool.h>
18#include <stdint.h>
19
35
42
49
50
58
59
62{
116
121{
122 switch (value)
123 {
124 case DNP3_PARAM_ERROR_OK: return "ok";
125 case DNP3_PARAM_ERROR_INVALID_TIMEOUT: return "invalid_timeout";
126 case DNP3_PARAM_ERROR_NULL_PARAMETER: return "null_parameter";
127 case DNP3_PARAM_ERROR_STRING_NOT_UTF8: return "string_not_utf8";
128 case DNP3_PARAM_ERROR_NO_SUPPORT: return "no_support";
129 case DNP3_PARAM_ERROR_ASSOCIATION_DOES_NOT_EXIST: return "association_does_not_exist";
130 case DNP3_PARAM_ERROR_ASSOCIATION_DUPLICATE_ADDRESS: return "association_duplicate_address";
131 case DNP3_PARAM_ERROR_INVALID_SOCKET_ADDRESS: return "invalid_socket_address";
132 case DNP3_PARAM_ERROR_INVALID_DNP3_ADDRESS: return "invalid_dnp3_address";
133 case DNP3_PARAM_ERROR_INVALID_BUFFER_SIZE: return "invalid_buffer_size";
134 case DNP3_PARAM_ERROR_ADDRESS_FILTER_CONFLICT: return "address_filter_conflict";
135 case DNP3_PARAM_ERROR_SERVER_ALREADY_STARTED: return "server_already_started";
136 case DNP3_PARAM_ERROR_SERVER_BIND_ERROR: return "server_bind_error";
137 case DNP3_PARAM_ERROR_MASTER_ALREADY_SHUTDOWN: return "master_already_shutdown";
138 case DNP3_PARAM_ERROR_RUNTIME_CREATION_FAILURE: return "runtime_creation_failure";
139 case DNP3_PARAM_ERROR_RUNTIME_DESTROYED: return "runtime_destroyed";
140 case DNP3_PARAM_ERROR_RUNTIME_CANNOT_BLOCK_WITHIN_ASYNC: return "runtime_cannot_block_within_async";
141 case DNP3_PARAM_ERROR_LOGGING_ALREADY_CONFIGURED: return "logging_already_configured";
142 case DNP3_PARAM_ERROR_POINT_DOES_NOT_EXIST: return "point_does_not_exist";
143 case DNP3_PARAM_ERROR_INVALID_PEER_CERTIFICATE: return "invalid_peer_certificate";
144 case DNP3_PARAM_ERROR_INVALID_LOCAL_CERTIFICATE: return "invalid_local_certificate";
145 case DNP3_PARAM_ERROR_INVALID_PRIVATE_KEY: return "invalid_private_key";
146 case DNP3_PARAM_ERROR_INVALID_DNS_NAME: return "invalid_dns_name";
147 case DNP3_PARAM_ERROR_OTHER_TLS_ERROR: return "other_tls_error";
148 case DNP3_PARAM_ERROR_WRONG_CHANNEL_TYPE: return "wrong_channel_type";
149 case DNP3_PARAM_ERROR_CONSUMED: return "consumed";
150 default: return "unknown param_error value";
151 }
152}
153
154
157{
201
206{
207 switch (value)
208 {
209 case DNP3_COMMAND_STATUS_SUCCESS: return "success";
210 case DNP3_COMMAND_STATUS_TIMEOUT: return "timeout";
211 case DNP3_COMMAND_STATUS_NO_SELECT: return "no_select";
212 case DNP3_COMMAND_STATUS_FORMAT_ERROR: return "format_error";
213 case DNP3_COMMAND_STATUS_NOT_SUPPORTED: return "not_supported";
214 case DNP3_COMMAND_STATUS_ALREADY_ACTIVE: return "already_active";
215 case DNP3_COMMAND_STATUS_HARDWARE_ERROR: return "hardware_error";
216 case DNP3_COMMAND_STATUS_LOCAL: return "local";
217 case DNP3_COMMAND_STATUS_TOO_MANY_OPS: return "too_many_ops";
218 case DNP3_COMMAND_STATUS_NOT_AUTHORIZED: return "not_authorized";
219 case DNP3_COMMAND_STATUS_AUTOMATION_INHIBIT: return "automation_inhibit";
220 case DNP3_COMMAND_STATUS_PROCESSING_LIMITED: return "processing_limited";
221 case DNP3_COMMAND_STATUS_OUT_OF_RANGE: return "out_of_range";
222 case DNP3_COMMAND_STATUS_DOWNSTREAM_LOCAL: return "downstream_local";
223 case DNP3_COMMAND_STATUS_ALREADY_COMPLETE: return "already_complete";
224 case DNP3_COMMAND_STATUS_BLOCKED: return "blocked";
225 case DNP3_COMMAND_STATUS_CANCELED: return "canceled";
226 case DNP3_COMMAND_STATUS_BLOCKED_OTHER_MASTER: return "blocked_other_master";
227 case DNP3_COMMAND_STATUS_DOWNSTREAM_FAIL: return "downstream_fail";
228 case DNP3_COMMAND_STATUS_NON_PARTICIPATING: return "non_participating";
229 case DNP3_COMMAND_STATUS_UNKNOWN: return "unknown";
230 default: return "unknown command_status value";
231 }
232}
233
235#define DNP3_FLAG_ONLINE 0x01
237#define DNP3_FLAG_RESTART 0x02
239#define DNP3_FLAG_COMM_LOST 0x04
241#define DNP3_FLAG_REMOTE_FORCED 0x08
243#define DNP3_FLAG_LOCAL_FORCED 0x10
245#define DNP3_FLAG_CHATTER_FILTER 0x20
247#define DNP3_FLAG_OVER_RANGE 0x20
249#define DNP3_FLAG_DISCONTINUITY 0x40
251#define DNP3_FLAG_REFERENCE_ERR 0x40
252
255{
265
270{
271 switch (value)
272 {
273 case DNP3_APP_DECODE_LEVEL_NOTHING: return "nothing";
274 case DNP3_APP_DECODE_LEVEL_HEADER: return "header";
275 case DNP3_APP_DECODE_LEVEL_OBJECT_HEADERS: return "object_headers";
276 case DNP3_APP_DECODE_LEVEL_OBJECT_VALUES: return "object_values";
277 default: return "unknown app_decode_level value";
278 }
279}
280
283{
291
296{
297 switch (value)
298 {
299 case DNP3_TRANSPORT_DECODE_LEVEL_NOTHING: return "nothing";
300 case DNP3_TRANSPORT_DECODE_LEVEL_HEADER: return "header";
301 case DNP3_TRANSPORT_DECODE_LEVEL_PAYLOAD: return "payload";
302 default: return "unknown transport_decode_level value";
303 }
304}
305
308{
316
321{
322 switch (value)
323 {
324 case DNP3_LINK_DECODE_LEVEL_NOTHING: return "nothing";
325 case DNP3_LINK_DECODE_LEVEL_HEADER: return "header";
326 case DNP3_LINK_DECODE_LEVEL_PAYLOAD: return "payload";
327 default: return "unknown link_decode_level value";
328 }
329}
330
333{
341
346{
347 switch (value)
348 {
349 case DNP3_PHYS_DECODE_LEVEL_NOTHING: return "nothing";
350 case DNP3_PHYS_DECODE_LEVEL_LENGTH: return "length";
351 case DNP3_PHYS_DECODE_LEVEL_DATA: return "data";
352 default: return "unknown phys_decode_level value";
353 }
354}
355
357
360{
370
381{
382 dnp3_decode_level_t _return_value = {
387 };
388 return _return_value;
389}
390
401{
402 dnp3_decode_level_t _return_value = {
407 };
408 return _return_value;
409}
410
411
414
416
419{
425
433{
434 dnp3_runtime_config_t _return_value = {
435 0
436 };
437 return _return_value;
438}
439
440
448
454
462void dnp3_runtime_set_shutdown_timeout(dnp3_runtime_t* instance, uint64_t timeout);
463
464
466
469{
471 bool fir;
473 bool fin;
475 bool con;
477 bool uns;
479 uint8_t seq;
481
482
485{
495
500{
501 switch (value)
502 {
503 case DNP3_TRIP_CLOSE_CODE_NUL: return "nul";
504 case DNP3_TRIP_CLOSE_CODE_CLOSE: return "close";
505 case DNP3_TRIP_CLOSE_CODE_TRIP: return "trip";
506 case DNP3_TRIP_CLOSE_CODE_RESERVED: return "reserved";
507 default: return "unknown trip_close_code value";
508 }
509}
510
512typedef enum dnp3_op_type_t
513{
525
529static const char* dnp3_op_type_to_string(dnp3_op_type_t value)
530{
531 switch (value)
532 {
533 case DNP3_OP_TYPE_NUL: return "nul";
534 case DNP3_OP_TYPE_PULSE_ON: return "pulse_on";
535 case DNP3_OP_TYPE_PULSE_OFF: return "pulse_off";
536 case DNP3_OP_TYPE_LATCH_ON: return "latch_on";
537 case DNP3_OP_TYPE_LATCH_OFF: return "latch_off";
538 default: return "unknown op_type value";
539 }
540}
541
543
546{
550 bool clear;
552 bool queue;
556
567{
568 dnp3_control_code_t _return_value = {
569 tcc,
570 clear,
571 false,
572 op_type
573 };
574 return _return_value;
575}
576
587{
588 dnp3_control_code_t _return_value = {
590 false,
591 false,
592 op_type
593 };
594 return _return_value;
595}
596
607{
608 dnp3_control_code_t _return_value = {
609 tcc,
610 false,
611 false,
612 op_type
613 };
614 return _return_value;
615}
616
617
619
622{
626 uint8_t count;
628 uint32_t on_time;
630 uint32_t off_time;
632
639static dnp3_group12_var1_t dnp3_group12_var1_init(dnp3_control_code_t code, uint8_t count, uint32_t on_time, uint32_t off_time)
640{
641 dnp3_group12_var1_t _return_value = {
642 code,
643 count,
644 on_time,
645 off_time
646 };
647 return _return_value;
648}
649
660{
661 dnp3_group12_var1_t _return_value = {
662 code,
663 1,
664 1000,
665 1000
666 };
667 return _return_value;
668}
669
670
671typedef struct dnp3_flags_t dnp3_flags_t;
672
674typedef struct dnp3_flags_t
675{
677 uint8_t value;
679
683static dnp3_flags_t dnp3_flags_init(uint8_t value)
684{
685 dnp3_flags_t _return_value = {
686 value
687 };
688 return _return_value;
689}
690
691
694{
708
713{
714 switch (value)
715 {
716 case DNP3_TIME_QUALITY_SYNCHRONIZED_TIME: return "synchronized_time";
717 case DNP3_TIME_QUALITY_UNSYNCHRONIZED_TIME: return "unsynchronized_time";
718 case DNP3_TIME_QUALITY_INVALID_TIME: return "invalid_time";
719 default: return "unknown time_quality value";
720 }
721}
722
724
726typedef struct dnp3_timestamp_t
727{
731 uint64_t value;
735
744{
745 dnp3_timestamp_t _return_value = {
746 0,
748 };
749 return _return_value;
750}
751
760{
761 dnp3_timestamp_t _return_value = {
762 value,
764 };
765 return _return_value;
766}
767
776{
777 dnp3_timestamp_t _return_value = {
778 value,
780 };
781 return _return_value;
782}
783
784
787{
797
802{
803 switch (value)
804 {
805 case DNP3_DOUBLE_BIT_INTERMEDIATE: return "intermediate";
806 case DNP3_DOUBLE_BIT_DETERMINED_OFF: return "determined_off";
807 case DNP3_DOUBLE_BIT_DETERMINED_ON: return "determined_on";
808 case DNP3_DOUBLE_BIT_INDETERMINATE: return "indeterminate";
809 default: return "unknown double_bit value";
810 }
811}
812
814
817{
819 uint16_t index;
821 bool value;
827
834static dnp3_binary_input_t dnp3_binary_input_init(uint16_t index, bool value, dnp3_flags_t flags, dnp3_timestamp_t time)
835{
836 dnp3_binary_input_t _return_value = {
837 index,
838 value,
839 flags,
840 time
841 };
842 return _return_value;
843}
844
845
848
853
854
856
859{
861 uint16_t index;
869
877{
878 dnp3_double_bit_binary_input_t _return_value = {
879 index,
880 value,
881 flags,
882 time
883 };
884 return _return_value;
885}
886
887
890
895
896
898
901{
903 uint16_t index;
905 bool value;
911
919{
920 dnp3_binary_output_status_t _return_value = {
921 index,
922 value,
923 flags,
924 time
925 };
926 return _return_value;
927}
928
929
932
937
938
939typedef struct dnp3_counter_t dnp3_counter_t;
940
942typedef struct dnp3_counter_t
943{
945 uint16_t index;
947 uint32_t value;
953
960static dnp3_counter_t dnp3_counter_init(uint16_t index, uint32_t value, dnp3_flags_t flags, dnp3_timestamp_t time)
961{
962 dnp3_counter_t _return_value = {
963 index,
964 value,
965 flags,
966 time
967 };
968 return _return_value;
969}
970
971
974
979
980
982
985{
987 uint16_t index;
989 uint32_t value;
995
1002static dnp3_frozen_counter_t dnp3_frozen_counter_init(uint16_t index, uint32_t value, dnp3_flags_t flags, dnp3_timestamp_t time)
1003{
1004 dnp3_frozen_counter_t _return_value = {
1005 index,
1006 value,
1007 flags,
1008 time
1009 };
1010 return _return_value;
1011}
1012
1013
1016
1021
1022
1024
1027{
1029 uint16_t index;
1031 double value;
1037
1044static dnp3_analog_input_t dnp3_analog_input_init(uint16_t index, double value, dnp3_flags_t flags, dnp3_timestamp_t time)
1045{
1046 dnp3_analog_input_t _return_value = {
1047 index,
1048 value,
1049 flags,
1050 time
1051 };
1052 return _return_value;
1053}
1054
1055
1058
1063
1064
1066
1069{
1071 uint16_t index;
1073 double value;
1079
1087{
1088 dnp3_frozen_analog_input_t _return_value = {
1089 index,
1090 value,
1091 flags,
1092 time
1093 };
1094 return _return_value;
1095}
1096
1097
1100
1105
1106
1108
1111{
1113 uint16_t index;
1115 double value;
1121
1129{
1130 dnp3_analog_output_status_t _return_value = {
1131 index,
1132 value,
1133 flags,
1134 time
1135 };
1136 return _return_value;
1137}
1138
1139
1142
1147
1148
1150
1157{
1159 uint16_t index;
1169
1177{
1178 dnp3_binary_output_command_event_t _return_value = {
1179 index,
1180 status,
1181 commanded_state,
1182 time
1183 };
1184 return _return_value;
1185}
1186
1187
1190
1195
1196
1199{
1209
1214{
1215 switch (value)
1216 {
1217 case DNP3_ANALOG_COMMAND_TYPE_I16: return "i16";
1218 case DNP3_ANALOG_COMMAND_TYPE_I32: return "i32";
1219 case DNP3_ANALOG_COMMAND_TYPE_F32: return "f32";
1220 case DNP3_ANALOG_COMMAND_TYPE_F64: return "f64";
1221 default: return "unknown analog_command_type value";
1222 }
1223}
1224
1226
1233{
1235 uint16_t index;
1247
1256{
1257 dnp3_analog_output_command_event_t _return_value = {
1258 index,
1259 status,
1260 commanded_value,
1261 command_type,
1262 time
1263 };
1264 return _return_value;
1265}
1266
1267
1270
1275
1276
1278
1283{
1285 uint16_t index;
1287 uint8_t value;
1289
1294static dnp3_unsigned_integer_t dnp3_unsigned_integer_init(uint16_t index, uint8_t value)
1295{
1296 dnp3_unsigned_integer_t _return_value = {
1297 index,
1298 value
1299 };
1300 return _return_value;
1301}
1302
1303
1306
1311
1312
1314
1317{
1319 uint16_t index;
1323 double value;
1325
1331{
1332 dnp3_analog_input_dead_band_t _return_value = {
1333 index,
1334 value
1335 };
1336 return _return_value;
1337}
1338
1339
1342
1347
1348
1351
1356
1357
1359
1362{
1364 uint16_t index;
1368
1374{
1375 dnp3_octet_string_t _return_value = {
1376 index,
1377 value
1378 };
1379 return _return_value;
1380}
1381
1382
1385
1390
1391
1394
1398
1402
1407
1415
1416
1421
1428
1432
1438void dnp3_endpoint_list_add(dnp3_endpoint_list_t* instance, const char* endpoint);
1439
1440
1442
1445{
1456
1466{
1467 dnp3_connect_strategy_t _return_value = {
1468 1000,
1469 10000,
1470 1000
1471 };
1472 return _return_value;
1473}
1474
1475
1478{
1484
1489{
1490 switch (value)
1491 {
1492 case DNP3_MIN_TLS_VERSION_V12: return "v12";
1493 case DNP3_MIN_TLS_VERSION_V13: return "v13";
1494 default: return "unknown min_tls_version value";
1495 }
1496}
1497
1502{
1514
1519{
1520 switch (value)
1521 {
1522 case DNP3_CERTIFICATE_MODE_AUTHORITY_BASED: return "authority_based";
1523 case DNP3_CERTIFICATE_MODE_SELF_SIGNED: return "self_signed";
1524 default: return "unknown certificate_mode value";
1525 }
1526}
1527
1529
1532{
1536 const char* dns_name;
1538 const char* peer_cert_path;
1540 const char* local_cert_path;
1542 const char* private_key_path;
1548 const char* password;
1556
1570static 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)
1571{
1572 dnp3_tls_client_config_t _return_value = {
1573 dns_name,
1574 peer_cert_path,
1575 local_cert_path,
1576 private_key_path,
1577 password,
1580 false
1581 };
1582 return _return_value;
1583}
1584
1585
1587#define DNP3_ATTRIBUTE_VARIATIONS_CONFIG_ID 0xC4
1589#define DNP3_ATTRIBUTE_VARIATIONS_CONFIG_VERSION 0xC5
1591#define DNP3_ATTRIBUTE_VARIATIONS_CONFIG_BUILD_DATE 0xC6
1593#define DNP3_ATTRIBUTE_VARIATIONS_CONFIG_LAST_CHANGE_DATE 0xC7
1595#define DNP3_ATTRIBUTE_VARIATIONS_CONFIG_DIGEST 0xC8
1597#define DNP3_ATTRIBUTE_VARIATIONS_CONFIG_DIGEST_ALGORITHM 0xC9
1599#define DNP3_ATTRIBUTE_VARIATIONS_MASTER_RESOURCE_ID 0xCA
1601#define DNP3_ATTRIBUTE_VARIATIONS_DEVICE_LOCATION_ALTITUDE 0xCB
1603#define DNP3_ATTRIBUTE_VARIATIONS_DEVICE_LOCATION_LONGITUDE 0xCC
1605#define DNP3_ATTRIBUTE_VARIATIONS_DEVICE_LOCATION_LATITUDE 0xCD
1607#define DNP3_ATTRIBUTE_VARIATIONS_USER_ASSIGNED_SECONDARY_OPERATOR_NAME 0xCE
1609#define DNP3_ATTRIBUTE_VARIATIONS_USER_ASSIGNED_PRIMARY_OPERATOR_NAME 0xCF
1611#define DNP3_ATTRIBUTE_VARIATIONS_USER_ASSIGNED_SYSTEM_NAME 0xD0
1613#define DNP3_ATTRIBUTE_VARIATIONS_SECURE_AUTH_VERSION 0xD1
1615#define DNP3_ATTRIBUTE_VARIATIONS_NUM_SECURITY_STATS_PER_ASSOC 0xD2
1617#define DNP3_ATTRIBUTE_VARIATIONS_USER_SPECIFIC_ATTRIBUTES 0xD3
1619#define DNP3_ATTRIBUTE_VARIATIONS_NUM_MASTER_DEFINED_DATA_SET_PROTO 0xD4
1621#define DNP3_ATTRIBUTE_VARIATIONS_NUM_OUTSTATION_DEFINED_DATA_SET_PROTO 0xD5
1623#define DNP3_ATTRIBUTE_VARIATIONS_NUM_MASTER_DEFINED_DATA_SETS 0xD6
1625#define DNP3_ATTRIBUTE_VARIATIONS_NUM_OUTSTATION_DEFINED_DATA_SETS 0xD7
1627#define DNP3_ATTRIBUTE_VARIATIONS_MAX_BINARY_OUTPUT_PER_REQUEST 0xD8
1629#define DNP3_ATTRIBUTE_VARIATIONS_LOCAL_TIMING_ACCURACY 0xD9
1631#define DNP3_ATTRIBUTE_VARIATIONS_DURATION_OF_TIME_ACCURACY 0xDA
1633#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_ANALOG_OUTPUT_EVENTS 0xDB
1635#define DNP3_ATTRIBUTE_VARIATIONS_MAX_ANALOG_OUTPUT_INDEX 0xDC
1637#define DNP3_ATTRIBUTE_VARIATIONS_NUM_ANALOG_OUTPUTS 0xDD
1639#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_BINARY_OUTPUT_EVENTS 0xDE
1641#define DNP3_ATTRIBUTE_VARIATIONS_MAX_BINARY_OUTPUT_INDEX 0xDF
1643#define DNP3_ATTRIBUTE_VARIATIONS_NUM_BINARY_OUTPUTS 0xE0
1645#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_FROZEN_COUNTER_EVENTS 0xE1
1647#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_FROZEN_COUNTERS 0xE2
1649#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_COUNTER_EVENTS 0xE3
1651#define DNP3_ATTRIBUTE_VARIATIONS_MAX_COUNTER_INDEX 0xE4
1653#define DNP3_ATTRIBUTE_VARIATIONS_NUM_COUNTER 0xE5
1655#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_FROZEN_ANALOG_INPUTS 0xE6
1657#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_ANALOG_INPUT_EVENTS 0xE7
1659#define DNP3_ATTRIBUTE_VARIATIONS_MAX_ANALOG_INPUT_INDEX 0xE8
1661#define DNP3_ATTRIBUTE_VARIATIONS_NUM_ANALOG_INPUT 0xE9
1663#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_DOUBLE_BIT_BINARY_INPUT_EVENTS 0xEA
1665#define DNP3_ATTRIBUTE_VARIATIONS_MAX_DOUBLE_BIT_BINARY_INPUT_INDEX 0xEB
1667#define DNP3_ATTRIBUTE_VARIATIONS_NUM_DOUBLE_BIT_BINARY_INPUT 0xEC
1669#define DNP3_ATTRIBUTE_VARIATIONS_SUPPORTS_BINARY_INPUT_EVENTS 0xED
1671#define DNP3_ATTRIBUTE_VARIATIONS_MAX_BINARY_INPUT_INDEX 0xEE
1673#define DNP3_ATTRIBUTE_VARIATIONS_NUM_BINARY_INPUT 0xEF
1675#define DNP3_ATTRIBUTE_VARIATIONS_MAX_TX_FRAGMENT_SIZE 0xF0
1677#define DNP3_ATTRIBUTE_VARIATIONS_MAX_RX_FRAGMENT_SIZE 0xF1
1679#define DNP3_ATTRIBUTE_VARIATIONS_DEVICE_MANUFACTURER_SOFTWARE_VERSION 0xF2
1681#define DNP3_ATTRIBUTE_VARIATIONS_DEVICE_MANUFACTURER_HARDWARE_VERSION 0xF3
1683#define DNP3_ATTRIBUTE_VARIATIONS_USER_ASSIGNED_OWNER_NAME 0xF4
1685#define DNP3_ATTRIBUTE_VARIATIONS_USER_ASSIGNED_LOCATION 0xF5
1687#define DNP3_ATTRIBUTE_VARIATIONS_USER_ASSIGNED_ID 0xF6
1689#define DNP3_ATTRIBUTE_VARIATIONS_USER_ASSIGNED_DEVICE_NAME 0xF7
1691#define DNP3_ATTRIBUTE_VARIATIONS_DEVICE_SERIAL_NUMBER 0xF8
1693#define DNP3_ATTRIBUTE_VARIATIONS_DEVICE_SUBSET_AND_CONFORMANCE 0xF9
1695#define DNP3_ATTRIBUTE_VARIATIONS_PRODUCT_NAME_AND_MODEL 0xFA
1697#define DNP3_ATTRIBUTE_VARIATIONS_DEVICE_MANUFACTURERS_NAME 0xFC
1699#define DNP3_ATTRIBUTE_VARIATIONS_ALL_ATTRIBUTES_REQUEST 0xFE
1701#define DNP3_ATTRIBUTE_VARIATIONS_LIST_OF_VARIATIONS 0xFF
1702
1705{
1711
1716{
1717 switch (value)
1718 {
1719 case DNP3_VARIATION_LIST_ATTR_UNKNOWN: return "unknown";
1720 case DNP3_VARIATION_LIST_ATTR_LIST_OF_VARIATIONS: return "list_of_variations";
1721 default: return "unknown variation_list_attr value";
1722 }
1723}
1724
1727{
1767
1772{
1773 switch (value)
1774 {
1775 case DNP3_STRING_ATTR_UNKNOWN: return "unknown";
1776 case DNP3_STRING_ATTR_CONFIG_ID: return "config_id";
1777 case DNP3_STRING_ATTR_CONFIG_VERSION: return "config_version";
1778 case DNP3_STRING_ATTR_CONFIG_DIGEST_ALGORITHM: return "config_digest_algorithm";
1779 case DNP3_STRING_ATTR_MASTER_RESOURCE_ID: return "master_resource_id";
1780 case DNP3_STRING_ATTR_USER_ASSIGNED_SECONDARY_OPERATOR_NAME: return "user_assigned_secondary_operator_name";
1781 case DNP3_STRING_ATTR_USER_ASSIGNED_PRIMARY_OPERATOR_NAME: return "user_assigned_primary_operator_name";
1782 case DNP3_STRING_ATTR_USER_ASSIGNED_SYSTEM_NAME: return "user_assigned_system_name";
1783 case DNP3_STRING_ATTR_USER_SPECIFIC_ATTRIBUTES: return "user_specific_attributes";
1784 case DNP3_STRING_ATTR_DEVICE_MANUFACTURER_SOFTWARE_VERSION: return "device_manufacturer_software_version";
1785 case DNP3_STRING_ATTR_DEVICE_MANUFACTURER_HARDWARE_VERSION: return "device_manufacturer_hardware_version";
1786 case DNP3_STRING_ATTR_USER_ASSIGNED_OWNER_NAME: return "user_assigned_owner_name";
1787 case DNP3_STRING_ATTR_USER_ASSIGNED_LOCATION: return "user_assigned_location";
1788 case DNP3_STRING_ATTR_USER_ASSIGNED_ID: return "user_assigned_id";
1789 case DNP3_STRING_ATTR_USER_ASSIGNED_DEVICE_NAME: return "user_assigned_device_name";
1790 case DNP3_STRING_ATTR_DEVICE_SERIAL_NUMBER: return "device_serial_number";
1791 case DNP3_STRING_ATTR_DEVICE_SUBSET_AND_CONFORMANCE: return "device_subset_and_conformance";
1792 case DNP3_STRING_ATTR_PRODUCT_NAME_AND_MODEL: return "product_name_and_model";
1793 case DNP3_STRING_ATTR_DEVICE_MANUFACTURERS_NAME: return "device_manufacturers_name";
1794 default: return "unknown string_attr value";
1795 }
1796}
1797
1800{
1850
1855{
1856 switch (value)
1857 {
1858 case DNP3_UINT_ATTR_UNKNOWN: return "unknown";
1859 case DNP3_UINT_ATTR_SECURE_AUTH_VERSION: return "secure_auth_version";
1860 case DNP3_UINT_ATTR_NUM_SECURITY_STATS_PER_ASSOC: return "num_security_stats_per_assoc";
1861 case DNP3_UINT_ATTR_NUM_MASTER_DEFINED_DATA_SET_PROTO: return "num_master_defined_data_set_proto";
1862 case DNP3_UINT_ATTR_NUM_OUTSTATION_DEFINED_DATA_SET_PROTO: return "num_outstation_defined_data_set_proto";
1863 case DNP3_UINT_ATTR_NUM_MASTER_DEFINED_DATA_SETS: return "num_master_defined_data_sets";
1864 case DNP3_UINT_ATTR_NUM_OUTSTATION_DEFINED_DATA_SETS: return "num_outstation_defined_data_sets";
1865 case DNP3_UINT_ATTR_MAX_BINARY_OUTPUT_PER_REQUEST: return "max_binary_output_per_request";
1866 case DNP3_UINT_ATTR_LOCAL_TIMING_ACCURACY: return "local_timing_accuracy";
1867 case DNP3_UINT_ATTR_DURATION_OF_TIME_ACCURACY: return "duration_of_time_accuracy";
1868 case DNP3_UINT_ATTR_MAX_ANALOG_OUTPUT_INDEX: return "max_analog_output_index";
1869 case DNP3_UINT_ATTR_NUM_ANALOG_OUTPUTS: return "num_analog_outputs";
1870 case DNP3_UINT_ATTR_MAX_BINARY_OUTPUT_INDEX: return "max_binary_output_index";
1871 case DNP3_UINT_ATTR_NUM_BINARY_OUTPUTS: return "num_binary_outputs";
1872 case DNP3_UINT_ATTR_MAX_COUNTER_INDEX: return "max_counter_index";
1873 case DNP3_UINT_ATTR_NUM_COUNTER: return "num_counter";
1874 case DNP3_UINT_ATTR_MAX_ANALOG_INPUT_INDEX: return "max_analog_input_index";
1875 case DNP3_UINT_ATTR_NUM_ANALOG_INPUT: return "num_analog_input";
1876 case DNP3_UINT_ATTR_MAX_DOUBLE_BIT_BINARY_INPUT_INDEX: return "max_double_bit_binary_input_index";
1877 case DNP3_UINT_ATTR_NUM_DOUBLE_BIT_BINARY_INPUT: return "num_double_bit_binary_input";
1878 case DNP3_UINT_ATTR_MAX_BINARY_INPUT_INDEX: return "max_binary_input_index";
1879 case DNP3_UINT_ATTR_NUM_BINARY_INPUT: return "num_binary_input";
1880 case DNP3_UINT_ATTR_MAX_TX_FRAGMENT_SIZE: return "max_tx_fragment_size";
1881 case DNP3_UINT_ATTR_MAX_RX_FRAGMENT_SIZE: return "max_rx_fragment_size";
1882 default: return "unknown uint_attr value";
1883 }
1884}
1885
1890{
1894
1899{
1900 switch (value)
1901 {
1902 case DNP3_INT_ATTR_UNKNOWN: return "unknown";
1903 default: return "unknown int_attr value";
1904 }
1905}
1906
1911{
1933
1938{
1939 switch (value)
1940 {
1941 case DNP3_BOOL_ATTR_UNKNOWN: return "unknown";
1942 case DNP3_BOOL_ATTR_SUPPORTS_ANALOG_OUTPUT_EVENTS: return "supports_analog_output_events";
1943 case DNP3_BOOL_ATTR_SUPPORTS_BINARY_OUTPUT_EVENTS: return "supports_binary_output_events";
1944 case DNP3_BOOL_ATTR_SUPPORTS_FROZEN_COUNTER_EVENTS: return "supports_frozen_counter_events";
1945 case DNP3_BOOL_ATTR_SUPPORTS_FROZEN_COUNTERS: return "supports_frozen_counters";
1946 case DNP3_BOOL_ATTR_SUPPORTS_COUNTER_EVENTS: return "supports_counter_events";
1947 case DNP3_BOOL_ATTR_SUPPORTS_FROZEN_ANALOG_INPUTS: return "supports_frozen_analog_inputs";
1948 case DNP3_BOOL_ATTR_SUPPORTS_ANALOG_INPUT_EVENTS: return "supports_analog_input_events";
1949 case DNP3_BOOL_ATTR_SUPPORTS_DOUBLE_BIT_BINARY_INPUT_EVENTS: return "supports_double_bit_binary_input_events";
1950 case DNP3_BOOL_ATTR_SUPPORTS_BINARY_INPUT_EVENTS: return "supports_binary_input_events";
1951 default: return "unknown bool_attr value";
1952 }
1953}
1954
1957{
1965
1970{
1971 switch (value)
1972 {
1973 case DNP3_TIME_ATTR_UNKNOWN: return "unknown";
1974 case DNP3_TIME_ATTR_CONFIG_BUILD_DATE: return "config_build_date";
1975 case DNP3_TIME_ATTR_CONFIG_LAST_CHANGE_DATE: return "config_last_change_date";
1976 default: return "unknown time_attr value";
1977 }
1978}
1979
1982{
1988
1993{
1994 switch (value)
1995 {
1996 case DNP3_OCTET_STRING_ATTR_UNKNOWN: return "unknown";
1997 case DNP3_OCTET_STRING_ATTR_CONFIG_DIGEST: return "config_digest";
1998 default: return "unknown octet_string_attr value";
1999 }
2000}
2001
2004{
2008
2013{
2014 switch (value)
2015 {
2016 case DNP3_BIT_STRING_ATTR_UNKNOWN: return "unknown";
2017 default: return "unknown bit_string_attr value";
2018 }
2019}
2020
2023{
2033
2038{
2039 switch (value)
2040 {
2041 case DNP3_FLOAT_ATTR_UNKNOWN: return "unknown";
2042 case DNP3_FLOAT_ATTR_DEVICE_LOCATION_ALTITUDE: return "device_location_altitude";
2043 case DNP3_FLOAT_ATTR_DEVICE_LOCATION_LONGITUDE: return "device_location_longitude";
2044 case DNP3_FLOAT_ATTR_DEVICE_LOCATION_LATITUDE: return "device_location_latitude";
2045 default: return "unknown float_attr value";
2046 }
2047}
2048
2049typedef struct dnp3_attr_prop_t dnp3_attr_prop_t;
2050
2054typedef struct dnp3_attr_prop_t
2055{
2059
2060
2061typedef struct dnp3_attr_item_t dnp3_attr_item_t;
2062
2064typedef struct dnp3_attr_item_t
2065{
2067 uint8_t variation;
2071
2072
2075
2080
2081
2083typedef enum dnp3_nothing_t
2084{
2088
2093{
2094 switch (value)
2095 {
2096 case DNP3_NOTHING_NOTHING: return "nothing";
2097 default: return "unknown nothing value";
2098 }
2099}
2100
2103
2108
2112
2117
2118
2121{
2131
2136{
2137 switch (value)
2138 {
2139 case DNP3_PORT_STATE_DISABLED: return "disabled";
2140 case DNP3_PORT_STATE_WAIT: return "wait";
2141 case DNP3_PORT_STATE_OPEN: return "open";
2142 case DNP3_PORT_STATE_SHUTDOWN: return "shutdown";
2143 default: return "unknown port_state value";
2144 }
2145}
2146
2149{
2150
2157 void (*on_destroy)(void* arg);
2159 void* ctx;
2161
2166{
2180
2185{
2186 switch (value)
2187 {
2188 case DNP3_CLIENT_STATE_DISABLED: return "disabled";
2189 case DNP3_CLIENT_STATE_CONNECTING: return "connecting";
2190 case DNP3_CLIENT_STATE_CONNECTED: return "connected";
2191 case DNP3_CLIENT_STATE_WAIT_AFTER_FAILED_CONNECT: return "wait_after_failed_connect";
2192 case DNP3_CLIENT_STATE_WAIT_AFTER_DISCONNECT: return "wait_after_disconnect";
2193 case DNP3_CLIENT_STATE_SHUTDOWN: return "shutdown";
2194 default: return "unknown client_state value";
2195 }
2196}
2197
2200{
2201
2208 void (*on_destroy)(void* arg);
2210 void* ctx;
2212
2215{
2487
2492{
2493 switch (value)
2494 {
2495 case DNP3_VARIATION_GROUP0: return "group0";
2496 case DNP3_VARIATION_GROUP0_VAR254: return "group0_var254";
2497 case DNP3_VARIATION_GROUP1_VAR0: return "group1_var0";
2498 case DNP3_VARIATION_GROUP1_VAR1: return "group1_var1";
2499 case DNP3_VARIATION_GROUP1_VAR2: return "group1_var2";
2500 case DNP3_VARIATION_GROUP2_VAR0: return "group2_var0";
2501 case DNP3_VARIATION_GROUP2_VAR1: return "group2_var1";
2502 case DNP3_VARIATION_GROUP2_VAR2: return "group2_var2";
2503 case DNP3_VARIATION_GROUP2_VAR3: return "group2_var3";
2504 case DNP3_VARIATION_GROUP3_VAR0: return "group3_var0";
2505 case DNP3_VARIATION_GROUP3_VAR1: return "group3_var1";
2506 case DNP3_VARIATION_GROUP3_VAR2: return "group3_var2";
2507 case DNP3_VARIATION_GROUP4_VAR0: return "group4_var0";
2508 case DNP3_VARIATION_GROUP4_VAR1: return "group4_var1";
2509 case DNP3_VARIATION_GROUP4_VAR2: return "group4_var2";
2510 case DNP3_VARIATION_GROUP4_VAR3: return "group4_var3";
2511 case DNP3_VARIATION_GROUP10_VAR0: return "group10_var0";
2512 case DNP3_VARIATION_GROUP10_VAR1: return "group10_var1";
2513 case DNP3_VARIATION_GROUP10_VAR2: return "group10_var2";
2514 case DNP3_VARIATION_GROUP11_VAR0: return "group11_var0";
2515 case DNP3_VARIATION_GROUP11_VAR1: return "group11_var1";
2516 case DNP3_VARIATION_GROUP11_VAR2: return "group11_var2";
2517 case DNP3_VARIATION_GROUP12_VAR1: return "group12_var1";
2518 case DNP3_VARIATION_GROUP13_VAR1: return "group13_var1";
2519 case DNP3_VARIATION_GROUP13_VAR2: return "group13_var2";
2520 case DNP3_VARIATION_GROUP20_VAR0: return "group20_var0";
2521 case DNP3_VARIATION_GROUP20_VAR1: return "group20_var1";
2522 case DNP3_VARIATION_GROUP20_VAR2: return "group20_var2";
2523 case DNP3_VARIATION_GROUP20_VAR5: return "group20_var5";
2524 case DNP3_VARIATION_GROUP20_VAR6: return "group20_var6";
2525 case DNP3_VARIATION_GROUP21_VAR0: return "group21_var0";
2526 case DNP3_VARIATION_GROUP21_VAR1: return "group21_var1";
2527 case DNP3_VARIATION_GROUP21_VAR2: return "group21_var2";
2528 case DNP3_VARIATION_GROUP21_VAR5: return "group21_var5";
2529 case DNP3_VARIATION_GROUP21_VAR6: return "group21_var6";
2530 case DNP3_VARIATION_GROUP21_VAR9: return "group21_var9";
2531 case DNP3_VARIATION_GROUP21_VAR10: return "group21_var10";
2532 case DNP3_VARIATION_GROUP22_VAR0: return "group22_var0";
2533 case DNP3_VARIATION_GROUP22_VAR1: return "group22_var1";
2534 case DNP3_VARIATION_GROUP22_VAR2: return "group22_var2";
2535 case DNP3_VARIATION_GROUP22_VAR5: return "group22_var5";
2536 case DNP3_VARIATION_GROUP22_VAR6: return "group22_var6";
2537 case DNP3_VARIATION_GROUP23_VAR0: return "group23_var0";
2538 case DNP3_VARIATION_GROUP23_VAR1: return "group23_var1";
2539 case DNP3_VARIATION_GROUP23_VAR2: return "group23_var2";
2540 case DNP3_VARIATION_GROUP23_VAR5: return "group23_var5";
2541 case DNP3_VARIATION_GROUP23_VAR6: return "group23_var6";
2542 case DNP3_VARIATION_GROUP30_VAR0: return "group30_var0";
2543 case DNP3_VARIATION_GROUP30_VAR1: return "group30_var1";
2544 case DNP3_VARIATION_GROUP30_VAR2: return "group30_var2";
2545 case DNP3_VARIATION_GROUP30_VAR3: return "group30_var3";
2546 case DNP3_VARIATION_GROUP30_VAR4: return "group30_var4";
2547 case DNP3_VARIATION_GROUP30_VAR5: return "group30_var5";
2548 case DNP3_VARIATION_GROUP30_VAR6: return "group30_var6";
2549 case DNP3_VARIATION_GROUP31_VAR0: return "group31_var0";
2550 case DNP3_VARIATION_GROUP31_VAR1: return "group31_var1";
2551 case DNP3_VARIATION_GROUP31_VAR2: return "group31_var2";
2552 case DNP3_VARIATION_GROUP31_VAR3: return "group31_var3";
2553 case DNP3_VARIATION_GROUP31_VAR4: return "group31_var4";
2554 case DNP3_VARIATION_GROUP31_VAR5: return "group31_var5";
2555 case DNP3_VARIATION_GROUP31_VAR6: return "group31_var6";
2556 case DNP3_VARIATION_GROUP31_VAR7: return "group31_var7";
2557 case DNP3_VARIATION_GROUP31_VAR8: return "group31_var8";
2558 case DNP3_VARIATION_GROUP32_VAR0: return "group32_var0";
2559 case DNP3_VARIATION_GROUP32_VAR1: return "group32_var1";
2560 case DNP3_VARIATION_GROUP32_VAR2: return "group32_var2";
2561 case DNP3_VARIATION_GROUP32_VAR3: return "group32_var3";
2562 case DNP3_VARIATION_GROUP32_VAR4: return "group32_var4";
2563 case DNP3_VARIATION_GROUP32_VAR5: return "group32_var5";
2564 case DNP3_VARIATION_GROUP32_VAR6: return "group32_var6";
2565 case DNP3_VARIATION_GROUP32_VAR7: return "group32_var7";
2566 case DNP3_VARIATION_GROUP32_VAR8: return "group32_var8";
2567 case DNP3_VARIATION_GROUP33_VAR0: return "group33_var0";
2568 case DNP3_VARIATION_GROUP33_VAR1: return "group33_var1";
2569 case DNP3_VARIATION_GROUP33_VAR2: return "group33_var2";
2570 case DNP3_VARIATION_GROUP33_VAR3: return "group33_var3";
2571 case DNP3_VARIATION_GROUP33_VAR4: return "group33_var4";
2572 case DNP3_VARIATION_GROUP33_VAR5: return "group33_var5";
2573 case DNP3_VARIATION_GROUP33_VAR6: return "group33_var6";
2574 case DNP3_VARIATION_GROUP33_VAR7: return "group33_var7";
2575 case DNP3_VARIATION_GROUP33_VAR8: return "group33_var8";
2576 case DNP3_VARIATION_GROUP34_VAR0: return "group34_var0";
2577 case DNP3_VARIATION_GROUP34_VAR1: return "group34_var1";
2578 case DNP3_VARIATION_GROUP34_VAR2: return "group34_var2";
2579 case DNP3_VARIATION_GROUP34_VAR3: return "group34_var3";
2580 case DNP3_VARIATION_GROUP40_VAR0: return "group40_var0";
2581 case DNP3_VARIATION_GROUP40_VAR1: return "group40_var1";
2582 case DNP3_VARIATION_GROUP40_VAR2: return "group40_var2";
2583 case DNP3_VARIATION_GROUP40_VAR3: return "group40_var3";
2584 case DNP3_VARIATION_GROUP40_VAR4: return "group40_var4";
2585 case DNP3_VARIATION_GROUP41_VAR1: return "group41_var1";
2586 case DNP3_VARIATION_GROUP41_VAR2: return "group41_var2";
2587 case DNP3_VARIATION_GROUP41_VAR3: return "group41_var3";
2588 case DNP3_VARIATION_GROUP41_VAR4: return "group41_var4";
2589 case DNP3_VARIATION_GROUP42_VAR0: return "group42_var0";
2590 case DNP3_VARIATION_GROUP42_VAR1: return "group42_var1";
2591 case DNP3_VARIATION_GROUP42_VAR2: return "group42_var2";
2592 case DNP3_VARIATION_GROUP42_VAR3: return "group42_var3";
2593 case DNP3_VARIATION_GROUP42_VAR4: return "group42_var4";
2594 case DNP3_VARIATION_GROUP42_VAR5: return "group42_var5";
2595 case DNP3_VARIATION_GROUP42_VAR6: return "group42_var6";
2596 case DNP3_VARIATION_GROUP42_VAR7: return "group42_var7";
2597 case DNP3_VARIATION_GROUP42_VAR8: return "group42_var8";
2598 case DNP3_VARIATION_GROUP43_VAR1: return "group43_var1";
2599 case DNP3_VARIATION_GROUP43_VAR2: return "group43_var2";
2600 case DNP3_VARIATION_GROUP43_VAR3: return "group43_var3";
2601 case DNP3_VARIATION_GROUP43_VAR4: return "group43_var4";
2602 case DNP3_VARIATION_GROUP43_VAR5: return "group43_var5";
2603 case DNP3_VARIATION_GROUP43_VAR6: return "group43_var6";
2604 case DNP3_VARIATION_GROUP43_VAR7: return "group43_var7";
2605 case DNP3_VARIATION_GROUP43_VAR8: return "group43_var8";
2606 case DNP3_VARIATION_GROUP50_VAR1: return "group50_var1";
2607 case DNP3_VARIATION_GROUP50_VAR2: return "group50_var2";
2608 case DNP3_VARIATION_GROUP50_VAR3: return "group50_var3";
2609 case DNP3_VARIATION_GROUP50_VAR4: return "group50_var4";
2610 case DNP3_VARIATION_GROUP51_VAR1: return "group51_var1";
2611 case DNP3_VARIATION_GROUP51_VAR2: return "group51_var2";
2612 case DNP3_VARIATION_GROUP52_VAR1: return "group52_var1";
2613 case DNP3_VARIATION_GROUP52_VAR2: return "group52_var2";
2614 case DNP3_VARIATION_GROUP60_VAR1: return "group60_var1";
2615 case DNP3_VARIATION_GROUP60_VAR2: return "group60_var2";
2616 case DNP3_VARIATION_GROUP60_VAR3: return "group60_var3";
2617 case DNP3_VARIATION_GROUP60_VAR4: return "group60_var4";
2618 case DNP3_VARIATION_GROUP70_VAR2: return "group70_var2";
2619 case DNP3_VARIATION_GROUP70_VAR3: return "group70_var3";
2620 case DNP3_VARIATION_GROUP70_VAR4: return "group70_var4";
2621 case DNP3_VARIATION_GROUP70_VAR5: return "group70_var5";
2622 case DNP3_VARIATION_GROUP70_VAR6: return "group70_var6";
2623 case DNP3_VARIATION_GROUP70_VAR7: return "group70_var7";
2624 case DNP3_VARIATION_GROUP70_VAR8: return "group70_var8";
2625 case DNP3_VARIATION_GROUP80_VAR1: return "group80_var1";
2626 case DNP3_VARIATION_GROUP102_VAR0: return "group102_var0";
2627 case DNP3_VARIATION_GROUP102_VAR1: return "group102_var1";
2628 case DNP3_VARIATION_GROUP110: return "group110";
2629 case DNP3_VARIATION_GROUP111: return "group111";
2630 default: return "unknown variation value";
2631 }
2632}
2633
2635
2638{
2646
2652static dnp3_event_classes_t dnp3_event_classes_init(bool class1, bool class2, bool class3)
2653{
2654 dnp3_event_classes_t _return_value = {
2655 class1,
2656 class2,
2657 class3
2658 };
2659 return _return_value;
2660}
2661
2671{
2672 dnp3_event_classes_t _return_value = {
2673 true,
2674 true,
2675 true
2676 };
2677 return _return_value;
2678}
2679
2689{
2690 dnp3_event_classes_t _return_value = {
2691 false,
2692 false,
2693 false
2694 };
2695 return _return_value;
2696}
2697
2698
2701{
2711
2716{
2717 switch (value)
2718 {
2719 case DNP3_EVENT_CLASS_NONE: return "none";
2720 case DNP3_EVENT_CLASS_CLASS1: return "class1";
2721 case DNP3_EVENT_CLASS_CLASS2: return "class2";
2722 case DNP3_EVENT_CLASS_CLASS3: return "class3";
2723 default: return "unknown event_class value";
2724 }
2725}
2726
2728
2731{
2733 uint32_t num_class_1;
2735 uint32_t num_class_2;
2737 uint32_t num_class_3;
2739
2740
2742
2749{
2752 uint64_t min_delay;
2755 uint64_t max_delay;
2757
2766{
2767 dnp3_retry_strategy_t _return_value = {
2768 1000,
2769 10000
2770 };
2771 return _return_value;
2772}
2773
2774
2777{
2787
2792{
2793 switch (value)
2794 {
2795 case DNP3_DATA_BITS_FIVE: return "five";
2796 case DNP3_DATA_BITS_SIX: return "six";
2797 case DNP3_DATA_BITS_SEVEN: return "seven";
2798 case DNP3_DATA_BITS_EIGHT: return "eight";
2799 default: return "unknown data_bits value";
2800 }
2801}
2802
2805{
2813
2818{
2819 switch (value)
2820 {
2821 case DNP3_FLOW_CONTROL_NONE: return "none";
2822 case DNP3_FLOW_CONTROL_SOFTWARE: return "software";
2823 case DNP3_FLOW_CONTROL_HARDWARE: return "hardware";
2824 default: return "unknown flow_control value";
2825 }
2826}
2827
2829typedef enum dnp3_parity_t
2830{
2838
2842static const char* dnp3_parity_to_string(dnp3_parity_t value)
2843{
2844 switch (value)
2845 {
2846 case DNP3_PARITY_NONE: return "none";
2847 case DNP3_PARITY_ODD: return "odd";
2848 case DNP3_PARITY_EVEN: return "even";
2849 default: return "unknown parity value";
2850 }
2851}
2852
2855{
2861
2866{
2867 switch (value)
2868 {
2869 case DNP3_STOP_BITS_ONE: return "one";
2870 case DNP3_STOP_BITS_TWO: return "two";
2871 default: return "unknown stop_bits value";
2872 }
2873}
2874
2876
2879{
2881 uint32_t baud_rate;
2891
2903{
2904 dnp3_serial_settings_t _return_value = {
2905 9600,
2910 };
2911 return _return_value;
2912}
2913
2914
2917{
2923
2928{
2929 switch (value)
2930 {
2931 case DNP3_LINK_ERROR_MODE_DISCARD: return "discard";
2932 case DNP3_LINK_ERROR_MODE_CLOSE: return "close";
2933 default: return "unknown link_error_mode value";
2934 }
2935}
2936
2939{
3007
3012{
3013 switch (value)
3014 {
3015 case DNP3_FUNCTION_CODE_CONFIRM: return "confirm";
3016 case DNP3_FUNCTION_CODE_READ: return "read";
3017 case DNP3_FUNCTION_CODE_WRITE: return "write";
3018 case DNP3_FUNCTION_CODE_SELECT: return "select";
3019 case DNP3_FUNCTION_CODE_OPERATE: return "operate";
3020 case DNP3_FUNCTION_CODE_DIRECT_OPERATE: return "direct_operate";
3021 case DNP3_FUNCTION_CODE_DIRECT_OPERATE_NO_RESPONSE: return "direct_operate_no_response";
3022 case DNP3_FUNCTION_CODE_IMMEDIATE_FREEZE: return "immediate_freeze";
3023 case DNP3_FUNCTION_CODE_IMMEDIATE_FREEZE_NO_RESPONSE: return "immediate_freeze_no_response";
3024 case DNP3_FUNCTION_CODE_FREEZE_CLEAR: return "freeze_clear";
3025 case DNP3_FUNCTION_CODE_FREEZE_CLEAR_NO_RESPONSE: return "freeze_clear_no_response";
3026 case DNP3_FUNCTION_CODE_FREEZE_AT_TIME: return "freeze_at_time";
3027 case DNP3_FUNCTION_CODE_FREEZE_AT_TIME_NO_RESPONSE: return "freeze_at_time_no_response";
3028 case DNP3_FUNCTION_CODE_COLD_RESTART: return "cold_restart";
3029 case DNP3_FUNCTION_CODE_WARM_RESTART: return "warm_restart";
3030 case DNP3_FUNCTION_CODE_INITIALIZE_DATA: return "initialize_data";
3031 case DNP3_FUNCTION_CODE_INITIALIZE_APPLICATION: return "initialize_application";
3032 case DNP3_FUNCTION_CODE_START_APPLICATION: return "start_application";
3033 case DNP3_FUNCTION_CODE_STOP_APPLICATION: return "stop_application";
3034 case DNP3_FUNCTION_CODE_SAVE_CONFIGURATION: return "save_configuration";
3035 case DNP3_FUNCTION_CODE_ENABLE_UNSOLICITED: return "enable_unsolicited";
3036 case DNP3_FUNCTION_CODE_DISABLE_UNSOLICITED: return "disable_unsolicited";
3037 case DNP3_FUNCTION_CODE_ASSIGN_CLASS: return "assign_class";
3038 case DNP3_FUNCTION_CODE_DELAY_MEASURE: return "delay_measure";
3039 case DNP3_FUNCTION_CODE_RECORD_CURRENT_TIME: return "record_current_time";
3040 case DNP3_FUNCTION_CODE_OPEN_FILE: return "open_file";
3041 case DNP3_FUNCTION_CODE_CLOSE_FILE: return "close_file";
3042 case DNP3_FUNCTION_CODE_DELETE_FILE: return "delete_file";
3043 case DNP3_FUNCTION_CODE_GET_FILE_INFO: return "get_file_info";
3044 case DNP3_FUNCTION_CODE_AUTHENTICATE_FILE: return "authenticate_file";
3045 case DNP3_FUNCTION_CODE_ABORT_FILE: return "abort_file";
3046 case DNP3_FUNCTION_CODE_RESPONSE: return "response";
3047 case DNP3_FUNCTION_CODE_UNSOLICITED_RESPONSE: return "unsolicited_response";
3048 default: return "unknown function_code value";
3049 }
3050}
3051
3054{
3062
3067{
3068 switch (value)
3069 {
3070 case DNP3_FILE_TYPE_DIRECTORY: return "directory";
3071 case DNP3_FILE_TYPE_SIMPLE: return "simple";
3072 case DNP3_FILE_TYPE_OTHER: return "other";
3073 default: return "unknown file_type value";
3074 }
3075}
3076
3078
3081{
3085 bool write;
3087 bool read;
3089
3095static dnp3_permission_set_t dnp3_permission_set_init(bool execute, bool write, bool read)
3096{
3097 dnp3_permission_set_t _return_value = {
3098 execute,
3099 write,
3100 read
3101 };
3102 return _return_value;
3103}
3104
3114{
3115 dnp3_permission_set_t _return_value = {
3116 false,
3117 false,
3118 false
3119 };
3120 return _return_value;
3121}
3122
3123
3125
3128{
3136
3143{
3144 dnp3_permissions_t _return_value = {
3145 world,
3146 group,
3147 owner
3148 };
3149 return _return_value;
3150}
3151
3161{
3162 dnp3_permissions_t _return_value = {
3166 };
3167 return _return_value;
3168}
3169
3170
3171typedef struct dnp3_open_file_t dnp3_open_file_t;
3172
3174typedef struct dnp3_open_file_t
3175{
3179 uint32_t file_handle;
3181 uint32_t file_size;
3187
3188
3191{
3229
3234{
3235 switch (value)
3236 {
3237 case DNP3_FILE_ERROR_OK: return "ok";
3238 case DNP3_FILE_ERROR_BAD_STATUS: return "bad_status";
3239 case DNP3_FILE_ERROR_NO_PERMISSION: return "no_permission";
3240 case DNP3_FILE_ERROR_BAD_BLOCK_NUM: return "bad_block_num";
3241 case DNP3_FILE_ERROR_ABORT_BY_USER: return "abort_by_user";
3242 case DNP3_FILE_ERROR_MAX_LENGTH_EXCEEDED: return "max_length_exceeded";
3243 case DNP3_FILE_ERROR_WRONG_HANDLE: return "wrong_handle";
3244 case DNP3_FILE_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
3245 case DNP3_FILE_ERROR_IIN_ERROR: return "iin_error";
3246 case DNP3_FILE_ERROR_BAD_RESPONSE: return "bad_response";
3247 case DNP3_FILE_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
3248 case DNP3_FILE_ERROR_WRITE_ERROR: return "write_error";
3249 case DNP3_FILE_ERROR_NO_CONNECTION: return "no_connection";
3250 case DNP3_FILE_ERROR_SHUTDOWN: return "shutdown";
3251 case DNP3_FILE_ERROR_ASSOCIATION_REMOVED: return "association_removed";
3252 case DNP3_FILE_ERROR_BAD_ENCODING: return "bad_encoding";
3253 case DNP3_FILE_ERROR_UNSUPPORTED_RESPONSE: return "unsupported_response";
3254 case DNP3_FILE_ERROR_UNSUPPORTED_OR_BAD_RESPONSE: return "unsupported_or_bad_response";
3255 default: return "unknown file_error value";
3256 }
3257}
3258
3259
3260typedef struct dnp3_file_info_t dnp3_file_info_t;
3261
3265typedef struct dnp3_file_info_t
3266{
3268 const char* file_name;
3274 uint32_t size;
3282
3283
3286{
3287
3292
3299 void (*on_destroy)(void* arg);
3301 void* ctx;
3303
3306{
3307
3312
3319 void (*on_destroy)(void* arg);
3321 void* ctx;
3323
3326{
3327
3331 void (*on_complete)(uint32_t, void*);
3332
3339 void (*on_destroy)(void* arg);
3341 void* ctx;
3343
3346{
3354
3359{
3360 switch (value)
3361 {
3362 case DNP3_FILE_MODE_READ: return "read";
3363 case DNP3_FILE_MODE_WRITE: return "write";
3364 case DNP3_FILE_MODE_APPEND: return "append";
3365 default: return "unknown file_mode value";
3366 }
3367}
3368
3371{
3379
3384{
3385 switch (value)
3386 {
3387 case DNP3_UDP_SOCKET_MODE_ONE_TO_ONE: return "one_to_one";
3388 case DNP3_UDP_SOCKET_MODE_ONE_TO_MANY: return "one_to_many";
3389 default: return "unknown udp_socket_mode value";
3390 }
3391}
3392
3397{
3403
3408{
3409 switch (value)
3410 {
3411 case DNP3_LINK_READ_MODE_STREAM: return "stream";
3412 case DNP3_LINK_READ_MODE_DATAGRAM: return "datagram";
3413 default: return "unknown link_read_mode value";
3414 }
3415}
3416
3421{
3433
3438{
3439 switch (value)
3440 {
3441 case DNP3_LOG_LEVEL_ERROR: return "error";
3442 case DNP3_LOG_LEVEL_WARN: return "warn";
3443 case DNP3_LOG_LEVEL_INFO: return "info";
3444 case DNP3_LOG_LEVEL_DEBUG: return "debug";
3445 case DNP3_LOG_LEVEL_TRACE: return "trace";
3446 default: return "unknown log_level value";
3447 }
3448}
3449
3451
3454{
3460
3465{
3466 switch (value)
3467 {
3468 case DNP3_LOG_OUTPUT_FORMAT_TEXT: return "text";
3469 case DNP3_LOG_OUTPUT_FORMAT_JSON: return "json";
3470 default: return "unknown log_output_format value";
3471 }
3472}
3473
3476{
3484
3489{
3490 switch (value)
3491 {
3492 case DNP3_TIME_FORMAT_NONE: return "none";
3493 case DNP3_TIME_FORMAT_RFC_3339: return "rfc_3339";
3494 case DNP3_TIME_FORMAT_SYSTEM: return "system";
3495 default: return "unknown time_format value";
3496 }
3497}
3498
3501{
3513
3525{
3526 dnp3_logging_config_t _return_value = {
3530 true,
3531 false
3532 };
3533 return _return_value;
3534}
3535
3536
3538typedef struct dnp3_logger_t
3539{
3540
3545 void (*on_message)(dnp3_log_level_t, const char*, void*);
3548 void (*on_destroy)(void* arg);
3550 void* ctx;
3552
3562
3563
3566{
3572
3577{
3578 switch (value)
3579 {
3580 case DNP3_RESPONSE_FUNCTION_RESPONSE: return "response";
3581 case DNP3_RESPONSE_FUNCTION_UNSOLICITED_RESPONSE: return "unsolicited_response";
3582 default: return "unknown response_function value";
3583 }
3584}
3585
3586typedef struct dnp3_iin1_t dnp3_iin1_t;
3587
3589typedef struct dnp3_iin1_t
3590{
3607} dnp3_iin1_t;
3608
3609
3610typedef struct dnp3_iin2_t dnp3_iin2_t;
3611
3613typedef struct dnp3_iin2_t
3614{
3631} dnp3_iin2_t;
3632
3633
3634typedef struct dnp3_iin_t dnp3_iin_t;
3635
3637typedef struct dnp3_iin_t
3638{
3643} dnp3_iin_t;
3644
3645
3647
3650{
3658
3659
3662{
3680
3685{
3686 switch (value)
3687 {
3688 case DNP3_QUALIFIER_CODE_RANGE8: return "range8";
3689 case DNP3_QUALIFIER_CODE_RANGE16: return "range16";
3690 case DNP3_QUALIFIER_CODE_ALL_OBJECTS: return "all_objects";
3691 case DNP3_QUALIFIER_CODE_COUNT8: return "count8";
3692 case DNP3_QUALIFIER_CODE_COUNT16: return "count16";
3693 case DNP3_QUALIFIER_CODE_COUNT_AND_PREFIX_8: return "count_and_prefix_8";
3694 case DNP3_QUALIFIER_CODE_COUNT_AND_PREFIX_16: return "count_and_prefix_16";
3695 case DNP3_QUALIFIER_CODE_FREE_FORMAT_16: return "free_format_16";
3696 default: return "unknown qualifier_code value";
3697 }
3698}
3699
3701
3704{
3714
3721static dnp3_header_info_t dnp3_header_info_init(dnp3_variation_t variation, dnp3_qualifier_code_t qualifier, bool is_event, bool has_flags)
3722{
3723 dnp3_header_info_t _return_value = {
3724 variation,
3725 qualifier,
3726 is_event,
3727 has_flags
3728 };
3729 return _return_value;
3730}
3731
3732
3735{
3745
3750{
3751 switch (value)
3752 {
3753 case DNP3_READ_TYPE_STARTUP_INTEGRITY: return "startup_integrity";
3754 case DNP3_READ_TYPE_UNSOLICITED: return "unsolicited";
3755 case DNP3_READ_TYPE_SINGLE_POLL: return "single_poll";
3756 case DNP3_READ_TYPE_PERIODIC_POLL: return "periodic_poll";
3757 default: return "unknown read_type value";
3758 }
3759}
3760
3765{
3766
3772
3778
3784
3790
3796
3802
3808
3814
3820
3826
3832
3838
3844
3850
3856
3862
3870 void (*handle_string_attr)(dnp3_header_info_t, dnp3_string_attr_t, uint8_t, uint8_t, const char*, void*);
3871
3880
3888 void (*handle_uint_attr)(dnp3_header_info_t, dnp3_uint_attr_t, uint8_t, uint8_t, uint32_t, void*);
3889
3899 void (*handle_bool_attr)(dnp3_header_info_t, dnp3_bool_attr_t, uint8_t, uint8_t, bool, void*);
3900
3910 void (*handle_int_attr)(dnp3_header_info_t, dnp3_int_attr_t, uint8_t, uint8_t, int32_t, void*);
3911
3919 void (*handle_time_attr)(dnp3_header_info_t, dnp3_time_attr_t, uint8_t, uint8_t, uint64_t, void*);
3920
3928 void (*handle_float_attr)(dnp3_header_info_t, dnp3_float_attr_t, uint8_t, uint8_t, double, void*);
3929
3938
3949 void (*on_destroy)(void* arg);
3951 void* ctx;
3953
3955
3958{
3960 uint16_t address;
3972
3983{
3984 dnp3_master_channel_config_t _return_value = {
3985 address,
3987 2048,
3988 2048
3989 };
3990 return _return_value;
3991}
3992
3993
4000
4003
4007
4011
4018void dnp3_write_dead_band_request_add_g34v1_u8(dnp3_write_dead_band_request_t* instance, uint8_t index, uint16_t dead_band);
4019
4026void dnp3_write_dead_band_request_add_g34v2_u8(dnp3_write_dead_band_request_t* instance, uint8_t index, uint32_t dead_band);
4027
4035
4042void dnp3_write_dead_band_request_add_g34v1_u16(dnp3_write_dead_band_request_t* instance, uint16_t index, uint16_t dead_band);
4043
4050void dnp3_write_dead_band_request_add_g34v2_u16(dnp3_write_dead_band_request_t* instance, uint16_t index, uint32_t dead_band);
4051
4059
4065
4066
4069{
4097
4102{
4103 switch (value)
4104 {
4105 case DNP3_EMPTY_RESPONSE_ERROR_OK: return "ok";
4106 case DNP3_EMPTY_RESPONSE_ERROR_REJECTED_BY_IIN2: return "rejected_by_iin2";
4107 case DNP3_EMPTY_RESPONSE_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
4108 case DNP3_EMPTY_RESPONSE_ERROR_IIN_ERROR: return "iin_error";
4109 case DNP3_EMPTY_RESPONSE_ERROR_BAD_RESPONSE: return "bad_response";
4110 case DNP3_EMPTY_RESPONSE_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
4111 case DNP3_EMPTY_RESPONSE_ERROR_WRITE_ERROR: return "write_error";
4112 case DNP3_EMPTY_RESPONSE_ERROR_NO_CONNECTION: return "no_connection";
4113 case DNP3_EMPTY_RESPONSE_ERROR_SHUTDOWN: return "shutdown";
4114 case DNP3_EMPTY_RESPONSE_ERROR_ASSOCIATION_REMOVED: return "association_removed";
4115 case DNP3_EMPTY_RESPONSE_ERROR_BAD_ENCODING: return "bad_encoding";
4116 case DNP3_EMPTY_RESPONSE_ERROR_UNSUPPORTED_RESPONSE: return "unsupported_response";
4117 case DNP3_EMPTY_RESPONSE_ERROR_UNSUPPORTED_OR_BAD_RESPONSE: return "unsupported_or_bad_response";
4118 default: return "unknown empty_response_error value";
4119 }
4120}
4121
4122
4125{
4126
4131
4138 void (*on_destroy)(void* arg);
4140 void* ctx;
4142
4153
4167
4180
4191dnp3_param_error_t dnp3_master_channel_create_udp(dnp3_runtime_t* runtime, dnp3_master_channel_config_t config, const char* local_endpoint, dnp3_link_read_mode_t link_read_mode, uint64_t retry_delay, dnp3_master_channel_t** out);
4192
4196
4208
4223
4228
4233
4235
4240{
4242 uint16_t address;
4244
4245typedef struct dnp3_poll_id_t dnp3_poll_id_t;
4246
4250typedef struct dnp3_poll_id_t
4251{
4255 uint64_t id;
4257
4258typedef struct dnp3_classes_t dnp3_classes_t;
4259
4261typedef struct dnp3_classes_t
4262{
4272
4279static dnp3_classes_t dnp3_classes_init(bool class0, bool class1, bool class2, bool class3)
4280{
4281 dnp3_classes_t _return_value = {
4282 class0,
4283 class1,
4284 class2,
4285 class3
4286 };
4287 return _return_value;
4288}
4289
4300{
4301 dnp3_classes_t _return_value = {
4302 true,
4303 true,
4304 true,
4305 true
4306 };
4307 return _return_value;
4308}
4309
4320{
4321 dnp3_classes_t _return_value = {
4322 false,
4323 false,
4324 false,
4325 false
4326 };
4327 return _return_value;
4328}
4329
4330
4333{
4343
4348{
4349 switch (value)
4350 {
4351 case DNP3_AUTO_TIME_SYNC_NONE: return "none";
4352 case DNP3_AUTO_TIME_SYNC_LAN: return "lan";
4353 case DNP3_AUTO_TIME_SYNC_NON_LAN: return "non_lan";
4354 case DNP3_AUTO_TIME_SYNC_DIRECT_WRITE_ABS_TIME: return "direct_write_abs_time";
4355 default: return "unknown auto_time_sync value";
4356 }
4357}
4358
4360
4363{
4391
4407static 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)
4408{
4409 dnp3_association_config_t _return_value = {
4410 5000,
4411 disable_unsol_classes,
4412 enable_unsol_classes,
4413 startup_integrity_classes,
4416 60,
4417 true,
4418 event_scan_on_events_available,
4419 16
4420 };
4421 return _return_value;
4422}
4423
4424
4426
4431{
4435 uint64_t value;
4439
4448{
4449 dnp3_utc_timestamp_t _return_value = {
4450 value,
4451 true
4452 };
4453 return _return_value;
4454}
4455
4464{
4465 dnp3_utc_timestamp_t _return_value = {
4466 0,
4467 false
4468 };
4469 return _return_value;
4470}
4471
4472
4475{
4476
4487 void (*on_destroy)(void* arg);
4489 void* ctx;
4491
4494{
4536
4541{
4542 switch (value)
4543 {
4544 case DNP3_TASK_TYPE_USER_READ: return "user_read";
4545 case DNP3_TASK_TYPE_PERIODIC_POLL: return "periodic_poll";
4546 case DNP3_TASK_TYPE_STARTUP_INTEGRITY: return "startup_integrity";
4547 case DNP3_TASK_TYPE_AUTO_EVENT_SCAN: return "auto_event_scan";
4548 case DNP3_TASK_TYPE_COMMAND: return "command";
4549 case DNP3_TASK_TYPE_CLEAR_RESTART_BIT: return "clear_restart_bit";
4550 case DNP3_TASK_TYPE_ENABLE_UNSOLICITED: return "enable_unsolicited";
4551 case DNP3_TASK_TYPE_DISABLE_UNSOLICITED: return "disable_unsolicited";
4552 case DNP3_TASK_TYPE_TIME_SYNC: return "time_sync";
4553 case DNP3_TASK_TYPE_RESTART: return "restart";
4554 case DNP3_TASK_TYPE_WRITE_DEAD_BANDS: return "write_dead_bands";
4555 case DNP3_TASK_TYPE_GENERIC_EMPTY_RESPONSE: return "generic_empty_response";
4556 case DNP3_TASK_TYPE_FILE_READ: return "file_read";
4557 case DNP3_TASK_TYPE_GET_FILE_INFO: return "get_file_info";
4558 case DNP3_TASK_TYPE_FILE_AUTH: return "file_auth";
4559 case DNP3_TASK_TYPE_FILE_OPEN: return "file_open";
4560 case DNP3_TASK_TYPE_FILE_WRITE_BLOCK: return "file_write_block";
4561 case DNP3_TASK_TYPE_FILE_CLOSE: return "file_close";
4562 default: return "unknown task_type value";
4563 }
4564}
4565
4568{
4594
4599{
4600 switch (value)
4601 {
4602 case DNP3_TASK_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
4603 case DNP3_TASK_ERROR_IIN_ERROR: return "iin_error";
4604 case DNP3_TASK_ERROR_BAD_RESPONSE: return "bad_response";
4605 case DNP3_TASK_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
4606 case DNP3_TASK_ERROR_WRITE_ERROR: return "write_error";
4607 case DNP3_TASK_ERROR_NO_CONNECTION: return "no_connection";
4608 case DNP3_TASK_ERROR_SHUTDOWN: return "shutdown";
4609 case DNP3_TASK_ERROR_ASSOCIATION_REMOVED: return "association_removed";
4610 case DNP3_TASK_ERROR_BAD_ENCODING: return "bad_encoding";
4611 case DNP3_TASK_ERROR_UNSUPPORTED_RESPONSE: return "unsupported_response";
4612 case DNP3_TASK_ERROR_UNSUPPORTED_OR_BAD_RESPONSE: return "unsupported_or_bad_response";
4613 case DNP3_TASK_ERROR_SYSTEM_TIME_NOT_AVAILABLE: return "system_time_not_available";
4614 default: return "unknown task_error value";
4615 }
4616}
4617
4620{
4621
4628
4637
4643
4648 void (*unsolicited_response)(bool, uint8_t, void*);
4651 void (*on_destroy)(void* arg);
4653 void* ctx;
4655
4660
4664
4673dnp3_request_t* dnp3_request_new_class(bool class0, bool class1, bool class2, bool class3);
4674
4681
4689dnp3_request_t* dnp3_request_new_one_byte_range(dnp3_variation_t variation, uint8_t start, uint8_t stop);
4690
4698dnp3_request_t* dnp3_request_new_two_byte_range(dnp3_variation_t variation, uint16_t start, uint16_t stop);
4699
4707
4715
4719
4724void dnp3_request_add_specific_attribute(dnp3_request_t* instance, uint8_t variation, uint8_t set);
4725
4731void dnp3_request_add_string_attribute(dnp3_request_t* instance, uint8_t variation, uint8_t set, const char* value);
4732
4738void dnp3_request_add_uint_attribute(dnp3_request_t* instance, uint8_t variation, uint8_t set, uint32_t value);
4739
4745void dnp3_request_add_one_byte_range_header(dnp3_request_t* instance, dnp3_variation_t variation, uint8_t start, uint8_t stop);
4746
4752void dnp3_request_add_two_byte_range_header(dnp3_request_t* instance, dnp3_variation_t variation, uint16_t start, uint16_t stop);
4753
4758
4764
4770
4777void dnp3_request_add_time_and_interval(dnp3_request_t* instance, uint64_t time, uint32_t interval_ms);
4778
4779
4790
4801dnp3_param_error_t dnp3_master_channel_add_udp_association(dnp3_master_channel_t* instance, uint16_t address, const char* destination, 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);
4802
4808
4819
4827
4839
4845
4851
4854{
4880
4885{
4886 switch (value)
4887 {
4888 case DNP3_READ_ERROR_OK: return "ok";
4889 case DNP3_READ_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
4890 case DNP3_READ_ERROR_IIN_ERROR: return "iin_error";
4891 case DNP3_READ_ERROR_BAD_RESPONSE: return "bad_response";
4892 case DNP3_READ_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
4893 case DNP3_READ_ERROR_WRITE_ERROR: return "write_error";
4894 case DNP3_READ_ERROR_NO_CONNECTION: return "no_connection";
4895 case DNP3_READ_ERROR_SHUTDOWN: return "shutdown";
4896 case DNP3_READ_ERROR_ASSOCIATION_REMOVED: return "association_removed";
4897 case DNP3_READ_ERROR_BAD_ENCODING: return "bad_encoding";
4898 case DNP3_READ_ERROR_UNSUPPORTED_RESPONSE: return "unsupported_response";
4899 case DNP3_READ_ERROR_UNSUPPORTED_OR_BAD_RESPONSE: return "unsupported_or_bad_response";
4900 default: return "unknown read_error value";
4901 }
4902}
4903
4904
4907{
4908
4913
4920 void (*on_destroy)(void* arg);
4922 void* ctx;
4924
4934
4942
4955
4966
4969
4973
4977
4981
4987
4993
4998void dnp3_command_set_add_g41_v1_u8(dnp3_command_set_t* instance, uint8_t idx, int32_t value);
4999
5004void dnp3_command_set_add_g41_v1_u16(dnp3_command_set_t* instance, uint16_t idx, int32_t value);
5005
5010void dnp3_command_set_add_g41_v2_u8(dnp3_command_set_t* instance, uint8_t idx, int16_t value);
5011
5016void dnp3_command_set_add_g41_v2_u16(dnp3_command_set_t* instance, uint16_t idx, int16_t value);
5017
5022void dnp3_command_set_add_g41_v3_u8(dnp3_command_set_t* instance, uint8_t idx, float value);
5023
5028void dnp3_command_set_add_g41_v3_u16(dnp3_command_set_t* instance, uint16_t idx, float value);
5029
5034void dnp3_command_set_add_g41_v4_u8(dnp3_command_set_t* instance, uint8_t idx, double value);
5035
5040void dnp3_command_set_add_g41_v4_u16(dnp3_command_set_t* instance, uint16_t idx, double value);
5041
5042
5045{
5051
5056{
5057 switch (value)
5058 {
5059 case DNP3_COMMAND_MODE_DIRECT_OPERATE: return "direct_operate";
5060 case DNP3_COMMAND_MODE_SELECT_BEFORE_OPERATE: return "select_before_operate";
5061 default: return "unknown command_mode value";
5062 }
5063}
5064
5067{
5097
5102{
5103 switch (value)
5104 {
5105 case DNP3_COMMAND_ERROR_OK: return "ok";
5106 case DNP3_COMMAND_ERROR_BAD_STATUS: return "bad_status";
5107 case DNP3_COMMAND_ERROR_HEADER_MISMATCH: return "header_mismatch";
5108 case DNP3_COMMAND_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
5109 case DNP3_COMMAND_ERROR_IIN_ERROR: return "iin_error";
5110 case DNP3_COMMAND_ERROR_BAD_RESPONSE: return "bad_response";
5111 case DNP3_COMMAND_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
5112 case DNP3_COMMAND_ERROR_WRITE_ERROR: return "write_error";
5113 case DNP3_COMMAND_ERROR_NO_CONNECTION: return "no_connection";
5114 case DNP3_COMMAND_ERROR_SHUTDOWN: return "shutdown";
5115 case DNP3_COMMAND_ERROR_ASSOCIATION_REMOVED: return "association_removed";
5116 case DNP3_COMMAND_ERROR_BAD_ENCODING: return "bad_encoding";
5117 case DNP3_COMMAND_ERROR_UNSUPPORTED_RESPONSE: return "unsupported_response";
5118 case DNP3_COMMAND_ERROR_UNSUPPORTED_OR_BAD_RESPONSE: return "unsupported_or_bad_response";
5119 default: return "unknown command_error value";
5120 }
5121}
5122
5123
5126{
5127
5132
5139 void (*on_destroy)(void* arg);
5141 void* ctx;
5143
5152
5162
5165{
5173
5178{
5179 switch (value)
5180 {
5181 case DNP3_TIME_SYNC_MODE_LAN: return "lan";
5182 case DNP3_TIME_SYNC_MODE_NON_LAN: return "non_lan";
5183 case DNP3_TIME_SYNC_MODE_DIRECT_WRITE_ABS_TIME: return "direct_write_abs_time";
5184 default: return "unknown time_sync_mode value";
5185 }
5186}
5187
5190{
5228
5233{
5234 switch (value)
5235 {
5236 case DNP3_TIME_SYNC_ERROR_OK: return "ok";
5237 case DNP3_TIME_SYNC_ERROR_CLOCK_ROLLBACK: return "clock_rollback";
5238 case DNP3_TIME_SYNC_ERROR_SYSTEM_TIME_NOT_UNIX: return "system_time_not_unix";
5239 case DNP3_TIME_SYNC_ERROR_BAD_OUTSTATION_TIME_DELAY: return "bad_outstation_time_delay";
5240 case DNP3_TIME_SYNC_ERROR_OVERFLOW: return "overflow";
5241 case DNP3_TIME_SYNC_ERROR_STILL_NEEDS_TIME: return "still_needs_time";
5242 case DNP3_TIME_SYNC_ERROR_SYSTEM_TIME_NOT_AVAILABLE: return "system_time_not_available";
5243 case DNP3_TIME_SYNC_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
5244 case DNP3_TIME_SYNC_ERROR_IIN_ERROR: return "iin_error";
5245 case DNP3_TIME_SYNC_ERROR_BAD_RESPONSE: return "bad_response";
5246 case DNP3_TIME_SYNC_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
5247 case DNP3_TIME_SYNC_ERROR_WRITE_ERROR: return "write_error";
5248 case DNP3_TIME_SYNC_ERROR_NO_CONNECTION: return "no_connection";
5249 case DNP3_TIME_SYNC_ERROR_SHUTDOWN: return "shutdown";
5250 case DNP3_TIME_SYNC_ERROR_ASSOCIATION_REMOVED: return "association_removed";
5251 case DNP3_TIME_SYNC_ERROR_BAD_ENCODING: return "bad_encoding";
5252 case DNP3_TIME_SYNC_ERROR_UNSUPPORTED_RESPONSE: return "unsupported_response";
5253 case DNP3_TIME_SYNC_ERROR_UNSUPPORTED_OR_BAD_RESPONSE: return "unsupported_or_bad_response";
5254 default: return "unknown time_sync_error value";
5255 }
5256}
5257
5258
5261{
5262
5267
5274 void (*on_destroy)(void* arg);
5276 void* ctx;
5278
5286
5289{
5315
5320{
5321 switch (value)
5322 {
5323 case DNP3_RESTART_ERROR_OK: return "ok";
5324 case DNP3_RESTART_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
5325 case DNP3_RESTART_ERROR_IIN_ERROR: return "iin_error";
5326 case DNP3_RESTART_ERROR_BAD_RESPONSE: return "bad_response";
5327 case DNP3_RESTART_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
5328 case DNP3_RESTART_ERROR_WRITE_ERROR: return "write_error";
5329 case DNP3_RESTART_ERROR_NO_CONNECTION: return "no_connection";
5330 case DNP3_RESTART_ERROR_SHUTDOWN: return "shutdown";
5331 case DNP3_RESTART_ERROR_ASSOCIATION_REMOVED: return "association_removed";
5332 case DNP3_RESTART_ERROR_BAD_ENCODING: return "bad_encoding";
5333 case DNP3_RESTART_ERROR_UNSUPPORTED_RESPONSE: return "unsupported_response";
5334 case DNP3_RESTART_ERROR_UNSUPPORTED_OR_BAD_RESPONSE: return "unsupported_or_bad_response";
5335 default: return "unknown restart_error value";
5336 }
5337}
5338
5339
5342{
5343
5347 void (*on_complete)(uint64_t, void*);
5348
5355 void (*on_destroy)(void* arg);
5357 void* ctx;
5359
5366
5373
5376{
5377
5382
5389 void (*on_destroy)(void* arg);
5391 void* ctx;
5393
5398{
5399
5406 bool (*opened)(uint32_t, void*);
5407
5415 bool (*block_received)(uint32_t, dnp3_byte_iterator_t*, void*);
5416
5421
5424 void (*completed)(void*);
5427 void (*on_destroy)(void* arg);
5429 void* ctx;
5431
5433
5436{
5442
5451{
5452 dnp3_file_read_config_t _return_value = {
5453 65535,
5454 4294967295
5455 };
5456 return _return_value;
5457}
5458
5459
5461
5464{
5470
5479{
5480 dnp3_dir_read_config_t _return_value = {
5481 65535,
5482 2048
5483 };
5484 return _return_value;
5485}
5486
5487
5496
5508dnp3_param_error_t dnp3_master_channel_read_file_with_auth(dnp3_master_channel_t* instance, dnp3_association_id_t association, const char* remote_file_path, dnp3_file_read_config_t config, dnp3_file_reader_t reader, const char* user_name, const char* password);
5509
5518
5530dnp3_param_error_t dnp3_master_channel_open_file(dnp3_master_channel_t* instance, dnp3_association_id_t association, const char* file_name, uint32_t auth_key, dnp3_permissions_t permissions, uint32_t file_size, dnp3_file_mode_t file_mode, uint16_t max_block_size, dnp3_file_open_callback_t callback);
5531
5541dnp3_param_error_t dnp3_master_channel_write_file_block(dnp3_master_channel_t* instance, dnp3_association_id_t association, uint32_t handle, uint32_t block_number, bool final_block, dnp3_byte_collection_t* block_data, dnp3_file_operation_callback_t callback);
5542
5550
5560
5563
5568
5569
5572{
5573
5578
5585 void (*on_destroy)(void* arg);
5587 void* ctx;
5589
5600
5612dnp3_param_error_t dnp3_master_channel_read_directory_with_auth(dnp3_master_channel_t* instance, dnp3_association_id_t association, const char* dir_path, dnp3_dir_read_config_t config, const char* user_name, const char* password, dnp3_read_directory_callback_t callback);
5613
5616{
5644
5649{
5650 switch (value)
5651 {
5652 case DNP3_LINK_STATUS_ERROR_OK: return "ok";
5653 case DNP3_LINK_STATUS_ERROR_UNEXPECTED_RESPONSE: return "unexpected_response";
5654 case DNP3_LINK_STATUS_ERROR_TOO_MANY_REQUESTS: return "too_many_requests";
5655 case DNP3_LINK_STATUS_ERROR_IIN_ERROR: return "iin_error";
5656 case DNP3_LINK_STATUS_ERROR_BAD_RESPONSE: return "bad_response";
5657 case DNP3_LINK_STATUS_ERROR_RESPONSE_TIMEOUT: return "response_timeout";
5658 case DNP3_LINK_STATUS_ERROR_WRITE_ERROR: return "write_error";
5659 case DNP3_LINK_STATUS_ERROR_NO_CONNECTION: return "no_connection";
5660 case DNP3_LINK_STATUS_ERROR_SHUTDOWN: return "shutdown";
5661 case DNP3_LINK_STATUS_ERROR_ASSOCIATION_REMOVED: return "association_removed";
5662 case DNP3_LINK_STATUS_ERROR_BAD_ENCODING: return "bad_encoding";
5663 case DNP3_LINK_STATUS_ERROR_UNSUPPORTED_RESPONSE: return "unsupported_response";
5664 case DNP3_LINK_STATUS_ERROR_UNSUPPORTED_OR_BAD_RESPONSE: return "unsupported_or_bad_response";
5665 default: return "unknown link_status_error value";
5666 }
5667}
5668
5669
5672{
5673
5678
5685 void (*on_destroy)(void* arg);
5687 void* ctx;
5689
5696
5697
5700
5707
5714
5715
5718
5725
5726
5729{
5730
5735 void (*accept)(const char*, dnp3_accept_handler_t*, void*);
5736
5743 void (*start)(const char*, dnp3_master_channel_t*, void*);
5744
5751 void (*accept_with_link_id)(const char*, uint16_t, uint16_t, dnp3_identified_link_handler_t*, void*);
5752
5761 void (*start_with_link_id)(const char*, uint16_t, uint16_t, dnp3_master_channel_t*, void*);
5764 void (*on_destroy)(void* arg);
5766 void* ctx;
5768
5771
5773
5776{
5778 uint16_t max_tasks;
5781 uint64_t timeout;
5785
5795{
5796 dnp3_link_id_config_t _return_value = {
5797 16,
5798 5000,
5800 };
5801 return _return_value;
5802}
5803
5804
5808
5819
5820
5825
5828{
5838
5843{
5844 switch (value)
5845 {
5846 case DNP3_UPDATE_RESULT_NO_POINT: return "no_point";
5847 case DNP3_UPDATE_RESULT_NO_EVENT: return "no_event";
5848 case DNP3_UPDATE_RESULT_CREATED: return "created";
5849 case DNP3_UPDATE_RESULT_OVERFLOW: return "overflow";
5850 default: return "unknown update_result value";
5851 }
5852}
5853
5855
5858{
5862 uint64_t created;
5864 uint64_t discarded;
5866
5867
5870{
5880
5885{
5886 switch (value)
5887 {
5888 case DNP3_EVENT_MODE_DETECT: return "detect";
5889 case DNP3_EVENT_MODE_FORCE: return "force";
5890 case DNP3_EVENT_MODE_SUPPRESS: return "suppress";
5891 default: return "unknown event_mode value";
5892 }
5893}
5894
5896
5901{
5907
5916{
5917 dnp3_update_options_t _return_value = {
5918 true,
5920 };
5921 return _return_value;
5922}
5923
5932{
5933 dnp3_update_options_t _return_value = {
5934 true,
5936 };
5937 return _return_value;
5938}
5939
5940
5943{
5959
5964{
5965 switch (value)
5966 {
5967 case DNP3_UPDATE_FLAGS_TYPE_BINARY_INPUT: return "binary_input";
5968 case DNP3_UPDATE_FLAGS_TYPE_DOUBLE_BIT_BINARY_INPUT: return "double_bit_binary_input";
5969 case DNP3_UPDATE_FLAGS_TYPE_BINARY_OUTPUT_STATUS: return "binary_output_status";
5970 case DNP3_UPDATE_FLAGS_TYPE_COUNTER: return "counter";
5971 case DNP3_UPDATE_FLAGS_TYPE_FROZEN_COUNTER: return "frozen_counter";
5972 case DNP3_UPDATE_FLAGS_TYPE_ANALOG_INPUT: return "analog_input";
5973 case DNP3_UPDATE_FLAGS_TYPE_ANALOG_OUTPUT_STATUS: return "analog_output_status";
5974 default: return "unknown update_flags_type value";
5975 }
5976}
5977
5989
5992{
5998
6003{
6004 switch (value)
6005 {
6006 case DNP3_STATIC_BINARY_INPUT_VARIATION_GROUP1_VAR1: return "group1_var1";
6007 case DNP3_STATIC_BINARY_INPUT_VARIATION_GROUP1_VAR2: return "group1_var2";
6008 default: return "unknown static_binary_input_variation value";
6009 }
6010}
6011
6014{
6026
6031{
6032 switch (value)
6033 {
6034 case DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR1: return "group2_var1";
6035 case DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR2: return "group2_var2";
6036 case DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR3: return "group2_var3";
6037 default: return "unknown event_binary_input_variation value";
6038 }
6039}
6040
6042
6045{
6051
6057{
6058 dnp3_binary_input_config_t _return_value = {
6059 static_variation,
6060 event_variation
6061 };
6062 return _return_value;
6063}
6064
6073{
6074 dnp3_binary_input_config_t _return_value = {
6077 };
6078 return _return_value;
6079}
6080
6081
6089
6095
6102
6109
6116
6119{
6125
6130{
6131 switch (value)
6132 {
6135 default: return "unknown static_double_bit_binary_input_variation value";
6136 }
6137}
6138
6141{
6153
6158{
6159 switch (value)
6160 {
6164 default: return "unknown event_double_bit_binary_input_variation value";
6165 }
6166}
6167
6169
6172{
6178
6184{
6186 static_variation,
6187 event_variation
6188 };
6189 return _return_value;
6190}
6191
6200{
6204 };
6205 return _return_value;
6206}
6207
6208
6216
6222
6229
6236
6243
6246{
6252
6257{
6258 switch (value)
6259 {
6262 default: return "unknown static_binary_output_status_variation value";
6263 }
6264}
6265
6268{
6276
6281{
6282 switch (value)
6283 {
6286 default: return "unknown event_binary_output_status_variation value";
6287 }
6288}
6289
6291
6294{
6300
6306{
6307 dnp3_binary_output_status_config_t _return_value = {
6308 static_variation,
6309 event_variation
6310 };
6311 return _return_value;
6312}
6313
6322{
6323 dnp3_binary_output_status_config_t _return_value = {
6326 };
6327 return _return_value;
6328}
6329
6330
6338
6344
6351
6358
6365
6368{
6378
6383{
6384 switch (value)
6385 {
6386 case DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR1: return "group20_var1";
6387 case DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR2: return "group20_var2";
6388 case DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR5: return "group20_var5";
6389 case DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR6: return "group20_var6";
6390 default: return "unknown static_counter_variation value";
6391 }
6392}
6393
6396{
6410
6415{
6416 switch (value)
6417 {
6418 case DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR1: return "group22_var1";
6419 case DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR2: return "group22_var2";
6420 case DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR5: return "group22_var5";
6421 case DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR6: return "group22_var6";
6422 default: return "unknown event_counter_variation value";
6423 }
6424}
6425
6427
6430{
6436 uint32_t deadband;
6438
6445{
6446 dnp3_counter_config_t _return_value = {
6447 static_variation,
6448 event_variation,
6449 deadband
6450 };
6451 return _return_value;
6452}
6453
6463{
6464 dnp3_counter_config_t _return_value = {
6467 0
6468 };
6469 return _return_value;
6470}
6471
6472
6479bool dnp3_database_add_counter(dnp3_database_t* instance, uint16_t index, dnp3_event_class_t point_class, dnp3_counter_config_t config);
6480
6485bool dnp3_database_remove_counter(dnp3_database_t* instance, uint16_t index);
6486
6493
6500
6507
6510{
6524
6529{
6530 switch (value)
6531 {
6532 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR1: return "group21_var1";
6533 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR2: return "group21_var2";
6534 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR5: return "group21_var5";
6535 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR6: return "group21_var6";
6536 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR9: return "group21_var9";
6537 case DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR10: return "group21_var10";
6538 default: return "unknown static_frozen_counter_variation value";
6539 }
6540}
6541
6544{
6558
6563{
6564 switch (value)
6565 {
6566 case DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR1: return "group23_var1";
6567 case DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR2: return "group23_var2";
6568 case DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR5: return "group23_var5";
6569 case DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR6: return "group23_var6";
6570 default: return "unknown event_frozen_counter_variation value";
6571 }
6572}
6573
6575
6578{
6584 uint32_t deadband;
6586
6593{
6594 dnp3_frozen_counter_config_t _return_value = {
6595 static_variation,
6596 event_variation,
6597 deadband
6598 };
6599 return _return_value;
6600}
6601
6611{
6612 dnp3_frozen_counter_config_t _return_value = {
6615 0
6616 };
6617 return _return_value;
6618}
6619
6620
6628
6634
6641
6648
6655
6658{
6672
6677{
6678 switch (value)
6679 {
6680 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR1: return "group30_var1";
6681 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR2: return "group30_var2";
6682 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR3: return "group30_var3";
6683 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR4: return "group30_var4";
6684 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR5: return "group30_var5";
6685 case DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR6: return "group30_var6";
6686 default: return "unknown static_analog_input_variation value";
6687 }
6688}
6689
6692{
6718
6723{
6724 switch (value)
6725 {
6726 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR1: return "group32_var1";
6727 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR2: return "group32_var2";
6728 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR3: return "group32_var3";
6729 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR4: return "group32_var4";
6730 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR5: return "group32_var5";
6731 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR6: return "group32_var6";
6732 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR7: return "group32_var7";
6733 case DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR8: return "group32_var8";
6734 default: return "unknown event_analog_input_variation value";
6735 }
6736}
6737
6739
6742{
6750 double deadband;
6752
6759{
6760 dnp3_analog_input_config_t _return_value = {
6761 static_variation,
6762 event_variation,
6763 deadband
6764 };
6765 return _return_value;
6766}
6767
6777{
6778 dnp3_analog_input_config_t _return_value = {
6781 0
6782 };
6783 return _return_value;
6784}
6785
6786
6796
6802
6809
6816
6823
6826{
6836
6841{
6842 switch (value)
6843 {
6848 default: return "unknown static_analog_output_status_variation value";
6849 }
6850}
6851
6854{
6880
6885{
6886 switch (value)
6887 {
6896 default: return "unknown event_analog_output_status_variation value";
6897 }
6898}
6899
6901
6904{
6912 double deadband;
6914
6921{
6922 dnp3_analog_output_status_config_t _return_value = {
6923 static_variation,
6924 event_variation,
6925 deadband
6926 };
6927 return _return_value;
6928}
6929
6939{
6940 dnp3_analog_output_status_config_t _return_value = {
6943 0
6944 };
6945 return _return_value;
6946}
6947
6948
6958
6964
6971
6978
6985
6988
6992
6996
7001
7002
7008bool dnp3_database_add_octet_string(dnp3_database_t* instance, uint16_t index, dnp3_event_class_t point_class);
7009
7015
7023
7031
7034{
7048
7053{
7054 switch (value)
7055 {
7056 case DNP3_ATTR_DEF_ERROR_OK: return "ok";
7057 case DNP3_ATTR_DEF_ERROR_ALREADY_DEFINED: return "already_defined";
7058 case DNP3_ATTR_DEF_ERROR_RESERVED_VARIATION: return "reserved_variation";
7059 case DNP3_ATTR_DEF_ERROR_BAD_TYPE: return "bad_type";
7060 case DNP3_ATTR_DEF_ERROR_NOT_WRITABLE: return "not_writable";
7061 case DNP3_ATTR_DEF_ERROR_BAD_VALUE: return "bad_value";
7062 default: return "unknown attr_def_error value";
7063 }
7064}
7065
7073dnp3_attr_def_error_t dnp3_database_define_string_attr(dnp3_database_t* instance, uint8_t set, bool writable, uint8_t variation, const char* value);
7074
7082dnp3_attr_def_error_t dnp3_database_define_float_attr(dnp3_database_t* instance, uint8_t set, bool writable, uint8_t variation, float value);
7083
7091dnp3_attr_def_error_t dnp3_database_define_double_attr(dnp3_database_t* instance, uint8_t set, bool writable, uint8_t variation, double value);
7092
7100dnp3_attr_def_error_t dnp3_database_define_uint_attr(dnp3_database_t* instance, uint8_t set, bool writable, uint8_t variation, uint32_t value);
7101
7109dnp3_attr_def_error_t dnp3_database_define_int_attr(dnp3_database_t* instance, uint8_t set, bool writable, uint8_t variation, int32_t value);
7110
7118dnp3_attr_def_error_t dnp3_database_define_time_attr(dnp3_database_t* instance, uint8_t set, bool writable, uint8_t variation, uint64_t value);
7119
7127dnp3_attr_def_error_t dnp3_database_define_bool_attr(dnp3_database_t* instance, uint8_t set, bool writable, uint8_t variation, bool value);
7128
7140
7141
7144{
7145
7149 void (*execute)(dnp3_database_t*, void*);
7152 void (*on_destroy)(void* arg);
7154 void* ctx;
7156
7161
7166
7167
7169
7174{
7176 uint16_t max_binary;
7182 uint16_t max_counter;
7186 uint16_t max_analog;
7192
7203static 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)
7204{
7205 dnp3_event_buffer_config_t _return_value = {
7206 max_binary,
7207 max_double_bit_binary,
7208 max_binary_output_status,
7209 max_counter,
7210 max_frozen_counter,
7211 max_analog,
7212 max_analog_output_status,
7213 max_octet_string
7214 };
7215 return _return_value;
7216}
7217
7232{
7233 dnp3_event_buffer_config_t _return_value = {
7234 0,
7235 0,
7236 0,
7237 0,
7238 0,
7239 0,
7240 0,
7241 0
7242 };
7243 return _return_value;
7244}
7245
7246
7248
7251{
7271
7286{
7287 dnp3_class_zero_config_t _return_value = {
7288 true,
7289 true,
7290 true,
7291 true,
7292 true,
7293 true,
7294 true,
7295 false
7296 };
7297 return _return_value;
7298}
7299
7300
7302
7305{
7317
7328{
7329 dnp3_outstation_features_t _return_value = {
7330 false,
7331 true,
7332 true,
7333 false
7334 };
7335 return _return_value;
7336}
7337
7338
7340
7343{
7397
7419static dnp3_outstation_config_t dnp3_outstation_config_init(uint16_t outstation_address, uint16_t master_address, dnp3_event_buffer_config_t event_buffer_config)
7420{
7421 dnp3_outstation_config_t _return_value = {
7422 outstation_address,
7423 master_address,
7424 event_buffer_config,
7425 2048,
7426 2048,
7427 2048,
7429 5000,
7430 5000,
7432 4294967295,
7433 5000,
7434 60000,
7435 64,
7436 65535,
7438 };
7439 return _return_value;
7440}
7441
7442
7445{
7453
7458{
7459 switch (value)
7460 {
7461 case DNP3_RESTART_DELAY_TYPE_NOT_SUPPORTED: return "not_supported";
7462 case DNP3_RESTART_DELAY_TYPE_SECONDS: return "seconds";
7463 case DNP3_RESTART_DELAY_TYPE_MILLI_SECONDS: return "milli_seconds";
7464 default: return "unknown restart_delay_type value";
7465 }
7466}
7467
7469
7474{
7478 uint16_t value;
7480
7489{
7490 dnp3_restart_delay_t _return_value = {
7492 0
7493 };
7494 return _return_value;
7495}
7496
7505{
7506 dnp3_restart_delay_t _return_value = {
7508 value
7509 };
7510 return _return_value;
7511}
7512
7521{
7522 dnp3_restart_delay_t _return_value = {
7524 value
7525 };
7526 return _return_value;
7527}
7528
7529
7532{
7550
7555{
7556 switch (value)
7557 {
7558 case DNP3_POINT_TYPE_BINARY_INPUT: return "binary_input";
7559 case DNP3_POINT_TYPE_DOUBLE_BIT_BINARY_INPUT: return "double_bit_binary_input";
7560 case DNP3_POINT_TYPE_BINARY_OUTPUT_STATUS: return "binary_output_status";
7561 case DNP3_POINT_TYPE_COUNTER: return "counter";
7562 case DNP3_POINT_TYPE_FROZEN_COUNTER: return "frozen_counter";
7563 case DNP3_POINT_TYPE_ANALOG_INPUT: return "analog_input";
7564 case DNP3_POINT_TYPE_ANALOG_OUTPUT_STATUS: return "analog_output_status";
7565 case DNP3_POINT_TYPE_OCTET_STRING: return "octet_string";
7566 default: return "unknown point_type value";
7567 }
7568}
7569
7572{
7580
7585{
7586 switch (value)
7587 {
7588 case DNP3_WRITE_TIME_RESULT_OK: return "ok";
7589 case DNP3_WRITE_TIME_RESULT_PARAMETER_ERROR: return "parameter_error";
7590 case DNP3_WRITE_TIME_RESULT_NOT_SUPPORTED: return "not_supported";
7591 default: return "unknown write_time_result value";
7592 }
7593}
7594
7597{
7603
7608{
7609 switch (value)
7610 {
7611 case DNP3_FREEZE_TYPE_IMMEDIATE_FREEZE: return "immediate_freeze";
7612 case DNP3_FREEZE_TYPE_FREEZE_AND_CLEAR: return "freeze_and_clear";
7613 default: return "unknown freeze_type value";
7614 }
7615}
7616
7619{
7627
7632{
7633 switch (value)
7634 {
7635 case DNP3_FREEZE_RESULT_OK: return "ok";
7636 case DNP3_FREEZE_RESULT_PARAMETER_ERROR: return "parameter_error";
7637 case DNP3_FREEZE_RESULT_NOT_SUPPORTED: return "not_supported";
7638 default: return "unknown freeze_result value";
7639 }
7640}
7641
7643
7646{
7656
7667{
7668 dnp3_application_iin_t _return_value = {
7669 false,
7670 false,
7671 false,
7672 false
7673 };
7674 return _return_value;
7675}
7676
7677
7679
7681typedef struct dnp3_type_count_t
7682{
7690 uint32_t num_counter;
7694 uint32_t num_analog;
7700
7701
7703
7706{
7712
7713
7716{
7717
7725 uint16_t (*get_processing_delay_ms)(void*);
7726
7732
7737
7744
7751
7758
7768
7777
7788 dnp3_freeze_result_t (*freeze_counters_range_at_time)(uint16_t, uint16_t, dnp3_database_handle_t*, uint64_t, uint32_t, void*);
7789
7804
7808
7819 void (*write_analog_dead_band)(uint16_t, double, void*);
7820
7826
7834 bool (*support_assign_class)(void*);
7835
7838 void (*begin_assign_class)(void*);
7839
7847
7856 void (*assign_class_range)(dnp3_point_type_t, uint16_t, uint16_t, dnp3_event_class_t, void*);
7857
7862 void (*end_assign_class)(void*);
7863
7871 bool (*write_string_attr)(uint8_t, uint8_t, dnp3_string_attr_t, const char*, void*);
7872
7880 bool (*write_float_attr)(uint8_t, uint8_t, dnp3_float_attr_t, float, void*);
7881
7889 bool (*write_double_attr)(uint8_t, uint8_t, dnp3_float_attr_t, double, void*);
7890
7898 bool (*write_uint_attr)(uint8_t, uint8_t, dnp3_uint_attr_t, uint32_t, void*);
7899
7907 bool (*write_int_attr)(uint8_t, uint8_t, dnp3_int_attr_t, int32_t, void*);
7908
7917
7926
7934 bool (*write_time_attr)(uint8_t, uint8_t, dnp3_time_attr_t, uint64_t, void*);
7935
7938 void (*begin_confirm)(void*);
7939
7943 void (*event_cleared)(uint64_t, void*);
7944
7951 void (*on_destroy)(void* arg);
7953 void* ctx;
7955
7957
7960{
7966
7967
7970{
7980
7985{
7986 switch (value)
7987 {
7988 case DNP3_BROADCAST_ACTION_PROCESSED: return "processed";
7989 case DNP3_BROADCAST_ACTION_IGNORED_BY_CONFIGURATION: return "ignored_by_configuration";
7990 case DNP3_BROADCAST_ACTION_BAD_OBJECT_HEADERS: return "bad_object_headers";
7991 case DNP3_BROADCAST_ACTION_UNSUPPORTED_FUNCTION: return "unsupported_function";
7992 default: return "unknown broadcast_action value";
7993 }
7994}
7995
8000{
8001
8006
8012
8016 void (*enter_solicited_confirm_wait)(uint8_t, void*);
8017
8021 void (*solicited_confirm_timeout)(uint8_t, void*);
8022
8026 void (*solicited_confirm_received)(uint8_t, void*);
8027
8031
8036 void (*wrong_solicited_confirm_seq)(uint8_t, uint8_t, void*);
8037
8042 void (*unexpected_confirm)(bool, uint8_t, void*);
8043
8047 void (*enter_unsolicited_confirm_wait)(uint8_t, void*);
8048
8053 void (*unsolicited_confirm_timeout)(uint8_t, bool, void*);
8054
8058 void (*unsolicited_confirmed)(uint8_t, void*);
8059
8062 void (*clear_restart_iin)(void*);
8065 void (*on_destroy)(void* arg);
8067 void* ctx;
8069
8072{
8080
8085{
8086 switch (value)
8087 {
8088 case DNP3_OPERATE_TYPE_SELECT_BEFORE_OPERATE: return "select_before_operate";
8089 case DNP3_OPERATE_TYPE_DIRECT_OPERATE: return "direct_operate";
8090 case DNP3_OPERATE_TYPE_DIRECT_OPERATE_NO_ACK: return "direct_operate_no_ack";
8091 default: return "unknown operate_type value";
8092 }
8093}
8094
8101{
8102
8105 void (*begin_fragment)(void*);
8106
8111
8123
8132
8144
8153
8165
8174
8186
8195
8207
8218 void (*on_destroy)(void* arg);
8220 void* ctx;
8222
8225{
8231
8236{
8237 switch (value)
8238 {
8239 case DNP3_CONNECTION_STATE_CONNECTED: return "connected";
8240 case DNP3_CONNECTION_STATE_DISCONNECTED: return "disconnected";
8241 default: return "unknown connection_state value";
8242 }
8243}
8244
8247{
8248
8255 void (*on_destroy)(void* arg);
8257 void* ctx;
8259
8268
8272
8280
8287
8291
8303
8307
8319
8323
8324
8327
8333
8339
8340
8343{
8344
8350 uint64_t (*disconnected)(const char*, const char*, void*);
8351
8356 void (*connecting)(const char*, const char*, void*);
8357
8362 void (*connect_failed)(const char*, const char*, void*);
8363
8368 void (*connected)(const char*, const char*, void*);
8369
8373 void (*resolution_failed)(const char*, void*);
8374
8381 void (*on_destroy)(void* arg);
8383 void* ctx;
8385
8390
8405
8421
8437
8454
8470
8483
8497
8499
8502{
8504 const char* local_endpoint;
8506 const char* remote_endpoint;
8513 uint64_t retry_delay;
8515
8526static dnp3_outstation_udp_config_t dnp3_outstation_udp_config_init(const char* local_endpoint, const char* remote_endpoint)
8527{
8528 dnp3_outstation_udp_config_t _return_value = {
8529 local_endpoint,
8530 remote_endpoint,
8533 5000
8534 };
8535 return _return_value;
8536}
8537
8538
8551
8557
8562
8568
8573
8578
8579
8584
8588
8598
8604
8608
8609
8611
8614{
8618 const char* dns_name;
8620 const char* peer_cert_path;
8622 const char* local_cert_path;
8624 const char* private_key_path;
8630 const char* password;
8638
8652static 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)
8653{
8654 dnp3_tls_server_config_t _return_value = {
8655 dns_name,
8656 peer_cert_path,
8657 local_cert_path,
8658 private_key_path,
8659 password,
8662 false
8663 };
8664 return _return_value;
8665}
8666
8667
8674
8684
8695
8711
8718
8722
8723
8726const char* dnp3_version();
8727
8728#ifdef __cplusplus
8729}
8730#endif
static dnp3_outstation_udp_config_t dnp3_outstation_udp_config_init(const char *local_endpoint, const char *remote_endpoint)
Initialize the configuration with default settings for unspecified parameter.
Definition: dnp3.h:8526
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:973
dnp3_double_bit_t
Double-bit binary input value.
Definition: dnp3.h:787
@ DNP3_DOUBLE_BIT_DETERMINED_OFF
Determined to be OFF.
Definition: dnp3.h:791
@ DNP3_DOUBLE_BIT_DETERMINED_ON
Determined to be ON.
Definition: dnp3.h:793
@ DNP3_DOUBLE_BIT_INTERMEDIATE
Transition between conditions.
Definition: dnp3.h:789
@ DNP3_DOUBLE_BIT_INDETERMINATE
Abnormal or custom condition.
Definition: dnp3.h:795
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 header for use with a READ request.
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:6256
static const char * dnp3_update_result_to_string(dnp3_update_result_t value)
Converts the enum to a string.
Definition: dnp3.h:5842
static const char * dnp3_update_flags_type_to_string(dnp3_update_flags_type_t value)
Converts the enum to a string.
Definition: dnp3.h:5963
static const char * dnp3_link_status_error_to_string(dnp3_link_status_error_t value)
Converts the enum to a string.
Definition: dnp3.h:5648
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:5616
@ DNP3_LINK_STATUS_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:5622
@ DNP3_LINK_STATUS_ERROR_UNSUPPORTED_OR_BAD_RESPONSE
response contained objects that are either malformed or valid but not supported by the library (e....
Definition: dnp3.h:5642
@ DNP3_LINK_STATUS_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:5634
@ DNP3_LINK_STATUS_ERROR_UNSUPPORTED_RESPONSE
response contained objects that the library doesn't support, which may be valid DNP3 (e....
Definition: dnp3.h:5640
@ DNP3_LINK_STATUS_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:5628
@ DNP3_LINK_STATUS_ERROR_BAD_RESPONSE
response was malformed or contained unexpected object headers
Definition: dnp3.h:5626
@ DNP3_LINK_STATUS_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:5636
@ DNP3_LINK_STATUS_ERROR_BAD_ENCODING
request data could not be encoded
Definition: dnp3.h:5638
@ DNP3_LINK_STATUS_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:5632
@ DNP3_LINK_STATUS_ERROR_UNEXPECTED_RESPONSE
There was activity on the link, but it wasn't a LINK_STATUS.
Definition: dnp3.h:5620
@ DNP3_LINK_STATUS_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:5618
@ DNP3_LINK_STATUS_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:5630
@ DNP3_LINK_STATUS_ERROR_IIN_ERROR
outstation returned an IIN.2 error bit
Definition: dnp3.h:5624
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:4659
struct dnp3_file_info_iterator_t dnp3_file_info_iterator_t
Iterator of file_info.
Definition: dnp3.h:5562
static dnp3_permissions_t dnp3_permissions_none()
Permissions with nothing enabled.
Definition: dnp3.h:3160
static const char * dnp3_op_type_to_string(dnp3_op_type_t value)
Converts the enum to a string.
Definition: dnp3.h:529
static const char * dnp3_function_code_to_string(dnp3_function_code_t value)
Converts the enum to a string.
Definition: dnp3.h:3011
dnp3_restart_error_t
Errors that can occur during a cold/warm restart operation.
Definition: dnp3.h:5289
@ DNP3_RESTART_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:5291
@ DNP3_RESTART_ERROR_UNSUPPORTED_RESPONSE
response contained objects that the library doesn't support, which may be valid DNP3 (e....
Definition: dnp3.h:5311
@ DNP3_RESTART_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:5303
@ DNP3_RESTART_ERROR_IIN_ERROR
outstation returned an IIN.2 error bit
Definition: dnp3.h:5295
@ DNP3_RESTART_ERROR_BAD_ENCODING
request data could not be encoded
Definition: dnp3.h:5309
@ DNP3_RESTART_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:5299
@ DNP3_RESTART_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:5301
@ DNP3_RESTART_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:5305
@ DNP3_RESTART_ERROR_BAD_RESPONSE
response was malformed or contained unexpected object headers
Definition: dnp3.h:5297
@ DNP3_RESTART_ERROR_UNSUPPORTED_OR_BAD_RESPONSE
response contained objects that are either malformed or valid but not supported by the library (e....
Definition: dnp3.h:5313
@ DNP3_RESTART_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:5307
@ DNP3_RESTART_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:5293
dnp3_attr_def_error_t dnp3_database_define_time_attr(dnp3_database_t *instance, uint8_t set, bool writable, uint8_t variation, uint64_t value)
Define a DNP3 time attribute.
dnp3_byte_collection_t * dnp3_byte_collection_create(uint32_t reserve_size)
Creates an instance of the collection.
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:606
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:7203
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:3999
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:6676
static const char * dnp3_double_bit_to_string(dnp3_double_bit_t value)
Converts the enum to a string.
Definition: dnp3.h:801
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:2715
static dnp3_outstation_features_t dnp3_outstation_features_init()
Initialize to default values.
Definition: dnp3.h:7327
static const char * dnp3_time_sync_error_to_string(dnp3_time_sync_error_t value)
Converts the enum to a string.
Definition: dnp3.h:5232
struct dnp3_outstation_t dnp3_outstation_t
Outstation handle.
Definition: dnp3.h:8389
static dnp3_header_info_t dnp3_header_info_init(dnp3_variation_t variation, dnp3_qualifier_code_t qualifier, bool is_event, bool has_flags)
Fully construct dnp3_header_info_t specifying the value of each field.
Definition: dnp3.h:3721
struct dnp3_connection_info_t dnp3_connection_info_t
Builder for configuring connection parameters.
Definition: dnp3.h:8267
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:2817
void dnp3_write_dead_band_request_add_g34v2_u8(dnp3_write_dead_band_request_t *instance, uint8_t index, uint32_t dead_band)
Add a g34v2 (unsigned 32-bit) dead-band with 8-bit indexing to the request.
dnp3_variation_t
Group/Variation.
Definition: dnp3.h:2215
@ DNP3_VARIATION_GROUP30_VAR6
Analog Input - Double-precision floating point with flags.
Definition: dnp3.h:2323
@ DNP3_VARIATION_GROUP33_VAR1
Frozen Analog Input Event - 32-bit without time.
Definition: dnp3.h:2363
@ DNP3_VARIATION_GROUP42_VAR4
Analog Output Event - 16-bit with time.
Definition: dnp3.h:2413
@ DNP3_VARIATION_GROUP70_VAR2
File Control - Authentication.
Definition: dnp3.h:2463
@ DNP3_VARIATION_GROUP11_VAR2
Binary Output Event - With time.
Definition: dnp3.h:2259
@ DNP3_VARIATION_GROUP70_VAR3
File Control - File command.
Definition: dnp3.h:2465
@ DNP3_VARIATION_GROUP1_VAR1
Binary Input - Packed format.
Definition: dnp3.h:2223
@ DNP3_VARIATION_GROUP20_VAR6
Counter - 16-bit without flags.
Definition: dnp3.h:2275
@ DNP3_VARIATION_GROUP40_VAR3
Analog Output Status - Single-precision floating point with flags.
Definition: dnp3.h:2393
@ DNP3_VARIATION_GROUP102_VAR0
Unsigned Integer - Any variation.
Definition: dnp3.h:2479
@ DNP3_VARIATION_GROUP23_VAR0
Frozen Counter Event - Any variation.
Definition: dnp3.h:2301
@ DNP3_VARIATION_GROUP1_VAR2
Binary Input - With flags.
Definition: dnp3.h:2225
@ DNP3_VARIATION_GROUP43_VAR1
Analog Output Command Event - 32-bit without time.
Definition: dnp3.h:2423
@ DNP3_VARIATION_GROUP43_VAR5
Analog Output Command Event - Single-precision floating point without time.
Definition: dnp3.h:2431
@ DNP3_VARIATION_GROUP41_VAR4
Analog Output - Double-precision floating point.
Definition: dnp3.h:2403
@ DNP3_VARIATION_GROUP22_VAR1
Counter Event - 32-bit without time.
Definition: dnp3.h:2293
@ DNP3_VARIATION_GROUP32_VAR0
Analog Input Event - Any variation.
Definition: dnp3.h:2343
@ DNP3_VARIATION_GROUP3_VAR2
Double-bit Binary Input - With flags.
Definition: dnp3.h:2239
@ DNP3_VARIATION_GROUP111
Octet String Event - Sized by variation.
Definition: dnp3.h:2485
@ DNP3_VARIATION_GROUP21_VAR1
Frozen Counter - 32-bit with flags.
Definition: dnp3.h:2279
@ DNP3_VARIATION_GROUP60_VAR2
Class Data - Class 1.
Definition: dnp3.h:2457
@ DNP3_VARIATION_GROUP11_VAR1
Binary Output Event - Without time.
Definition: dnp3.h:2257
@ DNP3_VARIATION_GROUP33_VAR2
Frozen Analog Input Event - 16-bit without time.
Definition: dnp3.h:2365
@ DNP3_VARIATION_GROUP2_VAR1
Binary Input Event - Without time.
Definition: dnp3.h:2229
@ DNP3_VARIATION_GROUP70_VAR6
File Control - File transport status.
Definition: dnp3.h:2471
@ DNP3_VARIATION_GROUP30_VAR1
Analog Input - 32-bit with flags.
Definition: dnp3.h:2313
@ DNP3_VARIATION_GROUP43_VAR2
Analog Output Command Event - 16-bit without time.
Definition: dnp3.h:2425
@ DNP3_VARIATION_GROUP40_VAR4
Analog Output Status - Double-precision floating point with flags.
Definition: dnp3.h:2395
@ DNP3_VARIATION_GROUP32_VAR8
Analog Input Event - Double-precision floating point with time.
Definition: dnp3.h:2359
@ DNP3_VARIATION_GROUP23_VAR1
Frozen Counter Event - 32-bit without time.
Definition: dnp3.h:2303
@ DNP3_VARIATION_GROUP11_VAR0
Binary Output Event - Any variation.
Definition: dnp3.h:2255
@ DNP3_VARIATION_GROUP31_VAR1
Frozen Analog Input - 32-bit with flags.
Definition: dnp3.h:2327
@ DNP3_VARIATION_GROUP42_VAR6
Analog Output Event - Double-precision floating point without time.
Definition: dnp3.h:2417
@ DNP3_VARIATION_GROUP3_VAR1
Double-bit Binary Input - Packed format.
Definition: dnp3.h:2237
@ DNP3_VARIATION_GROUP102_VAR1
Unsigned Integer - 8-bit.
Definition: dnp3.h:2481
@ DNP3_VARIATION_GROUP60_VAR1
Class Data - Class 0.
Definition: dnp3.h:2455
@ DNP3_VARIATION_GROUP70_VAR7
File Control - File descriptor.
Definition: dnp3.h:2473
@ DNP3_VARIATION_GROUP31_VAR7
Frozen Analog Input - Single-precision floating point with flags.
Definition: dnp3.h:2339
@ DNP3_VARIATION_GROUP33_VAR3
Frozen Analog Input Event - 32-bit with time of freeze.
Definition: dnp3.h:2367
@ DNP3_VARIATION_GROUP23_VAR2
Frozen Counter Event - 16-bit without time.
Definition: dnp3.h:2305
@ DNP3_VARIATION_GROUP40_VAR0
Analog Output Status - Any variation.
Definition: dnp3.h:2387
@ DNP3_VARIATION_GROUP52_VAR2
Time Delay - Fine (milliseconds)
Definition: dnp3.h:2453
@ DNP3_VARIATION_GROUP42_VAR8
Analog Output Event - Double-precision floating point with time.
Definition: dnp3.h:2421
@ DNP3_VARIATION_GROUP30_VAR5
Analog Input - Single-precision floating point with flags.
Definition: dnp3.h:2321
@ DNP3_VARIATION_GROUP1_VAR0
Binary Input - Any variation.
Definition: dnp3.h:2221
@ DNP3_VARIATION_GROUP31_VAR4
Frozen Analog Input - 16-bit with flags and time of freeze.
Definition: dnp3.h:2333
@ DNP3_VARIATION_GROUP40_VAR1
Analog Output Status - 32-bit with flags.
Definition: dnp3.h:2389
@ DNP3_VARIATION_GROUP21_VAR2
Frozen Counter - 16-bit with flags.
Definition: dnp3.h:2281
@ DNP3_VARIATION_GROUP33_VAR0
Frozen Analog Input Event - Any variation.
Definition: dnp3.h:2361
@ DNP3_VARIATION_GROUP34_VAR3
Analog Input Reporting Deadband - Single-precision floating point.
Definition: dnp3.h:2385
@ DNP3_VARIATION_GROUP40_VAR2
Analog Output Status - 16-bit with flags.
Definition: dnp3.h:2391
@ DNP3_VARIATION_GROUP20_VAR0
Counter - Any variation.
Definition: dnp3.h:2267
@ DNP3_VARIATION_GROUP4_VAR3
Double-bit Binary Input Event - With relative time.
Definition: dnp3.h:2247
@ DNP3_VARIATION_GROUP22_VAR2
Counter Event - 16-bit without time.
Definition: dnp3.h:2295
@ DNP3_VARIATION_GROUP32_VAR6
Analog Input Event - Double-precision floating point without time.
Definition: dnp3.h:2355
@ DNP3_VARIATION_GROUP0_VAR254
Device Attributes - All attributes request.
Definition: dnp3.h:2219
@ DNP3_VARIATION_GROUP42_VAR0
Analog Output Event - Any variation.
Definition: dnp3.h:2405
@ DNP3_VARIATION_GROUP42_VAR2
Analog Output Event - 16-bit without time.
Definition: dnp3.h:2409
@ DNP3_VARIATION_GROUP43_VAR8
Analog Output Command Event - Double-precision floating point with time.
Definition: dnp3.h:2437
@ DNP3_VARIATION_GROUP30_VAR2
Analog Input - 16-bit with flags.
Definition: dnp3.h:2315
@ DNP3_VARIATION_GROUP70_VAR4
File Control - File command status.
Definition: dnp3.h:2467
@ DNP3_VARIATION_GROUP22_VAR0
Counter Event - Any variation.
Definition: dnp3.h:2291
@ DNP3_VARIATION_GROUP50_VAR2
Time and Date - Absolute time and interval.
Definition: dnp3.h:2441
@ DNP3_VARIATION_GROUP30_VAR3
Analog Input - 32-bit without flags.
Definition: dnp3.h:2317
@ DNP3_VARIATION_GROUP0
Device Attributes - Specific attribute (variations 1 to 253 and 255). Only reported in dnp3_header_in...
Definition: dnp3.h:2217
@ DNP3_VARIATION_GROUP31_VAR0
Frozen Analog Input - Any variation.
Definition: dnp3.h:2325
@ DNP3_VARIATION_GROUP41_VAR2
Analog Output - 16-bit.
Definition: dnp3.h:2399
@ DNP3_VARIATION_GROUP32_VAR5
Analog Input Event - Single-precision floating point without time.
Definition: dnp3.h:2353
@ DNP3_VARIATION_GROUP34_VAR2
Analog Input Reporting Deadband - 32-bit.
Definition: dnp3.h:2383
@ DNP3_VARIATION_GROUP70_VAR8
File Control - File specification string.
Definition: dnp3.h:2475
@ DNP3_VARIATION_GROUP20_VAR2
Counter - 16-bit with flags.
Definition: dnp3.h:2271
@ DNP3_VARIATION_GROUP70_VAR5
File Control - File transport.
Definition: dnp3.h:2469
@ DNP3_VARIATION_GROUP12_VAR1
Binary Output Command - Control relay output block.
Definition: dnp3.h:2261
@ DNP3_VARIATION_GROUP41_VAR1
Analog Output - 32-bit.
Definition: dnp3.h:2397
@ DNP3_VARIATION_GROUP43_VAR3
Analog Output Command Event - 32-bit with time.
Definition: dnp3.h:2427
@ DNP3_VARIATION_GROUP43_VAR7
Analog Output Command Event - Single-precision floating point with time.
Definition: dnp3.h:2435
@ DNP3_VARIATION_GROUP33_VAR5
Frozen Analog Input Event - Single-precision floating point without time.
Definition: dnp3.h:2371
@ DNP3_VARIATION_GROUP33_VAR4
Frozen Analog Input Event - 16-bit with time of freeze.
Definition: dnp3.h:2369
@ DNP3_VARIATION_GROUP50_VAR1
Time and Date - Absolute time.
Definition: dnp3.h:2439
@ DNP3_VARIATION_GROUP13_VAR2
Binary Output Command Event - With time.
Definition: dnp3.h:2265
@ DNP3_VARIATION_GROUP52_VAR1
Time Delay - Coarse (seconds)
Definition: dnp3.h:2451
@ DNP3_VARIATION_GROUP32_VAR3
Analog Input Event - 32-bit with time.
Definition: dnp3.h:2349
@ DNP3_VARIATION_GROUP4_VAR2
Double-bit Binary Input Event - With absolute time.
Definition: dnp3.h:2245
@ DNP3_VARIATION_GROUP21_VAR0
Frozen Counter - Any variation.
Definition: dnp3.h:2277
@ DNP3_VARIATION_GROUP23_VAR6
Frozen Counter Event - 16-bit with time.
Definition: dnp3.h:2309
@ DNP3_VARIATION_GROUP43_VAR4
Analog Output Command Event - 16-bit with time.
Definition: dnp3.h:2429
@ DNP3_VARIATION_GROUP110
Octet String - Sized by variation.
Definition: dnp3.h:2483
@ DNP3_VARIATION_GROUP43_VAR6
Analog Output Command Event - Double-precision floating point without time.
Definition: dnp3.h:2433
@ DNP3_VARIATION_GROUP42_VAR7
Analog Output Event - Single-precision floating point with time.
Definition: dnp3.h:2419
@ DNP3_VARIATION_GROUP42_VAR5
Analog Output Event - Single-precision floating point without time.
Definition: dnp3.h:2415
@ DNP3_VARIATION_GROUP21_VAR5
Frozen Counter - 32-bit with flags and time.
Definition: dnp3.h:2283
@ DNP3_VARIATION_GROUP31_VAR5
Frozen Analog Input - 32-bit without flags.
Definition: dnp3.h:2335
@ DNP3_VARIATION_GROUP22_VAR6
Counter Event - 16-bit with time.
Definition: dnp3.h:2299
@ DNP3_VARIATION_GROUP21_VAR6
Frozen Counter - 16-bit with flags and time.
Definition: dnp3.h:2285
@ DNP3_VARIATION_GROUP10_VAR1
Binary Output - Packed format.
Definition: dnp3.h:2251
@ DNP3_VARIATION_GROUP31_VAR3
Frozen Analog Input - 32-bit with flags and time of freeze.
Definition: dnp3.h:2331
@ DNP3_VARIATION_GROUP34_VAR1
Analog Input Reporting Deadband - 16-bit.
Definition: dnp3.h:2381
@ DNP3_VARIATION_GROUP22_VAR5
Counter Event - 32-bit with time.
Definition: dnp3.h:2297
@ DNP3_VARIATION_GROUP2_VAR3
Binary Input Event - With relative time.
Definition: dnp3.h:2233
@ DNP3_VARIATION_GROUP33_VAR6
Frozen Analog Input Event - Double-precision floating point without time.
Definition: dnp3.h:2373
@ DNP3_VARIATION_GROUP32_VAR1
Analog Input Event - 32-bit without time.
Definition: dnp3.h:2345
@ DNP3_VARIATION_GROUP32_VAR4
Analog Input Event - 16-bit with time.
Definition: dnp3.h:2351
@ DNP3_VARIATION_GROUP34_VAR0
Analog Input Reporting Deadband - Any variation.
Definition: dnp3.h:2379
@ DNP3_VARIATION_GROUP2_VAR0
Binary Input Event - Any variation.
Definition: dnp3.h:2227
@ DNP3_VARIATION_GROUP21_VAR10
Frozen Counter - 16-bit without flags.
Definition: dnp3.h:2289
@ DNP3_VARIATION_GROUP51_VAR1
Time and Date CTO - Synchronized absolute time.
Definition: dnp3.h:2447
@ DNP3_VARIATION_GROUP20_VAR5
Counter - 32-bit without flags.
Definition: dnp3.h:2273
@ DNP3_VARIATION_GROUP4_VAR0
Double-bit Binary Input Event - Any variation.
Definition: dnp3.h:2241
@ DNP3_VARIATION_GROUP32_VAR2
Analog Input Event - 16-bit without time.
Definition: dnp3.h:2347
@ DNP3_VARIATION_GROUP10_VAR0
Binary Output - Any variation.
Definition: dnp3.h:2249
@ DNP3_VARIATION_GROUP33_VAR8
Frozen Analog Input Event - Double-precision floating point with time of freeze.
Definition: dnp3.h:2377
@ DNP3_VARIATION_GROUP31_VAR2
Frozen Analog Input - 16-bit with flags.
Definition: dnp3.h:2329
@ DNP3_VARIATION_GROUP50_VAR4
Time and Date - Indexed time and long interval.
Definition: dnp3.h:2445
@ DNP3_VARIATION_GROUP60_VAR3
Class Data - Class 2.
Definition: dnp3.h:2459
@ DNP3_VARIATION_GROUP80_VAR1
Internal Indications - Packed format.
Definition: dnp3.h:2477
@ DNP3_VARIATION_GROUP30_VAR4
Analog Input - 16-bit without flags.
Definition: dnp3.h:2319
@ DNP3_VARIATION_GROUP51_VAR2
Time and Date CTO - Unsynchronized absolute time.
Definition: dnp3.h:2449
@ DNP3_VARIATION_GROUP32_VAR7
Analog Input Event - Single-precision floating point with time.
Definition: dnp3.h:2357
@ DNP3_VARIATION_GROUP3_VAR0
Double-bit Binary Input - Any variation.
Definition: dnp3.h:2235
@ DNP3_VARIATION_GROUP42_VAR3
Analog Output Event - 32-bit with time.
Definition: dnp3.h:2411
@ DNP3_VARIATION_GROUP20_VAR1
Counter - 32-bit with flags.
Definition: dnp3.h:2269
@ DNP3_VARIATION_GROUP10_VAR2
Binary Output - With flags.
Definition: dnp3.h:2253
@ DNP3_VARIATION_GROUP31_VAR8
Frozen Analog Input - Double-precision floating point with flags.
Definition: dnp3.h:2341
@ DNP3_VARIATION_GROUP31_VAR6
Frozen Analog Input - 16-bit without flags.
Definition: dnp3.h:2337
@ DNP3_VARIATION_GROUP2_VAR2
Binary Input Event - With absolute time.
Definition: dnp3.h:2231
@ DNP3_VARIATION_GROUP23_VAR5
Frozen Counter Event - 32-bit with time.
Definition: dnp3.h:2307
@ DNP3_VARIATION_GROUP41_VAR3
Analog Output - Single-precision floating point.
Definition: dnp3.h:2401
@ DNP3_VARIATION_GROUP33_VAR7
Frozen Analog Input Event - Single-precision floating point with time of freeze.
Definition: dnp3.h:2375
@ DNP3_VARIATION_GROUP13_VAR1
Binary Output Command Event - Without time.
Definition: dnp3.h:2263
@ DNP3_VARIATION_GROUP42_VAR1
Analog Output Event - 32-bit without time.
Definition: dnp3.h:2407
@ DNP3_VARIATION_GROUP21_VAR9
Frozen Counter - 32-bit without flags.
Definition: dnp3.h:2287
@ DNP3_VARIATION_GROUP50_VAR3
Time and Date - Last recorded time.
Definition: dnp3.h:2443
@ DNP3_VARIATION_GROUP30_VAR0
Analog Input - Any variation.
Definition: dnp3.h:2311
@ DNP3_VARIATION_GROUP4_VAR1
Double-bit Binary Input Event - Without time.
Definition: dnp3.h:2243
@ DNP3_VARIATION_GROUP60_VAR4
Class Data - Class 3.
Definition: dnp3.h:2461
void dnp3_write_dead_band_request_add_g34v2_u16(dnp3_write_dead_band_request_t *instance, uint16_t index, uint32_t dead_band)
Add a g34v2 (unsigned 32-bit) dead-band with 16-bit indexing to the request.
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:8652
static dnp3_octet_string_t dnp3_octet_string_init(uint16_t index, dnp3_byte_iterator_t *value)
Fully construct dnp3_octet_string_t specifying the value of each field.
Definition: dnp3.h:1373
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 header for use with a READ request.
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:6884
dnp3_param_error_t dnp3_next_endpoint_action_sleep_for(dnp3_next_endpoint_action_t *instance, uint64_t duration)
Indicate that the connection task should sleep for the specified duration.
static const char * dnp3_phys_decode_level_to_string(dnp3_phys_decode_level_t value)
Converts the enum to a string.
Definition: dnp3.h:345
dnp3_param_error_t dnp3_master_channel_get_file_auth_key(dnp3_master_channel_t *instance, dnp3_association_id_t association, const char *username, const char *password, dnp3_file_auth_callback_t callback)
Obtain a file authentication key.
static dnp3_binary_input_config_t dnp3_binary_input_config_create(dnp3_static_binary_input_variation_t static_variation, dnp3_event_binary_input_variation_t event_variation)
Fully construct dnp3_binary_input_config_t specifying the value of each field.
Definition: dnp3.h:6056
dnp3_attr_def_error_t dnp3_database_define_double_attr(dnp3_database_t *instance, uint8_t set, bool writable, uint8_t variation, double value)
Define a 64-bit floating point attribute.
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:2670
static dnp3_timestamp_t dnp3_timestamp_synchronized_timestamp(uint64_t value)
Creates a synchronized timestamp struct.
Definition: dnp3.h:759
static const char * dnp3_float_attr_to_string(dnp3_float_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:2037
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:7445
@ DNP3_RESTART_DELAY_TYPE_NOT_SUPPORTED
Restart mode not supported.
Definition: dnp3.h:7447
@ DNP3_RESTART_DELAY_TYPE_MILLI_SECONDS
Value is in milliseconds (corresponds to g51v2)
Definition: dnp3.h:7451
@ DNP3_RESTART_DELAY_TYPE_SECONDS
Value is in seconds (corresponds to g51v1)
Definition: dnp3.h:7449
void dnp3_request_add_string_attribute(dnp3_request_t *instance, uint8_t variation, uint8_t set, const char *value)
Add a header that writes a visible string device attribute (group 0) for use with a WRITE request.
static const char * dnp3_file_type_to_string(dnp3_file_type_t value)
Converts the enum to a string.
Definition: dnp3.h:3066
void dnp3_master_server_destroy(dnp3_master_server_t *instance)
Shutdown down the server.
static dnp3_restart_delay_t dnp3_restart_delay_not_supported()
RestartDelay indicating that the request is not supported.
Definition: dnp3.h:7488
static const char * dnp3_link_error_mode_to_string(dnp3_link_error_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:2927
dnp3_update_info_t dnp3_database_update_binary_output_status_2(dnp3_database_t *instance, dnp3_binary_output_status_t value, dnp3_update_options_t options)
Update a Binary Output Status point.
static dnp3_analog_output_status_config_t dnp3_analog_output_status_config_create(dnp3_static_analog_output_status_variation_t static_variation, dnp3_event_analog_output_status_variation_t event_variation, double deadband)
Fully construct dnp3_analog_output_status_config_t specifying the value of each field.
Definition: dnp3.h:6920
void dnp3_disable_server_tcp_no_delay()
By default, TCP_NODELAY is set to true for all server TCP/TLS connections. This disables Nagle's algo...
struct dnp3_unsigned_integer_iterator_t dnp3_unsigned_integer_iterator_t
Iterator of unsigned_integer.
Definition: dnp3.h:1305
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_unsigned_integer_t dnp3_unsigned_integer_init(uint16_t index, uint8_t value)
Fully construct dnp3_unsigned_integer_t specifying the value of each field.
Definition: dnp3.h:1294
dnp3_param_error_t dnp3_outstation_create_tcp_client(dnp3_runtime_t *runtime, dnp3_link_error_mode_t link_error_mode, dnp3_endpoint_list_t *endpoints, dnp3_connect_strategy_t connect_strategy, dnp3_connect_options_t *connect_options, dnp3_outstation_config_t config, dnp3_outstation_application_t application, dnp3_outstation_information_t information, dnp3_control_handler_t control_handler, dnp3_client_state_listener_t listener, dnp3_outstation_t **out)
Create an outstation instance running as a TCP client.
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:6722
struct dnp3_analog_output_status_iterator_t dnp3_analog_output_status_iterator_t
Iterator of analog_output_status.
Definition: dnp3.h:1141
dnp3_param_error_t dnp3_next_endpoint_action_connect_to(dnp3_next_endpoint_action_t *instance, dnp3_connection_info_t *info)
Specify the next endpoint to attempt connection to.
dnp3_param_error_t dnp3_master_channel_get_file_info(dnp3_master_channel_t *instance, dnp3_association_id_t association, const char *file_name, dnp3_file_info_callback_t callback)
Asynchronously retrieve information on a particular file.
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:1044
dnp3_event_binary_output_status_variation_t
Event binary output status variation.
Definition: dnp3.h:6268
@ DNP3_EVENT_BINARY_OUTPUT_STATUS_VARIATION_GROUP11_VAR2
Binary Output Event - With time.
Definition: dnp3.h:6274
@ DNP3_EVENT_BINARY_OUTPUT_STATUS_VARIATION_GROUP11_VAR1
Binary Output Event - Without time.
Definition: dnp3.h:6270
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.
dnp3_param_error_t dnp3_outstation_disable(dnp3_outstation_t *instance)
disable communications
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:876
dnp3_event_binary_input_variation_t
Event binary input variation.
Definition: dnp3.h:6014
@ DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR2
Binary Input Event - With absolute time.
Definition: dnp3.h:6020
@ DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR3
Binary Input Event - With relative time.
Definition: dnp3.h:6024
@ DNP3_EVENT_BINARY_INPUT_VARIATION_GROUP2_VAR1
Binary Input Event - Without time.
Definition: dnp3.h:6016
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:3735
@ DNP3_READ_TYPE_UNSOLICITED
Unsolicited message.
Definition: dnp3.h:3739
@ DNP3_READ_TYPE_STARTUP_INTEGRITY
Startup integrity poll.
Definition: dnp3.h:3737
@ DNP3_READ_TYPE_SINGLE_POLL
Single poll requested by the user.
Definition: dnp3.h:3741
@ DNP3_READ_TYPE_PERIODIC_POLL
Periodic poll configured by the user.
Definition: dnp3.h:3743
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:1488
static const char * dnp3_file_mode_to_string(dnp3_file_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:3358
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:6157
dnp3_uint_attr_t
Enumeration of all the default uint attributes.
Definition: dnp3.h:1800
@ DNP3_UINT_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:1802
@ DNP3_UINT_ATTR_MAX_BINARY_INPUT_INDEX
Variation 238 - Maximum binary input point index.
Definition: dnp3.h:1842
@ DNP3_UINT_ATTR_NUM_BINARY_OUTPUTS
Variation 224 - Number of binary outputs.
Definition: dnp3.h:1828
@ DNP3_UINT_ATTR_NUM_MASTER_DEFINED_DATA_SETS
Variation 214 - Number of master defined data-sets.
Definition: dnp3.h:1812
@ DNP3_UINT_ATTR_NUM_BINARY_INPUT
Variation 239 - Number of binary input points.
Definition: dnp3.h:1844
@ DNP3_UINT_ATTR_MAX_COUNTER_INDEX
Variation 228 - Maximum counter point index.
Definition: dnp3.h:1830
@ DNP3_UINT_ATTR_MAX_ANALOG_OUTPUT_INDEX
Variation 220 - Maximum analog output index.
Definition: dnp3.h:1822
@ DNP3_UINT_ATTR_NUM_SECURITY_STATS_PER_ASSOC
Variation 210 - Number of security statistics per association.
Definition: dnp3.h:1806
@ DNP3_UINT_ATTR_SECURE_AUTH_VERSION
Variation 209 - Secure authentication version.
Definition: dnp3.h:1804
@ DNP3_UINT_ATTR_MAX_BINARY_OUTPUT_PER_REQUEST
Variation 216 - Maximum number of binary outputs per request.
Definition: dnp3.h:1816
@ DNP3_UINT_ATTR_NUM_ANALOG_INPUT
Variation 233 - Number of analog input points.
Definition: dnp3.h:1836
@ DNP3_UINT_ATTR_LOCAL_TIMING_ACCURACY
Variation 217 - Local timing accuracy (microseconds)
Definition: dnp3.h:1818
@ DNP3_UINT_ATTR_NUM_DOUBLE_BIT_BINARY_INPUT
Variation 236 - Number of double-bit binary input points.
Definition: dnp3.h:1840
@ DNP3_UINT_ATTR_NUM_OUTSTATION_DEFINED_DATA_SETS
Variation 215 - Number of outstation defined data-sets.
Definition: dnp3.h:1814
@ DNP3_UINT_ATTR_MAX_BINARY_OUTPUT_INDEX
Variation 223 - Maximum binary output index.
Definition: dnp3.h:1826
@ DNP3_UINT_ATTR_MAX_RX_FRAGMENT_SIZE
Variation 241 - Maximum receive fragment size.
Definition: dnp3.h:1848
@ DNP3_UINT_ATTR_DURATION_OF_TIME_ACCURACY
Variation 218 - Duration of time accuracy (seconds)
Definition: dnp3.h:1820
@ DNP3_UINT_ATTR_NUM_COUNTER
Variation 229 - Number of counter points.
Definition: dnp3.h:1832
@ DNP3_UINT_ATTR_NUM_ANALOG_OUTPUTS
Variation 221 - Number of analog outputs.
Definition: dnp3.h:1824
@ DNP3_UINT_ATTR_NUM_MASTER_DEFINED_DATA_SET_PROTO
Variation 212 - Number of master defined data-set prototypes.
Definition: dnp3.h:1808
@ DNP3_UINT_ATTR_MAX_ANALOG_INPUT_INDEX
Variation 232 - Maximum analog input point index.
Definition: dnp3.h:1834
@ DNP3_UINT_ATTR_MAX_TX_FRAGMENT_SIZE
Variation 240 - Maximum transmit fragment size.
Definition: dnp3.h:1846
@ DNP3_UINT_ATTR_NUM_OUTSTATION_DEFINED_DATA_SET_PROTO
Variation 213 - Number of outstation defined data-set prototypes.
Definition: dnp3.h:1810
@ DNP3_UINT_ATTR_MAX_DOUBLE_BIT_BINARY_INPUT_INDEX
Variation 235 - Maximum double-bit binary input point index.
Definition: dnp3.h:1838
struct dnp3_identified_link_handler_t dnp3_identified_link_handler_t
Class used to accept a connection, reject it, or defer it to link identification.
Definition: dnp3.h:5717
struct dnp3_analog_output_command_event_iterator_t dnp3_analog_output_command_event_iterator_t
Iterator of analog_output_command_event.
Definition: dnp3.h:1269
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:7666
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:1465
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:1478
@ DNP3_MIN_TLS_VERSION_V12
Allow TLS 1.2 and 1.3.
Definition: dnp3.h:1480
@ DNP3_MIN_TLS_VERSION_V13
Only allow TLS 1.3. A peer that does not support TLS 1.3 will fail to complete the handshake.
Definition: dnp3.h:1482
dnp3_certificate_mode_t
Determines how the certificate(s) presented by the peer are validated.
Definition: dnp3.h:1502
@ 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:1512
@ DNP3_CERTIFICATE_MODE_AUTHORITY_BASED
Validates the peer certificate against one or more configured trust anchors.
Definition: dnp3.h:1508
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:4407
static const char * dnp3_command_error_to_string(dnp3_command_error_t value)
Converts the enum to a string.
Definition: dnp3.h:5101
dnp3_file_mode_t
Different modes in which files may be opened.
Definition: dnp3.h:3346
@ DNP3_FILE_MODE_APPEND
Specifies that the file is to be opened for writing, appending to the end of the file.
Definition: dnp3.h:3352
@ DNP3_FILE_MODE_READ
Specifies that an existing file is to be opened for reading.
Definition: dnp3.h:3348
@ DNP3_FILE_MODE_WRITE
Specifies that the file is to be opened for writing, truncating any existing file to length 0.
Definition: dnp3.h:3350
static const char * dnp3_command_mode_to_string(dnp3_command_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:5055
dnp3_bit_string_attr_t
Enumeration of all known bit-string attributes.
Definition: dnp3.h:2004
@ DNP3_BIT_STRING_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:2006
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 request.
dnp3_param_error_t dnp3_master_channel_close_file(dnp3_master_channel_t *instance, dnp3_association_id_t association, uint32_t handle, dnp3_file_operation_callback_t callback)
Asynchronously close a file.
dnp3_frozen_analog_input_t * dnp3_frozen_analog_input_iterator_next(dnp3_frozen_analog_input_iterator_t *iter)
returns a pointer to the next value or NULL
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:1002
void dnp3_write_dead_band_request_finish_header(dnp3_write_dead_band_request_t *instance)
If a header is currently being written, then this will complete the header so that no new objects may...
dnp3_operate_type_t
Enumeration describing how the master requested the control operation.
Definition: dnp3.h:8072
@ DNP3_OPERATE_TYPE_SELECT_BEFORE_OPERATE
control point was properly selected before the operate request
Definition: dnp3.h:8074
@ DNP3_OPERATE_TYPE_DIRECT_OPERATE
operate the control via a DirectOperate request
Definition: dnp3.h:8076
@ DNP3_OPERATE_TYPE_DIRECT_OPERATE_NO_ACK
operate the control via a DirectOperateNoAck request
Definition: dnp3.h:8078
struct dnp3_octet_string_value_t dnp3_octet_string_value_t
Collection of octet_string_value.
Definition: dnp3.h:6987
dnp3_attr_def_error_t dnp3_database_define_string_attr(dnp3_database_t *instance, uint8_t set, bool writable, uint8_t variation, const char *value)
Define a string attribute.
static const char * dnp3_variation_list_attr_to_string(dnp3_variation_list_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:1715
dnp3_write_time_result_t
Write time result used by dnp3_outstation_application_t::write_absolute_time.
Definition: dnp3.h:7572
@ DNP3_WRITE_TIME_RESULT_OK
The write time operation succeeded.
Definition: dnp3.h:7574
@ DNP3_WRITE_TIME_RESULT_NOT_SUPPORTED
Writing time is not supported by this outstation (translated to IIN2.1 OBJECT_UNKNOWN).
Definition: dnp3.h:7578
@ DNP3_WRITE_TIME_RESULT_PARAMETER_ERROR
The request parameters are nonsensical.
Definition: dnp3.h:7576
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 header for use with a READ request.
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:6246
@ DNP3_STATIC_BINARY_OUTPUT_STATUS_VARIATION_GROUP10_VAR2
Binary Output - With flags.
Definition: dnp3.h:6250
@ DNP3_STATIC_BINARY_OUTPUT_STATUS_VARIATION_GROUP10_VAR1
Binary Output - Packed format.
Definition: dnp3.h:6248
static dnp3_utc_timestamp_t dnp3_utc_timestamp_invalid()
Construct an invalid dnp3_utc_timestamp_t.
Definition: dnp3.h:4463
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.
struct dnp3_byte_collection_t dnp3_byte_collection_t
Collection of byte_collection.
Definition: dnp3.h:2102
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.
dnp3_time_attr_t
Enumeration of all the known DNP3 Time attributes.
Definition: dnp3.h:1957
@ DNP3_TIME_ATTR_CONFIG_LAST_CHANGE_DATE
Variation 199 - Time and date that the outstation's configuration was last modified.
Definition: dnp3.h:1963
@ DNP3_TIME_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:1959
@ DNP3_TIME_ATTR_CONFIG_BUILD_DATE
Variation 198 - Time and date that the outstation's current configuration was built defined.
Definition: dnp3.h:1961
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:4279
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)
This method is implemented in terms of dnp3_outstation_create_serial_session_2 but without a port lis...
dnp3_param_error_t dnp3_master_channel_add_udp_association(dnp3_master_channel_t *instance, uint16_t address, const char *destination, 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 a UDP association to the channel.
dnp3_unsigned_integer_t * dnp3_unsigned_integer_iterator_next(dnp3_unsigned_integer_iterator_t *iter)
returns a pointer to the next value or NULL
void dnp3_endpoint_list_add(dnp3_endpoint_list_t *instance, const char *endpoint)
Add an IP endpoint to the list.
static const char * dnp3_bool_attr_to_string(dnp3_bool_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:1937
dnp3_event_mode_t
Controls how events are processed when updating values in the database.
Definition: dnp3.h:5870
@ DNP3_EVENT_MODE_SUPPRESS
Never produce an event regardless of change.
Definition: dnp3.h:5878
@ DNP3_EVENT_MODE_DETECT
Detect events in a type dependent fashion.
Definition: dnp3.h:5874
@ DNP3_EVENT_MODE_FORCE
Produce an event whether the value has changed or not.
Definition: dnp3.h:5876
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:8235
dnp3_param_error_t
Error type used throughout the library.
Definition: dnp3.h:62
@ DNP3_PARAM_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:64
@ DNP3_PARAM_ERROR_OTHER_TLS_ERROR
Other TLS error.
Definition: dnp3.h:110
@ DNP3_PARAM_ERROR_INVALID_PEER_CERTIFICATE
Invalid peer certificate file.
Definition: dnp3.h:102
@ DNP3_PARAM_ERROR_SERVER_ALREADY_STARTED
Server already started.
Definition: dnp3.h:86
@ DNP3_PARAM_ERROR_INVALID_PRIVATE_KEY
Invalid private key file.
Definition: dnp3.h:106
@ DNP3_PARAM_ERROR_INVALID_TIMEOUT
The supplied timeout value is too small or too large.
Definition: dnp3.h:66
@ DNP3_PARAM_ERROR_STRING_NOT_UTF8
Provided string argument is not UTF-8.
Definition: dnp3.h:70
@ DNP3_PARAM_ERROR_ADDRESS_FILTER_CONFLICT
Conflict in the address filter specification.
Definition: dnp3.h:84
@ DNP3_PARAM_ERROR_WRONG_CHANNEL_TYPE
This operation cannot be performed on this channel type.
Definition: dnp3.h:112
@ DNP3_PARAM_ERROR_LOGGING_ALREADY_CONFIGURED
Logging can only be configured once.
Definition: dnp3.h:98
@ DNP3_PARAM_ERROR_INVALID_BUFFER_SIZE
Invalid buffer size.
Definition: dnp3.h:82
@ DNP3_PARAM_ERROR_CONSUMED
This object is consumed and cannot be used again.
Definition: dnp3.h:114
@ DNP3_PARAM_ERROR_ASSOCIATION_DOES_NOT_EXIST
The specified association does not exist.
Definition: dnp3.h:74
@ DNP3_PARAM_ERROR_POINT_DOES_NOT_EXIST
Point does not exist.
Definition: dnp3.h:100
@ DNP3_PARAM_ERROR_SERVER_BIND_ERROR
Server failed to bind to the specified port.
Definition: dnp3.h:88
@ DNP3_PARAM_ERROR_RUNTIME_CANNOT_BLOCK_WITHIN_ASYNC
Runtime cannot execute blocking call within asynchronous context.
Definition: dnp3.h:96
@ DNP3_PARAM_ERROR_INVALID_SOCKET_ADDRESS
Invalid socket address.
Definition: dnp3.h:78
@ DNP3_PARAM_ERROR_NO_SUPPORT
Native library was compiled without support for this feature.
Definition: dnp3.h:72
@ DNP3_PARAM_ERROR_ASSOCIATION_DUPLICATE_ADDRESS
Duplicate association address.
Definition: dnp3.h:76
@ DNP3_PARAM_ERROR_RUNTIME_CREATION_FAILURE
Failed to create Tokio runtime.
Definition: dnp3.h:92
@ DNP3_PARAM_ERROR_INVALID_DNP3_ADDRESS
Invalid link-layer DNP3 address.
Definition: dnp3.h:80
@ DNP3_PARAM_ERROR_MASTER_ALREADY_SHUTDOWN
Master was already shutdown.
Definition: dnp3.h:90
@ DNP3_PARAM_ERROR_NULL_PARAMETER
Null parameter.
Definition: dnp3.h:68
@ DNP3_PARAM_ERROR_RUNTIME_DESTROYED
Runtime has already been disposed.
Definition: dnp3.h:94
@ DNP3_PARAM_ERROR_INVALID_LOCAL_CERTIFICATE
Invalid local certificate file.
Definition: dnp3.h:104
@ DNP3_PARAM_ERROR_INVALID_DNS_NAME
Invalid DNS name.
Definition: dnp3.h:108
dnp3_freeze_result_t
Result of a freeze operation.
Definition: dnp3.h:7619
@ DNP3_FREEZE_RESULT_OK
Freeze operation was successful.
Definition: dnp3.h:7621
@ DNP3_FREEZE_RESULT_PARAMETER_ERROR
The request parameters are nonsensical.
Definition: dnp3.h:7623
@ DNP3_FREEZE_RESULT_NOT_SUPPORTED
The demanded freeze operation is not supported by this device (translated to IIN2....
Definition: dnp3.h:7625
void dnp3_parse_zero_length_strings(bool enabled)
Enable or disable the parsing of zero-length strings, e.g., Group 110/111 Variation 0.
dnp3_port_state_t
State of the serial port.
Definition: dnp3.h:2121
@ DNP3_PORT_STATE_SHUTDOWN
Task has been shut down.
Definition: dnp3.h:2129
@ DNP3_PORT_STATE_WAIT
Waiting to perform an open retry.
Definition: dnp3.h:2125
@ DNP3_PORT_STATE_DISABLED
Disabled until enabled.
Definition: dnp3.h:2123
@ DNP3_PORT_STATE_OPEN
Port is open.
Definition: dnp3.h:2127
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_update_info_t dnp3_database_update_flags(dnp3_database_t *instance, uint16_t index, dnp3_update_flags_type_t flags_type, dnp3_flags_t flags, dnp3_timestamp_t time, dnp3_update_options_t options)
Update the flags for the specified point without changing the value.
dnp3_nothing_t
A single value enum which is used as a placeholder for futures that don't return a value.
Definition: dnp3.h:2084
@ DNP3_NOTHING_NOTHING
The value type is meaningless.
Definition: dnp3.h:2086
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_update_info_t dnp3_database_update_octet_string_2(dnp3_database_t *instance, uint16_t index, dnp3_octet_string_value_t *value, dnp3_update_options_t options)
Update an Octet String point.
dnp3_phys_decode_level_t
Controls how data transmitted at the physical layer (TCP, serial, etc) is logged.
Definition: dnp3.h:333
@ DNP3_PHYS_DECODE_LEVEL_LENGTH
Log only the length of data that is sent and received.
Definition: dnp3.h:337
@ DNP3_PHYS_DECODE_LEVEL_NOTHING
Log nothing.
Definition: dnp3.h:335
@ DNP3_PHYS_DECODE_LEVEL_DATA
Log the length and the actual data that is sent and received.
Definition: dnp3.h:339
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:6528
dnp3_analog_output_command_event_t * dnp3_analog_output_command_event_iterator_next(dnp3_analog_output_command_event_iterator_t *iter)
returns a pointer to the next value or NULL
dnp3_time_format_t
Describes if and how the time will be formatted in log messages.
Definition: dnp3.h:3476
@ DNP3_TIME_FORMAT_NONE
Don't format the timestamp as part of the message.
Definition: dnp3.h:3478
@ DNP3_TIME_FORMAT_SYSTEM
Format the time in a human readable format e.g. 'Jun 25 14:27:12.955'.
Definition: dnp3.h:3482
@ DNP3_TIME_FORMAT_RFC_3339
Format the time using RFC 3339.
Definition: dnp3.h:3480
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.
void dnp3_write_dead_band_request_add_g34v1_u16(dnp3_write_dead_band_request_t *instance, uint16_t index, uint16_t dead_band)
Add a g34v1 (unsigned 16-bit) dead-band with 16-bit indexing to the request.
static dnp3_decode_level_t dnp3_decode_level_nothing()
Initialize log levels to nothing.
Definition: dnp3.h:400
static dnp3_restart_delay_t dnp3_restart_delay_milliseconds(uint16_t value)
RestartDelay with a count of milliseconds.
Definition: dnp3.h:7520
dnp3_time_quality_t
Timestamp quality.
Definition: dnp3.h:694
@ DNP3_TIME_QUALITY_SYNCHRONIZED_TIME
The timestamp is UTC synchronized at the remote device.
Definition: dnp3.h:700
@ DNP3_TIME_QUALITY_INVALID_TIME
Timestamp is not valid, ignore the value and use a local timestamp.
Definition: dnp3.h:706
@ DNP3_TIME_QUALITY_UNSYNCHRONIZED_TIME
The device indicates the timestamp may be not be synchronized.
Definition: dnp3.h:704
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_param_error_t dnp3_outstation_create_tls_client(dnp3_runtime_t *runtime, dnp3_link_error_mode_t link_error_mode, dnp3_endpoint_list_t *endpoints, dnp3_connect_strategy_t connect_strategy, dnp3_connect_options_t *connect_options, dnp3_outstation_config_t config, dnp3_outstation_application_t application, dnp3_outstation_information_t information, dnp3_control_handler_t control_handler, dnp3_client_state_listener_t listener, dnp3_tls_client_config_t tls_config, dnp3_outstation_t **out)
Create an outstation instance running as a TLS client.
dnp3_parity_t
Parity checking modes.
Definition: dnp3.h:2830
@ DNP3_PARITY_EVEN
Parity bit sets even number of 1 bits.
Definition: dnp3.h:2836
@ DNP3_PARITY_ODD
Parity bit sets odd number of 1 bits.
Definition: dnp3.h:2834
@ DNP3_PARITY_NONE
No parity bit.
Definition: dnp3.h:2832
dnp3_connection_info_t * dnp3_connection_info_create()
Create a new ConnectionInfo. You must call set_endpoint() before using it.
dnp3_point_type_t
A type of static point whose events an ASSIGN_CLASS request assigns to a class.
Definition: dnp3.h:7532
@ DNP3_POINT_TYPE_COUNTER
Counters (group 20), whose events are group 22.
Definition: dnp3.h:7540
@ DNP3_POINT_TYPE_DOUBLE_BIT_BINARY_INPUT
Double-bit binary inputs (group 3), whose events are group 4.
Definition: dnp3.h:7536
@ DNP3_POINT_TYPE_OCTET_STRING
Octet strings (group 110), whose events are group 111.
Definition: dnp3.h:7548
@ DNP3_POINT_TYPE_ANALOG_OUTPUT_STATUS
Analog output status (group 40), whose events are group 42.
Definition: dnp3.h:7546
@ DNP3_POINT_TYPE_ANALOG_INPUT
Analog inputs (group 30), whose events are group 32.
Definition: dnp3.h:7544
@ DNP3_POINT_TYPE_BINARY_OUTPUT_STATUS
Binary output status (group 10), whose events are group 11.
Definition: dnp3.h:7538
@ DNP3_POINT_TYPE_BINARY_INPUT
Binary inputs (group 1), whose events are group 2.
Definition: dnp3.h:7534
@ DNP3_POINT_TYPE_FROZEN_COUNTER
Frozen counters (group 21), whose events are group 23.
Definition: dnp3.h:7542
dnp3_transport_decode_level_t
Controls how transmitted and received transport segments are decoded at the INFO log level.
Definition: dnp3.h:283
@ DNP3_TRANSPORT_DECODE_LEVEL_HEADER
Decode the header.
Definition: dnp3.h:287
@ DNP3_TRANSPORT_DECODE_LEVEL_NOTHING
Decode nothing.
Definition: dnp3.h:285
@ DNP3_TRANSPORT_DECODE_LEVEL_PAYLOAD
Decode the header and the raw payload as hexadecimal.
Definition: dnp3.h:289
static dnp3_counter_config_t dnp3_counter_config_init()
Initialize to defaults.
Definition: dnp3.h:6462
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:5067
@ DNP3_COMMAND_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:5089
@ DNP3_COMMAND_ERROR_HEADER_MISMATCH
Number of headers or objects in the response didn't match the number in the request.
Definition: dnp3.h:5073
@ DNP3_COMMAND_ERROR_BAD_ENCODING
request data could not be encoded
Definition: dnp3.h:5091
@ DNP3_COMMAND_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:5083
@ DNP3_COMMAND_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:5075
@ DNP3_COMMAND_ERROR_IIN_ERROR
outstation returned an IIN.2 error bit
Definition: dnp3.h:5077
@ DNP3_COMMAND_ERROR_BAD_STATUS
Outstation indicated that a command was not SUCCESS.
Definition: dnp3.h:5071
@ DNP3_COMMAND_ERROR_UNSUPPORTED_OR_BAD_RESPONSE
response contained objects that are either malformed or valid but not supported by the library (e....
Definition: dnp3.h:5095
@ DNP3_COMMAND_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:5085
@ DNP3_COMMAND_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:5087
@ DNP3_COMMAND_ERROR_UNSUPPORTED_RESPONSE
response contained objects that the library doesn't support, which may be valid DNP3 (e....
Definition: dnp3.h:5093
@ DNP3_COMMAND_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:5081
@ DNP3_COMMAND_ERROR_BAD_RESPONSE
response was malformed or contained unexpected object headers
Definition: dnp3.h:5079
@ DNP3_COMMAND_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:5069
static const char * dnp3_freeze_type_to_string(dnp3_freeze_type_t value)
Converts the enum to a string.
Definition: dnp3.h:7607
static dnp3_binary_input_config_t dnp3_binary_input_config_init()
Initialize to defaults.
Definition: dnp3.h:6072
dnp3_broadcast_action_t
Enumeration describing how the outstation processed a broadcast request.
Definition: dnp3.h:7970
@ DNP3_BROADCAST_ACTION_PROCESSED
Outstation processed the broadcast.
Definition: dnp3.h:7972
@ DNP3_BROADCAST_ACTION_UNSUPPORTED_FUNCTION
Outstation ignore the broadcast message b/c the function is not supported via Broadcast.
Definition: dnp3.h:7978
@ DNP3_BROADCAST_ACTION_IGNORED_BY_CONFIGURATION
Outstation ignored the broadcast message b/c it is disabled by configuration.
Definition: dnp3.h:7974
@ DNP3_BROADCAST_ACTION_BAD_OBJECT_HEADERS
Outstation was unable to parse the object headers and ignored the request.
Definition: dnp3.h:7976
dnp3_param_error_t dnp3_master_channel_write_file_block(dnp3_master_channel_t *instance, dnp3_association_id_t association, uint32_t handle, uint32_t block_number, bool final_block, dnp3_byte_collection_t *block_data, dnp3_file_operation_callback_t callback)
Asynchronously write a block of file data to the outstation.
static const char * dnp3_log_level_to_string(dnp3_log_level_t value)
Converts the enum to a string.
Definition: dnp3.h:3437
dnp3_read_error_t
Errors that can occur during a read operation.
Definition: dnp3.h:4854
@ DNP3_READ_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:4872
@ DNP3_READ_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:4868
@ DNP3_READ_ERROR_UNSUPPORTED_OR_BAD_RESPONSE
response contained objects that are either malformed or valid but not supported by the library (e....
Definition: dnp3.h:4878
@ DNP3_READ_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:4864
@ DNP3_READ_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:4866
@ DNP3_READ_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:4856
@ DNP3_READ_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:4858
@ DNP3_READ_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:4870
@ DNP3_READ_ERROR_BAD_ENCODING
request data could not be encoded
Definition: dnp3.h:4874
@ DNP3_READ_ERROR_UNSUPPORTED_RESPONSE
response contained objects that the library doesn't support, which may be valid DNP3 (e....
Definition: dnp3.h:4876
@ DNP3_READ_ERROR_BAD_RESPONSE
response was malformed or contained unexpected object headers
Definition: dnp3.h:4862
@ DNP3_READ_ERROR_IIN_ERROR
outstation returned an IIN.2 error bit
Definition: dnp3.h:4860
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.
struct dnp3_binary_output_command_event_iterator_t dnp3_binary_output_command_event_iterator_t
Iterator of binary_output_command_event.
Definition: dnp3.h:1189
void dnp3_connect_options_destroy(dnp3_connect_options_t *instance)
Destroy an instance.
static const char * dnp3_attr_def_error_to_string(dnp3_attr_def_error_t value)
Converts the enum to a string.
Definition: dnp3.h:7052
static dnp3_class_zero_config_t dnp3_class_zero_config_init()
Initialize to default values.
Definition: dnp3.h:7285
static const char * dnp3_command_status_to_string(dnp3_command_status_t value)
Converts the enum to a string.
Definition: dnp3.h:205
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:4884
static const char * dnp3_broadcast_action_to_string(dnp3_broadcast_action_t value)
Converts the enum to a string.
Definition: dnp3.h:7984
struct dnp3_binary_input_iterator_t dnp3_binary_input_iterator_t
Iterator of binary_input.
Definition: dnp3.h:847
static const char * dnp3_task_type_to_string(dnp3_task_type_t value)
Converts the enum to a string.
Definition: dnp3.h:4540
static dnp3_analog_input_config_t dnp3_analog_input_config_init()
Initialize to defaults.
Definition: dnp3.h:6776
static const char * dnp3_analog_command_type_to_string(dnp3_analog_command_type_t value)
Converts the enum to a string.
Definition: dnp3.h:1213
struct dnp3_address_filter_t dnp3_address_filter_t
Filters connecting client by their IP address to associate a connecting master with an outstation on ...
Definition: dnp3.h:8583
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:4333
@ DNP3_AUTO_TIME_SYNC_LAN
Perform automatic time sync with Record Current Time (0x18) function code.
Definition: dnp3.h:4337
@ DNP3_AUTO_TIME_SYNC_NONE
Do not perform automatic time sync.
Definition: dnp3.h:4335
@ DNP3_AUTO_TIME_SYNC_NON_LAN
Perform automatic time sync with Delay Measurement (0x17) function code.
Definition: dnp3.h:4339
@ DNP3_AUTO_TIME_SYNC_DIRECT_WRITE_ABS_TIME
Directly write absolute time (g50v1) without delay measurement. WARNING: This is a non-conformant wor...
Definition: dnp3.h:4341
void dnp3_byte_collection_destroy(dnp3_byte_collection_t *instance)
Destroys an instance of the collection.
dnp3_empty_response_error_t
Errors that may occur when performing a request that expects a response with zero object headers.
Definition: dnp3.h:4069
@ DNP3_EMPTY_RESPONSE_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:4071
@ DNP3_EMPTY_RESPONSE_ERROR_BAD_RESPONSE
response was malformed or contained unexpected object headers
Definition: dnp3.h:4079
@ DNP3_EMPTY_RESPONSE_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:4089
@ DNP3_EMPTY_RESPONSE_ERROR_UNSUPPORTED_RESPONSE
response contained objects that the library doesn't support, which may be valid DNP3 (e....
Definition: dnp3.h:4093
@ DNP3_EMPTY_RESPONSE_ERROR_UNSUPPORTED_OR_BAD_RESPONSE
response contained objects that are either malformed or valid but not supported by the library (e....
Definition: dnp3.h:4095
@ DNP3_EMPTY_RESPONSE_ERROR_REJECTED_BY_IIN2
IIN2 indicates request was not completely successful.
Definition: dnp3.h:4073
@ DNP3_EMPTY_RESPONSE_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:4075
@ DNP3_EMPTY_RESPONSE_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:4085
@ DNP3_EMPTY_RESPONSE_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:4087
@ DNP3_EMPTY_RESPONSE_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:4083
@ DNP3_EMPTY_RESPONSE_ERROR_IIN_ERROR
outstation returned an IIN.2 error bit
Definition: dnp3.h:4077
@ DNP3_EMPTY_RESPONSE_ERROR_BAD_ENCODING
request data could not be encoded
Definition: dnp3.h:4091
@ DNP3_EMPTY_RESPONSE_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:4081
static const char * dnp3_time_sync_mode_to_string(dnp3_time_sync_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:5177
dnp3_command_status_t
Enumeration received from an outstation in response to command request.
Definition: dnp3.h:157
@ DNP3_COMMAND_STATUS_ALREADY_ACTIVE
command is all ready in progress or its all ready in that mode (value == 5)
Definition: dnp3.h:169
@ DNP3_COMMAND_STATUS_DOWNSTREAM_FAIL
command not accepted because the outstation is forwarding the request to another downstream device wh...
Definition: dnp3.h:195
@ DNP3_COMMAND_STATUS_TOO_MANY_OPS
the command has been done too often and has been throttled (value == 8)
Definition: dnp3.h:175
@ DNP3_COMMAND_STATUS_SUCCESS
command was accepted, initiated, or queued (value == 0)
Definition: dnp3.h:159
@ DNP3_COMMAND_STATUS_CANCELED
command not accepted because the operation was cancelled (value == 16)
Definition: dnp3.h:191
@ DNP3_COMMAND_STATUS_NO_SELECT
command requires being selected before operate, configuration issue (value == 2)
Definition: dnp3.h:163
@ DNP3_COMMAND_STATUS_NON_PARTICIPATING
(deprecated) indicates the outstation shall not issue or perform the control operation (value == 126)
Definition: dnp3.h:197
@ DNP3_COMMAND_STATUS_LOCAL
the function governed by the control is in local only control (value == 7)
Definition: dnp3.h:173
@ DNP3_COMMAND_STATUS_AUTOMATION_INHIBIT
command not accepted because it was prevented or inhibited by a local automation process,...
Definition: dnp3.h:179
@ DNP3_COMMAND_STATUS_DOWNSTREAM_LOCAL
command not accepted because the outstation is forwarding the request to another downstream device wh...
Definition: dnp3.h:185
@ DNP3_COMMAND_STATUS_PROCESSING_LIMITED
command not accepted because the device cannot process any more activities than are presently in prog...
Definition: dnp3.h:181
@ DNP3_COMMAND_STATUS_TIMEOUT
command timed out before completing (value == 1)
Definition: dnp3.h:161
@ 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:183
@ DNP3_COMMAND_STATUS_NOT_AUTHORIZED
the command was rejected because the device denied it or an RTU intercepted it (value == 9)
Definition: dnp3.h:177
@ DNP3_COMMAND_STATUS_UNKNOWN
captures any value not defined in the enumeration
Definition: dnp3.h:199
@ DNP3_COMMAND_STATUS_FORMAT_ERROR
bad control code or timing values (value == 3)
Definition: dnp3.h:165
@ DNP3_COMMAND_STATUS_NOT_SUPPORTED
command is not implemented (value == 4)
Definition: dnp3.h:167
@ DNP3_COMMAND_STATUS_BLOCKED
command not accepted because the requested function is specifically blocked at the outstation (value ...
Definition: dnp3.h:189
@ DNP3_COMMAND_STATUS_HARDWARE_ERROR
something is stopping the command, often a local/remote interlock (value == 6)
Definition: dnp3.h:171
@ DNP3_COMMAND_STATUS_ALREADY_COMPLETE
command not accepted because the outstation has already completed the requested operation (value == 1...
Definition: dnp3.h:187
@ DNP3_COMMAND_STATUS_BLOCKED_OTHER_MASTER
command not accepted because another master is communicating with the outstation and has exclusive ri...
Definition: dnp3.h:193
static dnp3_classes_t dnp3_classes_all()
Initialize all classes to true.
Definition: dnp3.h:4299
static dnp3_restart_delay_t dnp3_restart_delay_seconds(uint16_t value)
RestartDelay with a count of seconds.
Definition: dnp3.h:7504
dnp3_param_error_t dnp3_accept_handler_accept(dnp3_accept_handler_t *instance, dnp3_link_error_mode_t error_mode, dnp3_master_channel_config_t config)
Accept the connection and create a master channel.
static dnp3_timestamp_t dnp3_timestamp_unsynchronized_timestamp(uint64_t value)
Creates an unsynchronized timestamp struct.
Definition: dnp3.h:775
static const char * dnp3_point_type_to_string(dnp3_point_type_t value)
Converts the enum to a string.
Definition: dnp3.h:7554
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:566
dnp3_static_analog_input_variation_t
Static analog input variation.
Definition: dnp3.h:6658
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR1
Analog Input - 32-bit with flags.
Definition: dnp3.h:6660
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR5
Analog Input - Single-precision floating point with flags.
Definition: dnp3.h:6668
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR2
Analog Input - 16-bit with flags.
Definition: dnp3.h:6662
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR4
Analog Input - 16-bit without flags.
Definition: dnp3.h:6666
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR6
Analog Input - Double-precision floating point with flags.
Definition: dnp3.h:6670
@ DNP3_STATIC_ANALOG_INPUT_VARIATION_GROUP30_VAR3
Analog Input - 32-bit without flags.
Definition: dnp3.h:6664
dnp3_binary_output_command_event_t * dnp3_binary_output_command_event_iterator_next(dnp3_binary_output_command_event_iterator_t *iter)
returns a pointer to the next value or NULL
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:3982
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:918
void dnp3_connection_info_set_timeout(dnp3_connection_info_t *instance, uint64_t timeout_ms)
Set the connection timeout.
dnp3_bool_attr_t
Enumeration of all the known boolean attributes.
Definition: dnp3.h:1911
@ DNP3_BOOL_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:1913
@ DNP3_BOOL_ATTR_SUPPORTS_ANALOG_OUTPUT_EVENTS
Variation 219 - Supports analog output events.
Definition: dnp3.h:1915
@ DNP3_BOOL_ATTR_SUPPORTS_BINARY_OUTPUT_EVENTS
Variation 222 - Supports binary output events.
Definition: dnp3.h:1917
@ DNP3_BOOL_ATTR_SUPPORTS_FROZEN_ANALOG_INPUTS
Variation 230 - Supports frozen analog input events.
Definition: dnp3.h:1925
@ DNP3_BOOL_ATTR_SUPPORTS_FROZEN_COUNTER_EVENTS
Variation 225 - Supports frozen counter events.
Definition: dnp3.h:1919
@ DNP3_BOOL_ATTR_SUPPORTS_FROZEN_COUNTERS
Variation 226 - Supports frozen counters.
Definition: dnp3.h:1921
@ DNP3_BOOL_ATTR_SUPPORTS_BINARY_INPUT_EVENTS
Variation 237 - Support binary input events.
Definition: dnp3.h:1931
@ DNP3_BOOL_ATTR_SUPPORTS_COUNTER_EVENTS
Variation 227 - Supports counter events.
Definition: dnp3.h:1923
@ DNP3_BOOL_ATTR_SUPPORTS_DOUBLE_BIT_BINARY_INPUT_EVENTS
Variation 234 - Supports double-bit binary input events.
Definition: dnp3.h:1929
@ DNP3_BOOL_ATTR_SUPPORTS_ANALOG_INPUT_EVENTS
Variation 231 - Supports analog input events.
Definition: dnp3.h:1927
dnp3_command_set_t * dnp3_command_set_create()
Create a new set of commands.
dnp3_param_error_t dnp3_outstation_create_serial_session_2(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_port_state_listener_t port_listener, dnp3_outstation_t **out)
Create an outstation instance running on a serial port which is tolerant to the serial port being add...
dnp3_command_mode_t
Command operation mode.
Definition: dnp3.h:5045
@ DNP3_COMMAND_MODE_SELECT_BEFORE_OPERATE
Perform a Select and Operate (0x03 then 0x04)
Definition: dnp3.h:5049
@ DNP3_COMMAND_MODE_DIRECT_OPERATE
Perform a Direct Operate (0x05)
Definition: dnp3.h:5047
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:7231
static dnp3_frozen_counter_config_t dnp3_frozen_counter_config_create(dnp3_static_frozen_counter_variation_t static_variation, dnp3_event_frozen_counter_variation_t event_variation, uint32_t deadband)
Fully construct dnp3_frozen_counter_config_t specifying the value of each field.
Definition: dnp3.h:6592
dnp3_param_error_t dnp3_connection_info_set_local_endpoint(dnp3_connection_info_t *instance, const char *local_endpoint)
Set the local endpoint to bind to.
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:8084
static dnp3_dir_read_config_t dnp3_dir_read_config_defaults()
Initialize the configuration to default values.
Definition: dnp3.h:5478
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.
void dnp3_request_add_specific_attribute(dnp3_request_t *instance, uint8_t variation, uint8_t set)
Add a header that reads a specific device attribute (group 0) for use with a READ request.
static dnp3_frozen_analog_input_t dnp3_frozen_analog_input_init(uint16_t index, double value, dnp3_flags_t flags, dnp3_timestamp_t time)
Fully construct dnp3_frozen_analog_input_t specifying the value of each field.
Definition: dnp3.h:1086
static dnp3_file_read_config_t dnp3_file_read_config_defaults()
Initialize the configuration to default values.
Definition: dnp3.h:5450
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:6002
dnp3_time_sync_mode_t
Time synchronization mode.
Definition: dnp3.h:5165
@ DNP3_TIME_SYNC_MODE_DIRECT_WRITE_ABS_TIME
Directly write absolute time (g50v1) without delay measurement. WARNING: This is a non-conformant wor...
Definition: dnp3.h:5171
@ DNP3_TIME_SYNC_MODE_NON_LAN
Perform a non-LAN time sync with Delay Measurement (0x17) function code.
Definition: dnp3.h:5169
@ DNP3_TIME_SYNC_MODE_LAN
Perform a LAN time sync with Record Current Time (0x18) function code.
Definition: dnp3.h:5167
static const char * dnp3_link_read_mode_to_string(dnp3_link_read_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:3407
dnp3_octet_string_attr_t
Enumeration of all known octet-string attributes.
Definition: dnp3.h:1982
@ DNP3_OCTET_STRING_ATTR_CONFIG_DIGEST
Variation 200 - Digest (aka fingerprint) of the configuration using a CRC, HASH, MAC,...
Definition: dnp3.h:1986
@ DNP3_OCTET_STRING_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:1984
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:4598
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:6119
@ DNP3_STATIC_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP3_VAR1
Double-bit Binary Input - Packed format.
Definition: dnp3.h:6121
@ DNP3_STATIC_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP3_VAR2
Double-bit Binary Input - With flags.
Definition: dnp3.h:6123
void dnp3_connect_options_set_timeout(dnp3_connect_options_t *instance, uint64_t timeout)
Set a timeout for the TCP connection that might be less than the default for the OS.
dnp3_static_binary_input_variation_t
Static binary input variation.
Definition: dnp3.h:5992
@ DNP3_STATIC_BINARY_INPUT_VARIATION_GROUP1_VAR2
Binary Input - With flags.
Definition: dnp3.h:5996
@ DNP3_STATIC_BINARY_INPUT_VARIATION_GROUP1_VAR1
Binary Input - Packed format.
Definition: dnp3.h:5994
static dnp3_permission_set_t dnp3_permission_set_none()
Permission set with nothing enabled.
Definition: dnp3.h:3113
static const char * dnp3_event_mode_to_string(dnp3_event_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:5884
dnp3_param_error_t dnp3_connection_info_set_endpoint(dnp3_connection_info_t *instance, const char *endpoint)
Set the endpoint to connect to.
static const char * dnp3_time_attr_to_string(dnp3_time_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:1969
dnp3_update_info_t dnp3_database_update_double_bit_binary_input_2(dnp3_database_t *instance, dnp3_double_bit_binary_input_t value, dnp3_update_options_t options)
Update a Double-Bit Binary Input point.
dnp3_attr_def_error_t dnp3_database_define_float_attr(dnp3_database_t *instance, uint8_t set, bool writable, uint8_t variation, float value)
Define a 32-bit floating point attribute.
dnp3_string_attr_t
Enumeration of all the default string attributes.
Definition: dnp3.h:1727
@ DNP3_STRING_ATTR_DEVICE_MANUFACTURER_SOFTWARE_VERSION
Variation 242 - Device manufacturer software version.
Definition: dnp3.h:1747
@ DNP3_STRING_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:1729
@ DNP3_STRING_ATTR_DEVICE_SERIAL_NUMBER
Variation 248 - Device serial number.
Definition: dnp3.h:1759
@ DNP3_STRING_ATTR_CONFIG_ID
Variation 196 - Configuration id.
Definition: dnp3.h:1731
@ DNP3_STRING_ATTR_USER_ASSIGNED_ID
Variation 246 - User assigned ID code/number.
Definition: dnp3.h:1755
@ DNP3_STRING_ATTR_USER_ASSIGNED_SYSTEM_NAME
Variation 208 - User-assigned system name.
Definition: dnp3.h:1743
@ DNP3_STRING_ATTR_PRODUCT_NAME_AND_MODEL
Variation 250 - Device manufacturer's product name and model.
Definition: dnp3.h:1763
@ DNP3_STRING_ATTR_USER_ASSIGNED_LOCATION
Variation 245 - User assigned location name.
Definition: dnp3.h:1753
@ DNP3_STRING_ATTR_USER_ASSIGNED_PRIMARY_OPERATOR_NAME
Variation 207 - User-assigned primary operator name.
Definition: dnp3.h:1741
@ DNP3_STRING_ATTR_CONFIG_VERSION
Variation 197 - Configuration version.
Definition: dnp3.h:1733
@ DNP3_STRING_ATTR_MASTER_RESOURCE_ID
Variation 202 - Master resource id (mRID)
Definition: dnp3.h:1737
@ DNP3_STRING_ATTR_USER_ASSIGNED_SECONDARY_OPERATOR_NAME
Variation 206 - User-assigned secondary operator name.
Definition: dnp3.h:1739
@ DNP3_STRING_ATTR_CONFIG_DIGEST_ALGORITHM
Variation 201 - Configuration digest algorithm.
Definition: dnp3.h:1735
@ DNP3_STRING_ATTR_DEVICE_SUBSET_AND_CONFORMANCE
Variation 249 - DNP3 subset and conformance.
Definition: dnp3.h:1761
@ DNP3_STRING_ATTR_USER_ASSIGNED_DEVICE_NAME
Variation 247 - User assigned device name.
Definition: dnp3.h:1757
@ DNP3_STRING_ATTR_USER_ASSIGNED_OWNER_NAME
Variation 244 - User-assigned owner name.
Definition: dnp3.h:1751
@ DNP3_STRING_ATTR_DEVICE_MANUFACTURER_HARDWARE_VERSION
Variation 243 - Device manufacturer hardware version.
Definition: dnp3.h:1749
@ DNP3_STRING_ATTR_USER_SPECIFIC_ATTRIBUTES
Variation 211 - Identification of user-specific attributes.
Definition: dnp3.h:1745
@ DNP3_STRING_ATTR_DEVICE_MANUFACTURERS_NAME
Variation 252 - Device manufacturer's name.
Definition: dnp3.h:1765
dnp3_param_error_t dnp3_accept_handler_get_link_identity(dnp3_accept_handler_t *instance)
Request that server attempt to identify the outstation by reading a link-layer header from the physic...
dnp3_event_analog_input_variation_t
Event analog input variation.
Definition: dnp3.h:6692
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR4
Analog Input Event - 16-bit with time.
Definition: dnp3.h:6704
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR8
Analog Input Event - Double-precision floating point with time.
Definition: dnp3.h:6716
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR1
Analog Input Event - 32-bit without time.
Definition: dnp3.h:6694
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR3
Analog Input Event - 32-bit with time.
Definition: dnp3.h:6700
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR2
Analog Input Event - 16-bit without time.
Definition: dnp3.h:6696
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR5
Analog Input Event - Single-precision floating point without time.
Definition: dnp3.h:6706
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR7
Analog Input Event - Single-precision floating point with time.
Definition: dnp3.h:6712
@ DNP3_EVENT_ANALOG_INPUT_VARIATION_GROUP32_VAR6
Analog Input Event - Double-precision floating point without time.
Definition: dnp3.h:6708
static const char * dnp3_uint_attr_to_string(dnp3_uint_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:1854
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:8673
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.
dnp3_param_error_t dnp3_master_channel_create_tls_2(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_connect_options_t *connect_options, 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...
void dnp3_runtime_set_shutdown_timeout(dnp3_runtime_t *instance, uint64_t timeout)
By default, when the runtime shuts down, it does so without a timeout and waits indefinitely for all ...
dnp3_update_info_t dnp3_database_update_frozen_counter_2(dnp3_database_t *instance, dnp3_frozen_counter_t value, dnp3_update_options_t options)
Update an Frozen Counter point.
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:485
@ DNP3_TRIP_CLOSE_CODE_RESERVED
RESERVED (3)
Definition: dnp3.h:493
@ DNP3_TRIP_CLOSE_CODE_CLOSE
CLOSE (1)
Definition: dnp3.h:489
@ DNP3_TRIP_CLOSE_CODE_TRIP
TRIP (2)
Definition: dnp3.h:491
@ DNP3_TRIP_CLOSE_CODE_NUL
NUL (0)
Definition: dnp3.h:487
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 typed used to perform transactions on the database inside of control and freeze callbacks.
Definition: dnp3.h:7160
void dnp3_byte_collection_add(dnp3_byte_collection_t *instance, uint8_t value)
Add a value to the collection.
void dnp3_runtime_destroy(dnp3_runtime_t *instance)
Destroy a runtime.
dnp3_param_error_t dnp3_master_channel_send_and_expect_empty_response(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_function_code_t function, dnp3_request_t *headers, dnp3_empty_response_callback_t callback)
Send the specified request to the association using the supplied function and collection of request h...
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 ...
dnp3_connect_options_t * dnp3_connect_options_create()
Initialize to the defaults.
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).
dnp3_param_error_t dnp3_master_channel_read_directory(dnp3_master_channel_t *instance, dnp3_association_id_t association, const char *dir_path, dnp3_dir_read_config_t config, dnp3_read_directory_callback_t callback)
Asynchronously retrieve a directory listing.
static dnp3_double_bit_binary_input_config_t dnp3_double_bit_binary_input_config_create(dnp3_static_double_bit_binary_input_variation_t static_variation, dnp3_event_double_bit_binary_input_variation_t event_variation)
Fully construct dnp3_double_bit_binary_input_config_t specifying the value of each field.
Definition: dnp3.h:6183
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_update_result_t
Defines what occurred during an update operation and which fields of dnp3_update_info_t are valid.
Definition: dnp3.h:5828
@ DNP3_UPDATE_RESULT_NO_POINT
No point exists for this type and index.
Definition: dnp3.h:5830
@ DNP3_UPDATE_RESULT_CREATED
An event was created with the specified id.
Definition: dnp3.h:5834
@ DNP3_UPDATE_RESULT_OVERFLOW
An event was created with the specified, but inserting it caused an event to be discarded.
Definition: dnp3.h:5836
@ DNP3_UPDATE_RESULT_NO_EVENT
The point exists, but the update did not create an event.
Definition: dnp3.h:5832
dnp3_static_counter_variation_t
Static counter variation.
Definition: dnp3.h:6368
@ DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR6
Counter - 16-bit without flags.
Definition: dnp3.h:6376
@ DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR2
Counter - 16-bit with flags.
Definition: dnp3.h:6372
@ DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR5
Counter - 32-bit without flags.
Definition: dnp3.h:6374
@ DNP3_STATIC_COUNTER_VARIATION_GROUP20_VAR1
Counter - 32-bit with flags.
Definition: dnp3.h:6370
dnp3_function_code_t
Application layer function code.
Definition: dnp3.h:2939
@ DNP3_FUNCTION_CODE_RESPONSE
Master shall interpret this fragment as an Application Layer response to an ApplicationLayer request ...
Definition: dnp3.h:3003
@ DNP3_FUNCTION_CODE_FREEZE_CLEAR_NO_RESPONSE
Same as FreezeClear but outstation shall not send a response (value == 10)
Definition: dnp3.h:2961
@ DNP3_FUNCTION_CODE_UNSOLICITED_RESPONSE
Master shall interpret this fragment as an unsolicited response that was not prompted by an explicit ...
Definition: dnp3.h:3005
@ 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:2959
@ DNP3_FUNCTION_CODE_FREEZE_AT_TIME_NO_RESPONSE
Same as FreezeAtTime but outstation shall not send a response (value == 12)
Definition: dnp3.h:2965
@ 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:2955
@ DNP3_FUNCTION_CODE_STOP_APPLICATION
Outstation shall stop running the applications specified by the objects in the request (value == 18)
Definition: dnp3.h:2977
@ DNP3_FUNCTION_CODE_ENABLE_UNSOLICITED
Enables outstation to initiate unsolicited responses from points specified by the objects in the requ...
Definition: dnp3.h:2981
@ 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:2989
@ DNP3_FUNCTION_CODE_SAVE_CONFIGURATION
This code is deprecated-Do not use for new designs (value == 19)
Definition: dnp3.h:2979
@ DNP3_FUNCTION_CODE_INITIALIZE_DATA
Obsolete-Do not use for new designs (value == 15)
Definition: dnp3.h:2971
@ DNP3_FUNCTION_CODE_CLOSE_FILE
Outstation shall close a file (value == 26)
Definition: dnp3.h:2993
@ DNP3_FUNCTION_CODE_START_APPLICATION
Outstation shall start running the applications specified by the objects in the request (value == 17)
Definition: dnp3.h:2975
@ 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:2963
@ 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:2973
@ DNP3_FUNCTION_CODE_WRITE
Outstation shall store the data specified by the objects in the request (value == 2)
Definition: dnp3.h:2945
@ DNP3_FUNCTION_CODE_OPERATE
Outstation shall activate the output points selected (or armed) by a previous select function code co...
Definition: dnp3.h:2949
@ DNP3_FUNCTION_CODE_WARM_RESTART
Outstation shall reset only portions of the device (value == 14)
Definition: dnp3.h:2969
@ 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:2987
@ DNP3_FUNCTION_CODE_DELETE_FILE
Outstation shall delete a file (value == 27)
Definition: dnp3.h:2995
@ DNP3_FUNCTION_CODE_ABORT_FILE
Outstation shall abort a file transfer operation (value == 30)
Definition: dnp3.h:3001
@ DNP3_FUNCTION_CODE_SELECT
Outstation shall select (or arm) the output points specified by the objects in the request in prepara...
Definition: dnp3.h:2947
@ DNP3_FUNCTION_CODE_COLD_RESTART
Outstation shall perform a complete reset of all hardware and software in the device (value == 13)
Definition: dnp3.h:2967
@ 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:2985
@ DNP3_FUNCTION_CODE_IMMEDIATE_FREEZE_NO_RESPONSE
Same as ImmediateFreeze but outstation shall not send a response (value == 8)
Definition: dnp3.h:2957
@ DNP3_FUNCTION_CODE_GET_FILE_INFO
Outstation shall retrieve information about a file (value == 28)
Definition: dnp3.h:2997
@ DNP3_FUNCTION_CODE_DIRECT_OPERATE_NO_RESPONSE
Same as DirectOperate but outstation shall not send a response (value == 6)
Definition: dnp3.h:2953
@ DNP3_FUNCTION_CODE_READ
Outstation shall return the data specified by the objects in the request (value == 1)
Definition: dnp3.h:2943
@ DNP3_FUNCTION_CODE_AUTHENTICATE_FILE
Outstation shall return a file authentication key (value == 29)
Definition: dnp3.h:2999
@ DNP3_FUNCTION_CODE_DIRECT_OPERATE
Outstation shall immediately actuate the output points specified by the objects in the request (value...
Definition: dnp3.h:2951
@ DNP3_FUNCTION_CODE_OPEN_FILE
Outstation shall open a file (value == 25)
Definition: dnp3.h:2991
@ DNP3_FUNCTION_CODE_CONFIRM
Master sends this to an outstation to confirm the receipt of an Application Layer fragment (value == ...
Definition: dnp3.h:2941
@ DNP3_FUNCTION_CODE_DISABLE_UNSOLICITED
Prevents outstation from initiating unsolicited responses from points specified by the objects in the...
Definition: dnp3.h:2983
dnp3_client_state_t
State of the client connection.
Definition: dnp3.h:2166
@ DNP3_CLIENT_STATE_CONNECTING
Client is trying to establish a connection to the remote device.
Definition: dnp3.h:2170
@ DNP3_CLIENT_STATE_DISABLED
Client is disabled and idle until enabled.
Definition: dnp3.h:2168
@ DNP3_CLIENT_STATE_CONNECTED
Client is connected to the remote device.
Definition: dnp3.h:2172
@ DNP3_CLIENT_STATE_WAIT_AFTER_DISCONNECT
Client was disconnected, waiting before retrying.
Definition: dnp3.h:2176
@ DNP3_CLIENT_STATE_SHUTDOWN
Client is shutting down.
Definition: dnp3.h:2178
@ DNP3_CLIENT_STATE_WAIT_AFTER_FAILED_CONNECT
Failed to establish a connection, waiting before retrying.
Definition: dnp3.h:2174
static const char * dnp3_restart_error_to_string(dnp3_restart_error_t value)
Converts the enum to a string.
Definition: dnp3.h:5319
static dnp3_counter_config_t dnp3_counter_config_create(dnp3_static_counter_variation_t static_variation, dnp3_event_counter_variation_t event_variation, uint32_t deadband)
Fully construct dnp3_counter_config_t specifying the value of each field.
Definition: dnp3.h:6444
static dnp3_retry_strategy_t dnp3_retry_strategy_init()
Initialize to defaults.
Definition: dnp3.h:2765
dnp3_op_type_t
Operation Type field, used in conjunction with dnp3_trip_close_code_t to specify a control operation.
Definition: dnp3.h:513
@ DNP3_OP_TYPE_PULSE_OFF
PULSE_OFF (2)
Definition: dnp3.h:519
@ DNP3_OP_TYPE_LATCH_ON
LATCH_ON (3)
Definition: dnp3.h:521
@ DNP3_OP_TYPE_NUL
NUL (0)
Definition: dnp3.h:515
@ DNP3_OP_TYPE_PULSE_ON
PULSE_ON (1)
Definition: dnp3.h:517
@ DNP3_OP_TYPE_LATCH_OFF
LATCH_OFF(4)
Definition: dnp3.h:523
static dnp3_serial_settings_t dnp3_serial_settings_init()
Initialize to default values.
Definition: dnp3.h:2902
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 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:6030
dnp3_attr_def_error_t
Errors that can occur when defining attributes.
Definition: dnp3.h:7034
@ DNP3_ATTR_DEF_ERROR_RESERVED_VARIATION
Variation is reserved and cannot be defined.
Definition: dnp3.h:7040
@ DNP3_ATTR_DEF_ERROR_NOT_WRITABLE
This attribute cannot be configured as writable.
Definition: dnp3.h:7044
@ DNP3_ATTR_DEF_ERROR_BAD_TYPE
The type does not match the required type in set 0.
Definition: dnp3.h:7042
@ DNP3_ATTR_DEF_ERROR_ALREADY_DEFINED
Attribute has already been defined.
Definition: dnp3.h:7038
@ DNP3_ATTR_DEF_ERROR_BAD_VALUE
The value cannot be encoded, e.g. a string longer than 255 bytes.
Definition: dnp3.h:7046
@ DNP3_ATTR_DEF_ERROR_OK
attribute defined successfully
Definition: dnp3.h:7036
void dnp3_write_dead_band_request_destroy(dnp3_write_dead_band_request_t *instance)
Destroy a request created with dnp3_write_dead_band_request_create.
void dnp3_disable_client_tcp_no_delay()
By default, TCP_NODELAY is set to true for all client TCP/TLS connections. This disables Nagle's algo...
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:3464
dnp3_attr_def_error_t dnp3_database_define_bool_attr(dnp3_database_t *instance, uint8_t set, bool writable, uint8_t variation, bool value)
Define a boolean attribute which is mapped to an unsigned integer internally.
dnp3_param_error_t dnp3_master_channel_read_file_with_auth(dnp3_master_channel_t *instance, dnp3_association_id_t association, const char *remote_file_path, dnp3_file_read_config_t config, dnp3_file_reader_t reader, const char *user_name, const char *password)
Start an operation to READ a file from the outstation using a dnp3_file_reader_t to receive data.
struct dnp3_next_endpoint_action_t dnp3_next_endpoint_action_t
Action object used by ClientConnectionHandler.next() to specify the next connection attempt or sleep ...
Definition: dnp3.h:8326
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:4568
@ DNP3_TASK_ERROR_BAD_ENCODING
request data could not be encoded
Definition: dnp3.h:4586
@ DNP3_TASK_ERROR_SYSTEM_TIME_NOT_AVAILABLE
the master had no system time to synchronize the outstation with, because dnp3_association_handler_t:...
Definition: dnp3.h:4592
@ DNP3_TASK_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:4576
@ DNP3_TASK_ERROR_UNSUPPORTED_OR_BAD_RESPONSE
response contained objects that are either malformed or valid but not supported by the library (e....
Definition: dnp3.h:4590
@ DNP3_TASK_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:4584
@ DNP3_TASK_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:4570
@ DNP3_TASK_ERROR_IIN_ERROR
outstation returned an IIN.2 error bit
Definition: dnp3.h:4572
@ DNP3_TASK_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:4582
@ DNP3_TASK_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:4578
@ DNP3_TASK_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:4580
@ DNP3_TASK_ERROR_UNSUPPORTED_RESPONSE
response contained objects that the library doesn't support, which may be valid DNP3 (e....
Definition: dnp3.h:4588
@ DNP3_TASK_ERROR_BAD_RESPONSE
response was malformed or contained unexpected object headers
Definition: dnp3.h:4574
dnp3_link_decode_level_t
Controls how transmitted and received link frames are decoded at the INFO log level.
Definition: dnp3.h:308
@ DNP3_LINK_DECODE_LEVEL_HEADER
Decode the header.
Definition: dnp3.h:312
@ DNP3_LINK_DECODE_LEVEL_PAYLOAD
Decode the header and the raw payload as hexadecimal.
Definition: dnp3.h:314
@ DNP3_LINK_DECODE_LEVEL_NOTHING
Decode nothing.
Definition: dnp3.h:310
dnp3_update_flags_type_t
Point type on which to update the flags.
Definition: dnp3.h:5943
@ DNP3_UPDATE_FLAGS_TYPE_FROZEN_COUNTER
Frozen counter.
Definition: dnp3.h:5953
@ DNP3_UPDATE_FLAGS_TYPE_COUNTER
Counter.
Definition: dnp3.h:5951
@ DNP3_UPDATE_FLAGS_TYPE_BINARY_INPUT
Binary input.
Definition: dnp3.h:5945
@ DNP3_UPDATE_FLAGS_TYPE_ANALOG_INPUT
Analog input.
Definition: dnp3.h:5955
@ DNP3_UPDATE_FLAGS_TYPE_BINARY_OUTPUT_STATUS
Binary output status.
Definition: dnp3.h:5949
@ DNP3_UPDATE_FLAGS_TYPE_ANALOG_OUTPUT_STATUS
Analog output status.
Definition: dnp3.h:5957
@ DNP3_UPDATE_FLAGS_TYPE_DOUBLE_BIT_BINARY_INPUT
Doubl-bit binary input.
Definition: dnp3.h:5947
static dnp3_link_id_config_t dnp3_link_id_config_init()
Initialize to default values.
Definition: dnp3.h:5794
dnp3_update_info_t dnp3_database_update_counter_2(dnp3_database_t *instance, dnp3_counter_t value, dnp3_update_options_t options)
Update a Counter point.
static const char * dnp3_string_attr_to_string(dnp3_string_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:1771
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:2652
dnp3_event_class_t
Event class.
Definition: dnp3.h:2701
@ DNP3_EVENT_CLASS_CLASS1
Class 1 event.
Definition: dnp3.h:2705
@ DNP3_EVENT_CLASS_CLASS2
Class 2 event.
Definition: dnp3.h:2707
@ DNP3_EVENT_CLASS_CLASS3
Class 3 event.
Definition: dnp3.h:2709
@ DNP3_EVENT_CLASS_NONE
Does not generate events.
Definition: dnp3.h:2703
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:6129
static const char * dnp3_read_type_to_string(dnp3_read_type_t value)
Converts the enum to a string.
Definition: dnp3.h:3749
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:6840
dnp3_param_error_t dnp3_connect_options_set_local_endpoint(dnp3_connect_options_t *instance, const char *endpoint)
Set the local address to which the socket is bound.
static const char * dnp3_time_quality_to_string(dnp3_time_quality_t value)
Converts the enum to a string.
Definition: dnp3.h:712
static const char * dnp3_nothing_to_string(dnp3_nothing_t value)
Converts the enum to a string.
Definition: dnp3.h:2092
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.
void dnp3_request_add_uint_attribute(dnp3_request_t *instance, uint8_t variation, uint8_t set, uint32_t value)
Add a header that writes an unsigned integer device attribute (group 0) for use with a WRITE request.
struct dnp3_runtime_t dnp3_runtime_t
Handle to the underlying runtime.
Definition: dnp3.h:413
static dnp3_logging_config_t dnp3_logging_config_init()
Initialize the configuration to default values.
Definition: dnp3.h:3524
static const char * dnp3_link_decode_level_to_string(dnp3_link_decode_level_t value)
Converts the enum to a string.
Definition: dnp3.h:320
void dnp3_request_add_time_and_interval(dnp3_request_t *instance, uint64_t time, uint32_t interval_ms)
Add a single g51v1 time-and-interval.
static const char * dnp3_param_error_to_string(dnp3_param_error_t value)
Converts the enum to a string.
Definition: dnp3.h:120
struct dnp3_double_bit_binary_input_iterator_t dnp3_double_bit_binary_input_iterator_t
Iterator of double_bit_binary_input.
Definition: dnp3.h:889
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_permissions_t dnp3_permissions_init(dnp3_permission_set_t world, dnp3_permission_set_t group, dnp3_permission_set_t owner)
Fully construct dnp3_permissions_t specifying the value of each field.
Definition: dnp3.h:3142
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:586
dnp3_class_count_t dnp3_database_discard_unselected_events(dnp3_database_t *instance, dnp3_event_classes_t classes)
Discard undelivered events of the given classes from the event buffer.
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:4319
static const char * dnp3_transport_decode_level_to_string(dnp3_transport_decode_level_t value)
Converts the enum to a string.
Definition: dnp3.h:295
dnp3_link_read_mode_t
Controls how the link-layer parser treats frames that span multiple calls to read of the physical lay...
Definition: dnp3.h:3397
@ DNP3_LINK_READ_MODE_DATAGRAM
Reading datagrams (UDP) where link-layer frames MAY NOT span separate calls to read.
Definition: dnp3.h:3401
@ DNP3_LINK_READ_MODE_STREAM
Reading from a stream (TCP, serial, etc.) where link-layer frames MAY span separate calls to read.
Definition: dnp3.h:3399
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.
static dnp3_analog_output_command_event_t dnp3_analog_output_command_event_init(uint16_t index, dnp3_command_status_t status, double commanded_value, dnp3_analog_command_type_t command_type, dnp3_timestamp_t time)
Fully construct dnp3_analog_output_command_event_t specifying the value of each field.
Definition: dnp3.h:1255
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 header for use with a READ request.
dnp3_udp_socket_mode_t
Describes how the UDP socket reads and writes datagrams from remote endpoint(s)
Definition: dnp3.h:3371
@ DNP3_UDP_SOCKET_MODE_ONE_TO_ONE
The UDP endpoint will only communicate with the specified remote endpoint.
Definition: dnp3.h:3373
@ DNP3_UDP_SOCKET_MODE_ONE_TO_MANY
The UDP endpoint will accept packets any remote endpoint.
Definition: dnp3.h:3377
dnp3_event_counter_variation_t
Event counter variation.
Definition: dnp3.h:6396
@ DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR5
Counter Event - 32-bit with time.
Definition: dnp3.h:6404
@ DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR2
Counter Event - 16-bit without time.
Definition: dnp3.h:6400
@ DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR1
Counter Event - 32-bit without time.
Definition: dnp3.h:6398
@ DNP3_EVENT_COUNTER_VARIATION_GROUP22_VAR6
Counter Event - 16-bit with time.
Definition: dnp3.h:6408
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:6510
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR9
Frozen Counter - 32-bit without flags.
Definition: dnp3.h:6520
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR6
Frozen Counter - 16-bit with flags and time.
Definition: dnp3.h:6518
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR2
Frozen Counter - 16-bit with flags.
Definition: dnp3.h:6514
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR1
Frozen Counter - 32-bit with flags.
Definition: dnp3.h:6512
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR10
Frozen Counter - 16-bit without flags.
Definition: dnp3.h:6522
@ DNP3_STATIC_FROZEN_COUNTER_VARIATION_GROUP21_VAR5
Frozen Counter - 32-bit with flags and time.
Definition: dnp3.h:6516
static dnp3_binary_output_status_config_t dnp3_binary_output_status_config_init()
Initialize to defaults.
Definition: dnp3.h:6321
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:6141
@ DNP3_EVENT_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP4_VAR3
Double-bit Binary Input Event - With relative time.
Definition: dnp3.h:6151
@ DNP3_EVENT_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP4_VAR1
Double-bit Binary Input Event - Without time.
Definition: dnp3.h:6143
@ DNP3_EVENT_DOUBLE_BIT_BINARY_INPUT_VARIATION_GROUP4_VAR2
Double-bit Binary Input Event - With absolute time.
Definition: dnp3.h:6147
dnp3_response_function_t
Type of response.
Definition: dnp3.h:3566
@ DNP3_RESPONSE_FUNCTION_UNSOLICITED_RESPONSE
Unsolicited response.
Definition: dnp3.h:3570
@ DNP3_RESPONSE_FUNCTION_RESPONSE
Solicited response.
Definition: dnp3.h:3568
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:1420
dnp3_param_error_t dnp3_master_channel_read_directory_with_auth(dnp3_master_channel_t *instance, dnp3_association_id_t association, const char *dir_path, dnp3_dir_read_config_t config, const char *user_name, const char *password, dnp3_read_directory_callback_t callback)
Asynchronously retrieve a directory listing by first obtaining an authentication key.
dnp3_param_error_t dnp3_outstation_enable(dnp3_outstation_t *instance)
enable communications
dnp3_int_attr_t
Enumeration of all the default integer attributes.
Definition: dnp3.h:1890
@ DNP3_INT_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:1892
static dnp3_analog_input_dead_band_t dnp3_analog_input_dead_band_init(uint16_t index, double value)
Fully construct dnp3_analog_input_dead_band_t specifying the value of each field.
Definition: dnp3.h:1330
static dnp3_analog_input_config_t dnp3_analog_input_config_create(dnp3_static_analog_input_variation_t static_variation, dnp3_event_analog_input_variation_t event_variation, double deadband)
Fully construct dnp3_analog_input_config_t specifying the value of each field.
Definition: dnp3.h:6758
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:6854
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR2
Analog Output Event - 16-bit without time.
Definition: dnp3.h:6858
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR5
Analog Output Event - Single-precision floating point without time.
Definition: dnp3.h:6868
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR8
Analog Output Event - Double-precision floating point with time.
Definition: dnp3.h:6878
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR7
Analog Output Event - Single-precision floating point with time.
Definition: dnp3.h:6874
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR3
Analog Output Event - 32-bit with time.
Definition: dnp3.h:6862
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR4
Analog Output Event - 16-bit with time.
Definition: dnp3.h:6866
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR6
Analog Output Event - Double-precision floating point without time.
Definition: dnp3.h:6870
@ DNP3_EVENT_ANALOG_OUTPUT_STATUS_VARIATION_GROUP42_VAR1
Analog Output Event - 32-bit without time.
Definition: dnp3.h:6856
static const char * dnp3_restart_delay_type_to_string(dnp3_restart_delay_type_t value)
Converts the enum to a string.
Definition: dnp3.h:7457
dnp3_attr_def_error_t dnp3_database_define_uint_attr(dnp3_database_t *instance, uint8_t set, bool writable, uint8_t variation, uint32_t value)
Define an unsigned integer attribute.
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:5190
@ DNP3_TIME_SYNC_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:5214
@ DNP3_TIME_SYNC_ERROR_UNSUPPORTED_OR_BAD_RESPONSE
response contained objects that are either malformed or valid but not supported by the library (e....
Definition: dnp3.h:5226
@ DNP3_TIME_SYNC_ERROR_UNSUPPORTED_RESPONSE
response contained objects that the library doesn't support, which may be valid DNP3 (e....
Definition: dnp3.h:5224
@ DNP3_TIME_SYNC_ERROR_BAD_ENCODING
request data could not be encoded
Definition: dnp3.h:5222
@ DNP3_TIME_SYNC_ERROR_IIN_ERROR
outstation returned an IIN.2 error bit
Definition: dnp3.h:5208
@ DNP3_TIME_SYNC_ERROR_OVERFLOW
Overflow in calculation.
Definition: dnp3.h:5200
@ DNP3_TIME_SYNC_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:5206
@ DNP3_TIME_SYNC_ERROR_STILL_NEEDS_TIME
Outstation did not clear the NEED_TIME IIN bit.
Definition: dnp3.h:5202
@ DNP3_TIME_SYNC_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:5192
@ DNP3_TIME_SYNC_ERROR_SYSTEM_TIME_NOT_UNIX
The system time cannot be converted to a Unix timestamp.
Definition: dnp3.h:5196
@ DNP3_TIME_SYNC_ERROR_BAD_RESPONSE
response was malformed or contained unexpected object headers
Definition: dnp3.h:5210
@ DNP3_TIME_SYNC_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:5212
@ DNP3_TIME_SYNC_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:5216
@ DNP3_TIME_SYNC_ERROR_BAD_OUTSTATION_TIME_DELAY
Outstation time delay exceeded the response delay.
Definition: dnp3.h:5198
@ DNP3_TIME_SYNC_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:5218
@ DNP3_TIME_SYNC_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:5220
@ DNP3_TIME_SYNC_ERROR_CLOCK_ROLLBACK
Detected a clock rollback.
Definition: dnp3.h:5194
@ DNP3_TIME_SYNC_ERROR_SYSTEM_TIME_NOT_AVAILABLE
System time not available.
Definition: dnp3.h:5204
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:834
static dnp3_analog_output_status_config_t dnp3_analog_output_status_config_init()
Initialize to defaults.
Definition: dnp3.h:6938
dnp3_app_decode_level_t
Controls how transmitted and received application-layer fragments are decoded at the INFO log level.
Definition: dnp3.h:255
@ DNP3_APP_DECODE_LEVEL_NOTHING
Decode nothing.
Definition: dnp3.h:257
@ DNP3_APP_DECODE_LEVEL_OBJECT_VALUES
Decode the header, the object headers, and the object values.
Definition: dnp3.h:263
@ DNP3_APP_DECODE_LEVEL_OBJECT_HEADERS
Decode the header and the object headers.
Definition: dnp3.h:261
@ DNP3_APP_DECODE_LEVEL_HEADER
Decode the header-only.
Definition: dnp3.h:259
static const char * dnp3_client_state_to_string(dnp3_client_state_t value)
Converts the enum to a string.
Definition: dnp3.h:2184
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:2791
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).
struct dnp3_accept_handler_t dnp3_accept_handler_t
Class used to accept a connection, reject it, or defer it to link identification.
Definition: dnp3.h:5699
void dnp3_connection_info_clear_local_endpoint(dnp3_connection_info_t *instance)
Clear any previously configured local endpoint so the OS chooses the interface and port.
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:4447
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_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:960
static const char * dnp3_static_counter_variation_to_string(dnp3_static_counter_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:6382
dnp3_file_error_t
Errors that can occur during file transfer.
Definition: dnp3.h:3191
@ DNP3_FILE_ERROR_BAD_ENCODING
request data could not be encoded
Definition: dnp3.h:3223
@ DNP3_FILE_ERROR_ABORT_BY_USER
File transfer aborted by user.
Definition: dnp3.h:3201
@ DNP3_FILE_ERROR_BAD_STATUS
Outstation returned an error status code.
Definition: dnp3.h:3195
@ DNP3_FILE_ERROR_WRONG_HANDLE
File handle returned by the outstation did not match the request.
Definition: dnp3.h:3205
@ DNP3_FILE_ERROR_OK
Success, i.e. no error occurred.
Definition: dnp3.h:3193
@ DNP3_FILE_ERROR_RESPONSE_TIMEOUT
timeout occurred before receiving a response
Definition: dnp3.h:3213
@ DNP3_FILE_ERROR_UNSUPPORTED_RESPONSE
response contained objects that the library doesn't support, which may be valid DNP3 (e....
Definition: dnp3.h:3225
@ DNP3_FILE_ERROR_MAX_LENGTH_EXCEEDED
Exceeded the maximum length specified by the user.
Definition: dnp3.h:3203
@ DNP3_FILE_ERROR_ASSOCIATION_REMOVED
association was removed mid-task
Definition: dnp3.h:3221
@ DNP3_FILE_ERROR_BAD_RESPONSE
response was malformed or contained unexpected object headers
Definition: dnp3.h:3211
@ DNP3_FILE_ERROR_SHUTDOWN
master was shutdown
Definition: dnp3.h:3219
@ DNP3_FILE_ERROR_UNSUPPORTED_OR_BAD_RESPONSE
response contained objects that are either malformed or valid but not supported by the library (e....
Definition: dnp3.h:3227
@ DNP3_FILE_ERROR_TOO_MANY_REQUESTS
too many user requests queued
Definition: dnp3.h:3207
@ DNP3_FILE_ERROR_NO_PERMISSION
Outstation indicated no permission to access file.
Definition: dnp3.h:3197
@ DNP3_FILE_ERROR_IIN_ERROR
outstation returned an IIN.2 error bit
Definition: dnp3.h:3209
@ DNP3_FILE_ERROR_NO_CONNECTION
no connection
Definition: dnp3.h:3217
@ DNP3_FILE_ERROR_WRITE_ERROR
insufficient buffer space to serialize the request
Definition: dnp3.h:3215
@ DNP3_FILE_ERROR_BAD_BLOCK_NUM
Received an unexpected block number.
Definition: dnp3.h:3199
static const char * dnp3_empty_response_error_to_string(dnp3_empty_response_error_t value)
Converts the enum to a string.
Definition: dnp3.h:4101
dnp3_octet_string_t * dnp3_octet_string_iterator_next(dnp3_octet_string_iterator_t *iter)
returns a pointer to the next value or NULL
dnp3_param_error_t dnp3_master_channel_read_file(dnp3_master_channel_t *instance, dnp3_association_id_t association, const char *remote_file_path, dnp3_file_read_config_t config, dnp3_file_reader_t reader)
Start an operation to READ a file from the outstation using a dnp3_file_reader_t to receive data.
bool dnp3_database_remove_octet_string(dnp3_database_t *instance, uint16_t index)
Remove an Octet String point.
dnp3_param_error_t dnp3_master_channel_create_tcp_2(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_connect_options_t *connect_options, dnp3_client_state_listener_t listener, dnp3_master_channel_t **out)
Create a master channel that connects to the specified TCP endpoint(s)
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:1057
static const char * dnp3_trip_close_code_to_string(dnp3_trip_close_code_t value)
Converts the enum to a string.
Definition: dnp3.h:499
dnp3_static_analog_output_status_variation_t
Static analog output status variation.
Definition: dnp3.h:6826
@ DNP3_STATIC_ANALOG_OUTPUT_STATUS_VARIATION_GROUP40_VAR2
Analog Output Status - 16-bit with flags.
Definition: dnp3.h:6830
@ DNP3_STATIC_ANALOG_OUTPUT_STATUS_VARIATION_GROUP40_VAR1
Analog Output Status - 32-bit with flags.
Definition: dnp3.h:6828
@ DNP3_STATIC_ANALOG_OUTPUT_STATUS_VARIATION_GROUP40_VAR3
Analog Output Status - Single-precision floating point with flags.
Definition: dnp3.h:6832
@ DNP3_STATIC_ANALOG_OUTPUT_STATUS_VARIATION_GROUP40_VAR4
Analog Output Status - Double-precision floating point with flags.
Definition: dnp3.h:6834
struct dnp3_write_dead_band_request_t dnp3_write_dead_band_request_t
Define a custom request to WRITE analog input dead-bands.
Definition: dnp3.h:4002
dnp3_link_error_mode_t
Controls how errors in parsed link-layer frames are handled. This behavior is configurable for physic...
Definition: dnp3.h:2917
@ 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:2919
@ DNP3_LINK_ERROR_MODE_CLOSE
Framing errors are bubbled up to calling code, closing the session. Suitable for physical layers that...
Definition: dnp3.h:2921
dnp3_stop_bits_t
Number of stop bits.
Definition: dnp3.h:2855
@ DNP3_STOP_BITS_TWO
Two stop bits.
Definition: dnp3.h:2859
@ DNP3_STOP_BITS_ONE
One stop bit.
Definition: dnp3.h:2857
dnp3_update_info_t dnp3_database_update_analog_output_status_2(dnp3_database_t *instance, dnp3_analog_output_status_t value, dnp3_update_options_t options)
Update a Analog Output Status point.
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:6544
@ DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR5
Frozen Counter Event - 32-bit with time.
Definition: dnp3.h:6552
@ DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR2
Frozen Counter Event - 16-bit without time.
Definition: dnp3.h:6548
@ DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR6
Frozen Counter Event - 16-bit with time.
Definition: dnp3.h:6556
@ DNP3_EVENT_FROZEN_COUNTER_VARIATION_GROUP23_VAR1
Frozen Counter Event - 32-bit without time.
Definition: dnp3.h:6546
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:7584
static const char * dnp3_stop_bits_to_string(dnp3_stop_bits_t value)
Converts the enum to a string.
Definition: dnp3.h:2865
dnp3_param_error_t dnp3_master_channel_open_file(dnp3_master_channel_t *instance, dnp3_association_id_t association, const char *file_name, uint32_t auth_key, dnp3_permissions_t permissions, uint32_t file_size, dnp3_file_mode_t file_mode, uint16_t max_block_size, dnp3_file_open_callback_t callback)
Asynchronously open a file.
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:6280
dnp3_param_error_t dnp3_master_channel_create_udp(dnp3_runtime_t *runtime, dnp3_master_channel_config_t config, const char *local_endpoint, dnp3_link_read_mode_t link_read_mode, uint64_t retry_delay, dnp3_master_channel_t **out)
Create a UDP master channel on the local endpoint.
dnp3_param_error_t dnp3_master_channel_operate_no_ack(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_command_set_t *command, dnp3_command_task_callback_t callback)
Asynchronously perform a DIRECT_OPERATE_NO_ACK (0x06) command operation on the association.
dnp3_param_error_t dnp3_create_master_tcp_server(dnp3_runtime_t *runtime, const char *local_addr, dnp3_link_id_config_t link_id_config, dnp3_connection_handler_t connection_handler, dnp3_master_server_t **out)
Spawn a TCP server that accepts connections from outstations.
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.
dnp3_param_error_t dnp3_identified_link_handler_accept(dnp3_identified_link_handler_t *instance, dnp3_link_error_mode_t error_mode, dnp3_master_channel_config_t config)
Accept the connection and create a master channel.
dnp3_attr_def_error_t dnp3_database_define_int_attr(dnp3_database_t *instance, uint8_t set, bool writable, uint8_t variation, int32_t value)
Define a signed integer attribute.
dnp3_file_type_t
File type enumeration used in Group 70 objects.
Definition: dnp3.h:3054
@ DNP3_FILE_TYPE_SIMPLE
File is a simple file type suitable for sequential file transfer.
Definition: dnp3.h:3058
@ DNP3_FILE_TYPE_DIRECTORY
File is a directory.
Definition: dnp3.h:3056
@ DNP3_FILE_TYPE_OTHER
Some other unspecified value.
Definition: dnp3.h:3060
void dnp3_write_dead_band_request_add_g34v3_u8(dnp3_write_dead_band_request_t *instance, uint8_t index, float dead_band)
Add a g34v3 (single-precision floating point) dead-band with 8-bit indexing to the request.
static const char * dnp3_bit_string_attr_to_string(dnp3_bit_string_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:2012
dnp3_write_dead_band_request_t * dnp3_write_dead_band_request_create()
A builder class to create one or more headers of analog input dead-bands.
struct dnp3_analog_input_dead_band_iterator_t dnp3_analog_input_dead_band_iterator_t
Iterator of analog_input_dead_band.
Definition: dnp3.h:1341
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.
dnp3_param_error_t dnp3_outstation_create_udp(dnp3_runtime_t *runtime, dnp3_outstation_udp_config_t udp_config, 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 that communicates over UDP.
static const char * dnp3_qualifier_code_to_string(dnp3_qualifier_code_t value)
Converts the enum to a string.
Definition: dnp3.h:3684
dnp3_param_error_t dnp3_outstation_create_tls_client_with_handler(dnp3_runtime_t *runtime, dnp3_link_error_mode_t link_error_mode, const char *span_name, dnp3_outstation_config_t config, dnp3_outstation_application_t application, dnp3_outstation_information_t information, dnp3_control_handler_t control_handler, dnp3_client_state_listener_t listener, dnp3_client_connection_handler_t connection_handler, dnp3_tls_client_config_t tls_config, dnp3_outstation_t **out)
Create an outstation instance running as a TLS client with fine-grained connection management.
static dnp3_binary_output_status_config_t dnp3_binary_output_status_config_create(dnp3_static_binary_output_status_variation_t static_variation, dnp3_event_binary_output_status_variation_t event_variation)
Fully construct dnp3_binary_output_status_config_t specifying the value of each field.
Definition: dnp3.h:6305
struct dnp3_database_t dnp3_database_t
Internal database access.
Definition: dnp3.h:5824
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:1570
static const char * dnp3_time_format_to_string(dnp3_time_format_t value)
Converts the enum to a string.
Definition: dnp3.h:3488
dnp3_freeze_type_t
Freeze operation type.
Definition: dnp3.h:7597
@ 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:7601
@ DNP3_FREEZE_TYPE_IMMEDIATE_FREEZE
Copy the current value of a counter to the associated point.
Definition: dnp3.h:7599
static dnp3_runtime_config_t dnp3_runtime_config_init()
Initialize the configuration to default values.
Definition: dnp3.h:432
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:2842
dnp3_data_bits_t
Number of bits per character.
Definition: dnp3.h:2777
@ DNP3_DATA_BITS_FIVE
5 bits per character
Definition: dnp3.h:2779
@ DNP3_DATA_BITS_SEVEN
7 bits per character
Definition: dnp3.h:2783
@ DNP3_DATA_BITS_EIGHT
8 bits per character
Definition: dnp3.h:2785
@ DNP3_DATA_BITS_SIX
6 bits per character
Definition: dnp3.h:2781
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.
struct dnp3_frozen_analog_input_iterator_t dnp3_frozen_analog_input_iterator_t
Iterator of frozen_analog_input.
Definition: dnp3.h:1099
static const char * dnp3_int_attr_to_string(dnp3_int_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:1898
static const char * dnp3_port_state_to_string(dnp3_port_state_t value)
Converts the enum to a string.
Definition: dnp3.h:2135
dnp3_attr_item_t * dnp3_attr_item_iter_next(dnp3_attr_item_iter_t *iter)
returns a pointer to the next value or NULL
static dnp3_event_classes_t dnp3_event_classes_none()
Initialize all classes to false.
Definition: dnp3.h:2688
struct dnp3_master_server_t dnp3_master_server_t
Class with methods used to spawn servers.
Definition: dnp3.h:5770
static dnp3_double_bit_binary_input_config_t dnp3_double_bit_binary_input_config_init()
Initialize to defaults.
Definition: dnp3.h:6199
static const char * dnp3_octet_string_attr_to_string(dnp3_octet_string_attr_t value)
Converts the enum to a string.
Definition: dnp3.h:1992
dnp3_connection_state_t
Outstation connection state for connection-oriented transports, e.g. TCP.
Definition: dnp3.h:8225
@ DNP3_CONNECTION_STATE_CONNECTED
Connected to the master.
Definition: dnp3.h:8227
@ DNP3_CONNECTION_STATE_DISCONNECTED
Disconnected from the master.
Definition: dnp3.h:8229
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:5915
dnp3_analog_input_t * dnp3_analog_input_iterator_next(dnp3_analog_input_iterator_t *iter)
returns a pointer to the next value or NULL
dnp3_analog_command_type_t
Describes the encoding of the commanded value.
Definition: dnp3.h:1199
@ DNP3_ANALOG_COMMAND_TYPE_I32
16-bit integer
Definition: dnp3.h:1203
@ DNP3_ANALOG_COMMAND_TYPE_I16
16-bit integer
Definition: dnp3.h:1201
@ DNP3_ANALOG_COMMAND_TYPE_F64
double-precision floating point
Definition: dnp3.h:1207
@ DNP3_ANALOG_COMMAND_TYPE_F32
single-precision floating point
Definition: dnp3.h:1205
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:5931
dnp3_qualifier_code_t
Qualifier code used in the response.
Definition: dnp3.h:3662
@ DNP3_QUALIFIER_CODE_RANGE16
16-bit start stop (0x01)
Definition: dnp3.h:3666
@ DNP3_QUALIFIER_CODE_COUNT16
16-bit count (0x08)
Definition: dnp3.h:3672
@ DNP3_QUALIFIER_CODE_COUNT_AND_PREFIX_16
16-bit count and prefix (0x28)
Definition: dnp3.h:3676
@ DNP3_QUALIFIER_CODE_ALL_OBJECTS
All objects (0x06)
Definition: dnp3.h:3668
@ DNP3_QUALIFIER_CODE_RANGE8
8-bit start stop (0x00)
Definition: dnp3.h:3664
@ DNP3_QUALIFIER_CODE_COUNT_AND_PREFIX_8
8-bit count and prefix (0x17)
Definition: dnp3.h:3674
@ DNP3_QUALIFIER_CODE_FREE_FORMAT_16
16-bit free format (0x5B)
Definition: dnp3.h:3678
@ DNP3_QUALIFIER_CODE_COUNT8
8-bit count (0x07)
Definition: dnp3.h:3670
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:7419
static const char * dnp3_event_counter_variation_to_string(dnp3_event_counter_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:6414
static const char * dnp3_certificate_mode_to_string(dnp3_certificate_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:1518
struct dnp3_frozen_counter_iterator_t dnp3_frozen_counter_iterator_t
Iterator of frozen_counter.
Definition: dnp3.h:1015
static const char * dnp3_app_decode_level_to_string(dnp3_app_decode_level_t value)
Converts the enum to a string.
Definition: dnp3.h:269
struct dnp3_byte_iterator_t dnp3_byte_iterator_t
Iterator of uint8_t.
Definition: dnp3.h:1350
dnp3_param_error_t dnp3_outstation_create_tcp_client_with_handler(dnp3_runtime_t *runtime, dnp3_link_error_mode_t link_error_mode, const char *span_name, dnp3_outstation_config_t config, dnp3_outstation_application_t application, dnp3_outstation_information_t information, dnp3_control_handler_t control_handler, dnp3_client_state_listener_t listener, dnp3_client_connection_handler_t connection_handler, dnp3_outstation_t **out)
Create an outstation instance running as a TCP client with fine-grained connection management.
static dnp3_frozen_counter_config_t dnp3_frozen_counter_config_init()
Initialize to defaults.
Definition: dnp3.h:6610
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:931
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.
dnp3_update_info_t dnp3_database_update_analog_input_2(dnp3_database_t *instance, dnp3_analog_input_t value, dnp3_update_options_t options)
Update a AnalogInput point.
dnp3_float_attr_t
Enumeration of all known float attributes.
Definition: dnp3.h:2023
@ DNP3_FLOAT_ATTR_DEVICE_LOCATION_LATITUDE
Variation 205 - Latitude of the device from the equator (90.0 to -90.0 deg)
Definition: dnp3.h:2031
@ DNP3_FLOAT_ATTR_DEVICE_LOCATION_LONGITUDE
Variation 204 - Longitude of the device from reference meridian (-180.0 to 180.0 deg)
Definition: dnp3.h:2029
@ DNP3_FLOAT_ATTR_DEVICE_LOCATION_ALTITUDE
Variation 203 - Altitude of the device.
Definition: dnp3.h:2027
@ DNP3_FLOAT_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:2025
static const char * dnp3_auto_time_sync_to_string(dnp3_auto_time_sync_t value)
Converts the enum to a string.
Definition: dnp3.h:4347
dnp3_task_type_t
Task type used in dnp3_association_information_t.
Definition: dnp3.h:4494
@ DNP3_TASK_TYPE_USER_READ
User-defined read request.
Definition: dnp3.h:4496
@ DNP3_TASK_TYPE_FILE_WRITE_BLOCK
Write a file block to the outstation.
Definition: dnp3.h:4532
@ DNP3_TASK_TYPE_GENERIC_EMPTY_RESPONSE
Generic request that expects an empty response.
Definition: dnp3.h:4518
@ DNP3_TASK_TYPE_DISABLE_UNSOLICITED
Disable unsolicited startup request.
Definition: dnp3.h:4510
@ DNP3_TASK_TYPE_PERIODIC_POLL
Periodic poll task.
Definition: dnp3.h:4498
@ DNP3_TASK_TYPE_FILE_READ
Read a file or directory from the outstation.
Definition: dnp3.h:4524
@ DNP3_TASK_TYPE_ENABLE_UNSOLICITED
Enable unsolicited startup request.
Definition: dnp3.h:4508
@ DNP3_TASK_TYPE_RESTART
Cold or warm restart task.
Definition: dnp3.h:4514
@ DNP3_TASK_TYPE_COMMAND
Command request.
Definition: dnp3.h:4504
@ DNP3_TASK_TYPE_FILE_OPEN
Open a file on the outstation.
Definition: dnp3.h:4530
@ DNP3_TASK_TYPE_CLEAR_RESTART_BIT
Clear RESTART IIN bit.
Definition: dnp3.h:4506
@ DNP3_TASK_TYPE_STARTUP_INTEGRITY
Startup integrity scan.
Definition: dnp3.h:4500
@ DNP3_TASK_TYPE_AUTO_EVENT_SCAN
Automatic event scan caused by the event class IIN bits (IIN1.1 - IIN1.3) indicating that events are ...
Definition: dnp3.h:4502
@ DNP3_TASK_TYPE_FILE_CLOSE
Close a file on the outstation.
Definition: dnp3.h:4534
@ DNP3_TASK_TYPE_WRITE_DEAD_BANDS
Write analog input dead-bands.
Definition: dnp3.h:4516
@ DNP3_TASK_TYPE_FILE_AUTH
Send username and password and get back an auth key from the outstation.
Definition: dnp3.h:4528
@ DNP3_TASK_TYPE_TIME_SYNC
Time synchronisation task.
Definition: dnp3.h:4512
@ DNP3_TASK_TYPE_GET_FILE_INFO
Get information about a file.
Definition: dnp3.h:4526
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:639
struct dnp3_attr_item_iter_t dnp3_attr_item_iter_t
Iterator of attr_item.
Definition: dnp3.h:2074
struct dnp3_octet_string_iterator_t dnp3_octet_string_iterator_t
Iterator of octet_string.
Definition: dnp3.h:1384
static const char * dnp3_response_function_to_string(dnp3_response_function_t value)
Converts the enum to a string.
Definition: dnp3.h:3576
dnp3_analog_input_dead_band_t * dnp3_analog_input_dead_band_iterator_next(dnp3_analog_input_dead_band_iterator_t *iter)
returns a pointer to the next value or NULL
void dnp3_write_dead_band_request_add_g34v3_u16(dnp3_write_dead_band_request_t *instance, uint16_t index, float dead_band)
Add a g34v3 (single-precision floating point) dead-band with 16-bit indexing to the request.
dnp3_log_output_format_t
Describes how each log event is formatted.
Definition: dnp3.h:3454
@ DNP3_LOG_OUTPUT_FORMAT_JSON
Output formatted as JSON.
Definition: dnp3.h:3458
@ DNP3_LOG_OUTPUT_FORMAT_TEXT
A simple text-based format.
Definition: dnp3.h:3456
static const char * dnp3_variation_to_string(dnp3_variation_t value)
Converts the enum to a string.
Definition: dnp3.h:2491
void dnp3_connection_info_destroy(dnp3_connection_info_t *instance)
Destroy a ConnectionInfo instance.
dnp3_log_level_t
Log level.
Definition: dnp3.h:3421
@ DNP3_LOG_LEVEL_DEBUG
Debugging log level.
Definition: dnp3.h:3429
@ DNP3_LOG_LEVEL_TRACE
Trace log level.
Definition: dnp3.h:3431
@ DNP3_LOG_LEVEL_WARN
Warning log level.
Definition: dnp3.h:3425
@ DNP3_LOG_LEVEL_ERROR
Error log level.
Definition: dnp3.h:3423
@ DNP3_LOG_LEVEL_INFO
Information log level.
Definition: dnp3.h:3427
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:1128
static const char * dnp3_udp_socket_mode_to_string(dnp3_udp_socket_mode_t value)
Converts the enum to a string.
Definition: dnp3.h:3383
static const char * dnp3_freeze_result_to_string(dnp3_freeze_result_t value)
Converts the enum to a string.
Definition: dnp3.h:7631
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.
dnp3_param_error_t dnp3_master_channel_write_dead_bands(dnp3_master_channel_t *instance, dnp3_association_id_t association, dnp3_write_dead_band_request_t *request, dnp3_empty_response_callback_t callback)
Perform a WRITE on the association using the supplied collection of dead-band headers.
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.
struct dnp3_connect_options_t dnp3_connect_options_t
Options that control how TCP connections are established.
Definition: dnp3.h:1393
static dnp3_binary_output_command_event_t dnp3_binary_output_command_event_init(uint16_t index, dnp3_command_status_t status, bool commanded_state, dnp3_timestamp_t time)
Fully construct dnp3_binary_output_command_event_t specifying the value of each field.
Definition: dnp3.h:1176
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.
void dnp3_write_dead_band_request_add_g34v1_u8(dnp3_write_dead_band_request_t *instance, uint8_t index, uint16_t dead_band)
Add a g34v1 (unsigned 16-bit) dead-band with 8-bit indexing to the request.
static dnp3_timestamp_t dnp3_timestamp_invalid_timestamp()
Creates an invalid timestamp struct.
Definition: dnp3.h:743
struct dnp3_command_set_t dnp3_command_set_t
Builder type used to construct command requests.
Definition: dnp3.h:4968
dnp3_flow_control_t
Flow control modes.
Definition: dnp3.h:2805
@ DNP3_FLOW_CONTROL_HARDWARE
Flow control using RTS/CTS signals.
Definition: dnp3.h:2811
@ DNP3_FLOW_CONTROL_SOFTWARE
Flow control using XON/XOFF bytes.
Definition: dnp3.h:2809
@ DNP3_FLOW_CONTROL_NONE
No flow control.
Definition: dnp3.h:2807
static dnp3_permission_set_t dnp3_permission_set_init(bool execute, bool write, bool read)
Fully construct dnp3_permission_set_t specifying the value of each field.
Definition: dnp3.h:3095
static const char * dnp3_file_error_to_string(dnp3_file_error_t value)
Converts the enum to a string.
Definition: dnp3.h:3233
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:6562
static dnp3_flags_t dnp3_flags_init(uint8_t value)
Fully construct dnp3_flags_t specifying the value of each field.
Definition: dnp3.h:683
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.
void dnp3_connection_info_clear_timeout(dnp3_connection_info_t *instance)
Clear any previously configured timeout so the OS default is used.
static dnp3_decode_level_t dnp3_decode_level_init()
Initialize log levels to defaults.
Definition: dnp3.h:380
dnp3_file_info_t * dnp3_file_info_iterator_next(dnp3_file_info_iterator_t *iter)
returns a pointer to the next value or NULL
dnp3_update_info_t dnp3_database_update_binary_input_2(dnp3_database_t *instance, dnp3_binary_input_t value, dnp3_update_options_t options)
Update a BinaryInput point.
dnp3_param_error_t dnp3_connection_info_set_master_address(dnp3_connection_info_t *instance, uint16_t address)
Change the master address for this and all subsequent connections.
dnp3_variation_list_attr_t
Enumeration of all the variation list attributes.
Definition: dnp3.h:1705
@ DNP3_VARIATION_LIST_ATTR_LIST_OF_VARIATIONS
Variation 255 - List of attribute variations.
Definition: dnp3.h:1709
@ DNP3_VARIATION_LIST_ATTR_UNKNOWN
The attribute variation is not defined or is not part of the default set.
Definition: dnp3.h:1707
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:659
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:6742
double deadband
Deadband value.
Definition: dnp3.h:6750
dnp3_static_analog_input_variation_t static_variation
Default static variation.
Definition: dnp3.h:6744
dnp3_event_analog_input_variation_t event_variation
Default event variation.
Definition: dnp3.h:6746
Analog input deadband corresponding to group 34.
Definition: dnp3.h:1317
uint16_t index
Index of the analog input.
Definition: dnp3.h:1319
double value
Deadband of the analog input.
Definition: dnp3.h:1323
analog_input point
Definition: dnp3.h:1027
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:1035
uint16_t index
Point index.
Definition: dnp3.h:1029
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:1033
double value
Point value.
Definition: dnp3.h:1031
Event transferred from master to outstation when the outstation receives a corresponding command.
Definition: dnp3.h:1233
uint16_t index
Index of the command event.
Definition: dnp3.h:1235
dnp3_analog_command_type_t command_type
Describes how the value was encoded in the protocol.
Definition: dnp3.h:1243
double commanded_value
Commanded state of the binary output.
Definition: dnp3.h:1241
dnp3_timestamp_t time
Associated timestamp.
Definition: dnp3.h:1245
dnp3_command_status_t status
Status from processing the command that triggered this event.
Definition: dnp3.h:1237
Analog Output Status configuration.
Definition: dnp3.h:6904
double deadband
Deadband value.
Definition: dnp3.h:6912
dnp3_static_analog_output_status_variation_t static_variation
Default static variation.
Definition: dnp3.h:6906
dnp3_event_analog_output_status_variation_t event_variation
Default event variation.
Definition: dnp3.h:6908
analog_output_status point
Definition: dnp3.h:1111
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:1119
uint16_t index
Point index.
Definition: dnp3.h:1113
double value
Point value.
Definition: dnp3.h:1115
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:1117
Application-controlled IIN bits.
Definition: dnp3.h:7646
bool local_control
IIN1.5 - Some output points are in local mode.
Definition: dnp3.h:7650
bool device_trouble
IIN1.6 - Device trouble.
Definition: dnp3.h:7652
bool config_corrupt
IIN2.5 - Configuration corrupt.
Definition: dnp3.h:7654
bool need_time
IIN1.4 - Time synchronization is required.
Definition: dnp3.h:7648
Association configuration.
Definition: dnp3.h:4363
dnp3_event_classes_t disable_unsol_classes
Classes to disable unsolicited responses at startup.
Definition: dnp3.h:4368
bool auto_integrity_scan_on_buffer_overflow
Automatic integrity scan when an EVENT_BUFFER_OVERFLOW is detected.
Definition: dnp3.h:4385
uint64_t response_timeout
Timeout for receiving a response on this association.
Definition: dnp3.h:4366
dnp3_auto_time_sync_t auto_time_sync
Automatic time synchronization configuration.
Definition: dnp3.h:4376
uint64_t keep_alive_timeout
Delay of inactivity before sending a REQUEST_LINK_STATUS to the outstation.
Definition: dnp3.h:4383
dnp3_event_classes_t enable_unsol_classes
Classes to enable unsolicited responses at startup.
Definition: dnp3.h:4370
dnp3_event_classes_t event_scan_on_events_available
Classes to automatically send reads when the IIN bit is asserted.
Definition: dnp3.h:4387
dnp3_retry_strategy_t auto_tasks_retry_strategy
Automatic tasks retry strategy.
Definition: dnp3.h:4378
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:4389
dnp3_classes_t startup_integrity_classes
Startup integrity classes to ask on master startup and when an outstation restart is detected.
Definition: dnp3.h:4374
Callbacks for a particular outstation association.
Definition: dnp3.h:4475
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:4487
dnp3_utc_timestamp_t(* get_current_time)(void *)
Returns the current time or an invalid time if none is available.
Definition: dnp3.h:4484
void * ctx
Context data.
Definition: dnp3.h:4489
Association identifier.
Definition: dnp3.h:4240
uint16_t address
Outstation address of the association.
Definition: dnp3.h:4242
Informational callbacks about the current state of an outstation association.
Definition: dnp3.h:4620
void(* unsolicited_response)(bool, uint8_t, void *)
Called when an unsolicited response is received.
Definition: dnp3.h:4648
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:4651
void(* task_success)(dnp3_task_type_t, dnp3_function_code_t, uint8_t, void *)
Called when a task successfully completes.
Definition: dnp3.h:4636
void * ctx
Context data.
Definition: dnp3.h:4653
void(* task_start)(dnp3_task_type_t, dnp3_function_code_t, uint8_t, void *)
Called when a new task is started.
Definition: dnp3.h:4627
void(* task_fail)(dnp3_task_type_t, dnp3_task_error_t, void *)
Called when a task fails.
Definition: dnp3.h:4642
An attribute variation and properties pair returned in Group0Var255.
Definition: dnp3.h:2065
dnp3_attr_prop_t properties
Properties of the attribute.
Definition: dnp3.h:2069
uint8_t variation
Variation of the attribute.
Definition: dnp3.h:2067
Attribute properties returned in Group0Var255.
Definition: dnp3.h:2055
bool is_writable
Indicate if the property can be used in a WRITE operation.
Definition: dnp3.h:2057
Binary Input configuration.
Definition: dnp3.h:6045
dnp3_static_binary_input_variation_t static_variation
Default static variation.
Definition: dnp3.h:6047
dnp3_event_binary_input_variation_t event_variation
Default event variation.
Definition: dnp3.h:6049
binary_input point
Definition: dnp3.h:817
uint16_t index
Point index.
Definition: dnp3.h:819
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:823
bool value
Point value.
Definition: dnp3.h:821
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:825
Event transferred from master to outstation when the outstation receives a corresponding command.
Definition: dnp3.h:1157
bool commanded_state
Commanded state of the binary output.
Definition: dnp3.h:1165
dnp3_command_status_t status
Status from processing the command that triggered this event.
Definition: dnp3.h:1161
dnp3_timestamp_t time
Associated timestamp.
Definition: dnp3.h:1167
uint16_t index
Index of the binary command event.
Definition: dnp3.h:1159
Binary Output Status configuration.
Definition: dnp3.h:6294
dnp3_event_binary_output_status_variation_t event_variation
Default event variation.
Definition: dnp3.h:6298
dnp3_static_binary_output_status_variation_t static_variation
Default static variation.
Definition: dnp3.h:6296
binary_output_status point
Definition: dnp3.h:901
bool value
Point value.
Definition: dnp3.h:905
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:907
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:909
uint16_t index
Point index.
Definition: dnp3.h:903
Information about the state of buffer after a CONFIRM has been processed.
Definition: dnp3.h:7706
dnp3_class_count_t classes
Remaining number of events in the buffer on a per-class basis.
Definition: dnp3.h:7708
dnp3_type_count_t types
Remaining number of events in the buffer on a per-type basis.
Definition: dnp3.h:7710
A count of events on a per-class basis.
Definition: dnp3.h:2731
uint32_t num_class_1
Number of class 1 events.
Definition: dnp3.h:2733
uint32_t num_class_2
Number of class 2 events.
Definition: dnp3.h:2735
uint32_t num_class_3
Number of class 3 events.
Definition: dnp3.h:2737
Controls which types are reported during a Class 0 read.
Definition: dnp3.h:7251
bool frozen_counter
Include Frozen Counters in Class 0 reads.
Definition: dnp3.h:7261
bool analog_output_status
Include Analog Output Status in Class 0 reads.
Definition: dnp3.h:7265
bool counter
Include Counters in Class 0 reads.
Definition: dnp3.h:7259
bool analog
Include Analog Inputs in Class 0 reads.
Definition: dnp3.h:7263
bool octet_string
Include Octet Strings in Class 0 reads.
Definition: dnp3.h:7269
bool binary_output_status
Include Binary Output Status in Class 0 reads.
Definition: dnp3.h:7257
bool binary
Include Binary Inputs in Class 0 reads.
Definition: dnp3.h:7253
bool double_bit_binary
Include Double-Bit Binary Inputs in Class 0 reads.
Definition: dnp3.h:7255
Class 0, 1, 2 and 3 config.
Definition: dnp3.h:4262
bool class3
Class 3 events.
Definition: dnp3.h:4270
bool class1
Class 1 events.
Definition: dnp3.h:4266
bool class2
Class 2 events.
Definition: dnp3.h:4268
bool class0
Class 0 (static data)
Definition: dnp3.h:4264
Provides fine-grained control over how TCP and TLS clients connect to endpoints.
Definition: dnp3.h:8343
void(* connecting)(const char *, const char *, void *)
Notification that a connection attempt is being made.
Definition: dnp3.h:8356
void(* next)(dnp3_next_endpoint_action_t *, void *)
Called to get the next endpoint to connect to or to sleep for a duration. Use the provided action obj...
Definition: dnp3.h:8378
uint64_t(* disconnected)(const char *, const char *, void *)
Notification that a previously successful connection failed. The task will sleep for the specified du...
Definition: dnp3.h:8350
void * ctx
Context data.
Definition: dnp3.h:8383
void(* resolution_failed)(const char *, void *)
Notification that DNS resolution failed.
Definition: dnp3.h:8373
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:8381
void(* connected)(const char *, const char *, void *)
Notification that a connection attempt succeeded.
Definition: dnp3.h:8368
void(* connect_failed)(const char *, const char *, void *)
Notification that connection operation failed.
Definition: dnp3.h:8362
Callback for monitoring the client TCP connection state.
Definition: dnp3.h:2200
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:2208
void(* on_change)(dnp3_client_state_t, void *)
Called when the client state changed.
Definition: dnp3.h:2205
void * ctx
Context data.
Definition: dnp3.h:2210
Handler for command tasks.
Definition: dnp3.h:5126
void(* on_failure)(dnp3_command_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:5136
void * ctx
Context data.
Definition: dnp3.h:5141
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5139
void(* on_complete)(dnp3_nothing_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:5131
Timing parameters for connection attempts.
Definition: dnp3.h:1445
uint64_t max_connect_delay
Maximum delay between two connection attempts.
Definition: dnp3.h:1451
uint64_t min_connect_delay
Minimum delay between two connection attempts, doubles up to the maximum delay.
Definition: dnp3.h:1448
uint64_t reconnect_delay
Delay before attempting a connection after a disconnect.
Definition: dnp3.h:1454
Callbacks to user code that determine how the server processes connections.
Definition: dnp3.h:5729
void(* accept_with_link_id)(const char *, uint16_t, uint16_t, dnp3_identified_link_handler_t *, void *)
Filter the connection based on the source and destination of the first link-layer frame.
Definition: dnp3.h:5751
void(* accept)(const char *, dnp3_accept_handler_t *, void *)
Filter the connection solely based on the remote address.
Definition: dnp3.h:5735
void * ctx
Context data.
Definition: dnp3.h:5766
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5764
void(* start)(const char *, dnp3_master_channel_t *, void *)
Start a communication session that was previously accepted using only the socket address.
Definition: dnp3.h:5743
void(* start_with_link_id)(const char *, uint16_t, uint16_t, dnp3_master_channel_t *, void *)
Start a communication session that was previously accepted using link identity information.
Definition: dnp3.h:5761
Callback interface for connection state events.
Definition: dnp3.h:8247
void(* on_change)(dnp3_connection_state_t, void *)
Called when the connection state changes.
Definition: dnp3.h:8252
void * ctx
Context data.
Definition: dnp3.h:8257
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:8255
CROB (dnp3_group12_var1_t) control code.
Definition: dnp3.h:546
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:554
bool queue
This field is obsolete and should always be 0.
Definition: dnp3.h:552
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:548
bool clear
Support for this field is optional. When the clear bit is set, the device shall remove pending contro...
Definition: dnp3.h:550
APDU Control field.
Definition: dnp3.h:469
bool fin
Final fragment of the message.
Definition: dnp3.h:473
bool uns
Unsolicited response.
Definition: dnp3.h:477
uint8_t seq
Sequence number.
Definition: dnp3.h:479
bool fir
First fragment in the message.
Definition: dnp3.h:471
bool con
Requires confirmation.
Definition: dnp3.h:475
Callbacks for handling controls.
Definition: dnp3.h:8101
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:8173
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:8185
void * ctx
Context data.
Definition: dnp3.h:8220
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:8131
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:8143
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:8218
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:8206
void(* end_fragment)(dnp3_database_handle_t *, void *)
Notifies the end of a command fragment.
Definition: dnp3.h:8110
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:8215
void(* begin_fragment)(void *)
Notifies the start of a command fragment.
Definition: dnp3.h:8105
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:8194
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:8164
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:8122
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:8152
Counter configuration.
Definition: dnp3.h:6430
dnp3_static_counter_variation_t static_variation
Default static variation.
Definition: dnp3.h:6432
dnp3_event_counter_variation_t event_variation
Default event variation.
Definition: dnp3.h:6434
uint32_t deadband
Deadband value.
Definition: dnp3.h:6436
counter point
Definition: dnp3.h:943
uint16_t index
Point index.
Definition: dnp3.h:945
uint32_t value
Point value.
Definition: dnp3.h:947
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:949
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:951
Database transaction interface.
Definition: dnp3.h:7144
void(* execute)(dnp3_database_t *, void *)
Execute a transaction on the provided database.
Definition: dnp3.h:7149
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:7152
void * ctx
Context data.
Definition: dnp3.h:7154
Controls the decoding of transmitted and received data at the application, transport,...
Definition: dnp3.h:360
dnp3_transport_decode_level_t transport
Controls transport segment layer decoding.
Definition: dnp3.h:364
dnp3_phys_decode_level_t physical
Controls the logging of physical layer read/write.
Definition: dnp3.h:368
dnp3_link_decode_level_t link
Controls link frame decoding.
Definition: dnp3.h:366
dnp3_app_decode_level_t application
Controls application fragment decoding.
Definition: dnp3.h:362
Configuration related to reading a file.
Definition: dnp3.h:5464
uint32_t max_file_size
Maximum number of bytes that may be accumulated while reading directory information.
Definition: dnp3.h:5468
uint16_t max_block_size
Maximum block size requested by the master during the file open.
Definition: dnp3.h:5466
Double-Bit Binary Input configuration.
Definition: dnp3.h:6172
dnp3_static_double_bit_binary_input_variation_t static_variation
Default static variation.
Definition: dnp3.h:6174
dnp3_event_double_bit_binary_input_variation_t event_variation
Default event variation.
Definition: dnp3.h:6176
double_bit_binary_input point
Definition: dnp3.h:859
dnp3_double_bit_t value
Point value.
Definition: dnp3.h:863
uint16_t index
Point index.
Definition: dnp3.h:861
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:867
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:865
Callback interface for any task that expects an empty response.
Definition: dnp3.h:4125
void(* on_failure)(dnp3_empty_response_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:4135
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:4138
void(* on_complete)(dnp3_nothing_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:4130
void * ctx
Context data.
Definition: dnp3.h:4140
Maximum number of events for each type.
Definition: dnp3.h:7174
uint16_t max_counter
Maximum number of Counter events (g22)
Definition: dnp3.h:7182
uint16_t max_analog
Maximum number of Analog Input events (g32)
Definition: dnp3.h:7186
uint16_t max_binary
Maximum number of Binary Input events (g2)
Definition: dnp3.h:7176
uint16_t max_binary_output_status
Maximum number of Binary Output Status events (g11)
Definition: dnp3.h:7180
uint16_t max_octet_string
Maximum number of Octet String events (g111)
Definition: dnp3.h:7190
uint16_t max_analog_output_status
Maximum number of Analog Output Status events (g42)
Definition: dnp3.h:7188
uint16_t max_double_bit_binary
Maximum number of Double-Bit Binary Input events (g4)
Definition: dnp3.h:7178
uint16_t max_frozen_counter
Maximum number of Frozen Counter events (g23)
Definition: dnp3.h:7184
Event classes.
Definition: dnp3.h:2638
bool class3
Class 3 events.
Definition: dnp3.h:2644
bool class1
Class 1 events.
Definition: dnp3.h:2640
bool class2
Class 2 events.
Definition: dnp3.h:2642
Callback interface used when obtaining an authentication key.
Definition: dnp3.h:3326
void(* on_failure)(dnp3_file_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:3336
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3339
void(* on_complete)(uint32_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:3331
void * ctx
Context data.
Definition: dnp3.h:3341
Callback interface for retrieving file info asynchronously.
Definition: dnp3.h:5376
void(* on_complete)(dnp3_file_info_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:5381
void * ctx
Context data.
Definition: dnp3.h:5391
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5389
void(* on_failure)(dnp3_file_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:5386
Information about a file or directory returned from the outstation.
Definition: dnp3.h:3266
uint32_t size
Size of the file in bytes.
Definition: dnp3.h:3274
dnp3_file_type_t file_type
Simple file or directory.
Definition: dnp3.h:3270
const char * file_name
Name of the file or directory.
Definition: dnp3.h:3268
dnp3_permissions_t permissions
Outstation permissions for the file.
Definition: dnp3.h:3280
uint64_t time_created
DNP3 timestamp.
Definition: dnp3.h:3278
Callback interface used when opening a file.
Definition: dnp3.h:3286
void(* on_complete)(dnp3_open_file_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:3291
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3299
void(* on_failure)(dnp3_file_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:3296
void * ctx
Context data.
Definition: dnp3.h:3301
Callback interface used when closing a file or writing a block of file data.
Definition: dnp3.h:3306
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3319
void(* on_complete)(dnp3_nothing_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:3311
void(* on_failure)(dnp3_file_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:3316
void * ctx
Context data.
Definition: dnp3.h:3321
Configuration related to reading a file.
Definition: dnp3.h:5436
uint32_t max_file_size
Maximum file size accepted by the master.
Definition: dnp3.h:5440
uint16_t max_block_size
Maximum block size requested by the master during the file open.
Definition: dnp3.h:5438
Callbacks for reading a file from the outstation asynchronously.
Definition: dnp3.h:5398
void(* aborted)(dnp3_file_error_t, void *)
Called when the transfer is aborted before completion due to an error or user request.
Definition: dnp3.h:5420
bool(* opened)(uint32_t, void *)
Called when the file is successfully opened.
Definition: dnp3.h:5406
bool(* block_received)(uint32_t, dnp3_byte_iterator_t *, void *)
Called when the next block is received.
Definition: dnp3.h:5415
void(* completed)(void *)
Called when the transfer completes successfully.
Definition: dnp3.h:5424
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5427
void * ctx
Context data.
Definition: dnp3.h:5429
Collection of individual flag bits represented by an underlying mask value.
Definition: dnp3.h:675
uint8_t value
bit-mask representing a set of individual flag bits
Definition: dnp3.h:677
frozen_analog_input point
Definition: dnp3.h:1069
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:1077
uint16_t index
Point index.
Definition: dnp3.h:1071
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:1075
double value
Point value.
Definition: dnp3.h:1073
Frozen Counter configuration.
Definition: dnp3.h:6578
uint32_t deadband
Deadband value.
Definition: dnp3.h:6584
dnp3_event_frozen_counter_variation_t event_variation
Default event variation.
Definition: dnp3.h:6582
dnp3_static_frozen_counter_variation_t static_variation
Default static variation.
Definition: dnp3.h:6580
frozen_counter point
Definition: dnp3.h:985
dnp3_timestamp_t time
Point timestamp.
Definition: dnp3.h:993
dnp3_flags_t flags
Point flags.
Definition: dnp3.h:991
uint16_t index
Point index.
Definition: dnp3.h:987
uint32_t value
Point value.
Definition: dnp3.h:989
Control Relay Output Block.
Definition: dnp3.h:622
uint32_t on_time
Duration the output drive remains active (in milliseconds)
Definition: dnp3.h:628
uint32_t off_time
Duration the output drive remains non-active (in milliseconds)
Definition: dnp3.h:630
uint8_t count
Count.
Definition: dnp3.h:626
dnp3_control_code_t code
Control code.
Definition: dnp3.h:624
Information about the object header and specific variation.
Definition: dnp3.h:3704
dnp3_qualifier_code_t qualifier
Qualifier code used in the response.
Definition: dnp3.h:3708
bool is_event
true if the received variation is an event type, false otherwise
Definition: dnp3.h:3710
bool has_flags
true if a flags byte is present on the underlying variation, false otherwise
Definition: dnp3.h:3712
dnp3_variation_t variation
underlying variation in the response
Definition: dnp3.h:3706
First IIN byte.
Definition: dnp3.h:3590
bool class_2_events
Outstation has unreported Class 2 events.
Definition: dnp3.h:3596
bool class_1_events
Outstation has unreported Class 1 events.
Definition: dnp3.h:3594
bool class_3_events
Outstation has unreported Class 3 events.
Definition: dnp3.h:3598
bool broadcast
Broadcast message was received.
Definition: dnp3.h:3592
bool local_control
One or more of the outstation’s points are in local control mode.
Definition: dnp3.h:3602
bool need_time
Outstation requires time synchronization.
Definition: dnp3.h:3600
bool device_trouble
An abnormal, device-specific condition exists in the outstation.
Definition: dnp3.h:3604
bool device_restart
Outstation restarted.
Definition: dnp3.h:3606
Second IIN byte.
Definition: dnp3.h:3614
bool parameter_error
A parameter in the request was invalid, e.g. malformed object data or an unsupported qualifier or ran...
Definition: dnp3.h:3620
bool object_unknown
Outstation does not support requested operation for objects in the request.
Definition: dnp3.h:3618
bool config_corrupt
The outstation detected corrupt configuration (optional support)
Definition: dnp3.h:3626
bool reserved_1
Reserved for future use - should always be set to 0.
Definition: dnp3.h:3630
bool already_executing
The operation requested is already executing (optional support)
Definition: dnp3.h:3624
bool no_func_code_support
Outstation does not support this function code.
Definition: dnp3.h:3616
bool reserved_2
Reserved for future use - should always be set to 0.
Definition: dnp3.h:3628
bool event_buffer_overflow
An event buffer overflow condition exists in the outstation, and at least one unconfirmed event was l...
Definition: dnp3.h:3622
Pair of IIN bytes.
Definition: dnp3.h:3638
dnp3_iin2_t iin2
Second IIN byte.
Definition: dnp3.h:3642
dnp3_iin1_t iin1
First IIN byte.
Definition: dnp3.h:3640
Logging interface that receives the log messages and writes them somewhere.
Definition: dnp3.h:3539
void * ctx
Context data.
Definition: dnp3.h:3550
void(* on_message)(dnp3_log_level_t, const char *, void *)
Called when a log message was received and should be logged.
Definition: dnp3.h:3545
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3548
Logging configuration options.
Definition: dnp3.h:3501
dnp3_time_format_t time_format
optional time format
Definition: dnp3.h:3507
bool print_module_info
optionally print the underlying Rust module information to the message string
Definition: dnp3.h:3511
dnp3_log_output_format_t output_format
output formatting options
Definition: dnp3.h:3505
bool print_level
optionally print the log level as part to the message string
Definition: dnp3.h:3509
dnp3_log_level_t level
logging level
Definition: dnp3.h:3503
Configuration for a MasterChannel that is independent of the physical layer.
Definition: dnp3.h:3958
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:3962
uint16_t address
Local DNP3 data-link address.
Definition: dnp3.h:3960
uint16_t rx_buffer_size
RX buffer size.
Definition: dnp3.h:3970
uint16_t tx_buffer_size
TX buffer size.
Definition: dnp3.h:3966
Octet String point.
Definition: dnp3.h:1362
uint16_t index
Point index.
Definition: dnp3.h:1364
dnp3_byte_iterator_t * value
Point value.
Definition: dnp3.h:1366
The result of opening a file on the outstation.
Definition: dnp3.h:3175
uint32_t file_handle
The handle assigned to the file by the outstation.
Definition: dnp3.h:3179
uint16_t max_block_size
Maximum block size returned by the outstation.
Definition: dnp3.h:3185
uint32_t file_size
Size of the file returned by the outstation.
Definition: dnp3.h:3181
Dynamic information required by the outstation from the user application.
Definition: dnp3.h:7716
bool(* write_string_attr)(uint8_t, uint8_t, dnp3_string_attr_t, const char *, void *)
Write a string attribute. This method is only called if the corresponding attribute has been configur...
Definition: dnp3.h:7871
uint16_t(* get_processing_delay_ms)(void *)
Returns the DELAY_MEASUREMENT delay.
Definition: dnp3.h:7725
void(* write_analog_dead_band)(uint16_t, double, void *)
Called when the outstation writes the dead-band of an analog input.
Definition: dnp3.h:7819
dnp3_restart_delay_t(* cold_restart)(void *)
Request that the outstation perform a cold restart.
Definition: dnp3.h:7743
bool(* write_octet_string_attr)(uint8_t, uint8_t, dnp3_octet_string_attr_t, dnp3_byte_iterator_t *, void *)
Write an octet-string attribute. This method is only called if the corresponding attribute has been c...
Definition: dnp3.h:7916
void(* end_assign_class)(void *)
Called after the point headers of an accepted ASSIGN_CLASS request are reported.
Definition: dnp3.h:7862
void * ctx
Context data.
Definition: dnp3.h:7953
void(* begin_write_analog_dead_bands)(void *)
Called when the outstation begins processing a header to write analog dead-bands.
Definition: dnp3.h:7807
void(* assign_class_range)(dnp3_point_type_t, uint16_t, uint16_t, dnp3_event_class_t, void *)
Called for a point header of an accepted ASSIGN_CLASS request that names a range of points of a type.
Definition: dnp3.h:7856
bool(* write_bit_string_attr)(uint8_t, uint8_t, dnp3_bit_string_attr_t, dnp3_byte_iterator_t *, void *)
Write a bit-string attribute. This method is only called if the corresponding attribute has been conf...
Definition: dnp3.h:7925
bool(* support_assign_class)(void *)
Controls outstation support for ASSIGN_CLASS requests, which change the class of the events that poin...
Definition: dnp3.h:7834
bool(* write_double_attr)(uint8_t, uint8_t, dnp3_float_attr_t, double, void *)
Write a 64-bit floating point attribute. This method is only called if the corresponding attribute ha...
Definition: dnp3.h:7889
void(* begin_confirm)(void *)
Called when a CONFIRM is received to a response or unsolicited response, but before any previously tr...
Definition: dnp3.h:7938
dnp3_restart_delay_t(* warm_restart)(void *)
Request that the outstation perform a warm restart.
Definition: dnp3.h:7750
bool(* write_uint_attr)(uint8_t, uint8_t, dnp3_uint_attr_t, uint32_t, void *)
Write an unsigned integer attribute. This method is only called if the corresponding attribute has be...
Definition: dnp3.h:7898
void(* end_confirm)(dnp3_buffer_state_t, void *)
Called when all relevant events have been cleared.
Definition: dnp3.h:7948
bool(* write_time_attr)(uint8_t, uint8_t, dnp3_time_attr_t, uint64_t, void *)
Write a DNP3 time attribute. This method is only called if the corresponding attribute has been confi...
Definition: dnp3.h:7934
bool(* write_float_attr)(uint8_t, uint8_t, dnp3_float_attr_t, float, void *)
Write a 32-bit floating point attribute. This method is only called if the corresponding attribute ha...
Definition: dnp3.h:7880
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:7731
dnp3_freeze_result_t(* freeze_counters_range_at_time)(uint16_t, uint16_t, dnp3_database_handle_t *, uint64_t, uint32_t, void *)
Freeze a range of counters at a requested time and interval.
Definition: dnp3.h:7788
void(* assign_class_all)(dnp3_point_type_t, dnp3_event_class_t, void *)
Called for a point header of an accepted ASSIGN_CLASS request that names every point of a type.
Definition: dnp3.h:7846
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:7951
void(* end_write_analog_dead_bands)(void *)
Called when the outstation completes processing a header to write analog dead-bands.
Definition: dnp3.h:7825
bool(* support_write_analog_dead_bands)(void *)
Controls outstation support for writing group 34, analog input dead-bands.
Definition: dnp3.h:7803
dnp3_application_iin_t(* get_application_iin)(void *)
Returns the application-controlled IIN bits.
Definition: dnp3.h:7736
bool(* write_int_attr)(uint8_t, uint8_t, dnp3_int_attr_t, int32_t, void *)
Write a signed integer attribute. This method is only called if the corresponding attribute has been ...
Definition: dnp3.h:7907
dnp3_freeze_result_t(* freeze_counters_all)(dnp3_freeze_type_t, dnp3_database_handle_t *, void *)
Freeze all the counters.
Definition: dnp3.h:7757
void(* event_cleared)(uint64_t, void *)
Called when an event is cleared from the buffer due to master acknowledgement.
Definition: dnp3.h:7943
void(* begin_assign_class)(void *)
Called before the point headers of an accepted ASSIGN_CLASS request are reported.
Definition: dnp3.h:7838
dnp3_freeze_result_t(* freeze_counters_all_at_time)(dnp3_database_handle_t *, uint64_t, uint32_t, void *)
Freeze all the counters at a requested time and interval.
Definition: dnp3.h:7767
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:7776
Outstation configuration.
Definition: dnp3.h:7343
dnp3_decode_level_t decode_level
Decoding level.
Definition: dnp3.h:7363
uint16_t max_controls_per_request
Maximum number of controls in a single request.
Definition: dnp3.h:7393
uint16_t rx_buffer_size
Receive buffer size.
Definition: dnp3.h:7361
uint32_t max_unsolicited_retries
Maximum number of unsolicited retries.
Definition: dnp3.h:7373
uint16_t master_address
Link-layer master address.
Definition: dnp3.h:7347
uint16_t solicited_buffer_size
Solicited response buffer size.
Definition: dnp3.h:7353
uint16_t outstation_address
Link-layer outstation address.
Definition: dnp3.h:7345
dnp3_outstation_features_t features
Optional features.
Definition: dnp3.h:7371
uint64_t confirm_timeout
Confirmation timeout.
Definition: dnp3.h:7366
uint64_t keep_alive_timeout
Delay of inactivity before sending a REQUEST_LINK_STATUS to the master.
Definition: dnp3.h:7381
uint64_t unsolicited_retry_delay
Delay to wait before retrying an unsolicited response.
Definition: dnp3.h:7376
dnp3_class_zero_config_t class_zero
Controls responses to Class 0 reads.
Definition: dnp3.h:7395
uint16_t unsolicited_buffer_size
Unsolicited response buffer size.
Definition: dnp3.h:7357
dnp3_event_buffer_config_t event_buffer_config
Event buffer sizes configuration.
Definition: dnp3.h:7349
uint64_t select_timeout
Select timeout.
Definition: dnp3.h:7369
uint16_t max_read_request_headers
Limits the selections or headers processed in a READ request.
Definition: dnp3.h:7391
Optional outstation features that can be enabled or disabled.
Definition: dnp3.h:7305
bool self_address
Respond to the self address.
Definition: dnp3.h:7307
bool respond_to_any_master
Outstation will process every request as if it came from the configured master address.
Definition: dnp3.h:7315
bool unsolicited
Respond to enable/disable unsolicited response and produce unsolicited responses.
Definition: dnp3.h:7311
bool broadcast
Process valid broadcast messages.
Definition: dnp3.h:7309
Informational callbacks that the outstation doesn't rely on to function.
Definition: dnp3.h:8000
void(* clear_restart_iin)(void *)
Master cleared the restart IIN bit.
Definition: dnp3.h:8062
void * ctx
Context data.
Definition: dnp3.h:8067
void(* enter_solicited_confirm_wait)(uint8_t, void *)
Outstation has begun waiting for a solicited confirm.
Definition: dnp3.h:8016
void(* solicited_confirm_timeout)(uint8_t, void *)
Failed to receive a solicited confirm before the timeout occurred.
Definition: dnp3.h:8021
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:8065
void(* enter_unsolicited_confirm_wait)(uint8_t, void *)
Outstation has begun waiting for an unsolicited confirm.
Definition: dnp3.h:8047
void(* wrong_solicited_confirm_seq)(uint8_t, uint8_t, void *)
Received a solicited confirm with the wrong sequence number.
Definition: dnp3.h:8036
void(* unexpected_confirm)(bool, uint8_t, void *)
Received a confirm when not expecting one.
Definition: dnp3.h:8042
void(* solicited_confirm_received)(uint8_t, void *)
Received the expected confirm.
Definition: dnp3.h:8026
void(* solicited_confirm_wait_new_request)(void *)
Received a new request while waiting for a solicited confirm, aborting the response series.
Definition: dnp3.h:8030
void(* process_request_from_idle)(dnp3_request_header_t, void *)
Called when a request is processed from the IDLE state.
Definition: dnp3.h:8005
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:8011
void(* unsolicited_confirm_timeout)(uint8_t, bool, void *)
Failed to receive an unsolicited confirm before the timeout occurred.
Definition: dnp3.h:8053
void(* unsolicited_confirmed)(uint8_t, void *)
Master confirmed an unsolicited message.
Definition: dnp3.h:8058
UDP outstation configuration.
Definition: dnp3.h:8502
const char * local_endpoint
Local endpoint to which the UDP socket is bound. Must be a socket address (ip:port)
Definition: dnp3.h:8504
const char * remote_endpoint
Remote endpoint where outbound requests are sent. Must be a socket address (ip:port)
Definition: dnp3.h:8506
uint64_t retry_delay
Period to wait before retrying after a failure to bind or connect the UDP socket.
Definition: dnp3.h:8513
dnp3_link_read_mode_t link_read_mode
Read mode to use, this should typically be set to DNP3_LINK_READ_MODE_DATAGRAM.
Definition: dnp3.h:8510
dnp3_udp_socket_mode_t socket_mode
UDP socket mode to use.
Definition: dnp3.h:8508
Defines read, write, execute permissions for particular group or user.
Definition: dnp3.h:3081
bool read
Permission to read.
Definition: dnp3.h:3087
bool write
Permission to write.
Definition: dnp3.h:3085
bool execute
Permission to execute.
Definition: dnp3.h:3083
Permissions for world, group, and owner.
Definition: dnp3.h:3128
dnp3_permission_set_t group
Group permissions.
Definition: dnp3.h:3132
dnp3_permission_set_t owner
Owner permissions.
Definition: dnp3.h:3134
dnp3_permission_set_t world
World permissions.
Definition: dnp3.h:3130
Poll identifier.
Definition: dnp3.h:4251
uint64_t id
Unique poll id assigned by the association.
Definition: dnp3.h:4255
uint16_t association_id
Outstation address of the association.
Definition: dnp3.h:4253
Callback interface for receiving updates about the state of a serial port.
Definition: dnp3.h:2149
void(* on_change)(dnp3_port_state_t, void *)
Invoked when the serial port changes state.
Definition: dnp3.h:2154
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:2157
void * ctx
Context data.
Definition: dnp3.h:2159
Callback interface for retrieving a directory list.
Definition: dnp3.h:5572
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5585
void(* on_complete)(dnp3_file_info_iterator_t *, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:5577
void(* on_failure)(dnp3_file_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:5582
void * ctx
Context data.
Definition: dnp3.h:5587
Callback interface used to received measurement values received from the outstation.
Definition: dnp3.h:3765
void(* handle_counter)(dnp3_header_info_t, dnp3_counter_iterator_t *, void *)
Handle counter data.
Definition: dnp3.h:3801
void(* handle_analog_input)(dnp3_header_info_t, dnp3_analog_input_iterator_t *, void *)
Handle analog input data.
Definition: dnp3.h:3813
void(* handle_analog_input_dead_band)(dnp3_header_info_t, dnp3_analog_input_dead_band_iterator_t *, void *)
Handle analog input deadbands (g34)
Definition: dnp3.h:3849
void(* handle_binary_output_command_event)(dnp3_header_info_t, dnp3_binary_output_command_event_iterator_t *, void *)
Handle binary output command events.
Definition: dnp3.h:3831
void * ctx
Context data.
Definition: dnp3.h:3951
void(* handle_variation_list_attr)(dnp3_header_info_t, dnp3_variation_list_attr_t, uint8_t, uint8_t, dnp3_attr_item_iter_t *, void *)
Handle a known or unknown list of attribute variations.
Definition: dnp3.h:3879
void(* handle_abs_time)(dnp3_header_info_t, dnp3_timestamp_t, void *)
Handle an absolute time value (g50v1)
Definition: dnp3.h:3861
void(* handle_uint_attr)(dnp3_header_info_t, dnp3_uint_attr_t, uint8_t, uint8_t, uint32_t, void *)
Handle an unsigned integer device attribute.
Definition: dnp3.h:3888
void(* handle_unsigned_integer)(dnp3_header_info_t, dnp3_unsigned_integer_iterator_t *, void *)
Handle unsigned integer values (g102)
Definition: dnp3.h:3843
void(* handle_analog_output_status)(dnp3_header_info_t, dnp3_analog_output_status_iterator_t *, void *)
Handle analog output status data.
Definition: dnp3.h:3825
void(* handle_frozen_counter)(dnp3_header_info_t, dnp3_frozen_counter_iterator_t *, void *)
Handle frozen counter input data.
Definition: dnp3.h:3807
void(* handle_binary_output_status)(dnp3_header_info_t, dnp3_binary_output_status_iterator_t *, void *)
Handle binary output status data.
Definition: dnp3.h:3795
void(* handle_octet_string_attr)(dnp3_header_info_t, dnp3_octet_string_attr_t, uint8_t, uint8_t, dnp3_byte_iterator_t *, void *)
Handle an octet string device attribute.
Definition: dnp3.h:3937
void(* begin_fragment)(dnp3_read_type_t, dnp3_response_header_t, void *)
Called when a valid response fragment is received, but before any measurements are processed.
Definition: dnp3.h:3771
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:3949
void(* handle_bool_attr)(dnp3_header_info_t, dnp3_bool_attr_t, uint8_t, uint8_t, bool, void *)
Handle a boolean device attribute.
Definition: dnp3.h:3899
void(* handle_frozen_analog_input)(dnp3_header_info_t, dnp3_frozen_analog_input_iterator_t *, void *)
Handle frozen analog input data.
Definition: dnp3.h:3819
void(* handle_binary_input)(dnp3_header_info_t, dnp3_binary_input_iterator_t *, void *)
Handle binary input data.
Definition: dnp3.h:3783
void(* handle_float_attr)(dnp3_header_info_t, dnp3_float_attr_t, uint8_t, uint8_t, double, void *)
Handle a floating point device attribute.
Definition: dnp3.h:3928
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:3789
void(* handle_time_attr)(dnp3_header_info_t, dnp3_time_attr_t, uint8_t, uint8_t, uint64_t, void *)
Handle a DNP3 time device attribute.
Definition: dnp3.h:3919
void(* handle_analog_output_command_event)(dnp3_header_info_t, dnp3_analog_output_command_event_iterator_t *, void *)
Handle analog output command events.
Definition: dnp3.h:3837
void(* handle_int_attr)(dnp3_header_info_t, dnp3_int_attr_t, uint8_t, uint8_t, int32_t, void *)
Handle a signed integer device attribute.
Definition: dnp3.h:3910
void(* handle_octet_string)(dnp3_header_info_t, dnp3_octet_string_iterator_t *, void *)
Handle octet string data.
Definition: dnp3.h:3855
void(* handle_string_attr)(dnp3_header_info_t, dnp3_string_attr_t, uint8_t, uint8_t, const char *, void *)
Handle a known or unknown visible string device attribute.
Definition: dnp3.h:3870
void(* handle_bit_string_attr)(dnp3_header_info_t, dnp3_bit_string_attr_t, uint8_t, uint8_t, dnp3_byte_iterator_t *, void *)
Handle a bit string device attribute.
Definition: dnp3.h:3946
void(* end_fragment)(dnp3_read_type_t, dnp3_response_header_t, void *)
Called when all the data from a response fragment has been processed.
Definition: dnp3.h:3777
Handler for read tasks.
Definition: dnp3.h:4907
void(* on_complete)(dnp3_nothing_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:4912
void * ctx
Context data.
Definition: dnp3.h:4922
void(* on_failure)(dnp3_read_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:4917
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:4920
Application-layer header for requests.
Definition: dnp3.h:7960
dnp3_control_field_t control_field
Control field.
Definition: dnp3.h:7962
dnp3_function_code_t function
Function code.
Definition: dnp3.h:7964
Response header information.
Definition: dnp3.h:3650
dnp3_response_function_t func
Response type.
Definition: dnp3.h:3654
dnp3_control_field_t control_field
Application control field.
Definition: dnp3.h:3652
dnp3_iin_t iin
IIN bytes.
Definition: dnp3.h:3656
Restart delay used by dnp3_outstation_application_t::cold_restart and dnp3_outstation_application_t::...
Definition: dnp3.h:7474
uint16_t value
Expected delay before the outstation comes back online.
Definition: dnp3.h:7478
dnp3_restart_delay_type_t restart_type
Indicates what dnp3_restart_delay_t::value is.
Definition: dnp3.h:7476
Handler for restart tasks.
Definition: dnp3.h:5342
void(* on_failure)(dnp3_restart_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:5352
void * ctx
Context data.
Definition: dnp3.h:5357
void(* on_complete)(uint64_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:5347
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5355
Retry strategy configuration.
Definition: dnp3.h:2749
uint64_t max_delay
Maximum delay between two retries.
Definition: dnp3.h:2755
uint64_t min_delay
Minimum delay between two retries.
Definition: dnp3.h:2752
Runtime configuration.
Definition: dnp3.h:419
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:423
Serial port settings.
Definition: dnp3.h:2879
dnp3_flow_control_t flow_control
Type of signalling to use for controlling data transfer.
Definition: dnp3.h:2885
dnp3_stop_bits_t stop_bits
Number of bits to use to signal the end of a character.
Definition: dnp3.h:2889
uint32_t baud_rate
Baud rate (in symbols-per-second)
Definition: dnp3.h:2881
dnp3_data_bits_t data_bits
Number of bits used to represent a character sent on the line.
Definition: dnp3.h:2883
dnp3_parity_t parity
Type of parity to use for error checking.
Definition: dnp3.h:2887
Handler for time synchronization tasks.
Definition: dnp3.h:5261
void(* on_destroy)(void *arg)
Callback when the underlying owner doesn't need the interface anymore.
Definition: dnp3.h:5274
void(* on_complete)(dnp3_nothing_t, void *)
Invoked when the asynchronous operation completes successfully.
Definition: dnp3.h:5266
void(* on_failure)(dnp3_time_sync_error_t, void *)
Invoked when the asynchronous operation fails.
Definition: dnp3.h:5271
void * ctx
Context data.
Definition: dnp3.h:5276
Timestamp associated with particular measurement from the outstation. The validity of the value depen...
Definition: dnp3.h:727
uint64_t value
Count of milliseconds since UNIX epoch.
Definition: dnp3.h:731
dnp3_time_quality_t quality
Enumeration that indicates the timestamp's validity.
Definition: dnp3.h:733
TLS client configuration.
Definition: dnp3.h:1532
const char * private_key_path
Path to the the PEM-encoded private key.
Definition: dnp3.h:1542
const char * dns_name
Subject name which is verified in the presented server certificate, from the SAN extension or in the ...
Definition: dnp3.h:1536
const char * password
Optional password if the private key file is encrypted.
Definition: dnp3.h:1548
dnp3_certificate_mode_t certificate_mode
Certificate validation mode.
Definition: dnp3.h:1552
const char * local_cert_path
Path to the PEM-encoded local certificate.
Definition: dnp3.h:1540
dnp3_min_tls_version_t min_tls_version
Minimum TLS version allowed.
Definition: dnp3.h:1550
bool allow_server_name_wildcard
If set to true, a '*' may be used for dnp3_tls_client_config_t::dns_name to bypass server name valida...
Definition: dnp3.h:1554
const char * peer_cert_path
Path to the PEM-encoded certificate of the peer.
Definition: dnp3.h:1538
TLS server configuration.
Definition: dnp3.h:8614
dnp3_min_tls_version_t min_tls_version
Minimum TLS version allowed.
Definition: dnp3.h:8632
const char * private_key_path
Path to the PEM-encoded private key.
Definition: dnp3.h:8624
const char * local_cert_path
Path to the PEM-encoded local certificate.
Definition: dnp3.h:8622
bool allow_client_name_wildcard
If set to true, a '*' may be used for dnp3_tls_server_config_t::dns_name to allow any authenticated c...
Definition: dnp3.h:8636
const char * dns_name
Subject name which is verified in the presented client certificate, from the SAN extension or in the ...
Definition: dnp3.h:8618
const char * password
Optional password if the private key file is encrypted.
Definition: dnp3.h:8630
dnp3_certificate_mode_t certificate_mode
Certificate validation mode.
Definition: dnp3.h:8634
const char * peer_cert_path
Path to the PEM-encoded certificate of the peer.
Definition: dnp3.h:8620
Remaining number of events in the buffer after a confirm on a per-type basis.
Definition: dnp3.h:7682
uint32_t num_double_bit_binary_input
Number of double-bit binary input events remaining in the buffer.
Definition: dnp3.h:7686
uint32_t num_octet_string
Number octet string events remaining in the buffer.
Definition: dnp3.h:7698
uint32_t num_analog
Number of analog events remaining in the buffer.
Definition: dnp3.h:7694
uint32_t num_analog_output_status
Number of analog output status events remaining in the buffer.
Definition: dnp3.h:7696
uint32_t num_binary_output_status
Number of binary output status events remaining in the buffer.
Definition: dnp3.h:7688
uint32_t num_counter
Number of counter events remaining in the buffer.
Definition: dnp3.h:7690
uint32_t num_binary_input
Number of binary input events remaining in the buffer.
Definition: dnp3.h:7684
uint32_t num_frozen_counter
Number of frozen counter events remaining in the buffer.
Definition: dnp3.h:7692
Unsigned byte corresponding to group 102 variation 1.
Definition: dnp3.h:1283
uint8_t value
Value of the object.
Definition: dnp3.h:1287
uint16_t index
Index of the object.
Definition: dnp3.h:1285
Defines what occurred during an update operation. Only certain id fields are valid depending on the v...
Definition: dnp3.h:5858
uint64_t created
The id of the created event if the result is DNP3_UPDATE_RESULT_CREATED or DNP3_UPDATE_RESULT_OVERFLO...
Definition: dnp3.h:5862
dnp3_update_result_t result
Defines what happened and which id fields are valid.
Definition: dnp3.h:5860
uint64_t discarded
The id of the discarded event if the result is DNP3_UPDATE_RESULT_OVERFLOW.
Definition: dnp3.h:5864
Options that control how the update is performed.
Definition: dnp3.h:5901
dnp3_event_mode_t event_mode
Determines how/if an event is produced.
Definition: dnp3.h:5905
bool update_static
Optionally bypass updating the static database (the current value)
Definition: dnp3.h:5903
Timestamp value returned by dnp3_association_handler_t::get_current_time.
Definition: dnp3.h:4431
bool is_valid
True if the timestamp is valid, false otherwise.
Definition: dnp3.h:4437
uint64_t value
Count of milliseconds since UNIX epoch.
Definition: dnp3.h:4435