├── CommonAPICppSpecification.pdf ├── CommonAPICppUserGuide.pdf ├── FrancaUserGuide-0.12.0.1.pdf ├── LICENSE ├── README.md ├── capicxx-core-runtime ├── AUTHORS ├── CHANGES ├── CMakeLists.txt ├── CommonAPI.pc.in ├── INSTALL ├── LICENSE ├── README.md ├── cmake │ ├── CommonAPIConfig.cmake.in │ └── CommonAPIConfigVersion.cmake.in ├── commonapi.spec.in ├── docx │ └── 01_mainpage.dox ├── doxygen.in ├── include │ └── CommonAPI │ │ ├── Address.hpp │ │ ├── Attribute.hpp │ │ ├── AttributeExtension.hpp │ │ ├── ByteBuffer.hpp │ │ ├── CallInfo.hpp │ │ ├── CommonAPI.hpp │ │ ├── Config.hpp │ │ ├── ContainerUtils.hpp │ │ ├── Deployable.hpp │ │ ├── Deployment.hpp │ │ ├── Enumeration.hpp │ │ ├── Event.hpp │ │ ├── Export.hpp │ │ ├── Extensions │ │ └── AttributeCacheExtension.hpp │ │ ├── Factory.hpp │ │ ├── IniFileReader.hpp │ │ ├── InputStream.hpp │ │ ├── Logger.hpp │ │ ├── LoggerImpl.hpp │ │ ├── MainLoopContext.hpp │ │ ├── OutputStream.hpp │ │ ├── Proxy.hpp │ │ ├── ProxyManager.hpp │ │ ├── Runtime.hpp │ │ ├── SelectiveEvent.hpp │ │ ├── SerializableArguments.hpp │ │ ├── Struct.hpp │ │ ├── Stub.hpp │ │ ├── TypeOutputStream.hpp │ │ ├── Types.hpp │ │ ├── Utils.hpp │ │ ├── Variant.hpp │ │ └── Version.hpp └── src │ └── CommonAPI │ ├── Address.cpp │ ├── ContainerUtils.cpp │ ├── IniFileReader.cpp │ ├── Logger.cpp │ ├── LoggerImpl.cpp │ ├── MainLoopContext.cpp │ ├── Proxy.cpp │ ├── ProxyManager.cpp │ ├── Runtime.cpp │ └── Utils.cpp ├── capicxx-someip-runtime ├── AUTHORS ├── CHANGES ├── CMakeLists.txt ├── CommonAPI-SomeIP.pc.in ├── INSTALL ├── LICENSE ├── README.md ├── cmake │ ├── CommonAPI-SomeIPConfig.cmake.in │ └── CommonAPI-SomeIPConfigVersion.cmake.in ├── include │ └── CommonAPI │ │ └── SomeIP │ │ ├── Address.hpp │ │ ├── AddressTranslator.hpp │ │ ├── Attribute.hpp │ │ ├── ClientId.hpp │ │ ├── CommonAPISomeIP.hpp │ │ ├── Configuration.hpp │ │ ├── Connection.hpp │ │ ├── Constants.hpp │ │ ├── Defines.hpp │ │ ├── Deployment.hpp │ │ ├── DispatchSource.hpp │ │ ├── Event.hpp │ │ ├── Factory.hpp │ │ ├── Helper.hpp │ │ ├── InputStream.hpp │ │ ├── InstanceAvailabilityStatusChangedEvent.hpp │ │ ├── InterfaceHandler.hpp │ │ ├── Message.hpp │ │ ├── OutputStream.hpp │ │ ├── Proxy.hpp │ │ ├── ProxyAsyncCallbackHandler.hpp │ │ ├── ProxyAsyncEventCallbackHandler.hpp │ │ ├── ProxyBase.hpp │ │ ├── ProxyConnection.hpp │ │ ├── ProxyHelper.hpp │ │ ├── ProxyManager.hpp │ │ ├── SelectiveEvent.hpp │ │ ├── SerializableArguments.hpp │ │ ├── StringEncoder.hpp │ │ ├── StubAdapter.hpp │ │ ├── StubAdapterHelper.hpp │ │ ├── StubManager.hpp │ │ ├── SubscriptionStatusWrapper.hpp │ │ ├── Types.hpp │ │ └── Watch.hpp └── src │ └── CommonAPI │ └── SomeIP │ ├── Address.cpp │ ├── AddressTranslator.cpp │ ├── ClientId.cpp │ ├── Connection.cpp │ ├── DispatchSource.cpp │ ├── Factory.cpp │ ├── InputStream.cpp │ ├── InstanceAvailabilityStatusChangedEvent.cpp │ ├── Message.cpp │ ├── OutputStream.cpp │ ├── Proxy.cpp │ ├── ProxyBase.cpp │ ├── ProxyManager.cpp │ ├── StringEncoder.cpp │ ├── StubAdapter.cpp │ ├── StubManager.cpp │ ├── SubscriptionStatusWrapper.cpp │ └── Watch.cpp ├── project ├── CMakeLists.txt ├── cgen │ ├── commonapi-generator.zip │ └── commonapi_someip_generator.zip ├── config │ ├── vsomeip-client.json │ └── vsomeip-service.json ├── fidl │ ├── Demo.fdepl │ └── Demo.fidl ├── gen_src.sh ├── patch │ └── patch.patch ├── script │ ├── client.sh │ └── service.sh ├── src-gen │ └── v1 │ │ └── com │ │ └── microchip │ │ ├── CustomTypes.hpp │ │ ├── CustomTypesSomeIPDeployment.cpp │ │ ├── CustomTypesSomeIPDeployment.hpp │ │ ├── IDemo.hpp │ │ ├── IDemoProxy.hpp │ │ ├── IDemoProxyBase.hpp │ │ ├── IDemoSomeIPDeployment.cpp │ │ ├── IDemoSomeIPDeployment.hpp │ │ ├── IDemoSomeIPProxy.cpp │ │ ├── IDemoSomeIPProxy.hpp │ │ ├── IDemoSomeIPStubAdapter.cpp │ │ ├── IDemoSomeIPStubAdapter.hpp │ │ ├── IDemoStub.hpp │ │ ├── IDemoStubDefault.cpp │ │ └── IDemoStubDefault.hpp └── src │ ├── Client.cpp │ ├── IDemoStubImpl.cpp │ ├── IDemoStubImpl.hpp │ └── Service.cpp └── vsomeip ├── AUTHORS ├── CHANGES ├── CMakeLists.txt ├── LICENSE ├── LICENSE_boost ├── README.md ├── config ├── vsomeip-local-security.json ├── vsomeip-local-tcp-client.json ├── vsomeip-local-tcp-service.json ├── vsomeip-local-tracing.json ├── vsomeip-local.json ├── vsomeip-tcp-client-security.json ├── vsomeip-tcp-client.json ├── vsomeip-tcp-service-security.json ├── vsomeip-tcp-service.json ├── vsomeip-udp-client-security.json ├── vsomeip-udp-client.json ├── vsomeip-udp-service-security.json ├── vsomeip-udp-service.json └── vsomeip.json ├── daemon ├── CMakeLists.txt └── vsomeipd.cpp ├── documentation ├── doxygen.in ├── multicast.txt ├── todo.txt ├── vsomeip.eap └── vsomeipUserGuide ├── examples ├── CMakeLists.txt ├── hello_world │ ├── CMakeLists.txt │ ├── hello_world_client.cpp │ ├── hello_world_service.cpp │ ├── helloworld-local.json │ └── readme ├── notify-sample.cpp ├── readme.txt ├── request-sample.cpp ├── response-sample.cpp ├── sample-ids.hpp └── subscribe-sample.cpp ├── exportmap.gcc ├── implementation ├── configuration │ ├── include │ │ ├── client.hpp │ │ ├── configuration.hpp │ │ ├── configuration_impl.hpp │ │ ├── debounce.hpp │ │ ├── e2e.hpp │ │ ├── event.hpp │ │ ├── eventgroup.hpp │ │ ├── internal.hpp │ │ ├── internal.hpp.in │ │ ├── policy.hpp │ │ ├── service.hpp │ │ ├── service_instance_range.hpp │ │ ├── trace.hpp │ │ └── watchdog.hpp │ └── src │ │ └── configuration_impl.cpp ├── e2e_protection │ ├── include │ │ ├── buffer │ │ │ └── buffer.hpp │ │ ├── crc │ │ │ └── crc.hpp │ │ ├── e2e │ │ │ └── profile │ │ │ │ ├── profile01 │ │ │ │ ├── checker.hpp │ │ │ │ ├── profile_01.hpp │ │ │ │ └── protector.hpp │ │ │ │ ├── profile_custom │ │ │ │ ├── checker.hpp │ │ │ │ ├── profile_custom.hpp │ │ │ │ └── protector.hpp │ │ │ │ └── profile_interface │ │ │ │ ├── checker.hpp │ │ │ │ ├── profile_interface.hpp │ │ │ │ └── protector.hpp │ │ └── e2exf │ │ │ └── config.hpp │ └── src │ │ ├── buffer │ │ └── buffer.cpp │ │ ├── crc │ │ └── crc.cpp │ │ ├── e2e │ │ └── profile │ │ │ ├── profile01 │ │ │ ├── checker.cpp │ │ │ ├── profile_01.cpp │ │ │ └── protector.cpp │ │ │ └── profile_custom │ │ │ ├── checker.cpp │ │ │ ├── profile_custom.cpp │ │ │ └── protector.cpp │ │ └── e2exf │ │ └── config.cpp ├── endpoints │ ├── include │ │ ├── buffer.hpp │ │ ├── client_endpoint.hpp │ │ ├── client_endpoint_impl.hpp │ │ ├── credentials.hpp │ │ ├── endpoint.hpp │ │ ├── endpoint_definition.hpp │ │ ├── endpoint_host.hpp │ │ ├── endpoint_impl.hpp │ │ ├── local_client_endpoint_impl.hpp │ │ ├── local_server_endpoint_impl.hpp │ │ ├── netlink_connector.hpp │ │ ├── server_endpoint_impl.hpp │ │ ├── tcp_client_endpoint_impl.hpp │ │ ├── tcp_server_endpoint_impl.hpp │ │ ├── udp_client_endpoint_impl.hpp │ │ ├── udp_server_endpoint_impl.hpp │ │ └── virtual_server_endpoint_impl.hpp │ └── src │ │ ├── client_endpoint_impl.cpp │ │ ├── credentials.cpp │ │ ├── endpoint_definition.cpp │ │ ├── endpoint_impl.cpp │ │ ├── local_client_endpoint_impl.cpp │ │ ├── local_server_endpoint_impl.cpp │ │ ├── netlink_connector.cpp │ │ ├── server_endpoint_impl.cpp │ │ ├── tcp_client_endpoint_impl.cpp │ │ ├── tcp_server_endpoint_impl.cpp │ │ ├── udp_client_endpoint_impl.cpp │ │ ├── udp_server_endpoint_impl.cpp │ │ └── virtual_server_endpoint_impl.cpp ├── helper │ └── boost │ │ └── asio │ │ ├── basic_datagram_socket_ext.hpp │ │ ├── datagram_socket_service_ext.hpp │ │ ├── detail │ │ ├── handler_type_requirements_ext.hpp │ │ ├── impl │ │ │ ├── reactive_socket_service_base_ext.ipp │ │ │ └── socket_ops_ext.ipp │ │ ├── reactive_socket_recv_op_ext.hpp │ │ ├── reactive_socket_recvfrom_op_ext.hpp │ │ ├── reactive_socket_recvmsg_op_ext.hpp │ │ ├── reactive_socket_service_base_ext.hpp │ │ ├── reactive_socket_service_ext.hpp │ │ ├── reactor_op_ext.hpp │ │ └── socket_ops_ext.hpp │ │ └── ip │ │ └── udp_ext.hpp ├── logging │ ├── include │ │ ├── defines.hpp │ │ ├── dlt_sink_backend.hpp │ │ ├── logger.hpp │ │ └── logger_impl.hpp │ └── src │ │ ├── dlt_sink_backend.cpp │ │ ├── logger.cpp │ │ └── logger_impl.cpp ├── message │ ├── include │ │ ├── deserializer.hpp │ │ ├── message_base_impl.hpp │ │ ├── message_header_impl.hpp │ │ ├── message_impl.hpp │ │ ├── payload_impl.hpp │ │ └── serializer.hpp │ └── src │ │ ├── deserializer.cpp │ │ ├── message_base_impl.cpp │ │ ├── message_header_impl.cpp │ │ ├── message_impl.cpp │ │ ├── payload_impl.cpp │ │ └── serializer.cpp ├── plugin │ ├── include │ │ └── plugin_manager.hpp │ └── src │ │ └── plugin_manager.cpp ├── routing │ ├── include │ │ ├── event.hpp │ │ ├── eventgroupinfo.hpp │ │ ├── routing_manager.hpp │ │ ├── routing_manager_adapter.hpp │ │ ├── routing_manager_base.hpp │ │ ├── routing_manager_host.hpp │ │ ├── routing_manager_impl.hpp │ │ ├── routing_manager_proxy.hpp │ │ ├── routing_manager_stub.hpp │ │ ├── routing_manager_stub_host.hpp │ │ ├── serviceinfo.hpp │ │ └── types.hpp │ └── src │ │ ├── event.cpp │ │ ├── eventgroupinfo.cpp │ │ ├── routing_manager_base.cpp │ │ ├── routing_manager_impl.cpp │ │ ├── routing_manager_proxy.cpp │ │ ├── routing_manager_stub.cpp │ │ └── serviceinfo.cpp ├── runtime │ ├── include │ │ ├── application_impl.hpp │ │ └── runtime_impl.hpp │ └── src │ │ ├── application_impl.cpp │ │ ├── error.cpp │ │ ├── runtime.cpp │ │ └── runtime_impl.cpp ├── service_discovery │ ├── include │ │ ├── configuration_option_impl.hpp │ │ ├── constants.hpp │ │ ├── defines.hpp │ │ ├── deserializer.hpp │ │ ├── entry_impl.hpp │ │ ├── enumeration_types.hpp │ │ ├── eventgroupentry_impl.hpp │ │ ├── ip_option_impl.hpp │ │ ├── ipv4_option_impl.hpp │ │ ├── ipv6_option_impl.hpp │ │ ├── load_balancing_option_impl.hpp │ │ ├── message_element_impl.hpp │ │ ├── message_impl.hpp │ │ ├── option_impl.hpp │ │ ├── primitive_types.hpp │ │ ├── protection_option_impl.hpp │ │ ├── request.hpp │ │ ├── runtime.hpp │ │ ├── runtime_impl.hpp │ │ ├── service_discovery.hpp │ │ ├── service_discovery_host.hpp │ │ ├── service_discovery_impl.hpp │ │ ├── serviceentry_impl.hpp │ │ └── subscription.hpp │ └── src │ │ ├── configuration_option_impl.cpp │ │ ├── deserializer.cpp │ │ ├── entry_impl.cpp │ │ ├── eventgroupentry_impl.cpp │ │ ├── ip_option_impl.cpp │ │ ├── ipv4_option_impl.cpp │ │ ├── ipv6_option_impl.cpp │ │ ├── load_balancing_option_impl.cpp │ │ ├── message_element_impl.cpp │ │ ├── message_impl.cpp │ │ ├── option_impl.cpp │ │ ├── protection_option_impl.cpp │ │ ├── request.cpp │ │ ├── runtime_impl.cpp │ │ ├── service_discovery_impl.cpp │ │ ├── serviceentry_impl.cpp │ │ └── subscription.cpp ├── tracing │ ├── include │ │ ├── defines.hpp │ │ ├── enumeration_types.hpp │ │ ├── trace_connector.hpp │ │ └── trace_header.hpp │ └── src │ │ ├── trace_connector.cpp │ │ └── trace_header.cpp └── utility │ ├── include │ ├── byteorder.hpp │ ├── criticalsection.hpp │ └── utility.hpp │ └── src │ ├── criticalsection.cpp │ └── utility.cpp ├── interface └── vsomeip │ ├── application.hpp │ ├── constants.hpp │ ├── defines.hpp │ ├── enumeration_types.hpp │ ├── error.hpp │ ├── export.hpp │ ├── function_types.hpp │ ├── handler.hpp │ ├── internal │ ├── deserializable.hpp │ └── serializable.hpp │ ├── message.hpp │ ├── message_base.hpp │ ├── payload.hpp │ ├── plugin.hpp │ ├── plugins │ ├── application_plugin.hpp │ └── pre_configuration_plugin.hpp │ ├── primitive_types.hpp │ ├── runtime.hpp │ └── vsomeip.hpp ├── test ├── CMakeLists.txt ├── application_tests │ ├── application_test.cpp │ ├── application_test_availability.cpp │ ├── application_test_availability_starter.sh │ ├── application_test_client.cpp │ ├── application_test_client_availability.cpp │ ├── application_test_daemon.cpp │ ├── application_test_globals.hpp │ ├── application_test_service.cpp │ ├── application_test_single_process.cpp │ ├── application_test_single_process.json │ ├── application_test_single_process_starter.sh │ ├── application_test_starter.sh │ └── conf │ │ ├── application_test.json.in │ │ ├── application_test_daemon.json.in │ │ ├── application_test_no_dispatch_threads.json.in │ │ └── application_test_no_dispatch_threads_daemon.json.in ├── big_payload_tests │ ├── big_payload_test_client.cpp │ ├── big_payload_test_client.hpp │ ├── big_payload_test_client_local_start.sh │ ├── big_payload_test_client_start.sh │ ├── big_payload_test_external_starter.sh │ ├── big_payload_test_globals.hpp │ ├── big_payload_test_local.json │ ├── big_payload_test_local_limited.json │ ├── big_payload_test_local_queue_limited.json │ ├── big_payload_test_local_random.json │ ├── big_payload_test_local_starter.sh │ ├── big_payload_test_service.cpp │ ├── big_payload_test_service.hpp │ ├── big_payload_test_service_external_start.sh │ ├── big_payload_test_service_local_start.sh │ └── conf │ │ ├── big_payload_test_tcp_client.json.in │ │ ├── big_payload_test_tcp_client_limited_general.json.in │ │ ├── big_payload_test_tcp_client_queue_limited_general.json.in │ │ ├── big_payload_test_tcp_client_queue_limited_specific.json.in │ │ ├── big_payload_test_tcp_client_random.json.in │ │ ├── big_payload_test_tcp_service.json.in │ │ ├── big_payload_test_tcp_service_limited_general.json.in │ │ ├── big_payload_test_tcp_service_queue_limited_general.json.in │ │ ├── big_payload_test_tcp_service_queue_limited_specific.json.in │ │ └── big_payload_test_tcp_service_random.json.in ├── client_id_tests │ ├── client_id_test_globals.hpp │ ├── client_id_test_master_starter.sh │ ├── client_id_test_service.cpp │ ├── client_id_test_slave_starter.sh │ ├── client_id_test_utility.cpp │ ├── client_id_test_utility.json │ ├── client_id_test_utility_masked_127.json │ ├── client_id_test_utility_masked_4095.json │ ├── client_id_test_utility_masked_511.json │ └── conf │ │ ├── client_id_test_diff_client_ids_diff_ports_master.json.in │ │ ├── client_id_test_diff_client_ids_diff_ports_slave.json.in │ │ ├── client_id_test_diff_client_ids_partial_same_ports_master.json.in │ │ ├── client_id_test_diff_client_ids_partial_same_ports_slave.json.in │ │ ├── client_id_test_diff_client_ids_same_ports_master.json.in │ │ ├── client_id_test_diff_client_ids_same_ports_slave.json.in │ │ ├── client_id_test_same_client_ids_diff_ports_master.json.in │ │ ├── client_id_test_same_client_ids_diff_ports_slave.json.in │ │ ├── client_id_test_same_client_ids_same_ports_master.json.in │ │ └── client_id_test_same_client_ids_same_ports_slave.json.in ├── configuration_tests │ ├── configuration-test-deprecated.json │ ├── configuration-test.cpp │ └── configuration-test.json ├── cpu_load_tests │ ├── conf │ │ ├── cpu_load_test_client_master.json.in │ │ ├── cpu_load_test_client_slave.json.in │ │ ├── cpu_load_test_service_master.json.in │ │ └── cpu_load_test_service_slave.json.in │ ├── cpu_load_measurer.cpp │ ├── cpu_load_measurer.hpp │ ├── cpu_load_test_client.cpp │ ├── cpu_load_test_globals.hpp │ ├── cpu_load_test_master_starter.sh │ ├── cpu_load_test_service.cpp │ └── cpu_load_test_slave_starter.sh ├── header_factory_tests │ ├── header_factory_test.cpp │ ├── header_factory_test_client.cpp │ ├── header_factory_test_client.hpp │ ├── header_factory_test_client.json │ ├── header_factory_test_client_start.sh │ ├── header_factory_test_send_receive_starter.sh │ ├── header_factory_test_service.cpp │ ├── header_factory_test_service.hpp │ ├── header_factory_test_service.json │ └── header_factory_test_service_start.sh ├── initial_event_tests │ ├── conf │ │ ├── initial_event_test_diff_client_ids_diff_ports_master.json.in │ │ ├── initial_event_test_diff_client_ids_diff_ports_master_tcp.json.in │ │ ├── initial_event_test_diff_client_ids_diff_ports_same_service_id_master.json.in │ │ ├── initial_event_test_diff_client_ids_diff_ports_same_service_id_slave.json.in │ │ ├── initial_event_test_diff_client_ids_diff_ports_slave.json.in │ │ ├── initial_event_test_diff_client_ids_diff_ports_slave_tcp.json.in │ │ ├── initial_event_test_diff_client_ids_partial_same_ports_master.json.in │ │ ├── initial_event_test_diff_client_ids_partial_same_ports_slave.json.in │ │ ├── initial_event_test_diff_client_ids_same_ports_master.json.in │ │ ├── initial_event_test_diff_client_ids_same_ports_master_tcp.json.in │ │ ├── initial_event_test_diff_client_ids_same_ports_slave.json.in │ │ ├── initial_event_test_diff_client_ids_same_ports_slave_tcp.json.in │ │ ├── initial_event_test_same_client_ids_diff_ports_master.json.in │ │ ├── initial_event_test_same_client_ids_diff_ports_slave.json.in │ │ ├── initial_event_test_same_client_ids_same_ports_master.json.in │ │ └── initial_event_test_same_client_ids_same_ports_slave.json.in │ ├── initial_event_test_availability_checker.cpp │ ├── initial_event_test_client.cpp │ ├── initial_event_test_globals.hpp │ ├── initial_event_test_master_starter.sh │ ├── initial_event_test_service.cpp │ ├── initial_event_test_slave_starter.sh │ └── initial_event_test_stop_service.cpp ├── magic_cookies_tests │ ├── conf │ │ ├── magic_cookies_test_client.json.in │ │ └── magic_cookies_test_service.json.in │ ├── magic_cookies_test_client.cpp │ ├── magic_cookies_test_client_start.sh │ ├── magic_cookies_test_service.cpp │ ├── magic_cookies_test_service_start.sh │ └── magic_cookies_test_starter.sh ├── malicious_data_tests │ ├── conf │ │ ├── malicious_data_test_master.json.in │ │ └── malicious_data_test_master_starter.sh.in │ ├── malicious_data_test_globals.hpp │ ├── malicious_data_test_msg_sender.cpp │ └── malicious_data_test_service.cpp ├── offer_tests │ ├── conf │ │ ├── offer_test_big_sd_msg_master.json.in │ │ ├── offer_test_big_sd_msg_master_starter.sh.in │ │ ├── offer_test_big_sd_msg_slave.json.in │ │ ├── offer_test_external_master.json.in │ │ ├── offer_test_external_master_starter.sh.in │ │ └── offer_test_external_slave.json.in │ ├── offer_test_big_sd_msg_client.cpp │ ├── offer_test_big_sd_msg_service.cpp │ ├── offer_test_big_sd_msg_slave_starter.sh │ ├── offer_test_client.cpp │ ├── offer_test_external_sd_msg_sender.cpp │ ├── offer_test_external_slave_starter.sh │ ├── offer_test_globals.hpp │ ├── offer_test_local.json │ ├── offer_test_local_starter.sh │ ├── offer_test_service.cpp │ └── offer_test_service_external.cpp ├── offered_services_info_test │ ├── offered_services_info_test_client.cpp │ ├── offered_services_info_test_globals.hpp │ ├── offered_services_info_test_local.json │ ├── offered_services_info_test_local_starter.sh │ └── offered_services_info_test_service.cpp ├── payload_tests │ ├── conf │ │ ├── external_local_payload_test_client_external.json.in │ │ ├── external_local_payload_test_client_local.json.in │ │ └── external_local_payload_test_service.json.in │ ├── external_local_payload_test_client_external_start.sh │ ├── external_local_payload_test_client_external_starter.sh │ ├── external_local_payload_test_client_local_and_external_starter.sh │ ├── external_local_payload_test_client_local_start.sh │ ├── external_local_payload_test_client_local_starter.sh │ ├── external_local_payload_test_service_client_external_start.sh │ ├── external_local_payload_test_service_start.sh │ ├── local_payload_test_client.json │ ├── local_payload_test_client_start.sh │ ├── local_payload_test_huge_payload_starter.sh │ ├── local_payload_test_service.json │ ├── local_payload_test_service_start.sh │ ├── local_payload_test_starter.sh │ ├── payload_test_client.cpp │ ├── payload_test_client.hpp │ ├── payload_test_service.cpp │ ├── payload_test_service.hpp │ ├── stopwatch.cpp │ └── stopwatch.hpp ├── pending_subscription_tests │ ├── conf │ │ ├── pending_subscription_test_master.json.in │ │ └── pending_subscription_test_master_starter.sh.in │ ├── pending_subscription_test_globals.hpp │ ├── pending_subscription_test_sd_msg_sender.cpp │ └── pending_subscription_test_service.cpp ├── readme.txt ├── restart_routing_tests │ ├── restart_routing_test_autoconfig.json │ ├── restart_routing_test_client.cpp │ ├── restart_routing_test_client.hpp │ ├── restart_routing_test_client.json │ ├── restart_routing_test_client_start.sh │ ├── restart_routing_test_service.cpp │ ├── restart_routing_test_service.hpp │ ├── restart_routing_test_service.json │ ├── restart_routing_test_service_start.sh │ └── restart_routing_test_starter.sh ├── routing_tests │ ├── conf │ │ ├── external_local_routing_test_client_external.json.in │ │ ├── external_local_routing_test_service.json.in │ │ ├── local_routing_test_starter.sh.bat.in │ │ └── local_routing_test_starter.sh.in │ ├── external_local_routing_test_client_external_start.sh │ ├── external_local_routing_test_service.cpp │ ├── external_local_routing_test_service.hpp │ ├── external_local_routing_test_service_start.sh │ ├── external_local_routing_test_starter.sh │ ├── local_routing_test_client.cpp │ ├── local_routing_test_client.hpp │ ├── local_routing_test_client.json │ ├── local_routing_test_client_start.sh │ ├── local_routing_test_service.cpp │ ├── local_routing_test_service.hpp │ ├── local_routing_test_service.json │ └── local_routing_test_service_start.sh ├── security_tests │ ├── conf │ │ └── security_test_config.json.in │ ├── security_test_client.cpp │ ├── security_test_client.hpp │ ├── security_test_client_start.sh │ ├── security_test_service.cpp │ ├── security_test_service.hpp │ └── security_test_start.sh ├── someip_test_globals.hpp ├── subscribe_notify_one_tests │ ├── conf │ │ ├── subscribe_notify_one_test_diff_client_ids_diff_ports_master.json.in │ │ ├── subscribe_notify_one_test_diff_client_ids_diff_ports_master_tcp.json.in │ │ ├── subscribe_notify_one_test_diff_client_ids_diff_ports_master_udp.json.in │ │ ├── subscribe_notify_one_test_diff_client_ids_diff_ports_slave.json.in │ │ ├── subscribe_notify_one_test_diff_client_ids_diff_ports_slave_tcp.json.in │ │ └── subscribe_notify_one_test_diff_client_ids_diff_ports_slave_udp.json.in │ ├── subscribe_notify_one_test_globals.hpp │ ├── subscribe_notify_one_test_master_starter.sh │ ├── subscribe_notify_one_test_service.cpp │ └── subscribe_notify_one_test_slave_starter.sh └── subscribe_notify_tests │ ├── conf │ ├── subscribe_notify_test_diff_client_ids_diff_ports_autoconfig_master.json.in │ ├── subscribe_notify_test_diff_client_ids_diff_ports_autoconfig_slave.json.in │ ├── subscribe_notify_test_diff_client_ids_diff_ports_master.json.in │ ├── subscribe_notify_test_diff_client_ids_diff_ports_master_tcp.json.in │ ├── subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_master.json.in │ ├── subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_slave.json.in │ ├── subscribe_notify_test_diff_client_ids_diff_ports_slave.json.in │ ├── subscribe_notify_test_diff_client_ids_diff_ports_slave_tcp.json.in │ ├── subscribe_notify_test_diff_client_ids_partial_same_ports_master.json.in │ ├── subscribe_notify_test_diff_client_ids_partial_same_ports_slave.json.in │ ├── subscribe_notify_test_diff_client_ids_same_ports_master.json.in │ ├── subscribe_notify_test_diff_client_ids_same_ports_master_tcp.json.in │ ├── subscribe_notify_test_diff_client_ids_same_ports_slave.json.in │ ├── subscribe_notify_test_diff_client_ids_same_ports_slave_tcp.json.in │ ├── subscribe_notify_test_one_event_two_eventgroups_master.json.in │ ├── subscribe_notify_test_one_event_two_eventgroups_tcp_slave.json.in │ ├── subscribe_notify_test_one_event_two_eventgroups_udp_slave.json.in │ ├── subscribe_notify_test_same_client_ids_diff_ports_master.json.in │ ├── subscribe_notify_test_same_client_ids_diff_ports_slave.json.in │ ├── subscribe_notify_test_same_client_ids_same_ports_master.json.in │ └── subscribe_notify_test_same_client_ids_same_ports_slave.json.in │ ├── subscribe_notify_test_globals.hpp │ ├── subscribe_notify_test_master_starter.sh │ ├── subscribe_notify_test_one_event_two_eventgroups_client.cpp │ ├── subscribe_notify_test_one_event_two_eventgroups_master_starter.sh │ ├── subscribe_notify_test_one_event_two_eventgroups_service.cpp │ ├── subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh │ ├── subscribe_notify_test_service.cpp │ └── subscribe_notify_test_slave_starter.sh ├── tools ├── CMakeLists.txt └── vsomeip_ctrl.cpp ├── vsomeip.pc.in ├── vsomeip.xml ├── vsomeipConfig.cmake.in └── vsomeipConfigVersion.cmake.in /CommonAPICppSpecification.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/some-ip/b1ab3161f38c4db498c16b1dd478693b17b994f9/CommonAPICppSpecification.pdf -------------------------------------------------------------------------------- /CommonAPICppUserGuide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/some-ip/b1ab3161f38c4db498c16b1dd478693b17b994f9/CommonAPICppUserGuide.pdf -------------------------------------------------------------------------------- /FrancaUserGuide-0.12.0.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/some-ip/b1ab3161f38c4db498c16b1dd478693b17b994f9/FrancaUserGuide-0.12.0.1.pdf -------------------------------------------------------------------------------- /capicxx-core-runtime/AUTHORS: -------------------------------------------------------------------------------- 1 | Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -------------------------------------------------------------------------------- /capicxx-core-runtime/CommonAPI.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@ 4 | includedir=@CMAKE_INSTALL_PREFIX@/include 5 | 6 | Name: @PROJECT@ 7 | Description: GENIVI Common API C++ Library 8 | Version: @COMPONENT_VERSION@ 9 | Libs: -L${libdir} -lCommonAPI 10 | Cflags: -I${includedir}/CommonAPI-@COMMONAPI_API_HEADER_VERSION@ 11 | 12 | -------------------------------------------------------------------------------- /capicxx-core-runtime/INSTALL: -------------------------------------------------------------------------------- 1 | Please refer to README.md for the installation instructions. 2 | -------------------------------------------------------------------------------- /capicxx-core-runtime/cmake/CommonAPIConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Config file for the CommonAPI package 2 | # It defines the following variables 3 | # COMMONAPI_INCLUDE_DIRS - include directories for CommonAPI 4 | 5 | # Compute paths 6 | get_filename_component(COMMONAPI_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 7 | set(COMMONAPI_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") 8 | 9 | # Our library dependencies (contains definitions for IMPORTED targets) 10 | include("${COMMONAPI_CMAKE_DIR}/CommonAPITargets.cmake") 11 | 12 | set(COMMONAPI_VERSION @PACKAGE_VERSION@) 13 | set(COMMONAPI_VERSION_STRING "@PACKAGE_VERSION@") 14 | -------------------------------------------------------------------------------- /capicxx-core-runtime/cmake/CommonAPIConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@PACKAGE_VERSION@") 2 | 3 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 4 | 5 | string(REPLACE "." "\\." ESCAPED_API_HEADER_VERSION "@COMMONAPI_API_HEADER_VERSION@") 6 | if("${PACKAGE_FIND_VERSION}" MATCHES "^${ESCAPED_API_HEADER_VERSION}($|\\.)") 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | endif() 9 | 10 | if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") 11 | set(PACKAGE_VERSION_EXACT TRUE) 12 | endif() 13 | -------------------------------------------------------------------------------- /capicxx-core-runtime/docx/01_mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \copyright 3 | * 4 | * Copyright (C) 2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 5 | * 6 | * This file is part of GENIVI project IPC CommonAPI C++. 7 | * 8 | * Contributions are licensed to the GENIVI Alliance under one or more Contribution License Agreements. 9 | * 10 | */ 11 | 12 | /*! 13 | \mainpage 14 | 15 | \par License 16 | This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 17 | 18 | \par CommonAPI C++ Specification and User Guide 19 | The specification and the user guide can be found in the CommonAPI documentation directory of the CommonAPI Tools project. 20 | 21 | \par Build instructions 22 | can be found in the README file of this project. 23 | */ 24 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/ByteBuffer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef COMMONAPI_BYTE_BUFFER_HPP_ 7 | #define COMMONAPI_BYTE_BUFFER_HPP_ 8 | 9 | #include 10 | #include 11 | 12 | namespace CommonAPI { 13 | 14 | typedef std::vector ByteBuffer; 15 | 16 | } // namespace CommonAPI 17 | 18 | #endif // COMMONAPI_BYTE_BUFFER_HPP_ 19 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/CallInfo.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef COMMONAPI_CALLINFO_HPP_ 7 | #define COMMONAPI_CALLINFO_HPP_ 8 | 9 | #include 10 | #include 11 | 12 | namespace CommonAPI { 13 | 14 | struct COMMONAPI_EXPORT CallInfo { 15 | CallInfo() 16 | : timeout_(DEFAULT_SEND_TIMEOUT_MS), sender_(0) { 17 | } 18 | CallInfo(Timeout_t _timeout) 19 | : timeout_(_timeout), sender_(0) { 20 | } 21 | CallInfo(Timeout_t _timeout, Sender_t _sender) 22 | : timeout_(_timeout), sender_(_sender) { 23 | } 24 | CallInfo(const CallInfo &_other) 25 | : timeout_(_other.timeout_), sender_(_other.sender_) { 26 | } 27 | 28 | Timeout_t timeout_; 29 | Sender_t sender_; 30 | }; 31 | 32 | } // namespace CommonAPI 33 | 34 | #endif // COMMONAPI_ADDRESS_HPP_ 35 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/CommonAPI.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef COMMONAPI_HPP_ 7 | #define COMMONAPI_HPP_ 8 | 9 | #ifndef COMMONAPI_INTERNAL_COMPILATION 10 | #define COMMONAPI_INTERNAL_COMPILATION 11 | #endif 12 | 13 | #include "Address.hpp" 14 | #include "Attribute.hpp" 15 | #include "AttributeExtension.hpp" 16 | #include "ByteBuffer.hpp" 17 | #include "MainLoopContext.hpp" 18 | #include "Runtime.hpp" 19 | #include "Types.hpp" 20 | 21 | #undef COMMONAPI_INTERNAL_COMPILATION 22 | 23 | #endif // COMMONAPI_HPP_ 24 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/Config.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef COMMONAPI_CONFIG_HPP_ 7 | #define COMMONAPI_CONFIG_HPP_ 8 | 9 | #include 10 | 11 | namespace CommonAPI { 12 | 13 | #ifndef DEFAULT_SEND_TIMEOUT 14 | #define DEFAULT_SEND_TIMEOUT 5000 15 | #endif 16 | 17 | static const Timeout_t DEFAULT_SEND_TIMEOUT_MS = DEFAULT_SEND_TIMEOUT; 18 | 19 | } // namespace CommonAPI 20 | 21 | #endif // COMMONAPI_CONFIG_HPP_ 22 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/ContainerUtils.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef COMMONAPI_CONTAINERUTILS_HPP_ 11 | #define COMMONAPI_CONTAINERUTILS_HPP_ 12 | 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | namespace CommonAPI { 19 | class ClientId; 20 | 21 | struct COMMONAPI_EXPORT SharedPointerClientIdContentHash : public std::unary_function, size_t> { 22 | size_t operator()(const std::shared_ptr& t) const; 23 | }; 24 | 25 | struct COMMONAPI_EXPORT SharedPointerClientIdContentEqual : public std::binary_function, std::shared_ptr, bool> { 26 | bool operator()(const std::shared_ptr& a, const std::shared_ptr& b) const; 27 | }; 28 | 29 | 30 | } // namespace std 31 | 32 | 33 | #endif // COMMONAPI_CONTAINERUTILS_HPP_ 34 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/Export.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef COMMONAPI_EXPORT_HPP_ 7 | #define COMMONAPI_EXPORT_HPP_ 8 | 9 | #ifdef _WIN32 10 | #define COMMONAPI_EXPORT __declspec(dllexport) 11 | #define COMMONAPI_EXPORT_CLASS_EXPLICIT 12 | 13 | #if COMMONAPI_DLL_COMPILATION 14 | #define COMMONAPI_IMPORT_EXPORT __declspec(dllexport) 15 | #else 16 | #define COMMONAPI_IMPORT_EXPORT __declspec(dllimport) 17 | #endif 18 | #else 19 | #define COMMONAPI_EXPORT __attribute__ ((visibility ("default"))) 20 | #define COMMONAPI_EXPORT_CLASS_EXPLICIT COMMONAPI_EXPORT 21 | #define COMMONAPI_IMPORT_EXPORT 22 | #endif 23 | 24 | #endif // COMMONAPI_EXPORT_HPP_ 25 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/IniFileReader.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef COMMONAPI_INIFILEREADER_HPP_ 7 | #define COMMONAPI_INIFILEREADER_HPP_ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | namespace CommonAPI { 16 | 17 | class IniFileReader { 18 | public: 19 | class Section { 20 | public: 21 | COMMONAPI_EXPORT const std::map &getMappings() const; 22 | COMMONAPI_EXPORT std::string getValue(const std::string &_key) const; 23 | private: 24 | std::map mappings_; 25 | 26 | friend class IniFileReader; 27 | }; 28 | 29 | COMMONAPI_EXPORT bool load(const std::string &_path); 30 | 31 | COMMONAPI_EXPORT const std::map> &getSections() const; 32 | COMMONAPI_EXPORT std::shared_ptr
getSection(const std::string &_name) const; 33 | 34 | private: 35 | std::map> sections_; 36 | }; 37 | 38 | } // namespace CommonAPI 39 | 40 | #endif // COMMONAPI_INIFILEREADER_HPP_ 41 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/SelectiveEvent.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef COMMONAPI_SELECTIVEEVENT_HPP_ 11 | #define COMMONAPI_SELECTIVEEVENT_HPP_ 12 | 13 | #include 14 | 15 | namespace CommonAPI { 16 | 17 | template 18 | class SelectiveEvent: public Event { 19 | public: 20 | typedef typename Event::Listener Listener; 21 | typedef typename Event::Subscription Subscription; 22 | 23 | virtual ~SelectiveEvent() {} 24 | }; 25 | 26 | } // namespace CommonAPI 27 | 28 | #endif // COMMONAPI_SELECTIVEEVENT_HPP_ 29 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/Utils.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef COMMONAPI_UTILS_HPP_ 7 | #define COMMONAPI_UTILS_HPP_ 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | namespace CommonAPI { 15 | 16 | std::vector COMMONAPI_EXPORT split(const std::string& s, char delim); 17 | void COMMONAPI_EXPORT trim(std::string &_s); 18 | 19 | 20 | } //namespace CommonAPI 21 | 22 | #endif /* COMMONAPI_UTILS_HPP_ */ 23 | -------------------------------------------------------------------------------- /capicxx-core-runtime/include/CommonAPI/Version.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef COMMONAPI_VERSION_HPP_ 11 | #define COMMONAPI_VERSION_HPP_ 12 | 13 | #include 14 | 15 | namespace CommonAPI { 16 | 17 | struct Version { 18 | Version() = default; 19 | Version(const uint32_t &majorValue, const uint32_t &minorValue) 20 | : Major(majorValue), Minor(minorValue) { 21 | } 22 | 23 | uint32_t Major; 24 | uint32_t Minor; 25 | }; 26 | 27 | } // namespace CommonAPI 28 | 29 | #endif // COMMONAPI_STRUCT_HPP_ 30 | -------------------------------------------------------------------------------- /capicxx-core-runtime/src/CommonAPI/ContainerUtils.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | #include 8 | 9 | namespace CommonAPI { 10 | 11 | size_t SharedPointerClientIdContentHash::operator()(const std::shared_ptr& t) const { 12 | if (t) { 13 | return t->hashCode(); 14 | } else { 15 | return 0; 16 | } 17 | } 18 | 19 | bool SharedPointerClientIdContentEqual::operator()(const std::shared_ptr& a, const std::shared_ptr& b) const { 20 | if (a && b) { 21 | return *a==*b; 22 | } else { 23 | return false; 24 | } 25 | } 26 | 27 | } // namespace std 28 | -------------------------------------------------------------------------------- /capicxx-core-runtime/src/CommonAPI/Logger.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | #include 8 | 9 | namespace CommonAPI { 10 | void 11 | Logger::init(bool _useConsole, const std::string &_fileName, bool _useDlt, const std::string &_level) { 12 | LoggerImpl::init(_useConsole, _fileName, _useDlt, _level); 13 | } 14 | 15 | } //namespace CommonAPI 16 | -------------------------------------------------------------------------------- /capicxx-core-runtime/src/CommonAPI/Proxy.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | 8 | namespace CommonAPI { 9 | 10 | Proxy::~Proxy() { 11 | completed_.set_value(); 12 | } 13 | 14 | const Address & 15 | Proxy::getAddress() const { 16 | return address_; 17 | } 18 | 19 | std::future Proxy::getCompletionFuture() { 20 | return completed_.get_future(); 21 | } 22 | 23 | } // namespace CommonAPI 24 | -------------------------------------------------------------------------------- /capicxx-core-runtime/src/CommonAPI/ProxyManager.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | #include 8 | 9 | namespace CommonAPI { 10 | 11 | std::shared_ptr 12 | ProxyManager::createProxy( 13 | const std::string &_domain, const std::string &_interface, const std::string &_instance, 14 | const ConnectionId_t &_connection) const { 15 | return Runtime::get()->createProxy(_domain, _interface, _instance, _connection); 16 | } 17 | 18 | std::shared_ptr 19 | ProxyManager::createProxy( 20 | const std::string &_domain, const std::string &_interface, const std::string &_instance, 21 | std::shared_ptr _context) const { 22 | return Runtime::get()->createProxy(_domain, _interface, _instance, _context); 23 | } 24 | 25 | } // namespace CommonAPI 26 | -------------------------------------------------------------------------------- /capicxx-core-runtime/src/CommonAPI/Utils.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace CommonAPI { 13 | 14 | std::vector& split(const std::string& s, char delim, std::vector& elems) { 15 | std::istringstream ss(s); 16 | std::string item; 17 | while (std::getline(ss, item, delim)) { 18 | elems.push_back(item); 19 | } 20 | return elems; 21 | } 22 | 23 | std::vector split(const std::string& s, char delim) { 24 | std::vector elems; 25 | return split(s, delim, elems); 26 | } 27 | 28 | void trim(std::string& toTrim) { 29 | toTrim.erase( 30 | toTrim.begin(), 31 | std::find_if( 32 | toTrim.begin(), 33 | toTrim.end(), 34 | std::not1(std::ptr_fun(isspace)) 35 | ) 36 | ); 37 | 38 | toTrim.erase( 39 | std::find_if( 40 | toTrim.rbegin(), 41 | toTrim.rend(), 42 | std::not1(std::ptr_fun(isspace))).base(), 43 | toTrim.end() 44 | ); 45 | } 46 | 47 | }//namespace CommonAPI 48 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/AUTHORS: -------------------------------------------------------------------------------- 1 | Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -------------------------------------------------------------------------------- /capicxx-someip-runtime/CommonAPI-SomeIP.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@ 4 | includedir=@CMAKE_INSTALL_PREFIX@/include 5 | 6 | Name: @PROJECT@ 7 | Description: C++ CommonAPI SOME/IP Runtime 8 | Version: @COMPONENT_VERSION@ 9 | Libs: -L${libdir} -lCommonAPI-SomeIP 10 | Requires: CommonAPI 11 | Requires.private: vsomeip 12 | Cflags: -I${includedir}/CommonAPI-@COMMONAPI_API_HEADER_VERSION@ 13 | 14 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/INSTALL: -------------------------------------------------------------------------------- 1 | Please refer to README.md for the installation instructions. 2 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/cmake/CommonAPI-SomeIPConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Config file for the CommonAPI-SomeIP package 2 | # It defines the following variables 3 | # COMMONAPI_SOMEIP_INCLUDE_DIRS - include directories for CommonAPI-SomeIP 4 | 5 | # Compute paths 6 | get_filename_component (COMMONAPI_SOMEIP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 7 | set (COMMONAPI_SOMEIP_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") 8 | 9 | include ("${COMMONAPI_SOMEIP_CMAKE_DIR}/CommonAPI-SomeIPTargets.cmake") 10 | 11 | set(COMMONAPI_SOMEIP_VERSION @PACKAGE_VERSION@) 12 | set(COMMONAPI_SOMEIP_VERSION_STRING "@PACKAGE_VERSION@") -------------------------------------------------------------------------------- /capicxx-someip-runtime/cmake/CommonAPI-SomeIPConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set (PACKAGE_VERSION "@PACKAGE_VERSION@") 2 | 3 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 4 | 5 | string(REPLACE "." "\\." ESCAPED_API_HEADER_VERSION "@COMMONAPI_API_HEADER_VERSION@") 6 | if("${PACKAGE_FIND_VERSION}" MATCHES "^${ESCAPED_API_HEADER_VERSION}($|\\.)") 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | endif() 9 | 10 | if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) 11 | set(PACKAGE_VERSION_EXACT TRUE) 12 | endif() 13 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/include/CommonAPI/SomeIP/CommonAPISomeIP.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef COMMONAPI_SOMEIP_HPP_ 7 | #define COMMONAPI_SOMEIP_HPP_ 8 | 9 | #ifndef COMMONAPI_INTERNAL_COMPILATION 10 | #define COMMONAPI_INTERNAL_COMPILATION 11 | #endif 12 | 13 | #include "AddressTranslator.hpp" 14 | 15 | #undef COMMONAPI_INTERNAL_COMPILATION 16 | 17 | #endif // COMMONAPI_SOMEIP_HPP_ 18 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/include/CommonAPI/SomeIP/Configuration.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef COMMONAPI_SOMEIP_CONFIGURATION_HPP_ 11 | #define COMMONAPI_SOMEIP_CONFIGURATION_HPP_ 12 | 13 | namespace CommonAPI { 14 | namespace SomeIP { 15 | 16 | struct FactoryConfig { 17 | bool useVirtualMode; 18 | }; 19 | 20 | } // namespace SomeIP 21 | } // namespace CommonAPI 22 | 23 | #endif // COMMONAPI_SOMEIP_CONFIGURATION_HPP_ 24 | 25 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/include/CommonAPI/SomeIP/Defines.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef COMMONAPI_SOMEIP_DEFINES_HPP_ 11 | #define COMMONAPI_SOMEIP_DEFINES_HPP_ 12 | 13 | namespace CommonAPI { 14 | namespace SomeIP { 15 | 16 | #define COMMONAPI_SOMEIP_APPLICATION_NAME "" 17 | 18 | } // namespace SomeIP 19 | } // namespace CommonAPI 20 | 21 | #endif // COMMONAPI_SOMEIP_DEFINES_HPP_ 22 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/include/CommonAPI/SomeIP/DispatchSource.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef DISPATCHSOURCE_HPP_ 11 | #define DISPATCHSOURCE_HPP_ 12 | 13 | #include 14 | #include "CommonAPI/MainLoopContext.hpp" 15 | #include 16 | 17 | namespace CommonAPI { 18 | namespace SomeIP { 19 | 20 | class Watch; 21 | 22 | class DispatchSource: public CommonAPI::DispatchSource { 23 | public: 24 | DispatchSource(Watch* watch); 25 | virtual ~DispatchSource(); 26 | 27 | bool prepare(int64_t& timeout); 28 | bool check(); 29 | bool dispatch(); 30 | 31 | private: 32 | Watch* watch_; 33 | 34 | std::mutex watchMutex_; 35 | }; 36 | 37 | } // namespace SomeIP 38 | } // namespace CommonAPI 39 | 40 | #endif /* DISPATCHSOURCE_HPP_ */ 41 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/include/CommonAPI/SomeIP/Helper.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef COMMONAPI_SOMEIP_HELPER_HPP_ 11 | #define COMMONAPI_SOMEIP_HELPER_HPP_ 12 | 13 | namespace CommonAPI { 14 | namespace SomeIP { 15 | 16 | template 17 | struct index_sequence {}; 18 | 19 | 20 | template 21 | struct make_sequence : make_sequence {}; 22 | 23 | template 24 | struct make_sequence<0, S_...> { 25 | typedef index_sequence type; 26 | }; 27 | 28 | 29 | template 30 | struct make_sequence_range : make_sequence_range {}; 31 | 32 | template 33 | struct make_sequence_range<0, Offset_, S_...> { 34 | typedef index_sequence type; 35 | }; 36 | 37 | } // namespace SomeIP 38 | } // namespace CommonAPI 39 | 40 | #endif // COMMONAPI_SOMEIP_HELPER_HPP_ 41 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/include/CommonAPI/SomeIP/InterfaceHandler.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef COMMONAPI_SOMEIP_INTERFACE_HANDLER_HPP_ 11 | #define COMMONAPI_SOMEIP_INTERFACE_HANDLER_HPP_ 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | namespace CommonAPI { 19 | namespace SomeIP { 20 | 21 | class InterfaceHandler { 22 | public: 23 | virtual ~InterfaceHandler() { } 24 | 25 | virtual bool onInterfaceMessage(const Message& message) = 0; 26 | }; 27 | 28 | } // namespace SomeIP 29 | } // namespace CommonAPI 30 | 31 | #endif // COMMONAPI_SOMEIP_INTERFACE_HANDLER_HPP_ 32 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/include/CommonAPI/SomeIP/StubManager.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 7 | #error "Only can be included directly, this file may disappear or change contents." 8 | #endif 9 | 10 | #ifndef COMMONAPI_SOMEIP_STUB_MANAGER_HPP_ 11 | #define COMMONAPI_SOMEIP_STUB_MANAGER_HPP_ 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | namespace CommonAPI { 19 | namespace SomeIP { 20 | 21 | class StubManager { 22 | public: 23 | StubManager(const std::shared_ptr& connection); 24 | virtual ~StubManager(); 25 | 26 | void registerStubAdapter(std::shared_ptr stubAdapter); 27 | void unregisterStubAdapter(std::shared_ptr stubAdapter); 28 | 29 | bool handleMessage(const Message&); 30 | 31 | private: 32 | std::weak_ptr connection_; 33 | std::map>> registeredStubAdapters_; 34 | std::mutex registeredStubAdaptersMutex_; 35 | }; 36 | 37 | } // namespace SomeIP 38 | } // namespace CommonAPI 39 | 40 | #endif // COMMONAPI_SOMEIP_STUB_MANAGER_HPP_ 41 | -------------------------------------------------------------------------------- /capicxx-someip-runtime/src/CommonAPI/SomeIP/DispatchSource.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace CommonAPI { 13 | namespace SomeIP { 14 | 15 | DispatchSource::DispatchSource(Watch* watch) : 16 | watch_(watch) { 17 | watch_->addDependentDispatchSource(this); 18 | } 19 | 20 | DispatchSource::~DispatchSource() { 21 | watch_->removeDependentDispatchSource(this); 22 | } 23 | 24 | bool DispatchSource::prepare(int64_t& timeout) { 25 | timeout = -1; 26 | return !watch_->emptyQueue(); 27 | } 28 | 29 | bool DispatchSource::check() { 30 | return !watch_->emptyQueue(); 31 | } 32 | 33 | bool DispatchSource::dispatch() { 34 | if (!watch_->emptyQueue()) { 35 | auto queueEntry = watch_->frontQueue(); 36 | watch_->popQueue(); 37 | watch_->processQueueEntry(queueEntry); 38 | } 39 | 40 | return !watch_->emptyQueue(); 41 | } 42 | 43 | } // namespace SomeIP 44 | } // namespace CommonAPI 45 | -------------------------------------------------------------------------------- /project/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | get_filename_component(RUNTIME_PATH ../ ABSOLUTE) 4 | message(STATUS ${RUNTIME_PATH}) 5 | 6 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++0x") 7 | include_directories( 8 | src-gen 9 | ${RUNTIME_PATH}/capicxx-core-runtime/include 10 | ${RUNTIME_PATH}/capicxx-someip-runtime/include 11 | ${RUNTIME_PATH}/vsomeip/interface 12 | ) 13 | link_directories( 14 | ${RUNTIME_PATH}/capicxx-core-runtime/build 15 | ${RUNTIME_PATH}/capicxx-someip-runtime/build 16 | ${RUNTIME_PATH}/vsomeip/build 17 | ) 18 | add_executable(client 19 | src/Client.cpp 20 | ./src-gen/v1/com/microchip/IDemoSomeIPProxy.cpp 21 | ./src-gen/v1/com/microchip/IDemoSomeIPDeployment.cpp 22 | ) 23 | target_link_libraries(client CommonAPI CommonAPI-SomeIP vsomeip) 24 | 25 | add_executable(service 26 | ./src/Service.cpp 27 | ./src/IDemoStubImpl.cpp 28 | ./src-gen/v1/com/microchip/IDemoStubDefault.cpp 29 | ./src-gen/v1/com/microchip/IDemoSomeIPStubAdapter.cpp 30 | ./src-gen/v1/com/microchip/IDemoSomeIPDeployment.cpp 31 | ) 32 | target_link_libraries(service CommonAPI CommonAPI-SomeIP vsomeip) 33 | -------------------------------------------------------------------------------- /project/cgen/commonapi-generator.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/some-ip/b1ab3161f38c4db498c16b1dd478693b17b994f9/project/cgen/commonapi-generator.zip -------------------------------------------------------------------------------- /project/cgen/commonapi_someip_generator.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/some-ip/b1ab3161f38c4db498c16b1dd478693b17b994f9/project/cgen/commonapi_someip_generator.zip -------------------------------------------------------------------------------- /project/config/vsomeip-client.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "10.40.32.100", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : { "enable" : "false", "path" : "vsomeip.log" }, 9 | "dlt" : "false" 10 | }, 11 | "applications" : 12 | [ 13 | { 14 | "name" : "client-sample", 15 | "id" : "0x2000" 16 | } 17 | ], 18 | 19 | "routing" : "client-sample", 20 | "service-discovery" : 21 | { 22 | "enable" : "true", 23 | "multicast" : "224.244.224.245", 24 | "port" : "30490", 25 | "protocol" : "udp" 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /project/config/vsomeip-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "10.40.32.64", 3 | "logging" : 4 | { 5 | "level" : "trace", 6 | "console" : "true", 7 | "file" : { "enable" : "false" }, 8 | "dlt" : "false" 9 | }, 10 | "applications" : 11 | [ 12 | { 13 | "name" : "service-sample", 14 | "id" : "0x1000" 15 | } 16 | ], 17 | "services" : 18 | [ 19 | { 20 | "service" : "0x10", 21 | "instance" : "22136", 22 | "reliable" : { "port" : "30509", "enable-magic-cookies" : "false" }, 23 | "unreliable": "31000" 24 | } 25 | ], 26 | "routing" : "service-sample", 27 | "service-discovery" : 28 | { 29 | "enable" : "true", 30 | "multicast" : "224.244.224.245", 31 | "port" : "30490", 32 | "protocol" : "udp" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /project/fidl/Demo.fdepl: -------------------------------------------------------------------------------- 1 | import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl" 2 | import "Demo.fidl" 3 | 4 | 5 | define org.genivi.commonapi.someip.deployment for interface com.microchip.IDemo { 6 | 7 | SomeIpServiceID = 16 8 | 9 | attribute attribBool { 10 | SomeIpGetterID = 30 11 | SomeIpSetterID = 31 12 | SomeIpNotifierID = 32 13 | SomeIpEventGroups = { 7000 } 14 | } 15 | 16 | 17 | method GetAttrib { 18 | SomeIpMethodID = 90 19 | } 20 | 21 | method SetAttrib { 22 | SomeIpMethodID = 91 23 | } 24 | 25 | broadcast Status { 26 | SomeIpEventID = 33000 27 | SomeIpEventGroups = { 33000 } 28 | } 29 | 30 | } 31 | 32 | 33 | define org.genivi.commonapi.someip.deployment for provider Service { 34 | instance com.microchip.IDemo { 35 | InstanceId = "com.microchip.demo" 36 | SomeIpInstanceID = 22136 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /project/fidl/Demo.fidl: -------------------------------------------------------------------------------- 1 | package com.microchip 2 | 3 | <** @description : Typecollection **> 4 | typeCollection CustomTypes{ 5 | version {major 1 minor 0} 6 | 7 | <** @description : **> 8 | struct attribStruct 9 | { 10 | UInt8 attribX 11 | UInt8 attribY 12 | UInt16 attribZ 13 | } 14 | } 15 | 16 | <** @description : Interface to be implemented by server **> 17 | interface IDemo 18 | { 19 | version {major 1 minor 0} 20 | 21 | attribute Boolean attribBool 22 | 23 | <** @description : Error handling **> 24 | enumeration GenericErrors 25 | { 26 | Error 27 | Success 28 | } 29 | 30 | 31 | <** @description : Retrieve Attrib **> 32 | method GetAttrib 33 | { 34 | out 35 | { 36 | Boolean data 37 | } 38 | 39 | error GenericErrors 40 | } 41 | 42 | <** @description : Set Attrib **> 43 | method SetAttrib 44 | { 45 | in 46 | { 47 | Boolean value 48 | } 49 | 50 | error GenericErrors 51 | } 52 | 53 | <** @description : Broadcast for notifing client **> 54 | broadcast Status 55 | { 56 | out { 57 | String Message 58 | } 59 | } 60 | 61 | 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /project/gen_src.sh: -------------------------------------------------------------------------------- 1 | ./cgen/commonapi-generator/commonapi-generator-linux-x86_64 -sk ./fidl/Demo.fidl 2 | ./cgen/commonapi_someip_generator/commonapi-someip-generator-linux-x86_64 ./fidl/Demo.fdepl 3 | -------------------------------------------------------------------------------- /project/script/client.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo route add -net 224.0.0.0/4 dev eth0 4 | COMMONAPI_PATH=../../capicxx-core-runtime/build 5 | COMMONAPI_SOMEIP_PATH=../../capicxx-someip-runtime/build 6 | VSOMEIP_PATH=../../vsomeip/build 7 | export LD_LIBRARY_PATH=../lib:${COMMONAPI_PATH}:${COMMONAPI_SOMEIP_PATH}:${VSOMEIP_PATH}:$LD_LIBRARY_PATH 8 | export VSOMEIP_APPLICATION_NAME=client-sample 9 | export VSOMEIP_CONFIGURATION=../config/vsomeip-client.json 10 | ../build/client 11 | -------------------------------------------------------------------------------- /project/script/service.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo route add -net 224.0.0.0/4 dev eth0 4 | COMMONAPI_PATH=../../capicxx-core-runtime/build 5 | COMMONAPI_SOMEIP_PATH=../../capicxx-someip-runtime/build 6 | VSOMEIP_PATH=../../vsomeip/build 7 | export LD_LIBRARY_PATH=${COMMONAPI_PATH}:${COMMONAPI_SOMEIP_PATH}:${VSOMEIP_PATH}:$LD_LIBRARY_PATH 8 | export VSOMEIP_APPLICATION_NAME=service-sample 9 | export VSOMEIP_CONFIGURATION=../config/vsomeip-service.json 10 | ../build/service 11 | -------------------------------------------------------------------------------- /project/src-gen/v1/com/microchip/CustomTypesSomeIPDeployment.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This file was generated by the CommonAPI Generators. 4 | * Used org.genivi.commonapi.someip 3.1.12.v201801251434. 5 | * Used org.franca.core 0.9.1.201412191134. 6 | * 7 | * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 8 | * If a copy of the MPL was not distributed with this file, You can obtain one at 9 | * http://mozilla.org/MPL/2.0/. 10 | */ 11 | #include 12 | 13 | namespace v1 { 14 | namespace com { 15 | namespace microchip { 16 | namespace CustomTypes_ { 17 | 18 | // typecollection-specific deployments 19 | 20 | } // namespace CustomTypes_ 21 | } // namespace microchip 22 | } // namespace com 23 | } // namespace v1 24 | -------------------------------------------------------------------------------- /project/src-gen/v1/com/microchip/CustomTypesSomeIPDeployment.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the CommonAPI Generators. 3 | * Used org.genivi.commonapi.someip 3.1.12.v201801251434. 4 | * Used org.franca.core 0.9.1.201412191134. 5 | * 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 7 | * If a copy of the MPL was not distributed with this file, You can obtain one at 8 | * http://mozilla.org/MPL/2.0/. 9 | */ 10 | 11 | #ifndef V1_COM_MICROCHIP_CUSTOM_TYPES_SOMEIP_DEPLOYMENT_HPP_ 12 | #define V1_COM_MICROCHIP_CUSTOM_TYPES_SOMEIP_DEPLOYMENT_HPP_ 13 | 14 | 15 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 16 | #define COMMONAPI_INTERNAL_COMPILATION 17 | #endif 18 | #include 19 | #undef COMMONAPI_INTERNAL_COMPILATION 20 | 21 | namespace v1 { 22 | namespace com { 23 | namespace microchip { 24 | namespace CustomTypes_ { 25 | 26 | // typecollection-specific deployment types 27 | typedef CommonAPI::SomeIP::StructDeployment< 28 | CommonAPI::SomeIP::IntegerDeployment, 29 | CommonAPI::SomeIP::IntegerDeployment, 30 | CommonAPI::SomeIP::IntegerDeployment 31 | > attribStructDeployment_t; 32 | 33 | 34 | // typecollection-specific deployments 35 | 36 | } // namespace CustomTypes_ 37 | } // namespace microchip 38 | } // namespace com 39 | } // namespace v1 40 | 41 | #endif // V1_COM_MICROCHIP_CUSTOM_TYPES_SOMEIP_DEPLOYMENT_HPP_ 42 | -------------------------------------------------------------------------------- /project/src-gen/v1/com/microchip/IDemoSomeIPDeployment.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the CommonAPI Generators. 3 | * Used org.genivi.commonapi.someip 3.1.12.v201801251434. 4 | * Used org.franca.core 0.9.1.201412191134. 5 | * 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 7 | * If a copy of the MPL was not distributed with this file, You can obtain one at 8 | * http://mozilla.org/MPL/2.0/. 9 | */ 10 | #include 11 | 12 | namespace v1 { 13 | namespace com { 14 | namespace microchip { 15 | namespace IDemo_ { 16 | 17 | // Type-specific deployments 18 | 19 | // Attribute-specific deployments 20 | 21 | // Argument-specific deployment 22 | 23 | // Broadcast-specific deployments 24 | 25 | } // namespace IDemo_ 26 | } // namespace microchip 27 | } // namespace com 28 | } // namespace v1 29 | -------------------------------------------------------------------------------- /project/src-gen/v1/com/microchip/IDemoSomeIPDeployment.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the CommonAPI Generators. 3 | * Used org.genivi.commonapi.someip 3.1.12.v201801251434. 4 | * Used org.franca.core 0.9.1.201412191134. 5 | * 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. 7 | * If a copy of the MPL was not distributed with this file, You can obtain one at 8 | * http://mozilla.org/MPL/2.0/. 9 | */ 10 | 11 | #ifndef V1_COM_MICROCHIP_I_Demo_SOMEIP_DEPLOYMENT_HPP_ 12 | #define V1_COM_MICROCHIP_I_Demo_SOMEIP_DEPLOYMENT_HPP_ 13 | 14 | 15 | #if !defined (COMMONAPI_INTERNAL_COMPILATION) 16 | #define COMMONAPI_INTERNAL_COMPILATION 17 | #endif 18 | #include 19 | #undef COMMONAPI_INTERNAL_COMPILATION 20 | 21 | namespace v1 { 22 | namespace com { 23 | namespace microchip { 24 | namespace IDemo_ { 25 | 26 | // Interface-specific deployment types 27 | typedef CommonAPI::SomeIP::EnumerationDeployment GenericErrorsDeployment_t; 28 | 29 | // Type-specific deployments 30 | 31 | // Attribute-specific deployments 32 | 33 | // Argument-specific deployment 34 | 35 | // Broadcast-specific deployments 36 | 37 | } // namespace IDemo_ 38 | } // namespace microchip 39 | } // namespace com 40 | } // namespace v1 41 | 42 | #endif // V1_COM_MICROCHIP_I_Demo_SOMEIP_DEPLOYMENT_HPP_ 43 | -------------------------------------------------------------------------------- /project/src/IDemoStubImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "IDemoStubImpl.hpp" 2 | 3 | 4 | IDemoStubImpl::IDemoStubImpl(){ 5 | std::cout << "Starting demo service" << std::endl; 6 | } 7 | 8 | void IDemoStubImpl::GetAttrib(const std::shared_ptr _client, GetAttribReply_t _reply) { 9 | _reply(v1::com::microchip::IDemo::GenericErrors::Success, getAttribBoolAttribute()); 10 | } 11 | 12 | void IDemoStubImpl::SetAttrib(const std::shared_ptr _client, bool _value, SetAttribReply_t _reply) { 13 | setAttribBoolAttribute(_value); 14 | _reply(v1::com::microchip::IDemo::GenericErrors::Success); 15 | } 16 | 17 | 18 | IDemoStubImpl::~IDemoStubImpl() { 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /project/src/IDemoStubImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef IVIDEOWINDOWSTUBIMPL_H_ 2 | #define IVIDEOWINDOWSTUBIMPL_H_ 3 | #include 4 | 5 | class IDemoStubImpl : public v1::com::microchip::IDemoStubDefault { 6 | public: 7 | /* 8 | * description: 9 | * constructor 10 | */ 11 | IDemoStubImpl(); 12 | /* 13 | * description: 14 | * Retrieve Attrib 15 | */ 16 | virtual void GetAttrib(const std::shared_ptr _client, GetAttribReply_t _reply); 17 | /* 18 | * description: 19 | * Set Attrib 20 | */ 21 | virtual void SetAttrib(const std::shared_ptr _client, bool _value, SetAttribReply_t _reply); 22 | /* 23 | * description: 24 | * Destructor 25 | */ 26 | virtual ~IDemoStubImpl(); 27 | 28 | }; 29 | 30 | #endif /*IVIDEOWINDOWSTUBIMPL_H_ */ 31 | -------------------------------------------------------------------------------- /vsomeip/AUTHORS: -------------------------------------------------------------------------------- 1 | Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -------------------------------------------------------------------------------- /vsomeip/LICENSE_boost: -------------------------------------------------------------------------------- 1 | This license applies to all files in directory implementation/helper/boost: 2 | 3 | Boost Software License - Version 1.0 - August 17th, 2003 4 | 5 | Permission is hereby granted, free of charge, to any person or organization 6 | obtaining a copy of the software and accompanying documentation covered by 7 | this license (the "Software") to use, reproduce, display, distribute, 8 | execute, and transmit the Software, and to prepare derivative works of the 9 | Software, and to permit third-parties to whom the Software is furnished to 10 | do so, all subject to the following: 11 | 12 | The copyright notices in the Software and this entire statement, including 13 | the above license grant, this restriction and the following disclaimer, 14 | must be included in all copies of the Software, in whole or in part, and 15 | all derivative works of the Software, unless such copies or derivative 16 | works are solely in the form of machine-executable object code generated by 17 | a source language processor. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /vsomeip/config/vsomeip-tcp-client.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "192.168.56.101", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "info", 7 | "console" : "true", 8 | "file" : { "enable" : "true", "path" : "/var/log/vsomeip.log" }, 9 | "dlt" : "true" 10 | }, 11 | "applications" : 12 | [ 13 | { 14 | "name" : "client-sample", 15 | "id" : "0x1343" 16 | }, 17 | { 18 | "name" : "second-client-sample", 19 | "id" : "0x1344" 20 | }, 21 | { 22 | "name" : "third-client-sample", 23 | "id" : "0x1345" 24 | }, 25 | { 26 | "name" : "fourth-client-sample", 27 | "id" : "0x1346" 28 | } 29 | ], 30 | "clients" : 31 | [ 32 | { 33 | "service" : "0x1234", 34 | "instance" : "0x5678", 35 | "reliable" : [ "41234" ] 36 | } 37 | ], 38 | "routing" : "client-sample", 39 | "service-discovery" : 40 | { 41 | "enable" : "true", 42 | "multicast" : "224.244.224.245", 43 | "port" : "30490", 44 | "protocol" : "udp", 45 | "initial_delay_min" : "10", 46 | "initial_delay_max" : "100", 47 | "repetitions_base_delay" : "200", 48 | "repetitions_max" : "3", 49 | "ttl" : "3", 50 | "cyclic_offer_delay" : "2000", 51 | "request_response_delay" : "1500" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vsomeip/config/vsomeip-udp-client.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "192.168.56.101", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : { "enable" : "true", "path" : "/var/log/vsomeip.log" }, 9 | "dlt" : "true" 10 | }, 11 | "applications" : 12 | [ 13 | { 14 | "name" : "client-sample", 15 | "id" : "0x1343" 16 | }, 17 | { 18 | "name" : "second-client-sample", 19 | "id" : "0x1344" 20 | }, 21 | { 22 | "name" : "third-client-sample", 23 | "id" : "0x1345" 24 | }, 25 | { 26 | "name" : "fourth-client-sample", 27 | "id" : "0x1346" 28 | } 29 | ], 30 | "clients" : 31 | [ 32 | { 33 | "service" : "0x1234", 34 | "instance" : "0x5678", 35 | "unreliable" : [ 40000, 40002 ] 36 | } 37 | ], 38 | "routing" : "client-sample", 39 | "service-discovery" : 40 | { 41 | "enable" : "true", 42 | "multicast" : "224.244.224.245", 43 | "port" : "30490", 44 | "protocol" : "udp", 45 | "initial_delay_min" : "10", 46 | "initial_delay_max" : "100", 47 | "repetitions_base_delay" : "200", 48 | "repetitions_max" : "3", 49 | "ttl" : "3", 50 | "cyclic_offer_delay" : "2000", 51 | "request_response_delay" : "1500" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vsomeip/daemon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | # This Source Code Form is subject to the terms of the Mozilla Public 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | cmake_minimum_required (VERSION 2.8) 7 | 8 | # Daemon 9 | add_executable(vsomeipd vsomeipd.cpp) 10 | target_link_libraries(vsomeipd vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY} ${DLT_LIBRARIES}) 11 | 12 | install ( 13 | TARGETS vsomeipd 14 | RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin 15 | ) 16 | 17 | ################################################################################################### 18 | -------------------------------------------------------------------------------- /vsomeip/documentation/multicast.txt: -------------------------------------------------------------------------------- 1 | To use IP multicast, the route must be added. In Linux this can be done 2 | by: 3 | 4 | # route add -net 224.0.0.0/4 dev eth0 5 | 6 | Other OSes may have different ways to do this. 7 | -------------------------------------------------------------------------------- /vsomeip/documentation/todo.txt: -------------------------------------------------------------------------------- 1 | TODO: 2 | 3 | - update the EA model to match the current implementation 4 | -------------------------------------------------------------------------------- /vsomeip/documentation/vsomeip.eap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/some-ip/b1ab3161f38c4db498c16b1dd478693b17b994f9/vsomeip/documentation/vsomeip.eap -------------------------------------------------------------------------------- /vsomeip/examples/hello_world/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | # This Source Code Form is subject to the terms of the Mozilla Public 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | cmake_minimum_required (VERSION 2.8.7) 7 | project (vSomeIPHelloWorld) 8 | 9 | # This will get us acces to 10 | # VSOMEIP_INCLUDE_DIRS - include directories for vSomeIP 11 | # VSOMEIP_LIBRARIES - libraries to link against 12 | find_package(vsomeip) 13 | if (NOT vsomeip_FOUND) 14 | message("vsomeip was not found. Please specify vsomeip_DIR") 15 | endif() 16 | 17 | find_package(Threads REQUIRED) 18 | 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 20 | 21 | include_directories(${VSOMEIP_INCLUDE_DIRS}) 22 | 23 | add_executable (hello_world_service hello_world_service.cpp) 24 | target_link_libraries(hello_world_service ${VSOMEIP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) 25 | 26 | add_executable (hello_world_client hello_world_client.cpp) 27 | target_link_libraries(hello_world_client ${VSOMEIP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) 28 | -------------------------------------------------------------------------------- /vsomeip/examples/hello_world/helloworld-local.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"134.86.56.94", 3 | "logging": 4 | { 5 | "level":"debug", 6 | "console":"true" 7 | }, 8 | 9 | "applications": 10 | [ 11 | { 12 | "name":"hello_world_service", 13 | "id":"0x4444" 14 | }, 15 | 16 | { 17 | "name":"hello_world_client", 18 | "id":"0x5555" 19 | } 20 | ], 21 | 22 | "services": 23 | [ 24 | { 25 | "service":"0x1111", 26 | "instance":"0x2222", 27 | "unreliable":"30509" 28 | } 29 | ], 30 | 31 | "routing":"hello_world_service", 32 | "service-discovery": 33 | { 34 | "enable":"false" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vsomeip/examples/readme.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | # This Source Code Form is subject to the terms of the Mozilla Public 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | To use the example applications you need two devices on the same network. The network addresses within 7 | the configuration files need to be adapted to match the devices addresses. 8 | 9 | To start the request/response-example from the build-directory do: 10 | 11 | HOST1: env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./request-sample 12 | HOST1: env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./response-sample 13 | 14 | To start the subscribe/notify-example from the build-directory do: 15 | 16 | HOST1: env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./subscribe-sample 17 | HOST1: env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./notify-sample 18 | -------------------------------------------------------------------------------- /vsomeip/examples/sample-ids.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_EXAMPLES_SAMPLE_IDS_HPP 7 | #define VSOMEIP_EXAMPLES_SAMPLE_IDS_HPP 8 | 9 | #define SAMPLE_SERVICE_ID 0x1234 10 | #define SAMPLE_INSTANCE_ID 0x5678 11 | #define SAMPLE_METHOD_ID 0x0421 12 | 13 | #define SAMPLE_EVENT_ID 0x8778 14 | #define SAMPLE_GET_METHOD_ID 0x0001 15 | #define SAMPLE_SET_METHOD_ID 0x0002 16 | 17 | #define SAMPLE_EVENTGROUP_ID 0x4465 18 | 19 | #define OTHER_SAMPLE_SERVICE_ID 0x0248 20 | #define OTHER_SAMPLE_INSTANCE_ID 0x5422 21 | #define OTHER_SAMPLE_METHOD_ID 0x1421 22 | 23 | #endif // VSOMEIP_EXAMPLES_SAMPLE_IDS_HPP 24 | -------------------------------------------------------------------------------- /vsomeip/implementation/configuration/include/client.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_CFG_CLIENT_HPP 7 | #define VSOMEIP_CFG_CLIENT_HPP 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | namespace vsomeip { 16 | namespace cfg { 17 | 18 | struct client { 19 | client() : service_(ANY_SERVICE), instance_(ANY_INSTANCE) {} 20 | 21 | // ports for specific service / instance 22 | service_t service_; 23 | instance_t instance_; 24 | std::map > ports_; 25 | 26 | // client port ranges mapped to remote port ranges 27 | std::map > remote_ports_; 28 | std::map > client_ports_; 29 | }; 30 | 31 | } // namespace cfg 32 | } // namespace vsomeip 33 | 34 | #endif // VSOMEIP_CFG_CLIENT_HPP 35 | -------------------------------------------------------------------------------- /vsomeip/implementation/configuration/include/event.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_CFG_EVENT_HPP 7 | #define VSOMEIP_CFG_EVENT_HPP 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | namespace vsomeip { 15 | namespace cfg { 16 | 17 | struct eventgroup; 18 | 19 | struct event { 20 | event(event_t _id, bool _is_field, bool _is_reliable) 21 | : id_(_id), is_field_(_is_field), is_reliable_(_is_reliable) { 22 | } 23 | 24 | event_t id_; 25 | bool is_field_; 26 | bool is_reliable_; 27 | std::vector > groups_; 28 | }; 29 | 30 | } // namespace cfg 31 | } // namespace vsomeip 32 | 33 | #endif // VSOMEIP_CFG_EVENT_HPP 34 | -------------------------------------------------------------------------------- /vsomeip/implementation/configuration/include/eventgroup.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_CFG_EVENTGROUP_HPP 7 | #define VSOMEIP_CFG_EVENTGROUP_HPP 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace vsomeip { 14 | namespace cfg { 15 | 16 | struct event; 17 | 18 | struct eventgroup { 19 | eventgroup_t id_; 20 | std::set > events_; 21 | std::string multicast_address_; 22 | uint16_t multicast_port_; 23 | uint8_t threshold_; 24 | }; 25 | 26 | } // namespace cfg 27 | } // namespace vsomeip 28 | 29 | #endif // VSOMEIP_CFG_EVENTGROUP_HPP 30 | -------------------------------------------------------------------------------- /vsomeip/implementation/configuration/include/policy.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_CFG_POLICY_HPP 7 | #define VSOMEIP_CFG_POLICY_HPP 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | namespace vsomeip { 15 | namespace cfg { 16 | 17 | typedef std::set> ranges_t; 18 | typedef std::set> ids_t; 19 | 20 | struct policy { 21 | policy() : allow_who_(false), allow_what_(false) {}; 22 | 23 | ids_t ids_; 24 | bool allow_who_; 25 | 26 | std::set> services_; 27 | std::set> offers_; 28 | bool allow_what_; 29 | }; 30 | 31 | } // namespace cfg 32 | } // namespace vsomeip 33 | 34 | #endif // VSOMEIP_CFG_POLICY_HPP 35 | -------------------------------------------------------------------------------- /vsomeip/implementation/configuration/include/service.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_CFG_SERVICE_HPP 7 | #define VSOMEIP_CFG_SERVICE_HPP 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace vsomeip { 14 | namespace cfg { 15 | 16 | struct event; 17 | struct eventgroup; 18 | 19 | struct service { 20 | service_t service_; 21 | instance_t instance_; 22 | 23 | std::string unicast_address_; 24 | 25 | uint16_t reliable_; 26 | uint16_t unreliable_; 27 | 28 | std::string multicast_address_; 29 | uint16_t multicast_port_; 30 | 31 | std::string protocol_; 32 | 33 | std::shared_ptr group_; 34 | std::map > events_; 35 | std::map > eventgroups_; 36 | }; 37 | 38 | } // namespace cfg 39 | } // namespace vsomeip 40 | 41 | #endif // VSOMEIP_CFG_SERVICE_HPP 42 | -------------------------------------------------------------------------------- /vsomeip/implementation/configuration/include/service_instance_range.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_CFG_SERVICE_INSTANCE_RANGE_HPP 7 | #define VSOMEIP_CFG_SERVICE_INSTANCE_RANGE_HPP 8 | 9 | #include 10 | 11 | namespace vsomeip { 12 | namespace cfg { 13 | 14 | struct service_instance_range { 15 | service_t first_service_; 16 | service_t last_service_; 17 | instance_t first_instance_; 18 | instance_t last_instance_; 19 | }; 20 | 21 | } 22 | } 23 | 24 | #endif // VSOMEIP_CFG_SERVICE_INSTANCE_RANGE_HPP 25 | -------------------------------------------------------------------------------- /vsomeip/implementation/configuration/include/watchdog.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | #ifndef VSOMEIP_CFG_WATCHDOG_HPP_ 6 | #define VSOMEIP_CFG_WATCHDOG_HPP_ 7 | 8 | namespace vsomeip { 9 | namespace cfg { 10 | 11 | struct watchdog { 12 | watchdog() 13 | : is_enabeled_(false), 14 | timeout_in_ms_(VSOMEIP_DEFAULT_WATCHDOG_TIMEOUT), 15 | missing_pongs_allowed_(VSOMEIP_DEFAULT_MAX_MISSING_PONGS) { 16 | } 17 | 18 | bool is_enabeled_; 19 | uint32_t timeout_in_ms_; 20 | uint32_t missing_pongs_allowed_; 21 | }; 22 | 23 | } // namespace cfg 24 | } // namespace vsomeip 25 | 26 | #endif /* VSOMEIP_CFG_WATCHDOG_HPP_ */ 27 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/crc/crc.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_CRC_HPP 7 | #define VSOMEIP_E2E_CRC_HPP 8 | 9 | #include 10 | #include "../buffer/buffer.hpp" 11 | 12 | namespace vsomeip { 13 | 14 | class e2e_crc { 15 | public: 16 | static uint8_t calculate_profile_01(buffer_view _buffer_view, 17 | const uint8_t _start_value = 0x00U); 18 | static uint32_t calculate_profile_04(buffer_view _buffer_view, 19 | const uint32_t _start_value = 0x00000000U); 20 | 21 | static uint32_t calculate_profile_custom(buffer_view _buffer_view); 22 | 23 | private: 24 | static const uint8_t lookup_table_profile_01_[256]; 25 | static const uint32_t lookup_table_profile_04_[256]; 26 | static const uint32_t lookup_table_profile_custom_[256]; 27 | 28 | }; 29 | 30 | } // namespace vsomeip 31 | 32 | #endif // VSOMEIP_E2E_CRC_HPP 33 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2e/profile/profile01/checker.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_PROFILE01_CHECKER_HPP 7 | #define VSOMEIP_E2E_PROFILE01_CHECKER_HPP 8 | 9 | #include "../profile01/profile_01.hpp" 10 | #include "../profile_interface/checker.hpp" 11 | 12 | namespace vsomeip { 13 | namespace e2e { 14 | namespace profile01 { 15 | 16 | class profile_01_checker final : public e2e::profile_interface::checker { 17 | 18 | public: 19 | profile_01_checker(void) = delete; 20 | 21 | // [SWS_E2E_00389] initialize state 22 | explicit profile_01_checker(const profile_config &_config) : 23 | config_(_config) {} 24 | 25 | virtual void check(const e2e_buffer &_buffer, 26 | e2e::profile_interface::generic_check_status &_generic_check_status) override final; 27 | 28 | private: 29 | profile_config config_; 30 | std::mutex check_mutex_; 31 | 32 | }; 33 | 34 | } // namespace profile01 35 | } // namespace e2e 36 | } // namespace vsomeip 37 | 38 | #endif // VSOMEIP_E2E_PROFILE01_CHECKER_HPP 39 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_PROFILE01_PROTECTOR_HPP 7 | #define VSOMEIP_E2E_PROFILE01_PROTECTOR_HPP 8 | 9 | #include 10 | #include "../profile01/profile_01.hpp" 11 | #include "../profile_interface/protector.hpp" 12 | 13 | namespace vsomeip { 14 | namespace e2e { 15 | namespace profile01 { 16 | 17 | class protector final : public e2e::profile_interface::protector { 18 | public: 19 | protector(void) = delete; 20 | 21 | explicit protector(const profile_config &_config) : config_(_config), counter_(0){}; 22 | 23 | void protect(e2e_buffer &_buffer) override final; 24 | 25 | private: 26 | 27 | void write_counter(e2e_buffer &_buffer); 28 | 29 | void write_data_id(e2e_buffer &_buffer); 30 | 31 | void write_crc(e2e_buffer &_buffer, uint8_t _computed_crc); 32 | 33 | void increment_counter(void); 34 | 35 | 36 | private: 37 | profile_config config_; 38 | uint8_t counter_; 39 | std::mutex protect_mutex_; 40 | }; 41 | 42 | } // namespace profile01 43 | } // namespace e2e 44 | } // namespace vsomeip 45 | 46 | #endif // VSOMEIP_E2E_PROFILE01_PROTECTOR_HPP 47 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2e/profile/profile_custom/checker.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_PROFILE_CUSTOM_CHECKER_HPP 7 | #define VSOMEIP_E2E_PROFILE_CUSTOM_CHECKER_HPP 8 | 9 | #include "../profile_custom/profile_custom.hpp" 10 | #include "../profile_interface/checker.hpp" 11 | #include 12 | 13 | namespace vsomeip { 14 | namespace e2e { 15 | namespace profile_custom { 16 | 17 | class profile_custom_checker final : public vsomeip::e2e::profile_interface::checker { 18 | 19 | public: 20 | profile_custom_checker(void) = delete; 21 | 22 | explicit profile_custom_checker(const vsomeip::e2e::profile_custom::profile_config &_config) : 23 | config_(_config) {} 24 | 25 | virtual void check(const e2e_buffer &_buffer, 26 | vsomeip::e2e::profile_interface::generic_check_status &_generic_check_status); 27 | 28 | private: 29 | uint32_t read_crc(const e2e_buffer &_buffer) const; 30 | 31 | private: 32 | profile_config config_; 33 | std::mutex check_mutex_; 34 | 35 | }; 36 | 37 | } // namespace profile_custom 38 | } // namespace e2e 39 | } // namespace vsomeip 40 | 41 | #endif // VSOMEIP_E2E_PROFILE_CUSTOM_CHECKER_HPP 42 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2e/profile/profile_custom/profile_custom.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_PROFILE_CUSTOM_PROFILE_CUSTOM_HPP 7 | #define VSOMEIP_E2E_PROFILE_CUSTOM_PROFILE_CUSTOM_HPP 8 | 9 | #include 10 | #include "../../../buffer/buffer.hpp" 11 | 12 | namespace vsomeip { 13 | namespace e2e { 14 | namespace profile_custom { 15 | 16 | struct profile_config; 17 | 18 | class profile_custom { 19 | public: 20 | static uint32_t compute_crc(const profile_config &_config, const e2e_buffer &_buffer); 21 | 22 | static bool is_buffer_length_valid(const profile_config &_config, const e2e_buffer &_buffer); 23 | }; 24 | 25 | struct profile_config { 26 | uint16_t crc_offset_; 27 | 28 | profile_config() = delete; 29 | 30 | profile_config(uint16_t _crc_offset) 31 | : crc_offset_(_crc_offset) { 32 | } 33 | profile_config(const profile_config &_config) = default; 34 | profile_config &operator=(const profile_config &_config) = default; 35 | }; 36 | 37 | } // namespace profile_custom 38 | } // namespace e2e 39 | } // namespace vsomeip 40 | 41 | #endif // VSOMEIP_E2E_PROFILE_CUSTOM_PROFILE_CUSTOM_HPP 42 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2e/profile/profile_custom/protector.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_PROFILE_CUSTOM_PROTECTOR_HPP 7 | #define VSOMEIP_E2E_PROFILE_CUSTOM_PROTECTOR_HPP 8 | 9 | #include 10 | #include "../profile_custom/profile_custom.hpp" 11 | #include "../profile_interface/protector.hpp" 12 | 13 | namespace vsomeip { 14 | namespace e2e { 15 | namespace profile_custom { 16 | 17 | class protector final : public vsomeip::e2e::profile_interface::protector { 18 | public: 19 | protector(void) = delete; 20 | 21 | explicit protector(const profile_config &_config) : config_(_config){}; 22 | 23 | void protect(e2e_buffer &_buffer) override final; 24 | 25 | private: 26 | 27 | void write_crc(e2e_buffer &_buffer, uint32_t _computed_crc); 28 | 29 | private: 30 | profile_config config_; 31 | std::mutex protect_mutex_; 32 | }; 33 | 34 | } // namespace profile_custom 35 | } // namespace e2e 36 | } // namespace vsomeip 37 | 38 | #endif // VSOMEIP_E2E_PROFILE_CUSTOM_PROTECTOR_HPP 39 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2e/profile/profile_interface/checker.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_PROFILE_INTERFACE_CHECKER_HPP 7 | #define VSOMEIP_E2E_PROFILE_INTERFACE_CHECKER_HPP 8 | 9 | #include "../profile_interface/profile_interface.hpp" 10 | #include "../../../buffer/buffer.hpp" 11 | #include 12 | 13 | namespace vsomeip { 14 | namespace e2e { 15 | namespace profile_interface { 16 | 17 | class checker : public profile_interface { 18 | public: 19 | virtual void check(const e2e_buffer &_buffer, 20 | vsomeip::e2e::profile_interface::generic_check_status &_generic_check_status) = 0; 21 | }; 22 | 23 | } // namespace profile_interface 24 | } // namespace e2e 25 | } // namespace vsomeip 26 | 27 | #endif // VSOMEIP_E2E_PROFILE_INTERFACE_CHECKER_HPP 28 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2e/profile/profile_interface/profile_interface.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_PROFILE_INTERFACE_PROFILE_INTERFACE_HPP 7 | #define VSOMEIP_E2E_PROFILE_INTERFACE_PROFILE_INTERFACE_HPP 8 | 9 | #include 10 | 11 | namespace vsomeip { 12 | namespace e2e { 13 | namespace profile_interface { 14 | 15 | enum class generic_check_status : uint8_t { E2E_OK, E2E_WRONG_CRC, E2E_ERROR}; 16 | 17 | class profile_interface { 18 | public: 19 | virtual ~profile_interface() { 20 | } 21 | }; 22 | 23 | } // namespace profile_interface 24 | } // namespace e2e 25 | } // namespace vsomeip 26 | 27 | #endif // VSOMEIP_E2E_PROFILE_INTERFACE_PROFILE_INTERFACE_HPP 28 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2e/profile/profile_interface/protector.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2E_PROFILE_INTERFACE_PROTECTOR_HPP 7 | #define VSOMEIP_E2E_PROFILE_INTERFACE_PROTECTOR_HPP 8 | 9 | #include "../../../buffer/buffer.hpp" 10 | #include "../profile_interface/profile_interface.hpp" 11 | 12 | namespace vsomeip { 13 | namespace e2e { 14 | namespace profile_interface { 15 | 16 | class protector : public profile_interface { 17 | public: 18 | virtual void protect(e2e_buffer &_buffer) = 0; 19 | }; 20 | 21 | } // namespace profile_interface 22 | } // namespace e2e 23 | } // namespace vsomeip 24 | 25 | #endif // VSOMEIP_E2E_PROFILE_INTERFACE_PROTECTOR_HPP 26 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/include/e2exf/config.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_E2EXF_CONFIG_HPP 7 | #define VSOMEIP_E2EXF_CONFIG_HPP 8 | 9 | #include "../e2e/profile/profile_interface/checker.hpp" 10 | #include "../e2e/profile/profile_interface/protector.hpp" 11 | 12 | #include 13 | #include 14 | 15 | namespace vsomeip { 16 | namespace e2exf { 17 | 18 | using session_id = uint16_t; 19 | using instance_id = uint16_t; 20 | 21 | using data_identifier = std::pair; 22 | 23 | std::ostream &operator<<(std::ostream &_os, const e2exf::data_identifier &_data_identifier); 24 | 25 | } // namespace e2exf 26 | } // namespace vsomeip 27 | 28 | #endif // VSOMEIP_E2EXF_CONFIG_HPP 29 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/src/buffer/buffer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include "../../../e2e_protection/include/buffer/buffer.hpp" 7 | #include 8 | 9 | namespace vsomeip { 10 | 11 | std::ostream &operator<<(std::ostream &_os, const e2e_buffer &_buffer) { 12 | for (auto b : _buffer) { 13 | if (isupper(b)) { 14 | _os << b; 15 | } else { 16 | _os << "[" << std::setfill('0') << std::setw(2) << std::hex << (uint32_t)b << std::dec << "]"; 17 | } 18 | } 19 | return _os; 20 | } 21 | 22 | } // namespace vsomeip 23 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/src/e2e/profile/profile_custom/profile_custom.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include "../../../../../e2e_protection/include/e2e/profile/profile_custom/profile_custom.hpp" 7 | #include "../../../../../e2e_protection/include/crc/crc.hpp" 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | namespace vsomeip { 14 | namespace e2e { 15 | namespace profile_custom { 16 | 17 | uint32_t profile_custom::compute_crc(const profile_config &_config, const e2e_buffer &_buffer) { 18 | uint32_t computed_crc = e2e_crc::calculate_profile_custom(buffer_view(_buffer, _config.crc_offset_ + 4, _buffer.size())); 19 | return computed_crc; 20 | } 21 | 22 | bool profile_custom::is_buffer_length_valid(const profile_config &_config, const e2e_buffer &_buffer) { 23 | return ((_config.crc_offset_ + 4U) <=_buffer.size()); 24 | } 25 | 26 | } // namespace profile_custom 27 | } // namespace e2e 28 | } // namespace vsomeip 29 | -------------------------------------------------------------------------------- /vsomeip/implementation/e2e_protection/src/e2exf/config.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | #include "../../../e2e_protection/include/e2exf/config.hpp" 8 | 9 | namespace vsomeip { 10 | 11 | std::ostream &operator<<(std::ostream &_os, const e2exf::data_identifier &_data_identifier) { 12 | _os << _data_identifier.first << _data_identifier.second; 13 | return _os; 14 | } 15 | 16 | } // namespace vsomeip 17 | -------------------------------------------------------------------------------- /vsomeip/implementation/endpoints/include/buffer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_BUFFER_HPP 7 | #define VSOMEIP_BUFFER_HPP 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | namespace vsomeip { 16 | 17 | typedef std::vector message_buffer_t; 18 | typedef std::shared_ptr message_buffer_ptr_t; 19 | 20 | } // namespace vsomeip 21 | 22 | #endif // VSOMEIP_BUFFER_HPP 23 | -------------------------------------------------------------------------------- /vsomeip/implementation/endpoints/include/client_endpoint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_CLIENT_ENDPOINT_HPP_ 7 | #define VSOMEIP_CLIENT_ENDPOINT_HPP_ 8 | 9 | #include "endpoint.hpp" 10 | 11 | namespace vsomeip { 12 | 13 | class client_endpoint : public virtual endpoint { 14 | public: 15 | virtual ~client_endpoint() {} 16 | 17 | virtual bool get_remote_address(boost::asio::ip::address &_address) const = 0; 18 | virtual std::uint16_t get_remote_port() const = 0; 19 | }; 20 | 21 | } // namespace vsomeip 22 | 23 | 24 | #endif /* VSOMEIP_CLIENT_ENDPOINT_HPP_ */ 25 | -------------------------------------------------------------------------------- /vsomeip/implementation/endpoints/include/credentials.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef ENDPOINTS_INCLUDE_CREDENTIALS_HPP_ 7 | #define ENDPOINTS_INCLUDE_CREDENTIALS_HPP_ 8 | 9 | #include 10 | 11 | namespace vsomeip { 12 | 13 | class credentials { 14 | public: 15 | static void activate_credentials(const int _fd); 16 | 17 | static void deactivate_credentials(const int _fd); 18 | 19 | static client_t receive_credentials(const int _fd, uid_t& _uid, gid_t& _gid); 20 | 21 | static void send_credentials(const int _fd, client_t _client); 22 | }; 23 | 24 | } // namespace vsomeip 25 | 26 | #endif /* ENDPOINTS_INCLUDE_CREDENTIALS_HPP_ */ 27 | -------------------------------------------------------------------------------- /vsomeip/implementation/helper/boost/asio/detail/reactor_op_ext.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/reactor_op_ext.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 7 | // 8 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 9 | // file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | 12 | #ifndef BOOST_ASIO_DETAIL_REACTOR_OP_EXT_HPP 13 | #define BOOST_ASIO_DETAIL_REACTOR_OP_EXT_HPP 14 | 15 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 | # pragma once 17 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 | 19 | #include 20 | 21 | namespace boost { 22 | namespace asio { 23 | namespace detail { 24 | 25 | class reactor_op_ext 26 | : public reactor_op 27 | { 28 | public: 29 | // The destination address 30 | boost::asio::ip::address da_; 31 | 32 | reactor_op_ext(perform_func_type perform_func, func_type complete_func) 33 | : reactor_op(perform_func, complete_func) 34 | { 35 | } 36 | }; 37 | 38 | } // namespace detail 39 | } // namespace asio 40 | } // namespace boost 41 | 42 | #endif // BOOST_ASIO_DETAIL_REACTOR_OP_EXT_HPP 43 | -------------------------------------------------------------------------------- /vsomeip/implementation/logging/include/defines.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef LOGGING_DEFINES_HPP_ 7 | #define LOGGING_DEFINES_HPP_ 8 | 9 | #define VSOMEIP_LOG_DEFAULT_APPLICATION_ID "VSIP" 10 | #define VSOMEIP_LOG_DEFAULT_APPLICATION_NAME "vSomeIP application|SysInfra|IPC" 11 | 12 | #define VSOMEIP_LOG_DEFAULT_CONTEXT_ID "VSIP" 13 | #define VSOMEIP_LOG_DEFAULT_CONTEXT_NAME "vSomeIP context" 14 | 15 | #endif /* LOGGING_DEFINES_HPP_ */ 16 | -------------------------------------------------------------------------------- /vsomeip/implementation/logging/include/dlt_sink_backend.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef LOGGING_INCLUDE_DLT_SINK_BACKEND_HPP_ 7 | #define LOGGING_INCLUDE_DLT_SINK_BACKEND_HPP_ 8 | 9 | #ifdef USE_DLT 10 | #include 11 | #endif 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | namespace logging = boost::log; 18 | namespace sinks = boost::log::sinks; 19 | 20 | namespace vsomeip 21 | { 22 | 23 | class dlt_sink_backend : 24 | public sinks::basic_sink_backend< 25 | sinks::combine_requirements< 26 | sinks::synchronized_feeding 27 | >::type 28 | > { 29 | public: 30 | dlt_sink_backend(const std::string &_app_id, 31 | const std::string &_context_id); 32 | virtual ~dlt_sink_backend(); 33 | 34 | void consume(const logging::record_view &rec); 35 | 36 | private: 37 | 38 | #ifdef USE_DLT 39 | DltLogLevelType level_as_dlt(logging::trivial::severity_level _level); 40 | DLT_DECLARE_CONTEXT(dlt_) 41 | #endif 42 | }; 43 | 44 | } /* namespace vsomeip */ 45 | 46 | #endif /* LOGGING_INCLUDE_DLT_SINK_BACKEND_HPP_ */ 47 | -------------------------------------------------------------------------------- /vsomeip/implementation/logging/src/logger.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include "../include/logger_impl.hpp" 7 | 8 | namespace vsomeip { 9 | 10 | std::shared_ptr logger::get() { 11 | return logger_impl::get(); 12 | } 13 | 14 | } // namespace vsomeip 15 | -------------------------------------------------------------------------------- /vsomeip/implementation/routing/include/routing_manager_adapter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_ROUTING_MANAGER_ADAPTER 7 | #define VSOMEIP_ROUTING_MANAGER_ADAPTER 8 | 9 | namespace vsomeip { 10 | 11 | class routing_manager; 12 | 13 | class routing_manager_adapter { 14 | public: 15 | virtual ~routing_manager_adapter() { 16 | } 17 | 18 | virtual routing_manager * get_manager() = 0; 19 | virtual void process_command(const byte_t *_data, length_t _length) = 0; 20 | }; 21 | 22 | } // namespace vsomeip 23 | 24 | #endif // VSOMEIP_ROUTING_MANAGER_ADAPTER_HPP 25 | -------------------------------------------------------------------------------- /vsomeip/implementation/runtime/src/error.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | 8 | namespace vsomeip { 9 | 10 | const char *ERROR_INFO[] = { "Missing vsomeip configuration", 11 | "Missing port configuration", "Client endpoint creation failed", 12 | "Server endpoint creation failed", "Service property mismatch" }; 13 | 14 | } // namespace vsomeip 15 | -------------------------------------------------------------------------------- /vsomeip/implementation/runtime/src/runtime.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | 8 | #include "../include/runtime_impl.hpp" 9 | 10 | namespace vsomeip { 11 | 12 | std::string runtime::get_property(const std::string &_name) { 13 | return runtime_impl::get_property(_name); 14 | } 15 | 16 | void runtime::set_property(const std::string &_name, const std::string &_value) { 17 | runtime_impl::set_property(_name, _value); 18 | } 19 | 20 | std::shared_ptr runtime::get() { 21 | return runtime_impl::get(); 22 | } 23 | 24 | } // namespace vsomeip 25 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/constants.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_CONSTANTS_HPP 7 | #define VSOMEIP_SD_CONSTANTS_HPP 8 | 9 | #include 10 | #include 11 | 12 | namespace vsomeip { 13 | namespace sd { 14 | 15 | const service_t service = 0xFFFF; 16 | const instance_t instance = 0x0000; 17 | const method_t method = 0x8100; 18 | const client_t client = 0x0000; 19 | const protocol_version_t protocol_version = 0x01; 20 | const interface_version_t interface_version = 0x01; 21 | const message_type_e message_type = message_type_e::MT_NOTIFICATION; 22 | const return_code_e return_code = return_code_e::E_OK; 23 | 24 | namespace protocol { 25 | 26 | const uint8_t reserved_byte = 0x0; 27 | const uint16_t reserved_word = 0x0; 28 | const uint32_t reserved_long = 0x0; 29 | 30 | const uint8_t tcp = 0x06; 31 | const uint8_t udp = 0x11; 32 | 33 | } // namespace protocol 34 | } // namespace sd 35 | } // namespace vsomeip 36 | 37 | #endif // VSOMEIP_SD_CONSTANTS_HPP 38 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/deserializer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_DESERIALIZER_HPP 7 | #define VSOMEIP_SD_DESERIALIZER_HPP 8 | 9 | #include "../../message/include/deserializer.hpp" 10 | 11 | namespace vsomeip { 12 | namespace sd { 13 | 14 | class message_impl; 15 | 16 | class deserializer: public vsomeip::deserializer { 17 | public: 18 | deserializer(std::uint32_t _shrink_buffer_threshold); 19 | deserializer(uint8_t *_data, std::size_t _length, 20 | std::uint32_t _shrink_buffer_threshold); 21 | deserializer(const deserializer &_other); 22 | virtual ~deserializer(); 23 | 24 | message_impl * deserialize_sd_message(); 25 | }; 26 | 27 | } // namespace sd 28 | } // vsomeip 29 | 30 | #endif // VSOMEIP_SD_DESERIALIZER_HPP 31 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/ip_option_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_IP_OPTION_IMPL_HPP 7 | #define VSOMEIP_SD_IP_OPTION_IMPL_HPP 8 | 9 | #include 10 | 11 | #include "option_impl.hpp" 12 | 13 | namespace vsomeip { 14 | namespace sd { 15 | 16 | class ip_option_impl: public option_impl { 17 | public: 18 | ip_option_impl(); 19 | virtual ~ip_option_impl(); 20 | virtual bool operator ==(const ip_option_impl &_option) const; 21 | 22 | uint16_t get_port() const; 23 | void set_port(uint16_t _port); 24 | 25 | layer_four_protocol_e get_layer_four_protocol() const; 26 | void set_layer_four_protocol(layer_four_protocol_e _protocol); 27 | 28 | virtual bool is_multicast() const = 0; 29 | 30 | virtual bool serialize(vsomeip::serializer *_to) const = 0; 31 | virtual bool deserialize(vsomeip::deserializer *_from) = 0; 32 | 33 | protected: 34 | layer_four_protocol_e protocol_; 35 | uint16_t port_; 36 | }; 37 | 38 | } // namespace sd 39 | } // namespace vsomeip 40 | 41 | #endif // VSOMEIP_SD_IP_OPTION_IMPL_HPP 42 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/ipv4_option_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_IPV4_OPTION_IMPL_HPP 7 | #define VSOMEIP_SD_IPV4_OPTION_IMPL_HPP 8 | 9 | #include 10 | 11 | #include "ip_option_impl.hpp" 12 | 13 | namespace vsomeip { 14 | namespace sd { 15 | 16 | class ipv4_option_impl: public ip_option_impl { 17 | public: 18 | ipv4_option_impl(bool _is_multicast); 19 | virtual ~ipv4_option_impl(); 20 | bool operator ==(const ipv4_option_impl &_other) const; 21 | 22 | const ipv4_address_t & get_address() const; 23 | void set_address(const ipv4_address_t &_address); 24 | 25 | bool is_multicast() const; 26 | bool serialize(vsomeip::serializer *_to) const; 27 | bool deserialize(vsomeip::deserializer *_from); 28 | 29 | private: 30 | ipv4_address_t address_; 31 | }; 32 | 33 | } // namespace sd 34 | } // namespace vsomeip 35 | 36 | #endif // VSOMEIP_SD_IPV4_OPTION_IMPL_HPP 37 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/ipv6_option_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_IPV6_OPTION_IMPL_HPP 7 | #define VSOMEIP_SD_IPV6_OPTION_IMPL_HPP 8 | 9 | #include 10 | 11 | #include "ip_option_impl.hpp" 12 | 13 | namespace vsomeip { 14 | namespace sd { 15 | 16 | class ipv6_option_impl: public ip_option_impl { 17 | public: 18 | ipv6_option_impl(bool _is_multicast); 19 | virtual ~ipv6_option_impl(); 20 | bool operator ==(const ipv6_option_impl &_other) const; 21 | 22 | const ipv6_address_t & get_address() const; 23 | void set_address(const ipv6_address_t &_address); 24 | 25 | bool is_multicast() const; 26 | bool serialize(vsomeip::serializer *_to) const; 27 | bool deserialize(vsomeip::deserializer *_from); 28 | 29 | private: 30 | ipv6_address_t address_; 31 | }; 32 | 33 | } // namespace sd 34 | } // namespace vsomeip 35 | 36 | #endif // VSOMEIP_SD_IPV6_OPTION_IMPL_HPP 37 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/load_balancing_option_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_LOAD_BALANCING_OPTION_IMPL_HPP 7 | #define VSOMEIP_SD_LOAD_BALANCING_OPTION_IMPL_HPP 8 | 9 | #include "primitive_types.hpp" 10 | #include "option_impl.hpp" 11 | 12 | namespace vsomeip { 13 | namespace sd { 14 | 15 | class load_balancing_option_impl: public option_impl { 16 | public: 17 | load_balancing_option_impl(); 18 | virtual ~load_balancing_option_impl(); 19 | bool operator ==(const load_balancing_option_impl &_other) const; 20 | 21 | priority_t get_priority() const; 22 | void set_priority(priority_t _priority); 23 | 24 | weight_t get_weight() const; 25 | void set_weight(weight_t _weight); 26 | 27 | bool serialize(vsomeip::serializer *_to) const; 28 | bool deserialize(vsomeip::deserializer *_from); 29 | 30 | private: 31 | priority_t priority_; 32 | weight_t weight_; 33 | }; 34 | 35 | } // namespace sd 36 | } // namespace vsomeip 37 | 38 | #endif // VSOMEIP_SD_LOAD_BALANCING_OPTION_IMPL_HPP 39 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/message_element_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_MESSAGE_ELEMENT_IMPL_HPP 7 | #define VSOMEIP_SD_MESSAGE_ELEMENT_IMPL_HPP 8 | 9 | namespace vsomeip { 10 | namespace sd { 11 | 12 | class message_impl; 13 | 14 | class message_element_impl { 15 | public: 16 | message_element_impl(); 17 | 18 | message_impl * get_owning_message() const; 19 | void set_owning_message(message_impl *_owner); 20 | 21 | protected: 22 | message_impl *owner_; 23 | }; 24 | 25 | } // namespace sd 26 | } // namespace vsomeip 27 | 28 | #endif // VSOMEIP_SD_MESSAGE_ELEMENT_IMPL_HPP 29 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/option_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_OPTION_IMPL_HPP 7 | #define VSOMEIP_SD_OPTION_IMPL_HPP 8 | 9 | #include 10 | 11 | #include "enumeration_types.hpp" 12 | #include "message_element_impl.hpp" 13 | 14 | namespace vsomeip { 15 | 16 | class serializer; 17 | class deserializer; 18 | 19 | namespace sd { 20 | 21 | class message_impl; 22 | 23 | class option_impl: public message_element_impl { 24 | public: 25 | option_impl(); 26 | virtual ~option_impl(); 27 | 28 | virtual bool operator ==(const option_impl &_other) const; 29 | 30 | uint16_t get_length() const; 31 | option_type_e get_type() const; 32 | 33 | virtual bool serialize(vsomeip::serializer *_to) const; 34 | virtual bool deserialize(vsomeip::deserializer *_from); 35 | 36 | protected: 37 | uint16_t length_; 38 | option_type_e type_; 39 | }; 40 | 41 | } // namespace sd 42 | } // namespace vsomeip 43 | 44 | #endif // VSOMEIP_INTERNAL_SD_OPTION_IMPL_HPP 45 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/primitive_types.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | 8 | #ifndef VSOMEIP_SD_PRIMITIVE_TYPES_HPP 9 | #define VSOMEIP_SD_PRIMITIVE_TYPES_HPP 10 | 11 | namespace vsomeip { 12 | namespace sd { 13 | 14 | // Load balancing 15 | typedef uint16_t priority_t; 16 | typedef uint16_t weight_t; 17 | 18 | // Protection 19 | typedef uint32_t alive_counter_t; 20 | typedef uint32_t crc_t; 21 | 22 | // 23 | typedef uint8_t flags_t; 24 | 25 | } // namespace sd 26 | } // namespace vsomeip 27 | 28 | #endif // VSOMEIP_SD_PRIMITIVE_TYPES_HPP 29 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/protection_option_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_PROTECTION_OPTION_IMPL_HPP 7 | #define VSOMEIP_SD_PROTECTION_OPTION_IMPL_HPP 8 | 9 | #include "../include/primitive_types.hpp" 10 | #include "../include/option_impl.hpp" 11 | 12 | namespace vsomeip { 13 | namespace sd { 14 | 15 | class protection_option_impl: public option_impl { 16 | public: 17 | protection_option_impl(); 18 | virtual ~protection_option_impl(); 19 | bool operator ==(const protection_option_impl &_other) const; 20 | 21 | alive_counter_t get_alive_counter() const; 22 | void set_alive_counter(alive_counter_t _counter); 23 | 24 | crc_t get_crc() const; 25 | void set_crc(crc_t _crc); 26 | 27 | bool serialize(vsomeip::serializer *_to) const; 28 | bool deserialize(vsomeip::deserializer *_from); 29 | 30 | private: 31 | alive_counter_t counter_; 32 | crc_t crc_; 33 | }; 34 | 35 | } // namespace sd 36 | } // namespace vsomeip 37 | 38 | #endif // VSOMEIP_SD_PROTECTION_OPTION_IMPL_HPP 39 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/request.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_REQUEST_HPP 7 | #define VSOMEIP_SD_REQUEST_HPP 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace vsomeip { 14 | 15 | class endpoint; 16 | 17 | namespace sd { 18 | 19 | class request { 20 | public: 21 | request(major_version_t _major, minor_version_t _minor, ttl_t _ttl); 22 | 23 | major_version_t get_major() const; 24 | void set_major(major_version_t _major); 25 | 26 | minor_version_t get_minor() const; 27 | void set_minor(minor_version_t _minor); 28 | 29 | ttl_t get_ttl() const; 30 | void set_ttl(ttl_t _ttl); 31 | 32 | uint8_t get_sent_counter() const; 33 | void set_sent_counter(uint8_t _sent_counter); 34 | 35 | private: 36 | major_version_t major_; 37 | minor_version_t minor_; 38 | ttl_t ttl_; 39 | 40 | uint8_t sent_counter_; 41 | }; 42 | 43 | } // namespace sd 44 | } // namespace vsomeip 45 | 46 | #endif // VSOMEIP_SD_SUBSCRIPTION_HPP 47 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/runtime.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_RUNTIME_HPP 7 | #define VSOMEIP_SD_RUNTIME_HPP 8 | 9 | #include 10 | 11 | namespace vsomeip { 12 | 13 | namespace sd { 14 | 15 | class message_impl; 16 | class service_discovery; 17 | class service_discovery_host; 18 | 19 | class runtime { 20 | public: 21 | virtual ~runtime() { 22 | } 23 | 24 | virtual std::shared_ptr create_service_discovery( 25 | service_discovery_host *_host) const = 0; 26 | virtual std::shared_ptr create_message() const = 0; 27 | }; 28 | 29 | } // namespace sd 30 | } // namespace vsomeip 31 | 32 | #endif // VSOMEIP_SD_RUNTIME_HPP 33 | 34 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/runtime_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_RUNTIME_IMPL_HPP 7 | #define VSOMEIP_SD_RUNTIME_IMPL_HPP 8 | 9 | #include 10 | #include "runtime.hpp" 11 | 12 | namespace vsomeip { 13 | namespace sd { 14 | 15 | class runtime_impl 16 | : public runtime, 17 | public plugin_impl { 18 | public: 19 | runtime_impl(); 20 | virtual ~runtime_impl(); 21 | 22 | std::shared_ptr create_service_discovery( 23 | service_discovery_host *_host) const; 24 | std::shared_ptr create_message() const; 25 | }; 26 | 27 | } // namespace sd 28 | } // namespace vsomeip 29 | 30 | #endif // VSOMEIP_SD_RUNTIME_IMPL_HPP 31 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/include/serviceentry_impl.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SD_SERVICEENTRY_IMPL_HPP 7 | #define VSOMEIP_SD_SERVICEENTRY_IMPL_HPP 8 | 9 | #include "entry_impl.hpp" 10 | 11 | namespace vsomeip { 12 | namespace sd { 13 | 14 | class serviceentry_impl: public entry_impl { 15 | public: 16 | serviceentry_impl(); 17 | virtual ~serviceentry_impl(); 18 | 19 | minor_version_t get_minor_version() const; 20 | void set_minor_version(minor_version_t _version); 21 | 22 | bool serialize(vsomeip::serializer *_to) const; 23 | bool deserialize(vsomeip::deserializer *_from); 24 | 25 | private: 26 | minor_version_t minor_version_; 27 | }; 28 | 29 | } // namespace sd 30 | } // namespace vsomeip 31 | 32 | #endif // VSOMEIP_SD_SERVICEENTRY_IMPL_HPP 33 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/src/message_element_impl.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include "../include/message_element_impl.hpp" 7 | 8 | namespace vsomeip { 9 | namespace sd { 10 | 11 | message_element_impl::message_element_impl() { 12 | owner_ = 0; 13 | } 14 | 15 | message_impl * message_element_impl::get_owning_message() const { 16 | return owner_; 17 | } 18 | 19 | void message_element_impl::set_owning_message(message_impl *_owner) { 20 | owner_ = _owner; 21 | } 22 | 23 | } // namespace sd 24 | } // namespace vsomeip 25 | -------------------------------------------------------------------------------- /vsomeip/implementation/service_discovery/src/request.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include "../include/request.hpp" 7 | 8 | namespace vsomeip { 9 | namespace sd { 10 | 11 | request::request(major_version_t _major, minor_version_t _minor, ttl_t _ttl) 12 | : major_(_major), minor_(_minor), ttl_(_ttl), sent_counter_(0) { 13 | } 14 | 15 | major_version_t request::get_major() const { 16 | return major_; 17 | } 18 | 19 | void request::set_major(major_version_t _major) { 20 | major_ = _major; 21 | } 22 | 23 | minor_version_t request::get_minor() const { 24 | return minor_; 25 | } 26 | 27 | void request::set_minor(minor_version_t _minor) { 28 | minor_ = _minor; 29 | } 30 | 31 | ttl_t request::get_ttl() const { 32 | return ttl_; 33 | } 34 | 35 | void request::set_ttl(ttl_t _ttl) { 36 | ttl_ = _ttl; 37 | } 38 | 39 | uint8_t request::get_sent_counter() const { 40 | return sent_counter_; 41 | } 42 | 43 | void request::set_sent_counter(uint8_t _sent_counter) { 44 | sent_counter_ = _sent_counter; 45 | } 46 | 47 | } // namespace sd 48 | } // namespace vsomeip 49 | -------------------------------------------------------------------------------- /vsomeip/implementation/tracing/include/defines.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef TRACING_INCLUDE_DEFINES_HPP_ 7 | #define TRACING_INCLUDE_DEFINES_HPP_ 8 | 9 | #define VSOMEIP_TC_DEFAULT_CHANNEL_NAME "Trace Connector Network Logging" 10 | #define VSOMEIP_TC_DEFAULT_CHANNEL_ID "TC" 11 | #define VSOMEIP_TC_DEFAULT_FILTER_TYPE "positive" 12 | 13 | #endif /* TRACING_INCLUDE_DEFINES_HPP_ */ 14 | -------------------------------------------------------------------------------- /vsomeip/implementation/tracing/include/enumeration_types.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_TC_ENUMERATION_TYPES_HPP 7 | #define VSOMEIP_TC_ENUMERATION_TYPES_HPP 8 | 9 | namespace vsomeip { 10 | namespace tc { 11 | 12 | enum class filter_criteria_e : uint8_t { 13 | SERVICES = 0x00, 14 | METHODS = 0x01, 15 | CLIENTS = 0x02, 16 | }; 17 | 18 | enum class filter_type_e : uint8_t { 19 | NEGATIVE = 0x00, 20 | POSITIVE = 0x01 21 | }; 22 | 23 | } // namespace tc 24 | } // namespace vsomeip 25 | 26 | #endif // VSOMEIP_TC_ENUMERATION_TYPES_HPP 27 | -------------------------------------------------------------------------------- /vsomeip/implementation/tracing/include/trace_header.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_TC_TRACE_HEADER_HPP 7 | #define VSOMEIP_TC_TRACE_HEADER_HPP 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | 15 | #define VSOMEIP_TRACE_HEADER_SIZE 10 16 | 17 | namespace vsomeip { 18 | 19 | class endpoint; 20 | 21 | namespace tc { 22 | 23 | enum class protocol_e : uint8_t { 24 | local = 0x0, 25 | udp = 0x1, 26 | tcp = 0x2, 27 | unknown = 0xFF 28 | }; 29 | 30 | struct trace_header { 31 | bool prepare(const std::shared_ptr &_endpoint, bool _is_sending, 32 | instance_t _instance); 33 | bool prepare(const endpoint* _endpoint, bool _is_sending, 34 | instance_t _instance); 35 | void prepare(const boost::asio::ip::address_v4 &_address, 36 | std::uint16_t _port, protocol_e _protocol, bool _is_sending, 37 | instance_t _instance); 38 | 39 | byte_t data_[VSOMEIP_TRACE_HEADER_SIZE]; 40 | }; 41 | 42 | } // namespace tc 43 | } // namespace vsomeip 44 | 45 | #endif // VSOMEIP_TC_TRACE_HEADER_HPP 46 | -------------------------------------------------------------------------------- /vsomeip/implementation/utility/include/criticalsection.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_CRITICALSECTION_HPP 7 | #define VSOMEIP_CRITICALSECTION_HPP 8 | 9 | #include 10 | #include 11 | 12 | namespace vsomeip { 13 | 14 | #ifdef _WIN32 15 | 16 | // Windows: CriticalSection uses win32 CRITICAL_SECTION. 17 | // Interface mimics std::mutex so we can use it in 18 | // conjunction with std::unique_lock. 19 | class CriticalSection final { 20 | public: 21 | CriticalSection(); 22 | ~CriticalSection(); 23 | 24 | // prevent copying 25 | CriticalSection(const CriticalSection&) = delete; 26 | CriticalSection& operator=(const CriticalSection&) = delete; 27 | 28 | void lock(); 29 | void unlock(); 30 | bool try_lock(); 31 | 32 | private: 33 | struct Impl; 34 | std::unique_ptr m_impl; 35 | }; 36 | 37 | #else 38 | 39 | // Linux: CriticalSection is a type alias for std::mutex. 40 | using CriticalSection = std::mutex; 41 | 42 | #endif 43 | 44 | } // namespace vsomeip 45 | 46 | #endif //VSOMEIP_CRITICALSECTION_HPP 47 | -------------------------------------------------------------------------------- /vsomeip/implementation/utility/src/criticalsection.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | #include "../include/criticalsection.hpp" 6 | 7 | #ifdef _WIN32 8 | 9 | #include 10 | 11 | namespace vsomeip { 12 | 13 | struct CriticalSection::Impl final { 14 | CRITICAL_SECTION m_criticalSection; 15 | }; 16 | 17 | 18 | CriticalSection::CriticalSection() 19 | : m_impl(new CriticalSection::Impl()) { 20 | InitializeCriticalSection(&m_impl->m_criticalSection); 21 | } 22 | 23 | CriticalSection::~CriticalSection() { 24 | DeleteCriticalSection(&m_impl->m_criticalSection); 25 | } 26 | 27 | void CriticalSection::lock() { 28 | EnterCriticalSection(&m_impl->m_criticalSection); 29 | } 30 | 31 | bool CriticalSection::try_lock() { 32 | return (TryEnterCriticalSection(&m_impl->m_criticalSection) != 0); 33 | } 34 | 35 | void CriticalSection::unlock(){ 36 | LeaveCriticalSection(&m_impl->m_criticalSection); 37 | } 38 | 39 | } // namespace vsomeip 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/error.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_ERROR_HPP 7 | #define VSOMEIP_ERROR_HPP 8 | 9 | #include 10 | 11 | namespace vsomeip { 12 | 13 | enum class error_code_e : uint8_t { 14 | CONFIGURATION_MISSING, 15 | PORT_CONFIGURATION_MISSING, 16 | CLIENT_ENDPOINT_CREATION_FAILED, 17 | SERVER_ENDPOINT_CREATION_FAILED, 18 | SERVICE_PROPERTY_MISMATCH 19 | }; 20 | 21 | extern const char *ERROR_INFO[]; 22 | 23 | } // namespace vsomeip 24 | 25 | #endif // VSOMEIP_ERROR_HPP 26 | 27 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/export.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef __EXPORT__HPP__ 7 | #define __EXPORT__HPP__ 8 | 9 | #if _WIN32 10 | #define VSOMEIP_EXPORT __declspec(dllexport) 11 | #define VSOMEIP_EXPORT_CLASS_EXPLICIT 12 | 13 | #if VSOMEIP_DLL_COMPILATION 14 | #define VSOMEIP_IMPORT_EXPORT __declspec(dllexport) 15 | #else 16 | #define VSOMEIP_IMPORT_EXPORT __declspec(dllimport) 17 | #endif 18 | 19 | #if VSOMEIP_DLL_COMPILATION_CONFIG 20 | #define VSOMEIP_IMPORT_EXPORT_CONFIG __declspec(dllexport) 21 | #else 22 | #define VSOMEIP_IMPORT_EXPORT_CONFIG __declspec(dllimport) 23 | #endif 24 | #else 25 | #define VSOMEIP_EXPORT 26 | #define VSOMEIP_IMPORT_EXPORT 27 | #define VSOMEIP_IMPORT_EXPORT_CONFIG 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/function_types.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_FUNCTION_TYPES_HPP 7 | #define VSOMEIP_FUNCTION_TYPES_HPP 8 | 9 | #include 10 | #include 11 | 12 | namespace vsomeip { 13 | 14 | class payload; 15 | 16 | typedef std::function< 17 | bool (const std::shared_ptr &, 18 | const std::shared_ptr &) > epsilon_change_func_t; 19 | 20 | } // namespace vsomeip 21 | 22 | #endif // VSOMEIP_FUNCTION_TYPES_HPP 23 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/handler.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_HANDLER_HPP 7 | #define VSOMEIP_HANDLER_HPP 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | namespace vsomeip { 15 | 16 | class message; 17 | 18 | typedef std::function< void (state_type_e) > state_handler_t; 19 | typedef std::function< void (const std::shared_ptr< message > &) > message_handler_t; 20 | typedef std::function< void (service_t, instance_t, bool) > availability_handler_t; 21 | typedef std::function< bool (client_t, bool) > subscription_handler_t; 22 | typedef std::function< void (const uint16_t) > error_handler_t; 23 | typedef std::function< void (const service_t, const instance_t, const eventgroup_t, 24 | const event_t, const uint16_t) > subscription_status_handler_t; 25 | typedef std::function< void (client_t, bool, std::function< void (const bool) > )> async_subscription_handler_t; 26 | 27 | typedef std::function< void (const std::vector> &_services) > offered_services_handler_t; 28 | typedef std::function< void () > watchdog_handler_t; 29 | 30 | 31 | } // namespace vsomeip 32 | 33 | #endif // VSOMEIP_HANDLER_HPP 34 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/internal/deserializable.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_DESERIALIZABLE_HPP 7 | #define VSOMEIP_DESERIALIZABLE_HPP 8 | 9 | #include 10 | 11 | namespace vsomeip { 12 | 13 | class deserializer; 14 | 15 | class deserializable { 16 | public: 17 | VSOMEIP_EXPORT virtual ~deserializable() { 18 | } 19 | VSOMEIP_EXPORT virtual bool deserialize(deserializer *_from) = 0; 20 | }; 21 | 22 | } // namespace vsomeip 23 | 24 | #endif // VSOMEIP_SERIALIZABLE_HPP 25 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/internal/serializable.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_SERIALIZABLE_HPP 7 | #define VSOMEIP_SERIALIZABLE_HPP 8 | 9 | #include 10 | 11 | namespace vsomeip { 12 | 13 | class serializer; 14 | 15 | /** 16 | * Abstract base class for element that can be serialized. 17 | */ 18 | class serializable { 19 | public: 20 | VSOMEIP_EXPORT virtual ~serializable() {} 21 | 22 | /** 23 | * \brief serialize the content of the object 24 | */ 25 | VSOMEIP_EXPORT virtual bool serialize(serializer *_to) const = 0; 26 | }; 27 | 28 | } // namespace vsomeip 29 | 30 | #endif // VSOMEIP_SERIALIZABLE_HPP 31 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/message.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_MESSAGE_HPP 7 | #define VSOMEIP_MESSAGE_HPP 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace vsomeip { 14 | 15 | class payload; 16 | 17 | /** 18 | * 19 | * \defgroup vsomeip 20 | * 21 | * @{ 22 | * 23 | */ 24 | 25 | /** 26 | * \brief Implements regular SOME/IP messages. 27 | * 28 | * This class extends @ref message_base by an unstructured payload. Except 29 | * SOME/IP Service Discovery messages, all SOME/IP messages within vsomeip 30 | * are represented by message objects. 31 | */ 32 | 33 | class message: virtual public message_base { 34 | public: 35 | virtual ~message() {} 36 | 37 | /** 38 | * \brief Returns a pointer to the message payload. 39 | */ 40 | virtual std::shared_ptr get_payload() const = 0; 41 | 42 | /** 43 | * \brief Set the message payload. 44 | */ 45 | virtual void set_payload(std::shared_ptr _payload) = 0; 46 | }; 47 | 48 | /** @} */ 49 | 50 | } // namespace vsomeip 51 | 52 | #endif // VSOMEIP_MESSAGE_HPP 53 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/plugins/application_plugin.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_APPLICATION_PLUGIN_HPP 7 | #define VSOMEIP_APPLICATION_PLUGIN_HPP 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | // Version should be incremented on breaking API change 15 | #define VSOMEIP_APPLICATION_PLUGIN_VERSION 1 16 | 17 | namespace vsomeip { 18 | 19 | enum class application_plugin_state_e : uint8_t { 20 | STATE_INITIALIZED, 21 | STATE_STARTED, 22 | STATE_STOPPED 23 | }; 24 | 25 | /** 26 | * The application plug-in can be used to extend application behavior 27 | * via an module/plug-in. 28 | */ 29 | class application_plugin { 30 | public: 31 | virtual ~application_plugin() {} 32 | 33 | // Called by vSomeIP to inform an application plug-in about its actual state 34 | // Call should not be blocked from plug-in as there is no threading. 35 | // The caller thread of "application::init/::start/::stop" will inform the plug-in. 36 | virtual void on_application_state_change(const std::string _application_name, 37 | const application_plugin_state_e _app_state) = 0; 38 | }; 39 | 40 | } 41 | 42 | #endif // VSOMEIP_APPLICATION_PLUGIN_HPP 43 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/plugins/pre_configuration_plugin.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_PRE_CONFIGURATION_PLUGIN_HPP 7 | #define VSOMEIP_PRE_CONFIGURATION_PLUGIN_HPP 8 | 9 | #include 10 | 11 | // Version should be incremented on breaking API change 12 | #define VSOMEIP_PRE_CONFIGURATION_PLUGIN_VERSION 1 13 | 14 | namespace vsomeip { 15 | /** 16 | * The pre configuration plug-in can be used to extend configuration load behavior 17 | * via an module/plug-in. 18 | */ 19 | class pre_configuration_plugin { 20 | public: 21 | virtual ~pre_configuration_plugin() {} 22 | 23 | // Plug-In should return a valid path to a vSomeIP configuration. 24 | // vSomeIP will use this path for config loading if such a plug-in is availablel. 25 | virtual std::string get_configuration_path() = 0; 26 | }; 27 | } 28 | 29 | #endif // VSOMEIP_PRE_CONFIGURATION_PLUGIN_HPP 30 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/primitive_types.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_PRIMITIVE_TYPES_HPP 7 | #define VSOMEIP_PRIMITIVE_TYPES_HPP 8 | 9 | #include 10 | #include 11 | 12 | namespace vsomeip { 13 | 14 | typedef uint32_t message_t; 15 | typedef uint16_t service_t; 16 | typedef uint16_t method_t; 17 | typedef uint16_t event_t; 18 | 19 | typedef uint16_t instance_t; 20 | typedef uint16_t eventgroup_t; 21 | 22 | typedef uint8_t major_version_t; 23 | typedef uint32_t minor_version_t; 24 | 25 | typedef uint32_t ttl_t; 26 | 27 | typedef uint32_t request_t; 28 | typedef uint16_t client_t; 29 | typedef uint16_t session_t; 30 | 31 | typedef uint32_t length_t; 32 | 33 | typedef uint8_t protocol_version_t; 34 | typedef uint8_t interface_version_t; 35 | 36 | typedef uint8_t byte_t; 37 | 38 | // Addresses 39 | typedef std::array ipv4_address_t; 40 | typedef std::array ipv6_address_t; 41 | 42 | typedef std::string trace_channel_t; 43 | 44 | typedef std::string trace_filter_type_t; 45 | 46 | typedef std::uint16_t pending_subscription_id_t; 47 | } // namespace vsomeip 48 | 49 | #endif // VSOMEIP_PRIMITIVE_TYPES_HPP 50 | -------------------------------------------------------------------------------- /vsomeip/interface/vsomeip/vsomeip.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef VSOMEIP_VSOMEIP_HPP 7 | #define VSOMEIP_VSOMEIP_HPP 8 | 9 | /** 10 | * \brief The central vsomeip header. Include this to use vsomeip. 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #endif // VSOMEIP_VSOMEIP_HPP 21 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/application_test_availability.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | #include 6 | 7 | #include "application_test_client_availability.cpp" 8 | #include "application_test_service.cpp" 9 | #include "application_test_daemon.cpp" 10 | 11 | TEST(someip_application_test_availability, register_availability_handlers) 12 | { 13 | // start application acting as daemon 14 | application_test_daemon its_daemon; 15 | 16 | // start receiver service 17 | application_test_service its_receiver(application_test::service); 18 | 19 | // start client 20 | application_test_client_availability its_client(application_test::service); 21 | int counter(0); 22 | while (!its_client.all_availability_handlers_called() && counter < 500) { 23 | std::this_thread::sleep_for(std::chrono::milliseconds(10)); 24 | counter++; 25 | } 26 | 27 | //shutdown 28 | its_receiver.stop(); 29 | its_client.stop(); 30 | its_daemon.stop(); 31 | } 32 | 33 | #ifndef _WIN32 34 | int main(int argc, char** argv) 35 | { 36 | ::testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/application_test_availability_starter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_CONFIGURATION=application_test_single_process.json 8 | ./application_test_availability 9 | 10 | exit $? -------------------------------------------------------------------------------- /vsomeip/test/application_tests/application_test_daemon.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include "../../implementation/logging/include/logger.hpp" 11 | 12 | class application_test_daemon { 13 | public: 14 | application_test_daemon() : 15 | app_(vsomeip::runtime::get()->create_application("daemon")) { 16 | if (!app_->init()) { 17 | ADD_FAILURE() << "Couldn't initialize application"; 18 | return; 19 | } 20 | std::promise its_promise; 21 | application_thread_ = std::thread([&](){ 22 | its_promise.set_value(true); 23 | app_->start(); 24 | }); 25 | EXPECT_TRUE(its_promise.get_future().get()); 26 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); 27 | VSOMEIP_INFO << "Daemon starting"; 28 | } 29 | 30 | ~application_test_daemon() { 31 | application_thread_.join(); 32 | } 33 | 34 | void stop() { 35 | VSOMEIP_INFO << "Daemon stopping"; 36 | app_->stop(); 37 | } 38 | 39 | private: 40 | std::shared_ptr app_; 41 | std::thread application_thread_; 42 | }; 43 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/application_test_globals.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef APPLICATION_TEST_GLOBALS_HPP_ 7 | #define APPLICATION_TEST_GLOBALS_HPP_ 8 | 9 | namespace application_test { 10 | 11 | struct service_info { 12 | vsomeip::service_t service_id; 13 | vsomeip::instance_t instance_id; 14 | vsomeip::method_t method_id; 15 | vsomeip::event_t event_id; 16 | vsomeip::eventgroup_t eventgroup_id; 17 | vsomeip::method_t shutdown_method_id; 18 | vsomeip::major_version_t major_version; 19 | vsomeip::minor_version_t minor_version; 20 | }; 21 | 22 | 23 | struct service_info service = { 0x1111, 0x1, 0x1111, 0x1111, 0x1000, 0x1404, 0x2, 0x4711 }; 24 | 25 | static constexpr int number_of_messages_to_send = 150; 26 | } 27 | 28 | #endif /* APPLICATION_TEST_GLOBALS_HPP_ */ 29 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/application_test_single_process.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/someip.log" 11 | }, 12 | "dlt":"false" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/application_test_single_process_starter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | FAIL=0 8 | 9 | export VSOMEIP_CONFIGURATION=application_test_single_process.json 10 | ./application_test_single_process 11 | 12 | if [ $? -ne 0 ] 13 | then 14 | ((FAIL+=1)) 15 | fi 16 | 17 | # Check if both exited successfully 18 | if [ $FAIL -eq 0 ] 19 | then 20 | exit 0 21 | else 22 | exit 1 23 | fi 24 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/conf/application_test.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/someip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications": 15 | [ 16 | { 17 | "name":"application_test", 18 | "id":"0x7788", 19 | "num_dispatchers":"5" 20 | } 21 | ], 22 | "services": 23 | [ 24 | { 25 | "service":"0x1234", 26 | "instance":"0x5678", 27 | "reliable":"30503" 28 | } 29 | ], 30 | "routing":"application_test", 31 | "service-discovery": 32 | { 33 | "enable":"true", 34 | "multicast":"224.0.0.1", 35 | "port":"30490", 36 | "protocol":"udp" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/conf/application_test_daemon.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/someip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications": 15 | [ 16 | { 17 | "name":"application_test", 18 | "id":"0x7788", 19 | "num_dispatchers":"5" 20 | } 21 | ], 22 | "services": 23 | [ 24 | { 25 | "service":"0x1234", 26 | "instance":"0x5678", 27 | "reliable":"30503" 28 | } 29 | ], 30 | "routing":"vsomeipd", 31 | "service-discovery": 32 | { 33 | "enable":"true", 34 | "multicast":"224.0.0.1", 35 | "port":"30490", 36 | "protocol":"udp" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/conf/application_test_no_dispatch_threads.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/someip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications": 15 | [ 16 | { 17 | "name":"application_test", 18 | "id":"0x7788" 19 | } 20 | ], 21 | "services": 22 | [ 23 | { 24 | "service":"0x1234", 25 | "instance":"0x5678", 26 | "reliable":"30503" 27 | } 28 | ], 29 | "routing":"application_test", 30 | "service-discovery": 31 | { 32 | "enable":"true", 33 | "multicast":"224.0.0.1", 34 | "port":"30490", 35 | "protocol":"udp" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vsomeip/test/application_tests/conf/application_test_no_dispatch_threads_daemon.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/someip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications": 15 | [ 16 | { 17 | "name":"application_test", 18 | "id":"0x7788" 19 | } 20 | ], 21 | "services": 22 | [ 23 | { 24 | "service":"0x1234", 25 | "instance":"0x5678", 26 | "reliable":"30503" 27 | } 28 | ], 29 | "routing":"vsomeipd", 30 | "service-discovery": 31 | { 32 | "enable":"true", 33 | "multicast":"224.0.0.1", 34 | "port":"30490", 35 | "protocol":"udp" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/big_payload_test_client_local_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | # Start the client 8 | export VSOMEIP_APPLICATION_NAME=big_payload_test_client 9 | export VSOMEIP_CONFIGURATION=big_payload_test_local.json 10 | ./big_payload_test_client 11 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/big_payload_test_client_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | # Start the client 8 | export VSOMEIP_APPLICATION_NAME=big_payload_test_client 9 | export VSOMEIP_CONFIGURATION=big_payload_test_tcp_client.json 10 | ./big_payload_test_client 11 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/big_payload_test_local.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"debug", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications": 15 | [ 16 | { 17 | "name":"big_payload_test_service", 18 | "id":"0x1277" 19 | }, 20 | { 21 | "name":"big_payload_test_client", 22 | "id":"0x1344" 23 | } 24 | ], 25 | "services": 26 | [ 27 | { 28 | "service":"0x1234", 29 | "instance":"0x5678" 30 | } 31 | ], 32 | "payload-sizes": 33 | [ 34 | { 35 | "unicast":"127.0.0.1", 36 | "ports": 37 | [ 38 | { 39 | "port":"30509", 40 | "max-payload-size":"614400" 41 | } 42 | ] 43 | } 44 | ], 45 | "routing":"big_payload_test_service", 46 | "service-discovery": 47 | { 48 | "enable":"true", 49 | "multicast":"224.244.224.245", 50 | "port":"30490", 51 | "protocol":"udp" 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/big_payload_test_local_limited.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"error", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications": 15 | [ 16 | { 17 | "name":"big_payload_test_service", 18 | "id":"0x1277" 19 | }, 20 | { 21 | "name":"big_payload_test_client", 22 | "id":"0x1344" 23 | } 24 | ], 25 | "services": 26 | [ 27 | { 28 | "service":"0x1234", 29 | "instance":"0x5678" 30 | } 31 | ], 32 | "max-payload-size-local" : "614400", 33 | "routing":"big_payload_test_service", 34 | "service-discovery": 35 | { 36 | "enable":"true", 37 | "multicast":"224.244.224.245", 38 | "port":"30490", 39 | "protocol":"udp" 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/big_payload_test_local_queue_limited.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"error", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications": 15 | [ 16 | { 17 | "name":"big_payload_test_service", 18 | "id":"0x1277" 19 | }, 20 | { 21 | "name":"big_payload_test_client", 22 | "id":"0x1344" 23 | } 24 | ], 25 | "services": 26 | [ 27 | { 28 | "service":"0x1234", 29 | "instance":"0x5678" 30 | } 31 | ], 32 | "endpoint-queue-limit-local" : "614430", 33 | "routing":"big_payload_test_service", 34 | "service-discovery": 35 | { 36 | "enable":"true", 37 | "multicast":"224.244.224.245", 38 | "port":"30490", 39 | "protocol":"udp" 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/big_payload_test_local_random.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"debug", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications": 15 | [ 16 | { 17 | "name":"big_payload_test_service", 18 | "id":"0x1277", 19 | "max_dispatch_time" : "5000" 20 | }, 21 | { 22 | "name":"big_payload_test_client", 23 | "id":"0x1344", 24 | "max_dispatch_time" : "5000" 25 | } 26 | ], 27 | "services": 28 | [ 29 | { 30 | "service":"0x1234", 31 | "instance":"0x5678" 32 | } 33 | ], 34 | "buffer-shrink-threshold" : "2", 35 | "routing":"big_payload_test_service", 36 | "service-discovery": 37 | { 38 | "enable":"true", 39 | "multicast":"224.244.224.245", 40 | "port":"30490", 41 | "protocol":"udp" 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/big_payload_test_service_external_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | if [[ $# -gt 0 && $1 != "RANDOM" && $1 != "LIMITED" && $1 != "LIMITEDGENERAL" && $1 != "QUEUELIMITEDGENERAL" && $1 != "QUEUELIMITEDSPECIFIC" ]] 8 | then 9 | echo "The only allowed parameter to this script is RANDOM, LIMITED, LIMITEDGENERAL, QUEUELIMITEDGENERAL or QUEUELIMITEDSPECIFIC" 10 | echo "Like $0 RANDOM" 11 | exit 1 12 | fi 13 | 14 | # Start the service 15 | if [[ $# -gt 0 && $1 == "RANDOM" ]]; then 16 | export VSOMEIP_CONFIGURATION=big_payload_test_tcp_service_random.json 17 | elif [[ $# -gt 0 && $1 == "LIMITEDGENERAL" ]]; then 18 | export VSOMEIP_CONFIGURATION=big_payload_test_tcp_service_limited_general.json 19 | elif [[ $# -gt 0 && $1 == "QUEUELIMITEDGENERAL" ]]; then 20 | export VSOMEIP_CONFIGURATION=big_payload_test_tcp_service_queue_limited_general.json 21 | elif [[ $# -gt 0 && $1 == "QUEUELIMITEDSPECIFIC" ]]; then 22 | export VSOMEIP_CONFIGURATION=big_payload_test_tcp_service_queue_limited_specific.json 23 | else 24 | export VSOMEIP_CONFIGURATION=big_payload_test_tcp_service.json 25 | fi 26 | ./big_payload_test_service $1 27 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/big_payload_test_service_local_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | # Start the service 8 | export VSOMEIP_APPLICATION_NAME=big_payload_test_service 9 | export VSOMEIP_CONFIGURATION=big_payload_test_local.json 10 | ./big_payload_test_service 11 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/conf/big_payload_test_tcp_client.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "netmask":"255.255.255.0", 4 | "logging": 5 | { 6 | "level":"info", 7 | "console":"true", 8 | "file": 9 | { 10 | "enable":"true", 11 | "path":"/var/log/vsomeip.log" 12 | }, 13 | "dlt":"true" 14 | }, 15 | "applications": 16 | [ 17 | { 18 | "name":"big_payload_test_client", 19 | "id":"0x1343" 20 | } 21 | ], 22 | "payload-sizes": 23 | [ 24 | { 25 | "unicast":"@TEST_IP_SLAVE@", 26 | "ports": 27 | [ 28 | { 29 | "port":"30509", 30 | "max-payload-size":"614400" 31 | } 32 | ] 33 | } 34 | ], 35 | "routing":"big_payload_test_client", 36 | "service-discovery": 37 | { 38 | "enable":"true", 39 | "multicast":"224.244.224.245", 40 | "port":"30490", 41 | "protocol":"udp" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/conf/big_payload_test_tcp_client_limited_general.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "netmask":"255.255.255.0", 4 | "logging": 5 | { 6 | "level":"info", 7 | "console":"true", 8 | "file": 9 | { 10 | "enable":"true", 11 | "path":"/var/log/vsomeip.log" 12 | }, 13 | "dlt":"true" 14 | }, 15 | "applications": 16 | [ 17 | { 18 | "name":"big_payload_test_client", 19 | "id":"0x1343" 20 | } 21 | ], 22 | "max-payload-size-reliable":"614400", 23 | "routing":"big_payload_test_client", 24 | "service-discovery": 25 | { 26 | "enable":"true", 27 | "multicast":"224.244.224.245", 28 | "port":"30490", 29 | "protocol":"udp" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/conf/big_payload_test_tcp_client_queue_limited_general.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "netmask":"255.255.255.0", 4 | "logging": 5 | { 6 | "level":"info", 7 | "console":"true", 8 | "file": 9 | { 10 | "enable":"true", 11 | "path":"/var/log/vsomeip.log" 12 | }, 13 | "dlt":"true" 14 | }, 15 | "applications": 16 | [ 17 | { 18 | "name":"big_payload_test_client", 19 | "id":"0x1343" 20 | } 21 | ], 22 | "endpoint-queue-limit-external" : "614416", 23 | "routing":"big_payload_test_client", 24 | "service-discovery": 25 | { 26 | "enable":"true", 27 | "multicast":"224.244.224.245", 28 | "port":"30490", 29 | "protocol":"udp" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/conf/big_payload_test_tcp_client_queue_limited_specific.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "netmask":"255.255.255.0", 4 | "logging": 5 | { 6 | "level":"info", 7 | "console":"true", 8 | "file": 9 | { 10 | "enable":"true", 11 | "path":"/var/log/vsomeip.log" 12 | }, 13 | "dlt":"true" 14 | }, 15 | "applications": 16 | [ 17 | { 18 | "name":"big_payload_test_client", 19 | "id":"0x1343" 20 | } 21 | ], 22 | "endpoint-queue-limits" : 23 | [ 24 | { 25 | "unicast":"@TEST_IP_SLAVE@", 26 | "ports": 27 | [ 28 | { 29 | "port":"30509", 30 | "queue-size-limit":"614416" 31 | } 32 | ] 33 | } 34 | ], 35 | "routing":"big_payload_test_client", 36 | "service-discovery": 37 | { 38 | "enable":"true", 39 | "multicast":"224.244.224.245", 40 | "port":"30490", 41 | "protocol":"udp" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vsomeip/test/big_payload_tests/conf/big_payload_test_tcp_client_random.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "netmask":"255.255.255.0", 4 | "logging": 5 | { 6 | "level":"info", 7 | "console":"true", 8 | "file": 9 | { 10 | "enable":"true", 11 | "path":"/var/log/vsomeip.log" 12 | }, 13 | "dlt":"true" 14 | }, 15 | "applications": 16 | [ 17 | { 18 | "name":"big_payload_test_client", 19 | "id":"0x1343", 20 | "max_dispatch_time" : "5000" 21 | } 22 | ], 23 | "buffer-shrink-threshold" : "2", 24 | "routing":"big_payload_test_client", 25 | "service-discovery": 26 | { 27 | "enable":"true", 28 | "multicast":"224.244.224.245", 29 | "port":"30490", 30 | "protocol":"udp" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsomeip/test/client_id_tests/client_id_test_globals.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef CLIENT_ID_TEST_CLIENT_ID_TEST_GLOBALS_HPP_ 7 | #define CLIENT_ID_TEST_CLIENT_ID_TEST_GLOBALS_HPP_ 8 | 9 | namespace client_id_test { 10 | 11 | struct service_info { 12 | vsomeip::service_t service_id; 13 | vsomeip::instance_t instance_id; 14 | vsomeip::method_t method_id; 15 | }; 16 | 17 | static constexpr std::array service_infos = {{ 18 | // placeholder to be consistent w/ client ids, service ids, app names 19 | { 0xFFFF, 0xFFFF, 0xFFFF }, 20 | // node 1 21 | { 0x1000, 0x1, 0x1111 }, 22 | { 0x2000, 0x1, 0x2222 }, 23 | { 0x3000, 0x1, 0x3333 }, 24 | // node 2 25 | { 0x4000, 0x1, 0x4444 }, 26 | { 0x5000, 0x1, 0x5555 }, 27 | { 0x6000, 0x1, 0x6666 } 28 | }}; 29 | 30 | static constexpr int messages_to_send = 10; 31 | } 32 | 33 | #endif /* CLIENT_ID_TEST_CLIENT_ID_TEST_GLOBALS_HPP_ */ 34 | -------------------------------------------------------------------------------- /vsomeip/test/client_id_tests/client_id_test_utility.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "diagnosis":"0x63", 15 | "applications": 16 | [ 17 | { 18 | "name":"client_id_test_utility_service_in", 19 | "id":"0x6311" 20 | }, 21 | { 22 | "name":"client_id_test_utility_service_in_two", 23 | "id":"0x6312" 24 | }, 25 | { 26 | "name":"client_id_test_utility_service_out_low", 27 | "id":"0x5911" 28 | }, 29 | { 30 | "name":"client_id_test_utility_service_out_high", 31 | "id":"0x7411" 32 | } 33 | ], 34 | "routing":"vsomeipd" 35 | } 36 | -------------------------------------------------------------------------------- /vsomeip/test/client_id_tests/client_id_test_utility_masked_127.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "diagnosis":"0x63", 15 | "diagnosis_mask":"0xFF80", 16 | "applications": 17 | [ 18 | { 19 | "name":"client_id_test_utility_service_in", 20 | "id":"0x6311" 21 | }, 22 | { 23 | "name":"client_id_test_utility_service_in_two", 24 | "id":"0x6312" 25 | }, 26 | { 27 | "name":"client_id_test_utility_service_out_low", 28 | "id":"0x5911" 29 | }, 30 | { 31 | "name":"client_id_test_utility_service_out_high", 32 | "id":"0x7411" 33 | } 34 | ], 35 | "routing":"vsomeipd" 36 | } 37 | -------------------------------------------------------------------------------- /vsomeip/test/client_id_tests/client_id_test_utility_masked_4095.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "diagnosis":"0x63", 15 | "diagnosis_mask":"0xF000", 16 | "applications": 17 | [ 18 | { 19 | "name":"client_id_test_utility_service_in", 20 | "id":"0x6011" 21 | }, 22 | { 23 | "name":"client_id_test_utility_service_in_two", 24 | "id":"0x6012" 25 | }, 26 | { 27 | "name":"client_id_test_utility_service_out_low", 28 | "id":"0x5911" 29 | }, 30 | { 31 | "name":"client_id_test_utility_service_out_high", 32 | "id":"0x7411" 33 | } 34 | ], 35 | "routing":"vsomeipd" 36 | } 37 | -------------------------------------------------------------------------------- /vsomeip/test/client_id_tests/client_id_test_utility_masked_511.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "diagnosis":"0x63", 15 | "diagnosis_mask":"0xFE00", 16 | "applications": 17 | [ 18 | { 19 | "name":"client_id_test_utility_service_in", 20 | "id":"0x6211" 21 | }, 22 | { 23 | "name":"client_id_test_utility_service_in_two", 24 | "id":"0x6212" 25 | }, 26 | { 27 | "name":"client_id_test_utility_service_out_low", 28 | "id":"0x5911" 29 | }, 30 | { 31 | "name":"client_id_test_utility_service_out_high", 32 | "id":"0x7411" 33 | } 34 | ], 35 | "routing":"vsomeipd" 36 | } 37 | -------------------------------------------------------------------------------- /vsomeip/test/cpu_load_tests/conf/cpu_load_test_client_master.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_MASTER@", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "false", 11 | "path" : "/var/log/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "false" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "cpu_load_test_client", 21 | "id" : "0x2222" 22 | } 23 | ], 24 | "routing" : "cpu_load_test_client", 25 | "service-discovery" : 26 | { 27 | "enable" : "true", 28 | "multicast" : "224.0.0.1", 29 | "port" : "30490", 30 | "protocol" : "udp" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsomeip/test/cpu_load_tests/conf/cpu_load_test_client_slave.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_SLAVE@", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "false", 11 | "path" : "/var/log/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "false" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "cpu_load_test_client", 21 | "id" : "0x2222" 22 | } 23 | ], 24 | "routing" : "cpu_load_test_client", 25 | "service-discovery" : 26 | { 27 | "enable" : "true", 28 | "multicast" : "224.0.0.1", 29 | "port" : "30490", 30 | "protocol" : "udp" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsomeip/test/cpu_load_tests/conf/cpu_load_test_service_master.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_MASTER@", 3 | "logging" : 4 | { 5 | "level" : "debug", 6 | "console" : "true", 7 | "file" : 8 | { 9 | "enable" : "false", 10 | "path" : "/tmp/vsomeip.log" 11 | }, 12 | 13 | "dlt" : "false" 14 | }, 15 | 16 | "applications" : 17 | [ 18 | { 19 | "name" : "cpu_load_test_service", 20 | "id" : "0x1111" 21 | } 22 | ], 23 | 24 | "services" : 25 | [ 26 | { 27 | "service" : "0x1111", 28 | "instance" : "0x1", 29 | "unreliable" : "30510", 30 | "reliable" : 31 | { 32 | "port" : "30510", 33 | "enable-magic-cookies" : "false" 34 | } 35 | } 36 | ], 37 | 38 | "routing" : "cpu_load_test_service", 39 | "service-discovery" : 40 | { 41 | "enable" : "true", 42 | "multicast" : "224.0.0.1", 43 | "port" : "30490", 44 | "protocol" : "udp" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vsomeip/test/cpu_load_tests/conf/cpu_load_test_service_slave.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_SLAVE@", 3 | "logging" : 4 | { 5 | "level" : "debug", 6 | "console" : "true", 7 | "file" : 8 | { 9 | "enable" : "false", 10 | "path" : "/tmp/vsomeip.log" 11 | }, 12 | 13 | "dlt" : "false" 14 | }, 15 | 16 | "applications" : 17 | [ 18 | { 19 | "name" : "cpu_load_test_service", 20 | "id" : "0x1111" 21 | } 22 | ], 23 | 24 | "services" : 25 | [ 26 | { 27 | "service" : "0x1111", 28 | "instance" : "0x1", 29 | "unreliable" : "30510", 30 | "reliable" : 31 | { 32 | "port" : "30510", 33 | "enable-magic-cookies" : "false" 34 | } 35 | } 36 | ], 37 | 38 | "routing" : "cpu_load_test_service", 39 | "service-discovery" : 40 | { 41 | "enable" : "true", 42 | "multicast" : "224.0.0.1", 43 | "port" : "30490", 44 | "protocol" : "udp" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vsomeip/test/cpu_load_tests/cpu_load_measurer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | class cpu_load_measurer { 11 | public: 12 | cpu_load_measurer(std::uint32_t _pid); 13 | virtual ~cpu_load_measurer(); 14 | void start(); 15 | void stop(); 16 | void print_cpu_load() const; 17 | double get_cpu_load() const; 18 | 19 | private: 20 | std::uint64_t read_proc_stat(std::uint64_t* _idle); 21 | std::uint64_t read_proc_pid_stat(); 22 | bool read_clock_ticks(); 23 | private: 24 | std::uint32_t pid_; 25 | std::uint64_t jiffies_complete_start_; 26 | std::uint64_t jiffies_idle_start_; 27 | std::uint64_t jiffies_complete_stop_; 28 | std::uint64_t jiffies_idle_stop_; 29 | std::uint64_t clock_ticks_; 30 | std::uint64_t jiffies_passed_pid_start_; 31 | std::uint64_t jiffies_passed_pid_stop_; 32 | double cpu_load_pid_; 33 | double cpu_load_overall_; 34 | double cpu_load_pid_wo_idle_; 35 | }; 36 | -------------------------------------------------------------------------------- /vsomeip/test/cpu_load_tests/cpu_load_test_globals.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #pragma once 7 | 8 | namespace cpu_load_test { 9 | 10 | static constexpr vsomeip::service_t service_id(0x1111); 11 | static constexpr vsomeip::instance_t instance_id(0x1); 12 | static constexpr vsomeip::method_t method_id(0x1111); 13 | static constexpr vsomeip::byte_t load_test_data(0xDD); 14 | static constexpr vsomeip::length_t default_payload_length(40); 15 | static constexpr vsomeip::method_t method_id_shutdown(0x7777); 16 | static constexpr vsomeip::method_t method_id_cpu_measure_start(0x8888); 17 | static constexpr vsomeip::method_t method_id_cpu_measure_stop(0x9999); 18 | } 19 | -------------------------------------------------------------------------------- /vsomeip/test/header_factory_tests/header_factory_test_client_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | export VSOMEIP_APPLICATION_NAME=header_factory_test_client 7 | export VSOMEIP_CONFIGURATION=header_factory_test_client.json 8 | ./header_factory_test_client 9 | -------------------------------------------------------------------------------- /vsomeip/test/header_factory_tests/header_factory_test_service.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef HEADERFACTORYTESTSERVICE_HPP_ 7 | #define HEADERFACTORYTESTSERVICE_HPP_ 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "../someip_test_globals.hpp" 18 | 19 | class header_factory_test_service 20 | { 21 | public: 22 | header_factory_test_service(bool _use_static_routing); 23 | bool init(); 24 | void start(); 25 | void stop(); 26 | void offer(); 27 | void stop_offer(); 28 | void join_offer_thread(); 29 | void on_state(vsomeip::state_type_e _state); 30 | void on_message(const std::shared_ptr &_request); 31 | void run(); 32 | 33 | private: 34 | std::shared_ptr app_; 35 | bool is_registered_; 36 | bool use_static_routing_; 37 | 38 | std::mutex mutex_; 39 | std::condition_variable condition_; 40 | bool blocked_; 41 | std::uint32_t number_of_received_messages_; 42 | std::thread offer_thread_; 43 | }; 44 | 45 | #endif /* HEADERFACTORYTESTSERVICE_HPP_ */ 46 | -------------------------------------------------------------------------------- /vsomeip/test/header_factory_tests/header_factory_test_service_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=header_factory_test_service 8 | export VSOMEIP_CONFIGURATION=header_factory_test_service.json 9 | ./header_factory_test_service 10 | -------------------------------------------------------------------------------- /vsomeip/test/magic_cookies_tests/magic_cookies_test_client_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=magic_cookies_test_client 8 | export VSOMEIP_CONFIGURATION=magic_cookies_test_client.json 9 | ./magic_cookies_test_client 10 | -------------------------------------------------------------------------------- /vsomeip/test/magic_cookies_tests/magic_cookies_test_service_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=magic_cookies_test_service 8 | export VSOMEIP_CONFIGURATION=magic_cookies_test_service.json 9 | ./magic_cookies_test_service --tcp --static-routing 10 | -------------------------------------------------------------------------------- /vsomeip/test/malicious_data_tests/conf/malicious_data_test_master.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "logging": 4 | { 5 | "level":"info", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications" : 15 | [ 16 | { 17 | "name" : "malicious_data_test_service", 18 | "id" : "0x4289", 19 | "max_dispatch_time" : "1000" 20 | } 21 | ], 22 | "services": 23 | [ 24 | { 25 | "service":"0x3345", 26 | "instance":"0x0001", 27 | "unreliable":"30001", 28 | "reliable": 29 | { 30 | "port":"40001", 31 | "enable-magic-cookies":"false" 32 | } 33 | } 34 | ], 35 | "routing":"vsomeipd", 36 | "service-discovery": 37 | { 38 | "enable":"true", 39 | "multicast":"224.0.24.1", 40 | "port":"30490", 41 | "protocol":"udp", 42 | "cyclic_offer_delay" : "1000" 43 | } 44 | } -------------------------------------------------------------------------------- /vsomeip/test/malicious_data_tests/malicious_data_test_globals.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef MALICIOUS_DATA_TEST_GLOBALS_HPP_ 7 | #define MALICIOUS_DATA_TEST_GLOBALS_HPP_ 8 | 9 | namespace malicious_data_test { 10 | 11 | struct service_info { 12 | vsomeip::service_t service_id; 13 | vsomeip::instance_t instance_id; 14 | vsomeip::method_t method_id; 15 | vsomeip::event_t event_id; 16 | vsomeip::eventgroup_t eventgroup_id; 17 | vsomeip::method_t shutdown_method_id; 18 | vsomeip::method_t notify_method_id; 19 | }; 20 | 21 | struct service_info service = { 0x3344, 0x1, 0x1111, 0x8002, 0x1, 0x1404, 0x4242 }; 22 | 23 | enum test_mode_e { 24 | SUBSCRIBE, 25 | SUBSCRIBE_UNSUBSCRIBE, 26 | UNSUBSCRIBE, 27 | SUBSCRIBE_UNSUBSCRIBE_NACK 28 | }; 29 | 30 | } 31 | 32 | #endif /* MALICIOUS_DATA_TEST_GLOBALS_HPP_ */ 33 | -------------------------------------------------------------------------------- /vsomeip/test/offer_tests/conf/offer_test_big_sd_msg_master.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "logging": 4 | { 5 | "level":"warning", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications" : 15 | [ 16 | { 17 | "name" : "offer_test_big_sd_msg_client", 18 | "id" : "0x6666" 19 | } 20 | ], 21 | "routing":"vsomeipd", 22 | "service-discovery": 23 | { 24 | "enable":"true", 25 | "ttl" : "3", 26 | "multicast":"224.0.11.1", 27 | "port":"30490", 28 | "protocol":"udp", 29 | "cyclic_offer_delay" : "1000" 30 | } 31 | } -------------------------------------------------------------------------------- /vsomeip/test/offer_tests/conf/offer_test_external_master.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "logging": 4 | { 5 | "level":"info", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "services": 15 | [ 16 | { 17 | "service":"0x1111", 18 | "instance":"0x0001", 19 | "unreliable":"30001", 20 | "reliable": 21 | { 22 | "port":"40001", 23 | "enable-magic-cookies":"false" 24 | } 25 | } 26 | ], 27 | "routing":"vsomeipd", 28 | "service-discovery": 29 | { 30 | "enable":"true", 31 | "multicast":"224.0.0.1", 32 | "port":"30490", 33 | "protocol":"udp", 34 | "cyclic_offer_delay" : "500" 35 | } 36 | } -------------------------------------------------------------------------------- /vsomeip/test/offer_tests/conf/offer_test_external_slave.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_SLAVE@", 3 | "logging": 4 | { 5 | "level":"info", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "services": 15 | [ 16 | { 17 | "service":"0x1111", 18 | "instance":"0x0001", 19 | "unreliable":"30001", 20 | "reliable": 21 | { 22 | "port":"40001", 23 | "enable-magic-cookies":"false" 24 | } 25 | } 26 | ], 27 | "routing":"vsomeipd", 28 | "service-discovery": 29 | { 30 | "enable":"true", 31 | "multicast":"224.0.0.1", 32 | "port":"30490", 33 | "protocol":"udp", 34 | "cyclic_offer_delay" : "500" 35 | } 36 | } -------------------------------------------------------------------------------- /vsomeip/test/offer_tests/offer_test_big_sd_msg_slave_starter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | FAIL=0 8 | # Rejecting offer for which there is already a remote offer: 9 | # * start daemon 10 | # * start application which offers service 11 | # * start daemon remotely 12 | # * start same application which offers the same service again remotely 13 | # -> should be rejected as there is already a service instance 14 | # running in the network 15 | 16 | export VSOMEIP_CONFIGURATION=offer_test_big_sd_msg_slave.json 17 | # start daemon 18 | ../daemon/./vsomeipd & 19 | PID_VSOMEIPD=$! 20 | sleep 1 21 | # Start the services 22 | ./offer_test_big_sd_msg_service & 23 | PID_SERVICE_TWO=$! 24 | sleep 1 25 | 26 | # Wait until all clients and services are finished 27 | for job in $PID_SERVICE_TWO 28 | do 29 | # Fail gets incremented if a client exits with a non-zero exit code 30 | wait $job || FAIL=$(($FAIL+1)) 31 | done 32 | 33 | # kill the services 34 | kill $PID_VSOMEIPD 35 | sleep 1 36 | 37 | 38 | 39 | # Check if everything went well 40 | if [ $FAIL -eq 0 ] 41 | then 42 | exit 0 43 | else 44 | exit 1 45 | fi 46 | -------------------------------------------------------------------------------- /vsomeip/test/offer_tests/offer_test_external_slave_starter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | FAIL=0 8 | # Rejecting offer for which there is already a remote offer: 9 | # * start daemon 10 | # * start application which offers service 11 | # * start daemon remotely 12 | # * start same application which offers the same service again remotely 13 | # -> should be rejected as there is already a service instance 14 | # running in the network 15 | 16 | export VSOMEIP_CONFIGURATION=offer_test_external_slave.json 17 | # start daemon 18 | ../daemon/./vsomeipd & 19 | PID_VSOMEIPD=$! 20 | sleep 1 21 | # Start the services 22 | ./offer_test_service_external 2 & 23 | PID_SERVICE_TWO=$! 24 | sleep 1 25 | 26 | # Wait until all clients and services are finished 27 | for job in $PID_SERVICE_TWO 28 | do 29 | # Fail gets incremented if a client exits with a non-zero exit code 30 | wait $job || FAIL=$(($FAIL+1)) 31 | done 32 | 33 | # kill the services 34 | kill $PID_VSOMEIPD 35 | sleep 1 36 | 37 | 38 | 39 | # Check if everything went well 40 | if [ $FAIL -eq 0 ] 41 | then 42 | exit 0 43 | else 44 | exit 1 45 | fi 46 | -------------------------------------------------------------------------------- /vsomeip/test/offer_tests/offer_test_globals.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef OFFER_TEST_GLOBALS_HPP_ 7 | #define OFFER_TEST_GLOBALS_HPP_ 8 | 9 | namespace offer_test { 10 | 11 | struct service_info { 12 | vsomeip::service_t service_id; 13 | vsomeip::instance_t instance_id; 14 | vsomeip::method_t method_id; 15 | vsomeip::event_t event_id; 16 | vsomeip::eventgroup_t eventgroup_id; 17 | vsomeip::method_t shutdown_method_id; 18 | }; 19 | 20 | struct service_info service = { 0x1111, 0x1, 0x1111, 0x1111, 0x1000, 0x1404 }; 21 | 22 | static constexpr int number_of_messages_to_send = 150; 23 | 24 | static constexpr std::uint16_t big_msg_number_services = 300; 25 | static constexpr vsomeip::event_t big_msg_event_id = 0x8000; 26 | static constexpr vsomeip::eventgroup_t big_msg_eventgroup_id = 0x1; 27 | } 28 | 29 | #endif /* OFFER_TEST_GLOBALS_HPP_ */ 30 | -------------------------------------------------------------------------------- /vsomeip/test/offer_tests/offer_test_local.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"127.0.0.1", 3 | "logging": 4 | { 5 | "level":"info", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "routing":"vsomeipd", 15 | "service-discovery": 16 | { 17 | "enable":"false" 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /vsomeip/test/offered_services_info_test/offered_services_info_test_globals.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef OFFER_TEST_GLOBALS_HPP_ 7 | #define OFFER_TEST_GLOBALS_HPP_ 8 | 9 | namespace offer_test { 10 | 11 | struct service_info { 12 | vsomeip::service_t service_id; 13 | vsomeip::instance_t instance_id; 14 | vsomeip::method_t method_id; 15 | vsomeip::event_t event_id; 16 | vsomeip::eventgroup_t eventgroup_id; 17 | vsomeip::method_t shutdown_method_id; 18 | }; 19 | 20 | uint8_t num_all_offered_services = 5; 21 | uint8_t num_local_offered_services = 2; 22 | uint8_t num_remote_offered_services = 3; 23 | 24 | 25 | struct service_info service = { 0x1111, 0x1, 0x1111, 0x1111, 0x1000, 0x1404 }; 26 | struct service_info remote_service = { 0x2222, 0x2, 0x2222, 0x2222, 0x2000, 0x2808 }; 27 | } 28 | 29 | #endif /* OFFER_TEST_GLOBALS_HPP_ */ 30 | -------------------------------------------------------------------------------- /vsomeip/test/offered_services_info_test/offered_services_info_test_local.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "127.0.0.1", 3 | "diagnosis":"0x12", 4 | "logging" : 5 | { 6 | "level" : "warning", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "false", 11 | "path" : "/tmp/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "false" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "offered_services_info_test_service", 21 | "id" : "0x1277" 22 | } 23 | ], 24 | 25 | "services" : 26 | [ 27 | { 28 | "service" : "0x1111", 29 | "instance" : "0x1" 30 | }, 31 | { 32 | "service" : "0x2222", 33 | "instance" : "0x2", 34 | "reliable" : { "port" : "30502" }, 35 | "unreliable" : "31002" 36 | }, 37 | { 38 | "service" : "0x2223", 39 | "instance" : "0x3", 40 | "reliable" : { "port" : "30503" } 41 | }, 42 | { 43 | "service" : "0x2224", 44 | "instance" : "0x4", 45 | "unreliable" : "31004" 46 | } 47 | ], 48 | 49 | "routing" : "vsomeipd", 50 | "service-discovery" : 51 | { 52 | "enable" : "false", 53 | "multicast" : "224.0.0.1", 54 | "port" : "30490", 55 | "protocol" : "udp" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/conf/external_local_payload_test_client_external.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_SLAVE@", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "true", 11 | "path" : "/var/log/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "true" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "external_local_payload_test_client_external", 21 | "id" : "0x1343" 22 | } 23 | ], 24 | 25 | "services" : 26 | [ 27 | { 28 | "service" : "0x1234", 29 | "instance" : "0x5678", 30 | "unicast" : "@TEST_IP_MASTER@", 31 | "unreliable" : "30509", 32 | "reliable" : 33 | { 34 | "port" : "30510", 35 | "enable-magic-cookies" : "false" 36 | } 37 | } 38 | ], 39 | 40 | "routing" : "external_local_payload_test_client_external", 41 | "service-discovery" : 42 | { 43 | "enable" : "false", 44 | "multicast" : "224.0.0.1", 45 | "port" : "30491", 46 | "protocol" : "udp" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/conf/external_local_payload_test_client_local.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_MASTER@", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "true", 11 | "path" : "/var/log/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "true" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "external_local_payload_test_client_local", 21 | "id" : "0x1343" 22 | } 23 | ], 24 | 25 | 26 | "services" : 27 | [ 28 | { 29 | "service" : "0x1234", 30 | "instance" : "0x5678", 31 | "unicast" : "@TEST_IP_MASTER@", 32 | "unreliable" : "30509", 33 | "reliable" : 34 | { 35 | "port" : "30510", 36 | "enable-magic-cookies" : "false" 37 | } 38 | } 39 | ], 40 | 41 | "routing" : "external_local_payload_test_service", 42 | "service-discovery" : 43 | { 44 | "enable" : "false", 45 | "multicast" : "224.0.0.1", 46 | "port" : "30491", 47 | "protocol" : "udp" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/conf/external_local_payload_test_service.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_MASTER@", 3 | "logging" : 4 | { 5 | "level" : "debug", 6 | "console" : "true", 7 | "file" : 8 | { 9 | "enable" : "false", 10 | "path" : "/tmp/vsomeip.log" 11 | }, 12 | 13 | "dlt" : "false" 14 | }, 15 | 16 | "applications" : 17 | [ 18 | { 19 | "name" : "external_local_payload_test_service", 20 | "id" : "0x1277" 21 | } 22 | ], 23 | 24 | "services" : 25 | [ 26 | { 27 | "service" : "0x1234", 28 | "instance" : "0x5678", 29 | "unreliable" : "30509", 30 | "reliable" : 31 | { 32 | "port" : "30510", 33 | "enable-magic-cookies" : "false" 34 | } 35 | } 36 | ], 37 | 38 | "routing" : "external_local_payload_test_service", 39 | "service-discovery" : 40 | { 41 | "enable" : "false", 42 | "multicast" : "224.0.0.1", 43 | "port" : "30490", 44 | "protocol" : "udp" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/external_local_payload_test_client_external_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=external_local_payload_test_client_external 8 | export VSOMEIP_CONFIGURATION=external_local_payload_test_client_external.json 9 | ./payload_test_client --udp --max-payload-size UDP 10 | # We sleep to let the service restart with --tcp option so we can test 11 | # communication via TCP. 12 | sleep 5 13 | ./payload_test_client --tcp --max-payload-size TCP 14 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/external_local_payload_test_client_local_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=external_local_payload_test_client_local 8 | export VSOMEIP_CONFIGURATION=external_local_payload_test_client_local.json 9 | ./payload_test_client 10 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/external_local_payload_test_service_client_external_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=external_local_payload_test_service 8 | export VSOMEIP_CONFIGURATION=external_local_payload_test_service.json 9 | ./payload_test_service --udp 10 | # After payload was measured with UDP the client will restart and measure 11 | # throughput with TCP 12 | ./payload_test_service --tcp -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/external_local_payload_test_service_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=external_local_payload_test_service 8 | export VSOMEIP_CONFIGURATION=external_local_payload_test_service.json 9 | ./payload_test_service 10 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/local_payload_test_client.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "127.0.0.1", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "true", 11 | "path" : "/var/log/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "true" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "local_payload_test_client", 21 | "id" : "0x1343" 22 | } 23 | ], 24 | "services" : 25 | [ 26 | ], 27 | 28 | "routing" : "local_payload_test_service", 29 | "service-discovery" : 30 | { 31 | "enable" : "false", 32 | "multicast" : "224.0.0.1", 33 | "port" : "30491", 34 | "protocol" : "udp" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/local_payload_test_client_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=local_payload_test_client 8 | export VSOMEIP_CONFIGURATION=local_payload_test_client.json 9 | ./payload_test_client 10 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/local_payload_test_service.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "127.0.0.1", 3 | "logging" : 4 | { 5 | "level" : "debug", 6 | "console" : "true", 7 | "file" : 8 | { 9 | "enable" : "false", 10 | "path" : "/tmp/vsomeip.log" 11 | }, 12 | 13 | "dlt" : "false" 14 | }, 15 | 16 | "applications" : 17 | [ 18 | { 19 | "name" : "local_payload_test_service", 20 | "id" : "0x1277" 21 | } 22 | ], 23 | 24 | "services" : 25 | [ 26 | { 27 | "service" : "0x1234", 28 | "instance" : "0x5678" 29 | } 30 | ], 31 | 32 | "routing" : "local_payload_test_service", 33 | "service-discovery" : 34 | { 35 | "enable" : "false", 36 | "multicast" : "224.0.0.1", 37 | "port" : "30490", 38 | "protocol" : "udp" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/local_payload_test_service_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=local_payload_test_service 8 | export VSOMEIP_CONFIGURATION=local_payload_test_service.json 9 | ./payload_test_service 10 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/stopwatch.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #include "stopwatch.hpp" 7 | 8 | #include 9 | #include 10 | 11 | 12 | #define USEC_PER_SEC 1000000ULL 13 | #define NSEC_PER_USEC 1000ULL 14 | 15 | 16 | stop_watch::usec_t stop_watch::get_total_elapsed_microseconds() const { 17 | usec_t elapsed = total_elapsed_; 18 | 19 | if (started_) 20 | elapsed += get_elapsed(); 21 | 22 | return elapsed; 23 | } 24 | 25 | stop_watch::usec_t stop_watch::get_total_elapsed_seconds() const { 26 | return get_total_elapsed_microseconds() / USEC_PER_SEC; 27 | } 28 | 29 | stop_watch::usec_t stop_watch::now() { 30 | struct timespec ts; 31 | 32 | const int ret = clock_gettime(CLOCK_MONOTONIC_RAW, &ts); 33 | assert(!ret); 34 | static_cast(ret); // prevent warning in release build 35 | 36 | return (usec_t) ts.tv_sec * USEC_PER_SEC + (usec_t) ts.tv_nsec / NSEC_PER_USEC; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /vsomeip/test/payload_tests/stopwatch.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef STOP_WATCH_H_ 7 | #define STOP_WATCH_H_ 8 | 9 | #include 10 | 11 | 12 | class stop_watch 13 | { 14 | public: 15 | typedef uint64_t usec_t; 16 | 17 | stop_watch() : 18 | started_(false), 19 | start_time_point_(0), 20 | total_elapsed_(0) 21 | { 22 | } 23 | 24 | inline void reset() 25 | { 26 | started_ = false; 27 | total_elapsed_ = 0; 28 | } 29 | 30 | inline void start() 31 | { 32 | start_time_point_ = now(); 33 | started_ = true; 34 | } 35 | 36 | inline void stop() 37 | { 38 | total_elapsed_ += get_elapsed(); 39 | started_ = false; 40 | } 41 | 42 | usec_t get_total_elapsed_microseconds() const; 43 | usec_t get_total_elapsed_seconds() const; 44 | 45 | private: 46 | inline usec_t get_elapsed() const 47 | { 48 | return now() - start_time_point_; 49 | } 50 | 51 | static usec_t now(); 52 | 53 | bool started_; 54 | usec_t start_time_point_; 55 | usec_t total_elapsed_; 56 | }; 57 | 58 | #endif // STOP_WATCH_H_ 59 | -------------------------------------------------------------------------------- /vsomeip/test/pending_subscription_tests/conf/pending_subscription_test_master.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast":"@TEST_IP_MASTER@", 3 | "logging": 4 | { 5 | "level":"info", 6 | "console":"true", 7 | "file": 8 | { 9 | "enable":"false", 10 | "path":"/tmp/vsomeip.log" 11 | }, 12 | "dlt":"false" 13 | }, 14 | "applications" : 15 | [ 16 | { 17 | "name" : "pending_subscription_test_service", 18 | "id" : "0xCAFE", 19 | "max_dispatch_time" : "1000" 20 | } 21 | ], 22 | "services": 23 | [ 24 | { 25 | "service":"0x1122", 26 | "instance":"0x0001", 27 | "unreliable":"30001", 28 | "reliable": 29 | { 30 | "port":"40001", 31 | "enable-magic-cookies":"false" 32 | } 33 | } 34 | ], 35 | "routing":"vsomeipd", 36 | "service-discovery": 37 | { 38 | "enable":"true", 39 | "multicast":"224.0.23.1", 40 | "port":"30490", 41 | "protocol":"udp", 42 | "cyclic_offer_delay" : "1000" 43 | } 44 | } -------------------------------------------------------------------------------- /vsomeip/test/pending_subscription_tests/pending_subscription_test_globals.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef PENDING_SUBSCRIPTION_TEST_GLOBALS_HPP_ 7 | #define PENDING_SUBSCRIPTION_TEST_GLOBALS_HPP_ 8 | 9 | namespace pending_subscription_test { 10 | 11 | struct service_info { 12 | vsomeip::service_t service_id; 13 | vsomeip::instance_t instance_id; 14 | vsomeip::method_t method_id; 15 | vsomeip::event_t event_id; 16 | vsomeip::eventgroup_t eventgroup_id; 17 | vsomeip::method_t shutdown_method_id; 18 | vsomeip::method_t notify_method_id; 19 | }; 20 | 21 | struct service_info service = { 0x1122, 0x1, 0x1111, 0x1111, 0x1000, 0x1404, 0x4242 }; 22 | 23 | enum test_mode_e { 24 | SUBSCRIBE, 25 | SUBSCRIBE_UNSUBSCRIBE, 26 | UNSUBSCRIBE, 27 | SUBSCRIBE_UNSUBSCRIBE_NACK, 28 | SUBSCRIBE_UNSUBSCRIBE_SAME_PORT, 29 | SUBSCRIBE_RESUBSCRIBE_MIXED, 30 | SUBSCRIBE_STOPSUBSCRIBE_SUBSCRIBE 31 | }; 32 | 33 | } 34 | 35 | #endif /* PENDING_SUBSCRIPTION_TEST_GLOBALS_HPP_ */ 36 | -------------------------------------------------------------------------------- /vsomeip/test/restart_routing_tests/restart_routing_test_autoconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "127.0.0.1", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "warning", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "true", 11 | "path" : "/var/log/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "true" 15 | }, 16 | 17 | "service-discovery" : 18 | { 19 | "enable" : "false", 20 | "multicast" : "224.0.0.1", 21 | "port" : "30491", 22 | "protocol" : "udp" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vsomeip/test/restart_routing_tests/restart_routing_test_client.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "127.0.0.1", 3 | "netmask" : "255.255.255.0", 4 | "logging" : 5 | { 6 | "level" : "warning", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "true", 11 | "path" : "/var/log/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "true" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "restart_routing_test_client1", 21 | "id" : "0x1343" 22 | }, 23 | { 24 | "name" : "restart_routing_test_client2", 25 | "id" : "0x1344" 26 | }, 27 | { 28 | "name" : "restart_routing_test_client3", 29 | "id" : "0x1345" 30 | }, 31 | { 32 | "name" : "restart_routing_test_client4", 33 | "id" : "0x1346" 34 | } 35 | ], 36 | "services" : 37 | [ 38 | ], 39 | 40 | "routing" : "vsomeipd", 41 | "service-discovery" : 42 | { 43 | "enable" : "false", 44 | "multicast" : "224.0.0.1", 45 | "port" : "30491", 46 | "protocol" : "udp" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vsomeip/test/restart_routing_tests/restart_routing_test_client_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=restart_routing_test_client 8 | export VSOMEIP_CONFIGURATION=restart_routing_test_client.json 9 | ./restart_routing_test_client 10 | -------------------------------------------------------------------------------- /vsomeip/test/restart_routing_tests/restart_routing_test_service.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef RESTART_ROUTING_TEST_SERVICE_HPP 7 | #define RESTART_ROUTING_TEST_SERVICE_HPP 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include "../someip_test_globals.hpp" 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | class routing_restart_test_service { 20 | public: 21 | routing_restart_test_service(); 22 | bool init(); 23 | void start(); 24 | void stop(); 25 | void offer(); 26 | void stop_offer(); 27 | void join_offer_thread(); 28 | void on_state(vsomeip::state_type_e _state); 29 | void on_message(const std::shared_ptr &_request); 30 | void on_message_shutdown(const std::shared_ptr &_request); 31 | void run(); 32 | 33 | private: 34 | std::shared_ptr app_; 35 | bool is_registered_; 36 | 37 | std::mutex mutex_; 38 | std::condition_variable condition_; 39 | bool blocked_; 40 | std::uint32_t number_of_received_messages_; 41 | std::thread offer_thread_; 42 | }; 43 | 44 | #endif // RESTART_ROUTING_TEST_SERVICE_HPP 45 | -------------------------------------------------------------------------------- /vsomeip/test/restart_routing_tests/restart_routing_test_service.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "127.0.0.1", 3 | "logging" : 4 | { 5 | "level" : "warning", 6 | "console" : "true", 7 | "file" : 8 | { 9 | "enable" : "false", 10 | "path" : "/tmp/vsomeip.log" 11 | }, 12 | 13 | "dlt" : "false" 14 | }, 15 | 16 | "applications" : 17 | [ 18 | { 19 | "name" : "vsomeipd", 20 | "id" : "0x0815" 21 | }, 22 | { 23 | "name" : "restart_routing_test_service", 24 | "id" : "0x1277" 25 | } 26 | ], 27 | 28 | "services" : 29 | [ 30 | { 31 | "service" : "0x1234", 32 | "instance" : "0x5678" 33 | } 34 | ], 35 | 36 | "routing" : "vsomeipd", 37 | "service-discovery" : 38 | { 39 | "enable" : "false", 40 | "multicast" : "224.0.0.1", 41 | "port" : "30490", 42 | "protocol" : "udp" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vsomeip/test/restart_routing_tests/restart_routing_test_service_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=restart_routing_test_service 8 | export VSOMEIP_CONFIGURATION=restart_routing_test_service.json 9 | ./restart_routing_test_service 10 | -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/conf/external_local_routing_test_client_external.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_SLAVE@", 3 | "netmask" : "255.255.255.0", 4 | "diagnosis" : "0x16", 5 | "logging" : 6 | { 7 | "level" : "debug", 8 | "console" : "true", 9 | "file" : 10 | { 11 | "enable" : "true", 12 | "path" : "/var/log/vsomeip.log" 13 | }, 14 | 15 | "dlt" : "true" 16 | }, 17 | 18 | "applications" : 19 | [ 20 | { 21 | "name" : "external_local_routing_test_client_external", 22 | "id" : "0x1644" 23 | } 24 | ], 25 | 26 | "services" : 27 | [ 28 | { 29 | "service" : "0x1234", 30 | "instance" : "0x5678", 31 | "unicast" : "@TEST_IP_MASTER@", 32 | "unreliable" : "30509" 33 | } 34 | ], 35 | 36 | "routing" : "external_local_routing_test_client_external", 37 | "service-discovery" : 38 | { 39 | "enable" : "false", 40 | "multicast" : "224.0.0.1", 41 | "port" : "30491", 42 | "protocol" : "udp" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/conf/external_local_routing_test_service.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_MASTER@", 3 | "diagnosis":"0x12", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "false", 11 | "path" : "/tmp/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "false" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "external_local_routing_test_service", 21 | "id" : "0x1277" 22 | } 23 | ], 24 | 25 | "services" : 26 | [ 27 | { 28 | "service" : "0x1234", 29 | "instance" : "0x5678", 30 | "unreliable" : "30509" 31 | } 32 | ], 33 | 34 | "routing" : "external_local_routing_test_service", 35 | "service-discovery" : 36 | { 37 | "enable" : "false", 38 | "multicast" : "224.0.0.1", 39 | "port" : "30490", 40 | "protocol" : "udp" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/external_local_routing_test_client_external_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=external_local_routing_test_client_external 8 | export VSOMEIP_CONFIGURATION=external_local_routing_test_client_external.json 9 | ./local_routing_test_client 10 | -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/external_local_routing_test_service_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=external_local_routing_test_service 8 | export VSOMEIP_CONFIGURATION=external_local_routing_test_service.json 9 | ./external_local_routing_test_service 10 | -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/local_routing_test_client.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "127.0.0.1", 3 | "netmask" : "255.255.255.0", 4 | "diagnosis":"0x12", 5 | "logging" : 6 | { 7 | "level" : "debug", 8 | "console" : "true", 9 | "file" : 10 | { 11 | "enable" : "true", 12 | "path" : "/var/log/vsomeip.log" 13 | }, 14 | 15 | "dlt" : "true" 16 | }, 17 | 18 | "applications" : 19 | [ 20 | { 21 | "name" : "local_routing_test_client", 22 | "id" : "0x1255" 23 | } 24 | ], 25 | 26 | "services" : 27 | [ 28 | ], 29 | 30 | "routing" : "vsomeipd", 31 | "service-discovery" : 32 | { 33 | "enable" : "false", 34 | "multicast" : "224.0.0.1", 35 | "port" : "30491", 36 | "protocol" : "udp" 37 | } 38 | } -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/local_routing_test_client_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=local_routing_test_client 8 | export VSOMEIP_CONFIGURATION=local_routing_test_client.json 9 | ./local_routing_test_client 10 | -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/local_routing_test_service.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef LOCALROUTINGTESTSERVICE_HPP_ 7 | #define LOCALROUTINGTESTSERVICE_HPP_ 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "../someip_test_globals.hpp" 18 | 19 | class local_routing_test_service 20 | { 21 | public: 22 | local_routing_test_service(bool _use_static_routing); 23 | bool init(); 24 | void start(); 25 | void stop(); 26 | void offer(); 27 | void stop_offer(); 28 | void join_offer_thread(); 29 | void on_state(vsomeip::state_type_e _state); 30 | void on_message(const std::shared_ptr &_request); 31 | void run(); 32 | 33 | private: 34 | std::shared_ptr app_; 35 | bool is_registered_; 36 | bool use_static_routing_; 37 | 38 | bool blocked_; 39 | std::uint32_t number_of_received_messages_; 40 | std::mutex mutex_; 41 | std::condition_variable condition_; 42 | std::thread offer_thread_; 43 | }; 44 | 45 | #endif /* LOCALROUTINGTESTSERVICE_HPP_ */ 46 | -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/local_routing_test_service.json: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "127.0.0.1", 3 | "diagnosis":"0x12", 4 | "logging" : 5 | { 6 | "level" : "debug", 7 | "console" : "true", 8 | "file" : 9 | { 10 | "enable" : "false", 11 | "path" : "/tmp/vsomeip.log" 12 | }, 13 | 14 | "dlt" : "false" 15 | }, 16 | 17 | "applications" : 18 | [ 19 | { 20 | "name" : "local_routing_test_service", 21 | "id" : "0x1277" 22 | } 23 | ], 24 | 25 | "services" : 26 | [ 27 | { 28 | "service" : "0x1234", 29 | "instance" : "0x5678" 30 | } 31 | ], 32 | 33 | "routing" : "vsomeipd", 34 | "service-discovery" : 35 | { 36 | "enable" : "false", 37 | "multicast" : "224.0.0.1", 38 | "port" : "30490", 39 | "protocol" : "udp" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vsomeip/test/routing_tests/local_routing_test_service_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=local_routing_test_service 8 | export VSOMEIP_CONFIGURATION=local_routing_test_service.json 9 | ./local_routing_test_service 10 | -------------------------------------------------------------------------------- /vsomeip/test/security_tests/security_test_client.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | // This Source Code Form is subject to the terms of the Mozilla Public 4 | // License, v. 2.0. If a copy of the MPL was not distributed with this 5 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | #ifndef SECURITY_TEST_CLIENT_HPP 8 | #define SECURITY_TEST_CLIENT_HPP 9 | 10 | #include 11 | 12 | #include 13 | 14 | #include "../someip_test_globals.hpp" 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | class security_test_client { 22 | public: 23 | security_test_client(); 24 | bool init(); 25 | void start(); 26 | void stop(); 27 | 28 | void on_state(vsomeip::state_type_e _state); 29 | void on_availability(vsomeip::service_t _service, 30 | vsomeip::instance_t _instance, bool _is_available); 31 | void on_message(const std::shared_ptr &_response); 32 | 33 | void run(); 34 | void join_sender_thread(); 35 | 36 | private: 37 | void shutdown_service(); 38 | 39 | std::shared_ptr app_; 40 | 41 | std::mutex mutex_; 42 | std::condition_variable condition_; 43 | bool is_available_; 44 | 45 | std::thread sender_; 46 | 47 | std::atomic received_responses_; 48 | }; 49 | 50 | #endif // SECURITY_TEST_CLIENT_HPP 51 | -------------------------------------------------------------------------------- /vsomeip/test/security_tests/security_test_client_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_APPLICATION_NAME=client-sample 8 | export VSOMEIP_CONFIGURATION=vsomeip-security.json 9 | ./security_test_client 10 | -------------------------------------------------------------------------------- /vsomeip/test/security_tests/security_test_service.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef SECURITY_TEST_SERVICE_HPP 7 | #define SECURITY_TEST_SERVICE_HPP 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include "../someip_test_globals.hpp" 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | class security_test_service { 20 | public: 21 | security_test_service(); 22 | bool init(); 23 | void start(); 24 | void stop(); 25 | void offer(); 26 | void stop_offer(); 27 | void join_offer_thread(); 28 | void on_state(vsomeip::state_type_e _state); 29 | void on_message(const std::shared_ptr &_request); 30 | void on_message_shutdown(const std::shared_ptr &_request); 31 | void run(); 32 | 33 | private: 34 | std::shared_ptr app_; 35 | bool is_registered_; 36 | 37 | std::mutex mutex_; 38 | std::condition_variable condition_; 39 | bool blocked_; 40 | std::uint32_t number_of_received_messages_; 41 | std::thread offer_thread_; 42 | }; 43 | 44 | #endif // SECURITY_TEST_SERVICE_HPP 45 | -------------------------------------------------------------------------------- /vsomeip/test/security_tests/security_test_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | export VSOMEIP_CONFIGURATION=security_test_config.json 8 | 9 | export VSOMEIP_APPLICATION_NAME=service-sample 10 | ./security_test_service & 11 | 12 | sleep 1 13 | 14 | export VSOMEIP_APPLICATION_NAME=client-sample 15 | ./security_test_client 16 | -------------------------------------------------------------------------------- /vsomeip/test/subscribe_notify_one_tests/subscribe_notify_one_test_globals.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | // This Source Code Form is subject to the terms of the Mozilla Public 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | #ifndef SUBSCRIBE_NOTIFY_TEST_GLOBALS_HPP_ 7 | #define SUBSCRIBE_NOTIFY_TEST_GLOBALS_HPP_ 8 | 9 | namespace subscribe_notify_one_test { 10 | 11 | struct service_info { 12 | vsomeip::service_t service_id; 13 | vsomeip::instance_t instance_id; 14 | vsomeip::method_t method_id; 15 | vsomeip::event_t event_id; 16 | vsomeip::eventgroup_t eventgroup_id; 17 | }; 18 | 19 | static constexpr std::array service_infos = {{ 20 | // placeholder to be consistent w/ client ids, service ids, app names 21 | { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF }, 22 | // node 1 23 | { 0x1111, 0x1, 0x1111, 0x1111, 0x1000 }, 24 | { 0x2222, 0x1, 0x2222, 0x2222, 0x2000 }, 25 | { 0x3333, 0x1, 0x3333, 0x3333, 0x3000 }, 26 | // node 2 27 | { 0x4444, 0x1, 0x4444, 0x4444, 0x4000 }, 28 | { 0x5555, 0x1, 0x5555, 0x5555, 0x5000 }, 29 | { 0x6666, 0x1, 0x6666, 0x6666, 0x6000 } 30 | }}; 31 | 32 | static constexpr int notifications_to_send = 10; 33 | } 34 | 35 | #endif /* SUBSCRIBE_NOTIFY_TEST_GLOBALS_HPP_ */ 36 | -------------------------------------------------------------------------------- /vsomeip/test/subscribe_notify_tests/conf/subscribe_notify_test_one_event_two_eventgroups_master.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_MASTER@", 3 | "logging" : 4 | { 5 | "level" : "debug", 6 | "console" : "true", 7 | "file" : { "enable" : "false", "path" : "/var/log/vsomeip.log" }, 8 | "dlt" : "false" 9 | }, 10 | "applications" : 11 | [ 12 | { 13 | "name" : "subscribe_notify_test_client", 14 | "id" : "0x9999" 15 | } 16 | ], 17 | "routing" : "vsomeipd", 18 | "service-discovery" : 19 | { 20 | "enable":"true", 21 | "multicast":"224.0.0.1", 22 | "port":"30490", 23 | "protocol":"udp", 24 | "initial_delay_min" : "10", 25 | "initial_delay_max" : "10", 26 | "repetitions_base_delay" : "30", 27 | "repetitions_max" : "0", 28 | "cyclic_offer_delay" : "1000", 29 | "ttl" : "3" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vsomeip/test/subscribe_notify_tests/conf/subscribe_notify_test_one_event_two_eventgroups_tcp_slave.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_SLAVE@", 3 | "logging" : 4 | { 5 | "level" : "debug", 6 | "console" : "true", 7 | "file" : { "enable" : "false", "path" : "/tmp/vsomeip.log" }, 8 | "dlt" : "false" 9 | }, 10 | "applications" : 11 | [ 12 | { 13 | "name" : "subscribe_notify_test_service", 14 | "id" : "0x8888" 15 | } 16 | ], 17 | "services" : 18 | [ 19 | { 20 | "service" : "0xcafe", 21 | "instance" : "0x1", 22 | "reliable" : { "port":"30509", "enable-magic-cookies":"false" } 23 | } 24 | ], 25 | "routing" : "vsomeipd", 26 | "service-discovery" : 27 | { 28 | "enable":"true", 29 | "multicast":"224.0.0.1", 30 | "port":"30490", 31 | "protocol":"udp", 32 | "initial_delay_min" : "10", 33 | "initial_delay_max" : "10", 34 | "repetitions_base_delay" : "30", 35 | "repetitions_max" : "0", 36 | "cyclic_offer_delay" : "1000", 37 | "ttl" : "3" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vsomeip/test/subscribe_notify_tests/conf/subscribe_notify_test_one_event_two_eventgroups_udp_slave.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "unicast" : "@TEST_IP_SLAVE@", 3 | "logging" : 4 | { 5 | "level" : "debug", 6 | "console" : "true", 7 | "file" : { "enable" : "false", "path" : "/tmp/vsomeip.log" }, 8 | "dlt" : "false" 9 | }, 10 | "applications" : 11 | [ 12 | { 13 | "name" : "subscribe_notify_test_service", 14 | "id" : "0x8888" 15 | } 16 | ], 17 | "services" : 18 | [ 19 | { 20 | "service" : "0xcafe", 21 | "instance" : "0x1", 22 | "unreliable" : "30509" 23 | } 24 | ], 25 | "routing" : "vsomeipd", 26 | "service-discovery" : 27 | { 28 | "enable":"true", 29 | "multicast":"224.0.0.1", 30 | "port":"30490", 31 | "protocol":"udp", 32 | "initial_delay_min" : "10", 33 | "initial_delay_max" : "10", 34 | "repetitions_base_delay" : "30", 35 | "repetitions_max" : "0", 36 | "cyclic_offer_delay" : "1000", 37 | "ttl" : "3" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vsomeip/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 | # This Source Code Form is subject to the terms of the Mozilla Public 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | 6 | cmake_minimum_required (VERSION 2.8) 7 | 8 | # vsomeip_ctrl 9 | add_executable(vsomeip_ctrl EXCLUDE_FROM_ALL vsomeip_ctrl.cpp) 10 | target_link_libraries(vsomeip_ctrl 11 | vsomeip 12 | ${Boost_LIBRARIES} 13 | ${DL_LIBRARY} 14 | ${CMAKE_THREAD_LIBS_INIT} 15 | ) 16 | 17 | ################################################################################################### 18 | 19 | -------------------------------------------------------------------------------- /vsomeip/vsomeip.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@ 4 | includedir=@CMAKE_INSTALL_PREFIX@/include 5 | 6 | Name: @PROJECT@ 7 | Description: New SOME/IP stack, feature complete 8 | Version: @VSOMEIP_VERSION@ 9 | Libs: -L${libdir} -lvsomeip -lvsomeip-sd -lboost_system -lboost_log -lboost_filesystem 10 | Cflags: -I${includedir} 11 | 12 | -------------------------------------------------------------------------------- /vsomeip/vsomeipConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Config file for the vSomeIP package, defines the following variables: 2 | # VSOMEIP_INCLUDE_DIRS - include directories for vSomeIP 3 | # VSOMEIP_LIBRARIES - libraries to link against 4 | 5 | # Compute paths 6 | get_filename_component (VSOMEIP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 7 | set (VSOMEIP_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") 8 | 9 | # Our library dependencies (contains definitions for IMPORTED targets) 10 | if (NOT TARGET vsomeip AND NOT vsomeip_BINARY_DIR) 11 | include ("${VSOMEIP_CMAKE_DIR}/vsomeipTargets.cmake") 12 | endif () 13 | 14 | # These are IMPORTED targets created by vsomeipTargets.cmake 15 | set (VSOMEIP_LIBRARIES vsomeip) 16 | -------------------------------------------------------------------------------- /vsomeip/vsomeipConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set (PACKAGE_VERSION "@VSOMEIP_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set (PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else () 7 | set (PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set (PACKAGE_VERSION_EXACT TRUE) 10 | endif () 11 | endif () 12 | --------------------------------------------------------------------------------