├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG ├── CMakeLists.txt ├── COPYING ├── Makefile ├── README.md ├── config ├── stack_config.h └── stack_config.h.cmake ├── demos └── beaglebone │ ├── CMakeLists.txt │ ├── Makefile │ ├── beagle_client.c │ ├── beagle_demo.c │ ├── beagle_demo.icd │ ├── beaglebone_leds.c │ ├── beaglebone_leds.h │ ├── static_model.c │ └── static_model.h ├── examples ├── CMakeLists.txt ├── Makefile ├── goose_publisher │ ├── Makefile │ └── goose_publisher_example.c ├── goose_subscriber │ ├── CMakeLists.txt │ ├── Makefile │ └── goose_subscriber_example.c ├── iec61850_client_example1 │ ├── CMakeLists.txt │ ├── Makefile │ └── client_example1.c ├── iec61850_client_example2 │ ├── CMakeLists.txt │ ├── Makefile │ └── client_example2.c ├── iec61850_client_example3 │ ├── CMakeLists.txt │ ├── Makefile │ └── client_example3.c ├── iec61850_client_example4 │ ├── CMakeLists.txt │ ├── Makefile │ └── client_example4.c ├── iec61850_client_example5 │ ├── CMakeLists.txt │ ├── Makefile │ └── client_example5.c ├── iec61850_client_example_files │ ├── CMakeLists.txt │ ├── Makefile │ └── client_example_files.c ├── iec61850_client_example_reporting │ ├── CMakeLists.txt │ ├── Makefile │ └── client_example_reporting.c ├── mms_client_example1 │ ├── CMakeLists.txt │ ├── Makefile │ └── mms_client_example1.c ├── mms_client_example2 │ ├── CMakeLists.txt │ ├── Makefile │ └── mms_client_example2.c ├── mms_client_example3 │ ├── CMakeLists.txt │ ├── Makefile │ └── mms_client_example3.c ├── mms_client_example4 │ ├── CMakeLists.txt │ ├── Makefile │ └── mms_client_example4.c ├── mms_client_example5 │ ├── CMakeLists.txt │ ├── Makefile │ └── mms_client_example5.c ├── mms_utility │ ├── CMakeLists.txt │ ├── Makefile │ └── mms_utility.c ├── server_example1 │ ├── CMakeLists.txt │ ├── Makefile │ ├── sampleModel_with_dataset.icd │ ├── server_example1.c │ ├── static_model.c │ └── static_model.h ├── server_example2 │ ├── CMakeLists.txt │ ├── Makefile │ ├── complexModel.icd │ ├── server_example2.c │ ├── static_model.c │ └── static_model.h ├── server_example3 │ ├── CMakeLists.txt │ ├── Makefile │ ├── server_example3.c │ ├── simpleIO_direct_control.icd │ ├── simpleIO_sbo_control.icd │ ├── static_model.c │ ├── static_model.h │ └── vmd-filestore │ │ └── SYSTEM.BIN ├── server_example4 │ ├── CMakeLists.txt │ ├── Makefile │ ├── server_example4.c │ ├── simpleIO_direct_control.icd │ ├── static_model.c │ └── static_model.h ├── server_example5 │ ├── CMakeLists.txt │ ├── Makefile │ ├── server_example5.c │ ├── simpleIO_direct_control.icd │ ├── static_model.c │ └── static_model.h ├── server_example_61400_25 │ ├── CMakeLists.txt │ ├── Makefile │ ├── server_example_61400_25.c │ ├── static_model.c │ ├── static_model.h │ └── wtur.icd ├── server_example_complex_array │ ├── CMakeLists.txt │ ├── Makefile │ ├── mhai_array.icd │ ├── server_example_ca.c │ ├── static_model.c │ └── static_model.h ├── server_example_config_file │ ├── CMakeLists.txt │ ├── Makefile │ ├── server_example_config_file.c │ ├── simpleIO_direct_control_goose.icd │ └── vmd-filestore │ │ └── model.cfg ├── server_example_control │ ├── CMakeLists.txt │ ├── Makefile │ ├── server_example_control.c │ ├── simpleIO_control_tests.icd │ ├── static_model.c │ └── static_model.h ├── server_example_dynamic │ ├── CMakeLists.txt │ ├── Makefile │ └── server_example_dynamic.c └── server_example_goose │ ├── CMakeLists.txt │ ├── Makefile │ ├── server_example_goose.c │ ├── simpleIO_direct_control_goose.icd │ ├── static_model.c │ └── static_model.h ├── make ├── common_targets.mk ├── stack_includes.mk └── target_system.mk ├── src ├── CMakeLists.txt ├── common │ ├── array_list.c │ ├── array_list.h │ ├── buffer_chain.c │ ├── buffer_chain.h │ ├── byte_buffer.c │ ├── byte_buffer.h │ ├── byte_stream.c │ ├── byte_stream.h │ ├── conversions.c │ ├── conversions.h │ ├── libiec61850_common_api.h │ ├── libiec61850_platform_includes.h │ ├── linked_list.c │ ├── linked_list.h │ ├── map.c │ ├── map.h │ ├── simple_allocator.c │ ├── simple_allocator.h │ ├── string_map.c │ ├── string_map.h │ ├── string_utilities.c │ └── string_utilities.h ├── doxygen.config ├── doxygen │ ├── DoxygenLayout.xml │ ├── doxygen.css │ ├── doxygen.mod.css │ ├── footer.html │ ├── header.html │ ├── libIEC61850_server.png │ ├── mainpage.doxygen │ └── stylesheet.css ├── goose │ ├── goose_publisher.c │ ├── goose_publisher.h │ ├── goose_subscriber.c │ ├── goose_subscriber.h │ └── iec61850_goose.asn ├── hal │ ├── ethernet │ │ ├── ethernet.h │ │ ├── linux │ │ │ └── ethernet_linux.c │ │ └── win32 │ │ │ └── ethernet_win32.c │ ├── filesystem │ │ ├── filesystem.h │ │ ├── linux │ │ │ └── file_provider_linux.c │ │ └── win32 │ │ │ └── file_provider_win32.c │ ├── hal.c │ ├── hal.h │ ├── platform_endian.h │ ├── socket │ │ ├── linux │ │ │ └── socket_linux.c │ │ ├── socket.h │ │ └── win32 │ │ │ └── socket_win32.c │ └── thread │ │ ├── linux │ │ └── thread_linux.c │ │ ├── thread.h │ │ └── win32 │ │ └── thread_win32.c ├── iedclient │ ├── iec61850_client.h │ └── impl │ │ ├── client_control.c │ │ ├── client_goose_control.c │ │ ├── client_report.c │ │ ├── client_report_control.c │ │ ├── ied_connection.c │ │ └── ied_connection_private.h ├── iedcommon │ ├── iec61850_common.c │ └── iec61850_common.h ├── iedserver │ ├── iec61850_server.h │ ├── impl │ │ ├── client_connection.c │ │ ├── ied_server.c │ │ └── ied_server_private.h │ ├── mms_mapping │ │ ├── control.c │ │ ├── control.h │ │ ├── mms_goose.c │ │ ├── mms_goose.h │ │ ├── mms_mapping.c │ │ ├── mms_mapping.h │ │ ├── mms_mapping_internal.h │ │ ├── reporting.c │ │ └── reporting.h │ └── model │ │ ├── cdc.c │ │ ├── cdc.h │ │ ├── config_file_parser.c │ │ ├── config_file_parser.h │ │ ├── dynamic_model.c │ │ ├── dynamic_model.h │ │ ├── model.c │ │ └── model.h ├── mms │ ├── asn1 │ │ ├── asn1_ber_primitive_value.c │ │ ├── asn1_ber_primitive_value.h │ │ ├── ber_decode.c │ │ ├── ber_decode.h │ │ ├── ber_encoder.c │ │ ├── ber_encoder.h │ │ ├── ber_integer.c │ │ └── ber_integer.h │ ├── iso_acse │ │ ├── acse.c │ │ └── acse.h │ ├── iso_client │ │ ├── impl │ │ │ └── iso_client_connection.c │ │ └── iso_client_connection.h │ ├── iso_common │ │ ├── iso_connection_parameters.c │ │ └── iso_connection_parameters.h │ ├── iso_cotp │ │ ├── cotp.c │ │ └── cotp.h │ ├── iso_mms │ │ ├── asn1c │ │ │ ├── AccessResult.c │ │ │ ├── AccessResult.h │ │ │ ├── Address.c │ │ │ ├── Address.h │ │ │ ├── AlternateAccess.c │ │ │ ├── AlternateAccess.h │ │ │ ├── AlternateAccessSelection.c │ │ │ ├── AlternateAccessSelection.h │ │ │ ├── BIT_STRING.c │ │ │ ├── BIT_STRING.h │ │ │ ├── BOOLEAN.c │ │ │ ├── BOOLEAN.h │ │ │ ├── ConcludeRequestPDU.c │ │ │ ├── ConcludeRequestPDU.h │ │ │ ├── ConcludeResponsePDU.c │ │ │ ├── ConcludeResponsePDU.h │ │ │ ├── ConfirmedErrorPDU.c │ │ │ ├── ConfirmedErrorPDU.h │ │ │ ├── ConfirmedRequestPdu.c │ │ │ ├── ConfirmedRequestPdu.h │ │ │ ├── ConfirmedResponsePdu.c │ │ │ ├── ConfirmedResponsePdu.h │ │ │ ├── ConfirmedServiceRequest.c │ │ │ ├── ConfirmedServiceRequest.h │ │ │ ├── ConfirmedServiceResponse.c │ │ │ ├── ConfirmedServiceResponse.h │ │ │ ├── Data.c │ │ │ ├── Data.h │ │ │ ├── DataAccessError.c │ │ │ ├── DataAccessError.h │ │ │ ├── DataSequence.c │ │ │ ├── DataSequence.h │ │ │ ├── DefineNamedVariableListRequest.c │ │ │ ├── DefineNamedVariableListRequest.h │ │ │ ├── DefineNamedVariableListResponse.c │ │ │ ├── DefineNamedVariableListResponse.h │ │ │ ├── DeleteNamedVariableListRequest.c │ │ │ ├── DeleteNamedVariableListRequest.h │ │ │ ├── DeleteNamedVariableListResponse.c │ │ │ ├── DeleteNamedVariableListResponse.h │ │ │ ├── FloatingPoint.c │ │ │ ├── FloatingPoint.h │ │ │ ├── GeneralizedTime.c │ │ │ ├── GeneralizedTime.h │ │ │ ├── GetNameListRequest.c │ │ │ ├── GetNameListRequest.h │ │ │ ├── GetNameListResponse.c │ │ │ ├── GetNameListResponse.h │ │ │ ├── GetNamedVariableListAttributesRequest.c │ │ │ ├── GetNamedVariableListAttributesRequest.h │ │ │ ├── GetNamedVariableListAttributesResponse.c │ │ │ ├── GetNamedVariableListAttributesResponse.h │ │ │ ├── GetVariableAccessAttributesRequest.c │ │ │ ├── GetVariableAccessAttributesRequest.h │ │ │ ├── GetVariableAccessAttributesResponse.c │ │ │ ├── GetVariableAccessAttributesResponse.h │ │ │ ├── INTEGER.c │ │ │ ├── INTEGER.h │ │ │ ├── Identifier.c │ │ │ ├── Identifier.h │ │ │ ├── IndexRangeSeq.c │ │ │ ├── IndexRangeSeq.h │ │ │ ├── InformationReport.c │ │ │ ├── InformationReport.h │ │ │ ├── InitRequestDetail.c │ │ │ ├── InitRequestDetail.h │ │ │ ├── InitResponseDetail.c │ │ │ ├── InitResponseDetail.h │ │ │ ├── InitiateErrorPdu.c │ │ │ ├── InitiateErrorPdu.h │ │ │ ├── InitiateRequestPdu.c │ │ │ ├── InitiateRequestPdu.h │ │ │ ├── InitiateResponsePdu.c │ │ │ ├── InitiateResponsePdu.h │ │ │ ├── Integer16.c │ │ │ ├── Integer16.h │ │ │ ├── Integer32.c │ │ │ ├── Integer32.h │ │ │ ├── Integer8.c │ │ │ ├── Integer8.h │ │ │ ├── ListOfVariableSeq.c │ │ │ ├── ListOfVariableSeq.h │ │ │ ├── MMSString.c │ │ │ ├── MMSString.h │ │ │ ├── MmsPdu.c │ │ │ ├── MmsPdu.h │ │ │ ├── NULL.c │ │ │ ├── NULL.h │ │ │ ├── NativeEnumerated.c │ │ │ ├── NativeEnumerated.h │ │ │ ├── NativeInteger.c │ │ │ ├── NativeInteger.h │ │ │ ├── OCTET_STRING.c │ │ │ ├── OCTET_STRING.h │ │ │ ├── ObjectClass.c │ │ │ ├── ObjectClass.h │ │ │ ├── ObjectName.c │ │ │ ├── ObjectName.h │ │ │ ├── ParameterSupportOptions.c │ │ │ ├── ParameterSupportOptions.h │ │ │ ├── ReadRequest.c │ │ │ ├── ReadRequest.h │ │ │ ├── ReadResponse.c │ │ │ ├── ReadResponse.h │ │ │ ├── RejectPDU.c │ │ │ ├── RejectPDU.h │ │ │ ├── ScatteredAccessDescription.c │ │ │ ├── ScatteredAccessDescription.h │ │ │ ├── ServiceError.c │ │ │ ├── ServiceError.h │ │ │ ├── ServiceSupportOptions.c │ │ │ ├── ServiceSupportOptions.h │ │ │ ├── StructComponent.c │ │ │ ├── StructComponent.h │ │ │ ├── TimeOfDay.c │ │ │ ├── TimeOfDay.h │ │ │ ├── TypeSpecification.c │ │ │ ├── TypeSpecification.h │ │ │ ├── UTF8String.c │ │ │ ├── UTF8String.h │ │ │ ├── UnconfirmedPDU.c │ │ │ ├── UnconfirmedPDU.h │ │ │ ├── UnconfirmedService.c │ │ │ ├── UnconfirmedService.h │ │ │ ├── Unsigned16.c │ │ │ ├── Unsigned16.h │ │ │ ├── Unsigned32.c │ │ │ ├── Unsigned32.h │ │ │ ├── Unsigned8.c │ │ │ ├── Unsigned8.h │ │ │ ├── UtcTime.c │ │ │ ├── UtcTime.h │ │ │ ├── VariableAccessSpecification.c │ │ │ ├── VariableAccessSpecification.h │ │ │ ├── VariableSpecification.c │ │ │ ├── VariableSpecification.h │ │ │ ├── VisibleString.c │ │ │ ├── VisibleString.h │ │ │ ├── WriteRequest.c │ │ │ ├── WriteRequest.h │ │ │ ├── WriteResponse.c │ │ │ ├── WriteResponse.h │ │ │ ├── asn_SEQUENCE_OF.c │ │ │ ├── asn_SEQUENCE_OF.h │ │ │ ├── asn_SET_OF.c │ │ │ ├── asn_SET_OF.h │ │ │ ├── asn_application.h │ │ │ ├── asn_codecs.h │ │ │ ├── asn_codecs_prim.c │ │ │ ├── asn_codecs_prim.h │ │ │ ├── asn_internal.h │ │ │ ├── asn_system.h │ │ │ ├── ber_decoder.c │ │ │ ├── ber_decoder.h │ │ │ ├── ber_tlv_length.c │ │ │ ├── ber_tlv_length.h │ │ │ ├── ber_tlv_tag.c │ │ │ ├── ber_tlv_tag.h │ │ │ ├── constr_CHOICE.c │ │ │ ├── constr_CHOICE.h │ │ │ ├── constr_SEQUENCE.c │ │ │ ├── constr_SEQUENCE.h │ │ │ ├── constr_SEQUENCE_OF.c │ │ │ ├── constr_SEQUENCE_OF.h │ │ │ ├── constr_SET_OF.c │ │ │ ├── constr_SET_OF.h │ │ │ ├── constr_TYPE.c │ │ │ ├── constr_TYPE.h │ │ │ ├── constraints.c │ │ │ ├── constraints.h │ │ │ ├── der_encoder.c │ │ │ ├── der_encoder.h │ │ │ ├── per_decoder.c │ │ │ ├── per_decoder.h │ │ │ ├── per_encoder.c │ │ │ ├── per_encoder.h │ │ │ ├── per_support.c │ │ │ ├── per_support.h │ │ │ ├── xer_decoder.c │ │ │ ├── xer_decoder.h │ │ │ ├── xer_encoder.c │ │ │ ├── xer_encoder.h │ │ │ ├── xer_support.c │ │ │ └── xer_support.h │ │ ├── client │ │ │ ├── mms_client_common.c │ │ │ ├── mms_client_connection.c │ │ │ ├── mms_client_connection.h │ │ │ ├── mms_client_files.c │ │ │ ├── mms_client_get_namelist.c │ │ │ ├── mms_client_get_var_access.c │ │ │ ├── mms_client_identify.c │ │ │ ├── mms_client_initiate.c │ │ │ ├── mms_client_internal.h │ │ │ ├── mms_client_named_variable_list.c │ │ │ ├── mms_client_read.c │ │ │ ├── mms_client_status.c │ │ │ └── mms_client_write.c │ │ ├── common │ │ │ ├── mms_common.h │ │ │ ├── mms_common_internal.h │ │ │ ├── mms_common_msg.c │ │ │ ├── mms_type_spec.c │ │ │ ├── mms_type_spec.h │ │ │ ├── mms_types.h │ │ │ ├── mms_value.c │ │ │ ├── mms_value.h │ │ │ └── mms_value_internal.h │ │ └── server │ │ │ ├── mms_access_result.c │ │ │ ├── mms_access_result.h │ │ │ ├── mms_association_service.c │ │ │ ├── mms_device.c │ │ │ ├── mms_device_model.h │ │ │ ├── mms_domain.c │ │ │ ├── mms_file_service.c │ │ │ ├── mms_get_namelist_service.c │ │ │ ├── mms_get_var_access_service.c │ │ │ ├── mms_identify_service.c │ │ │ ├── mms_information_report.c │ │ │ ├── mms_named_variable_list.c │ │ │ ├── mms_named_variable_list.h │ │ │ ├── mms_named_variable_list_service.c │ │ │ ├── mms_read_service.c │ │ │ ├── mms_server.c │ │ │ ├── mms_server.h │ │ │ ├── mms_server_common.c │ │ │ ├── mms_server_connection.c │ │ │ ├── mms_server_connection.h │ │ │ ├── mms_server_internal.h │ │ │ ├── mms_status_service.c │ │ │ ├── mms_value_cache.c │ │ │ ├── mms_value_cache.h │ │ │ └── mms_write_service.c │ ├── iso_presentation │ │ ├── iso_presentation.c │ │ └── iso_presentation.h │ ├── iso_server │ │ ├── iso_connection.c │ │ ├── iso_server.c │ │ ├── iso_server.h │ │ └── iso_server_private.h │ └── iso_session │ │ ├── iso_session.c │ │ └── iso_session.h ├── sampled_values │ ├── sv.asn1 │ └── sv_publisher.c └── vs │ ├── libiec61850-wo-goose.def │ ├── libiec61850.def │ └── stdbool.h └── tools └── model_generator ├── build.sh ├── build2.sh ├── complexModel.icd ├── genconfig.jar ├── genericIO.icd ├── genmodel.jar ├── inverter3ph.icd ├── inverter_with_report.icd ├── manifest-dynamic.mf ├── manifest.mf ├── sampleModel.icd ├── sampleModel_errors.icd ├── sampleModel_with_dataset.icd ├── simpleIO_direct_control_goose.scd └── src └── com └── libiec61850 ├── scl ├── DataAttributeDefinition.java ├── DataObjectDefinition.java ├── ParserUtils.java ├── SclParser.java ├── SclParserException.java ├── communication │ ├── Communication.java │ ├── ConnectedAP.java │ ├── GSE.java │ ├── GSEAddress.java │ └── SubNetwork.java ├── model │ ├── AccessPoint.java │ ├── AttributeType.java │ ├── Authentication.java │ ├── DataAttribute.java │ ├── DataModelNode.java │ ├── DataModelValue.java │ ├── DataObject.java │ ├── DataSet.java │ ├── FunctionalConstraint.java │ ├── FunctionalConstraintData.java │ ├── GSEControl.java │ ├── IED.java │ ├── Log.java │ ├── LogControl.java │ ├── LogicalDevice.java │ ├── LogicalNode.java │ ├── OptionFields.java │ ├── ReportControlBlock.java │ ├── RptEnabled.java │ ├── Server.java │ ├── SettingControl.java │ └── TriggerOptions.java └── types │ ├── DataAttributeType.java │ ├── DataObjectType.java │ ├── EnumerationType.java │ ├── EnumerationValue.java │ ├── IllegalValueException.java │ ├── LogicalNodeType.java │ ├── SclType.java │ └── TypeDeclarations.java └── tools ├── DynamicModelGenerator.java └── StaticModelGenerator.java /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: 3 | - gcc 4 | - clang 5 | # Change this to your needs 6 | # script: ./configure && make 7 | script: 8 | - make 9 | - make examples 10 | -------------------------------------------------------------------------------- /demos/beaglebone/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(beagle_demo_SRCS 6 | beagle_demo.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${beagle_demo_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example3 16 | ${beagle_demo_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example3 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /demos/beaglebone/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = beagle_demo 4 | PROJECT_SOURCES = beagle_demo.c 5 | PROJECT_SOURCES += beaglebone_leds.c 6 | PROJECT_SOURCES += static_model.c 7 | 8 | include $(LIBIEC_HOME)/make/target_system.mk 9 | include $(LIBIEC_HOME)/make/stack_includes.mk 10 | 11 | all: $(PROJECT_BINARY_NAME) 12 | 13 | include $(LIBIEC_HOME)/make/common_targets.mk 14 | 15 | LDLIBS += -lm 16 | 17 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 18 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 19 | 20 | beagle_client: beagle_client.c $(LIB_NAME) 21 | $(CC) $(CFLAGS) $(LDFLAGS) -o beagle_client beagle_client.c $(INCLUDES) $(LIB_NAME) $(LDLIBS) 22 | 23 | clean: 24 | rm -f $(PROJECT_BINARY_NAME) beagle_client 25 | 26 | 27 | -------------------------------------------------------------------------------- /demos/beaglebone/beaglebone_leds.c: -------------------------------------------------------------------------------- 1 | /* 2 | * beaglebone_leds.c 3 | */ 4 | 5 | #include 6 | #include "beaglebone_leds.h" 7 | 8 | static void 9 | writeToFile(char* filename, char* text) 10 | { 11 | FILE* file = fopen(filename, "w"); 12 | fprintf(file, text); 13 | fclose(file); 14 | } 15 | 16 | void 17 | flashLED(char* led) 18 | { 19 | #ifndef SIMULATED 20 | char filename[255]; 21 | 22 | sprintf(filename, "%s/trigger", led); 23 | writeToFile(filename, "timer"); 24 | 25 | sprintf(filename, "%s/delay_on", led); 26 | writeToFile(filename, "200"); 27 | 28 | sprintf(filename, "%s/delay_off", led); 29 | writeToFile(filename, "200"); 30 | #else 31 | printf("FLASH: %s\n", led); 32 | #endif 33 | } 34 | 35 | void 36 | switchLED(char* led, int value) 37 | { 38 | #ifndef SIMULATED 39 | char filename[255]; 40 | char* valueStr[10]; 41 | 42 | sprintf(filename, "%s/trigger", led); 43 | writeToFile(filename, "none"); 44 | 45 | sprintf(filename, "%s/brightness", led); 46 | sprintf(valueStr, "%i", value); 47 | 48 | writeToFile(filename, valueStr); 49 | #else 50 | printf("SWITCH: %s %i\n", led, value); 51 | #endif 52 | } 53 | 54 | void 55 | initLEDs() 56 | { 57 | switchLED(LED1, 0); 58 | switchLED(LED2, 0); 59 | switchLED(LED3, 0); 60 | switchLED(LED4, 0); 61 | } 62 | -------------------------------------------------------------------------------- /demos/beaglebone/beaglebone_leds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * beaglebone_leds.h 3 | */ 4 | 5 | #ifndef BEAGLEBONE_LEDS_H_ 6 | #define BEAGLEBONE_LEDS_H_ 7 | 8 | 9 | //#define SIMULATED 1 10 | 11 | 12 | #if 0 13 | #define LED1 "/sys/class/leds/beaglebone::usr0" 14 | #define LED2 "/sys/class/leds/beaglebone::usr1" 15 | #define LED3 "/sys/class/leds/beaglebone::usr2" 16 | #define LED4 "/sys/class/leds/beaglebone::usr3" 17 | #endif 18 | 19 | #if 1 20 | #define LED1 "/sys/class/leds/beaglebone:green:usr0" 21 | #define LED2 "/sys/class/leds/beaglebone:green:usr1" 22 | #define LED3 "/sys/class/leds/beaglebone:green:usr2" 23 | #define LED4 "/sys/class/leds/beaglebone:green:usr3" 24 | #endif 25 | 26 | void 27 | flashLED(char* led); 28 | 29 | void 30 | switchLED(char* led, int value); 31 | 32 | void 33 | initLEDs(); 34 | 35 | #endif /* BEAGLEBONE_LEDS_H_ */ 36 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(server_example1) 2 | add_subdirectory(server_example2) 3 | add_subdirectory(server_example3) 4 | add_subdirectory(server_example4) 5 | add_subdirectory(server_example5) 6 | add_subdirectory(server_example_goose) 7 | add_subdirectory(server_example_control) 8 | add_subdirectory(server_example_dynamic) 9 | add_subdirectory(server_example_config_file) 10 | add_subdirectory(server_example_complex_array) 11 | add_subdirectory(server_example_61400_25) 12 | add_subdirectory(iec61850_client_example1) 13 | add_subdirectory(iec61850_client_example2) 14 | add_subdirectory(iec61850_client_example3) 15 | add_subdirectory(iec61850_client_example4) 16 | add_subdirectory(iec61850_client_example5) 17 | add_subdirectory(iec61850_client_example_files) 18 | add_subdirectory(iec61850_client_example_reporting) 19 | add_subdirectory(goose_subscriber) 20 | add_subdirectory(mms_client_example1) 21 | add_subdirectory(mms_client_example2) 22 | add_subdirectory(mms_client_example3) 23 | add_subdirectory(mms_client_example4) 24 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | 2 | EXAMPLE_DIRS = mms_client_example1 3 | EXAMPLE_DIRS += mms_client_example2 4 | EXAMPLE_DIRS += mms_client_example3 5 | EXAMPLE_DIRS += mms_client_example4 6 | EXAMPLE_DIRS += mms_client_example5 7 | EXAMPLE_DIRS += iec61850_client_example1 8 | EXAMPLE_DIRS += iec61850_client_example2 9 | EXAMPLE_DIRS += iec61850_client_example3 10 | EXAMPLE_DIRS += iec61850_client_example4 11 | EXAMPLE_DIRS += iec61850_client_example5 12 | EXAMPLE_DIRS += iec61850_client_example_reporting 13 | EXAMPLE_DIRS += server_example1 14 | EXAMPLE_DIRS += server_example2 15 | EXAMPLE_DIRS += server_example3 16 | EXAMPLE_DIRS += server_example4 17 | EXAMPLE_DIRS += server_example5 18 | EXAMPLE_DIRS += server_example_goose 19 | EXAMPLE_DIRS += server_example_control 20 | EXAMPLE_DIRS += server_example_config_file 21 | EXAMPLE_DIRS += server_example_dynamic 22 | EXAMPLE_DIRS += server_example_complex_array 23 | EXAMPLE_DIRS += server_example_61400_25 24 | EXAMPLE_DIRS += goose_subscriber 25 | EXAMPLE_DIRS += goose_publisher 26 | EXAMPLE_DIRS += mms_utility 27 | 28 | all: examples 29 | 30 | examples: 31 | -for d in $(EXAMPLE_DIRS); do(cd $$d && $(MAKE)); done 32 | 33 | clean: 34 | -for d in $(EXAMPLE_DIRS); do(cd $$d && $(MAKE) clean); done 35 | 36 | -------------------------------------------------------------------------------- /examples/goose_publisher/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = goose_publisher_example 4 | PROJECT_SOURCES = goose_publisher_example.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/goose_publisher/goose_publisher_example.c: -------------------------------------------------------------------------------- 1 | /* 2 | * goose_publisher_example.c 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "mms_value.h" 12 | #include "goose_publisher.h" 13 | #include "hal.h" 14 | 15 | // has to be executed as root! 16 | int 17 | main(int argc, char** argv) 18 | { 19 | 20 | LinkedList dataSetValues = LinkedList_create(); 21 | 22 | LinkedList_add(dataSetValues, MmsValue_newIntegerFromInt32(1234)); 23 | LinkedList_add(dataSetValues, MmsValue_newBinaryTime(false)); 24 | LinkedList_add(dataSetValues, MmsValue_newIntegerFromInt32(5678)); 25 | 26 | GoosePublisher publisher = GoosePublisher_create(NULL, "eth0"); 27 | 28 | GoosePublisher_setGoCbRef(publisher, "Test1/LLN0$GO$gocb1"); 29 | GoosePublisher_setConfRev(publisher, 1); 30 | GoosePublisher_setDataSetRef(publisher, "Test1/LLN0$dataset1"); 31 | 32 | int i = 0; 33 | 34 | for (i = 0; i < 3; i++) { 35 | sleep(1); 36 | 37 | if (GoosePublisher_publish(publisher, dataSetValues) == -1) { 38 | printf("Error sending message!\n"); 39 | } 40 | } 41 | 42 | GoosePublisher_destroy(publisher); 43 | } 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /examples/goose_subscriber/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(goose_subscriber_example_SRCS 3 | goose_subscriber_example.c 4 | ) 5 | 6 | IF(WIN32) 7 | 8 | IF(WITH_WPCAP) 9 | 10 | set_source_files_properties(${goose_subscriber_example_SRCS} 11 | PROPERTIES LANGUAGE CXX) 12 | add_executable(goose_subscriber_example 13 | ${goose_subscriber_example_SRCS} 14 | ) 15 | 16 | target_link_libraries(goose_subscriber_example 17 | iec61850 18 | ) 19 | 20 | ENDIF(WITH_WPCAP) 21 | 22 | ELSE(WIN32) 23 | 24 | add_executable(goose_subscriber_example 25 | ${goose_subscriber_example_SRCS} 26 | ) 27 | 28 | target_link_libraries(goose_subscriber_example 29 | iec61850 30 | ) 31 | 32 | ENDIF(WIN32) 33 | 34 | 35 | -------------------------------------------------------------------------------- /examples/goose_subscriber/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = goose_subscriber_example 4 | PROJECT_SOURCES = goose_subscriber_example.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/goose_subscriber/goose_subscriber_example.c: -------------------------------------------------------------------------------- 1 | /* 2 | * goose_subscriber_example.c 3 | * 4 | * This is an example for a standalone GOOSE subscriber 5 | * 6 | * Has to be started as root in Linux. 7 | */ 8 | 9 | #include "goose_subscriber.h" 10 | #include "thread.h" 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | static int running = 1; 18 | 19 | void sigint_handler(int signalId) 20 | { 21 | running = 0; 22 | } 23 | 24 | void 25 | gooseListener(GooseSubscriber subscriber, void* parameter) 26 | { 27 | printf("GOOSE event:\n"); 28 | printf(" stNum: %u sqNum: %u\n", GooseSubscriber_getStNum(subscriber), 29 | GooseSubscriber_getSqNum(subscriber)); 30 | printf(" timeToLive: %u\n", GooseSubscriber_getTimeAllowedToLive(subscriber)); 31 | printf(" timestamp: %llu\n", GooseSubscriber_getTimestamp(subscriber)); 32 | } 33 | 34 | int 35 | main(int argc, char** argv) 36 | { 37 | MmsValue* dataSetValues = MmsValue_createEmtpyArray(4); 38 | 39 | int i; 40 | for (i = 0; i < 4; i++) { 41 | MmsValue* dataSetEntry = MmsValue_newBoolean(false); 42 | MmsValue_setElement(dataSetValues, i, dataSetEntry); 43 | } 44 | 45 | GooseSubscriber subscriber = GooseSubscriber_create("simpleIOGenericIO/LLN0$GO$gcbEvents", dataSetValues); 46 | 47 | if (argc > 1) { 48 | printf("Set interface id: %s\n", argv[1]); 49 | GooseSubscriber_setInterfaceId(subscriber, argv[1]); 50 | } 51 | 52 | GooseSubscriber_setAppId(subscriber, 0x1000); 53 | 54 | GooseSubscriber_setListener(subscriber, gooseListener, NULL); 55 | 56 | GooseSubscriber_subscribe(subscriber); 57 | 58 | signal(SIGINT, sigint_handler); 59 | 60 | while (running) { 61 | Thread_sleep(100); 62 | } 63 | 64 | GooseSubscriber_destroy(subscriber); 65 | } 66 | -------------------------------------------------------------------------------- /examples/iec61850_client_example1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(iec61850_client_example1_SRCS 3 | client_example1.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${iec61850_client_example1_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(iec61850_client_example1 12 | ${iec61850_client_example1_SRCS} 13 | ) 14 | 15 | target_link_libraries(iec61850_client_example1 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example1/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = client_example1 4 | PROJECT_SOURCES = client_example1.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(iec61850_client_example2_SRCS 3 | client_example2.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${iec61850_client_example2_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(iec61850_client_example2 12 | ${iec61850_client_example2_SRCS} 13 | ) 14 | 15 | target_link_libraries(iec61850_client_example2 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example2/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = client_example2 4 | PROJECT_SOURCES = client_example2.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(iec61850_client_example3_SRCS 3 | client_example3.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${iec61850_client_example3_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(iec61850_client_example3 12 | ${iec61850_client_example3_SRCS} 13 | ) 14 | 15 | target_link_libraries(iec61850_client_example3 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example3/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = client_example3 4 | PROJECT_SOURCES = client_example3.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(iec61850_client_example4_SRCS 3 | client_example4.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${iec61850_client_example4_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(iec61850_client_example4 12 | ${iec61850_client_example4_SRCS} 13 | ) 14 | 15 | target_link_libraries(iec61850_client_example4 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example4/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = client_example4 4 | PROJECT_SOURCES = client_example4.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(iec61850_client_example5_SRCS 3 | client_example5.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${iec61850_client_example5_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(iec61850_client_example5 12 | ${iec61850_client_example5_SRCS} 13 | ) 14 | 15 | target_link_libraries(iec61850_client_example5 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example5/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = client_example5 4 | PROJECT_SOURCES = client_example5.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example_files/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(iec61850_client_example_files_SRCS 3 | client_example_files.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${iec61850_client_example_files_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(iec61850_client_example_files 12 | ${iec61850_client_example_files_SRCS} 13 | ) 14 | 15 | target_link_libraries(iec61850_client_example_files 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example_files/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = client_example_files 4 | PROJECT_SOURCES = client_example_files.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example_reporting/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(iec61850_client_example_reporting_SRCS 3 | client_example_reporting.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${iec61850_client_example_reporting_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(iec61850_client_example_reporting 12 | ${iec61850_client_example_reporting_SRCS} 13 | ) 14 | 15 | target_link_libraries(iec61850_client_example_reporting 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/iec61850_client_example_reporting/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = client_example_reporting 4 | PROJECT_SOURCES = client_example_reporting.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(mms_client_example1_SRCS 3 | mms_client_example1.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${mms_client_example1_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(mms_client_example1 12 | ${mms_client_example1_SRCS} 13 | ) 14 | 15 | target_link_libraries(mms_client_example1 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example1/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = mms_client_example1 4 | PROJECT_SOURCES = mms_client_example1.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example1/mms_client_example1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_client_example.c 3 | * 4 | * This is the most simple example. It illustrates how to create an MmsConnection 5 | * object and connect to a MMS server. 6 | * 7 | * Copyright 2013 Michael Zillgith 8 | * 9 | * This file is part of libIEC61850. 10 | * 11 | * libIEC61850 is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * libIEC61850 is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with libIEC61850. If not, see . 23 | * 24 | * See COPYING file for the complete license text. 25 | */ 26 | 27 | #include 28 | #include 29 | #include "mms_client_connection.h" 30 | #include "thread.h" 31 | 32 | int main(int argc, char** argv) { 33 | 34 | MmsConnection con = MmsConnection_create(); 35 | 36 | MmsError mmsError; 37 | 38 | if (MmsConnection_connect(con, &mmsError, "localhost", 102)) { 39 | // add application code here 40 | 41 | Thread_sleep(1000); 42 | 43 | printf("Send abort\n"); 44 | MmsConnection_abort(con, &mmsError); 45 | } 46 | else 47 | printf("Connect to server failed!\n"); 48 | 49 | MmsConnection_destroy(con); 50 | } 51 | 52 | -------------------------------------------------------------------------------- /examples/mms_client_example2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(mms_client_example2_SRCS 3 | mms_client_example2.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${mms_client_example2_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(mms_client_example2 12 | ${mms_client_example2_SRCS} 13 | ) 14 | 15 | target_link_libraries(mms_client_example2 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example2/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = mms_client_example2 4 | PROJECT_SOURCES = mms_client_example2.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example2/mms_client_example2.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "mms_client_connection.h" 5 | 6 | int main(int argc, char** argv) { 7 | 8 | char* hostname; 9 | int tcpPort = 102; 10 | 11 | if (argc > 1) 12 | hostname = argv[1]; 13 | else 14 | hostname = "localhost"; 15 | 16 | if (argc > 2) 17 | tcpPort = atoi(argv[2]); 18 | 19 | MmsConnection con = MmsConnection_create(); 20 | 21 | MmsError mmsError; 22 | 23 | /* Set maximum MMS PDU size (local detail) to 2000 byte */ 24 | MmsConnection_setLocalDetail(con, 2000); 25 | 26 | if (!MmsConnection_connect(con, &mmsError, hostname, tcpPort)) { 27 | printf("MMS connect failed!\n"); 28 | goto exit; 29 | } 30 | else 31 | printf("MMS connected.\n\n"); 32 | 33 | printf("Domains present on server:\n--------------------------\n"); 34 | LinkedList nameList = MmsConnection_getDomainNames(con, &mmsError); 35 | LinkedList_printStringList(nameList); 36 | printf("\n"); 37 | 38 | LinkedList element = nameList; 39 | 40 | while ((element = LinkedList_getNext(element)) != NULL) { 41 | printf("\nNamed variables in domain: %s\n-------------------------------------------------\n", (char*) element->data); 42 | 43 | LinkedList variableList = MmsConnection_getDomainVariableNames(con, &mmsError, (char*) element->data); 44 | 45 | LinkedList_printStringList(variableList); 46 | 47 | LinkedList_destroy(variableList); 48 | 49 | printf("\nNamed variable lists (data sets) in domain: %s\n", (char*) element->data); 50 | 51 | LinkedList dataSetList = MmsConnection_getDomainVariableListNames(con, &mmsError, (char*) element->data); 52 | 53 | LinkedList_printStringList(dataSetList); 54 | 55 | LinkedList_destroy(dataSetList); 56 | 57 | } 58 | 59 | LinkedList_destroy(nameList); 60 | 61 | exit: 62 | MmsConnection_destroy(con); 63 | } 64 | 65 | -------------------------------------------------------------------------------- /examples/mms_client_example3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(mms_client_example3_SRCS 3 | mms_client_example3.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${mms_client_example3_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(mms_client_example3 12 | ${mms_client_example3_SRCS} 13 | ) 14 | 15 | target_link_libraries(mms_client_example3 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example3/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = mms_client_example3 4 | PROJECT_SOURCES = mms_client_example3.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example3/mms_client_example3.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "mms_client_connection.h" 5 | 6 | int main(int argc, char** argv) { 7 | 8 | char* hostname; 9 | int tcpPort = 102; 10 | 11 | if (argc > 1) 12 | hostname = argv[1]; 13 | else 14 | hostname = "localhost"; 15 | 16 | if (argc > 2) 17 | tcpPort = atoi(argv[2]); 18 | 19 | MmsConnection con = MmsConnection_create(); 20 | 21 | MmsError error; 22 | 23 | if (!MmsConnection_connect(con, &error, hostname, tcpPort)) { 24 | printf("MMS connect failed!\n"); 25 | goto exit; 26 | } 27 | else 28 | printf("MMS connected.\n\n"); 29 | 30 | MmsValue* value = 31 | MmsConnection_readVariable(con, &error, "simpleIOGenericIO", "LLN0$GO"); 32 | 33 | if (value == NULL) 34 | printf("reading value failed!\n"); 35 | else 36 | MmsValue_delete(value); 37 | 38 | exit: 39 | MmsConnection_destroy(con); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /examples/mms_client_example4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(mms_client_example4_SRCS 3 | mms_client_example4.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${mms_client_example4_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(mms_client_example4 12 | ${mms_client_example4_SRCS} 13 | ) 14 | 15 | target_link_libraries(mms_client_example4 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example4/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = mms_client_example4 4 | PROJECT_SOURCES = mms_client_example4.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(mms_client_example5_SRCS 3 | mms_client_example5.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${mms_client_example5_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(mms_client_example5 12 | ${mms_client_example5_SRCS} 13 | ) 14 | 15 | target_link_libraries(mms_client_example5 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example5/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = mms_client_example5 4 | PROJECT_SOURCES = mms_client_example5.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/mms_client_example5/mms_client_example5.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "mms_client_connection.h" 5 | 6 | int main(int argc, char** argv) { 7 | 8 | char* hostname; 9 | int tcpPort = 102; 10 | 11 | if (argc > 1) 12 | hostname = argv[1]; 13 | else 14 | hostname = "localhost"; 15 | 16 | if (argc > 2) 17 | tcpPort = atoi(argv[2]); 18 | 19 | MmsConnection con = MmsConnection_create(); 20 | 21 | MmsError error; 22 | 23 | if (!MmsConnection_connect(con, &error, hostname, tcpPort)) { 24 | printf("MMS connect failed!\n"); 25 | goto exit; 26 | } 27 | else 28 | printf("MMS connected.\n\n"); 29 | 30 | LinkedList dataSetEntries = LinkedList_create(); 31 | 32 | MmsVariableAccessSpecification* dataSetEntry = 33 | MmsVariableAccessSpecification_create("BayControllerQ", "QA1CSWI1$ST$Pos"); 34 | 35 | LinkedList_add(dataSetEntries, (void*) dataSetEntry); 36 | 37 | dataSetEntry = 38 | MmsVariableAccessSpecification_create("BayControllerQ", "QA1XCBR1$ST$Pos"); 39 | 40 | LinkedList_add(dataSetEntries, (void*) dataSetEntry); 41 | 42 | MmsConnection_defineNamedVariableList(con, &error, "BayControllerQ", "LLN0$LIBIEC61850_CLIENT", dataSetEntries); 43 | 44 | /* delete list and all elements */ 45 | LinkedList_destroy(dataSetEntries); 46 | 47 | exit: 48 | MmsConnection_destroy(con); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /examples/mms_utility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(mms_utility_SRCS 3 | mms_utility.c 4 | ) 5 | 6 | IF(WIN32) 7 | set_source_files_properties(${mms_utility_SRCS} 8 | PROPERTIES LANGUAGE CXX) 9 | ENDIF(WIN32) 10 | 11 | add_executable(mms_utility 12 | ${mms_utility_SRCS} 13 | ) 14 | 15 | target_link_libraries(mms_utility 16 | iec61850 17 | ) 18 | -------------------------------------------------------------------------------- /examples/mms_utility/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = mms_utility 4 | PROJECT_SOURCES = mms_utility.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | -------------------------------------------------------------------------------- /examples/server_example1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example1_SRCS 6 | server_example1.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example1_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example1 16 | ${server_example1_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example1 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /examples/server_example1/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example1 4 | PROJECT_SOURCES = server_example1.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | include $(LIBIEC_HOME)/make/target_system.mk 8 | include $(LIBIEC_HOME)/make/stack_includes.mk 9 | 10 | all: $(PROJECT_BINARY_NAME) 11 | 12 | include $(LIBIEC_HOME)/make/common_targets.mk 13 | 14 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 15 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 16 | 17 | clean: 18 | rm -f $(PROJECT_BINARY_NAME) 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/server_example2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example2_SRCS 6 | server_example2.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example2_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example2 16 | ${server_example2_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example2 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /examples/server_example2/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example2 4 | PROJECT_SOURCES = server_example2.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | PROJECT_ICD_FILE = complexModel.scd 8 | 9 | include $(LIBIEC_HOME)/make/target_system.mk 10 | include $(LIBIEC_HOME)/make/stack_includes.mk 11 | 12 | all: $(PROJECT_BINARY_NAME) 13 | 14 | include $(LIBIEC_HOME)/make/common_targets.mk 15 | 16 | model: $(PROJECT_ICD_FILE) 17 | java -jar $(LIBIEC_HOME)/tools/model_generator/genmodel.jar $(PROJECT_ICD_FILE) 18 | 19 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 20 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDFLAGS) $(LDLIBS) 21 | 22 | clean: 23 | rm -f $(PROJECT_BINARY_NAME) 24 | 25 | -------------------------------------------------------------------------------- /examples/server_example3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example3_SRCS 6 | server_example3.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example3_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example3 16 | ${server_example3_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example3 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /examples/server_example3/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example3 4 | PROJECT_SOURCES = server_example3.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | include $(LIBIEC_HOME)/make/target_system.mk 8 | include $(LIBIEC_HOME)/make/stack_includes.mk 9 | 10 | all: $(PROJECT_BINARY_NAME) 11 | 12 | include $(LIBIEC_HOME)/make/common_targets.mk 13 | 14 | LDLIBS += -lm 15 | 16 | CP = cp 17 | 18 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 19 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 20 | $(CP) $(PROJECT_BINARY_NAME) vmd-filestore/IEDSERVER.BIN 21 | 22 | clean: 23 | rm -f $(PROJECT_BINARY_NAME) 24 | rm -f vmd-filestore/IEDSERVER.BIN 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/server_example3/vmd-filestore/SYSTEM.BIN: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/careychow/libIEC61850/5b60884d5ff6836ec4e62d2efe7636eee874f9e5/examples/server_example3/vmd-filestore/SYSTEM.BIN -------------------------------------------------------------------------------- /examples/server_example4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example4_SRCS 6 | server_example4.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example4_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example4 16 | ${server_example4_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example4 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /examples/server_example4/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example4 4 | PROJECT_SOURCES = server_example4.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | include $(LIBIEC_HOME)/make/target_system.mk 8 | include $(LIBIEC_HOME)/make/stack_includes.mk 9 | 10 | all: $(PROJECT_BINARY_NAME) 11 | 12 | include $(LIBIEC_HOME)/make/common_targets.mk 13 | 14 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 15 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 16 | 17 | clean: 18 | rm -f $(PROJECT_BINARY_NAME) 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/server_example5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example5_SRCS 6 | server_example5.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example5_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example5 16 | ${server_example5_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example5 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /examples/server_example5/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example5 4 | PROJECT_SOURCES = server_example5.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | include $(LIBIEC_HOME)/make/target_system.mk 8 | include $(LIBIEC_HOME)/make/stack_includes.mk 9 | 10 | all: $(PROJECT_BINARY_NAME) 11 | 12 | include $(LIBIEC_HOME)/make/common_targets.mk 13 | 14 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 15 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 16 | 17 | clean: 18 | rm -f $(PROJECT_BINARY_NAME) 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/server_example_61400_25/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example_61400_25_SRCS 6 | server_example_61400_25.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example_61400_25_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example_61400_25 16 | ${server_example_61400_25_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example_61400_25 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /examples/server_example_61400_25/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example_61400_25 4 | PROJECT_SOURCES = server_example_61400_25.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | include $(LIBIEC_HOME)/make/target_system.mk 8 | include $(LIBIEC_HOME)/make/stack_includes.mk 9 | 10 | all: $(PROJECT_BINARY_NAME) 11 | 12 | include $(LIBIEC_HOME)/make/common_targets.mk 13 | 14 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 15 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 16 | 17 | clean: 18 | rm -f $(PROJECT_BINARY_NAME) 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/server_example_complex_array/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example_ca_SRCS 6 | server_example_ca.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example_ca_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example_ca 16 | ${server_example_ca_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example_ca 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /examples/server_example_complex_array/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example_ca 4 | PROJECT_SOURCES = server_example_ca.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | include $(LIBIEC_HOME)/make/target_system.mk 8 | include $(LIBIEC_HOME)/make/stack_includes.mk 9 | 10 | all: $(PROJECT_BINARY_NAME) 11 | 12 | include $(LIBIEC_HOME)/make/common_targets.mk 13 | 14 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 15 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 16 | 17 | clean: 18 | rm -f $(PROJECT_BINARY_NAME) 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/server_example_config_file/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example_config_file_SRCS 6 | server_example_config_file.c 7 | ) 8 | 9 | IF(WIN32) 10 | set_source_files_properties(${server_example_config_file_SRCS} 11 | PROPERTIES LANGUAGE CXX) 12 | ENDIF(WIN32) 13 | 14 | add_executable(server_example_config_file 15 | ${server_example_config_file_SRCS} 16 | ) 17 | 18 | target_link_libraries(server_example_config_file 19 | iec61850 20 | ) 21 | -------------------------------------------------------------------------------- /examples/server_example_config_file/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example_config_file 4 | PROJECT_SOURCES = server_example_config_file.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/server_example_control/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example_control_SRCS 6 | server_example_control.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example_control_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example_control 16 | ${server_example_control_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example_control 20 | iec61850 21 | ) 22 | -------------------------------------------------------------------------------- /examples/server_example_control/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example_control 4 | PROJECT_SOURCES = server_example_control.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | include $(LIBIEC_HOME)/make/target_system.mk 8 | include $(LIBIEC_HOME)/make/stack_includes.mk 9 | 10 | all: $(PROJECT_BINARY_NAME) 11 | 12 | include $(LIBIEC_HOME)/make/common_targets.mk 13 | 14 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 15 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 16 | 17 | clean: 18 | rm -f $(PROJECT_BINARY_NAME) 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/server_example_dynamic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example_dynamic_SRCS 6 | server_example_dynamic.c 7 | ) 8 | 9 | IF(WIN32) 10 | set_source_files_properties(${server_example_dynamic_SRCS} 11 | PROPERTIES LANGUAGE CXX) 12 | ENDIF(WIN32) 13 | 14 | add_executable(server_example_dynamic 15 | ${server_example_dynamic_SRCS} 16 | ) 17 | 18 | target_link_libraries(server_example_dynamic 19 | iec61850 20 | ) 21 | -------------------------------------------------------------------------------- /examples/server_example_dynamic/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example_dynamic 4 | PROJECT_SOURCES = server_example_dynamic.c 5 | 6 | include $(LIBIEC_HOME)/make/target_system.mk 7 | include $(LIBIEC_HOME)/make/stack_includes.mk 8 | 9 | all: $(PROJECT_BINARY_NAME) 10 | 11 | include $(LIBIEC_HOME)/make/common_targets.mk 12 | 13 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 14 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 15 | 16 | clean: 17 | rm -f $(PROJECT_BINARY_NAME) 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/server_example_goose/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( 2 | . 3 | ) 4 | 5 | set(server_example_goose_SRCS 6 | server_example_goose.c 7 | static_model.c 8 | ) 9 | 10 | IF(WIN32) 11 | set_source_files_properties(${server_example_goose_SRCS} 12 | PROPERTIES LANGUAGE CXX) 13 | ENDIF(WIN32) 14 | 15 | add_executable(server_example_goose 16 | ${server_example_goose_SRCS} 17 | ) 18 | 19 | target_link_libraries(server_example_goose 20 | iec61850 21 | ) 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/server_example_goose/Makefile: -------------------------------------------------------------------------------- 1 | LIBIEC_HOME=../.. 2 | 3 | PROJECT_BINARY_NAME = server_example_goose 4 | PROJECT_SOURCES = server_example_goose.c 5 | PROJECT_SOURCES += static_model.c 6 | 7 | include $(LIBIEC_HOME)/make/target_system.mk 8 | include $(LIBIEC_HOME)/make/stack_includes.mk 9 | 10 | all: $(PROJECT_BINARY_NAME) 11 | 12 | include $(LIBIEC_HOME)/make/common_targets.mk 13 | 14 | $(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME) 15 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS) 16 | 17 | clean: 18 | rm -f $(PROJECT_BINARY_NAME) 19 | 20 | 21 | -------------------------------------------------------------------------------- /make/common_targets.mk: -------------------------------------------------------------------------------- 1 | $(LIB_NAME): 2 | cd $(LIBIEC_HOME); $(MAKE) -f Makefile 3 | 4 | lib: $(LIB_NAME) 5 | 6 | libclean: clean 7 | cd $(LIBIEC_HOME); $(MAKE) -f Makefile clean 8 | -------------------------------------------------------------------------------- /make/stack_includes.mk: -------------------------------------------------------------------------------- 1 | INCLUDES = -I$(LIBIEC_HOME)/config 2 | INCLUDES += -I$(LIBIEC_HOME)/src/common 3 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_presentation 4 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_session 5 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_cotp 6 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_acse 7 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_mms/common 8 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_mms/client 9 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_mms/server 10 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_client 11 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_common 12 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/iso_server 13 | INCLUDES += -I$(LIBIEC_HOME)/src/mms/asn1 14 | INCLUDES += -I$(LIBIEC_HOME)/src/iedcommon 15 | INCLUDES += -I$(LIBIEC_HOME)/src/iedserver/mms_mapping 16 | INCLUDES += -I$(LIBIEC_HOME)/src/iedserver/model 17 | INCLUDES += -I$(LIBIEC_HOME)/src/iedserver 18 | INCLUDES += -I$(LIBIEC_HOME)/src/iedclient 19 | INCLUDES += -I$(LIBIEC_HOME)/src/hal 20 | INCLUDES += -I$(LIBIEC_HOME)/src/hal/thread 21 | INCLUDES += -I$(LIBIEC_HOME)/src/hal/socket 22 | INCLUDES += -I$(LIBIEC_HOME)/src/hal/filesystem 23 | INCLUDES += -I$(LIBIEC_HOME)/src/goose 24 | -------------------------------------------------------------------------------- /src/common/array_list.c: -------------------------------------------------------------------------------- 1 | /* 2 | * array_list.c 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #include "libiec61850_platform_includes.h" 25 | #include "array_list.h" 26 | 27 | int 28 | ArrayList_listSize(void** list) 29 | { 30 | int size = 0; 31 | 32 | while (list[size] != NULL) 33 | size++; 34 | return size; 35 | } 36 | -------------------------------------------------------------------------------- /src/common/array_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * array_list.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef ARRAY_LIST_H_ 25 | #define ARRAY_LIST_H_ 26 | 27 | int 28 | ArrayList_listSize(void** list); 29 | 30 | 31 | #endif /* ARRAY_LIST_H_ */ 32 | -------------------------------------------------------------------------------- /src/common/buffer_chain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * buffer_chain.h 3 | * 4 | * Created on: Nov 10, 2013 5 | * Author: mzillgit 6 | */ 7 | 8 | #ifndef BUFFER_CHAIN_H_ 9 | #define BUFFER_CHAIN_H_ 10 | 11 | typedef struct sBufferChain* BufferChain; 12 | 13 | struct sBufferChain { 14 | int length; 15 | int partLength; 16 | int partMaxLength; 17 | uint8_t* buffer; 18 | BufferChain nextPart; 19 | }; 20 | 21 | void 22 | BufferChain_init(BufferChain self, int length, int partLength, BufferChain nextPart, uint8_t* buffer); 23 | 24 | void 25 | BufferChain_destroy(BufferChain self); 26 | 27 | int /* returns the number of bytes written to the buffer */ 28 | BufferChain_dumpToBuffer(BufferChain self, uint8_t* buffer, int bufferMaxSize); 29 | 30 | 31 | typedef struct { 32 | uint8_t* memory; 33 | int currentPos; 34 | int size; 35 | } MemoryArea; 36 | 37 | void 38 | MemoryArea_initialize(MemoryArea* self, uint8_t* memory, int size); 39 | 40 | uint8_t* 41 | MemoryArea_getNextBlock(MemoryArea* self, int size); 42 | 43 | #if 0 44 | 45 | typedef struct sMemoryPool* MemoryPool; 46 | 47 | typedef struct sMemoryChunk MemoryChunk; 48 | 49 | struct sMemoryPool { 50 | uint8_t* memory; 51 | int size; 52 | MemoryChunk firstChunk; 53 | }; 54 | 55 | struct sMemoryChunk { 56 | MemoryChunk previous; 57 | MemoryChunk next; 58 | uint8_t* data; 59 | uint8_t free; 60 | int size; 61 | }; 62 | 63 | MemoryPool 64 | MemoryPool_create(uint8_t* memoryAddress, int size); 65 | 66 | void 67 | MemoryPool_destroy(MemoryPool self); 68 | 69 | MemoryChunk 70 | MemoryPool_allocateChunk(MemoryPool self, int size); 71 | MemoryPool_freeChunk(MemoryPool self, MemoryChunk chunk); 72 | 73 | #endif 74 | 75 | #endif /* BUFFER_CHAIN_H_ */ 76 | -------------------------------------------------------------------------------- /src/common/byte_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * byte_buffer.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef BYTE_BUFFER_H_ 25 | #define BYTE_BUFFER_H_ 26 | 27 | #include "libiec61850_common_api.h" 28 | 29 | typedef struct { 30 | uint8_t* buffer; 31 | int maxSize; 32 | int size; 33 | } ByteBuffer; 34 | 35 | ByteBuffer* 36 | ByteBuffer_create(ByteBuffer* self, int maxSize); 37 | 38 | void 39 | ByteBuffer_destroy(ByteBuffer* self); 40 | 41 | void 42 | ByteBuffer_wrap(ByteBuffer* self, uint8_t* buf, int size, int maxSize); 43 | 44 | int 45 | ByteBuffer_append(ByteBuffer* self, uint8_t* data, int dataSize); 46 | 47 | int 48 | ByteBuffer_appendByte(ByteBuffer* self, uint8_t byte); 49 | 50 | uint8_t* 51 | ByteBuffer_getBuffer(ByteBuffer* self); 52 | 53 | int 54 | ByteBuffer_getSize(ByteBuffer* self); 55 | 56 | int 57 | ByteBuffer_getMaxSize(ByteBuffer* self); 58 | 59 | int 60 | ByteBuffer_setSize(ByteBuffer* self, int size); 61 | 62 | void 63 | ByteBuffer_print(ByteBuffer* self, char* message); 64 | 65 | #endif /* BYTE_BUFFER_H_ */ 66 | -------------------------------------------------------------------------------- /src/common/byte_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * byte_stream.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef BYTE_STREAM_H_ 25 | #define BYTE_STREAM_H_ 26 | 27 | #include "libiec61850_platform_includes.h" 28 | #include "socket.h" 29 | #include "byte_buffer.h" 30 | 31 | int 32 | ByteStream_readUint8(Socket self, uint8_t* byte); 33 | 34 | int 35 | ByteStream_readUint16(Socket self, uint16_t* value); 36 | 37 | int 38 | ByteStream_skipBytes(Socket self, int number); 39 | 40 | int 41 | ByteStream_readOctets(Socket self, uint8_t* targetBuffer, int size); 42 | 43 | #endif /* BYTE_STREAM_H_ */ 44 | -------------------------------------------------------------------------------- /src/common/conversions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * conversions.h 3 | * 4 | * Some helper functions to convert data. 5 | * 6 | * Copyright 2014 Michael Zillgith 7 | * 8 | * This file is part of libIEC61850. 9 | * 10 | * libIEC61850 is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * libIEC61850 is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with libIEC61850. If not, see . 22 | * 23 | * See COPYING file for the complete license text. 24 | */ 25 | 26 | #ifndef CONVERSIONS_H_ 27 | #define CONVERSIONS_H_ 28 | 29 | #include "libiec61850_platform_includes.h" 30 | 31 | void 32 | Conversions_intToStringBuffer(int intValue, int numberOfDigits, uint8_t* buffer); 33 | 34 | void 35 | Conversions_msTimeToGeneralizedTime(uint64_t msTime, uint8_t* buffer); 36 | 37 | uint64_t 38 | Conversions_generalizedTimeToMsTime(char* gtString); 39 | 40 | void 41 | memcpyReverseByteOrder(uint8_t* dst, uint8_t* src, int size); 42 | 43 | #endif /* CONVERSIONS_H_ */ 44 | -------------------------------------------------------------------------------- /src/common/libiec61850_common_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libiec61850_common_api_includes.h 3 | */ 4 | 5 | #ifndef LIBIEC61850_COMMON_API_INCLUDES_H_ 6 | #define LIBIEC61850_COMMON_API_INCLUDES_H_ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef __GNUC__ 15 | #define ATTRIBUTE_PACKED __attribute__ ((__packed__)) 16 | #else 17 | #define ATTRIBUTE_PACKED 18 | #endif 19 | 20 | #include "hal.h" 21 | #include "mms_value.h" 22 | 23 | #endif /* LIBIEC61850_COMMON_API_INCLUDES_H_ */ 24 | -------------------------------------------------------------------------------- /src/common/libiec61850_platform_includes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libiec61850_platform_includes.h 3 | */ 4 | 5 | #ifndef LIBIEC61850_PLATFORM_INCLUDES_H_ 6 | #define LIBIEC61850_PLATFORM_INCLUDES_H_ 7 | 8 | #include "libiec61850_common_api.h" 9 | 10 | #include "string_utilities.h" 11 | #include 12 | #include 13 | #include "platform_endian.h" 14 | 15 | #if (DEBUG != 1) 16 | #define NDEBUG 1 17 | #endif 18 | 19 | #include 20 | 21 | #endif /* LIBIEC61850_PLATFORM_INCLUDES_H_ */ 22 | -------------------------------------------------------------------------------- /src/common/map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * map.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef MAP_H_ 25 | #define MAP_H_ 26 | 27 | #include "libiec61850_platform_includes.h" 28 | #include "linked_list.h" 29 | 30 | typedef struct sMap* Map; 31 | 32 | struct sMap { 33 | LinkedList entries; 34 | 35 | /* client provided function to compare two keys */ 36 | int (*compareKeys)(void* key1, void* key2); 37 | }; 38 | 39 | Map 40 | Map_create(void); 41 | 42 | int 43 | Map_size(Map map); 44 | 45 | void* 46 | Map_addEntry(Map map, void* key, void* value); 47 | 48 | void* 49 | Map_removeEntry(Map map, void* key, bool deleteKey); 50 | 51 | void* 52 | Map_getEntry(Map map, void* key); 53 | 54 | void 55 | Map_delete(Map map, bool deleteKey); 56 | 57 | void 58 | Map_deleteStatic(Map map, bool deleteKey); 59 | 60 | void 61 | Map_deleteDeep(Map map, bool deleteKey, void (*valueDeleteFunction) (void*)); 62 | 63 | 64 | #endif /* MAP_H_ */ 65 | -------------------------------------------------------------------------------- /src/common/simple_allocator.c: -------------------------------------------------------------------------------- 1 | /* 2 | * simple_allocator.c 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #include 25 | 26 | #include "simple_allocator.h" 27 | 28 | void 29 | MemoryAllocator_init(MemoryAllocator* self, char* memoryBlock, int size) 30 | { 31 | self->memoryBlock = memoryBlock; 32 | self->currentPtr = memoryBlock; 33 | self->size = size; 34 | } 35 | 36 | char* 37 | MemoryAllocator_allocate(MemoryAllocator* self, int size) 38 | { 39 | if (((self->currentPtr - self->memoryBlock) + size) <= self->size) 40 | return (self->currentPtr += size); 41 | else 42 | return NULL; 43 | } 44 | -------------------------------------------------------------------------------- /src/common/simple_allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * simple_allocator.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef SIMPLE_ALLOCATOR_H_ 25 | #define SIMPLE_ALLOCATOR_H_ 26 | 27 | typedef struct { 28 | char* memoryBlock; 29 | char* currentPtr; 30 | int size; 31 | } MemoryAllocator; 32 | 33 | void 34 | MemoryAllocator_init(MemoryAllocator* self, char* memoryBlock, int size); 35 | 36 | char* 37 | MemoryAllocator_allocate(MemoryAllocator* self, int size); 38 | 39 | #endif /* SIMPLE_ALLOCATOR_H_ */ 40 | -------------------------------------------------------------------------------- /src/common/string_map.c: -------------------------------------------------------------------------------- 1 | /* 2 | * string_map.c 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #include "libiec61850_platform_includes.h" 25 | #include "string_map.h" 26 | 27 | Map 28 | StringMap_create() { 29 | Map map = Map_create(); 30 | map->compareKeys = (int (*) (void*, void*)) strcmp; 31 | return map; 32 | } 33 | -------------------------------------------------------------------------------- /src/common/string_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * string_map.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #include "map.h" 25 | 26 | Map 27 | StringMap_create(void); 28 | 29 | -------------------------------------------------------------------------------- /src/doxygen/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/doxygen/libIEC61850_server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/careychow/libIEC61850/5b60884d5ff6836ec4e62d2efe7636eee874f9e5/src/doxygen/libIEC61850_server.png -------------------------------------------------------------------------------- /src/goose/iec61850_goose.asn: -------------------------------------------------------------------------------- 1 | IEC61850 DEFINITIONS ::= BEGIN 2 | 3 | IEC61850SpecificProtocol ::= CHOICE { 4 | -- gseMngtPdu [APPLICATION 0] IMPLICIT GSEMngtPdu, 5 | goosePdu [APPLICATION 1] IMPLICIT IECGoosePdu 6 | } 7 | 8 | IECGoosePdu ::= SEQUENCE { 9 | gocbRef [0] IMPLICIT VisibleString, 10 | timeAllowedtoLive [1] IMPLICIT INTEGER, 11 | datSet [2] IMPLICIT VisibleString, 12 | goID [3] IMPLICIT VisibleString OPTIONAL, 13 | t [4] IMPLICIT UtcTime, 14 | stNum [5] IMPLICIT INTEGER, 15 | sqNum [6] IMPLICIT INTEGER, 16 | simulation [7] IMPLICIT BOOLEAN DEFAULT FALSE, 17 | confRev [8] IMPLICIT INTEGER, 18 | ndsCom [9] IMPLICIT BOOLEAN DEFAULT FALSE, 19 | numDatSetEntries [10] IMPLICIT INTEGER, 20 | allData [11] IMPLICIT SEQUENCE OF Data 21 | } 22 | 23 | Data ::= CHOICE 24 | { 25 | -- context tag 0 is reserved for AccessResult 26 | array [1] IMPLICIT DataSequence, 27 | structure [2] IMPLICIT DataSequence, 28 | boolean [3] IMPLICIT BOOLEAN, 29 | bitstring [4] IMPLICIT BIT STRING, 30 | integer [5] IMPLICIT INTEGER, 31 | unsigned [6] IMPLICIT INTEGER, -- shall not be negative 32 | floatingpoint [7] IMPLICIT FloatingPoint, 33 | -- [8] is reserved 34 | octetstring [9] IMPLICIT OCTET STRING, 35 | visiblestring [10] IMPLICIT VisibleString, 36 | generalizedtime [11] IMPLICIT GeneralizedTime, 37 | binarytime [12] IMPLICIT TimeOfDay, 38 | bcd [13] IMPLICIT INTEGER, 39 | booleanArray [14] IMPLICIT BIT STRING, 40 | --objId [15] IMPLICIT OBJECT IDENTIFIER 41 | mMSString [16] IMPLICIT MMSString, -- unicode string 42 | utctime [17] IMPLICIT UtcTime --UTC Time 43 | } 44 | 45 | DataSequence ::= SEQUENCE OF Data 46 | 47 | FloatingPoint ::= OCTET STRING 48 | 49 | UtcTime ::= OCTET STRING 50 | 51 | MMSString ::= UTF8String 52 | 53 | TimeOfDay ::= OCTET STRING -- (SIZE (4 | 6)) 54 | 55 | END 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/hal/hal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * hal.c 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | 25 | #include "libiec61850_platform_includes.h" 26 | 27 | #include "stack_config.h" 28 | 29 | #include 30 | 31 | #if defined __linux__ || defined __APPLE__ 32 | 33 | #ifdef CONFIG_SYSTEM_HAS_CLOCK_GETTIME 34 | uint64_t 35 | Hal_getTimeInMs() 36 | { 37 | struct timespec tp; 38 | 39 | clock_gettime(CLOCK_REALTIME, &tp); 40 | 41 | return ((uint64_t) tp.tv_sec) * 1000LL + (tp.tv_nsec / 1000000); 42 | } 43 | #else 44 | 45 | #include 46 | 47 | uint64_t 48 | Hal_getTimeInMs() 49 | { 50 | struct timeval now; 51 | 52 | gettimeofday(&now, NULL); 53 | 54 | return ((uint64_t) now.tv_sec * 1000LL) + (now.tv_usec / 1000); 55 | } 56 | 57 | #endif 58 | 59 | #elif defined _WIN32 60 | #include "windows.h" 61 | 62 | uint64_t 63 | Hal_getTimeInMs() 64 | { 65 | FILETIME ft; 66 | uint64_t now; 67 | 68 | static const uint64_t DIFF_TO_UNIXTIME = 11644473600000LL; 69 | 70 | GetSystemTimeAsFileTime(&ft); 71 | 72 | now = (LONGLONG)ft.dwLowDateTime + ((LONGLONG)(ft.dwHighDateTime) << 32LL); 73 | 74 | return (now / 10000LL) - DIFF_TO_UNIXTIME; 75 | } 76 | #endif 77 | -------------------------------------------------------------------------------- /src/hal/hal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hal.c 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef HAL_C_ 25 | #define HAL_C_ 26 | 27 | /*! \addtogroup hal 28 | * 29 | * @{ 30 | */ 31 | 32 | /** 33 | * @defgroup HAL_TIME Time related functions 34 | * 35 | * @{ 36 | */ 37 | 38 | /** 39 | * Get the system time in milliseconds. 40 | * 41 | * The time value returned as 64-bit unsigned integer should represent the milliseconds 42 | * since the UNIX epoch (1970/01/01 00:00 UTC). 43 | * 44 | * \return the system time with millisecond resolution. 45 | */ 46 | uint64_t Hal_getTimeInMs(void); 47 | 48 | /*! @} */ 49 | 50 | /*! @} */ 51 | 52 | #endif /* HAL_C_ */ 53 | -------------------------------------------------------------------------------- /src/hal/platform_endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | * endian.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef ENDIAN_H_ 25 | #define ENDIAN_H_ 26 | 27 | #include "stack_config.h" 28 | 29 | #ifndef PLATFORM_IS_BIGENDIAN 30 | #ifdef __GNUC__ 31 | #ifdef __BYTE_ORDER__ 32 | #if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) 33 | #define PLATFORM_IS_BIGENDIAN 1 34 | #endif 35 | #endif /* __BYTE_ORDER__ */ 36 | #endif /* __GNUC__ */ 37 | #endif 38 | 39 | #if (PLATFORM_IS_BIGENDIAN == 1) 40 | # define ORDER_LITTLE_ENDIAN 0 41 | #else 42 | # define ORDER_LITTLE_ENDIAN 1 43 | #endif 44 | 45 | #endif /* ENDIAN_H_ */ 46 | -------------------------------------------------------------------------------- /src/iedserver/mms_mapping/mms_mapping_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_mapping_internal.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef MMS_MAPPING_INTERNAL_H_ 25 | #define MMS_MAPPING_INTERNAL_H_ 26 | 27 | #include "thread.h" 28 | #include "linked_list.h" 29 | 30 | struct sMmsMapping { 31 | IedModel* model; 32 | MmsDevice* mmsDevice; 33 | MmsServer mmsServer; 34 | LinkedList reportControls; 35 | LinkedList gseControls; 36 | LinkedList controlObjects; 37 | LinkedList observedObjects; 38 | LinkedList attributeAccessHandlers; 39 | 40 | bool reportThreadRunning; 41 | bool reportThreadFinished; 42 | Thread reportWorkerThread; 43 | 44 | IedServer iedServer; 45 | 46 | IedConnectionIndicationHandler connectionIndicationHandler; 47 | void* connectionIndicationHandlerParameter; 48 | }; 49 | 50 | #endif /* MMS_MAPPING_INTERNAL_H_ */ 51 | -------------------------------------------------------------------------------- /src/iedserver/model/config_file_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * config_file_parser.h 3 | * 4 | * Copyright 2014 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef CONFIG_FILE_PARSER_H_ 25 | #define CONFIG_FILE_PARSER_H_ 26 | 27 | /** \addtogroup server_api_group 28 | * @{ 29 | */ 30 | 31 | /** 32 | * @defgroup CONFIG_FILE_PARSER Create data models by configuration files 33 | * 34 | * @{ 35 | */ 36 | 37 | IedModel* 38 | ConfigFileParser_createModelFromConfigFile(FileHandle fileHandle); 39 | 40 | /**@}*/ 41 | 42 | /**@}*/ 43 | 44 | #endif /* CONFIG_FILE_PARSER_H_ */ 45 | -------------------------------------------------------------------------------- /src/mms/asn1/asn1_ber_primitive_value.h: -------------------------------------------------------------------------------- 1 | /* 2 | * asn1_ber_primitive_value.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef ASN1_BER_PRIMITIVE_VALUE_H_ 25 | #define ASN1_BER_PRIMITIVE_VALUE_H_ 26 | 27 | #include "libiec61850_common_api.h" 28 | 29 | typedef struct ATTRIBUTE_PACKED { 30 | uint8_t size; 31 | uint8_t maxSize; 32 | uint8_t* octets; 33 | } Asn1PrimitiveValue; 34 | 35 | Asn1PrimitiveValue* 36 | Asn1PrimitiveValue_create(int size); 37 | 38 | int 39 | Asn1PrimitiveValue_getSize(Asn1PrimitiveValue* self); 40 | 41 | int 42 | Asn1PrimitiveValue_getMaxSize(Asn1PrimitiveValue* self); 43 | 44 | Asn1PrimitiveValue* 45 | Asn1PrimitiveValue_clone(Asn1PrimitiveValue* self); 46 | 47 | bool 48 | Asn1PrimitivaValue_compare(Asn1PrimitiveValue* self, Asn1PrimitiveValue* otherValue); 49 | 50 | void 51 | Asn1PrimitiveValue_destroy(Asn1PrimitiveValue* self); 52 | 53 | #endif /* ASN1_BER_PRIMITIVE_VALUE_H_ */ 54 | -------------------------------------------------------------------------------- /src/mms/asn1/ber_decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ber_decode.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef BER_DECODER_H_ 25 | #define BER_DECODER_H_ 26 | 27 | #include "libiec61850_platform_includes.h" 28 | 29 | int 30 | BerDecoder_decodeLength(uint8_t* buffer, int* length, int bufPos, int maxBufPos); 31 | char* 32 | BerDecoder_decodeString(uint8_t* buffer, int strlen, int bufPos, int maxBufPos); 33 | 34 | uint32_t 35 | BerDecoder_decodeUint32(uint8_t* buffer, int intlen, int bufPos); 36 | 37 | float 38 | BerDecoder_decodeFloat(uint8_t* buffer, int bufPos); 39 | 40 | double 41 | BerDecoder_decodeDouble(uint8_t* buffer, int bufPos); 42 | 43 | bool 44 | BerDecoder_decodeBoolean(uint8_t* buffer, int bufPos); 45 | 46 | #endif /* BER_DECODER_H_ */ 47 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/Address.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _Address_H_ 9 | #define _Address_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Unsigned32.h" 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Dependencies */ 25 | typedef enum Address_PR { 26 | Address_PR_NOTHING, /* No components present */ 27 | Address_PR_numericAddress, 28 | Address_PR_symbolicAddress, 29 | Address_PR_unconstrainedAddress 30 | } Address_PR; 31 | 32 | /* Address */ 33 | typedef struct Address { 34 | Address_PR present; 35 | union Address_u { 36 | Unsigned32_t numericAddress; 37 | VisibleString_t symbolicAddress; 38 | OCTET_STRING_t unconstrainedAddress; 39 | } choice; 40 | 41 | /* Context for parsing across buffer boundaries */ 42 | asn_struct_ctx_t _asn_ctx; 43 | } Address_t; 44 | 45 | /* Implementation */ 46 | extern asn_TYPE_descriptor_t asn_DEF_Address; 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* _Address_H_ */ 53 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/AlternateAccess.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _AlternateAccess_H_ 9 | #define _AlternateAccess_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include "Identifier.h" 17 | #include 18 | #include 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* Dependencies */ 26 | typedef enum AlternateAccess__Member_PR { 27 | AlternateAccess__Member_PR_NOTHING, /* No components present */ 28 | AlternateAccess__Member_PR_unnamed, 29 | AlternateAccess__Member_PR_named 30 | } AlternateAccess__Member_PR; 31 | 32 | /* Forward declarations */ 33 | struct AlternateAccessSelection; 34 | 35 | struct AlternateAccess__Member { 36 | AlternateAccess__Member_PR present; 37 | union AlternateAccess__Member_u { 38 | struct AlternateAccessSelection *unnamed; 39 | struct named { 40 | Identifier_t componentName; 41 | struct AlternateAccessSelection *access; 42 | 43 | /* Context for parsing across buffer boundaries */ 44 | asn_struct_ctx_t _asn_ctx; 45 | } named; 46 | } choice; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | }; 51 | 52 | /* AlternateAccess */ 53 | typedef struct AlternateAccess { 54 | A_SEQUENCE_OF(struct AlternateAccess__Member) list; 55 | 56 | /* Context for parsing across buffer boundaries */ 57 | asn_struct_ctx_t _asn_ctx; 58 | } AlternateAccess_t; 59 | 60 | /* Implementation */ 61 | extern asn_TYPE_descriptor_t asn_DEF_AlternateAccess; 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | /* Referred external types */ 68 | #include "AlternateAccessSelection.h" 69 | 70 | #endif /* _AlternateAccess_H_ */ 71 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/BIT_STRING.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _BIT_STRING_H_ 6 | #define _BIT_STRING_H_ 7 | 8 | #include /* Some help from OCTET STRING */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct BIT_STRING_s { 15 | uint8_t *buf; /* BIT STRING body */ 16 | int size; /* Size of the above buffer */ 17 | 18 | int bits_unused;/* Unused trailing bits in the last octet (0..7) */ 19 | 20 | asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ 21 | } BIT_STRING_t; 22 | 23 | extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; 24 | 25 | asn_struct_print_f BIT_STRING_print; /* Human-readable output */ 26 | asn_constr_check_f BIT_STRING_constraint; 27 | xer_type_encoder_f BIT_STRING_encode_xer; 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* _BIT_STRING_H_ */ 34 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/BOOLEAN.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _BOOLEAN_H_ 6 | #define _BOOLEAN_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* 15 | * The underlying integer may contain various values, but everything 16 | * non-zero is capped to 0xff by the DER encoder. The BER decoder may 17 | * yield non-zero values different from 1, beware. 18 | */ 19 | typedef int BOOLEAN_t; 20 | 21 | extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; 22 | 23 | asn_struct_free_f BOOLEAN_free; 24 | asn_struct_print_f BOOLEAN_print; 25 | ber_type_decoder_f BOOLEAN_decode_ber; 26 | der_type_encoder_f BOOLEAN_encode_der; 27 | xer_type_decoder_f BOOLEAN_decode_xer; 28 | xer_type_encoder_f BOOLEAN_encode_xer; 29 | per_type_decoder_f BOOLEAN_decode_uper; 30 | per_type_encoder_f BOOLEAN_encode_uper; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* _BOOLEAN_H_ */ 37 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ConcludeRequestPDU.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ConcludeRequestPDU_H_ 9 | #define _ConcludeRequestPDU_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* ConcludeRequestPDU */ 22 | typedef NULL_t ConcludeRequestPDU_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_ConcludeRequestPDU; 26 | asn_struct_free_f ConcludeRequestPDU_free; 27 | asn_struct_print_f ConcludeRequestPDU_print; 28 | asn_constr_check_f ConcludeRequestPDU_constraint; 29 | ber_type_decoder_f ConcludeRequestPDU_decode_ber; 30 | der_type_encoder_f ConcludeRequestPDU_encode_der; 31 | xer_type_decoder_f ConcludeRequestPDU_decode_xer; 32 | xer_type_encoder_f ConcludeRequestPDU_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _ConcludeRequestPDU_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ConcludeResponsePDU.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ConcludeResponsePDU_H_ 9 | #define _ConcludeResponsePDU_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* ConcludeResponsePDU */ 22 | typedef NULL_t ConcludeResponsePDU_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_ConcludeResponsePDU; 26 | asn_struct_free_f ConcludeResponsePDU_free; 27 | asn_struct_print_f ConcludeResponsePDU_print; 28 | asn_constr_check_f ConcludeResponsePDU_constraint; 29 | ber_type_decoder_f ConcludeResponsePDU_decode_ber; 30 | der_type_encoder_f ConcludeResponsePDU_encode_der; 31 | xer_type_decoder_f ConcludeResponsePDU_decode_xer; 32 | xer_type_encoder_f ConcludeResponsePDU_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _ConcludeResponsePDU_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ConfirmedErrorPDU.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ConfirmedErrorPDU_H_ 9 | #define _ConfirmedErrorPDU_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Unsigned32.h" 16 | #include "ServiceError.h" 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* ConfirmedErrorPDU */ 24 | typedef struct ConfirmedErrorPDU { 25 | Unsigned32_t invokeID; 26 | ServiceError_t serviceError; 27 | 28 | /* Context for parsing across buffer boundaries */ 29 | asn_struct_ctx_t _asn_ctx; 30 | } ConfirmedErrorPDU_t; 31 | 32 | /* Implementation */ 33 | extern asn_TYPE_descriptor_t asn_DEF_ConfirmedErrorPDU; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _ConfirmedErrorPDU_H_ */ 40 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ConfirmedRequestPdu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ConfirmedRequestPdu_H_ 9 | #define _ConfirmedRequestPdu_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Unsigned32.h" 16 | #include "ConfirmedServiceRequest.h" 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* ConfirmedRequestPdu */ 24 | typedef struct ConfirmedRequestPdu { 25 | Unsigned32_t invokeID; 26 | ConfirmedServiceRequest_t confirmedServiceRequest; 27 | 28 | /* Context for parsing across buffer boundaries */ 29 | asn_struct_ctx_t _asn_ctx; 30 | } ConfirmedRequestPdu_t; 31 | 32 | /* Implementation */ 33 | extern asn_TYPE_descriptor_t asn_DEF_ConfirmedRequestPdu; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _ConfirmedRequestPdu_H_ */ 40 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ConfirmedResponsePdu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ConfirmedResponsePdu_H_ 9 | #define _ConfirmedResponsePdu_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Unsigned32.h" 16 | #include "ConfirmedServiceResponse.h" 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* ConfirmedResponsePdu */ 24 | typedef struct ConfirmedResponsePdu { 25 | Unsigned32_t invokeID; 26 | ConfirmedServiceResponse_t confirmedServiceResponse; 27 | 28 | /* Context for parsing across buffer boundaries */ 29 | asn_struct_ctx_t _asn_ctx; 30 | } ConfirmedResponsePdu_t; 31 | 32 | /* Implementation */ 33 | extern asn_TYPE_descriptor_t asn_DEF_ConfirmedResponsePdu; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _ConfirmedResponsePdu_H_ */ 40 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/DataAccessError.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _DataAccessError_H_ 9 | #define _DataAccessError_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Dependencies */ 22 | typedef enum DataAccessError { 23 | DataAccessError_objectinvalidated = 0, 24 | DataAccessError_hardwarefault = 1, 25 | DataAccessError_temporarilyunavailable = 2, 26 | DataAccessError_objectaccessdenied = 3, 27 | DataAccessError_objectundefined = 4, 28 | DataAccessError_invalidaddress = 5, 29 | DataAccessError_typeunsupported = 6, 30 | DataAccessError_typeinconsistent = 7, 31 | DataAccessError_objectattributeinconsistent = 8, 32 | DataAccessError_objectaccessunsupported = 9, 33 | DataAccessError_objectnonexistent = 10, 34 | DataAccessError_objectvalueinvalid = 11 35 | } e_DataAccessError; 36 | 37 | /* DataAccessError */ 38 | typedef INTEGER_t DataAccessError_t; 39 | 40 | /* Implementation */ 41 | extern asn_TYPE_descriptor_t asn_DEF_DataAccessError; 42 | asn_struct_free_f DataAccessError_free; 43 | asn_struct_print_f DataAccessError_print; 44 | asn_constr_check_f DataAccessError_constraint; 45 | ber_type_decoder_f DataAccessError_decode_ber; 46 | der_type_encoder_f DataAccessError_encode_der; 47 | xer_type_decoder_f DataAccessError_decode_xer; 48 | xer_type_encoder_f DataAccessError_encode_xer; 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* _DataAccessError_H_ */ 55 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/DataSequence.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #include 9 | 10 | #include "DataSequence.h" 11 | 12 | static asn_TYPE_member_t asn_MBR_DataSequence_1[] = { 13 | { ATF_POINTER, 0, 0, 14 | -1 /* Ambiguous tag (CHOICE?) */, 15 | 0, 16 | &asn_DEF_Data, 17 | 0, /* Defer constraints checking to the member type */ 18 | 0, /* PER is not compiled, use -gen-PER */ 19 | 0, 20 | "" 21 | }, 22 | }; 23 | static ber_tlv_tag_t asn_DEF_DataSequence_tags_1[] = { 24 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 25 | }; 26 | static asn_SET_OF_specifics_t asn_SPC_DataSequence_specs_1 = { 27 | sizeof(struct DataSequence), 28 | offsetof(struct DataSequence, _asn_ctx), 29 | 2, /* XER encoding is XMLValueList */ 30 | }; 31 | asn_TYPE_descriptor_t asn_DEF_DataSequence = { 32 | "DataSequence", 33 | "DataSequence", 34 | SEQUENCE_OF_free, 35 | SEQUENCE_OF_print, 36 | SEQUENCE_OF_constraint, 37 | SEQUENCE_OF_decode_ber, 38 | SEQUENCE_OF_encode_der, 39 | SEQUENCE_OF_decode_xer, 40 | SEQUENCE_OF_encode_xer, 41 | 0, 0, /* No PER support, use "-gen-PER" to enable */ 42 | 0, /* Use generic outmost tag fetcher */ 43 | asn_DEF_DataSequence_tags_1, 44 | sizeof(asn_DEF_DataSequence_tags_1) 45 | /sizeof(asn_DEF_DataSequence_tags_1[0]), /* 1 */ 46 | asn_DEF_DataSequence_tags_1, /* Same as above */ 47 | sizeof(asn_DEF_DataSequence_tags_1) 48 | /sizeof(asn_DEF_DataSequence_tags_1[0]), /* 1 */ 49 | 0, /* No PER visible constraints */ 50 | asn_MBR_DataSequence_1, 51 | 1, /* Single element */ 52 | &asn_SPC_DataSequence_specs_1 /* Additional specs */ 53 | }; 54 | 55 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/DataSequence.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _DataSequence_H_ 9 | #define _DataSequence_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* Forward declarations */ 23 | struct Data; 24 | 25 | /* DataSequence */ 26 | typedef struct DataSequence { 27 | A_SEQUENCE_OF(struct Data) list; 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } DataSequence_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_DataSequence; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | /* Referred external types */ 41 | #include "Data.h" 42 | 43 | #endif /* _DataSequence_H_ */ 44 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/DefineNamedVariableListRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _DefineNamedVariableListRequest_H_ 9 | #define _DefineNamedVariableListRequest_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "ObjectName.h" 16 | #include 17 | #include "VariableSpecification.h" 18 | #include 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* Forward declarations */ 26 | struct AlternateAccess; 27 | 28 | struct DefineNamedVariableListRequest__listOfVariable__Member { 29 | VariableSpecification_t variableSpecification; 30 | struct AlternateAccess *alternateAccess /* OPTIONAL */; 31 | 32 | /* Context for parsing across buffer boundaries */ 33 | asn_struct_ctx_t _asn_ctx; 34 | } ; 35 | 36 | /* DefineNamedVariableListRequest */ 37 | typedef struct DefineNamedVariableListRequest { 38 | ObjectName_t variableListName; 39 | struct DefineNamedVariableListRequest__listOfVariable { 40 | A_SEQUENCE_OF(struct DefineNamedVariableListRequest__listOfVariable__Member) list; 41 | 42 | /* Context for parsing across buffer boundaries */ 43 | asn_struct_ctx_t _asn_ctx; 44 | } listOfVariable; 45 | 46 | /* Context for parsing across buffer boundaries */ 47 | asn_struct_ctx_t _asn_ctx; 48 | } DefineNamedVariableListRequest_t; 49 | 50 | /* Implementation */ 51 | extern asn_TYPE_descriptor_t asn_DEF_DefineNamedVariableListRequest; 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | /* Referred external types */ 58 | #include "AlternateAccess.h" 59 | 60 | #endif /* _DefineNamedVariableListRequest_H_ */ 61 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/DefineNamedVariableListResponse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _DefineNamedVariableListResponse_H_ 9 | #define _DefineNamedVariableListResponse_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* DefineNamedVariableListResponse */ 22 | typedef NULL_t DefineNamedVariableListResponse_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_DefineNamedVariableListResponse; 26 | asn_struct_free_f DefineNamedVariableListResponse_free; 27 | asn_struct_print_f DefineNamedVariableListResponse_print; 28 | asn_constr_check_f DefineNamedVariableListResponse_constraint; 29 | ber_type_decoder_f DefineNamedVariableListResponse_decode_ber; 30 | der_type_encoder_f DefineNamedVariableListResponse_encode_der; 31 | xer_type_decoder_f DefineNamedVariableListResponse_decode_xer; 32 | xer_type_encoder_f DefineNamedVariableListResponse_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _DefineNamedVariableListResponse_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/DeleteNamedVariableListRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _DeleteNamedVariableListRequest_H_ 9 | #define _DeleteNamedVariableListRequest_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include "Identifier.h" 17 | #include 18 | #include 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* Dependencies */ 26 | typedef enum DeleteNamedVariableListRequest__scopeOfDelete { 27 | DeleteNamedVariableListRequest__scopeOfDelete_specific = 0, 28 | DeleteNamedVariableListRequest__scopeOfDelete_aaspecific = 1, 29 | DeleteNamedVariableListRequest__scopeOfDelete_domain = 2, 30 | DeleteNamedVariableListRequest__scopeOfDelete_vmd = 3 31 | } e_DeleteNamedVariableListRequest__scopeOfDelete; 32 | 33 | /* Forward declarations */ 34 | struct ObjectName; 35 | 36 | struct DeleteNamedVariableListRequest__listOfVariableListName { 37 | A_SEQUENCE_OF(struct ObjectName) list; 38 | 39 | /* Context for parsing across buffer boundaries */ 40 | asn_struct_ctx_t _asn_ctx; 41 | }; 42 | 43 | /* DeleteNamedVariableListRequest */ 44 | typedef struct DeleteNamedVariableListRequest { 45 | INTEGER_t *scopeOfDelete /* DEFAULT 0 */; 46 | struct DeleteNamedVariableListRequest__listOfVariableListName *listOfVariableListName; 47 | Identifier_t *domainName /* OPTIONAL */; 48 | 49 | /* Context for parsing across buffer boundaries */ 50 | asn_struct_ctx_t _asn_ctx; 51 | } DeleteNamedVariableListRequest_t; 52 | 53 | /* Implementation */ 54 | extern asn_TYPE_descriptor_t asn_DEF_DeleteNamedVariableListRequest; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | /* Referred external types */ 61 | #include "ObjectName.h" 62 | 63 | #endif /* _DeleteNamedVariableListRequest_H_ */ 64 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/DeleteNamedVariableListResponse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _DeleteNamedVariableListResponse_H_ 9 | #define _DeleteNamedVariableListResponse_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Unsigned32.h" 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* DeleteNamedVariableListResponse */ 23 | typedef struct DeleteNamedVariableListResponse { 24 | Unsigned32_t numberMatched; 25 | Unsigned32_t numberDeleted; 26 | 27 | /* Context for parsing across buffer boundaries */ 28 | asn_struct_ctx_t _asn_ctx; 29 | } DeleteNamedVariableListResponse_t; 30 | 31 | /* Implementation */ 32 | extern asn_TYPE_descriptor_t asn_DEF_DeleteNamedVariableListResponse; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _DeleteNamedVariableListResponse_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/FloatingPoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _FloatingPoint_H_ 9 | #define _FloatingPoint_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* FloatingPoint */ 22 | typedef OCTET_STRING_t FloatingPoint_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_FloatingPoint; 26 | asn_struct_free_f FloatingPoint_free; 27 | asn_struct_print_f FloatingPoint_print; 28 | asn_constr_check_f FloatingPoint_constraint; 29 | ber_type_decoder_f FloatingPoint_decode_ber; 30 | der_type_encoder_f FloatingPoint_encode_der; 31 | xer_type_decoder_f FloatingPoint_decode_xer; 32 | xer_type_encoder_f FloatingPoint_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _FloatingPoint_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/GetNameListRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _GetNameListRequest_H_ 9 | #define _GetNameListRequest_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "ObjectClass.h" 16 | #include "Identifier.h" 17 | #include 18 | #include 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* Dependencies */ 26 | typedef enum GetNameListRequest__objectScope_PR { 27 | GetNameListRequest__objectScope_PR_NOTHING, /* No components present */ 28 | GetNameListRequest__objectScope_PR_vmdSpecific, 29 | GetNameListRequest__objectScope_PR_domainSpecific, 30 | GetNameListRequest__objectScope_PR_aaSpecific 31 | } GetNameListRequest__objectScope_PR; 32 | 33 | /* GetNameListRequest */ 34 | typedef struct GetNameListRequest { 35 | ObjectClass_t objectClass; 36 | struct GetNameListRequest__objectScope { 37 | GetNameListRequest__objectScope_PR present; 38 | union GetNameListRequest__objectScope_u { 39 | NULL_t vmdSpecific; 40 | Identifier_t domainSpecific; 41 | NULL_t aaSpecific; 42 | } choice; 43 | 44 | /* Context for parsing across buffer boundaries */ 45 | asn_struct_ctx_t _asn_ctx; 46 | } objectScope; 47 | Identifier_t *continueAfter /* OPTIONAL */; 48 | 49 | /* Context for parsing across buffer boundaries */ 50 | asn_struct_ctx_t _asn_ctx; 51 | } GetNameListRequest_t; 52 | 53 | /* Implementation */ 54 | extern asn_TYPE_descriptor_t asn_DEF_GetNameListRequest; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _GetNameListRequest_H_ */ 61 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/GetNameListResponse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _GetNameListResponse_H_ 9 | #define _GetNameListResponse_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include "Identifier.h" 17 | #include 18 | #include 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* GetNameListResponse */ 26 | typedef struct GetNameListResponse { 27 | struct GetNameListResponse__listOfIdentifier { 28 | A_SEQUENCE_OF(Identifier_t) list; 29 | 30 | /* Context for parsing across buffer boundaries */ 31 | asn_struct_ctx_t _asn_ctx; 32 | } listOfIdentifier; 33 | BOOLEAN_t *moreFollows /* DEFAULT TRUE */; 34 | 35 | /* Context for parsing across buffer boundaries */ 36 | asn_struct_ctx_t _asn_ctx; 37 | } GetNameListResponse_t; 38 | 39 | /* Implementation */ 40 | extern asn_TYPE_descriptor_t asn_DEF_GetNameListResponse; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _GetNameListResponse_H_ */ 47 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/GetNamedVariableListAttributesRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _GetNamedVariableListAttributesRequest_H_ 9 | #define _GetNamedVariableListAttributesRequest_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "ObjectName.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* GetNamedVariableListAttributesRequest */ 22 | typedef ObjectName_t GetNamedVariableListAttributesRequest_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_GetNamedVariableListAttributesRequest; 26 | asn_struct_free_f GetNamedVariableListAttributesRequest_free; 27 | asn_struct_print_f GetNamedVariableListAttributesRequest_print; 28 | asn_constr_check_f GetNamedVariableListAttributesRequest_constraint; 29 | ber_type_decoder_f GetNamedVariableListAttributesRequest_decode_ber; 30 | der_type_encoder_f GetNamedVariableListAttributesRequest_encode_der; 31 | xer_type_decoder_f GetNamedVariableListAttributesRequest_decode_xer; 32 | xer_type_encoder_f GetNamedVariableListAttributesRequest_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _GetNamedVariableListAttributesRequest_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/GetNamedVariableListAttributesResponse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _GetNamedVariableListAttributesResponse_H_ 9 | #define _GetNamedVariableListAttributesResponse_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include 17 | #include "VariableSpecification.h" 18 | #include 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* Forward declarations */ 26 | struct AlternateAccess; 27 | 28 | struct GetNamedVariableListAttributesResponse__listOfVariable__Member { 29 | VariableSpecification_t variableSpecification; 30 | struct AlternateAccess *alternateAccess /* OPTIONAL */; 31 | 32 | /* Context for parsing across buffer boundaries */ 33 | asn_struct_ctx_t _asn_ctx; 34 | } ; 35 | 36 | struct GetNamedVariableListAttributesResponse__listOfVariable { 37 | A_SEQUENCE_OF(struct GetNamedVariableListAttributesResponse__listOfVariable__Member) list; 38 | 39 | /* Context for parsing across buffer boundaries */ 40 | asn_struct_ctx_t _asn_ctx; 41 | }; 42 | 43 | /* GetNamedVariableListAttributesResponse */ 44 | typedef struct GetNamedVariableListAttributesResponse { 45 | BOOLEAN_t mmsDeletable; 46 | struct GetNamedVariableListAttributesResponse__listOfVariable listOfVariable; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | } GetNamedVariableListAttributesResponse_t; 51 | 52 | /* Implementation */ 53 | extern asn_TYPE_descriptor_t asn_DEF_GetNamedVariableListAttributesResponse; 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | /* Referred external types */ 60 | #include "AlternateAccess.h" 61 | 62 | #endif /* _GetNamedVariableListAttributesResponse_H_ */ 63 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/GetVariableAccessAttributesRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _GetVariableAccessAttributesRequest_H_ 9 | #define _GetVariableAccessAttributesRequest_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "ObjectName.h" 16 | #include "Address.h" 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* Dependencies */ 24 | typedef enum GetVariableAccessAttributesRequest_PR { 25 | GetVariableAccessAttributesRequest_PR_NOTHING, /* No components present */ 26 | GetVariableAccessAttributesRequest_PR_name, 27 | GetVariableAccessAttributesRequest_PR_address 28 | } GetVariableAccessAttributesRequest_PR; 29 | 30 | /* GetVariableAccessAttributesRequest */ 31 | typedef struct GetVariableAccessAttributesRequest { 32 | GetVariableAccessAttributesRequest_PR present; 33 | union GetVariableAccessAttributesRequest_u { 34 | ObjectName_t name; 35 | Address_t address; 36 | } choice; 37 | 38 | /* Context for parsing across buffer boundaries */ 39 | asn_struct_ctx_t _asn_ctx; 40 | } GetVariableAccessAttributesRequest_t; 41 | 42 | /* Implementation */ 43 | extern asn_TYPE_descriptor_t asn_DEF_GetVariableAccessAttributesRequest; 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* _GetVariableAccessAttributesRequest_H_ */ 50 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/GetVariableAccessAttributesResponse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _GetVariableAccessAttributesResponse_H_ 9 | #define _GetVariableAccessAttributesResponse_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include "TypeSpecification.h" 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* Forward declarations */ 24 | struct Address; 25 | 26 | /* GetVariableAccessAttributesResponse */ 27 | typedef struct GetVariableAccessAttributesResponse { 28 | BOOLEAN_t mmsDeletable; 29 | struct Address *address /* OPTIONAL */; 30 | TypeSpecification_t typeSpecification; 31 | 32 | /* Context for parsing across buffer boundaries */ 33 | asn_struct_ctx_t _asn_ctx; 34 | } GetVariableAccessAttributesResponse_t; 35 | 36 | /* Implementation */ 37 | extern asn_TYPE_descriptor_t asn_DEF_GetVariableAccessAttributesResponse; 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | /* Referred external types */ 44 | #include "Address.h" 45 | 46 | #endif /* _GetVariableAccessAttributesResponse_H_ */ 47 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/Identifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _Identifier_H_ 9 | #define _Identifier_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Identifier */ 22 | typedef VisibleString_t Identifier_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_Identifier; 26 | asn_struct_free_f Identifier_free; 27 | asn_struct_print_f Identifier_print; 28 | asn_constr_check_f Identifier_constraint; 29 | ber_type_decoder_f Identifier_decode_ber; 30 | der_type_encoder_f Identifier_encode_der; 31 | xer_type_decoder_f Identifier_decode_xer; 32 | xer_type_encoder_f Identifier_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Identifier_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/IndexRangeSeq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _IndexRangeSeq_H_ 9 | #define _IndexRangeSeq_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Unsigned32.h" 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* IndexRangeSeq */ 23 | typedef struct IndexRangeSeq { 24 | Unsigned32_t lowIndex; 25 | Unsigned32_t numberOfElements; 26 | 27 | /* Context for parsing across buffer boundaries */ 28 | asn_struct_ctx_t _asn_ctx; 29 | } IndexRangeSeq_t; 30 | 31 | /* Implementation */ 32 | extern asn_TYPE_descriptor_t asn_DEF_IndexRangeSeq; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _IndexRangeSeq_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/InformationReport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _InformationReport_H_ 9 | #define _InformationReport_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "VariableAccessSpecification.h" 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Forward declarations */ 25 | struct AccessResult; 26 | 27 | /* InformationReport */ 28 | typedef struct InformationReport { 29 | VariableAccessSpecification_t variableAccessSpecification; 30 | struct InformationReport__listOfAccessResult { 31 | A_SEQUENCE_OF(struct AccessResult) list; 32 | 33 | /* Context for parsing across buffer boundaries */ 34 | asn_struct_ctx_t _asn_ctx; 35 | } listOfAccessResult; 36 | 37 | /* Context for parsing across buffer boundaries */ 38 | asn_struct_ctx_t _asn_ctx; 39 | } InformationReport_t; 40 | 41 | /* Implementation */ 42 | extern asn_TYPE_descriptor_t asn_DEF_InformationReport; 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | /* Referred external types */ 49 | #include "AccessResult.h" 50 | 51 | #endif /* _InformationReport_H_ */ 52 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/InitRequestDetail.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _InitRequestDetail_H_ 9 | #define _InitRequestDetail_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Integer16.h" 16 | #include "ParameterSupportOptions.h" 17 | #include "ServiceSupportOptions.h" 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* InitRequestDetail */ 25 | typedef struct InitRequestDetail { 26 | Integer16_t proposedVersionNumber; 27 | ParameterSupportOptions_t proposedParameterCBB; 28 | ServiceSupportOptions_t servicesSupportedCalling; 29 | 30 | /* Context for parsing across buffer boundaries */ 31 | asn_struct_ctx_t _asn_ctx; 32 | } InitRequestDetail_t; 33 | 34 | /* Implementation */ 35 | extern asn_TYPE_descriptor_t asn_DEF_InitRequestDetail; 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* _InitRequestDetail_H_ */ 42 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/InitResponseDetail.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _InitResponseDetail_H_ 9 | #define _InitResponseDetail_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Integer16.h" 16 | #include "ParameterSupportOptions.h" 17 | #include "ServiceSupportOptions.h" 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* InitResponseDetail */ 25 | typedef struct InitResponseDetail { 26 | Integer16_t negotiatedVersionNumber; 27 | ParameterSupportOptions_t negotiatedParameterCBB; 28 | ServiceSupportOptions_t servicesSupportedCalled; 29 | 30 | /* Context for parsing across buffer boundaries */ 31 | asn_struct_ctx_t _asn_ctx; 32 | } InitResponseDetail_t; 33 | 34 | /* Implementation */ 35 | extern asn_TYPE_descriptor_t asn_DEF_InitResponseDetail; 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* _InitResponseDetail_H_ */ 42 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/InitiateErrorPdu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _InitiateErrorPdu_H_ 9 | #define _InitiateErrorPdu_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "ServiceError.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* InitiateErrorPdu */ 22 | typedef ServiceError_t InitiateErrorPdu_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_InitiateErrorPdu; 26 | asn_struct_free_f InitiateErrorPdu_free; 27 | asn_struct_print_f InitiateErrorPdu_print; 28 | asn_constr_check_f InitiateErrorPdu_constraint; 29 | ber_type_decoder_f InitiateErrorPdu_decode_ber; 30 | der_type_encoder_f InitiateErrorPdu_encode_der; 31 | xer_type_decoder_f InitiateErrorPdu_decode_xer; 32 | xer_type_encoder_f InitiateErrorPdu_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _InitiateErrorPdu_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/InitiateRequestPdu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _InitiateRequestPdu_H_ 9 | #define _InitiateRequestPdu_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Integer32.h" 16 | #include "Integer16.h" 17 | #include "Integer8.h" 18 | #include "InitRequestDetail.h" 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* InitiateRequestPdu */ 26 | typedef struct InitiateRequestPdu { 27 | Integer32_t *localDetailCalling /* OPTIONAL */; 28 | Integer16_t proposedMaxServOutstandingCalling; 29 | Integer16_t proposedMaxServOutstandingCalled; 30 | Integer8_t *proposedDataStructureNestingLevel /* OPTIONAL */; 31 | InitRequestDetail_t mmsInitRequestDetail; 32 | 33 | /* Context for parsing across buffer boundaries */ 34 | asn_struct_ctx_t _asn_ctx; 35 | } InitiateRequestPdu_t; 36 | 37 | /* Implementation */ 38 | extern asn_TYPE_descriptor_t asn_DEF_InitiateRequestPdu; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _InitiateRequestPdu_H_ */ 45 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/InitiateResponsePdu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _InitiateResponsePdu_H_ 9 | #define _InitiateResponsePdu_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Integer32.h" 16 | #include "Integer16.h" 17 | #include "Integer8.h" 18 | #include "InitResponseDetail.h" 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* InitiateResponsePdu */ 26 | typedef struct InitiateResponsePdu { 27 | Integer32_t *localDetailCalled /* OPTIONAL */; 28 | Integer16_t negotiatedMaxServOutstandingCalling; 29 | Integer16_t negotiatedMaxServOutstandingCalled; 30 | Integer8_t *negotiatedDataStructureNestingLevel /* OPTIONAL */; 31 | InitResponseDetail_t mmsInitResponseDetail; 32 | 33 | /* Context for parsing across buffer boundaries */ 34 | asn_struct_ctx_t _asn_ctx; 35 | } InitiateResponsePdu_t; 36 | 37 | /* Implementation */ 38 | extern asn_TYPE_descriptor_t asn_DEF_InitiateResponsePdu; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _InitiateResponsePdu_H_ */ 45 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/Integer16.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _Integer16_H_ 9 | #define _Integer16_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Integer16 */ 22 | typedef long Integer16_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_Integer16; 26 | asn_struct_free_f Integer16_free; 27 | asn_struct_print_f Integer16_print; 28 | asn_constr_check_f Integer16_constraint; 29 | ber_type_decoder_f Integer16_decode_ber; 30 | der_type_encoder_f Integer16_encode_der; 31 | xer_type_decoder_f Integer16_decode_xer; 32 | xer_type_encoder_f Integer16_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Integer16_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/Integer32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _Integer32_H_ 9 | #define _Integer32_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Integer32 */ 22 | typedef long Integer32_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_Integer32; 26 | asn_struct_free_f Integer32_free; 27 | asn_struct_print_f Integer32_print; 28 | asn_constr_check_f Integer32_constraint; 29 | ber_type_decoder_f Integer32_decode_ber; 30 | der_type_encoder_f Integer32_encode_der; 31 | xer_type_decoder_f Integer32_decode_xer; 32 | xer_type_encoder_f Integer32_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Integer32_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/Integer8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _Integer8_H_ 9 | #define _Integer8_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Integer8 */ 22 | typedef long Integer8_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_Integer8; 26 | asn_struct_free_f Integer8_free; 27 | asn_struct_print_f Integer8_print; 28 | asn_constr_check_f Integer8_constraint; 29 | ber_type_decoder_f Integer8_decode_ber; 30 | der_type_encoder_f Integer8_encode_der; 31 | xer_type_decoder_f Integer8_decode_xer; 32 | xer_type_encoder_f Integer8_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Integer8_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ListOfVariableSeq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ListOfVariableSeq_H_ 9 | #define _ListOfVariableSeq_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "VariableSpecification.h" 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* Forward declarations */ 23 | struct AlternateAccess; 24 | 25 | /* ListOfVariableSeq */ 26 | typedef struct ListOfVariableSeq { 27 | VariableSpecification_t variableSpecification; 28 | struct AlternateAccess *alternateAccess /* OPTIONAL */; 29 | 30 | /* Context for parsing across buffer boundaries */ 31 | asn_struct_ctx_t _asn_ctx; 32 | } ListOfVariableSeq_t; 33 | 34 | /* Implementation */ 35 | extern asn_TYPE_descriptor_t asn_DEF_ListOfVariableSeq; 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | /* Referred external types */ 42 | #include "AlternateAccess.h" 43 | 44 | #endif /* _ListOfVariableSeq_H_ */ 45 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/MMSString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _MMSString_H_ 9 | #define _MMSString_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* MMSString */ 22 | typedef UTF8String_t MMSString_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_MMSString; 26 | asn_struct_free_f MMSString_free; 27 | asn_struct_print_f MMSString_print; 28 | asn_constr_check_f MMSString_constraint; 29 | ber_type_decoder_f MMSString_decode_ber; 30 | der_type_encoder_f MMSString_encode_der; 31 | xer_type_decoder_f MMSString_decode_xer; 32 | xer_type_encoder_f MMSString_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _MMSString_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/NULL.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef ASN_TYPE_NULL_H 6 | #define ASN_TYPE_NULL_H 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* 15 | * The value of the NULL type is meaningless: see BOOLEAN if you want to 16 | * carry true/false semantics. 17 | */ 18 | typedef int NULL_t; 19 | 20 | extern asn_TYPE_descriptor_t asn_DEF_NULL; 21 | 22 | asn_struct_print_f NULL_print; 23 | der_type_encoder_f NULL_encode_der; 24 | xer_type_decoder_f NULL_decode_xer; 25 | xer_type_encoder_f NULL_encode_xer; 26 | per_type_decoder_f NULL_decode_uper; 27 | per_type_encoder_f NULL_encode_uper; 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* NULL_H */ 34 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/NativeEnumerated.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004, 2005, 2006 Lev Walkin . 3 | * All rights reserved. 4 | * Redistribution and modifications are permitted subject to BSD license. 5 | */ 6 | /* 7 | * This type differs from the standard ENUMERATED in that it is modelled using 8 | * the fixed machine type (long, int, short), so it can hold only values of 9 | * limited length. There is no type (i.e., NativeEnumerated_t, any integer type 10 | * will do). 11 | * This type may be used when integer range is limited by subtype constraints. 12 | */ 13 | #ifndef _NativeEnumerated_H_ 14 | #define _NativeEnumerated_H_ 15 | 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; 23 | 24 | xer_type_encoder_f NativeEnumerated_encode_xer; 25 | per_type_decoder_f NativeEnumerated_decode_uper; 26 | per_type_encoder_f NativeEnumerated_encode_uper; 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* _NativeEnumerated_H_ */ 33 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/NativeInteger.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | /* 6 | * This type differs from the standard INTEGER in that it is modelled using 7 | * the fixed machine type (long, int, short), so it can hold only values of 8 | * limited length. There is no type (i.e., NativeInteger_t, any integer type 9 | * will do). 10 | * This type may be used when integer range is limited by subtype constraints. 11 | */ 12 | #ifndef _NativeInteger_H_ 13 | #define _NativeInteger_H_ 14 | 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; 23 | 24 | asn_struct_free_f NativeInteger_free; 25 | asn_struct_print_f NativeInteger_print; 26 | ber_type_decoder_f NativeInteger_decode_ber; 27 | der_type_encoder_f NativeInteger_encode_der; 28 | xer_type_decoder_f NativeInteger_decode_xer; 29 | xer_type_encoder_f NativeInteger_encode_xer; 30 | per_type_decoder_f NativeInteger_decode_uper; 31 | per_type_encoder_f NativeInteger_encode_uper; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _NativeInteger_H_ */ 38 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ObjectClass.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #include 9 | 10 | #include "ObjectClass.h" 11 | 12 | static asn_TYPE_member_t asn_MBR_ObjectClass_1[] = { 13 | { ATF_NOFLAGS, 0, offsetof(struct ObjectClass, choice.basicObjectClass), 14 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 15 | -1, /* IMPLICIT tag at current level */ 16 | &asn_DEF_INTEGER, 17 | 0, /* Defer constraints checking to the member type */ 18 | 0, /* PER is not compiled, use -gen-PER */ 19 | 0, 20 | "basicObjectClass" 21 | }, 22 | }; 23 | static asn_TYPE_tag2member_t asn_MAP_ObjectClass_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* basicObjectClass at 464 */ 25 | }; 26 | static asn_CHOICE_specifics_t asn_SPC_ObjectClass_specs_1 = { 27 | sizeof(struct ObjectClass), 28 | offsetof(struct ObjectClass, _asn_ctx), 29 | offsetof(struct ObjectClass, present), 30 | sizeof(((struct ObjectClass *)0)->present), 31 | asn_MAP_ObjectClass_tag2el_1, 32 | 1, /* Count of tags in the map */ 33 | 0, 34 | -1 /* Extensions start */ 35 | }; 36 | asn_TYPE_descriptor_t asn_DEF_ObjectClass = { 37 | "ObjectClass", 38 | "ObjectClass", 39 | CHOICE_free, 40 | CHOICE_print, 41 | CHOICE_constraint, 42 | CHOICE_decode_ber, 43 | CHOICE_encode_der, 44 | CHOICE_decode_xer, 45 | CHOICE_encode_xer, 46 | 0, 0, /* No PER support, use "-gen-PER" to enable */ 47 | CHOICE_outmost_tag, 48 | 0, /* No effective tags (pointer) */ 49 | 0, /* No effective tags (count) */ 50 | 0, /* No tags (pointer) */ 51 | 0, /* No tags (count) */ 52 | 0, /* No PER visible constraints */ 53 | asn_MBR_ObjectClass_1, 54 | 1, /* Elements count */ 55 | &asn_SPC_ObjectClass_specs_1 /* Additional specs */ 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ObjectClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ObjectClass_H_ 9 | #define _ObjectClass_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* Dependencies */ 23 | typedef enum ObjectClass_PR { 24 | ObjectClass_PR_NOTHING, /* No components present */ 25 | ObjectClass_PR_basicObjectClass 26 | } ObjectClass_PR; 27 | typedef enum ObjectClass__basicObjectClass { 28 | ObjectClass__basicObjectClass_namedVariable = 0, 29 | ObjectClass__basicObjectClass_scatteredAccess = 1, 30 | ObjectClass__basicObjectClass_namedVariableList = 2, 31 | ObjectClass__basicObjectClass_namedType = 3, 32 | ObjectClass__basicObjectClass_semaphore = 4, 33 | ObjectClass__basicObjectClass_eventCondition = 5, 34 | ObjectClass__basicObjectClass_eventAction = 6, 35 | ObjectClass__basicObjectClass_eventEnrollment = 7, 36 | ObjectClass__basicObjectClass_journal = 8, 37 | ObjectClass__basicObjectClass_domain = 9, 38 | ObjectClass__basicObjectClass_programInvocation = 10, 39 | ObjectClass__basicObjectClass_operatorStation = 11, 40 | ObjectClass__basicObjectClass_dataExchange = 12, 41 | ObjectClass__basicObjectClass_accessControlList = 13 42 | } e_ObjectClass__basicObjectClass; 43 | 44 | /* ObjectClass */ 45 | typedef struct ObjectClass { 46 | ObjectClass_PR present; 47 | union ObjectClass_u { 48 | INTEGER_t basicObjectClass; 49 | } choice; 50 | 51 | /* Context for parsing across buffer boundaries */ 52 | asn_struct_ctx_t _asn_ctx; 53 | } ObjectClass_t; 54 | 55 | /* Implementation */ 56 | extern asn_TYPE_descriptor_t asn_DEF_ObjectClass; 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* _ObjectClass_H_ */ 63 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ObjectName.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ObjectName_H_ 9 | #define _ObjectName_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Identifier.h" 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* Dependencies */ 24 | typedef enum ObjectName_PR { 25 | ObjectName_PR_NOTHING, /* No components present */ 26 | ObjectName_PR_vmdspecific, 27 | ObjectName_PR_domainspecific, 28 | ObjectName_PR_aaspecific 29 | } ObjectName_PR; 30 | 31 | struct ObjectName__domainspecific { 32 | Identifier_t domainId; 33 | Identifier_t itemId; 34 | 35 | /* Context for parsing across buffer boundaries */ 36 | asn_struct_ctx_t _asn_ctx; 37 | }; 38 | 39 | /* ObjectName */ 40 | typedef struct ObjectName { 41 | ObjectName_PR present; 42 | union ObjectName_u { 43 | Identifier_t vmdspecific; 44 | struct ObjectName__domainspecific domainspecific; 45 | Identifier_t aaspecific; 46 | } choice; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | } ObjectName_t; 51 | 52 | /* Implementation */ 53 | extern asn_TYPE_descriptor_t asn_DEF_ObjectName; 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* _ObjectName_H_ */ 60 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ParameterSupportOptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ParameterSupportOptions_H_ 9 | #define _ParameterSupportOptions_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Dependencies */ 22 | typedef enum ParameterSupportOptions { 23 | ParameterSupportOptions_str1 = 0, 24 | ParameterSupportOptions_str2 = 1, 25 | ParameterSupportOptions_vnam = 2, 26 | ParameterSupportOptions_valt = 3, 27 | ParameterSupportOptions_vadr = 4, 28 | ParameterSupportOptions_vsca = 5, 29 | ParameterSupportOptions_tpy = 6, 30 | ParameterSupportOptions_vlis = 7, 31 | ParameterSupportOptions_real = 8, 32 | ParameterSupportOptions_cei = 10 33 | } e_ParameterSupportOptions; 34 | 35 | /* ParameterSupportOptions */ 36 | typedef BIT_STRING_t ParameterSupportOptions_t; 37 | 38 | /* Implementation */ 39 | extern asn_TYPE_descriptor_t asn_DEF_ParameterSupportOptions; 40 | asn_struct_free_f ParameterSupportOptions_free; 41 | asn_struct_print_f ParameterSupportOptions_print; 42 | asn_constr_check_f ParameterSupportOptions_constraint; 43 | ber_type_decoder_f ParameterSupportOptions_decode_ber; 44 | der_type_encoder_f ParameterSupportOptions_encode_der; 45 | xer_type_decoder_f ParameterSupportOptions_decode_xer; 46 | xer_type_encoder_f ParameterSupportOptions_encode_xer; 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* _ParameterSupportOptions_H_ */ 53 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ReadRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ReadRequest_H_ 9 | #define _ReadRequest_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include "VariableAccessSpecification.h" 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* ReadRequest */ 24 | typedef struct ReadRequest { 25 | BOOLEAN_t *specificationWithResult /* DEFAULT FALSE */; 26 | VariableAccessSpecification_t variableAccessSpecification; 27 | 28 | /* Context for parsing across buffer boundaries */ 29 | asn_struct_ctx_t _asn_ctx; 30 | } ReadRequest_t; 31 | 32 | /* Implementation */ 33 | extern asn_TYPE_descriptor_t asn_DEF_ReadRequest; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _ReadRequest_H_ */ 40 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ReadResponse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ReadResponse_H_ 9 | #define _ReadResponse_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* Forward declarations */ 24 | struct VariableAccessSpecification; 25 | struct AccessResult; 26 | 27 | struct ReadResponse__listOfAccessResult { 28 | A_SEQUENCE_OF(struct AccessResult) list; 29 | 30 | /* Context for parsing across buffer boundaries */ 31 | asn_struct_ctx_t _asn_ctx; 32 | }; 33 | 34 | /* ReadResponse */ 35 | typedef struct ReadResponse { 36 | struct VariableAccessSpecification *variableAccessSpecification /* OPTIONAL */; 37 | struct ReadResponse__listOfAccessResult listOfAccessResult; 38 | 39 | /* Context for parsing across buffer boundaries */ 40 | asn_struct_ctx_t _asn_ctx; 41 | } ReadResponse_t; 42 | 43 | /* Implementation */ 44 | extern asn_TYPE_descriptor_t asn_DEF_ReadResponse; 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | /* Referred external types */ 51 | #include "VariableAccessSpecification.h" 52 | #include "AccessResult.h" 53 | 54 | #endif /* _ReadResponse_H_ */ 55 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ScatteredAccessDescription.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _ScatteredAccessDescription_H_ 9 | #define _ScatteredAccessDescription_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include "Identifier.h" 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Forward declarations */ 25 | struct VariableSpecification; 26 | struct AlternateAccess; 27 | 28 | struct ScatteredAccessDescription__Member { 29 | Identifier_t *componentName /* OPTIONAL */; 30 | struct VariableSpecification *variableSpecification; 31 | struct AlternateAccess *alternateAccess /* OPTIONAL */; 32 | 33 | /* Context for parsing across buffer boundaries */ 34 | asn_struct_ctx_t _asn_ctx; 35 | }; 36 | 37 | 38 | 39 | /* ScatteredAccessDescription */ 40 | typedef struct ScatteredAccessDescription { 41 | A_SEQUENCE_OF(struct ScatteredAccessDescription__Member) list; 42 | 43 | /* Context for parsing across buffer boundaries */ 44 | asn_struct_ctx_t _asn_ctx; 45 | } ScatteredAccessDescription_t; 46 | 47 | /* Implementation */ 48 | extern asn_TYPE_descriptor_t asn_DEF_ScatteredAccessDescription; 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | /* Referred external types */ 55 | #include "VariableSpecification.h" 56 | #include "AlternateAccess.h" 57 | 58 | #endif /* _ScatteredAccessDescription_H_ */ 59 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/StructComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _StructComponent_H_ 9 | #define _StructComponent_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "Identifier.h" 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* Forward declarations */ 23 | struct TypeSpecification; 24 | 25 | /* StructComponent */ 26 | typedef struct StructComponent { 27 | Identifier_t *componentName /* OPTIONAL */; 28 | struct TypeSpecification *componentType; 29 | 30 | /* Context for parsing across buffer boundaries */ 31 | asn_struct_ctx_t _asn_ctx; 32 | } StructComponent_t; 33 | 34 | /* Implementation */ 35 | extern asn_TYPE_descriptor_t asn_DEF_StructComponent; 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | /* Referred external types */ 42 | #include "TypeSpecification.h" 43 | 44 | #endif /* _StructComponent_H_ */ 45 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/TimeOfDay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _TimeOfDay_H_ 9 | #define _TimeOfDay_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* TimeOfDay */ 22 | typedef OCTET_STRING_t TimeOfDay_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_TimeOfDay; 26 | asn_struct_free_f TimeOfDay_free; 27 | asn_struct_print_f TimeOfDay_print; 28 | asn_constr_check_f TimeOfDay_constraint; 29 | ber_type_decoder_f TimeOfDay_decode_ber; 30 | der_type_encoder_f TimeOfDay_encode_der; 31 | xer_type_decoder_f TimeOfDay_decode_xer; 32 | xer_type_encoder_f TimeOfDay_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _TimeOfDay_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/UTF8String.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _UTF8String_H_ 6 | #define _UTF8String_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef OCTET_STRING_t UTF8String_t; /* Implemented via OCTET STRING */ 15 | 16 | extern asn_TYPE_descriptor_t asn_DEF_UTF8String; 17 | 18 | asn_struct_print_f UTF8String_print; 19 | asn_constr_check_f UTF8String_constraint; 20 | 21 | /* 22 | * Returns length of the given UTF-8 string in characters, 23 | * or a negative error code: 24 | * -1: UTF-8 sequence truncated 25 | * -2: Illegal UTF-8 sequence start 26 | * -3: Continuation expectation failed 27 | * -4: Not minimal length encoding 28 | * -5: Invalid arguments 29 | */ 30 | ssize_t UTF8String_length(const UTF8String_t *st); 31 | 32 | /* 33 | * Convert the UTF-8 string into a sequence of wide characters. 34 | * Returns the number of characters necessary. 35 | * Returned value might be greater than dstlen. 36 | * In case of conversion error, 0 is returned. 37 | * 38 | * If st points to a valid UTF-8 string, calling 39 | * UTF8String_to_wcs(st, 0, 0); 40 | * is equivalent to 41 | * UTF8String_length(const UTF8String_t *st); 42 | */ 43 | size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* _UTF8String_H_ */ 50 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/UnconfirmedPDU.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _UnconfirmedPDU_H_ 9 | #define _UnconfirmedPDU_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "UnconfirmedService.h" 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* UnconfirmedPDU */ 23 | typedef struct UnconfirmedPDU { 24 | UnconfirmedService_t unconfirmedService; 25 | 26 | /* Context for parsing across buffer boundaries */ 27 | asn_struct_ctx_t _asn_ctx; 28 | } UnconfirmedPDU_t; 29 | 30 | /* Implementation */ 31 | extern asn_TYPE_descriptor_t asn_DEF_UnconfirmedPDU; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _UnconfirmedPDU_H_ */ 38 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/UnconfirmedService.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #include 9 | 10 | #include "UnconfirmedService.h" 11 | 12 | static asn_TYPE_member_t asn_MBR_UnconfirmedService_1[] = { 13 | { ATF_NOFLAGS, 0, offsetof(struct UnconfirmedService, choice.informationReport), 14 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 15 | -1, /* IMPLICIT tag at current level */ 16 | &asn_DEF_InformationReport, 17 | 0, /* Defer constraints checking to the member type */ 18 | 0, /* PER is not compiled, use -gen-PER */ 19 | 0, 20 | "informationReport" 21 | }, 22 | }; 23 | static asn_TYPE_tag2member_t asn_MAP_UnconfirmedService_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* informationReport at 110 */ 25 | }; 26 | static asn_CHOICE_specifics_t asn_SPC_UnconfirmedService_specs_1 = { 27 | sizeof(struct UnconfirmedService), 28 | offsetof(struct UnconfirmedService, _asn_ctx), 29 | offsetof(struct UnconfirmedService, present), 30 | sizeof(((struct UnconfirmedService *)0)->present), 31 | asn_MAP_UnconfirmedService_tag2el_1, 32 | 1, /* Count of tags in the map */ 33 | 0, 34 | -1 /* Extensions start */ 35 | }; 36 | asn_TYPE_descriptor_t asn_DEF_UnconfirmedService = { 37 | "UnconfirmedService", 38 | "UnconfirmedService", 39 | CHOICE_free, 40 | CHOICE_print, 41 | CHOICE_constraint, 42 | CHOICE_decode_ber, 43 | CHOICE_encode_der, 44 | CHOICE_decode_xer, 45 | CHOICE_encode_xer, 46 | 0, 0, /* No PER support, use "-gen-PER" to enable */ 47 | CHOICE_outmost_tag, 48 | 0, /* No effective tags (pointer) */ 49 | 0, /* No effective tags (count) */ 50 | 0, /* No tags (pointer) */ 51 | 0, /* No tags (count) */ 52 | 0, /* No PER visible constraints */ 53 | asn_MBR_UnconfirmedService_1, 54 | 1, /* Elements count */ 55 | &asn_SPC_UnconfirmedService_specs_1 /* Additional specs */ 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/UnconfirmedService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _UnconfirmedService_H_ 9 | #define _UnconfirmedService_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "InformationReport.h" 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* Dependencies */ 23 | typedef enum UnconfirmedService_PR { 24 | UnconfirmedService_PR_NOTHING, /* No components present */ 25 | UnconfirmedService_PR_informationReport 26 | } UnconfirmedService_PR; 27 | 28 | /* UnconfirmedService */ 29 | typedef struct UnconfirmedService { 30 | UnconfirmedService_PR present; 31 | union UnconfirmedService_u { 32 | InformationReport_t informationReport; 33 | } choice; 34 | 35 | /* Context for parsing across buffer boundaries */ 36 | asn_struct_ctx_t _asn_ctx; 37 | } UnconfirmedService_t; 38 | 39 | /* Implementation */ 40 | extern asn_TYPE_descriptor_t asn_DEF_UnconfirmedService; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _UnconfirmedService_H_ */ 47 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/Unsigned16.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _Unsigned16_H_ 9 | #define _Unsigned16_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Unsigned16 */ 22 | typedef long Unsigned16_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_Unsigned16; 26 | asn_struct_free_f Unsigned16_free; 27 | asn_struct_print_f Unsigned16_print; 28 | asn_constr_check_f Unsigned16_constraint; 29 | ber_type_decoder_f Unsigned16_decode_ber; 30 | der_type_encoder_f Unsigned16_encode_der; 31 | xer_type_decoder_f Unsigned16_decode_xer; 32 | xer_type_encoder_f Unsigned16_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Unsigned16_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/Unsigned32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _Unsigned32_H_ 9 | #define _Unsigned32_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Unsigned32 */ 22 | typedef INTEGER_t Unsigned32_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_Unsigned32; 26 | asn_struct_free_f Unsigned32_free; 27 | asn_struct_print_f Unsigned32_print; 28 | asn_constr_check_f Unsigned32_constraint; 29 | ber_type_decoder_f Unsigned32_decode_ber; 30 | der_type_encoder_f Unsigned32_encode_der; 31 | xer_type_decoder_f Unsigned32_decode_xer; 32 | xer_type_encoder_f Unsigned32_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Unsigned32_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/Unsigned8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _Unsigned8_H_ 9 | #define _Unsigned8_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Unsigned8 */ 22 | typedef long Unsigned8_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_Unsigned8; 26 | asn_struct_free_f Unsigned8_free; 27 | asn_struct_print_f Unsigned8_print; 28 | asn_constr_check_f Unsigned8_constraint; 29 | ber_type_decoder_f Unsigned8_decode_ber; 30 | der_type_encoder_f Unsigned8_encode_der; 31 | xer_type_decoder_f Unsigned8_decode_xer; 32 | xer_type_encoder_f Unsigned8_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Unsigned8_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/UtcTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _UtcTime_H_ 9 | #define _UtcTime_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* UtcTime */ 22 | typedef OCTET_STRING_t UtcTime_t; 23 | 24 | /* Implementation */ 25 | extern asn_TYPE_descriptor_t asn_DEF_UtcTime; 26 | asn_struct_free_f UtcTime_free; 27 | asn_struct_print_f UtcTime_print; 28 | asn_constr_check_f UtcTime_constraint; 29 | ber_type_decoder_f UtcTime_decode_ber; 30 | der_type_encoder_f UtcTime_encode_der; 31 | xer_type_decoder_f UtcTime_decode_xer; 32 | xer_type_encoder_f UtcTime_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _UtcTime_H_ */ 39 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/VariableAccessSpecification.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _VariableAccessSpecification_H_ 9 | #define _VariableAccessSpecification_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "ObjectName.h" 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Dependencies */ 25 | typedef enum VariableAccessSpecification_PR { 26 | VariableAccessSpecification_PR_NOTHING, /* No components present */ 27 | VariableAccessSpecification_PR_listOfVariable, 28 | VariableAccessSpecification_PR_variableListName 29 | } VariableAccessSpecification_PR; 30 | 31 | /* Forward declarations */ 32 | struct ListOfVariableSeq; 33 | 34 | struct VariableAccessSpecification__listOfVariable { 35 | A_SEQUENCE_OF(struct ListOfVariableSeq) list; 36 | 37 | /* Context for parsing across buffer boundaries */ 38 | asn_struct_ctx_t _asn_ctx; 39 | }; 40 | 41 | /* VariableAccessSpecification */ 42 | typedef struct VariableAccessSpecification { 43 | VariableAccessSpecification_PR present; 44 | union VariableAccessSpecification_u { 45 | struct VariableAccessSpecification__listOfVariable listOfVariable; 46 | ObjectName_t variableListName; 47 | } choice; 48 | 49 | /* Context for parsing across buffer boundaries */ 50 | asn_struct_ctx_t _asn_ctx; 51 | } VariableAccessSpecification_t; 52 | 53 | /* Implementation */ 54 | extern asn_TYPE_descriptor_t asn_DEF_VariableAccessSpecification; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | /* Referred external types */ 61 | #include "ListOfVariableSeq.h" 62 | 63 | #endif /* _VariableAccessSpecification_H_ */ 64 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/VisibleString.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _VisibleString_H_ 6 | #define _VisibleString_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef OCTET_STRING_t VisibleString_t; /* Implemented via OCTET STRING */ 15 | 16 | extern asn_TYPE_descriptor_t asn_DEF_VisibleString; 17 | 18 | asn_constr_check_f VisibleString_constraint; 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif /* _VisibleString_H_ */ 25 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/WriteRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _WriteRequest_H_ 9 | #define _WriteRequest_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "VariableAccessSpecification.h" 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Forward declarations */ 25 | struct Data; 26 | 27 | struct WriteRequest__listOfData { 28 | A_SEQUENCE_OF(struct Data) list; 29 | 30 | /* Context for parsing across buffer boundaries */ 31 | asn_struct_ctx_t _asn_ctx; 32 | }; 33 | 34 | /* WriteRequest */ 35 | typedef struct WriteRequest { 36 | VariableAccessSpecification_t variableAccessSpecification; 37 | struct WriteRequest__listOfData listOfData; 38 | 39 | /* Context for parsing across buffer boundaries */ 40 | asn_struct_ctx_t _asn_ctx; 41 | } WriteRequest_t; 42 | 43 | /* Implementation */ 44 | extern asn_TYPE_descriptor_t asn_DEF_WriteRequest; 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | /* Referred external types */ 51 | #include "Data.h" 52 | 53 | #endif /* _WriteRequest_H_ */ 54 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/WriteResponse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) 3 | * From ASN.1 module "MMS" 4 | * found in "../mms-extended.asn" 5 | * `asn1c -fskeletons-copy` 6 | */ 7 | 8 | #ifndef _WriteResponse_H_ 9 | #define _WriteResponse_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include "DataAccessError.h" 17 | #include 18 | #include 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* Dependencies */ 26 | typedef enum WriteResponse__Member_PR { 27 | WriteResponse__Member_PR_NOTHING, /* No components present */ 28 | WriteResponse__Member_PR_failure, 29 | WriteResponse__Member_PR_success 30 | } WriteResponse__Member_PR; 31 | 32 | struct WriteResponse__Member { 33 | WriteResponse__Member_PR present; 34 | union WriteResponse__Member_u { 35 | DataAccessError_t failure; 36 | NULL_t success; 37 | } choice; 38 | 39 | /* Context for parsing across buffer boundaries */ 40 | asn_struct_ctx_t _asn_ctx; 41 | }; 42 | 43 | /* WriteResponse */ 44 | typedef struct WriteResponse { 45 | A_SEQUENCE_OF(struct WriteResponse__Member) list; 46 | 47 | /* Context for parsing across buffer boundaries */ 48 | asn_struct_ctx_t _asn_ctx; 49 | } WriteResponse_t; 50 | 51 | /* Implementation */ 52 | extern asn_TYPE_descriptor_t asn_DEF_WriteResponse; 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* _WriteResponse_H_ */ 59 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/asn_SEQUENCE_OF.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #include 6 | #include 7 | 8 | typedef A_SEQUENCE_OF(void) asn_sequence; 9 | 10 | void 11 | asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) { 12 | asn_sequence *as = (asn_sequence *)asn_sequence_of_x; 13 | 14 | if(as) { 15 | void *ptr; 16 | int n; 17 | 18 | if(number < 0 || number >= as->count) 19 | return; /* Nothing to delete */ 20 | 21 | if(_do_free && as->free) { 22 | ptr = as->array[number]; 23 | } else { 24 | ptr = 0; 25 | } 26 | 27 | /* 28 | * Shift all elements to the left to hide the gap. 29 | */ 30 | --as->count; 31 | for(n = number; n < as->count; n++) 32 | as->array[n] = as->array[n+1]; 33 | 34 | /* 35 | * Invoke the third-party function only when the state 36 | * of the parent structure is consistent. 37 | */ 38 | if(ptr) as->free(ptr); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/asn_SEQUENCE_OF.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef ASN_SEQUENCE_OF_H 6 | #define ASN_SEQUENCE_OF_H 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* 15 | * SEQUENCE OF is the same as SET OF with a tiny difference: 16 | * the delete operation preserves the initial order of elements 17 | * and thus MAY operate in non-constant time. 18 | */ 19 | #define A_SEQUENCE_OF(type) A_SET_OF(type) 20 | 21 | #define ASN_SEQUENCE_ADD(headptr, ptr) \ 22 | asn_sequence_add((headptr), (ptr)) 23 | 24 | /*********************************************** 25 | * Implementation of the SEQUENCE OF structure. 26 | */ 27 | 28 | #define asn_sequence_add asn_set_add 29 | #define asn_sequence_empty asn_set_empty 30 | 31 | /* 32 | * Delete the element from the set by its number (base 0). 33 | * This is NOT a constant-time operation. 34 | * The order of elements is preserved. 35 | * If _do_free is given AND the (*free) is initialized, the element 36 | * will be freed using the custom (*free) function as well. 37 | */ 38 | void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); 39 | 40 | /* 41 | * Cope with different conversions requirements to/from void in C and C++. 42 | * This is mostly useful for support library. 43 | */ 44 | typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; 45 | #define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) 46 | #define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* ASN_SEQUENCE_OF_H */ 53 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/asn_SET_OF.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef ASN_SET_OF_H 6 | #define ASN_SET_OF_H 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #define A_SET_OF(type) \ 13 | struct { \ 14 | type **array; \ 15 | int count; /* Meaningful size */ \ 16 | int size; /* Allocated size */ \ 17 | void (*free)(type *); \ 18 | } 19 | 20 | #define ASN_SET_ADD(headptr, ptr) \ 21 | asn_set_add((headptr), (ptr)) 22 | 23 | /******************************************* 24 | * Implementation of the SET OF structure. 25 | */ 26 | 27 | /* 28 | * Add another structure into the set by its pointer. 29 | * RETURN VALUES: 30 | * 0 for success and -1/errno for failure. 31 | */ 32 | int asn_set_add(void *asn_set_of_x, void *ptr); 33 | 34 | /* 35 | * Delete the element from the set by its number (base 0). 36 | * This is a constant-time operation. The order of elements before the 37 | * deleted ones is guaranteed, the order of elements after the deleted 38 | * one is NOT guaranteed. 39 | * If _do_free is given AND the (*free) is initialized, the element 40 | * will be freed using the custom (*free) function as well. 41 | */ 42 | void asn_set_del(void *asn_set_of_x, int number, int _do_free); 43 | 44 | /* 45 | * Empty the contents of the set. Will free the elements, if (*free) is given. 46 | * Will NOT free the set itself. 47 | */ 48 | void asn_set_empty(void *asn_set_of_x); 49 | 50 | /* 51 | * Cope with different conversions requirements to/from void in C and C++. 52 | * This is mostly useful for support library. 53 | */ 54 | typedef A_SET_OF(void) asn_anonymous_set_; 55 | #define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) 56 | #define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* ASN_SET_OF_H */ 63 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/asn_application.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | /* 6 | * Application-level ASN.1 callbacks. 7 | */ 8 | #ifndef _ASN_APPLICATION_H_ 9 | #define _ASN_APPLICATION_H_ 10 | 11 | #include "asn_system.h" /* for platform-dependent types */ 12 | #include "asn_codecs.h" /* for ASN.1 codecs specifics */ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /* 19 | * Generic type of an application-defined callback to return various 20 | * types of data to the application. 21 | * EXPECTED RETURN VALUES: 22 | * -1: Failed to consume bytes. Abort the mission. 23 | * Non-negative return values indicate success, and ignored. 24 | */ 25 | typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, 26 | void *application_specific_key); 27 | 28 | /* 29 | * A callback of this type is called whenever constraint validation fails 30 | * on some ASN.1 type. See "constraints.h" for more details on constraint 31 | * validation. 32 | * This callback specifies a descriptor of the ASN.1 type which failed 33 | * the constraint check, as well as human readable message on what 34 | * particular constraint has failed. 35 | */ 36 | typedef void (asn_app_constraint_failed_f)(void *application_specific_key, 37 | struct asn_TYPE_descriptor_s *type_descriptor_which_failed, 38 | const void *structure_which_failed_ptr, 39 | const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ 46 | 47 | #endif /* _ASN_APPLICATION_H_ */ 48 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/asn_codecs_prim.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef ASN_CODECS_PRIM_H 6 | #define ASN_CODECS_PRIM_H 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct ASN__PRIMITIVE_TYPE_s { 15 | uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ 16 | int size; /* Size of the buffer */ 17 | } ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ 18 | 19 | asn_struct_free_f ASN__PRIMITIVE_TYPE_free; 20 | ber_type_decoder_f ber_decode_primitive; 21 | der_type_encoder_f der_encode_primitive; 22 | 23 | /* 24 | * A callback specification for the xer_decode_primitive() function below. 25 | */ 26 | enum xer_pbd_rval { 27 | XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ 28 | XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ 29 | XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ 30 | XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ 31 | XPBD_BODY_CONSUMED /* Body is recognized and consumed */ 32 | }; 33 | typedef enum xer_pbd_rval (xer_primitive_body_decoder_f) 34 | (asn_TYPE_descriptor_t *td, void *struct_ptr, 35 | const void *chunk_buf, size_t chunk_size); 36 | 37 | /* 38 | * Specific function to decode simple primitive types. 39 | * Also see xer_decode_general() in xer_decoder.h 40 | */ 41 | asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, 42 | asn_TYPE_descriptor_t *type_descriptor, 43 | void **struct_ptr, size_t struct_size, 44 | const char *opt_mname, 45 | const void *buf_ptr, size_t size, 46 | xer_primitive_body_decoder_f *prim_body_decoder 47 | ); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* ASN_CODECS_PRIM_H */ 54 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/ber_tlv_length.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _BER_TLV_LENGTH_H_ 6 | #define _BER_TLV_LENGTH_H_ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | typedef ssize_t ber_tlv_len_t; 13 | 14 | /* 15 | * This function tries to fetch the length of the BER TLV value and place it 16 | * in *len_r. 17 | * RETURN VALUES: 18 | * 0: More data expected than bufptr contains. 19 | * -1: Fatal error deciphering length. 20 | * >0: Number of bytes used from bufptr. 21 | * On return with >0, len_r is constrained as -1..MAX, where -1 mean 22 | * that the value is of indefinite length. 23 | */ 24 | ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, 25 | ber_tlv_len_t *len_r); 26 | 27 | /* 28 | * This function expects bufptr to be positioned over L in TLV. 29 | * It returns number of bytes occupied by L and V together, suitable 30 | * for skipping. The function properly handles indefinite length. 31 | * RETURN VALUES: 32 | * Standard {-1,0,>0} convention. 33 | */ 34 | ssize_t ber_skip_length( 35 | struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ 36 | int _is_constructed, const void *bufptr, size_t size); 37 | 38 | /* 39 | * This function serializes the length (L from TLV) in DER format. 40 | * It always returns number of bytes necessary to represent the length, 41 | * it is a caller's responsibility to check the return value 42 | * against the supplied buffer's size. 43 | */ 44 | size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* _BER_TLV_LENGTH_H_ */ 51 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/constr_CHOICE.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004, 2005 Lev Walkin . 3 | * All rights reserved. 4 | * Redistribution and modifications are permitted subject to BSD license. 5 | */ 6 | #ifndef _CONSTR_CHOICE_H_ 7 | #define _CONSTR_CHOICE_H_ 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct asn_CHOICE_specifics_s { 16 | /* 17 | * Target structure description. 18 | */ 19 | int struct_size; /* Size of the target structure. */ 20 | int ctx_offset; /* Offset of the asn_codec_ctx_t member */ 21 | int pres_offset; /* Identifier of the present member */ 22 | int pres_size; /* Size of the identifier (enum) */ 23 | 24 | /* 25 | * Tags to members mapping table. 26 | */ 27 | asn_TYPE_tag2member_t *tag2el; 28 | int tag2el_count; 29 | 30 | /* Canonical ordering of CHOICE elements, for PER */ 31 | int *canonical_order; 32 | 33 | /* 34 | * Extensions-related stuff. 35 | */ 36 | int ext_start; /* First member of extensions, or -1 */ 37 | } asn_CHOICE_specifics_t; 38 | 39 | /* 40 | * A set specialized functions dealing with the CHOICE type. 41 | */ 42 | asn_struct_free_f CHOICE_free; 43 | asn_struct_print_f CHOICE_print; 44 | asn_constr_check_f CHOICE_constraint; 45 | ber_type_decoder_f CHOICE_decode_ber; 46 | der_type_encoder_f CHOICE_encode_der; 47 | xer_type_decoder_f CHOICE_decode_xer; 48 | xer_type_encoder_f CHOICE_encode_xer; 49 | per_type_decoder_f CHOICE_decode_uper; 50 | per_type_encoder_f CHOICE_encode_uper; 51 | asn_outmost_tag_f CHOICE_outmost_tag; 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* _CONSTR_CHOICE_H_ */ 58 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/constr_SEQUENCE.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _CONSTR_SEQUENCE_H_ 6 | #define _CONSTR_SEQUENCE_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct asn_SEQUENCE_specifics_s { 15 | /* 16 | * Target structure description. 17 | */ 18 | int struct_size; /* Size of the target structure. */ 19 | int ctx_offset; /* Offset of the asn_struct_ctx_t member */ 20 | 21 | /* 22 | * Tags to members mapping table (sorted). 23 | */ 24 | asn_TYPE_tag2member_t *tag2el; 25 | int tag2el_count; 26 | 27 | /* 28 | * Optional members of the extensions root (roms) or additions (aoms). 29 | * Meaningful for PER. 30 | */ 31 | int *oms; /* Optional MemberS */ 32 | int roms_count; /* Root optional members count */ 33 | int aoms_count; /* Additions optional members count */ 34 | 35 | /* 36 | * Description of an extensions group. 37 | */ 38 | int ext_after; /* Extensions start after this member */ 39 | int ext_before; /* Extensions stop before this member */ 40 | } asn_SEQUENCE_specifics_t; 41 | 42 | 43 | /* 44 | * A set specialized functions dealing with the SEQUENCE type. 45 | */ 46 | asn_struct_free_f SEQUENCE_free; 47 | asn_struct_print_f SEQUENCE_print; 48 | asn_constr_check_f SEQUENCE_constraint; 49 | ber_type_decoder_f SEQUENCE_decode_ber; 50 | der_type_encoder_f SEQUENCE_encode_der; 51 | xer_type_decoder_f SEQUENCE_decode_xer; 52 | xer_type_encoder_f SEQUENCE_encode_xer; 53 | per_type_decoder_f SEQUENCE_decode_uper; 54 | per_type_encoder_f SEQUENCE_encode_uper; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _CONSTR_SEQUENCE_H_ */ 61 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/constr_SEQUENCE_OF.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _CONSTR_SEQUENCE_OF_H_ 6 | #define _CONSTR_SEQUENCE_OF_H_ 7 | 8 | #include 9 | #include /* Implemented using SET OF */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /* 16 | * A set specialized functions dealing with the SEQUENCE OF type. 17 | * Generally implemented using SET OF. 18 | */ 19 | #define SEQUENCE_OF_free SET_OF_free 20 | #define SEQUENCE_OF_print SET_OF_print 21 | #define SEQUENCE_OF_constraint SET_OF_constraint 22 | #define SEQUENCE_OF_decode_ber SET_OF_decode_ber 23 | #define SEQUENCE_OF_decode_xer SET_OF_decode_xer 24 | #define SEQUENCE_OF_decode_uper SET_OF_decode_uper 25 | der_type_encoder_f SEQUENCE_OF_encode_der; 26 | xer_type_encoder_f SEQUENCE_OF_encode_xer; 27 | per_type_encoder_f SEQUENCE_OF_encode_uper; 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* _CONSTR_SET_OF_H_ */ 34 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/constr_SET_OF.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _CONSTR_SET_OF_H_ 6 | #define _CONSTR_SET_OF_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct asn_SET_OF_specifics_s { 15 | /* 16 | * Target structure description. 17 | */ 18 | int struct_size; /* Size of the target structure. */ 19 | int ctx_offset; /* Offset of the asn_struct_ctx_t member */ 20 | 21 | /* XER-specific stuff */ 22 | int as_XMLValueList; /* The member type must be encoded like this */ 23 | } asn_SET_OF_specifics_t; 24 | 25 | /* 26 | * A set specialized functions dealing with the SET OF type. 27 | */ 28 | asn_struct_free_f SET_OF_free; 29 | asn_struct_print_f SET_OF_print; 30 | asn_constr_check_f SET_OF_constraint; 31 | ber_type_decoder_f SET_OF_decode_ber; 32 | der_type_encoder_f SET_OF_encode_der; 33 | xer_type_decoder_f SET_OF_decode_xer; 34 | xer_type_encoder_f SET_OF_encode_xer; 35 | per_type_decoder_f SET_OF_decode_uper; 36 | per_type_encoder_f SET_OF_encode_uper; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _CONSTR_SET_OF_H_ */ 43 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/per_decoder.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | asn_dec_rval_t 6 | uper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) { 7 | asn_codec_ctx_t s_codec_ctx; 8 | asn_dec_rval_t rval; 9 | asn_per_data_t pd; 10 | 11 | if(skip_bits < 0 || skip_bits > 7 12 | || unused_bits < 0 || unused_bits > 7 13 | || (unused_bits > 0 && !size)) 14 | _ASN_DECODE_FAILED; 15 | 16 | /* 17 | * Stack checker requires that the codec context 18 | * must be allocated on the stack. 19 | */ 20 | if(opt_codec_ctx) { 21 | if(opt_codec_ctx->max_stack_size) { 22 | s_codec_ctx = *opt_codec_ctx; 23 | opt_codec_ctx = &s_codec_ctx; 24 | } 25 | } else { 26 | /* If context is not given, be security-conscious anyway */ 27 | memset(&s_codec_ctx, 0, sizeof(s_codec_ctx)); 28 | s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX; 29 | opt_codec_ctx = &s_codec_ctx; 30 | } 31 | 32 | /* Fill in the position indicator */ 33 | pd.buffer = (const uint8_t *)buffer; 34 | pd.nboff = skip_bits; 35 | pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from */ 36 | if(pd.nboff > pd.nbits) 37 | _ASN_DECODE_FAILED; 38 | 39 | /* 40 | * Invoke type-specific decoder. 41 | */ 42 | if(!td->uper_decoder) 43 | _ASN_DECODE_FAILED; /* PER is not compiled in */ 44 | rval = td->uper_decoder(opt_codec_ctx, td, 0, sptr, &pd); 45 | if(rval.code == RC_OK) { 46 | /* Return the number of consumed bits */ 47 | rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3) 48 | + pd.nboff - skip_bits; 49 | } else { 50 | /* PER codec is not a restartable */ 51 | rval.consumed = 0; 52 | } 53 | return rval; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/per_decoder.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _PER_DECODER_H_ 6 | #define _PER_DECODER_H_ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 16 | 17 | /* 18 | * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. 19 | */ 20 | asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, 21 | struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ 22 | void **struct_ptr, /* Pointer to a target structure's pointer */ 23 | const void *buffer, /* Data to be decoded */ 24 | size_t size, /* Size of data buffer */ 25 | int skip_bits, /* Number of unused leading bits, 0..7 */ 26 | int unused_bits /* Number of unused tailing bits, 0..7 */ 27 | ); 28 | 29 | 30 | /* 31 | * Type of the type-specific PER decoder function. 32 | */ 33 | typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, 34 | struct asn_TYPE_descriptor_s *type_descriptor, 35 | asn_per_constraints_t *constraints, 36 | void **struct_ptr, 37 | asn_per_data_t *per_data 38 | ); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _PER_DECODER_H_ */ 45 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/per_encoder.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _PER_ENCODER_H_ 6 | #define _PER_ENCODER_H_ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 16 | 17 | /* 18 | * Unaligned PER encoder of any ASN.1 type. May be invoked by the application. 19 | */ 20 | asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, 21 | void *struct_ptr, /* Structure to be encoded */ 22 | asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ 23 | void *app_key /* Arbitrary callback argument */ 24 | ); 25 | 26 | /* A variant of uper_encode() which encodes data into the existing buffer */ 27 | asn_enc_rval_t uper_encode_to_buffer( 28 | struct asn_TYPE_descriptor_s *type_descriptor, 29 | void *struct_ptr, /* Structure to be encoded */ 30 | void *buffer, /* Pre-allocated buffer */ 31 | size_t buffer_size /* Initial buffer size (max) */ 32 | ); 33 | 34 | 35 | /* 36 | * Type of the generic PER encoder function. 37 | */ 38 | typedef asn_enc_rval_t (per_type_encoder_f)( 39 | struct asn_TYPE_descriptor_s *type_descriptor, 40 | asn_per_constraints_t *constraints, 41 | void *struct_ptr, 42 | asn_per_outp_t *per_output 43 | ); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* _PER_ENCODER_H_ */ 50 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/xer_encoder.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | /* 10 | * The XER encoder of any type. May be invoked by the application. 11 | */ 12 | asn_enc_rval_t 13 | xer_encode(asn_TYPE_descriptor_t *td, void *sptr, 14 | enum xer_encoder_flags_e xer_flags, 15 | asn_app_consume_bytes_f *cb, void *app_key) { 16 | asn_enc_rval_t er, tmper; 17 | const char *mname; 18 | size_t mlen; 19 | int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2; 20 | 21 | if(!td || !sptr) goto cb_failed; 22 | 23 | mname = td->xml_tag; 24 | mlen = strlen(mname); 25 | 26 | _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); 27 | 28 | tmper = td->xer_encoder(td, sptr, 1, xer_flags, cb, app_key); 29 | if(tmper.encoded == -1) return tmper; 30 | 31 | _ASN_CALLBACK3("\n", xcan); 32 | 33 | er.encoded = 4 + xcan + (2 * mlen) + tmper.encoded; 34 | 35 | _ASN_ENCODED_OK(er); 36 | cb_failed: 37 | _ASN_ENCODE_FAILED; 38 | } 39 | 40 | /* 41 | * This is a helper function for xer_fprint, which directs all incoming data 42 | * into the provided file descriptor. 43 | */ 44 | static int 45 | xer__print2fp(const void *buffer, size_t size, void *app_key) { 46 | FILE *stream = (FILE *)app_key; 47 | 48 | if(fwrite(buffer, 1, size, stream) != size) 49 | return -1; 50 | 51 | return 0; 52 | } 53 | 54 | int 55 | xer_fprint(FILE *stream, asn_TYPE_descriptor_t *td, void *sptr) { 56 | asn_enc_rval_t er; 57 | 58 | if(!stream) stream = stdout; 59 | if(!td || !sptr) 60 | return -1; 61 | 62 | er = xer_encode(td, sptr, XER_F_BASIC, xer__print2fp, stream); 63 | if(er.encoded == -1) 64 | return -1; 65 | 66 | return fflush(stream); 67 | } 68 | -------------------------------------------------------------------------------- /src/mms/iso_mms/asn1c/xer_encoder.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _XER_ENCODER_H_ 6 | #define _XER_ENCODER_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 15 | 16 | /* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ 17 | enum xer_encoder_flags_e { 18 | /* Mode of encoding */ 19 | XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ 20 | XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ 21 | }; 22 | 23 | /* 24 | * The XER encoder of any type. May be invoked by the application. 25 | */ 26 | asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, 27 | void *struct_ptr, /* Structure to be encoded */ 28 | enum xer_encoder_flags_e xer_flags, 29 | asn_app_consume_bytes_f *consume_bytes_cb, 30 | void *app_key /* Arbitrary callback argument */ 31 | ); 32 | 33 | /* 34 | * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) 35 | * output into the chosen file pointer. 36 | * RETURN VALUES: 37 | * 0: The structure is printed. 38 | * -1: Problem printing the structure. 39 | * WARNING: No sensible errno value is returned. 40 | */ 41 | int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); 42 | 43 | /* 44 | * Type of the generic XER encoder. 45 | */ 46 | typedef asn_enc_rval_t (xer_type_encoder_f)( 47 | struct asn_TYPE_descriptor_s *type_descriptor, 48 | void *struct_ptr, /* Structure to be encoded */ 49 | int ilevel, /* Level of indentation */ 50 | enum xer_encoder_flags_e xer_flags, 51 | asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ 52 | void *app_key /* Arbitrary callback argument */ 53 | ); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* _XER_ENCODER_H_ */ 60 | -------------------------------------------------------------------------------- /src/mms/iso_mms/client/mms_client_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_client_common.c 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | #include 24 | #include "mms_common.h" 25 | #include "mms_client_connection.h" 26 | #include "byte_buffer.h" 27 | 28 | #include "mms_client_internal.h" 29 | 30 | int 31 | mmsClient_write_out(void *buffer, size_t size, void *app_key) 32 | { 33 | ByteBuffer* writeBuffer = (ByteBuffer*) app_key; 34 | return ByteBuffer_append(writeBuffer, (uint8_t*) buffer, size); 35 | } 36 | 37 | 38 | uint32_t 39 | mmsClient_getInvokeId(ConfirmedResponsePdu_t* confirmedResponse) 40 | { 41 | long invokeId; 42 | 43 | asn_INTEGER2long(&confirmedResponse->invokeID, &invokeId); 44 | 45 | return (uint32_t) invokeId; 46 | } 47 | 48 | 49 | MmsPdu_t* 50 | mmsClient_createConfirmedRequestPdu(uint32_t invokeId) 51 | { 52 | MmsPdu_t* mmsPdu = (MmsPdu_t*) calloc(1, sizeof(MmsPdu_t)); 53 | mmsPdu->present = MmsPdu_PR_confirmedRequestPdu; 54 | 55 | asn_long2INTEGER(&(mmsPdu->choice.confirmedRequestPdu.invokeID), invokeId); 56 | 57 | return mmsPdu; 58 | } 59 | -------------------------------------------------------------------------------- /src/mms/iso_mms/common/mms_common_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_common_internal.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #include "mms_value.h" 25 | #include "MmsPdu.h" 26 | #include "mms_access_result.h" 27 | #include "conversions.h" 28 | 29 | MmsValue* 30 | mmsMsg_parseDataElement(Data_t* dataElement); 31 | 32 | void 33 | mmsMsg_createFloatData(MmsValue* value, int* size, uint8_t** buf); 34 | 35 | Data_t* 36 | mmsMsg_createBasicDataElement(MmsValue* value); 37 | 38 | Data_t* 39 | mmsMsg_createDataElement(MmsValue* value); 40 | 41 | void 42 | mmsMsg_addResultToResultList(AccessResult_t* accessResult, MmsValue* value); 43 | 44 | AccessResult_t** 45 | mmsMsg_createAccessResultsList(MmsPdu_t* mmsPdu, int resultsCount); 46 | 47 | char* 48 | mmsMsg_createStringFromAsnIdentifier(Identifier_t identifier); 49 | 50 | void 51 | mmsMsg_copyAsn1IdentifierToStringBuffer(Identifier_t identifier, char* buffer, int bufSize); 52 | 53 | void 54 | mmsMsg_deleteAccessResultList(AccessResult_t** accessResult, int variableCount); 55 | -------------------------------------------------------------------------------- /src/mms/iso_mms/server/mms_access_result.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_access_result.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef MMS_ACCESS_RESULT_H_ 25 | #define MMS_ACCESS_RESULT_H_ 26 | 27 | #include "mms_value.h" 28 | 29 | int 30 | mmsServer_encodeAccessResult(MmsValue* value, uint8_t* buffer, int bufPos, bool encode); 31 | 32 | #endif /* MMS_ACCESS_RESULT_H_ */ 33 | -------------------------------------------------------------------------------- /src/mms/iso_mms/server/mms_device.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_device.c 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #include "mms_device_model.h" 25 | 26 | MmsDevice* 27 | MmsDevice_create(char* deviceName) 28 | { 29 | MmsDevice* self = (MmsDevice*) calloc(1, sizeof(MmsDevice)); 30 | self->deviceName = deviceName; 31 | 32 | return self; 33 | } 34 | 35 | void 36 | MmsDevice_destroy(MmsDevice* self) 37 | { 38 | 39 | int i; 40 | for (i = 0; i < self->domainCount; i++) { 41 | MmsDomain_destroy(self->domains[i]); 42 | } 43 | 44 | free(self->domains); 45 | free(self); 46 | } 47 | 48 | MmsDomain* 49 | MmsDevice_getDomain(MmsDevice* self, char* domainId) 50 | { 51 | int i; 52 | 53 | for (i = 0; i < self->domainCount; i++) { 54 | if (strcmp(self->domains[i]->domainName, domainId) == 0) { 55 | return self->domains[i]; 56 | } 57 | 58 | } 59 | 60 | return NULL; 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/mms/iso_mms/server/mms_value_cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_value_cache.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef MMS_VARIABLE_CACHE_H_ 25 | #define MMS_VARIABLE_CACHE_H_ 26 | 27 | #include "mms_device_model.h" 28 | #include "mms_value.h" 29 | 30 | typedef struct sMmsValueCache* MmsValueCache; 31 | 32 | MmsValueCache 33 | MmsValueCache_create(MmsDomain* domain); 34 | 35 | void 36 | MmsValueCache_insertValue(MmsValueCache self, char* itemId, MmsValue* value); 37 | 38 | MmsValue* 39 | MmsValueCache_lookupValue(MmsValueCache self, char* itemId); 40 | 41 | void 42 | MmsValueCache_destroy(MmsValueCache self); 43 | 44 | #endif /* MMS_VARIABLE_CACHE_H_ */ 45 | -------------------------------------------------------------------------------- /src/mms/iso_server/iso_server_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iso_server_private.h 3 | * 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | #ifndef ISO_SERVER_PRIVATE_H_ 25 | #define ISO_SERVER_PRIVATE_H_ 26 | 27 | #include "socket.h" 28 | 29 | IsoConnection 30 | IsoConnection_create(Socket socket, IsoServer isoServer); 31 | 32 | void 33 | private_IsoServer_increaseConnectionCounter(IsoServer self); 34 | 35 | void 36 | private_IsoServer_decreaseConnectionCounter(IsoServer self); 37 | 38 | int 39 | private_IsoServer_getConnectionCounter(IsoServer self); 40 | 41 | /** 42 | * \brief User provided lock that will be called when higher layer (MMS) is called 43 | */ 44 | void 45 | IsoServer_setUserLock(IsoServer self, Semaphore userLock); 46 | 47 | void 48 | IsoServer_userLock(IsoServer self); 49 | 50 | void 51 | IsoServer_userUnlock(IsoServer self); 52 | 53 | #endif /* ISO_SERVER_PRIVATE_H_ */ 54 | -------------------------------------------------------------------------------- /src/sampled_values/sv.asn1: -------------------------------------------------------------------------------- 1 | IEC61850 DEFINITIONS ::= BEGIN 2 | IMPORTS Data FROM ISO-IEC-9506-2 3 | IEC 61850-9-2 Specific Protocol ::= CHOICE { 4 | savPdu [APPLICATION 0] IMPLICIT SavPdu, 5 | } 6 | 7 | 8 | SavPdu ::= SEQUENCE { 9 | noASDU [0] IMPLICIT INTEGER(1..65535), 10 | security [1] ANY OPTIONAL, 11 | asdu [2] IMPLICIT SEQUENCE OF ASDU 12 | } 13 | 14 | ASDU ::= SEQUENCE { 15 | svID [0] IMPLICIT VisibleString, 16 | datset [1] IMPLICIT VisibleString OPTIONAL, 17 | smpCnt [2] IMPLICIT OCTET STRING (SIZE(2)), 18 | confRev [3] IMPLICIT OCTET STRING (SIZE(4)), 19 | refrTm [4] IMPLICIT UtcTime OPTIONAL, 20 | smpSynch [5] IMPLICIT OCTET STRING (SIZE(1)), 21 | smpRate [6] IMPLICIT OCTET STRING (SIZE(2)) OPTIONAL, 22 | sample [7] IMPLICIT OCTET STRING (SIZE(n)), 23 | smpMod [8] IMPLICIT OCTET STRING (SIZE(2)) OPTIONAL 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/vs/stdbool.h: -------------------------------------------------------------------------------- 1 | // just to make Visual Studio Compiler happy! 2 | -------------------------------------------------------------------------------- /tools/model_generator/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir build 4 | 5 | find src/ -name "*.java" > listFile.tmp 6 | 7 | javac -target 1.6 -source 1.6 -d build @listFile.tmp 8 | 9 | jar cfm genmodel.jar manifest.mf -C build/ com/ 10 | 11 | rm listFile.tmp 12 | rm -r build 13 | -------------------------------------------------------------------------------- /tools/model_generator/build2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir build 4 | 5 | find src/ -name "*.java" > listFile.tmp 6 | 7 | javac -target 1.6 -source 1.6 -d build @listFile.tmp 8 | 9 | jar cfm genconfig.jar manifest-dynamic.mf -C build/ com/ 10 | 11 | rm listFile.tmp 12 | rm -r build 13 | -------------------------------------------------------------------------------- /tools/model_generator/genconfig.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/careychow/libIEC61850/5b60884d5ff6836ec4e62d2efe7636eee874f9e5/tools/model_generator/genconfig.jar -------------------------------------------------------------------------------- /tools/model_generator/genmodel.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/careychow/libIEC61850/5b60884d5ff6836ec4e62d2efe7636eee874f9e5/tools/model_generator/genmodel.jar -------------------------------------------------------------------------------- /tools/model_generator/manifest-dynamic.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: com.libiec61850.tools.DynamicModelGenerator 3 | -------------------------------------------------------------------------------- /tools/model_generator/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: com.libiec61850.tools.StaticModelGenerator 3 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/SclParserException.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl; 2 | 3 | import org.w3c.dom.Node; 4 | 5 | /* 6 | * SclParserException.java 7 | * 8 | * Copyright 2013 Michael Zillgith 9 | * 10 | * This file is part of libIEC61850. 11 | * 12 | * libIEC61850 is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * libIEC61850 is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with libIEC61850. If not, see . 24 | * 25 | * See COPYING file for the complete license text. 26 | */ 27 | 28 | public class SclParserException extends Exception { 29 | 30 | private Node node = null; 31 | 32 | public SclParserException() { 33 | } 34 | 35 | public SclParserException(String message) { 36 | super(message); 37 | } 38 | 39 | public SclParserException(Node node, String message) { 40 | super(message); 41 | this.node = node; 42 | } 43 | 44 | @Override 45 | public String getMessage() { 46 | String message = null; 47 | 48 | if (node != null) { 49 | message = node.getNodeName() + " starting at line " + node.getUserData("START_LINE_NUMBER_ATTR") + " column " 50 | + node.getUserData("START_COLUMN_NUMBER_ATTR") + ": " + super.getMessage(); 51 | } else 52 | message = super.getMessage(); 53 | 54 | return message; 55 | } 56 | 57 | private static final long serialVersionUID = 6243253854159814835L; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/communication/Communication.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.communication; 2 | 3 | /* 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | import java.util.LinkedList; 25 | import java.util.List; 26 | 27 | import org.w3c.dom.Node; 28 | 29 | import com.libiec61850.scl.ParserUtils; 30 | import com.libiec61850.scl.SclParserException; 31 | 32 | public class Communication { 33 | 34 | private List subNetworks; 35 | 36 | public Communication(Node comSection) throws SclParserException { 37 | List subnetworks = ParserUtils.getChildNodesWithTag(comSection, "SubNetwork"); 38 | 39 | if (subnetworks.size() == 0) 40 | throw new SclParserException(comSection, "no subnetworks defined"); 41 | 42 | subNetworks = new LinkedList(); 43 | 44 | for (Node node : subnetworks) { 45 | subNetworks.add(new SubNetwork(node)); 46 | } 47 | } 48 | 49 | public List getSubNetworks() { 50 | return subNetworks; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/model/AccessPoint.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.model; 2 | 3 | /* 4 | * AccessPoint.java 5 | * 6 | * Copyright 2013 Michael Zillgith 7 | * 8 | * This file is part of libIEC61850. 9 | * 10 | * libIEC61850 is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * libIEC61850 is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with libIEC61850. If not, see . 22 | * 23 | * See COPYING file for the complete license text. 24 | */ 25 | 26 | import org.w3c.dom.Node; 27 | 28 | import com.libiec61850.scl.ParserUtils; 29 | import com.libiec61850.scl.SclParserException; 30 | import com.libiec61850.scl.types.TypeDeclarations; 31 | 32 | public class AccessPoint { 33 | 34 | private String name; 35 | private Server server; 36 | 37 | public AccessPoint(Node apNode, TypeDeclarations typeDeclarations) throws SclParserException { 38 | this.name = ParserUtils.parseAttribute(apNode, "name"); 39 | 40 | if (this.name == null) 41 | throw new SclParserException(apNode, "AccessPoint as no name defined!"); 42 | 43 | Node serverNode = ParserUtils.getChildNodeWithTag(apNode, "Server"); 44 | 45 | if (serverNode == null) 46 | throw new SclParserException(apNode, "AccessPoint has no server defined!"); 47 | 48 | this.server = new Server(serverNode, typeDeclarations); 49 | 50 | } 51 | 52 | public String getName() { 53 | return name; 54 | } 55 | 56 | public Server getServer() { 57 | return server; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/model/Authentication.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.model; 2 | 3 | /* 4 | * Authentication.java 5 | * 6 | * Copyright 2013 Michael Zillgith 7 | * 8 | * This file is part of libIEC61850. 9 | * 10 | * libIEC61850 is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * libIEC61850 is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with libIEC61850. If not, see . 22 | * 23 | * See COPYING file for the complete license text. 24 | */ 25 | 26 | import org.w3c.dom.Node; 27 | 28 | public class Authentication { 29 | 30 | public Authentication(Node authenticationNode) { 31 | // TODO Auto-generated constructor stub 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/model/DataModelNode.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.model; 2 | 3 | /* 4 | * DataModelNode.java 5 | * 6 | * Copyright 2013 Michael Zillgith 7 | * 8 | * This file is part of libIEC61850. 9 | * 10 | * libIEC61850 is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * libIEC61850 is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with libIEC61850. If not, see . 22 | * 23 | * See COPYING file for the complete license text. 24 | */ 25 | 26 | import com.libiec61850.scl.types.SclType; 27 | 28 | public interface DataModelNode { 29 | public String getName(); 30 | public DataModelNode getChildByName(String childName); 31 | public SclType getSclType(); 32 | public DataModelNode getParent(); 33 | } 34 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/model/FunctionalConstraint.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.model; 2 | 3 | /* 4 | * Copyright 2013, 2014 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | public enum FunctionalConstraint { 25 | ST(0), /** Status information */ 26 | MX(1), /** Measurands - analogue values */ 27 | SP(2), /** Setpoint */ 28 | SV(3), /** Substitution */ 29 | CF(4), /** Configuration */ 30 | DC(5), /** Description */ 31 | SG(6), /** Setting group */ 32 | SE(7), /** Setting group editable */ 33 | SR(8), /** Service response / Service tracking */ 34 | OR(9), /** Operate received */ 35 | BL(10), /** Blocking */ 36 | EX(11), /** Extended definition */ 37 | CO(12), /** Control */ 38 | ALL(99), /** All FCs */ 39 | NONE(-1) /** not specified */ 40 | ; 41 | 42 | private int intValue; 43 | 44 | FunctionalConstraint(int intValue) { 45 | this.intValue = intValue; 46 | } 47 | 48 | public int getIntValue() { 49 | return this.intValue; 50 | } 51 | 52 | public static FunctionalConstraint createFromString(String fc) { 53 | return FunctionalConstraint.valueOf(fc); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/model/Log.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.model; 2 | 3 | import org.w3c.dom.Node; 4 | 5 | import com.libiec61850.scl.ParserUtils; 6 | import com.libiec61850.scl.SclParserException; 7 | 8 | /* 9 | * Copyright 2014 Michael Zillgith 10 | * 11 | * This file is part of libIEC61850. 12 | * 13 | * libIEC61850 is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * libIEC61850 is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with libIEC61850. If not, see . 25 | * 26 | * See COPYING file for the complete license text. 27 | */ 28 | 29 | public class Log { 30 | 31 | private String name; 32 | 33 | public Log(Node logNode) throws SclParserException { 34 | name = ParserUtils.parseAttribute(logNode, "name"); 35 | 36 | if (name == null) 37 | throw new SclParserException(logNode, "Log is missing required attribute name!"); 38 | } 39 | 40 | public String getName() { 41 | return name; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/model/RptEnabled.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.model; 2 | 3 | import org.w3c.dom.Node; 4 | 5 | import com.libiec61850.scl.ParserUtils; 6 | 7 | public class RptEnabled { 8 | 9 | private int maxInstances = 1; 10 | private String desc = null; 11 | 12 | public RptEnabled(Node rptEnabledNode) { 13 | this.desc = ParserUtils.parseAttribute(rptEnabledNode, "desc"); 14 | String maxString = ParserUtils.parseAttribute(rptEnabledNode, "max"); 15 | 16 | if (maxString != null) { 17 | maxInstances = new Integer(maxString); 18 | } 19 | } 20 | 21 | public int getMaxInstances() { 22 | return maxInstances; 23 | } 24 | 25 | public String getDesc() { 26 | return desc; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/model/SettingControl.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.model; 2 | 3 | import org.w3c.dom.Node; 4 | 5 | import com.libiec61850.scl.ParserUtils; 6 | import com.libiec61850.scl.SclParserException; 7 | 8 | /* 9 | * Copyright 2014 Michael Zillgith 10 | * 11 | * This file is part of libIEC61850. 12 | * 13 | * libIEC61850 is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * libIEC61850 is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with libIEC61850. If not, see . 25 | * 26 | * See COPYING file for the complete license text. 27 | */ 28 | 29 | public class SettingControl { 30 | 31 | private String desc; 32 | private int numOfSGs = 1; 33 | private int actSG = 1; 34 | 35 | public SettingControl(Node settingControlNode) throws SclParserException { 36 | desc = ParserUtils.parseAttribute(settingControlNode, "desc"); 37 | 38 | String numOfSGsString = ParserUtils.parseAttribute(settingControlNode, "numOfSGs"); 39 | 40 | if (numOfSGsString != null) 41 | numOfSGs = Integer.decode(numOfSGsString); 42 | 43 | String actSGString = ParserUtils.parseAttribute(settingControlNode, "actSG"); 44 | 45 | if (actSGString != null) 46 | actSG = Integer.decode(actSGString); 47 | } 48 | 49 | public String getDesc() { 50 | return desc; 51 | } 52 | 53 | public int getNumOfSGs() { 54 | return numOfSGs; 55 | } 56 | 57 | public int getActSG() { 58 | return actSG; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/types/EnumerationValue.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.types; 2 | 3 | /* 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | import org.w3c.dom.Node; 25 | 26 | import com.libiec61850.scl.ParserUtils; 27 | import com.libiec61850.scl.SclParserException; 28 | 29 | public class EnumerationValue { 30 | private String symbolicName; 31 | private int ord; 32 | 33 | public EnumerationValue(String symbolicName, int ord) { 34 | this.symbolicName = symbolicName; 35 | this.ord = ord; 36 | } 37 | 38 | public EnumerationValue(Node xmlNode) throws SclParserException { 39 | String ordString = ParserUtils.parseAttribute(xmlNode, "ord"); 40 | 41 | if (ordString == null) 42 | throw new SclParserException(xmlNode, "ord attribute missing"); 43 | 44 | this.ord = new Integer(ordString); 45 | 46 | this.symbolicName = xmlNode.getTextContent(); 47 | } 48 | 49 | public String getSymbolicName() { 50 | return symbolicName; 51 | } 52 | 53 | public int getOrd() { 54 | return ord; 55 | } 56 | 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/types/IllegalValueException.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.types; 2 | 3 | /* 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | public class IllegalValueException extends Exception { 25 | public IllegalValueException(String message) { 26 | super(message); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /tools/model_generator/src/com/libiec61850/scl/types/SclType.java: -------------------------------------------------------------------------------- 1 | package com.libiec61850.scl.types; 2 | 3 | /* 4 | * Copyright 2013 Michael Zillgith 5 | * 6 | * This file is part of libIEC61850. 7 | * 8 | * libIEC61850 is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * libIEC61850 is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with libIEC61850. If not, see . 20 | * 21 | * See COPYING file for the complete license text. 22 | */ 23 | 24 | import org.w3c.dom.Node; 25 | 26 | import com.libiec61850.scl.ParserUtils; 27 | import com.libiec61850.scl.SclParserException; 28 | 29 | public class SclType { 30 | 31 | private String id = null; 32 | private String description; 33 | 34 | public SclType(Node xmlNode) throws SclParserException { 35 | this.id = ParserUtils.parseAttribute(xmlNode, "id"); 36 | this.description = ParserUtils.parseAttribute(xmlNode, "desc"); 37 | 38 | if (this.id == null) 39 | throw new SclParserException(xmlNode, "id is missing!"); 40 | } 41 | 42 | public SclType(String id, String description) { 43 | this.id = id; 44 | this.description = description; 45 | } 46 | 47 | public String getId() { 48 | return id; 49 | } 50 | 51 | public String getDesc() { 52 | return description; 53 | } 54 | } 55 | --------------------------------------------------------------------------------