├── .gitignore ├── README.md ├── builds ├── arm32 │ ├── Dockerfile-arm │ └── linux-arm-toolchain.cmake └── arm64 │ ├── Dockerfile-arm64 │ └── linux-arm64-toolchain.cmake ├── doc └── images │ ├── linux64.png │ ├── server.png │ └── win64.png ├── go.mod └── iec61850 ├── config.go ├── config_armv7l.go ├── config_armv8.go ├── config_linux64.go ├── config_windows64.go ├── iec61850_client.go ├── iec61850_control.go ├── iec61850_server.go ├── inc ├── common │ └── inc │ │ ├── buffer_chain.h │ │ ├── byte_buffer.h │ │ ├── conversions.h │ │ ├── inc_common.go │ │ ├── libiec61850_common_api.h │ │ ├── libiec61850_platform_includes.h │ │ ├── linked_list.h │ │ ├── map.h │ │ ├── mem_alloc_linked_list.h │ │ ├── simple_allocator.h │ │ ├── string_map.h │ │ └── string_utilities.h ├── goose │ ├── goose_publisher.h │ ├── goose_receiver.h │ ├── goose_receiver_internal.h │ ├── goose_subscriber.h │ ├── iec61850_goose.asn │ └── inc_goose.go ├── hal │ └── inc │ │ ├── hal_base.h │ │ ├── hal_ethernet.h │ │ ├── hal_filesystem.h │ │ ├── hal_serial.h │ │ ├── hal_socket.h │ │ ├── hal_thread.h │ │ ├── hal_time.h │ │ ├── inc_hal.go │ │ ├── lib_memory.h │ │ ├── platform_endian.h │ │ ├── tls_config.h │ │ └── tls_socket.h ├── iec61850 │ ├── inc │ │ ├── iec61850_cdc.h │ │ ├── iec61850_client.h │ │ ├── iec61850_common.h │ │ ├── iec61850_config_file_parser.h │ │ ├── iec61850_dynamic_model.h │ │ ├── iec61850_model.h │ │ ├── iec61850_server.h │ │ └── inc_61850.go │ └── inc_private │ │ ├── control.h │ │ ├── iec61850_common_internal.h │ │ ├── ied_connection_private.h │ │ ├── ied_server_private.h │ │ ├── inc_61850_private.go │ │ ├── logging.h │ │ ├── mms_goose.h │ │ ├── mms_mapping.h │ │ ├── mms_mapping_internal.h │ │ ├── mms_sv.h │ │ └── reporting.h ├── logging │ ├── inc_logging.go │ └── logging_api.h └── mms │ ├── inc │ ├── inc_mms.go │ ├── iso_connection_parameters.h │ ├── mms_client_connection.h │ ├── mms_common.h │ ├── mms_server.h │ ├── mms_type_spec.h │ ├── mms_types.h │ └── mms_value.h │ ├── inc_private │ ├── acse.h │ ├── asn1_ber_primitive_value.h │ ├── ber_decode.h │ ├── ber_encoder.h │ ├── ber_integer.h │ ├── cotp.h │ ├── inc_mms_private.go │ ├── iso_client_connection.h │ ├── iso_presentation.h │ ├── iso_server.h │ ├── iso_server_private.h │ ├── iso_session.h │ ├── mms_client_internal.h │ ├── mms_common_internal.h │ ├── mms_device_model.h │ ├── mms_named_variable_list.h │ ├── mms_server_connection.h │ ├── mms_server_internal.h │ ├── mms_server_libinternal.h │ ├── mms_value_cache.h │ └── mms_value_internal.h │ └── iso_mms │ └── asn1c │ ├── AccessResult.h │ ├── Address.h │ ├── AlternateAccess.h │ ├── AlternateAccessSelection.h │ ├── BIT_STRING.h │ ├── BOOLEAN.h │ ├── ConcludeRequestPDU.h │ ├── ConcludeResponsePDU.h │ ├── ConfirmedErrorPDU.h │ ├── ConfirmedRequestPdu.h │ ├── ConfirmedResponsePdu.h │ ├── ConfirmedServiceRequest.h │ ├── ConfirmedServiceResponse.h │ ├── Data.h │ ├── DataAccessError.h │ ├── DataSequence.h │ ├── DefineNamedVariableListRequest.h │ ├── DefineNamedVariableListResponse.h │ ├── DeleteNamedVariableListRequest.h │ ├── DeleteNamedVariableListResponse.h │ ├── FloatingPoint.h │ ├── GeneralizedTime.h │ ├── GetNameListRequest.h │ ├── GetNameListResponse.h │ ├── GetNamedVariableListAttributesRequest.h │ ├── GetNamedVariableListAttributesResponse.h │ ├── GetVariableAccessAttributesRequest.h │ ├── GetVariableAccessAttributesResponse.h │ ├── INTEGER.h │ ├── Identifier.h │ ├── IndexRangeSeq.h │ ├── InformationReport.h │ ├── InitRequestDetail.h │ ├── InitResponseDetail.h │ ├── InitiateErrorPdu.h │ ├── InitiateRequestPdu.h │ ├── InitiateResponsePdu.h │ ├── Integer16.h │ ├── Integer32.h │ ├── Integer8.h │ ├── ListOfVariableSeq.h │ ├── MMSString.h │ ├── MmsPdu.h │ ├── NULL.h │ ├── NativeEnumerated.h │ ├── NativeInteger.h │ ├── OCTET_STRING.h │ ├── ObjectClass.h │ ├── ObjectName.h │ ├── ParameterSupportOptions.h │ ├── ReadRequest.h │ ├── ReadResponse.h │ ├── RejectPDU.h │ ├── ScatteredAccessDescription.h │ ├── ServiceError.h │ ├── ServiceSupportOptions.h │ ├── StructComponent.h │ ├── TimeOfDay.h │ ├── TypeSpecification.h │ ├── UTF8String.h │ ├── UnconfirmedPDU.h │ ├── UnconfirmedService.h │ ├── Unsigned16.h │ ├── Unsigned32.h │ ├── Unsigned8.h │ ├── UtcTime.h │ ├── VariableAccessSpecification.h │ ├── VariableSpecification.h │ ├── VisibleString.h │ ├── WriteRequest.h │ ├── WriteResponse.h │ ├── asn_SEQUENCE_OF.h │ ├── asn_SET_OF.h │ ├── asn_application.h │ ├── asn_codecs.h │ ├── asn_codecs_prim.h │ ├── asn_internal.h │ ├── asn_system.h │ ├── ber_decoder.h │ ├── ber_tlv_length.h │ ├── ber_tlv_tag.h │ ├── constr_CHOICE.h │ ├── constr_SEQUENCE.h │ ├── constr_SEQUENCE_OF.h │ ├── constr_SET_OF.h │ ├── constr_TYPE.h │ ├── constraints.h │ ├── der_encoder.h │ ├── inc_mms_asn1c.go │ ├── per_decoder.h │ ├── per_encoder.h │ ├── per_support.h │ ├── xer_decoder.h │ ├── xer_encoder.h │ └── xer_support.h ├── lib ├── linux64 │ ├── lib_linux64.go │ └── libiec61850.a ├── linux_armv7l │ ├── lib_armv7l.go │ ├── libhal.a │ └── libiec61850.a ├── linux_armv8 │ ├── lib_armv8.go │ ├── libhal.a │ └── libiec61850.a └── win64 │ ├── lib_win64.go │ ├── libhal.a │ └── libiec61850.a ├── model.go ├── scl_xml └── scl.go ├── test ├── client_control_test.go ├── client_model_browser_test.go ├── client_model_read_values_test.go ├── scl_load_test.go ├── server_dynamic_test.go └── test_icd.icd └── types.go /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /cmd 3 | -------------------------------------------------------------------------------- /builds/arm32/Dockerfile-arm: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | RUN apt-get update -y \ 4 | && apt-get install -y gcc-multilib-arm-linux-gnueabihf binutils-arm-linux-gnueabihf g++-multilib-arm-linux-gnueabihf 5 | RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y git cmake 6 | 7 | RUN mkdir /workspace && cd /workspace \ 8 | && git clone https://github.com/mz-automation/libiec61850.git \ 9 | && mkdir libiec61850/build 10 | COPY linux-arm-toolchain.cmake /workspace/libiec61850/build 11 | 12 | RUN cd /workspace/libiec61850/build \ 13 | && cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=linux-arm-toolchain.cmake .. ${1+"$@"} \ 14 | && make -j 2 \ 15 | && make install 16 | 17 | 18 | WORKDIR /workspace/libiec61850/build -------------------------------------------------------------------------------- /builds/arm32/linux-arm-toolchain.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Linux) 2 | set(CMAKE_SYSTEM_PROCESSOR arm) 3 | set(CMAKE_C_FLAGS "-march=armv7-a") 4 | set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc) -------------------------------------------------------------------------------- /builds/arm64/Dockerfile-arm64: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | RUN apt-get update -y \ 4 | && apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu 5 | RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y git cmake 6 | 7 | RUN mkdir /workspace && cd /workspace \ 8 | && git clone https://github.com/mz-automation/libiec61850.git \ 9 | && mkdir libiec61850/build 10 | COPY linux-arm64-toolchain.cmake /workspace/libiec61850/build 11 | 12 | RUN cd /workspace/libiec61850/build \ 13 | && cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=linux-arm64-toolchain.cmake .. ${1+"$@"} \ 14 | && make -j 2 \ 15 | && make install 16 | 17 | 18 | WORKDIR /workspace/libiec61850/build -------------------------------------------------------------------------------- /builds/arm64/linux-arm64-toolchain.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Linux) 2 | set(CMAKE_SYSTEM_PROCESSOR arm) 3 | set(CMAKE_C_FLAGS "-march=armv8-a") 4 | set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc) 5 | set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++) -------------------------------------------------------------------------------- /doc/images/linux64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/doc/images/linux64.png -------------------------------------------------------------------------------- /doc/images/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/doc/images/server.png -------------------------------------------------------------------------------- /doc/images/win64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/doc/images/win64.png -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/jifanchn/go-libiec61850 2 | 3 | go 1.18 4 | -------------------------------------------------------------------------------- /iec61850/config.go: -------------------------------------------------------------------------------- 1 | package iec61850 2 | 3 | // this file is used to import all the packages that are needed include cgo files 4 | // if you want to use the cgo files, you should import this file 5 | 6 | import ( 7 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/common/inc" 8 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/goose" 9 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/hal/inc" 10 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/iec61850/inc" 11 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/iec61850/inc_private" 12 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/logging" 13 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/mms/inc" 14 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/mms/inc_private" 15 | _ "github.com/jifanchn/go-libiec61850/iec61850/inc/mms/iso_mms/asn1c" 16 | 17 | _ "github.com/jifanchn/go-libiec61850/iec61850/lib/linux64" 18 | _ "github.com/jifanchn/go-libiec61850/iec61850/lib/linux_armv7l" 19 | _ "github.com/jifanchn/go-libiec61850/iec61850/lib/win64" 20 | ) 21 | -------------------------------------------------------------------------------- /iec61850/config_armv7l.go: -------------------------------------------------------------------------------- 1 | //go:build linux && arm 2 | 3 | package iec61850 4 | 5 | // #cgo CFLAGS: -I./inc/hal/inc -I./inc/common/inc -I./inc/goose -I./inc/iec61850/inc -I./inc/iec61850/inc_private -I./inc/logging -I./inc/mms/inc -I./inc/mms/inc_private -I./inc/mms/iso_mms/asn1c 6 | // #cgo LDFLAGS: -static-libgcc -static-libstdc++ -L./lib/linux_armv7l -liec61850 -lhal 7 | import "C" 8 | -------------------------------------------------------------------------------- /iec61850/config_armv8.go: -------------------------------------------------------------------------------- 1 | //go:build linux && arm64 2 | 3 | package iec61850 4 | 5 | // #cgo CFLAGS: -I./inc/hal/inc -I./inc/common/inc -I./inc/goose -I./inc/iec61850/inc -I./inc/iec61850/inc_private -I./inc/logging -I./inc/mms/inc -I./inc/mms/inc_private -I./inc/mms/iso_mms/asn1c 6 | // #cgo LDFLAGS: -static-libgcc -static-libstdc++ -L./lib/linux_armv8 -liec61850 -lhal 7 | import "C" 8 | -------------------------------------------------------------------------------- /iec61850/config_linux64.go: -------------------------------------------------------------------------------- 1 | //go:build linux && amd64 2 | 3 | package iec61850 4 | 5 | // #cgo CFLAGS: -I./inc/hal/inc -I./inc/common/inc -I./inc/goose -I./inc/iec61850/inc -I./inc/iec61850/inc_private -I./inc/logging -I./inc/mms/inc -I./inc/mms/inc_private -I./inc/mms/iso_mms/asn1c 6 | // #cgo LDFLAGS: -static-libgcc -static-libstdc++ -L./lib/linux64 -liec61850 7 | import "C" 8 | -------------------------------------------------------------------------------- /iec61850/config_windows64.go: -------------------------------------------------------------------------------- 1 | //go:build windows && amd64 2 | 3 | package iec61850 4 | 5 | // #cgo CFLAGS: -I./inc/hal/inc -I./inc/common/inc -I./inc/goose -I./inc/iec61850/inc -I./inc/iec61850/inc_private -I./inc/logging -I./inc/mms/inc -I./inc/mms/inc_private -I./inc/mms/iso_mms/asn1c 6 | // #cgo LDFLAGS: -static-libgcc -static-libstdc++ -L./lib/win64 -liec61850 -lhal -lws2_32 7 | import "C" 8 | -------------------------------------------------------------------------------- /iec61850/iec61850_control.go: -------------------------------------------------------------------------------- 1 | package iec61850 2 | 3 | // #include 4 | import "C" 5 | import ( 6 | "fmt" 7 | "unsafe" 8 | ) 9 | 10 | // DirectWithNormalSecurity Get the value of the specified data set 11 | func (client *IedClient) DirectWithNormalSecurity(controlReference string, val bool) error { 12 | //var clientError C.IedClientError 13 | 14 | cDataSetReference := C.CString(controlReference) 15 | defer C.free(unsafe.Pointer(cDataSetReference)) 16 | 17 | control := C.ControlObjectClient_create(cDataSetReference, client.connection) 18 | if control == nil { 19 | return fmt.Errorf("error creating control object client") 20 | } 21 | 22 | defer C.ControlObjectClient_destroy(control) 23 | 24 | ctlVal := C.MmsValue_newBoolean(C._Bool(val)) 25 | defer C.MmsValue_delete(ctlVal) 26 | 27 | C.ControlObjectClient_setOrigin(control, nil, 3) 28 | 29 | if bool(C.ControlObjectClient_operate(control, ctlVal, 0)) { 30 | return nil 31 | } else { 32 | return fmt.Errorf("failed to operate %s\n", controlReference) 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /iec61850/iec61850_server.go: -------------------------------------------------------------------------------- 1 | package iec61850 2 | 3 | /* 4 | #include "iec61850_server.h" 5 | */ 6 | import "C" 7 | 8 | type IedServer struct { 9 | server C.IedServer 10 | } 11 | 12 | // NewIedServer creates a new instance of the IedServer using the provided model. 13 | func NewIedServer(model *IedModel) *IedServer { 14 | return &IedServer{ 15 | server: C.IedServer_create(model.model), 16 | } 17 | } 18 | 19 | // Start initiates the IedServer on the provided port. 20 | func (is *IedServer) Start(port int) { 21 | C.IedServer_start(is.server, C.int(port)) 22 | // If there's another way to detect the error, handle it here. 23 | } 24 | 25 | // IsRunning checks if the IedServer is currently running. 26 | func (is *IedServer) IsRunning() bool { 27 | return bool(C.IedServer_isRunning(is.server)) 28 | } 29 | 30 | // Stop terminates the IedServer. 31 | func (is *IedServer) Stop() { 32 | C.IedServer_stop(is.server) 33 | } 34 | 35 | // Destroy frees all resources associated with the IedServer. 36 | func (is *IedServer) Destroy() { 37 | C.IedServer_destroy(is.server) 38 | } 39 | 40 | // LockDataModel locks the data model of the IedServer. 41 | func (is *IedServer) LockDataModel() { 42 | C.IedServer_lockDataModel(is.server) 43 | } 44 | 45 | // UnlockDataModel unlocks the data model of the IedServer. 46 | func (is *IedServer) UnlockDataModel() { 47 | C.IedServer_unlockDataModel(is.server) 48 | } 49 | 50 | // UpdateUTCTimeAttributeValue updates a DataAttribute with a UTC time value. 51 | func (is *IedServer) UpdateUTCTimeAttributeValue(attr *DataAttribute, value int64) { 52 | C.IedServer_updateUTCTimeAttributeValue(is.server, attr.attribute, C.uint64_t(value)) 53 | } 54 | 55 | // UpdateFloatAttributeValue updates a DataAttribute with a float value. 56 | func (is *IedServer) UpdateFloatAttributeValue(attr *DataAttribute, value float32) { 57 | C.IedServer_updateFloatAttributeValue(is.server, attr.attribute, C.float(value)) 58 | } 59 | 60 | // UpdateInt32AttributeValue updates a DataAttribute with an Int32 value. 61 | func (is *IedServer) UpdateInt32AttributeValue(attr *DataAttribute, value int32) { 62 | C.IedServer_updateInt32AttributeValue(is.server, attr.attribute, C.int32_t(value)) 63 | } 64 | 65 | // UpdateVisibleStringAttributeValue updates a DataAttribute with a visible string value. 66 | func (is *IedServer) UpdateVisibleStringAttributeValue(attr *DataAttribute, value string) { 67 | C.IedServer_updateVisibleStringAttributeValue(is.server, attr.attribute, C.CString(value)) 68 | } 69 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/buffer_chain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * buffer_chain.h 3 | * 4 | * Copyright 2013-2018 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 BUFFER_CHAIN_H_ 25 | #define BUFFER_CHAIN_H_ 26 | 27 | #include "libiec61850_platform_includes.h" 28 | 29 | typedef struct sBufferChain* BufferChain; 30 | 31 | struct sBufferChain { 32 | int length; 33 | int partLength; 34 | int partMaxLength; 35 | uint8_t* buffer; 36 | BufferChain nextPart; 37 | }; 38 | 39 | LIB61850_INTERNAL void 40 | BufferChain_init(BufferChain self, int length, int partLength, BufferChain nextPart, uint8_t* buffer); 41 | 42 | typedef struct { 43 | uint8_t* memory; 44 | int currentPos; 45 | int size; 46 | } MemoryArea; 47 | 48 | LIB61850_INTERNAL void 49 | MemoryArea_initialize(MemoryArea* self, uint8_t* memory, int size); 50 | 51 | LIB61850_INTERNAL uint8_t* 52 | MemoryArea_getNextBlock(MemoryArea* self, int size); 53 | 54 | #if 0 55 | 56 | typedef struct sMemoryPool* MemoryPool; 57 | 58 | typedef struct sMemoryChunk MemoryChunk; 59 | 60 | struct sMemoryPool { 61 | uint8_t* memory; 62 | int size; 63 | MemoryChunk firstChunk; 64 | }; 65 | 66 | struct sMemoryChunk { 67 | MemoryChunk previous; 68 | MemoryChunk next; 69 | uint8_t* data; 70 | uint8_t free; 71 | int size; 72 | }; 73 | 74 | MemoryPool 75 | MemoryPool_create(uint8_t* memoryAddress, int size); 76 | 77 | void 78 | MemoryPool_destroy(MemoryPool self); 79 | 80 | MemoryChunk 81 | MemoryPool_allocateChunk(MemoryPool self, int size); 82 | MemoryPool_freeChunk(MemoryPool self, MemoryChunk chunk); 83 | 84 | #endif 85 | 86 | #endif /* BUFFER_CHAIN_H_ */ 87 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/byte_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * byte_buffer.h 3 | * 4 | * Copyright 2013-2018 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 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | typedef struct { 34 | uint8_t* buffer; 35 | int maxSize; 36 | int size; 37 | } ByteBuffer; 38 | 39 | LIB61850_INTERNAL ByteBuffer* 40 | ByteBuffer_create(ByteBuffer* self, int maxSize); 41 | 42 | LIB61850_INTERNAL void 43 | ByteBuffer_destroy(ByteBuffer* self); 44 | 45 | LIB61850_INTERNAL void 46 | ByteBuffer_wrap(ByteBuffer* self, uint8_t* buf, int size, int maxSize); 47 | 48 | LIB61850_INTERNAL int 49 | ByteBuffer_append(ByteBuffer* self, uint8_t* data, int dataSize); 50 | 51 | LIB61850_INTERNAL int 52 | ByteBuffer_appendByte(ByteBuffer* self, uint8_t byte); 53 | 54 | LIB61850_INTERNAL uint8_t* 55 | ByteBuffer_getBuffer(ByteBuffer* self); 56 | 57 | LIB61850_INTERNAL int 58 | ByteBuffer_getSize(ByteBuffer* self); 59 | 60 | LIB61850_INTERNAL int 61 | ByteBuffer_getMaxSize(ByteBuffer* self); 62 | 63 | LIB61850_INTERNAL int 64 | ByteBuffer_setSize(ByteBuffer* self, int size); 65 | 66 | LIB61850_INTERNAL void 67 | ByteBuffer_print(ByteBuffer* self, char* message); 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | 74 | #endif /* BYTE_BUFFER_H_ */ 75 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/conversions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * conversions.h 3 | * 4 | * Some helper functions to convert data. 5 | * 6 | * Copyright 2014-2018 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_common_api.h" 30 | 31 | LIB61850_INTERNAL void 32 | Conversions_intToStringBuffer(int intValue, int numberOfDigits, uint8_t* buffer); 33 | 34 | LIB61850_INTERNAL void 35 | Conversions_msTimeToGeneralizedTime(uint64_t msTime, uint8_t* buffer); 36 | 37 | LIB61850_INTERNAL uint64_t 38 | Conversions_generalizedTimeToMsTime(const char* gtString); 39 | 40 | LIB61850_INTERNAL void 41 | memcpyReverseByteOrder(uint8_t* dst, const uint8_t* src, int size); 42 | 43 | #endif /* CONVERSIONS_H_ */ 44 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/inc_common.go: -------------------------------------------------------------------------------- 1 | package inc_common 2 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/libiec61850_common_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libiec61850_common_api.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 | #ifndef DEPRECATED 21 | #if defined(__GNUC__) || defined(__clang__) 22 | #define DEPRECATED __attribute__((deprecated)) 23 | #else 24 | #define DEPRECATED 25 | #endif 26 | #endif 27 | 28 | #if defined _WIN32 || defined __CYGWIN__ 29 | #ifdef EXPORT_FUNCTIONS_FOR_DLL 30 | #define LIB61850_API __declspec(dllexport) 31 | #else 32 | #define LIB61850_API 33 | #endif 34 | 35 | #define LIB61850_INTERNAL 36 | #else 37 | #if __GNUC__ >= 4 38 | #define LIB61850_API __attribute__ ((visibility ("default"))) 39 | #define LIB61850_INTERNAL __attribute__ ((visibility ("hidden"))) 40 | #else 41 | #define LIB61850_API 42 | #define LIB61850_INTERNAL 43 | #endif 44 | #endif 45 | 46 | #include "hal_time.h" 47 | #include "mms_value.h" 48 | 49 | #endif /* LIBIEC61850_COMMON_API_INCLUDES_H_ */ 50 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/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 "stack_config.h" 9 | 10 | #include "libiec61850_common_api.h" 11 | 12 | #include "string_utilities.h" 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include "platform_endian.h" 19 | 20 | #define LIBIEC61850_VERSION "1.5.2" 21 | 22 | #ifndef CONFIG_DEFAULT_MMS_VENDOR_NAME 23 | #define CONFIG_DEFAULT_MMS_VENDOR_NAME "libiec61850.com" 24 | #endif 25 | 26 | #ifndef CONFIG_DEFAULT_MMS_MODEL_NAME 27 | #define CONFIG_DEFAULT_MMS_MODEL_NAME "LIBIEC61850" 28 | #endif 29 | 30 | #ifndef CONFIG_DEFAULT_MMS_REVISION 31 | #define CONFIG_DEFAULT_MMS_REVISION LIBIEC61850_VERSION 32 | #endif 33 | 34 | #ifndef CONFIG_IEC61850_SAMPLED_VALUES_SUPPORT 35 | #define CONFIG_IEC61850_SAMPLED_VALUES_SUPPORT 0 36 | #endif 37 | 38 | #if (DEBUG != 1) 39 | #define NDEBUG 1 40 | #endif 41 | 42 | #include 43 | 44 | #include "lib_memory.h" 45 | 46 | #endif /* LIBIEC61850_PLATFORM_INCLUDES_H_ */ 47 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * map.h 3 | * 4 | * Copyright 2013-2018 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_common_api.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 | LIB61850_INTERNAL Map 40 | Map_create(void); 41 | 42 | LIB61850_INTERNAL int 43 | Map_size(Map map); 44 | 45 | LIB61850_INTERNAL void* 46 | Map_addEntry(Map map, void* key, void* value); 47 | 48 | LIB61850_INTERNAL void* 49 | Map_removeEntry(Map map, void* key, bool deleteKey); 50 | 51 | LIB61850_INTERNAL void* 52 | Map_getEntry(Map map, void* key); 53 | 54 | LIB61850_INTERNAL void 55 | Map_delete(Map map, bool deleteKey); 56 | 57 | LIB61850_INTERNAL void 58 | Map_deleteStatic(Map map, bool deleteKey); 59 | 60 | LIB61850_INTERNAL void 61 | Map_deleteDeep(Map map, bool deleteKey, void (*valueDeleteFunction) (void*)); 62 | 63 | 64 | #endif /* MAP_H_ */ 65 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/mem_alloc_linked_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mem_alloc_linked_list.h 3 | * 4 | * Implementation of linked list (LinkedList) that uses the provided memory buffer as 5 | * memory pool for storage allocation. 6 | * 7 | * Copyright 2014 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 | #ifndef MEM_ALLOC_LINKED_LIST_H_ 28 | #define MEM_ALLOC_LINKED_LIST_H_ 29 | 30 | #include "libiec61850_common_api.h" 31 | #include "linked_list.h" 32 | #include "simple_allocator.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef struct sMemAllocLinkedList* MemAllocLinkedList; 39 | 40 | LIB61850_INTERNAL MemAllocLinkedList 41 | MemAllocLinkedList_create(MemoryAllocator* ma); 42 | 43 | LIB61850_INTERNAL LinkedList 44 | MemAllocLinkedList_add(MemAllocLinkedList list, void* data); 45 | 46 | #endif /* MEM_ALLOC_LINKED_LIST_H_ */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/simple_allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * simple_allocator.h 3 | * 4 | * Copyright 2013-2018 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 | LIB61850_INTERNAL void 34 | MemoryAllocator_init(MemoryAllocator* self, char* memoryBlock, int size); 35 | 36 | LIB61850_INTERNAL int 37 | MemoryAllocator_getAlignedSize(int size); 38 | 39 | LIB61850_INTERNAL char* 40 | MemoryAllocator_allocate(MemoryAllocator* self, int size); 41 | 42 | #endif /* SIMPLE_ALLOCATOR_H_ */ 43 | -------------------------------------------------------------------------------- /iec61850/inc/common/inc/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 | LIB61850_INTERNAL Map 27 | StringMap_create(void); 28 | 29 | -------------------------------------------------------------------------------- /iec61850/inc/goose/goose_receiver_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * goose_receiver_internal.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 GOOSE_RECEIVER_INTERNAL_H_ 25 | #define GOOSE_RECEIVER_INTERNAL_H_ 26 | 27 | 28 | #define ETH_BUFFER_LENGTH 1518 29 | 30 | #define ETH_P_GOOSE 0x88b8 31 | 32 | #ifndef DEBUG_GOOSE_SUBSCRIBER 33 | #define DEBUG_GOOSE_SUBSCRIBER 0 34 | #endif 35 | 36 | 37 | struct sGooseSubscriber { 38 | char goCBRef[130]; 39 | char datSet[130]; 40 | char goId[130]; 41 | int goCBRefLen; 42 | uint32_t timeAllowedToLive; 43 | uint32_t stNum; 44 | uint32_t sqNum; 45 | uint32_t confRev; 46 | MmsValue* timestamp; 47 | bool simulation; 48 | bool ndsCom; 49 | 50 | uint64_t invalidityTime; 51 | bool stateValid; 52 | GooseParseError parseError; 53 | 54 | uint8_t srcMac[6]; /* source mac address */ 55 | uint8_t dstMac[6]; /* destination mac address */ 56 | int32_t appId; /* APPID or -1 if APPID should be ignored */ 57 | 58 | MmsValue* dataSetValues; 59 | bool dataSetValuesSelfAllocated; 60 | bool dstMacSet; 61 | bool isObserver; 62 | bool vlanSet; 63 | uint16_t vlanId; 64 | uint8_t vlanPrio; 65 | 66 | GooseListener listener; 67 | void* listenerParameter; 68 | }; 69 | 70 | 71 | 72 | #endif /* GOOSE_RECEIVER_INTERNAL_H_ */ 73 | -------------------------------------------------------------------------------- /iec61850/inc/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 | -------------------------------------------------------------------------------- /iec61850/inc/goose/inc_goose.go: -------------------------------------------------------------------------------- 1 | package inc_goose 2 | -------------------------------------------------------------------------------- /iec61850/inc/hal/inc/hal_base.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hal_base.h 3 | * 4 | * Copyright 2013-2021 Michael Zillgith 5 | * 6 | * This file is part of Platform Abstraction Layer (libpal) 7 | * for libiec61850, libmms, and lib60870. 8 | */ 9 | 10 | #ifndef HAL_INC_HAL_BASE_H_ 11 | #define HAL_INC_HAL_BASE_H_ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #ifdef __GNUC__ 20 | #define ATTRIBUTE_PACKED __attribute__ ((__packed__)) 21 | #else 22 | #define ATTRIBUTE_PACKED 23 | #endif 24 | 25 | #ifndef DEPRECATED 26 | #if defined(__GNUC__) || defined(__clang__) 27 | #define DEPRECATED __attribute__((deprecated)) 28 | #else 29 | #define DEPRECATED 30 | #endif 31 | #endif 32 | 33 | #if defined _WIN32 || defined __CYGWIN__ 34 | #ifdef EXPORT_FUNCTIONS_FOR_DLL 35 | #define PAL_API __declspec(dllexport) 36 | #else 37 | #define PAL_API 38 | #endif 39 | 40 | #define PAL_INTERNAL 41 | #else 42 | #if __GNUC__ >= 4 43 | #define PAL_API __attribute__ ((visibility ("default"))) 44 | #define PAL_INTERNAL __attribute__ ((visibility ("hidden"))) 45 | #else 46 | #define PAL_API 47 | #define PAL_INTERNAL 48 | #endif 49 | #endif 50 | 51 | #endif /* HAL_INC_HAL_BASE_H_ */ 52 | -------------------------------------------------------------------------------- /iec61850/inc/hal/inc/hal_thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * thread_hal.h 3 | * 4 | * Multi-threading abstraction layer 5 | * 6 | * Copyright 2013-2021 Michael Zillgith 7 | * 8 | * This file is part of Platform Abstraction Layer (libpal) 9 | * for libiec61850, libmms, and lib60870. 10 | */ 11 | 12 | #ifndef THREAD_HAL_H_ 13 | #define THREAD_HAL_H_ 14 | 15 | #include "hal_base.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /** 22 | * \file hal_thread.h 23 | * \brief Abstraction layer for threading and synchronization 24 | */ 25 | 26 | /*! \addtogroup hal 27 | * 28 | * @{ 29 | */ 30 | 31 | /** 32 | * @defgroup HAL_THREAD Threading and synchronization API 33 | * 34 | * @{ 35 | */ 36 | 37 | /** Opaque reference of a Thread instance */ 38 | typedef struct sThread* Thread; 39 | 40 | /** Qpaque reference of a Semaphore instance */ 41 | typedef void* Semaphore; 42 | 43 | /** Reference to a function that is called when starting the thread */ 44 | typedef void* (*ThreadExecutionFunction) (void*); 45 | 46 | /** 47 | * \brief Create a new Thread instance 48 | * 49 | * \param function the entry point of the thread 50 | * \param parameter a parameter that is passed to the threads start function 51 | * \param autodestroy the thread is automatically destroyed if the ThreadExecutionFunction has finished. 52 | * 53 | * \return the newly created Thread instance 54 | */ 55 | PAL_API Thread 56 | Thread_create(ThreadExecutionFunction function, void* parameter, bool autodestroy); 57 | 58 | /** 59 | * \brief Start a Thread. 60 | * 61 | * This function invokes the start function of the thread. The thread terminates when 62 | * the start function returns. 63 | * 64 | * \param thread the Thread instance to start 65 | */ 66 | PAL_API void 67 | Thread_start(Thread thread); 68 | 69 | /** 70 | * \brief Destroy a Thread and free all related resources. 71 | * 72 | * \param thread the Thread instance to destroy 73 | */ 74 | PAL_API void 75 | Thread_destroy(Thread thread); 76 | 77 | /** 78 | * \brief Suspend execution of the Thread for the specified number of milliseconds 79 | */ 80 | PAL_API void 81 | Thread_sleep(int millies); 82 | 83 | PAL_API Semaphore 84 | Semaphore_create(int initialValue); 85 | 86 | /* Wait until semaphore value is greater than zero. Then decrease the semaphore value. */ 87 | PAL_API void 88 | Semaphore_wait(Semaphore self); 89 | 90 | PAL_API void 91 | Semaphore_post(Semaphore self); 92 | 93 | PAL_API void 94 | Semaphore_destroy(Semaphore self); 95 | 96 | /*! @} */ 97 | 98 | /*! @} */ 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | 104 | 105 | #endif /* THREAD_HAL_H_ */ 106 | -------------------------------------------------------------------------------- /iec61850/inc/hal/inc/hal_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * time.c 3 | * 4 | * Copyright 2013-2021 Michael Zillgith 5 | * 6 | * This file is part of Platform Abstraction Layer (libpal) 7 | * for libiec61850, libmms, and lib60870. 8 | */ 9 | 10 | #ifndef HAL_C_ 11 | #define HAL_C_ 12 | 13 | #include "hal_base.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | * \file hal_time.h 21 | * \brief Abstraction layer for system time access 22 | */ 23 | 24 | /*! \addtogroup hal 25 | * 26 | * @{ 27 | */ 28 | 29 | /** 30 | * @defgroup HAL_TIME Time related functions 31 | * 32 | * @{ 33 | */ 34 | 35 | typedef uint64_t nsSinceEpoch; 36 | typedef uint64_t msSinceEpoch; 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 | PAL_API msSinceEpoch 47 | Hal_getTimeInMs(void); 48 | 49 | /** 50 | * Get the system time in nanoseconds. 51 | * 52 | * The time value returned as 64-bit unsigned integer should represent the nanoseconds 53 | * since the UNIX epoch (1970/01/01 00:00 UTC). 54 | * 55 | * \return the system time with nanosecond resolution. 56 | */ 57 | PAL_API nsSinceEpoch 58 | Hal_getTimeInNs(void); 59 | 60 | /** 61 | * Set the system time from ns time 62 | * 63 | * The time value returned as 64-bit unsigned integer should represent the nanoseconds 64 | * since the UNIX epoch (1970/01/01 00:00 UTC). 65 | * 66 | * \return true on success, otherwise false 67 | */ 68 | PAL_API bool 69 | Hal_setTimeInNs(nsSinceEpoch nsTime); 70 | 71 | /*! @} */ 72 | 73 | /*! @} */ 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | 80 | #endif /* HAL_C_ */ 81 | -------------------------------------------------------------------------------- /iec61850/inc/hal/inc/inc_hal.go: -------------------------------------------------------------------------------- 1 | package inc_hal 2 | -------------------------------------------------------------------------------- /iec61850/inc/hal/inc/lib_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * lib_memory.h 3 | * 4 | * Copyright 2014-2021 Michael Zillgith 5 | * 6 | * This file is part of Platform Abstraction Layer (libpal) 7 | * for libiec61850, libmms, and lib60870. 8 | */ 9 | 10 | #ifndef MEMORY_H_ 11 | #define MEMORY_H_ 12 | 13 | #include "hal_base.h" 14 | 15 | #define CALLOC(nmemb, size) Memory_calloc(nmemb, size) 16 | #define MALLOC(size) Memory_malloc(size) 17 | #define REALLOC(oldptr, size) Memory_realloc(oldptr, size) 18 | #define FREEMEM(ptr) Memory_free(ptr) 19 | 20 | #define GLOBAL_CALLOC(nmemb, size) Memory_calloc(nmemb, size) 21 | #define GLOBAL_MALLOC(size) Memory_malloc(size) 22 | #define GLOBAL_REALLOC(oldptr, size) Memory_realloc(oldptr, size) 23 | #define GLOBAL_FREEMEM(ptr) Memory_free(ptr) 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | 31 | typedef void 32 | (*MemoryExceptionHandler) (void* parameter); 33 | 34 | PAL_API void 35 | Memory_installExceptionHandler(MemoryExceptionHandler handler, void* parameter); 36 | 37 | PAL_API void* 38 | Memory_malloc(size_t size); 39 | 40 | PAL_API void* 41 | Memory_calloc(size_t nmemb, size_t size); 42 | 43 | PAL_API void * 44 | Memory_realloc(void *ptr, size_t size); 45 | 46 | PAL_API void 47 | Memory_free(void* memb); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* MEMORY_H_ */ 54 | -------------------------------------------------------------------------------- /iec61850/inc/hal/inc/platform_endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | * platform_endian.h 3 | * 4 | * Copyright 2013-2021 Michael Zillgith 5 | * 6 | * This file is part of Platform Abstraction Layer (libpal) 7 | * for libiec61850, libmms, and lib60870. 8 | */ 9 | 10 | #ifndef ENDIAN_H_ 11 | #define ENDIAN_H_ 12 | 13 | #ifndef PLATFORM_IS_BIGENDIAN 14 | #ifdef __GNUC__ 15 | #ifdef __BYTE_ORDER__ 16 | #if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) 17 | #define PLATFORM_IS_BIGENDIAN 1 18 | #endif 19 | 20 | #else 21 | 22 | /* older versions of GCC have __BYTE_ORDER__ not defined! */ 23 | #ifdef __PPC__ 24 | #define PLATFORM_IS_BIGENDIAN 1 25 | #endif 26 | 27 | #endif /* __BYTE_ORDER__ */ 28 | #endif /* __GNUC__ */ 29 | #endif 30 | 31 | #if (PLATFORM_IS_BIGENDIAN == 1) 32 | # define ORDER_LITTLE_ENDIAN 0 33 | #else 34 | # define ORDER_LITTLE_ENDIAN 1 35 | #endif 36 | 37 | #endif /* ENDIAN_H_ */ 38 | -------------------------------------------------------------------------------- /iec61850/inc/iec61850/inc/iec61850_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 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #include "hal_filesystem.h" 32 | 33 | /** \addtogroup server_api_group 34 | * @{ 35 | */ 36 | 37 | /** 38 | * @defgroup CONFIG_FILE_PARSER Create data models by configuration files 39 | * 40 | * @{ 41 | */ 42 | 43 | /** 44 | * \brief Create a data model from simple text configuration file 45 | * 46 | * \param filename name or path of the configuraton file 47 | * 48 | * \return the data model to be used by \ref IedServer 49 | */ 50 | LIB61850_API IedModel* 51 | ConfigFileParser_createModelFromConfigFileEx(const char* filename); 52 | 53 | LIB61850_API IedModel* 54 | ConfigFileParser_createModelFromConfigFile(FileHandle fileHandle); 55 | 56 | /**@}*/ 57 | 58 | /**@}*/ 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* CONFIG_FILE_PARSER_H_ */ 65 | -------------------------------------------------------------------------------- /iec61850/inc/iec61850/inc/inc_61850.go: -------------------------------------------------------------------------------- 1 | package inc_61850 2 | -------------------------------------------------------------------------------- /iec61850/inc/iec61850/inc_private/iec61850_common_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iec61850_common_internal.h 3 | * 4 | * Copyright 2019 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 SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ 25 | #define SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ 26 | 27 | #include "iec61850_model.h" 28 | 29 | LIB61850_INTERNAL char* 30 | MmsMapping_getMmsDomainFromObjectReference(const char* objectReference, char* buffer); 31 | 32 | LIB61850_INTERNAL char* 33 | MmsMapping_createMmsVariableNameFromObjectReference(const char* objectReference, FunctionalConstraint fc, char* buffer); 34 | 35 | LIB61850_INTERNAL MmsVariableAccessSpecification* 36 | MmsMapping_ObjectReferenceToVariableAccessSpec(char* objectReference); 37 | 38 | LIB61850_INTERNAL char* 39 | MmsMapping_varAccessSpecToObjectReference(MmsVariableAccessSpecification* varAccessSpec); 40 | 41 | #endif /* SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ */ 42 | -------------------------------------------------------------------------------- /iec61850/inc/iec61850/inc_private/inc_61850_private.go: -------------------------------------------------------------------------------- 1 | package inc_61850_private 2 | -------------------------------------------------------------------------------- /iec61850/inc/iec61850/inc_private/mms_goose.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_goose.h 3 | * 4 | * Copyright 2013-2019 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_GOOSE_H_ 25 | #define MMS_GOOSE_H_ 26 | 27 | LIB61850_INTERNAL MmsGooseControlBlock 28 | MmsGooseControlBlock_create(void); 29 | 30 | LIB61850_INTERNAL void 31 | MmsGooseControlBlock_destroy(MmsGooseControlBlock self); 32 | 33 | LIB61850_INTERNAL MmsDomain* 34 | MmsGooseControlBlock_getDomain(MmsGooseControlBlock self); 35 | 36 | LIB61850_INTERNAL void 37 | MmsGooseControlBlock_useGooseVlanTag(MmsGooseControlBlock self, bool useVlanTag); 38 | 39 | LIB61850_INTERNAL void 40 | MmsGooseControlBlock_setGooseInterfaceId(MmsGooseControlBlock self, const char* interfaceId); 41 | 42 | LIB61850_INTERNAL char* 43 | MmsGooseControlBlock_getLogicalNodeName(MmsGooseControlBlock self); 44 | 45 | LIB61850_INTERNAL MmsValue* 46 | MmsGooseControlBlock_getGCBValue(MmsGooseControlBlock self, char* elementName); 47 | 48 | LIB61850_INTERNAL MmsValue* 49 | MmsGooseControlBlock_getMmsValues(MmsGooseControlBlock self); 50 | 51 | LIB61850_INTERNAL MmsVariableSpecification* 52 | MmsGooseControlBlock_getVariableSpecification(MmsGooseControlBlock self); 53 | 54 | LIB61850_INTERNAL bool 55 | MmsGooseControlBlock_isEnabled(MmsGooseControlBlock self); 56 | 57 | LIB61850_INTERNAL void 58 | MmsGooseControlBlock_checkAndPublish(MmsGooseControlBlock self, uint64_t currentTime, MmsMapping* mapping); 59 | 60 | LIB61850_INTERNAL void 61 | MmsGooseControlBlock_setStateChangePending(MmsGooseControlBlock self); 62 | 63 | LIB61850_INTERNAL void 64 | MmsGooseControlBlock_publishNewState(MmsGooseControlBlock self); 65 | 66 | LIB61850_INTERNAL bool 67 | MmsGooseControlBlock_enable(MmsGooseControlBlock self, MmsMapping* mmsMapping); 68 | 69 | LIB61850_INTERNAL void 70 | MmsGooseControlBlock_disable(MmsGooseControlBlock self, MmsMapping* mmsMapping); 71 | 72 | LIB61850_INTERNAL void 73 | GOOSE_sendPendingEvents(MmsMapping* self); 74 | 75 | LIB61850_INTERNAL MmsVariableSpecification* 76 | GOOSE_createGOOSEControlBlocks(MmsMapping* self, MmsDomain* domain, 77 | LogicalNode* logicalNode, int gseCount); 78 | 79 | #endif /* MMS_GOOSE_H_ */ 80 | -------------------------------------------------------------------------------- /iec61850/inc/iec61850/inc_private/mms_sv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_sv.h 3 | * 4 | * Copyright 2015 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 LIBIEC61850_SRC_IEC61850_INC_PRIVATE_MMS_SV_H_ 25 | #define LIBIEC61850_SRC_IEC61850_INC_PRIVATE_MMS_SV_H_ 26 | 27 | 28 | typedef struct sMmsSampledValueControlBlock* MmsSampledValueControlBlock; 29 | 30 | LIB61850_INTERNAL MmsSampledValueControlBlock 31 | MmsSampledValueControlBlock_create(void); 32 | 33 | LIB61850_INTERNAL void 34 | MmsSampledValueControlBlock_destroy(MmsSampledValueControlBlock self); 35 | 36 | LIB61850_INTERNAL MmsVariableSpecification* 37 | LIBIEC61850_SV_createSVControlBlocks(MmsMapping* self, MmsDomain* domain, 38 | LogicalNode* logicalNode, int svCount, bool unicast); 39 | 40 | LIB61850_INTERNAL MmsValue* 41 | LIBIEC61850_SV_readAccessSampledValueControlBlock(MmsMapping* self, MmsDomain* domain, char* variableIdOrig); 42 | 43 | LIB61850_INTERNAL MmsDataAccessError 44 | LIBIEC61850_SV_writeAccessSVControlBlock(MmsMapping* self, MmsDomain* domain, char* variableIdOrig, 45 | MmsValue* value, MmsServerConnection connection); 46 | 47 | LIB61850_INTERNAL void 48 | LIBIEC61850_SV_setSVCBHandler(MmsMapping* self, SVControlBlock* svcb, SVCBEventHandler handler, void* parameter); 49 | 50 | #endif /* LIBIEC61850_SRC_IEC61850_INC_PRIVATE_MMS_SV_H_ */ 51 | -------------------------------------------------------------------------------- /iec61850/inc/logging/inc_logging.go: -------------------------------------------------------------------------------- 1 | package inc_logging 2 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc/inc_mms.go: -------------------------------------------------------------------------------- 1 | package inc_mms 2 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc/mms_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_types.h 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 | #ifndef MMS_TYPES_H_ 25 | #define MMS_TYPES_H_ 26 | 27 | #include "libiec61850_common_api.h" 28 | 29 | typedef enum { 30 | MMS_VALUE_NO_RESPONSE, 31 | MMS_VALUE_OK, 32 | MMS_VALUE_ACCESS_DENIED, 33 | MMS_VALUE_VALUE_INVALID, 34 | MMS_VALUE_TEMPORARILY_UNAVAILABLE, 35 | MMS_VALUE_OBJECT_ACCESS_UNSUPPORTED 36 | } MmsValueIndication; 37 | 38 | /** 39 | * \addtogroup MMS_VAR_SPEC 40 | */ 41 | /**@{*/ 42 | 43 | /** 44 | * Type definition for MMS Named Variables 45 | */ 46 | typedef struct sMmsVariableSpecification MmsVariableSpecification; 47 | 48 | /**@}*/ 49 | 50 | struct ATTRIBUTE_PACKED sMmsVariableSpecification { 51 | MmsType type; 52 | char* name; 53 | union uMmsTypeSpecification 54 | { 55 | struct sMmsArray { 56 | int elementCount; /* number of array elements */ 57 | MmsVariableSpecification* elementTypeSpec; 58 | } array; 59 | struct sMmsStructure { 60 | int elementCount; 61 | MmsVariableSpecification** elements; 62 | } structure; 63 | int boolean; /* dummy - not required */ 64 | int integer; /* size of integer in bits */ 65 | int unsignedInteger; /* size of integer in bits */ 66 | struct sMmsFloat 67 | { 68 | uint8_t exponentWidth; 69 | uint8_t formatWidth; 70 | } floatingpoint; 71 | int bitString; /* Number of bits in bitstring */ 72 | int octetString; /* Number of octets in octet string */ 73 | int visibleString; /* Maximum size of string */ 74 | int mmsString; 75 | int utctime; /* dummy - not required */ 76 | int binaryTime; /* size: either 4 or 6 */ 77 | } typeSpec; 78 | }; 79 | 80 | 81 | #endif /* MMS_TYPES_H_ */ 82 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/asn1_ber_primitive_value.h: -------------------------------------------------------------------------------- 1 | /* 2 | * asn1_ber_primitive_value.h 3 | * 4 | * Copyright 2013-2018 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 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | 32 | #include "libiec61850_common_api.h" 33 | 34 | typedef struct ATTRIBUTE_PACKED { 35 | uint8_t size; 36 | uint8_t maxSize; 37 | uint8_t* octets; 38 | } Asn1PrimitiveValue; 39 | 40 | LIB61850_INTERNAL Asn1PrimitiveValue* 41 | Asn1PrimitiveValue_create(int size); 42 | 43 | LIB61850_INTERNAL int 44 | Asn1PrimitiveValue_getSize(Asn1PrimitiveValue* self); 45 | 46 | LIB61850_INTERNAL int 47 | Asn1PrimitiveValue_getMaxSize(Asn1PrimitiveValue* self); 48 | 49 | LIB61850_INTERNAL Asn1PrimitiveValue* 50 | Asn1PrimitiveValue_clone(Asn1PrimitiveValue* self); 51 | 52 | LIB61850_INTERNAL bool 53 | Asn1PrimitivaValue_compare(Asn1PrimitiveValue* self, Asn1PrimitiveValue* otherValue); 54 | 55 | LIB61850_INTERNAL void 56 | Asn1PrimitiveValue_destroy(Asn1PrimitiveValue* self); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* ASN1_BER_PRIMITIVE_VALUE_H_ */ 63 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/ber_decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ber_decode.h 3 | * 4 | * Copyright 2013-2018 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 | LIB61850_INTERNAL int 30 | BerDecoder_decodeLength(uint8_t* buffer, int* length, int bufPos, int maxBufPos); 31 | 32 | LIB61850_INTERNAL char* 33 | BerDecoder_decodeString(uint8_t* buffer, int strlen, int bufPos, int maxBufPos); 34 | 35 | LIB61850_INTERNAL uint32_t 36 | BerDecoder_decodeUint32(uint8_t* buffer, int intlen, int bufPos); 37 | 38 | LIB61850_INTERNAL int32_t 39 | BerDecoder_decodeInt32(uint8_t* buffer, int intlen, int bufPos); 40 | 41 | LIB61850_INTERNAL float 42 | BerDecoder_decodeFloat(uint8_t* buffer, int bufPos); 43 | 44 | LIB61850_INTERNAL double 45 | BerDecoder_decodeDouble(uint8_t* buffer, int bufPos); 46 | 47 | LIB61850_INTERNAL bool 48 | BerDecoder_decodeBoolean(uint8_t* buffer, int bufPos); 49 | 50 | LIB61850_INTERNAL void 51 | BerDecoder_decodeOID(uint8_t* buffer, int bufPos, int length, ItuObjectIdentifier* oid); 52 | 53 | #endif /* BER_DECODER_H_ */ 54 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/ber_integer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ber_integer.h 3 | * 4 | * Copyright 2013-2018 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_INTEGER_H_ 25 | #define BER_INTEGER_H_ 26 | 27 | #include "asn1_ber_primitive_value.h" 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | LIB61850_INTERNAL Asn1PrimitiveValue* 34 | BerInteger_createFromBuffer(uint8_t* buf, int size); 35 | 36 | LIB61850_INTERNAL Asn1PrimitiveValue* 37 | BerInteger_createInt32(void); 38 | 39 | LIB61850_INTERNAL int 40 | BerInteger_setFromBerInteger(Asn1PrimitiveValue* self, Asn1PrimitiveValue* value); 41 | 42 | LIB61850_INTERNAL int 43 | BerInteger_setInt32(Asn1PrimitiveValue* self, int32_t value); 44 | 45 | LIB61850_INTERNAL Asn1PrimitiveValue* 46 | BerInteger_createFromInt32(int32_t value); 47 | 48 | LIB61850_INTERNAL int 49 | BerInteger_setUint8(Asn1PrimitiveValue* self, uint8_t value); 50 | 51 | LIB61850_INTERNAL int 52 | BerInteger_setUint16(Asn1PrimitiveValue* self, uint16_t value); 53 | 54 | LIB61850_INTERNAL int 55 | BerInteger_setUint32(Asn1PrimitiveValue* self, uint32_t value); 56 | 57 | LIB61850_INTERNAL Asn1PrimitiveValue* 58 | BerInteger_createFromUint32(uint32_t value); 59 | 60 | LIB61850_INTERNAL Asn1PrimitiveValue* 61 | BerInteger_createFromInt64(int64_t value); 62 | 63 | LIB61850_INTERNAL Asn1PrimitiveValue* 64 | BerInteger_createInt64(void); 65 | 66 | LIB61850_INTERNAL int 67 | BerInteger_setInt64(Asn1PrimitiveValue* self, int64_t value); 68 | 69 | LIB61850_INTERNAL void 70 | BerInteger_toInt32(Asn1PrimitiveValue* self, int32_t* nativeValue); 71 | 72 | LIB61850_INTERNAL void 73 | BerInteger_toUint32(Asn1PrimitiveValue* self, uint32_t* nativeValue); 74 | 75 | LIB61850_INTERNAL void 76 | BerInteger_toInt64(Asn1PrimitiveValue* self, int64_t* nativeValue); 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif /* BER_INTEGER_H_ */ 83 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/inc_mms_private.go: -------------------------------------------------------------------------------- 1 | package inc_mms_private 2 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/iso_presentation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iso_presentation.h 3 | * 4 | * Copyright 2013-2019 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_PRESENTATION_H_ 25 | #define ISO_PRESENTATION_H_ 26 | 27 | #include "byte_buffer.h" 28 | #include "buffer_chain.h" 29 | #include "iso_connection_parameters.h" 30 | 31 | typedef struct { 32 | PSelector callingPresentationSelector; 33 | PSelector calledPresentationSelector; 34 | uint8_t nextContextId; 35 | uint8_t acseContextId; 36 | uint8_t mmsContextId; 37 | ByteBuffer nextPayload; 38 | } IsoPresentation; 39 | 40 | LIB61850_INTERNAL void 41 | IsoPresentation_init(IsoPresentation* session); 42 | 43 | LIB61850_INTERNAL int 44 | IsoPresentation_parseUserData(IsoPresentation* session, ByteBuffer* message); 45 | 46 | LIB61850_INTERNAL int 47 | IsoPresentation_parseConnect(IsoPresentation* session, ByteBuffer* message); 48 | 49 | LIB61850_INTERNAL void 50 | IsoPresentation_createConnectPdu(IsoPresentation* self, IsoConnectionParameters parameters, 51 | BufferChain buffer, BufferChain payload); 52 | 53 | LIB61850_INTERNAL void 54 | IsoPresentation_createCpaMessage(IsoPresentation* self, BufferChain writeBuffer, BufferChain payload); 55 | 56 | LIB61850_INTERNAL void 57 | IsoPresentation_createUserData(IsoPresentation* self, BufferChain writeBuffer, BufferChain payload); 58 | 59 | LIB61850_INTERNAL void 60 | IsoPresentation_createUserDataACSE(IsoPresentation* self, BufferChain writeBuffer, BufferChain payload); 61 | 62 | LIB61850_INTERNAL int 63 | IsoPresentation_parseAcceptMessage(IsoPresentation* self, ByteBuffer* byteBuffer); 64 | 65 | LIB61850_INTERNAL void 66 | IsoPresentation_createAbortUserMessage(IsoPresentation* self, BufferChain writeBuffer, BufferChain payload); 67 | 68 | #endif /* ISO_PRESENTATION_H_ */ 69 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/iso_server_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * iso_server_private.h 3 | * 4 | * Copyright 2013-2020 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 "tls_config.h" 28 | #include "hal_socket.h" 29 | 30 | LIB61850_INTERNAL IsoConnection 31 | IsoConnection_create(Socket socket, IsoServer isoServer, bool isSingleThread); 32 | 33 | LIB61850_INTERNAL void 34 | IsoConnection_start(IsoConnection self); 35 | 36 | LIB61850_INTERNAL void 37 | IsoConnection_destroy(IsoConnection self); 38 | 39 | LIB61850_INTERNAL void 40 | IsoConnection_callTickHandler(IsoConnection self); 41 | 42 | LIB61850_INTERNAL void 43 | IsoConnection_handleTcpConnection(IsoConnection self, bool isSingleThread); 44 | 45 | #define ISO_CON_STATE_TERMINATED 2 /* connection has terminated and is ready to be destroyed */ 46 | #define ISO_CON_STATE_RUNNING 1 /* connection is newly started */ 47 | #define ISO_CON_STATE_STOPPED 0 /* connection is being stopped */ 48 | 49 | LIB61850_INTERNAL int 50 | IsoConnection_getState(IsoConnection self); 51 | 52 | /** 53 | * \brief Add the connection socket to the given HandleSet instance 54 | */ 55 | LIB61850_INTERNAL void 56 | IsoConnection_addToHandleSet(const IsoConnection self, HandleSet handles); 57 | 58 | /** 59 | * \brief Remove the connection socket from the given HandleSet instance 60 | */ 61 | LIB61850_INTERNAL void 62 | IsoConnection_removeFromHandleSet(const IsoConnection self, HandleSet handles); 63 | 64 | LIB61850_INTERNAL void 65 | private_IsoServer_increaseConnectionCounter(IsoServer self); 66 | 67 | LIB61850_INTERNAL void 68 | private_IsoServer_decreaseConnectionCounter(IsoServer self); 69 | 70 | LIB61850_INTERNAL int 71 | private_IsoServer_getConnectionCounter(IsoServer self); 72 | 73 | LIB61850_INTERNAL bool 74 | IsoConnection_isRunning(IsoConnection self); 75 | 76 | #endif /* ISO_SERVER_PRIVATE_H_ */ 77 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/iso_session.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ise_session.h 3 | * 4 | * Copyright 2013-2018 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 ISE_SESSION_H_ 25 | #define ISE_SESSION_H_ 26 | 27 | #include "byte_buffer.h" 28 | #include "buffer_chain.h" 29 | #include "iso_connection_parameters.h" 30 | 31 | typedef struct { 32 | SSelector callingSessionSelector; 33 | SSelector calledSessionSelector; 34 | uint16_t sessionRequirement; 35 | uint8_t protocolOptions; 36 | ByteBuffer userData; 37 | } IsoSession; 38 | 39 | typedef enum { 40 | SESSION_OK, 41 | SESSION_ERROR, 42 | SESSION_CONNECT, 43 | SESSION_GIVE_TOKEN, 44 | SESSION_DATA, 45 | SESSION_ABORT, 46 | SESSION_FINISH, 47 | SESSION_DISCONNECT, 48 | SESSION_NOT_FINISHED 49 | } IsoSessionIndication; 50 | 51 | LIB61850_INTERNAL void 52 | IsoSession_init(IsoSession* session); 53 | 54 | LIB61850_INTERNAL ByteBuffer* 55 | IsoSession_getUserData(IsoSession* session); 56 | 57 | LIB61850_INTERNAL void 58 | IsoSession_createConnectSpdu(IsoSession* self, IsoConnectionParameters isoParameters, BufferChain buffer, BufferChain payload); 59 | 60 | LIB61850_INTERNAL IsoSessionIndication 61 | IsoSession_parseMessage(IsoSession* self, ByteBuffer* message); 62 | 63 | LIB61850_INTERNAL void 64 | IsoSession_createDataSpdu(IsoSession* self, BufferChain buffer, BufferChain payload); 65 | 66 | LIB61850_INTERNAL void 67 | IsoSession_createAcceptSpdu(IsoSession* self, BufferChain buffer, BufferChain payload); 68 | 69 | LIB61850_INTERNAL void 70 | IsoSession_createAbortSpdu(IsoSession* self, BufferChain buffer, BufferChain payload); 71 | 72 | LIB61850_INTERNAL void 73 | IsoSession_createFinishSpdu(IsoSession* self, BufferChain buffer, BufferChain payload); 74 | 75 | LIB61850_INTERNAL void 76 | IsoSession_createDisconnectSpdu(IsoSession* self, BufferChain buffer, BufferChain payload); 77 | 78 | #endif /* ISE_SESSION_H_ */ 79 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/mms_named_variable_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_named_variable_list.h 3 | * 4 | * Copyright 2013-2018 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_NAMED_VARIABLE_LIST_H_ 25 | #define MMS_NAMED_VARIABLE_LIST_H_ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /** \addtogroup mms_server_api_group 32 | * @{ 33 | */ 34 | 35 | #include "libiec61850_common_api.h" 36 | #include "linked_list.h" 37 | #include "mms_common.h" 38 | 39 | struct sMmsNamedVariableList { 40 | bool deletable; 41 | MmsDomain* domain; 42 | char* name; 43 | LinkedList listOfVariables; 44 | }; 45 | 46 | LIB61850_INTERNAL MmsNamedVariableListEntry 47 | MmsNamedVariableListEntry_create(MmsAccessSpecifier accessSpecifier); 48 | 49 | LIB61850_INTERNAL void 50 | MmsNamedVariableListEntry_destroy(MmsNamedVariableListEntry self); 51 | 52 | LIB61850_INTERNAL MmsDomain* 53 | MmsNamedVariableListEntry_getDomain(MmsNamedVariableListEntry self); 54 | 55 | LIB61850_INTERNAL char* 56 | MmsNamedVariableListEntry_getVariableName(MmsNamedVariableListEntry self); 57 | 58 | LIB61850_INTERNAL MmsNamedVariableList 59 | MmsNamedVariableList_create(MmsDomain* domain, char* name, bool deletable); 60 | 61 | LIB61850_INTERNAL char* 62 | MmsNamedVariableList_getName(MmsNamedVariableList self); 63 | 64 | LIB61850_INTERNAL MmsDomain* 65 | MmsNamedVariableList_getDomain(MmsNamedVariableList self); 66 | 67 | LIB61850_INTERNAL bool 68 | MmsNamedVariableList_isDeletable(MmsNamedVariableList self); 69 | 70 | LIB61850_INTERNAL void 71 | MmsNamedVariableList_addVariable(MmsNamedVariableList self, MmsNamedVariableListEntry variable); 72 | 73 | LIB61850_INTERNAL LinkedList 74 | MmsNamedVariableList_getVariableList(MmsNamedVariableList self); 75 | 76 | LIB61850_INTERNAL void 77 | MmsNamedVariableList_destroy(MmsNamedVariableList self); 78 | 79 | /**@}*/ 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* MMS_NAMED_VARIABLE_LIST_H_ */ 86 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/mms_value_cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_value_cache.h 3 | * 4 | * Copyright 2013-2018 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 | LIB61850_INTERNAL MmsValueCache 33 | MmsValueCache_create(MmsDomain* domain); 34 | 35 | LIB61850_INTERNAL void 36 | MmsValueCache_insertValue(MmsValueCache self, char* itemId, MmsValue* value); 37 | 38 | LIB61850_INTERNAL MmsValue* 39 | MmsValueCache_lookupValue(MmsValueCache self, const char* itemId, MmsVariableSpecification** outSpec); 40 | 41 | LIB61850_INTERNAL void 42 | MmsValueCache_destroy(MmsValueCache self); 43 | 44 | #endif /* MMS_VARIABLE_CACHE_H_ */ 45 | -------------------------------------------------------------------------------- /iec61850/inc/mms/inc_private/mms_value_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mms_value_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_VALUE_INTERNAL_H_ 25 | #define MMS_VALUE_INTERNAL_H_ 26 | 27 | #include "mms_value.h" 28 | #include "ber_integer.h" 29 | 30 | struct ATTRIBUTE_PACKED sMmsValue { 31 | MmsType type; 32 | uint8_t deleteValue; 33 | union uMmsValue { 34 | MmsDataAccessError dataAccessError; 35 | struct { 36 | int size; 37 | MmsValue** components; 38 | } structure; 39 | bool boolean; 40 | Asn1PrimitiveValue* integer; 41 | struct { 42 | uint8_t exponentWidth; 43 | uint8_t formatWidth; /* number of bits - either 32 or 64) */ 44 | uint8_t buf[8]; 45 | } floatingPoint; 46 | struct { 47 | uint16_t size; 48 | int maxSize; 49 | uint8_t* buf; 50 | } octetString; 51 | struct { 52 | int size; /* Number of bits */ 53 | uint8_t* buf; 54 | } bitString; 55 | struct { 56 | char* buf; 57 | int16_t size; /* size of the string, equals the amount of allocated memory - 1 */ 58 | } visibleString; 59 | uint8_t utcTime[8]; 60 | struct { 61 | uint8_t size; 62 | uint8_t buf[6]; 63 | } binaryTime; 64 | } value; 65 | }; 66 | 67 | 68 | LIB61850_INTERNAL MmsValue* 69 | MmsValue_newIntegerFromBerInteger(Asn1PrimitiveValue* berInteger); 70 | 71 | LIB61850_INTERNAL MmsValue* 72 | MmsValue_newUnsignedFromBerInteger(Asn1PrimitiveValue* berInteger); 73 | 74 | #endif /* MMS_VALUE_INTERNAL_H_ */ 75 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/AccessResult.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 _AccessResult_H_ 9 | #define _AccessResult_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "DataAccessError.h" 16 | #include "DataSequence.h" 17 | #include 18 | #include 19 | #include 20 | #include "FloatingPoint.h" 21 | #include 22 | #include 23 | #include 24 | #include "TimeOfDay.h" 25 | #include "MMSString.h" 26 | #include "UtcTime.h" 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* Dependencies */ 34 | typedef enum AccessResult_PR { 35 | AccessResult_PR_NOTHING, /* No components present */ 36 | AccessResult_PR_failure, 37 | AccessResult_PR_array, 38 | AccessResult_PR_structure, 39 | AccessResult_PR_boolean, 40 | AccessResult_PR_bitstring, 41 | AccessResult_PR_integer, 42 | AccessResult_PR_unsigned, 43 | AccessResult_PR_floatingpoint, 44 | AccessResult_PR_octetstring, 45 | AccessResult_PR_visiblestring, 46 | AccessResult_PR_generalizedtime, 47 | AccessResult_PR_binarytime, 48 | AccessResult_PR_bcd, 49 | AccessResult_PR_booleanArray, 50 | AccessResult_PR_mMSString, 51 | AccessResult_PR_utctime 52 | } AccessResult_PR; 53 | 54 | /* AccessResult */ 55 | typedef struct AccessResult { 56 | AccessResult_PR present; 57 | union AccessResult_u { 58 | DataAccessError_t failure; 59 | DataSequence_t array; 60 | DataSequence_t structure; 61 | BOOLEAN_t boolean; 62 | BIT_STRING_t bitstring; 63 | INTEGER_t integer; 64 | INTEGER_t Unsigned; 65 | FloatingPoint_t floatingpoint; 66 | OCTET_STRING_t octetstring; 67 | VisibleString_t visiblestring; 68 | GeneralizedTime_t generalizedtime; 69 | TimeOfDay_t binarytime; 70 | INTEGER_t bcd; 71 | BIT_STRING_t booleanArray; 72 | MMSString_t mMSString; 73 | UtcTime_t utctime; 74 | } choice; 75 | 76 | /* Context for parsing across buffer boundaries */ 77 | asn_struct_ctx_t _asn_ctx; 78 | } AccessResult_t; 79 | 80 | /* Implementation */ 81 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_AccessResult; 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif /* _AccessResult_H_ */ 88 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Address; 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* _Address_H_ */ 53 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; 24 | 25 | LIB61850_INTERNAL asn_struct_print_f BIT_STRING_print; /* Human-readable output */ 26 | LIB61850_INTERNAL asn_constr_check_f BIT_STRING_constraint; 27 | LIB61850_INTERNAL xer_type_encoder_f BIT_STRING_encode_xer; 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* _BIT_STRING_H_ */ 34 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL asn_struct_free_f BOOLEAN_free; 24 | LIB61850_INTERNAL asn_struct_print_f BOOLEAN_print; 25 | LIB61850_INTERNAL ber_type_decoder_f BOOLEAN_decode_ber; 26 | LIB61850_INTERNAL der_type_encoder_f BOOLEAN_encode_der; 27 | LIB61850_INTERNAL xer_type_decoder_f BOOLEAN_decode_xer; 28 | LIB61850_INTERNAL xer_type_encoder_f BOOLEAN_encode_xer; 29 | LIB61850_INTERNAL per_type_decoder_f BOOLEAN_decode_uper; 30 | LIB61850_INTERNAL per_type_encoder_f BOOLEAN_encode_uper; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* _BOOLEAN_H_ */ 37 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ConcludeRequestPDU; 26 | LIB61850_INTERNAL asn_struct_free_f ConcludeRequestPDU_free; 27 | LIB61850_INTERNAL asn_struct_print_f ConcludeRequestPDU_print; 28 | LIB61850_INTERNAL asn_constr_check_f ConcludeRequestPDU_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f ConcludeRequestPDU_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f ConcludeRequestPDU_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f ConcludeRequestPDU_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f ConcludeRequestPDU_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _ConcludeRequestPDU_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ConcludeResponsePDU; 26 | LIB61850_INTERNAL asn_struct_free_f ConcludeResponsePDU_free; 27 | LIB61850_INTERNAL asn_struct_print_f ConcludeResponsePDU_print; 28 | LIB61850_INTERNAL asn_constr_check_f ConcludeResponsePDU_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f ConcludeResponsePDU_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f ConcludeResponsePDU_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f ConcludeResponsePDU_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f ConcludeResponsePDU_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _ConcludeResponsePDU_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ConfirmedErrorPDU; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _ConfirmedErrorPDU_H_ */ 40 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ConfirmedRequestPdu; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _ConfirmedRequestPdu_H_ */ 40 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ConfirmedResponsePdu; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _ConfirmedResponsePdu_H_ */ 40 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/ConfirmedServiceRequest.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 _ConfirmedServiceRequest_H_ 9 | #define _ConfirmedServiceRequest_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "GetNameListRequest.h" 16 | #include "ReadRequest.h" 17 | #include "WriteRequest.h" 18 | #include "GetVariableAccessAttributesRequest.h" 19 | #include "DefineNamedVariableListRequest.h" 20 | #include "GetNamedVariableListAttributesRequest.h" 21 | #include "DeleteNamedVariableListRequest.h" 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Dependencies */ 29 | typedef enum ConfirmedServiceRequest_PR { 30 | ConfirmedServiceRequest_PR_NOTHING, /* No components present */ 31 | ConfirmedServiceRequest_PR_getNameList, 32 | ConfirmedServiceRequest_PR_read, 33 | ConfirmedServiceRequest_PR_write, 34 | ConfirmedServiceRequest_PR_getVariableAccessAttributes, 35 | ConfirmedServiceRequest_PR_defineNamedVariableList, 36 | ConfirmedServiceRequest_PR_getNamedVariableListAttributes, 37 | ConfirmedServiceRequest_PR_deleteNamedVariableList 38 | } ConfirmedServiceRequest_PR; 39 | 40 | /* ConfirmedServiceRequest */ 41 | typedef struct ConfirmedServiceRequest { 42 | ConfirmedServiceRequest_PR present; 43 | union ConfirmedServiceRequest_u { 44 | GetNameListRequest_t getNameList; 45 | ReadRequest_t read; 46 | WriteRequest_t write; 47 | GetVariableAccessAttributesRequest_t getVariableAccessAttributes; 48 | DefineNamedVariableListRequest_t defineNamedVariableList; 49 | GetNamedVariableListAttributesRequest_t getNamedVariableListAttributes; 50 | DeleteNamedVariableListRequest_t deleteNamedVariableList; 51 | } choice; 52 | 53 | /* Context for parsing across buffer boundaries */ 54 | asn_struct_ctx_t _asn_ctx; 55 | } ConfirmedServiceRequest_t; 56 | 57 | /* Implementation */ 58 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ConfirmedServiceRequest; 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* _ConfirmedServiceRequest_H_ */ 65 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/ConfirmedServiceResponse.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 _ConfirmedServiceResponse_H_ 9 | #define _ConfirmedServiceResponse_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "GetNameListResponse.h" 16 | #include "ReadResponse.h" 17 | #include "WriteResponse.h" 18 | #include "GetVariableAccessAttributesResponse.h" 19 | #include "DefineNamedVariableListResponse.h" 20 | #include "GetNamedVariableListAttributesResponse.h" 21 | #include "DeleteNamedVariableListResponse.h" 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Dependencies */ 29 | typedef enum ConfirmedServiceResponse_PR { 30 | ConfirmedServiceResponse_PR_NOTHING, /* No components present */ 31 | ConfirmedServiceResponse_PR_getNameList, 32 | ConfirmedServiceResponse_PR_read, 33 | ConfirmedServiceResponse_PR_write, 34 | ConfirmedServiceResponse_PR_getVariableAccessAttributes, 35 | ConfirmedServiceResponse_PR_defineNamedVariableList, 36 | ConfirmedServiceResponse_PR_getNamedVariableListAttributes, 37 | ConfirmedServiceResponse_PR_deleteNamedVariableList 38 | } ConfirmedServiceResponse_PR; 39 | 40 | /* ConfirmedServiceResponse */ 41 | typedef struct ConfirmedServiceResponse { 42 | ConfirmedServiceResponse_PR present; 43 | union ConfirmedServiceResponse_u { 44 | GetNameListResponse_t getNameList; 45 | ReadResponse_t read; 46 | WriteResponse_t write; 47 | GetVariableAccessAttributesResponse_t getVariableAccessAttributes; 48 | DefineNamedVariableListResponse_t defineNamedVariableList; 49 | GetNamedVariableListAttributesResponse_t getNamedVariableListAttributes; 50 | DeleteNamedVariableListResponse_t deleteNamedVariableList; 51 | } choice; 52 | 53 | /* Context for parsing across buffer boundaries */ 54 | asn_struct_ctx_t _asn_ctx; 55 | } ConfirmedServiceResponse_t; 56 | 57 | /* Implementation */ 58 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ConfirmedServiceResponse; 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* _ConfirmedServiceResponse_H_ */ 65 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/Data.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 _Data_H_ 9 | #define _Data_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include 16 | #include 17 | #include 18 | #include "FloatingPoint.h" 19 | #include 20 | #include 21 | #include 22 | #include "TimeOfDay.h" 23 | #include "MMSString.h" 24 | #include "UtcTime.h" 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Dependencies */ 32 | typedef enum Data_PR { 33 | Data_PR_NOTHING, /* No components present */ 34 | Data_PR_array, 35 | Data_PR_structure, 36 | Data_PR_boolean, 37 | Data_PR_bitstring, 38 | Data_PR_integer, 39 | Data_PR_unsigned, 40 | Data_PR_floatingpoint, 41 | Data_PR_octetstring, 42 | Data_PR_visiblestring, 43 | Data_PR_generalizedtime, 44 | Data_PR_binarytime, 45 | Data_PR_bcd, 46 | Data_PR_booleanArray, 47 | Data_PR_mMSString, 48 | Data_PR_utctime 49 | } Data_PR; 50 | 51 | /* Forward declarations */ 52 | struct DataSequence; 53 | 54 | /* Data */ 55 | typedef struct Data { 56 | Data_PR present; 57 | union Data_u { 58 | struct DataSequence *array; 59 | struct DataSequence *structure; 60 | BOOLEAN_t boolean; 61 | BIT_STRING_t bitstring; 62 | INTEGER_t integer; 63 | INTEGER_t Unsigned; 64 | FloatingPoint_t floatingpoint; 65 | OCTET_STRING_t octetstring; 66 | VisibleString_t visiblestring; 67 | GeneralizedTime_t generalizedtime; 68 | TimeOfDay_t binarytime; 69 | INTEGER_t bcd; 70 | BIT_STRING_t booleanArray; 71 | MMSString_t mMSString; 72 | UtcTime_t utctime; 73 | } choice; 74 | 75 | /* Context for parsing across buffer boundaries */ 76 | asn_struct_ctx_t _asn_ctx; 77 | } Data_t; 78 | 79 | /* Implementation */ 80 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Data; 81 | 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | 86 | /* Referred external types */ 87 | #include "DataSequence.h" 88 | 89 | #endif /* _Data_H_ */ 90 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_DataAccessError; 42 | LIB61850_INTERNAL asn_struct_free_f DataAccessError_free; 43 | LIB61850_INTERNAL asn_struct_print_f DataAccessError_print; 44 | LIB61850_INTERNAL asn_constr_check_f DataAccessError_constraint; 45 | LIB61850_INTERNAL ber_type_decoder_f DataAccessError_decode_ber; 46 | LIB61850_INTERNAL der_type_encoder_f DataAccessError_encode_der; 47 | LIB61850_INTERNAL xer_type_decoder_f DataAccessError_decode_xer; 48 | LIB61850_INTERNAL xer_type_encoder_f DataAccessError_encode_xer; 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* _DataAccessError_H_ */ 55 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_DefineNamedVariableListResponse; 26 | LIB61850_INTERNAL asn_struct_free_f DefineNamedVariableListResponse_free; 27 | LIB61850_INTERNAL asn_struct_print_f DefineNamedVariableListResponse_print; 28 | LIB61850_INTERNAL asn_constr_check_f DefineNamedVariableListResponse_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f DefineNamedVariableListResponse_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f DefineNamedVariableListResponse_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f DefineNamedVariableListResponse_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f DefineNamedVariableListResponse_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _DefineNamedVariableListResponse_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_DeleteNamedVariableListResponse; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _DeleteNamedVariableListResponse_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_FloatingPoint; 26 | LIB61850_INTERNAL asn_struct_free_f FloatingPoint_free; 27 | LIB61850_INTERNAL asn_struct_print_f FloatingPoint_print; 28 | LIB61850_INTERNAL asn_constr_check_f FloatingPoint_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f FloatingPoint_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f FloatingPoint_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f FloatingPoint_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f FloatingPoint_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _FloatingPoint_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/GeneralizedTime.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 _GeneralizedTime_H_ 6 | #define _GeneralizedTime_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef OCTET_STRING_t GeneralizedTime_t; /* Implemented via OCTET STRING */ 15 | 16 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_GeneralizedTime; 17 | 18 | LIB61850_INTERNAL asn_struct_print_f GeneralizedTime_print; 19 | LIB61850_INTERNAL asn_constr_check_f GeneralizedTime_constraint; 20 | LIB61850_INTERNAL der_type_encoder_f GeneralizedTime_encode_der; 21 | LIB61850_INTERNAL xer_type_encoder_f GeneralizedTime_encode_xer; 22 | 23 | /*********************** 24 | * Some handy helpers. * 25 | ***********************/ 26 | 27 | struct tm; /* */ 28 | 29 | /* 30 | * Convert a GeneralizedTime structure into time_t 31 | * and optionally into struct tm. 32 | * If as_gmt is given, the resulting _optional_tm4fill will have a GMT zone, 33 | * instead of default local one. 34 | * On error returns -1 and errno set to EINVAL 35 | */ 36 | LIB61850_INTERNAL time_t asn_GT2time(const GeneralizedTime_t *, struct tm *_optional_tm4fill, 37 | int as_gmt); 38 | 39 | /* A version of the above function also returning the fractions of seconds */ 40 | LIB61850_INTERNAL time_t asn_GT2time_frac(const GeneralizedTime_t *, 41 | int *frac_value, int *frac_digits, /* (value / (10 ^ digits)) */ 42 | struct tm *_optional_tm4fill, int as_gmt); 43 | 44 | /* 45 | * Another version returning fractions with defined precision 46 | * For example, parsing of the time ending with ".1" seconds 47 | * with frac_digits=3 (msec) would yield frac_value = 100. 48 | */ 49 | LIB61850_INTERNAL time_t asn_GT2time_prec(const GeneralizedTime_t *, 50 | int *frac_value, int frac_digits, 51 | struct tm *_optional_tm4fill, int as_gmt); 52 | 53 | /* 54 | * Convert a struct tm into GeneralizedTime. 55 | * If _optional_gt is not given, this function will try to allocate one. 56 | * If force_gmt is given, the resulting GeneralizedTime will be forced 57 | * into a GMT time zone (encoding ends with a "Z"). 58 | * On error, this function returns 0 and sets errno. 59 | */ 60 | LIB61850_INTERNAL GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *_optional_gt, 61 | const struct tm *, int force_gmt); 62 | LIB61850_INTERNAL GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *_optional_gt, 63 | const struct tm *, int frac_value, int frac_digits, int force_gmt); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* _GeneralizedTime_H_ */ 70 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_GetNameListRequest; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _GetNameListRequest_H_ */ 61 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_GetNameListResponse; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _GetNameListResponse_H_ */ 47 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_GetNamedVariableListAttributesRequest; 26 | LIB61850_INTERNAL asn_struct_free_f GetNamedVariableListAttributesRequest_free; 27 | LIB61850_INTERNAL asn_struct_print_f GetNamedVariableListAttributesRequest_print; 28 | LIB61850_INTERNAL asn_constr_check_f GetNamedVariableListAttributesRequest_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f GetNamedVariableListAttributesRequest_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f GetNamedVariableListAttributesRequest_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f GetNamedVariableListAttributesRequest_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f GetNamedVariableListAttributesRequest_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _GetNamedVariableListAttributesRequest_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_GetVariableAccessAttributesRequest; 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* _GetVariableAccessAttributesRequest_H_ */ 50 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/INTEGER.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 _INTEGER_H_ 6 | #define _INTEGER_H_ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; 16 | 17 | extern asn_TYPE_descriptor_t asn_DEF_INTEGER; 18 | 19 | /* Map with to integer value association */ 20 | typedef struct asn_INTEGER_enum_map_s { 21 | long nat_value; /* associated native integer value */ 22 | size_t enum_len; /* strlen("tag") */ 23 | const char *enum_name; /* "tag" */ 24 | } asn_INTEGER_enum_map_t; 25 | 26 | /* This type describes an enumeration for INTEGER and ENUMERATED types */ 27 | typedef struct asn_INTEGER_specifics_s { 28 | asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ 29 | unsigned int *enum2value; /* "tag" => N; sorted by tag */ 30 | int map_count; /* Elements in either map */ 31 | int extension; /* This map is extensible */ 32 | int strict_enumeration; /* Enumeration set is fixed */ 33 | } asn_INTEGER_specifics_t; 34 | 35 | LIB61850_INTERNAL asn_struct_print_f INTEGER_print; 36 | LIB61850_INTERNAL ber_type_decoder_f INTEGER_decode_ber; 37 | LIB61850_INTERNAL der_type_encoder_f INTEGER_encode_der; 38 | LIB61850_INTERNAL xer_type_decoder_f INTEGER_decode_xer; 39 | LIB61850_INTERNAL xer_type_encoder_f INTEGER_encode_xer; 40 | LIB61850_INTERNAL per_type_decoder_f INTEGER_decode_uper; 41 | LIB61850_INTERNAL per_type_encoder_f INTEGER_encode_uper; 42 | 43 | /*********************************** 44 | * Some handy conversion routines. * 45 | ***********************************/ 46 | 47 | /* 48 | * Returns 0 if it was possible to convert, -1 otherwise. 49 | * -1/EINVAL: Mandatory argument missing 50 | * -1/ERANGE: Value encoded is out of range for long representation 51 | * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()). 52 | */ 53 | LIB61850_INTERNAL int asn_INTEGER2long(const INTEGER_t *i, long *l); 54 | LIB61850_INTERNAL int asn_long2INTEGER(INTEGER_t *i, long l); 55 | 56 | /* 57 | * Convert the integer value into the corresponding enumeration map entry. 58 | */ 59 | LIB61850_INTERNAL const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* _INTEGER_H_ */ 66 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Identifier; 26 | LIB61850_INTERNAL asn_struct_free_f Identifier_free; 27 | LIB61850_INTERNAL asn_struct_print_f Identifier_print; 28 | LIB61850_INTERNAL asn_constr_check_f Identifier_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f Identifier_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f Identifier_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f Identifier_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f Identifier_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Identifier_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_IndexRangeSeq; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _IndexRangeSeq_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_InitRequestDetail; 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* _InitRequestDetail_H_ */ 42 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_InitResponseDetail; 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* _InitResponseDetail_H_ */ 42 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_InitiateErrorPdu; 26 | LIB61850_INTERNAL asn_struct_free_f InitiateErrorPdu_free; 27 | LIB61850_INTERNAL asn_struct_print_f InitiateErrorPdu_print; 28 | LIB61850_INTERNAL asn_constr_check_f InitiateErrorPdu_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f InitiateErrorPdu_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f InitiateErrorPdu_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f InitiateErrorPdu_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f InitiateErrorPdu_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _InitiateErrorPdu_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_InitiateRequestPdu; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _InitiateRequestPdu_H_ */ 45 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_InitiateResponsePdu; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _InitiateResponsePdu_H_ */ 45 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Integer16; 26 | LIB61850_INTERNAL asn_struct_free_f Integer16_free; 27 | LIB61850_INTERNAL asn_struct_print_f Integer16_print; 28 | LIB61850_INTERNAL asn_constr_check_f Integer16_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f Integer16_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f Integer16_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f Integer16_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f Integer16_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Integer16_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Integer32; 26 | LIB61850_INTERNAL asn_struct_free_f Integer32_free; 27 | LIB61850_INTERNAL asn_struct_print_f Integer32_print; 28 | LIB61850_INTERNAL asn_constr_check_f Integer32_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f Integer32_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f Integer32_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f Integer32_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f Integer32_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Integer32_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Integer8; 26 | LIB61850_INTERNAL asn_struct_free_f Integer8_free; 27 | LIB61850_INTERNAL asn_struct_print_f Integer8_print; 28 | LIB61850_INTERNAL asn_constr_check_f Integer8_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f Integer8_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f Integer8_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f Integer8_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f Integer8_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Integer8_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_MMSString; 26 | LIB61850_INTERNAL asn_struct_free_f MMSString_free; 27 | LIB61850_INTERNAL asn_struct_print_f MMSString_print; 28 | LIB61850_INTERNAL asn_constr_check_f MMSString_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f MMSString_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f MMSString_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f MMSString_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f MMSString_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _MMSString_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/MmsPdu.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 _MmsPdu_H_ 9 | #define _MmsPdu_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "ConfirmedRequestPdu.h" 16 | #include "ConfirmedResponsePdu.h" 17 | #include "ConfirmedErrorPDU.h" 18 | #include "UnconfirmedPDU.h" 19 | #include "RejectPDU.h" 20 | #include "InitiateRequestPdu.h" 21 | #include "InitiateResponsePdu.h" 22 | #include "InitiateErrorPdu.h" 23 | #include "ConcludeRequestPDU.h" 24 | #include "ConcludeResponsePDU.h" 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Dependencies */ 32 | typedef enum MmsPdu_PR { 33 | MmsPdu_PR_NOTHING, /* No components present */ 34 | MmsPdu_PR_confirmedRequestPdu, 35 | MmsPdu_PR_confirmedResponsePdu, 36 | MmsPdu_PR_confirmedErrorPDU, 37 | MmsPdu_PR_unconfirmedPDU, 38 | MmsPdu_PR_rejectPDU, 39 | MmsPdu_PR_initiateRequestPdu, 40 | MmsPdu_PR_initiateResponsePdu, 41 | MmsPdu_PR_initiateErrorPdu, 42 | MmsPdu_PR_concludeRequestPDU, 43 | MmsPdu_PR_concludeResponsePDU 44 | } MmsPdu_PR; 45 | 46 | /* MmsPdu */ 47 | typedef struct MmsPdu { 48 | MmsPdu_PR present; 49 | union MmsPdu_u { 50 | ConfirmedRequestPdu_t confirmedRequestPdu; 51 | ConfirmedResponsePdu_t confirmedResponsePdu; 52 | ConfirmedErrorPDU_t confirmedErrorPDU; 53 | UnconfirmedPDU_t unconfirmedPDU; 54 | RejectPDU_t rejectPDU; 55 | InitiateRequestPdu_t initiateRequestPdu; 56 | InitiateResponsePdu_t initiateResponsePdu; 57 | InitiateErrorPdu_t initiateErrorPdu; 58 | ConcludeRequestPDU_t concludeRequestPDU; 59 | ConcludeResponsePDU_t concludeResponsePDU; 60 | } choice; 61 | 62 | /* Context for parsing across buffer boundaries */ 63 | asn_struct_ctx_t _asn_ctx; 64 | } MmsPdu_t; 65 | 66 | /* Implementation */ 67 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_MmsPdu; 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif /* _MmsPdu_H_ */ 74 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_NULL; 21 | 22 | LIB61850_INTERNAL asn_struct_print_f NULL_print; 23 | LIB61850_INTERNAL der_type_encoder_f NULL_encode_der; 24 | LIB61850_INTERNAL xer_type_decoder_f NULL_decode_xer; 25 | LIB61850_INTERNAL xer_type_encoder_f NULL_encode_xer; 26 | LIB61850_INTERNAL per_type_decoder_f NULL_decode_uper; 27 | LIB61850_INTERNAL per_type_encoder_f NULL_encode_uper; 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* NULL_H */ 34 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; 23 | 24 | LIB61850_INTERNAL xer_type_encoder_f NativeEnumerated_encode_xer; 25 | LIB61850_INTERNAL per_type_decoder_f NativeEnumerated_decode_uper; 26 | LIB61850_INTERNAL per_type_encoder_f NativeEnumerated_encode_uper; 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* _NativeEnumerated_H_ */ 33 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 23 | extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; 24 | 25 | LIB61850_INTERNAL 26 | asn_struct_free_f NativeInteger_free; 27 | 28 | LIB61850_INTERNAL 29 | asn_struct_print_f NativeInteger_print; 30 | 31 | LIB61850_INTERNAL 32 | ber_type_decoder_f NativeInteger_decode_ber; 33 | 34 | LIB61850_INTERNAL 35 | der_type_encoder_f NativeInteger_encode_der; 36 | 37 | LIB61850_INTERNAL 38 | xer_type_decoder_f NativeInteger_decode_xer; 39 | 40 | LIB61850_INTERNAL 41 | xer_type_encoder_f NativeInteger_encode_xer; 42 | 43 | LIB61850_INTERNAL 44 | per_type_decoder_f NativeInteger_decode_uper; 45 | 46 | LIB61850_INTERNAL 47 | per_type_encoder_f NativeInteger_encode_uper; 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* _NativeInteger_H_ */ 54 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/OCTET_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 _OCTET_STRING_H_ 6 | #define _OCTET_STRING_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct OCTET_STRING { 15 | uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ 16 | int size; /* Size of the buffer */ 17 | 18 | asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ 19 | } OCTET_STRING_t; 20 | 21 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; 22 | 23 | LIB61850_INTERNAL asn_struct_free_f OCTET_STRING_free; 24 | LIB61850_INTERNAL asn_struct_print_f OCTET_STRING_print; 25 | LIB61850_INTERNAL asn_struct_print_f OCTET_STRING_print_utf8; 26 | LIB61850_INTERNAL ber_type_decoder_f OCTET_STRING_decode_ber; 27 | LIB61850_INTERNAL der_type_encoder_f OCTET_STRING_encode_der; 28 | LIB61850_INTERNAL xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ 29 | LIB61850_INTERNAL xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ 30 | LIB61850_INTERNAL xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ 31 | LIB61850_INTERNAL xer_type_encoder_f OCTET_STRING_encode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f OCTET_STRING_encode_xer_utf8; 33 | LIB61850_INTERNAL per_type_decoder_f OCTET_STRING_decode_uper; 34 | LIB61850_INTERNAL per_type_encoder_f OCTET_STRING_encode_uper; 35 | 36 | /****************************** 37 | * Handy conversion routines. * 38 | ******************************/ 39 | 40 | /* 41 | * This function clears the previous value of the OCTET STRING (if any) 42 | * and then allocates a new memory with the specified content (str/size). 43 | * If size = -1, the size of the original string will be determined 44 | * using strlen(str). 45 | * If str equals to NULL, the function will silently clear the 46 | * current contents of the OCTET STRING. 47 | * Returns 0 if it was possible to perform operation, -1 otherwise. 48 | */ 49 | LIB61850_INTERNAL 50 | int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); 51 | 52 | /* Handy conversion from the C string into the OCTET STRING. */ 53 | #define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) 54 | 55 | /* 56 | * Allocate and fill the new OCTET STRING and return a pointer to the newly 57 | * allocated object. NULL is permitted in str: the function will just allocate 58 | * empty OCTET STRING. 59 | */ 60 | LIB61850_INTERNAL 61 | OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, 62 | const char *str, int size); 63 | 64 | /**************************** 65 | * Internally useful stuff. * 66 | ****************************/ 67 | 68 | typedef struct asn_OCTET_STRING_specifics_s { 69 | /* 70 | * Target structure description. 71 | */ 72 | int struct_size; /* Size of the structure */ 73 | int ctx_offset; /* Offset of the asn_struct_ctx_t member */ 74 | 75 | int subvariant; /* {0,1,2} for O-S, BIT STRING or ANY */ 76 | } asn_OCTET_STRING_specifics_t; 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif /* _OCTET_STRING_H_ */ 83 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ObjectClass; 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* _ObjectClass_H_ */ 63 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ObjectName; 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* _ObjectName_H_ */ 60 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ParameterSupportOptions; 40 | LIB61850_INTERNAL asn_struct_free_f ParameterSupportOptions_free; 41 | LIB61850_INTERNAL asn_struct_print_f ParameterSupportOptions_print; 42 | LIB61850_INTERNAL asn_constr_check_f ParameterSupportOptions_constraint; 43 | LIB61850_INTERNAL ber_type_decoder_f ParameterSupportOptions_decode_ber; 44 | LIB61850_INTERNAL der_type_encoder_f ParameterSupportOptions_encode_der; 45 | LIB61850_INTERNAL xer_type_decoder_f ParameterSupportOptions_decode_xer; 46 | LIB61850_INTERNAL xer_type_encoder_f ParameterSupportOptions_encode_xer; 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* _ParameterSupportOptions_H_ */ 53 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_ReadRequest; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _ReadRequest_H_ */ 40 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_TimeOfDay; 26 | LIB61850_INTERNAL asn_struct_free_f TimeOfDay_free; 27 | LIB61850_INTERNAL asn_struct_print_f TimeOfDay_print; 28 | LIB61850_INTERNAL asn_constr_check_f TimeOfDay_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f TimeOfDay_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f TimeOfDay_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f TimeOfDay_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f TimeOfDay_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _TimeOfDay_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_UTF8String; 17 | 18 | LIB61850_INTERNAL asn_struct_print_f UTF8String_print; 19 | LIB61850_INTERNAL 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 | LIB61850_INTERNAL 31 | ssize_t UTF8String_length(const UTF8String_t *st); 32 | 33 | /* 34 | * Convert the UTF-8 string into a sequence of wide characters. 35 | * Returns the number of characters necessary. 36 | * Returned value might be greater than dstlen. 37 | * In case of conversion error, 0 is returned. 38 | * 39 | * If st points to a valid UTF-8 string, calling 40 | * UTF8String_to_wcs(st, 0, 0); 41 | * is equivalent to 42 | * UTF8String_length(const UTF8String_t *st); 43 | */ 44 | LIB61850_INTERNAL 45 | size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* _UTF8String_H_ */ 52 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_UnconfirmedPDU; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _UnconfirmedPDU_H_ */ 38 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_UnconfirmedService; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _UnconfirmedService_H_ */ 47 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Unsigned16; 26 | LIB61850_INTERNAL asn_struct_free_f Unsigned16_free; 27 | LIB61850_INTERNAL asn_struct_print_f Unsigned16_print; 28 | LIB61850_INTERNAL asn_constr_check_f Unsigned16_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f Unsigned16_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f Unsigned16_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f Unsigned16_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f Unsigned16_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Unsigned16_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Unsigned32; 26 | LIB61850_INTERNAL asn_struct_free_f Unsigned32_free; 27 | LIB61850_INTERNAL asn_struct_print_f Unsigned32_print; 28 | LIB61850_INTERNAL asn_constr_check_f Unsigned32_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f Unsigned32_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f Unsigned32_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f Unsigned32_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f Unsigned32_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Unsigned32_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_Unsigned8; 26 | LIB61850_INTERNAL asn_struct_free_f Unsigned8_free; 27 | LIB61850_INTERNAL asn_struct_print_f Unsigned8_print; 28 | LIB61850_INTERNAL asn_constr_check_f Unsigned8_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f Unsigned8_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f Unsigned8_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f Unsigned8_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f Unsigned8_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _Unsigned8_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_UtcTime; 26 | LIB61850_INTERNAL asn_struct_free_f UtcTime_free; 27 | LIB61850_INTERNAL asn_struct_print_f UtcTime_print; 28 | LIB61850_INTERNAL asn_constr_check_f UtcTime_constraint; 29 | LIB61850_INTERNAL ber_type_decoder_f UtcTime_decode_ber; 30 | LIB61850_INTERNAL der_type_encoder_f UtcTime_encode_der; 31 | LIB61850_INTERNAL xer_type_decoder_f UtcTime_decode_xer; 32 | LIB61850_INTERNAL xer_type_encoder_f UtcTime_encode_xer; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _UtcTime_H_ */ 39 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/VariableSpecification.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 _VariableSpecification_H_ 9 | #define _VariableSpecification_H_ 10 | 11 | 12 | #include 13 | 14 | /* Including external dependencies */ 15 | #include "ObjectName.h" 16 | #include "Address.h" 17 | #include 18 | #include "TypeSpecification.h" 19 | #include 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /* Dependencies */ 27 | typedef enum VariableSpecification_PR { 28 | VariableSpecification_PR_NOTHING, /* No components present */ 29 | VariableSpecification_PR_name, 30 | VariableSpecification_PR_address, 31 | VariableSpecification_PR_variableDescription, 32 | VariableSpecification_PR_scatteredAccessDescription, 33 | VariableSpecification_PR_invalidated 34 | } VariableSpecification_PR; 35 | 36 | /* Forward declarations */ 37 | struct ScatteredAccessDescription; 38 | 39 | struct VariableSpecification__variableDescription { 40 | Address_t address; 41 | TypeSpecification_t typeSpecification; 42 | 43 | /* Context for parsing across buffer boundaries */ 44 | asn_struct_ctx_t _asn_ctx; 45 | }; 46 | 47 | /* VariableSpecification */ 48 | typedef struct VariableSpecification { 49 | VariableSpecification_PR present; 50 | union VariableSpecification_u { 51 | ObjectName_t name; 52 | Address_t address; 53 | struct VariableSpecification__variableDescription variableDescription; 54 | struct ScatteredAccessDescription *scatteredAccessDescription; 55 | NULL_t invalidated; 56 | } choice; 57 | 58 | /* Context for parsing across buffer boundaries */ 59 | asn_struct_ctx_t _asn_ctx; 60 | } VariableSpecification_t; 61 | 62 | /* Implementation */ 63 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_VariableSpecification; 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | /* Referred external types */ 70 | #include "ScatteredAccessDescription.h" 71 | 72 | #endif /* _VariableSpecification_H_ */ 73 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_VisibleString; 17 | 18 | LIB61850_INTERNAL asn_constr_check_f VisibleString_constraint; 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif /* _VisibleString_H_ */ 25 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL extern asn_TYPE_descriptor_t asn_DEF_WriteResponse; 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* _WriteResponse_H_ */ 59 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | LIB61850_INTERNAL 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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL asn_struct_free_f ASN__PRIMITIVE_TYPE_free; 20 | LIB61850_INTERNAL ber_type_decoder_f ber_decode_primitive; 21 | LIB61850_INTERNAL 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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/asn_system.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | /* 6 | * Miscellaneous system-dependent types. 7 | */ 8 | #ifndef _ASN_SYSTEM_H_ 9 | #define _ASN_SYSTEM_H_ 10 | 11 | #ifdef HAVE_CONFIG_H 12 | #include "config.h" 13 | #endif 14 | 15 | #include /* For snprintf(3) */ 16 | #include /* For *alloc(3) */ 17 | #include /* For memcpy(3) */ 18 | 19 | #include "stack_config.h" 20 | #include "libiec61850_platform_includes.h" 21 | #if CONFIG_INCLUDE_PLATFORM_SPECIFIC_HEADERS 22 | #include "libiec61850_platform_specific.h" 23 | #else 24 | #include /* For size_t */ 25 | #endif 26 | 27 | #include /* For va_start */ 28 | #include /* for offsetof and ptrdiff_t */ 29 | 30 | 31 | 32 | #ifdef _WIN32 33 | #ifndef WIN32 34 | #define WIN32 35 | #endif 36 | #endif 37 | 38 | #ifdef WIN32 39 | 40 | #include 41 | #include 42 | #define snprintf _snprintf 43 | #define vsnprintf _vsnprintf 44 | 45 | #ifdef _MSC_VER /* MSVS.Net */ 46 | #ifndef __cplusplus 47 | #define inline __inline 48 | #endif 49 | #define ssize_t SSIZE_T 50 | #if 0 51 | typedef char int8_t; 52 | typedef short int16_t; 53 | typedef int int32_t; 54 | typedef unsigned char uint8_t; 55 | typedef unsigned short uint16_t; 56 | typedef unsigned int uint32_t; 57 | #endif 58 | #define WIN32_LEAN_AND_MEAN 59 | #include 60 | #include 61 | #define isnan _isnan 62 | #define finite _finite 63 | #define copysign _copysign 64 | #define ilogb _logb 65 | #endif /* _MSC_VER */ 66 | 67 | #else /* !WIN32 */ 68 | 69 | #if defined(__vxworks) 70 | #include 71 | #else /* !defined(__vxworks) */ 72 | 73 | #include /* C99 specifies this file */ 74 | /* 75 | * 1. Earlier FreeBSD version didn't have , 76 | * but was present. 77 | * 2. Sun Solaris requires for alloca(3), 78 | * but does not have . 79 | */ 80 | #if (!defined(__FreeBSD__) || !defined(_SYS_INTTYPES_H_)) 81 | #if defined(sun) 82 | #include /* For alloca(3) */ 83 | #include /* for finite(3) */ 84 | #elif defined(__hpux) 85 | #ifdef __GNUC__ 86 | #include /* For alloca(3) */ 87 | #else /* !__GNUC__ */ 88 | #define inline 89 | #endif /* __GNUC__ */ 90 | #else 91 | #include /* SUSv2+ and C99 specify this file, for uintXX_t */ 92 | #endif /* defined(sun) */ 93 | #endif 94 | 95 | #endif /* defined(__vxworks) */ 96 | 97 | #endif /* WIN32 */ 98 | 99 | #if __GNUC__ >= 3 100 | #ifndef GCC_PRINTFLIKE 101 | #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) 102 | #endif 103 | #else 104 | #ifndef GCC_PRINTFLIKE 105 | #define GCC_PRINTFLIKE(fmt,var) /* nothing */ 106 | #endif 107 | #endif 108 | 109 | #ifndef offsetof /* If not defined by */ 110 | #define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0)) 111 | #endif /* offsetof */ 112 | 113 | #ifndef MIN /* Suitable for comparing primitive types (integers) */ 114 | #if defined(__GNUC__) 115 | #define MIN(a,b) ({ __typeof a _a = a; __typeof b _b = b; \ 116 | ((_a)<(_b)?(_a):(_b)); }) 117 | #else /* !__GNUC__ */ 118 | #define MIN(a,b) ((a)<(b)?(a):(b)) /* Unsafe variant */ 119 | #endif /* __GNUC__ */ 120 | #endif /* MIN */ 121 | 122 | #endif /* _ASN_SYSTEM_H_ */ 123 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/ber_decoder.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 _BER_DECODER_H_ 6 | #define _BER_DECODER_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 15 | struct asn_codec_ctx_s; /* Forward declaration */ 16 | 17 | /* 18 | * The BER decoder of any type. 19 | * This function may be invoked directly from the application. 20 | */ 21 | LIB61850_INTERNAL asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, 22 | struct asn_TYPE_descriptor_s *type_descriptor, 23 | void **struct_ptr, /* Pointer to a target structure's pointer */ 24 | const void *buffer, /* Data to be decoded */ 25 | size_t size /* Size of that buffer */ 26 | ); 27 | 28 | /* 29 | * Type of generic function which decodes the byte stream into the structure. 30 | */ 31 | typedef asn_dec_rval_t (ber_type_decoder_f)( 32 | struct asn_codec_ctx_s *opt_codec_ctx, 33 | struct asn_TYPE_descriptor_s *type_descriptor, 34 | void **struct_ptr, const void *buf_ptr, size_t size, 35 | int tag_mode); 36 | 37 | /******************************* 38 | * INTERNALLY USEFUL FUNCTIONS * 39 | *******************************/ 40 | 41 | /* 42 | * Check that all tags correspond to the type definition (as given in head). 43 | * On return, last_length would contain either a non-negative length of the 44 | * value part of the last TLV, or the negative number of expected 45 | * "end of content" sequences. The number may only be negative if the 46 | * head->last_tag_form is non-zero. 47 | */ 48 | LIB61850_INTERNAL asn_dec_rval_t ber_check_tags( 49 | struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ 50 | struct asn_TYPE_descriptor_s *type_descriptor, 51 | asn_struct_ctx_t *opt_ctx, /* saved decoding context */ 52 | const void *ptr, size_t size, 53 | int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ 54 | int last_tag_form, /* {-1,0:1}: any, primitive, constr */ 55 | ber_tlv_len_t *last_length, 56 | int *opt_tlv_form /* optional tag form */ 57 | ); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* _BER_DECODER_H_ */ 64 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 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 | LIB61850_INTERNAL 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 | LIB61850_INTERNAL 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 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/ber_tlv_tag.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 _BER_TLV_TAG_H_ 6 | #define _BER_TLV_TAG_H_ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | enum asn_tag_class { 13 | ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ 14 | ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ 15 | ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ 16 | ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ 17 | }; 18 | typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ 19 | 20 | /* 21 | * Tag class is encoded together with tag value for optimization purposes. 22 | */ 23 | #define BER_TAG_CLASS(tag) ((tag) & 0x3) 24 | #define BER_TAG_VALUE(tag) ((tag) >> 2) 25 | #define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) 26 | 27 | #define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) 28 | 29 | /* 30 | * Several functions for printing the TAG in the canonical form 31 | * (i.e. "[PRIVATE 0]"). 32 | * Return values correspond to their libc counterparts (if any). 33 | */ 34 | LIB61850_INTERNAL ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); 35 | LIB61850_INTERNAL ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); 36 | LIB61850_INTERNAL char *ber_tlv_tag_string(ber_tlv_tag_t tag); 37 | 38 | 39 | /* 40 | * This function tries to fetch the tag from the input stream. 41 | * RETURN VALUES: 42 | * 0: More data expected than bufptr contains. 43 | * -1: Fatal error deciphering tag. 44 | * >0: Number of bytes used from bufptr. tag_r will contain the tag. 45 | */ 46 | LIB61850_INTERNAL ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); 47 | 48 | /* 49 | * This function serializes the tag (T from TLV) in BER format. 50 | * It always returns number of bytes necessary to represent the tag, 51 | * it is a caller's responsibility to check the return value 52 | * against the supplied buffer's size. 53 | */ 54 | LIB61850_INTERNAL size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _BER_TLV_TAG_H_ */ 61 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL asn_struct_free_f CHOICE_free; 43 | LIB61850_INTERNAL asn_struct_print_f CHOICE_print; 44 | LIB61850_INTERNAL asn_constr_check_f CHOICE_constraint; 45 | LIB61850_INTERNAL ber_type_decoder_f CHOICE_decode_ber; 46 | LIB61850_INTERNAL der_type_encoder_f CHOICE_encode_der; 47 | LIB61850_INTERNAL xer_type_decoder_f CHOICE_decode_xer; 48 | LIB61850_INTERNAL xer_type_encoder_f CHOICE_encode_xer; 49 | LIB61850_INTERNAL per_type_decoder_f CHOICE_decode_uper; 50 | LIB61850_INTERNAL per_type_encoder_f CHOICE_encode_uper; 51 | LIB61850_INTERNAL asn_outmost_tag_f CHOICE_outmost_tag; 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* _CONSTR_CHOICE_H_ */ 58 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL asn_struct_free_f SEQUENCE_free; 47 | LIB61850_INTERNAL asn_struct_print_f SEQUENCE_print; 48 | LIB61850_INTERNAL asn_constr_check_f SEQUENCE_constraint; 49 | LIB61850_INTERNAL ber_type_decoder_f SEQUENCE_decode_ber; 50 | LIB61850_INTERNAL der_type_encoder_f SEQUENCE_encode_der; 51 | LIB61850_INTERNAL xer_type_decoder_f SEQUENCE_decode_xer; 52 | LIB61850_INTERNAL xer_type_encoder_f SEQUENCE_encode_xer; 53 | LIB61850_INTERNAL per_type_decoder_f SEQUENCE_decode_uper; 54 | LIB61850_INTERNAL per_type_encoder_f SEQUENCE_encode_uper; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _CONSTR_SEQUENCE_H_ */ 61 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL der_type_encoder_f SEQUENCE_OF_encode_der; 26 | LIB61850_INTERNAL xer_type_encoder_f SEQUENCE_OF_encode_xer; 27 | LIB61850_INTERNAL per_type_encoder_f SEQUENCE_OF_encode_uper; 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* _CONSTR_SET_OF_H_ */ 34 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL asn_struct_free_f SET_OF_free; 29 | LIB61850_INTERNAL asn_struct_print_f SET_OF_print; 30 | LIB61850_INTERNAL asn_constr_check_f SET_OF_constraint; 31 | LIB61850_INTERNAL ber_type_decoder_f SET_OF_decode_ber; 32 | LIB61850_INTERNAL der_type_encoder_f SET_OF_encode_der; 33 | LIB61850_INTERNAL xer_type_decoder_f SET_OF_decode_xer; 34 | LIB61850_INTERNAL xer_type_encoder_f SET_OF_encode_xer; 35 | LIB61850_INTERNAL per_type_decoder_f SET_OF_decode_uper; 36 | LIB61850_INTERNAL per_type_encoder_f SET_OF_encode_uper; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _CONSTR_SET_OF_H_ */ 43 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/constraints.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _ASN1_CONSTRAINTS_VALIDATOR_H_ 6 | #define _ASN1_CONSTRAINTS_VALIDATOR_H_ 7 | 8 | #include /* Platform-dependent types */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 15 | 16 | /* 17 | * Validate the structure according to the ASN.1 constraints. 18 | * If errbuf and errlen are given, they shall be pointing to the appropriate 19 | * buffer space and its length before calling this function. Alternatively, 20 | * they could be passed as NULL's. If constraints validation fails, 21 | * errlen will contain the actual number of bytes taken from the errbuf 22 | * to encode an error message (properly 0-terminated). 23 | * 24 | * RETURN VALUES: 25 | * This function returns 0 in case all ASN.1 constraints are met 26 | * and -1 if one or more constraints were failed. 27 | */ 28 | LIB61850_INTERNAL int 29 | asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, 30 | const void *struct_ptr, /* Target language's structure */ 31 | char *errbuf, /* Returned error description */ 32 | size_t *errlen /* Length of the error description */ 33 | ); 34 | 35 | 36 | /* 37 | * Generic type for constraint checking callback, 38 | * associated with every type descriptor. 39 | */ 40 | typedef int (asn_constr_check_f)( 41 | struct asn_TYPE_descriptor_s *type_descriptor, 42 | const void *struct_ptr, 43 | asn_app_constraint_failed_f *optional_callback, /* Log the error */ 44 | void *optional_app_key /* Opaque key passed to a callback */ 45 | ); 46 | 47 | /******************************* 48 | * INTERNALLY USEFUL FUNCTIONS * 49 | *******************************/ 50 | 51 | LIB61850_INTERNAL asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ 52 | LIB61850_INTERNAL asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ 53 | 54 | /* 55 | * Invoke the callback with a complete error message. 56 | */ 57 | #define _ASN_CTFAIL if(ctfailcb) ctfailcb 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* _ASN1_CONSTRAINTS_VALIDATOR_H_ */ 64 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/der_encoder.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 _DER_ENCODER_H_ 6 | #define _DER_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 | /* 17 | * The DER encoder of any type. May be invoked by the application. 18 | */ 19 | LIB61850_INTERNAL asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, 20 | void *struct_ptr, /* Structure to be encoded */ 21 | asn_app_consume_bytes_f *consume_bytes_cb, 22 | void *app_key /* Arbitrary callback argument */ 23 | ); 24 | 25 | /* A variant of der_encode() which encodes data into the pre-allocated buffer */ 26 | LIB61850_INTERNAL asn_enc_rval_t der_encode_to_buffer( 27 | struct asn_TYPE_descriptor_s *type_descriptor, 28 | void *struct_ptr, /* Structure to be encoded */ 29 | void *buffer, /* Pre-allocated buffer */ 30 | size_t buffer_size /* Initial buffer size (maximum) */ 31 | ); 32 | 33 | /* 34 | * Type of the generic DER encoder. 35 | */ 36 | typedef asn_enc_rval_t (der_type_encoder_f)( 37 | struct asn_TYPE_descriptor_s *type_descriptor, 38 | void *struct_ptr, /* Structure to be encoded */ 39 | int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ 40 | ber_tlv_tag_t tag, 41 | asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ 42 | void *app_key /* Arbitrary callback argument */ 43 | ); 44 | 45 | 46 | /******************************* 47 | * INTERNALLY USEFUL FUNCTIONS * 48 | *******************************/ 49 | 50 | /* 51 | * Write out leading TL[v] sequence according to the type definition. 52 | */ 53 | LIB61850_INTERNAL ssize_t der_write_tags( 54 | struct asn_TYPE_descriptor_s *type_descriptor, 55 | size_t struct_length, 56 | int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ 57 | int last_tag_form, /* {0,!0}: prim, constructed */ 58 | ber_tlv_tag_t tag, 59 | asn_app_consume_bytes_f *consume_bytes_cb, 60 | void *app_key 61 | ); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* _DER_ENCODER_H_ */ 68 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/inc_mms_asn1c.go: -------------------------------------------------------------------------------- 1 | package inc_mms_asnic 2 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 21 | asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, 22 | struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ 23 | void **struct_ptr, /* Pointer to a target structure's pointer */ 24 | const void *buffer, /* Data to be decoded */ 25 | size_t size, /* Size of data buffer */ 26 | int skip_bits, /* Number of unused leading bits, 0..7 */ 27 | int unused_bits /* Number of unused tailing bits, 0..7 */ 28 | ); 29 | 30 | 31 | /* 32 | * Type of the type-specific PER decoder function. 33 | */ 34 | typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, 35 | struct asn_TYPE_descriptor_s *type_descriptor, 36 | asn_per_constraints_t *constraints, 37 | void **struct_ptr, 38 | asn_per_data_t *per_data 39 | ); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* _PER_DECODER_H_ */ 46 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 21 | asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, 22 | void *struct_ptr, /* Structure to be encoded */ 23 | asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ 24 | void *app_key /* Arbitrary callback argument */ 25 | ); 26 | 27 | /* A variant of uper_encode() which encodes data into the existing buffer */ 28 | LIB61850_INTERNAL 29 | asn_enc_rval_t uper_encode_to_buffer( 30 | struct asn_TYPE_descriptor_s *type_descriptor, 31 | void *struct_ptr, /* Structure to be encoded */ 32 | void *buffer, /* Pre-allocated buffer */ 33 | size_t buffer_size /* Initial buffer size (max) */ 34 | ); 35 | 36 | 37 | /* 38 | * Type of the generic PER encoder function. 39 | */ 40 | typedef asn_enc_rval_t (per_type_encoder_f)( 41 | struct asn_TYPE_descriptor_s *type_descriptor, 42 | asn_per_constraints_t *constraints, 43 | void *struct_ptr, 44 | asn_per_outp_t *per_output 45 | ); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* _PER_ENCODER_H_ */ 52 | -------------------------------------------------------------------------------- /iec61850/inc/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 | LIB61850_INTERNAL 27 | asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, 28 | void *struct_ptr, /* Structure to be encoded */ 29 | enum xer_encoder_flags_e xer_flags, 30 | asn_app_consume_bytes_f *consume_bytes_cb, 31 | void *app_key /* Arbitrary callback argument */ 32 | ); 33 | 34 | /* 35 | * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) 36 | * output into the chosen file pointer. 37 | * RETURN VALUES: 38 | * 0: The structure is printed. 39 | * -1: Problem printing the structure. 40 | * WARNING: No sensible errno value is returned. 41 | */ 42 | LIB61850_INTERNAL 43 | int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); 44 | 45 | /* 46 | * Type of the generic XER encoder. 47 | */ 48 | typedef asn_enc_rval_t (xer_type_encoder_f)( 49 | struct asn_TYPE_descriptor_s *type_descriptor, 50 | void *struct_ptr, /* Structure to be encoded */ 51 | int ilevel, /* Level of indentation */ 52 | enum xer_encoder_flags_e xer_flags, 53 | asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ 54 | void *app_key /* Arbitrary callback argument */ 55 | ); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* _XER_ENCODER_H_ */ 62 | -------------------------------------------------------------------------------- /iec61850/inc/mms/iso_mms/asn1c/xer_support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com. 3 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 4 | * Redistribution and modifications are permitted subject to BSD license. 5 | */ 6 | #ifndef _XER_SUPPORT_H_ 7 | #define _XER_SUPPORT_H_ 8 | 9 | #include /* Platform-specific types */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /* 16 | * Types of data transferred to the application. 17 | */ 18 | typedef enum { 19 | PXML_TEXT, /* Plain text between XML tags. */ 20 | PXML_TAG, /* A tag, starting with '<'. */ 21 | PXML_COMMENT, /* An XML comment, including "". */ 22 | /* 23 | * The following chunk types are reported if the chunk 24 | * terminates the specified XML element. 25 | */ 26 | PXML_TAG_END, /* Tag ended */ 27 | PXML_COMMENT_END /* Comment ended */ 28 | } pxml_chunk_type_e; 29 | 30 | /* 31 | * Callback function that is called by the parser when parsed data is 32 | * available. The _opaque is the pointer to a field containing opaque user 33 | * data specified in pxml_create() call. The chunk type is _type and the text 34 | * data is the piece of buffer identified by _bufid (as supplied to 35 | * pxml_feed() call) starting at offset _offset and of _size bytes size. 36 | * The chunk is NOT '\0'-terminated. 37 | */ 38 | typedef int (pxml_callback_f)(pxml_chunk_type_e _type, 39 | const void *_chunk_data, size_t _chunk_size, void *_key); 40 | 41 | /* 42 | * Parse the given buffer as it were a chunk of XML data. 43 | * Invoke the specified callback each time the meaninful data is found. 44 | * This function returns number of bytes consumed from the bufer. 45 | * It will always be lesser than or equal to the specified _size. 46 | * The next invocation of this function must account the difference. 47 | */ 48 | LIB61850_INTERNAL 49 | ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, 50 | pxml_callback_f *cb, void *_key); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif /* _XER_SUPPORT_H_ */ 57 | -------------------------------------------------------------------------------- /iec61850/lib/linux64/lib_linux64.go: -------------------------------------------------------------------------------- 1 | package lib_linux64 2 | -------------------------------------------------------------------------------- /iec61850/lib/linux64/libiec61850.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/iec61850/lib/linux64/libiec61850.a -------------------------------------------------------------------------------- /iec61850/lib/linux_armv7l/lib_armv7l.go: -------------------------------------------------------------------------------- 1 | package lib_armv7l 2 | -------------------------------------------------------------------------------- /iec61850/lib/linux_armv7l/libhal.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/iec61850/lib/linux_armv7l/libhal.a -------------------------------------------------------------------------------- /iec61850/lib/linux_armv7l/libiec61850.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/iec61850/lib/linux_armv7l/libiec61850.a -------------------------------------------------------------------------------- /iec61850/lib/linux_armv8/lib_armv8.go: -------------------------------------------------------------------------------- 1 | package lib_armv8 2 | -------------------------------------------------------------------------------- /iec61850/lib/linux_armv8/libhal.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/iec61850/lib/linux_armv8/libhal.a -------------------------------------------------------------------------------- /iec61850/lib/linux_armv8/libiec61850.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/iec61850/lib/linux_armv8/libiec61850.a -------------------------------------------------------------------------------- /iec61850/lib/win64/lib_win64.go: -------------------------------------------------------------------------------- 1 | package lib_win64 2 | -------------------------------------------------------------------------------- /iec61850/lib/win64/libhal.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/iec61850/lib/win64/libhal.a -------------------------------------------------------------------------------- /iec61850/lib/win64/libiec61850.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jifanchn/go-libiec61850/300e0ae9b276d5b9647867f1beeb5e8b60c2f231/iec61850/lib/win64/libiec61850.a -------------------------------------------------------------------------------- /iec61850/model.go: -------------------------------------------------------------------------------- 1 | package iec61850 2 | 3 | /* 4 | #include "iec61850_server.h" 5 | */ 6 | import "C" 7 | import "unsafe" 8 | 9 | type IedModel struct { 10 | model *C.IedModel 11 | } 12 | 13 | func NewIedModel(name string) *IedModel { 14 | return &IedModel{ 15 | model: C.IedModel_create(C.CString(name)), 16 | } 17 | } 18 | 19 | func (m *IedModel) Destroy() { 20 | C.IedModel_destroy(m.model) 21 | } 22 | 23 | type LogicalDevice struct { 24 | device *C.LogicalDevice 25 | } 26 | 27 | func (m *IedModel) CreateLogicalDevice(name string) *LogicalDevice { 28 | return &LogicalDevice{ 29 | device: C.LogicalDevice_create(C.CString(name), m.model), 30 | } 31 | } 32 | 33 | type LogicalNode struct { 34 | node *C.LogicalNode 35 | } 36 | 37 | func (d *LogicalDevice) CreateLogicalNode(name string) *LogicalNode { 38 | return &LogicalNode{ 39 | node: C.LogicalNode_create(C.CString(name), d.device), 40 | } 41 | } 42 | 43 | type DataObject struct { 44 | object *C.DataObject 45 | } 46 | 47 | // ENS: EnumerationString 48 | // VSS: Visible String Setting 49 | // SAV: Sampled Value 50 | // APC: Analogue Process Control 51 | 52 | func (n *LogicalNode) CreateDataObjectCDC_ENS(name string) *DataObject { 53 | return &DataObject{ 54 | object: C.CDC_ENS_create(C.CString(name), (*C.ModelNode)(n.node), 0), 55 | } 56 | } 57 | 58 | func (n *LogicalNode) CreateDataObjectCDC_VSS(name string) *DataObject { 59 | return &DataObject{ 60 | object: C.CDC_VSS_create(C.CString(name), (*C.ModelNode)(n.node), 0), 61 | } 62 | } 63 | 64 | func (n *LogicalNode) CreateDataObjectCDC_SAV(name string, isInteger bool) *DataObject { 65 | return &DataObject{ 66 | object: C.CDC_SAV_create(C.CString(name), (*C.ModelNode)(n.node), 0, C.bool(isInteger)), 67 | } 68 | } 69 | 70 | func (n *LogicalNode) CreateDataObjectCDC_APC(name string, ctlModel int) *DataObject { 71 | return &DataObject{ 72 | object: C.CDC_APC_create(C.CString(name), (*C.ModelNode)(n.node), 0, C.uint(ctlModel), C.bool(false)), 73 | } 74 | } 75 | 76 | type DataAttribute struct { 77 | attribute *C.DataAttribute 78 | } 79 | 80 | func (do *DataObject) GetChild(name string) *DataAttribute { 81 | return &DataAttribute{ 82 | attribute: (*C.DataAttribute)(unsafe.Pointer(C.ModelNode_getChild((*C.ModelNode)(unsafe.Pointer(do.object)), C.CString(name)))), 83 | } 84 | } 85 | 86 | type DataSet struct { 87 | dataSet *C.DataSet 88 | } 89 | 90 | // CreateDataSet creates a new DataSet under this LogicalNode. 91 | func (ln *LogicalNode) CreateDataSet(name string) *DataSet { 92 | cName := C.CString(name) 93 | defer C.free(unsafe.Pointer(cName)) 94 | 95 | cDataSet := C.DataSet_create(cName, ln.node) 96 | return &DataSet{dataSet: cDataSet} 97 | } 98 | 99 | // AddDataSetEntry adds a new DataSetEntry to this DataSet. 100 | func (ds *DataSet) AddDataSetEntry(ref string) { 101 | cRef := C.CString(ref) 102 | defer C.free(unsafe.Pointer(cRef)) 103 | 104 | C.DataSetEntry_create(ds.dataSet, cRef, -1, nil) 105 | } 106 | -------------------------------------------------------------------------------- /iec61850/test/client_control_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "fmt" 5 | "github.com/jifanchn/go-libiec61850/iec61850" 6 | "testing" 7 | "time" 8 | ) 9 | 10 | func TestIEC61850DirectWithNormalSecurity(t *testing.T) { 11 | client := iec61850.NewIedClient(iec61850.ConnectTimeout(time.Second * 5)) 12 | err := client.Connect("localhost", 10102) 13 | if err != nil { 14 | fmt.Println("Error connecting:", err) 15 | return 16 | } 17 | 18 | r1, err := client.ReadBoolean("BMS01DL_TRANS0/ykGAPC0.SPC00.stVal", iec61850.IEC61850_FC_ST) 19 | if err != nil { 20 | return 21 | } 22 | fmt.Printf("read success, r1 value: %+v\n", r1) 23 | 24 | err = client.DirectWithNormalSecurity("BMS01DL_TRANS0/ykGAPC0.SPC00", false) 25 | if err != nil { 26 | fmt.Println(err) 27 | return 28 | } 29 | 30 | r2, err := client.ReadBoolean("BMS01DL_TRANS0/ykGAPC0.SPC00.stVal", iec61850.IEC61850_FC_ST) 31 | if err != nil { 32 | return 33 | } 34 | fmt.Printf("read success, r2 value: %+v\n", r2) 35 | } 36 | -------------------------------------------------------------------------------- /iec61850/test/client_model_browser_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "fmt" 5 | "github.com/jifanchn/go-libiec61850/iec61850" 6 | "testing" 7 | ) 8 | 9 | func TestIEC61850ClientPrintTree(t *testing.T) { 10 | client := iec61850.NewIedClient() 11 | err := client.Connect("localhost", 102) 12 | if err != nil { 13 | fmt.Println("Error connecting:", err) 14 | return 15 | } 16 | fmt.Println("BROWSER MODEL....................") 17 | client.BrowseModel() 18 | scl, err := client.BrowseModelToSCL() 19 | if err != nil { 20 | t.Error(err) 21 | } 22 | fmt.Println("BROWSER SCL MODEL................") 23 | scl.Print() 24 | 25 | client.Close() 26 | } 27 | -------------------------------------------------------------------------------- /iec61850/test/client_model_read_values_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "fmt" 5 | "github.com/jifanchn/go-libiec61850/iec61850" 6 | "testing" 7 | "time" 8 | ) 9 | 10 | func TestIEC61850ClientReadValues(t *testing.T) { 11 | fmt.Println("CREATE SERVER....................") 12 | modelName := "test" 13 | tcpPort := 102 14 | 15 | // Create IedModel 16 | model := iec61850.NewIedModel(modelName) 17 | defer model.Destroy() 18 | // test/SENSORS/LLN0 19 | lDevice1 := model.CreateLogicalDevice("SENSORS") 20 | lln0 := lDevice1.CreateLogicalNode("LLN0") 21 | dataVSS := lln0.CreateDataObjectCDC_VSS("DATA") 22 | dataF := lln0.CreateDataObjectCDC_SAV("FLOAT", false) 23 | dataI := lln0.CreateDataObjectCDC_SAV("INT", true) 24 | fmt.Println(dataVSS) 25 | fmt.Println(dataF) 26 | fmt.Println(dataI) 27 | dataset := lln0.CreateDataSet("DATASET") 28 | fmt.Println(dataset) 29 | dataset.AddDataSetEntry("LLN0$ST$DATA$stVal") 30 | dataset.AddDataSetEntry("LLN0$MX$FLOAT$instMag$f") 31 | dataset.AddDataSetEntry("LLN0$MX$INT$instMag$i") 32 | 33 | server := iec61850.NewIedServer(model) 34 | 35 | // Start the server 36 | server.Start(tcpPort) 37 | 38 | server.LockDataModel() 39 | 40 | // childString := dataVSS.GetChild("instMag.s") 41 | childFloat := dataF.GetChild("instMag.f") 42 | childInt := dataI.GetChild("instMag.i") 43 | childStr := dataVSS.GetChild("stVal") 44 | 45 | server.UpdateVisibleStringAttributeValue(childStr, "Hello World!") 46 | server.UpdateFloatAttributeValue(childFloat, 3.14159) 47 | server.UpdateInt32AttributeValue(childInt, 42) 48 | 49 | server.UnlockDataModel() 50 | 51 | client := iec61850.NewIedClient() 52 | err := client.Connect("localhost", 102) 53 | if err != nil { 54 | fmt.Println("Error connecting:", err) 55 | return 56 | } 57 | fmt.Println("BROWSER MODEL....................") 58 | client.BrowseModel() 59 | scl, err := client.BrowseModelToSCL() 60 | if err != nil { 61 | t.Error(err) 62 | } 63 | fmt.Println("BROWSER SCL MODEL................") 64 | scl.Print() 65 | fmt.Println("READ VALUES......................") 66 | valueString, err := client.ReadString("testSENSORS/LLN0.DATA.stVal", iec61850.IEC61850_FC_ST) 67 | if err != nil { 68 | fmt.Println(err) 69 | } 70 | valInt, err := client.ReadInt32("testSENSORS/LLN0.INT.instMag.i", iec61850.IEC61850_FC_MX) 71 | if err != nil { 72 | fmt.Println(err) 73 | } 74 | valFloat, err := client.ReadFloat("testSENSORS/LLN0.FLOAT.instMag.f", iec61850.IEC61850_FC_MX) 75 | if err != nil { 76 | fmt.Println(err) 77 | } 78 | 79 | dataSet, err := client.ReadDataSetValues("testSENSORS/LLN0.DATASET", "") 80 | if err != nil { 81 | fmt.Println(err) 82 | } 83 | 84 | fmt.Printf("Result = %v, %v, %v\n", valueString, valInt, valFloat) 85 | fmt.Printf("Dataset = %v\n", dataSet) 86 | time.Sleep(time.Hour) 87 | server.Stop() 88 | server.Destroy() 89 | } 90 | -------------------------------------------------------------------------------- /iec61850/test/scl_load_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "github.com/jifanchn/go-libiec61850/iec61850/scl_xml" 5 | "testing" 6 | ) 7 | 8 | func TestIEC61850LoadICD(t *testing.T) { 9 | scl, err := scl_xml.GetSCL("test_icd.icd") 10 | if err != nil { 11 | t.Error(err) 12 | } 13 | scl.Print() 14 | } 15 | -------------------------------------------------------------------------------- /iec61850/test/server_dynamic_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "fmt" 5 | "github.com/jifanchn/go-libiec61850/iec61850" 6 | "os" 7 | "os/signal" 8 | "syscall" 9 | "testing" 10 | "time" 11 | ) 12 | 13 | func TestIEC61850ServerDynamicTest(t *testing.T) { 14 | modelName := "testmodel" 15 | tcpPort := 102 16 | 17 | // Create IedModel 18 | model := iec61850.NewIedModel(modelName) 19 | defer model.Destroy() 20 | 21 | // Create LogicalDevice 22 | lDevice1 := model.CreateLogicalDevice("SENSORS") 23 | 24 | // Create LogicalNodes 25 | lln0 := lDevice1.CreateLogicalNode("LLN0") 26 | ttmp1 := lDevice1.CreateLogicalNode("TTMP1") 27 | ggio1 := lDevice1.CreateLogicalNode("GGIO1") 28 | 29 | // Create DataObjects 30 | lln0.CreateDataObjectCDC_ENS("Mod") 31 | lln0.CreateDataObjectCDC_ENS("Health") 32 | ttmp1TmpSv := ttmp1.CreateDataObjectCDC_SAV("TmpSv", false) 33 | ggio1.CreateDataObjectCDC_APC("AnOut1", 2) // Assuming the constant CDC_CTL_MODEL_HAS_CANCEL | CDC_CTL_MODEL_SBO_ENHANCED equates to 2 34 | 35 | // Get DataAttributes 36 | temperatureValue := ttmp1TmpSv.GetChild("instMag.f") 37 | temperatureTimestamp := ttmp1TmpSv.GetChild("t") 38 | 39 | // Create IedServer 40 | server := iec61850.NewIedServer(model) 41 | defer server.Destroy() 42 | 43 | // Start the server 44 | server.Start(tcpPort) 45 | 46 | // Set up a signal handler to gracefully shut down the server on SIGINT (Ctrl+C) 47 | c := make(chan os.Signal, 1) 48 | signal.Notify(c, syscall.SIGINT) 49 | go func() { 50 | for range c { 51 | server.Stop() 52 | fmt.Println("Server stopped.") 53 | os.Exit(0) 54 | } 55 | }() 56 | 57 | // Sample update loop for attributes 58 | val := 0.0 59 | for i := 0; i < 10; i++ { // limited loop to 10 iterations for test 60 | server.LockDataModel() 61 | 62 | server.UpdateUTCTimeAttributeValue(temperatureTimestamp, time.Now().UnixNano()/int64(time.Millisecond)) 63 | server.UpdateFloatAttributeValue(temperatureValue, float32(val)) 64 | 65 | server.UnlockDataModel() 66 | 67 | val += 0.1 68 | 69 | time.Sleep(100 * time.Millisecond) 70 | } 71 | 72 | time.Sleep(time.Hour) 73 | } 74 | --------------------------------------------------------------------------------