summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLutz Bichler <Lutz.Bichler@bmw.de>2014-07-01 09:08:45 +0200
committerLutz Bichler <Lutz.Bichler@bmw.de>2014-07-01 09:08:45 +0200
commita111a08e42a227fb61426b210e69c6369eb96fff (patch)
treed922faa3443c166c83bf8f173cc19804eeec46ea
parent7dba9c645ee7a310ddb2bbd0d722a892f3ae6e34 (diff)
downloadvSomeIP-a111a08e42a227fb61426b210e69c6369eb96fff.tar.gz
Initial commit of redesigned vsomeip libraries.
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt (renamed from vsomeip/CMakeLists.txt)65
-rw-r--r--config/vsomeip-sample.xml41
-rw-r--r--config/vsomeip-test.xml107
-rw-r--r--config/vsomeip.xml69
-rw-r--r--implementation/application/include/application_impl.hpp148
-rw-r--r--implementation/application/include/runtime_impl.hpp27
-rw-r--r--implementation/application/src/application_impl.cpp354
-rw-r--r--implementation/application/src/runtime.cpp20
-rw-r--r--implementation/application/src/runtime_impl.cpp48
-rw-r--r--implementation/configuration/include/configuration_impl.hpp111
-rw-r--r--implementation/configuration/include/internal.hpp61
-rw-r--r--implementation/configuration/include/service.hpp28
-rw-r--r--implementation/configuration/include/servicegroup.hpp28
-rw-r--r--implementation/configuration/src/configuration.cpp15
-rw-r--r--implementation/configuration/src/configuration_impl.cpp579
-rw-r--r--implementation/endpoints/include/client_endpoint_impl.hpp83
-rw-r--r--implementation/endpoints/include/endpoint.hpp39
-rw-r--r--implementation/endpoints/include/endpoint_host.hpp25
-rw-r--r--implementation/endpoints/include/endpoint_impl.hpp63
-rw-r--r--implementation/endpoints/include/local_client_endpoint_impl.hpp45
-rw-r--r--implementation/endpoints/include/local_server_endpoint_impl.hpp87
-rw-r--r--implementation/endpoints/include/server_endpoint_impl.hpp68
-rw-r--r--implementation/endpoints/include/tcp_client_endpoint_impl.hpp42
-rw-r--r--implementation/endpoints/include/tcp_server_endpoint_impl.hpp85
-rw-r--r--implementation/endpoints/include/udp_client_endpoint_impl.hpp (renamed from vsomeip/include/vsomeip_internal/udp_client_impl.hpp)30
-rw-r--r--implementation/endpoints/include/udp_server_endpoint_impl.hpp (renamed from vsomeip/include/vsomeip_internal/udp_service_impl.hpp)33
-rw-r--r--implementation/endpoints/src/client_endpoint_impl.cpp214
-rw-r--r--implementation/endpoints/src/endpoint_impl.cpp131
-rw-r--r--implementation/endpoints/src/local_client_endpoint_impl.cpp124
-rw-r--r--implementation/endpoints/src/local_server_endpoint_impl.cpp207
-rw-r--r--implementation/endpoints/src/server_endpoint_impl.cpp173
-rw-r--r--implementation/endpoints/src/tcp_client_endpoint_impl.cpp112
-rw-r--r--implementation/endpoints/src/tcp_server_endpoint_impl.cpp197
-rw-r--r--implementation/endpoints/src/udp_client_endpoint_impl.cpp105
-rw-r--r--implementation/endpoints/src/udp_server_endpoint_impl.cpp137
-rw-r--r--implementation/examples/client-sample.cpp122
-rw-r--r--implementation/examples/service-sample.cpp86
-rw-r--r--implementation/logging/include/logger_impl.hpp58
-rw-r--r--implementation/logging/src/logger.cpp16
-rw-r--r--implementation/logging/src/logger_impl.cpp (renamed from vsomeip/src/vsomeip/log_owner.cpp)113
-rw-r--r--implementation/message/include/byteorder.hpp (renamed from vsomeip/include/vsomeip_internal/byteorder.hpp)23
-rw-r--r--implementation/message/include/deserializer.hpp (renamed from vsomeip/include/vsomeip_internal/deserializer.hpp)27
-rw-r--r--implementation/message/include/message_base_impl.hpp65
-rw-r--r--implementation/message/include/message_header_impl.hpp48
-rw-r--r--implementation/message/include/message_impl.hpp36
-rw-r--r--implementation/message/include/payload_impl.hpp44
-rw-r--r--implementation/message/include/payload_owner.hpp (renamed from vsomeip/include/vsomeip_internal/payload_owner.hpp)0
-rw-r--r--implementation/message/include/serializer.hpp (renamed from vsomeip/include/vsomeip_internal/serializer.hpp)23
-rw-r--r--implementation/message/src/deserializer.cpp (renamed from vsomeip/src/vsomeip/deserializer.cpp)21
-rw-r--r--implementation/message/src/message_base_impl.cpp105
-rw-r--r--implementation/message/src/message_header_impl.cpp81
-rw-r--r--implementation/message/src/message_impl.cpp (renamed from vsomeip/src/vsomeip/message_impl.cpp)27
-rw-r--r--implementation/message/src/payload_impl.cpp89
-rw-r--r--implementation/message/src/serializer.cpp (renamed from vsomeip/src/vsomeip/serializer.cpp)24
-rw-r--r--implementation/routing/include/local_routing_manager.hpp43
-rw-r--r--implementation/routing/include/routing_info.hpp46
-rw-r--r--implementation/routing/include/routing_manager.hpp91
-rw-r--r--implementation/routing/include/routing_manager_adapter.hpp24
-rw-r--r--implementation/routing/include/routing_manager_host.hpp35
-rw-r--r--implementation/routing/include/routing_manager_impl.hpp140
-rw-r--r--implementation/routing/include/routing_manager_proxy.hpp127
-rw-r--r--implementation/routing/include/routing_manager_stub.hpp72
-rw-r--r--implementation/routing/src/routing_info.cpp53
-rw-r--r--implementation/routing/src/routing_manager_impl.cpp419
-rw-r--r--implementation/routing/src/routing_manager_proxy.cpp498
-rw-r--r--implementation/routing/src/routing_manager_stub.cpp352
-rw-r--r--implementation/service_discovery/include/configuration_option_impl.hpp47
-rw-r--r--implementation/service_discovery/include/constants.hpp36
-rw-r--r--implementation/service_discovery/include/defines.hpp14
-rwxr-xr-ximplementation/service_discovery/include/deserializer.hpp31
-rwxr-xr-ximplementation/service_discovery/include/entry_impl.hpp75
-rw-r--r--implementation/service_discovery/include/enumeration_types.hpp (renamed from vsomeip/include/vsomeip/sd/enumeration_types.hpp)91
-rwxr-xr-ximplementation/service_discovery/include/eventgroupentry_impl.hpp34
-rw-r--r--implementation/service_discovery/include/ipv4_option_impl.hpp33
-rw-r--r--implementation/service_discovery/include/ipv6_option_impl.hpp32
-rwxr-xr-ximplementation/service_discovery/include/load_balancing_option_impl.hpp39
-rwxr-xr-ximplementation/service_discovery/include/message_element_impl.hpp29
-rwxr-xr-ximplementation/service_discovery/include/message_impl.hpp75
-rw-r--r--implementation/service_discovery/include/option_impl.hpp45
-rw-r--r--implementation/service_discovery/include/primitive_types.hpp29
-rwxr-xr-ximplementation/service_discovery/include/protection_option_impl.hpp39
-rw-r--r--implementation/service_discovery/include/runtime.hpp34
-rw-r--r--implementation/service_discovery/include/runtime_impl.hpp29
-rw-r--r--implementation/service_discovery/include/service_discovery.hpp33
-rw-r--r--implementation/service_discovery/include/service_discovery_host.hpp33
-rw-r--r--implementation/service_discovery/include/service_discovery_impl.hpp38
-rw-r--r--implementation/service_discovery/include/service_discovery_proxy.hpp42
-rw-r--r--implementation/service_discovery/include/service_discovery_stub.hpp31
-rw-r--r--implementation/service_discovery/include/service_discovery_stub_impl.hpp38
-rw-r--r--implementation/service_discovery/include/serviceentry_impl.hpp33
-rwxr-xr-ximplementation/service_discovery/src/configuration_option_impl.cpp (renamed from vsomeip/src/vsomeip.sd/configuration_option_impl.cpp)27
-rw-r--r--implementation/service_discovery/src/deserializer.cpp (renamed from vsomeip/src/vsomeip.sd/deserializer.cpp)21
-rwxr-xr-ximplementation/service_discovery/src/entry_impl.cpp175
-rwxr-xr-ximplementation/service_discovery/src/eventgroupentry_impl.cpp75
-rw-r--r--implementation/service_discovery/src/ipv4_endpoint_option_impl.cpp50
-rwxr-xr-ximplementation/service_discovery/src/ipv6_endpoint_option_impl.cpp51
-rwxr-xr-ximplementation/service_discovery/src/load_balancing_option_impl.cpp73
-rwxr-xr-ximplementation/service_discovery/src/message_element_impl.cpp25
-rwxr-xr-ximplementation/service_discovery/src/message_impl.cpp323
-rwxr-xr-ximplementation/service_discovery/src/option_impl.cpp58
-rwxr-xr-ximplementation/service_discovery/src/protection_option_impl.cpp72
-rw-r--r--implementation/service_discovery/src/runtime.cpp28
-rw-r--r--implementation/service_discovery/src/runtime_impl.cpp38
-rw-r--r--implementation/service_discovery/src/service_discovery_impl.cpp37
-rw-r--r--implementation/service_discovery/src/service_discovery_proxy.cpp37
-rw-r--r--implementation/service_discovery/src/service_discovery_stub_impl.cpp35
-rwxr-xr-ximplementation/service_discovery/src/serviceentry_impl.cpp58
-rw-r--r--implementation/test/configuration-test.cpp227
-rw-r--r--implementation/utility/include/utility.hpp41
-rw-r--r--implementation/utility/src/utility.cpp40
-rw-r--r--interface/vsomeip/application.hpp89
-rw-r--r--interface/vsomeip/configuration.hpp67
-rw-r--r--interface/vsomeip/constants.hpp46
-rw-r--r--interface/vsomeip/defines.hpp37
-rw-r--r--interface/vsomeip/deserializable.hpp22
-rw-r--r--interface/vsomeip/enumeration_types.hpp47
-rw-r--r--interface/vsomeip/handler.hpp24
-rw-r--r--interface/vsomeip/logger.hpp36
-rw-r--r--interface/vsomeip/message.hpp27
-rw-r--r--interface/vsomeip/message_base.hpp59
-rw-r--r--interface/vsomeip/payload.hpp31
-rw-r--r--interface/vsomeip/primitive_types.hpp40
-rw-r--r--interface/vsomeip/runtime.hpp31
-rw-r--r--interface/vsomeip/serializable.hpp22
-rw-r--r--interface/vsomeip/vsomeip.hpp18
-rw-r--r--vSomeIPConfig.cmake.in (renamed from vsomeip/vSomeIPConfig.cmake.in)2
-rw-r--r--vSomeIPConfigVersion.cmake.in (renamed from vsomeip/vSomeIPConfigVersion.cmake.in)0
-rwxr-xr-xvsomeip-documentation/lh/LH10162833-SOMEIP.pdfbin1030495 -> 0 bytes
-rwxr-xr-xvsomeip-documentation/lh/LH10162833_SOMEIP_Middleware_v02.pdfbin1725866 -> 0 bytes
-rw-r--r--vsomeip-documentation/vsomeip-doxygen.conf2303
-rw-r--r--vsomeip/.cproject80
-rw-r--r--vsomeip/.gitignore2
-rw-r--r--vsomeip/.project27
-rw-r--r--vsomeip/.settings/org.eclipse.core.resources.prefs16
-rw-r--r--vsomeip/build/.gitkeep0
-rw-r--r--vsomeip/include/boost_ext/asio/mq.hpp15
-rw-r--r--vsomeip/include/boost_ext/asio/mq/basic_message_queue.hpp84
-rw-r--r--vsomeip/include/boost_ext/asio/mq/basic_message_queue_service.hpp290
-rw-r--r--vsomeip/include/boost_ext/asio/mq/message_queue_adapter.hpp126
-rw-r--r--vsomeip/include/boost_ext/asio/placeholders.hpp59
-rw-r--r--vsomeip/include/boost_ext/process.hpp62
-rw-r--r--vsomeip/include/vsomeip/application.hpp90
-rw-r--r--vsomeip/include/vsomeip/config.hpp43
-rw-r--r--vsomeip/include/vsomeip/deserializable.hpp27
-rw-r--r--vsomeip/include/vsomeip/endpoint.hpp34
-rw-r--r--vsomeip/include/vsomeip/enumeration_types.hpp69
-rw-r--r--vsomeip/include/vsomeip/factory.hpp43
-rw-r--r--vsomeip/include/vsomeip/field.hpp37
-rw-r--r--vsomeip/include/vsomeip/message.hpp38
-rw-r--r--vsomeip/include/vsomeip/message_base.hpp141
-rw-r--r--vsomeip/include/vsomeip/payload.hpp59
-rw-r--r--vsomeip/include/vsomeip/primitive_types.hpp56
-rw-r--r--vsomeip/include/vsomeip/sd/configuration_option.hpp36
-rw-r--r--vsomeip/include/vsomeip/sd/constants.hpp15
-rwxr-xr-xvsomeip/include/vsomeip/sd/entry.hpp56
-rw-r--r--vsomeip/include/vsomeip/sd/eventgroup_entry.hpp30
-rw-r--r--vsomeip/include/vsomeip/sd/factory.hpp44
-rw-r--r--vsomeip/include/vsomeip/sd/ipv4_endpoint_option.hpp39
-rw-r--r--vsomeip/include/vsomeip/sd/ipv4_multicast_option.hpp28
-rw-r--r--vsomeip/include/vsomeip/sd/ipv6_endpoint_option.hpp37
-rw-r--r--vsomeip/include/vsomeip/sd/ipv6_multicast_option.hpp28
-rw-r--r--vsomeip/include/vsomeip/sd/load_balancing_option.hpp34
-rw-r--r--vsomeip/include/vsomeip/sd/message.hpp62
-rw-r--r--vsomeip/include/vsomeip/sd/option.hpp34
-rw-r--r--vsomeip/include/vsomeip/sd/protection_option.hpp34
-rw-r--r--vsomeip/include/vsomeip/sd/service_entry.hpp31
-rw-r--r--vsomeip/include/vsomeip/sd/vsomeip.hpp30
-rw-r--r--vsomeip/include/vsomeip/serializable.hpp27
-rw-r--r--vsomeip/include/vsomeip/statistics.hpp51
-rw-r--r--vsomeip/include/vsomeip/version.hpp15
-rw-r--r--vsomeip/include/vsomeip/vsomeip.hpp22
-rw-r--r--vsomeip/include/vsomeip_internal/administration_proxy_impl.hpp188
-rw-r--r--vsomeip/include/vsomeip_internal/application_base_impl.hpp59
-rw-r--r--vsomeip/include/vsomeip_internal/application_impl.hpp144
-rw-r--r--vsomeip/include/vsomeip_internal/client.hpp35
-rw-r--r--vsomeip/include/vsomeip_internal/client_impl.hpp78
-rw-r--r--vsomeip/include/vsomeip_internal/configuration.hpp98
-rw-r--r--vsomeip/include/vsomeip_internal/constants.hpp60
-rw-r--r--vsomeip/include/vsomeip_internal/daemon.hpp52
-rw-r--r--vsomeip/include/vsomeip_internal/debug.hpp19
-rw-r--r--vsomeip/include/vsomeip_internal/endpoint_impl.hpp42
-rw-r--r--vsomeip/include/vsomeip_internal/enumeration_types.hpp68
-rw-r--r--vsomeip/include/vsomeip_internal/factory_impl.hpp42
-rw-r--r--vsomeip/include/vsomeip_internal/field_impl.hpp53
-rw-r--r--vsomeip/include/vsomeip_internal/log_macros.hpp19
-rw-r--r--vsomeip/include/vsomeip_internal/log_owner.hpp71
-rw-r--r--vsomeip/include/vsomeip_internal/log_user.hpp32
-rw-r--r--vsomeip/include/vsomeip_internal/managed_proxy_impl.hpp73
-rw-r--r--vsomeip/include/vsomeip_internal/managing_proxy_impl.hpp111
-rw-r--r--vsomeip/include/vsomeip_internal/message_base_impl.hpp68
-rw-r--r--vsomeip/include/vsomeip_internal/message_header_impl.hpp53
-rw-r--r--vsomeip/include/vsomeip_internal/message_impl.hpp41
-rw-r--r--vsomeip/include/vsomeip_internal/message_queue.hpp49
-rw-r--r--vsomeip/include/vsomeip_internal/method_info.hpp31
-rw-r--r--vsomeip/include/vsomeip_internal/owner_base.hpp28
-rw-r--r--vsomeip/include/vsomeip_internal/participant.hpp54
-rw-r--r--vsomeip/include/vsomeip_internal/participant_impl.hpp89
-rw-r--r--vsomeip/include/vsomeip_internal/payload_impl.hpp50
-rw-r--r--vsomeip/include/vsomeip_internal/primitive_types.hpp23
-rw-r--r--vsomeip/include/vsomeip_internal/protocol.hpp33
-rw-r--r--vsomeip/include/vsomeip_internal/proxy.hpp58
-rw-r--r--vsomeip/include/vsomeip_internal/proxy_base_impl.hpp33
-rw-r--r--vsomeip/include/vsomeip_internal/proxy_owner.hpp34
-rw-r--r--vsomeip/include/vsomeip_internal/sd/client_proxy.hpp74
-rw-r--r--vsomeip/include/vsomeip_internal/sd/configuration_option_impl.hpp53
-rw-r--r--vsomeip/include/vsomeip_internal/sd/constants.hpp33
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/deserializer.hpp34
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/entry_impl.hpp75
-rw-r--r--vsomeip/include/vsomeip_internal/sd/eventgroup_client_proxy.hpp51
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/eventgroup_entry_impl.hpp40
-rw-r--r--vsomeip/include/vsomeip_internal/sd/eventgroup_service_proxy.hpp50
-rw-r--r--vsomeip/include/vsomeip_internal/sd/events.hpp148
-rw-r--r--vsomeip/include/vsomeip_internal/sd/factory_impl.hpp36
-rw-r--r--vsomeip/include/vsomeip_internal/sd/group.hpp100
-rw-r--r--vsomeip/include/vsomeip_internal/sd/group_machine.hpp140
-rw-r--r--vsomeip/include/vsomeip_internal/sd/ipv4_endpoint_option_impl.hpp47
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/ipv4_multicast_option_impl.hpp32
-rw-r--r--vsomeip/include/vsomeip_internal/sd/ipv6_endpoint_option_impl.hpp47
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/ipv6_multicast_option_impl.hpp32
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/load_balancing_option_impl.hpp45
-rw-r--r--vsomeip/include/vsomeip_internal/sd/managing_application_impl.hpp73
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/message_element_impl.hpp32
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/message_impl.hpp73
-rw-r--r--vsomeip/include/vsomeip_internal/sd/option_impl.hpp47
-rwxr-xr-xvsomeip/include/vsomeip_internal/sd/protection_option_impl.hpp44
-rw-r--r--vsomeip/include/vsomeip_internal/sd/service.hpp48
-rw-r--r--vsomeip/include/vsomeip_internal/sd/service_discovery.hpp64
-rw-r--r--vsomeip/include/vsomeip_internal/sd/service_discovery_impl.hpp117
-rw-r--r--vsomeip/include/vsomeip_internal/sd/service_entry_impl.hpp39
-rw-r--r--vsomeip/include/vsomeip_internal/sd/service_proxy.hpp79
-rw-r--r--vsomeip/include/vsomeip_internal/sd/timer_service.hpp36
-rw-r--r--vsomeip/include/vsomeip_internal/service.hpp33
-rw-r--r--vsomeip/include/vsomeip_internal/service_impl.hpp69
-rw-r--r--vsomeip/include/vsomeip_internal/statistics_impl.hpp45
-rw-r--r--vsomeip/include/vsomeip_internal/statistics_owner.hpp31
-rw-r--r--vsomeip/include/vsomeip_internal/statistics_owner_impl.hpp35
-rw-r--r--vsomeip/include/vsomeip_internal/supervised_managing_proxy_impl.hpp58
-rw-r--r--vsomeip/include/vsomeip_internal/tcp_client_impl.hpp52
-rw-r--r--vsomeip/include/vsomeip_internal/tcp_service_impl.hpp91
-rw-r--r--vsomeip/include/vsomeip_internal/utility.hpp26
-rw-r--r--vsomeip/src/vsomeip.backup/client_group_machine.cpp229
-rw-r--r--vsomeip/src/vsomeip.backup/client_group_machine.hpp186
-rw-r--r--vsomeip/src/vsomeip.backup/eventgroup_client_state_machine.cpp66
-rw-r--r--vsomeip/src/vsomeip.backup/eventgroup_service_state_machine.cpp57
-rw-r--r--vsomeip/src/vsomeip.daemon/application_info.hpp41
-rw-r--r--vsomeip/src/vsomeip.daemon/client_info.hpp26
-rw-r--r--vsomeip/src/vsomeip.daemon/daemon.cpp11
-rw-r--r--vsomeip/src/vsomeip.daemon/daemon_impl.cpp1345
-rw-r--r--vsomeip/src/vsomeip.daemon/daemon_impl.hpp236
-rw-r--r--vsomeip/src/vsomeip.daemon/daemon_proxy_impl.cpp27
-rw-r--r--vsomeip/src/vsomeip.daemon/daemon_proxy_impl.hpp32
-rw-r--r--vsomeip/src/vsomeip.daemon/main.cpp22
-rw-r--r--vsomeip/src/vsomeip.daemon/request_info.hpp40
-rw-r--r--vsomeip/src/vsomeip.daemon/service_info.hpp30
-rw-r--r--vsomeip/src/vsomeip.datatypes/README3
-rw-r--r--vsomeip/src/vsomeip.examples/application_sample.cpp90
-rw-r--r--vsomeip/src/vsomeip.examples/client_sample-sd.cpp147
-rw-r--r--vsomeip/src/vsomeip.examples/client_sample.cpp113
-rw-r--r--vsomeip/src/vsomeip.examples/external-client_sample-sd.cpp106
-rw-r--r--vsomeip/src/vsomeip.examples/external-client_sample.cpp104
-rw-r--r--vsomeip/src/vsomeip.examples/external-service_sample.cpp75
-rw-r--r--vsomeip/src/vsomeip.examples/service_sample.cpp107
-rw-r--r--vsomeip/src/vsomeip.sd/client_proxy.cpp135
-rwxr-xr-xvsomeip/src/vsomeip.sd/entry_impl.cpp178
-rw-r--r--vsomeip/src/vsomeip.sd/eventgroup_client_proxy.cpp51
-rw-r--r--vsomeip/src/vsomeip.sd/eventgroup_service_proxy.cpp45
-rwxr-xr-xvsomeip/src/vsomeip.sd/eventgroupentry_impl.cpp80
-rw-r--r--vsomeip/src/vsomeip.sd/factory.cpp30
-rw-r--r--vsomeip/src/vsomeip.sd/factory_impl.cpp51
-rw-r--r--vsomeip/src/vsomeip.sd/group.cpp386
-rw-r--r--vsomeip/src/vsomeip.sd/group_machine.cpp163
-rw-r--r--vsomeip/src/vsomeip.sd/ipv4_endpoint_option_impl.cpp96
-rwxr-xr-xvsomeip/src/vsomeip.sd/ipv4_multicast_option_impl.cpp47
-rwxr-xr-xvsomeip/src/vsomeip.sd/ipv6_endpoint_option_impl.cpp98
-rw-r--r--vsomeip/src/vsomeip.sd/ipv6_multicast_option_impl.cpp50
-rwxr-xr-xvsomeip/src/vsomeip.sd/load_balancing_option_impl.cpp76
-rwxr-xr-xvsomeip/src/vsomeip.sd/message_element_impl.cpp28
-rwxr-xr-xvsomeip/src/vsomeip.sd/message_impl.cpp345
-rwxr-xr-xvsomeip/src/vsomeip.sd/option_impl.cpp57
-rwxr-xr-xvsomeip/src/vsomeip.sd/protection_option_impl.cpp76
-rw-r--r--vsomeip/src/vsomeip.sd/service_discovery_impl.cpp551
-rwxr-xr-xvsomeip/src/vsomeip.sd/service_entry_impl.cpp62
-rw-r--r--vsomeip/src/vsomeip.sd/service_proxy.cpp137
-rw-r--r--vsomeip/src/vsomeip.sd/timer_service.cpp48
-rw-r--r--vsomeip/src/vsomeip/administration_proxy_impl.cpp1090
-rw-r--r--vsomeip/src/vsomeip/application_base_impl.cpp23
-rw-r--r--vsomeip/src/vsomeip/application_impl.cpp429
-rw-r--r--vsomeip/src/vsomeip/client_impl.cpp186
-rw-r--r--vsomeip/src/vsomeip/configuration.cpp535
-rw-r--r--vsomeip/src/vsomeip/debug.cpp18
-rw-r--r--vsomeip/src/vsomeip/endpoint_impl.cpp67
-rw-r--r--vsomeip/src/vsomeip/factory.cpp25
-rw-r--r--vsomeip/src/vsomeip/factory_impl.cpp116
-rw-r--r--vsomeip/src/vsomeip/field_impl.cpp66
-rw-r--r--vsomeip/src/vsomeip/log_user.cpp26
-rw-r--r--vsomeip/src/vsomeip/managed_proxy_impl.cpp243
-rw-r--r--vsomeip/src/vsomeip/managing_proxy_impl.cpp460
-rw-r--r--vsomeip/src/vsomeip/message_base_impl.cpp133
-rw-r--r--vsomeip/src/vsomeip/message_header_impl.cpp85
-rw-r--r--vsomeip/src/vsomeip/owner_base.cpp25
-rw-r--r--vsomeip/src/vsomeip/participant_impl.cpp183
-rw-r--r--vsomeip/src/vsomeip/payload_impl.cpp92
-rw-r--r--vsomeip/src/vsomeip/proxy_base_impl.cpp24
-rw-r--r--vsomeip/src/vsomeip/proxy_owner.cpp27
-rw-r--r--vsomeip/src/vsomeip/service_impl.cpp178
-rw-r--r--vsomeip/src/vsomeip/statistics_impl.cpp49
-rw-r--r--vsomeip/src/vsomeip/statistics_owner_impl.cpp25
-rw-r--r--vsomeip/src/vsomeip/supervised_managing_proxy_impl.cpp172
-rw-r--r--vsomeip/src/vsomeip/tcp_client_impl.cpp131
-rw-r--r--vsomeip/src/vsomeip/tcp_service_impl.cpp209
-rw-r--r--vsomeip/src/vsomeip/udp_client_impl.cpp127
-rw-r--r--vsomeip/src/vsomeip/udp_service_impl.cpp139
-rw-r--r--vsomeip/src/vsomeip/utility.cpp35
-rw-r--r--vsomeip/vsomeip.conf96
315 files changed, 9348 insertions, 19579 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a007fea
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build/*
diff --git a/vsomeip/CMakeLists.txt b/CMakeLists.txt
index 7a6505c..0466d3e 100644
--- a/vsomeip/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,8 @@
cmake_minimum_required (VERSION 2.8)
project (vsomeip)
set (VSOMEIP_MAJOR_VERSION 0)
-set (VSOMEIP_MINOR_VERSION 1)
-set (VSOMEIP_PATCH_VERSION 0)
+set (VSOMEIP_MINOR_VERSION 0)
+set (VSOMEIP_PATCH_VERSION 1)
set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION})
set (CMAKE_VERBOSE_MAKEFILE off)
@@ -45,66 +45,53 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
endif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set (CMAKE_CXX_FLAGS "-D${OS} -DUSE_VSOMEIP_STATISTICS -DBOOST_LOG_DYN_LINK -g -std=c++0x -O0 -Wno-deprecated-register")
-include_directories("include")
+include_directories(
+ "interface"
+)
# Boost
-find_package( Boost 1.54 COMPONENTS system thread program_options log REQUIRED )
+find_package( Boost 1.54 COMPONENTS system thread log REQUIRED )
include_directories( ${Boost_INCLUDE_DIR} )
# Base library
file(GLOB vsomeip_SRC
- "src/vsomeip/*.cpp"
+ "implementation/application/src/*.cpp"
+ "implementation/configuration/src/*.cpp"
+ "implementation/endpoints/src/*.cpp"
+ "implementation/logging/src/*.cpp"
+ "implementation/message/src/*.cpp"
+ "implementation/routing/src/*.cpp"
+ "implementation/utility/src/*.cpp"
)
add_library(vsomeip SHARED ${vsomeip_SRC})
target_link_libraries(vsomeip ${Boost_LIBRARIES} rt ${DL_LIBRARY})
-file (GLOB vsomeip-sd_SRC
- "src/vsomeip.sd/*.cpp"
+file(GLOB vsomeip-sd_SRC
+ "implementation/service_discovery/src/*.cpp"
)
add_library(vsomeip-sd SHARED ${vsomeip-sd_SRC})
target_link_libraries(vsomeip-sd vsomeip ${Boost_LIBRARIES} rt ${DL_LIBRARY})
-# Daemon
-file (GLOB vsomeipd_SRC
- "src/vsomeip.daemon/*.cpp"
-)
-
-# Daemon
-add_executable(vsomeipd ${vsomeipd_SRC})
-target_link_libraries(vsomeipd vsomeip ${Boost_LIBRARIES} rt ${DL_LIBRARY})
-
-# Test executables
-add_executable(application_sample src/vsomeip.examples/application_sample.cpp)
-target_link_libraries(application_sample vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
-
-add_executable(client_sample src/vsomeip.examples/client_sample.cpp)
-target_link_libraries(client_sample vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
-
-add_executable(client_sample-sd src/vsomeip.examples/client_sample-sd.cpp)
-target_link_libraries(client_sample-sd vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
-
-add_executable(service_sample src/vsomeip.examples/service_sample.cpp)
-target_link_libraries(service_sample vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
-
-add_executable(external-client_sample src/vsomeip.examples/external-client_sample.cpp)
-target_link_libraries(external-client_sample vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
+# Executables
+add_executable(configuration-test implementation/test/configuration-test.cpp)
+target_link_libraries(configuration-test vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
-add_executable(external-client_sample-sd src/vsomeip.examples/external-client_sample-sd.cpp)
-target_link_libraries(external-client_sample-sd vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
+add_executable(client-sample implementation/examples/client-sample.cpp)
+target_link_libraries(client-sample vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
-add_executable(external-service_sample src/vsomeip.examples/external-service_sample.cpp)
-target_link_libraries(external-service_sample vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
+add_executable(service-sample implementation/examples/service-sample.cpp)
+target_link_libraries(service-sample vsomeip ${Boost_LIBRARIES} ${DL_LIBRARY})
###################################################################################################
-file (GLOB_RECURSE vsomeip_INCLUDE "include/*.hpp")
+file (GLOB_RECURSE vsomeip_INCLUDE "interface/*.hpp")
-set_target_properties (vsomeip vsomeip-sd PROPERTIES PUBLIC_HEADER "${vsomeip_INCLUDE}")
+set_target_properties (vsomeip PROPERTIES PUBLIC_HEADER "${vsomeip_INCLUDE}")
install (
- TARGETS vsomeip vsomeip-sd
+ TARGETS vsomeip
# IMPORTANT: Add the vsomeip library to the "export-set"
EXPORT vsomeipTargets
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin
@@ -113,7 +100,7 @@ install (
)
# Add all targets to the build-tree export set
-export (TARGETS vsomeip vsomeip-sd FILE "${PROJECT_BINARY_DIR}/vSomeIPTargets.cmake")
+export (TARGETS vsomeip FILE "${PROJECT_BINARY_DIR}/vSomeIPTargets.cmake")
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
diff --git a/config/vsomeip-sample.xml b/config/vsomeip-sample.xml
new file mode 100644
index 0000000..c488ae6
--- /dev/null
+++ b/config/vsomeip-sample.xml
@@ -0,0 +1,41 @@
+<!-- vsomeip test configuration file -->
+<someip>
+ <unicast>10.0.2.15</unicast>
+ <logging>
+ <level>debug</level>
+ <console>true</console>
+ <file>false</file>
+ <dlt>false</dlt>
+ </logging>
+ <services>
+ <servicegroup>
+ <name>default</name>
+ <delays>
+ <initial>
+ <min>10</min>
+ <max>100</max>
+ </initial>
+ <repetition-base>200</repetition-base>
+ <cyclic-offer>2000</cyclic-offer>
+ <cyclic-request>2001</cyclic-request>
+ </delays>
+ <service>
+ <service-id>0x1234</service-id>
+ <instance-id>0x5678</instance-id>
+ <major>0x1</major>
+ <minor>0x1</minor>
+ <ttl>4000</ttl>
+ <port>30500</port>
+ <multicast>225.225.225.1</multicast>
+ </service>
+ </servicegroup>
+ </services>
+ <routing>
+ <host>client-sample</host>
+ </routing>
+ <service-discovery>
+ <host>client-sample</host>
+ <protocol>udp</protocol>
+ <port>30490</port>
+ </service-discovery>
+</someip>
diff --git a/config/vsomeip-test.xml b/config/vsomeip-test.xml
new file mode 100644
index 0000000..0c8fb3c
--- /dev/null
+++ b/config/vsomeip-test.xml
@@ -0,0 +1,107 @@
+<!-- vsomeip test configuration file -->
+<someip>
+ <address>10.0.2.15</address>
+ <logging>
+ <level>debug</level>
+ <console>true</console>
+ <file>
+ <enabled>true</enabled>
+ <path>/home/someip/another-file.log</path>
+ </file>
+ <dlt>false</dlt>
+ </logging>
+ <services>
+ <servicegroup>
+ <name>default</name>
+ <address>local</address>
+ <delays>
+ <initial>
+ <min>10</min>
+ <max>100</max>
+ </initial>
+ <repetition-base>200</repetition-base>
+ <repetition-max>7</repetition-max>
+ <cyclic-offer>2000</cyclic-offer>
+ <cyclic-request>2001</cyclic-request>
+ </delays>
+ <service>
+ <service-id>0x1234</service-id>
+ <instance-id>0x0022</instance-id>
+ <ports>
+ <reliable>30506</reliable>
+ <unreliable>31000</unreliable>
+ </ports>
+ <multicast>225.225.225.1</multicast>
+ </service>
+ <service>
+ <service-id>0x1234</service-id>
+ <instance-id>0x0023</instance-id>
+ <ports>
+ <reliable>30503</reliable>
+ </ports>
+ <multicast>225.225.225.2</multicast>
+ </service>
+ </servicegroup>
+ <servicegroup>
+ <name>extra</name>
+ <address>local</address>
+ <delays>
+ <initial>
+ <min>100</min>
+ <max>200</max>
+ </initial>
+ <repetition-base>300</repetition-base>
+ <repetition-max>5</repetition-max>
+ <cyclic-offer>2500</cyclic-offer>
+ <cyclic-request>2221</cyclic-request>
+ </delays>
+ <service>
+ <service-id>0x2277</service-id>
+ <instance-id>0x0022</instance-id>
+ <ports>
+ <reliable>30505</reliable>
+ <unreliable>31001</unreliable>
+ </ports>
+ <multicast>225.225.225.3</multicast>
+ </service>
+ <service>
+ <service-id>0x2266</service-id>
+ <instance-id>0x0022</instance-id>
+ <ports>
+ <reliable>30505</reliable>
+ <unreliable>30507</unreliable>
+ </ports>
+ <multicast>225.225.226.1</multicast>
+ </service>
+ </servicegroup>
+ <servicegroup>
+ <name>remote</name>
+ <address>10.0.2.23</address>
+ <service>
+ <service-id>0x4466</service-id>
+ <instance-id>0x0321</instance-id>
+ <ports>
+ <reliable>30506</reliable>
+ <unreliable>30444</unreliable>
+ </ports>
+ <multicast>225.225.228.1</multicast>
+ </service>
+ </servicegroup>
+ </services>
+ <routing>
+ <host>A</host>
+ </routing>
+ <service-discovery>
+ <host>my_application</host>
+ <port>30666</port>
+ <protocol>tcp</protocol>
+ </service-discovery>
+ <applications>
+ <application>
+ <name>A</name>
+ </application>
+ <application>
+ <name>B</name>
+ </application>
+ </applications>
+</someip> \ No newline at end of file
diff --git a/config/vsomeip.xml b/config/vsomeip.xml
new file mode 100644
index 0000000..83cb54a
--- /dev/null
+++ b/config/vsomeip.xml
@@ -0,0 +1,69 @@
+<!-- vsomeip test configuration file -->
+<someip>
+ <unicast>127.0.0.1</unicast>
+ <logging>
+ <level>trace</level>
+ <console>true</console>
+ <file>
+ <enable>false</enable>
+ <path>/tmp/vsomeip.log</path>
+ </file>
+ <dlt>false</dlt>
+ </logging>
+ <services>
+ <servicegroup>
+ <name>default</name>
+ <delays>
+ <initial>
+ <min>10</min>
+ <max>100</max>
+ </initial>
+ <repetition-base>200</repetition-base>
+ <cyclic-offer>2000</cyclic-offer>
+ <cyclic-request>2001</cyclic-request>
+ </delays>
+ <service>
+ <service-id>0x1234</service-id>
+ <instance-id>0x5678</instance-id>
+ <ports>
+ <reliable>30506</reliable>
+ <unreliable>31000</unreliable>
+ </ports>
+ <multicast>225.225.225.1</multicast>
+ </service>
+ </servicegroup>
+ <servicegroup>
+ <address>10.0.2.15</address>
+ <service>
+ <service-id>0x4466</service-id>
+ <instance-id>0x0421</instance-id>
+ <port>
+ <reliable>30507</reliable>
+ </port>
+ </service>
+ </servicegroup>
+ </services>
+ <routing>
+ <host>client-sample</host>
+ </routing>
+ <service-discovery>
+ <enabled>true</enabled>
+ <host>client-sample</host>
+ <protocol>udp</protocol>
+ <port>30490</port>
+ </service-discovery>
+ <applications>
+ <application>
+ <name>client-sample</name>
+ <id>0x1343</id>
+ </application>
+ <application>
+ <name>other-client-sample</name>
+ <id>0x1344</id>
+ </application>
+ <application>
+ <name>service-sample</name>
+ <id>0x1277</id>
+ </application>
+ </applications>
+</someip>
diff --git a/implementation/application/include/application_impl.hpp b/implementation/application/include/application_impl.hpp
new file mode 100644
index 0000000..3790a70
--- /dev/null
+++ b/implementation/application/include/application_impl.hpp
@@ -0,0 +1,148 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_APPLICATION_IMPL_HPP
+#define VSOMEIP_APPLICATION_IMPL_HPP
+
+#include <map>
+#include <string>
+
+#include <boost/asio/signal_set.hpp>
+
+#include <vsomeip/application.hpp>
+
+#include "../../routing/include/routing_manager_host.hpp"
+#include "../../service_discovery/include/service_discovery_host.hpp"
+
+namespace vsomeip {
+
+class configuration;
+class logger;
+class routing_manager;
+class routing_manager_stub;
+
+namespace sd {
+class service_discovery;
+class service_discovery_stub;
+} // namespace sd
+
+class application_impl
+ : public application,
+ public routing_manager_host,
+ public sd::service_discovery_host,
+ public std::enable_shared_from_this< application_impl > {
+public:
+ application_impl(const std::string &_name);
+ ~application_impl();
+
+ bool init(int _argc, char **_argv);
+ void start();
+ void stop();
+
+ void offer_service(service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl);
+
+ void stop_offer_service(service_t _service, instance_t _instance);
+
+ void publish_eventgroup(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup,
+ major_version_t _major, ttl_t _ttl);
+
+ void stop_publish_eventgroup(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup);
+
+ // Consume services
+ void request_service(service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor,
+ ttl_t _ttl);
+ void release_service(service_t _service, instance_t _instance);
+
+ void subscribe(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup);
+
+ void unsubscribe(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup);
+
+ bool is_available(service_t _service, instance_t _instance);
+
+ // Define content of eventgroups
+ void add_event(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event);
+
+ void add_field(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event,
+ std::vector< uint8_t > &_value);
+
+ void remove_event_or_field(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event);
+
+
+ void send(std::shared_ptr< message > _message, bool _flush, bool _reliable);
+ void set(service_t _service, instance_t _instance,
+ event_t _event, std::vector< byte_t > &_value);
+
+ bool register_message_handler(service_t _service, instance_t _instance,
+ method_t _method, message_handler_t _handler);
+ bool unregister_message_handler(service_t _service, instance_t _instance,
+ method_t _method);
+
+ bool register_availability_handler(service_t _service, instance_t _instance,
+ availability_handler_t _handler);
+ bool unregister_availability_handler(service_t _service, instance_t _instance);
+
+ // routing_manager_host
+ const std::string & get_name() const;
+ client_t get_client() const;
+ std::shared_ptr< configuration > get_configuration() const;
+ boost::asio::io_service & get_io();
+ void on_availability(service_t _service, instance_t _instance, bool _is_available) const;
+ void on_message(std::shared_ptr< message > _message);
+ void on_error();
+
+ // service_discovery_host
+
+private:
+ void service(boost::asio::io_service &_io);
+
+private:
+ client_t client_; // unique application identifier
+ session_t session_;
+
+ std::string name_;
+ std::shared_ptr< configuration > configuration_;
+
+ boost::asio::io_service host_io_;
+
+ // Proxy to or the Routing Manager itself
+ std::shared_ptr< routing_manager > routing_;
+
+ // Stub to export the Routing Manager
+ std::shared_ptr< routing_manager_stub > routing_stub_;
+
+ // Proxy to or the Service Discovery itself
+ std::shared_ptr< sd::service_discovery > discovery_;
+
+ // Stub to export the Service Discovery
+ std::shared_ptr< sd::service_discovery_stub > discovery_stub_;
+
+ // Method/Event (=Member) handlers
+ std::map< service_t,
+ std::map< instance_t,
+ std::map< method_t,
+ message_handler_t > > > members_;
+
+ // Availability handlers
+ std::map< service_t,
+ std::map< instance_t,
+ availability_handler_t > > availability_;
+
+ // Signals
+ boost::asio::signal_set signals_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_APPLICATION_IMPL_HPP
diff --git a/implementation/application/include/runtime_impl.hpp b/implementation/application/include/runtime_impl.hpp
new file mode 100644
index 0000000..8900ba4
--- /dev/null
+++ b/implementation/application/include/runtime_impl.hpp
@@ -0,0 +1,27 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_RUNTIME_IMPL_HPP
+#define VSOMEIP_RUNTIME_IMPL_HPP
+
+#include <vsomeip/runtime.hpp>
+
+namespace vsomeip {
+
+class runtime_impl: public runtime {
+public:
+ static runtime * get();
+
+ virtual ~runtime_impl();
+
+ std::shared_ptr< application > create_application(const std::string &_name) const;
+ std::shared_ptr< message > create_request() const;
+ std::shared_ptr< message > create_response(std::shared_ptr< message > &_request) const;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_RUNTIME_IMPL_HPP
diff --git a/implementation/application/src/application_impl.cpp b/implementation/application/src/application_impl.cpp
new file mode 100644
index 0000000..99cbadf
--- /dev/null
+++ b/implementation/application/src/application_impl.cpp
@@ -0,0 +1,354 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <thread>
+
+#include <vsomeip/configuration.hpp>
+#include <vsomeip/defines.hpp>
+#include <vsomeip/logger.hpp>
+
+#include "../include/application_impl.hpp"
+#include "../../configuration/include/internal.hpp"
+#include "../../message/include/serializer.hpp"
+#include "../../routing/include/routing_manager_impl.hpp"
+#include "../../routing/include/routing_manager_proxy.hpp"
+#include "../../routing/include/routing_manager_stub.hpp"
+#include "../../service_discovery/include/runtime.hpp"
+#include "../../service_discovery/include/service_discovery_impl.hpp"
+#include "../../service_discovery/include/service_discovery_proxy.hpp"
+#include "../../service_discovery/include/service_discovery_stub.hpp"
+#include "../../utility/include/utility.hpp"
+
+namespace vsomeip {
+
+application_impl::application_impl(const std::string &_name)
+ : name_(_name), routing_(0), discovery_(0), signals_(host_io_, SIGINT, SIGTERM) {
+}
+
+application_impl::~application_impl() {
+}
+
+bool application_impl::init(int _argc, char **_argv) {
+ bool is_initialized(false);
+
+ // determine path
+ std::string its_path(VSOMEIP_DEFAULT_CONFIGURATION_FILE_PATH);
+
+ int i = 0;
+ while (i < _argc-1) {
+ if (std::string("--someip") == _argv[i]) {
+ its_path = _argv[i+1];
+ break;
+ }
+
+ i++;
+ }
+
+ configuration_.reset(configuration::get(its_path));
+ VSOMEIP_INFO << "Using configuration file: " << its_path;
+
+ if (configuration_) {
+ client_ = configuration_->get_id(name_);
+
+ // Routing
+ if (name_ == configuration_->get_routing_host()) {
+ routing_ = std::make_shared< routing_manager_impl >(this);
+ routing_stub_ = std::make_shared< routing_manager_stub >(routing_.get());
+ } else {
+ routing_ = std::make_shared< routing_manager_proxy >(this);
+ }
+
+ if (configuration_->is_service_discovery_enabled()) {
+ VSOMEIP_INFO << "Service Discovery enabled.";
+ sd::runtime **its_runtime = static_cast< sd::runtime ** >(
+ utility::load_library(
+ VSOMEIP_SD_LIBRARY,
+ VSOMEIP_SD_RUNTIME_SYMBOL_STRING)
+ );
+
+ if (0 != its_runtime && 0 != (*its_runtime)) {
+ VSOMEIP_INFO << "Service Discovery module loaded.";
+ if (name_ == configuration_->get_service_discovery_host()) {
+ discovery_ = (*its_runtime)->create_service_discovery(this);
+ discovery_stub_ = (*its_runtime)->create_service_discovery_stub(discovery_.get());
+ } else {
+ discovery_ = (*its_runtime)->create_service_discovery_proxy(this);
+ }
+ }
+ }
+
+ routing_->init();
+ if (routing_stub_)
+ routing_stub_->init();
+
+ if (discovery_)
+ discovery_->init();
+ if (discovery_stub_)
+ discovery_stub_->init();
+
+ // Smallest allowed session identifier
+ session_ = 0x0001;
+
+ VSOMEIP_DEBUG << "Application(" << name_ << ", " << std::hex << client_ << ") is initialized.";
+
+ is_initialized = true;
+ }
+
+ // Register signal handler
+ std::function< void (boost::system::error_code const &, int) > its_signal_handler
+ = [this] (boost::system::error_code const &_error, int _signal) {
+ if (!_error) {
+ switch (_signal) {
+ case SIGTERM:
+ case SIGINT:
+ stop();
+ exit(0);
+ break;
+ default:
+ break;
+ }
+ }
+ };
+ signals_.async_wait(its_signal_handler);
+
+ return is_initialized;
+}
+
+void application_impl::start() {
+ if (routing_)
+ routing_->start();
+ if (routing_stub_)
+ routing_stub_->start();
+
+ if (discovery_)
+ discovery_->start();
+ if (discovery_stub_)
+ discovery_stub_->start();
+
+ // start the threads that process the io service queues
+ std::thread its_host_thread(std::bind(&application_impl::service, this, std::ref(host_io_)));
+ its_host_thread.join();
+}
+
+void application_impl::stop() {
+ VSOMEIP_DEBUG << "Client [" << std::hex << client_ << "]: shutting down...";
+ if (routing_stub_)
+ routing_stub_->stop();
+ if (routing_)
+ routing_->stop();
+
+ if (discovery_stub_)
+ discovery_stub_->stop();
+ if (discovery_)
+ discovery_->stop();
+
+ host_io_.stop();
+}
+
+void application_impl::offer_service(
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) {
+ if (routing_)
+ routing_->offer_service(client_, _service, _instance, _major, _minor, _ttl);
+}
+
+void application_impl::stop_offer_service(
+ service_t _service, instance_t _instance) {
+ if (routing_)
+ routing_->stop_offer_service(client_, _service, _instance);
+}
+
+void application_impl::publish_eventgroup(
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup, major_version_t _major, ttl_t _ttl) {
+ if (routing_)
+ routing_->publish_eventgroup(client_, _service, _instance, _eventgroup, _major, _ttl);
+}
+
+void application_impl::stop_publish_eventgroup(
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+ if (routing_)
+ routing_->stop_publish_eventgroup(client_, _service, _instance, _eventgroup);
+}
+
+void application_impl::request_service(
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) {
+ if (routing_)
+ routing_->request_service(client_, _service, _instance, _major, _minor, _ttl);
+}
+
+void application_impl::release_service(
+ service_t _service, instance_t _instance) {
+ if (routing_)
+ routing_->release_service(client_, _service, _instance);
+}
+
+void application_impl::subscribe(
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+ if (routing_)
+ routing_->subscribe(client_, _service, _instance, _eventgroup);
+}
+
+void application_impl::unsubscribe(
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+ if (routing_)
+ routing_->unsubscribe(client_, _service, _instance, _eventgroup);
+}
+
+bool application_impl::is_available(service_t _service, instance_t _instance) {
+ return true; // TODO: depend on SD
+}
+
+void application_impl::add_event(
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup, event_t _event) {
+
+}
+
+void application_impl::add_field(
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event, std::vector< byte_t > &_value) {
+
+}
+
+void application_impl::remove_event_or_field(
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup, event_t _event) {
+
+}
+
+void application_impl::send(std::shared_ptr< message > _message, bool _flush, bool _reliable) {
+ if (routing_) {
+ if (utility::is_request(_message)) {
+ _message->set_client(client_);
+ _message->set_session(session_++);
+ }
+ routing_->send(client_, _message, _flush, _reliable);
+ }
+}
+
+void application_impl::set(
+ service_t _service, instance_t _instance,
+ event_t _event, std::vector< byte_t > &_value) {
+ // TODO: change signature to use payload
+}
+
+bool application_impl::register_message_handler(
+ service_t _service, instance_t _instance, method_t _method, message_handler_t _handler) {
+ std::cout << "Registering for message ["
+ << std::hex
+ << _service << "." << _instance << "." << _method
+ << "]" << std::endl;
+
+ members_[_service][_instance][_method] = _handler;
+ return true;
+}
+
+bool application_impl::unregister_message_handler(
+ service_t _service, instance_t _instance, method_t _method) {
+ bool its_result = false;
+
+ auto found_service = members_.find(_service);
+ if (found_service != members_.end()) {
+ auto found_instance = found_service->second.find(_instance);
+ if (found_instance != found_service->second.end()) {
+ auto found_method = found_instance->second.find(_method);
+ if (found_method != found_instance->second.end()) {
+ found_instance->second.erase(_method);
+ its_result = true;
+ }
+ }
+ }
+
+ return its_result;
+}
+
+bool application_impl::register_availability_handler(
+ service_t _service, instance_t _instance, availability_handler_t _handler) {
+ availability_[_service][_instance] = _handler;
+ return true;
+}
+
+bool application_impl::unregister_availability_handler(
+ service_t _service, instance_t _instance) {
+ bool its_result = false;
+
+ auto found_service = availability_.find(_service);
+ if (found_service != availability_.end()) {
+ auto found_instance = found_service->second.find(_instance);
+ if (found_instance != found_service->second.end()) {
+ found_service->second.erase(_instance);
+ its_result = true;
+ }
+ }
+ return its_result;
+}
+
+// Interface "routing_manager_host"
+const std::string & application_impl::get_name() const {
+ return name_;
+}
+
+client_t application_impl::get_client() const {
+ return client_;
+}
+
+std::shared_ptr< configuration > application_impl::get_configuration() const {
+ return configuration_;
+}
+
+boost::asio::io_service & application_impl::get_io() {
+ return host_io_;
+}
+
+void application_impl::on_availability(service_t _service, instance_t _instance, bool _is_available) const {
+ auto found_service = availability_.find(_service);
+ if (found_service != availability_.end()) {
+ auto found_instance = found_service->second.find(_instance);
+ if (found_instance != found_service->second.end()) {
+ found_instance->second(_service, _instance, _is_available);
+ }
+ }
+}
+
+void application_impl::on_message(std::shared_ptr< message > _message) {
+ service_t its_service = _message->get_service();
+ instance_t its_instance = _message->get_instance();
+ method_t its_method = _message->get_method();
+
+ // find list of handlers
+ auto found_service = members_.find(its_service);
+ if (found_service == members_.end()) {
+ found_service = members_.find(VSOMEIP_ANY_SERVICE);
+ }
+ if (found_service != members_.end()) {
+ auto found_instance = found_service->second.find(its_instance);
+ if (found_instance == found_service->second.end()) {
+ found_instance = found_service->second.find(VSOMEIP_ANY_SERVICE);
+ }
+ if (found_instance != found_service->second.end()) {
+ auto found_method = found_instance->second.find(its_method);
+ if (found_method == found_instance->second.end()) {
+ found_method = found_instance->second.find(VSOMEIP_ANY_METHOD);
+ }
+
+ if (found_method != found_instance->second.end()) {
+ found_method->second(_message);
+ }
+ }
+ }
+}
+
+void application_impl::on_error() {
+ std::cerr << "ERROR" << std::endl;
+}
+
+
+// Internal
+void application_impl::service(boost::asio::io_service &_io) {
+ _io.run();
+ VSOMEIP_ERROR << "Service stopped running..." << std::endl;
+}
+
+} // namespace vsomeip
diff --git a/implementation/application/src/runtime.cpp b/implementation/application/src/runtime.cpp
new file mode 100644
index 0000000..33e62e2
--- /dev/null
+++ b/implementation/application/src/runtime.cpp
@@ -0,0 +1,20 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <vsomeip/runtime.hpp>
+
+#include "../include/runtime_impl.hpp"
+
+namespace vsomeip {
+
+runtime * runtime::get() {
+ return runtime_impl::get();
+}
+
+} // namespace vsomeip
+
+
+
diff --git a/implementation/application/src/runtime_impl.cpp b/implementation/application/src/runtime_impl.cpp
new file mode 100644
index 0000000..b49027d
--- /dev/null
+++ b/implementation/application/src/runtime_impl.cpp
@@ -0,0 +1,48 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <vsomeip/defines.hpp>
+
+#include "../include/application_impl.hpp"
+#include "../include/runtime_impl.hpp"
+#include "../../message/include/message_impl.hpp"
+
+namespace vsomeip {
+
+runtime * runtime_impl::get() {
+ static runtime_impl the_runtime;
+ return &the_runtime;
+}
+
+runtime_impl::~runtime_impl() {
+}
+
+std::shared_ptr< application > runtime_impl::create_application(const std::string &_name) const {
+ return std::make_shared< application_impl >(_name);
+}
+
+std::shared_ptr< message > runtime_impl::create_request() const {
+ std::shared_ptr< message_impl > its_request = std::make_shared< message_impl >();
+ its_request->set_protocol_version(VSOMEIP_PROTOCOL_VERSION);
+ its_request->set_message_type(message_type_e::REQUEST);
+ its_request->set_return_code(return_code_e::E_OK);
+ return its_request;
+}
+
+std::shared_ptr< message > runtime_impl::create_response(std::shared_ptr< message > &_request) const {
+ std::shared_ptr< message_impl > its_response = std::make_shared< message_impl >();
+ its_response->set_service(_request->get_service());
+ its_response->set_instance(_request->get_instance());
+ its_response->set_method(_request->get_method());
+ its_response->set_client(_request->get_client());
+ its_response->set_session(_request->get_session());
+ its_response->set_interface_version(_request->get_interface_version());
+ its_response->set_message_type(message_type_e::RESPONSE);
+ its_response->set_return_code(return_code_e::E_OK);
+ return its_response;
+}
+
+} // namespace vsomeip
diff --git a/implementation/configuration/include/configuration_impl.hpp b/implementation/configuration/include/configuration_impl.hpp
new file mode 100644
index 0000000..23c065e
--- /dev/null
+++ b/implementation/configuration/include/configuration_impl.hpp
@@ -0,0 +1,111 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_CFG_CONFIGURATION_IMPL_HPP
+#define VSOMEIP_CFG_CONFIGURATION_IMPL_HPP
+
+#include <map>
+#include <mutex>
+
+#include <boost/property_tree/ptree.hpp>
+
+#include <vsomeip/configuration.hpp>
+
+namespace vsomeip {
+namespace cfg {
+
+class service;
+class servicegroup;
+
+class configuration_impl : public configuration {
+public:
+ static configuration * get(const std::string &_path);
+
+ configuration_impl();
+ virtual ~configuration_impl();
+
+ bool load(const std::string &_path);
+
+ const boost::asio::ip::address & get_address() const;
+ bool is_v4() const;
+ bool is_v6() const;
+
+ bool has_console_log() const;
+ bool has_file_log() const;
+ bool has_dlt_log() const;
+ const std::string & get_logfile() const;
+ boost::log::trivial::severity_level get_loglevel() const;
+
+ std::string get_address(service_t _service, instance_t _instance) const;
+
+ uint32_t get_min_initial_delay(service_t _service, instance_t _instance) const;
+ uint32_t get_max_initial_delay(service_t _service, instance_t _instance) const;
+
+ uint32_t get_repetition_base_delay(service_t _service, instance_t _instance) const;
+ uint8_t get_repetition_max(service_t _service, instance_t _instance) const;
+
+ uint32_t get_cyclic_offer_delay(service_t _service, instance_t _instance) const;
+ uint32_t get_cyclic_request_delay(service_t _service, instance_t _instance) const;
+
+ uint16_t get_reliable_port(service_t _service, instance_t _instance) const;
+ uint16_t get_unreliable_port(service_t _service, instance_t _instance) const;
+ std::string get_multicast(service_t _service, instance_t _instance) const;
+
+ const std::string & get_routing_host() const;
+
+ bool is_service_discovery_enabled() const;
+ const std::string & get_service_discovery_host() const;
+ const std::string & get_service_discovery_protocol() const;
+ uint16_t get_service_discovery_port() const;
+
+ client_t get_id(const std::string &_name) const;
+
+ std::set< std::pair< service_t, instance_t > > get_remote_services() const;
+
+private:
+ bool get_someip_configuration(boost::property_tree::ptree &_tree);
+ bool get_logging_configuration(boost::property_tree::ptree &_tree);
+ bool get_services_configuration(boost::property_tree::ptree &_tree);
+ bool get_routing_configuration(boost::property_tree::ptree &_tree);
+ bool get_service_discovery_configuration(boost::property_tree::ptree &_tree);
+ bool get_applications_configuration(boost::property_tree::ptree &_tree);
+
+ bool get_servicegroup_configuration(const boost::property_tree::ptree &_tree);
+ bool get_delays_configuration(boost::shared_ptr< servicegroup > &_group, const boost::property_tree::ptree &_tree);
+ bool get_service_configuration(boost::shared_ptr< servicegroup > &_group, const boost::property_tree::ptree &_tree);
+ bool get_application_configuration(const boost::property_tree::ptree &_tree);
+
+ service * find_service(service_t _service, instance_t _instance) const;
+
+private:
+ static std::map< std::string, configuration * > the_configurations;
+ static std::mutex mutex_;
+
+ // Configuration data
+ boost::asio::ip::address address_;
+
+ bool has_console_log_;
+ bool has_file_log_;
+ bool has_dlt_log_;
+ std::string logfile_;
+ boost::log::trivial::severity_level loglevel_;
+
+ std::map< service_t, std::map< instance_t, boost::shared_ptr< service > > > services_;
+
+ std::string routing_host_;
+
+ bool is_service_discovery_enabled_;
+ std::string service_discovery_host_;
+ std::string service_discovery_protocol_;
+ uint16_t service_discovery_port_;
+
+ std::map< std::string, client_t > applications_;
+};
+
+} // namespace cfg
+} // namespace vsomeip
+
+#endif // VSOMEIP_CFG_CONFIGURATION_IMPL_HPP
diff --git a/implementation/configuration/include/internal.hpp b/implementation/configuration/include/internal.hpp
new file mode 100644
index 0000000..8dcf084
--- /dev/null
+++ b/implementation/configuration/include/internal.hpp
@@ -0,0 +1,61 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_INTERNAL_HPP
+#define VSOMEIP_INTERNAL_HPP
+
+#include <cstdint>
+
+namespace vsomeip {
+
+#define VSOMEIP_SD_LIBRARY "libvsomeip-sd.so"
+#define VSOMEIP_SD_RUNTIME_SYMBOL VSOMEIP_SD_RUNTIME
+#define VSOMEIP_SD_RUNTIME_SYMBOL_STRING "VSOMEIP_SD_RUNTIME"
+
+#define VSOMEIP_ROUTING_ENDPOINT "rtg"
+#define VSOMEIP_SERVICE_DISCOVERY_ENDPOINT "sd"
+
+#define VSOMEIP_DEFAULT_CONNECT_TIMEOUT 100
+#define VSOMEIP_DEFAULT_FLUSH_TIMEOUT 1000
+
+#define VSOMEIP_DEFAULT_WATCHDOG_CYCLE 1000
+#define VSOMEIP_DEFAULT_WATCHDOG_TIMEOUT 1000
+#define VSOMEIP_DEFAULT_MAX_MISSING_PONGS 3
+
+#define VSOMEIP_COMMAND_HEADER_SIZE 7
+
+#define VSOMEIP_COMMAND_TYPE_POS 0
+#define VSOMEIP_COMMAND_CLIENT_POS 1
+#define VSOMEIP_COMMAND_SIZE_POS_MIN 3
+#define VSOMEIP_COMMAND_SIZE_POS_MAX 5
+#define VSOMEIP_COMMAND_PAYLOAD_POS 7
+
+#define VSOMEIP_REGISTER_APPLICATION 0x00
+#define VSOMEIP_DEREGISTER_APPLICATION 0x01
+#define VSOMEIP_APPLICATION_LOST 0x02
+#define VSOMEIP_ROUTING_INFO 0x03
+
+#define VSOMEIP_PING 0x0E
+#define VSOMEIP_PONG 0x0F
+
+#define VSOMEIP_OFFER_SERVICE 0x10
+#define VSOMEIP_STOP_OFFER_SERVICE 0x11
+#define VSOMEIP_PUBLISH_EVENTGROUP 0x12
+#define VSOMEIP_STOP_PUBLISH_EVENTGROUP 0x13
+#define VSOMEIP_ADD_EVENT 0x14
+#define VSOMEIP_ADD_FIELD 0x15
+#define VSOMEIP_REMOVE_EVENT_OR_FIELD 0x16
+#define VSOMEIP_SEND 0x17
+#define VSOMEIP_SET 0x18
+
+#define VSOMEIP_OFFER_SERVICE_COMMAND_SIZE 20
+#define VSOMEIP_STOP_OFFER_SERVICE_COMMAND_SIZE 11
+#define VSOMEIP_PUBLISH_EVENTGROUP_COMMAND_SIZE 18
+#define VSOMEIP_STOP_PUBLISH_EVENTGROUP_COMMAND_SIZE 13
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_INTERNAL_HPP
diff --git a/implementation/configuration/include/service.hpp b/implementation/configuration/include/service.hpp
new file mode 100644
index 0000000..8ab3504
--- /dev/null
+++ b/implementation/configuration/include/service.hpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_CFG_SERVICE_HPP
+#define VSOMEIP_CFG_SERVICE_HPP
+
+namespace vsomeip {
+namespace cfg {
+
+struct service {
+ service_t service_;
+ instance_t instance_;
+
+ uint16_t reliable_;
+
+ uint16_t unreliable_;
+ std::string multicast_;
+
+ boost::shared_ptr< servicegroup > group_;
+};
+
+} // namespace cfg
+} // namespace vsomeip
+
+#endif // VSOMEIP_CFG_SERVICE_HPP
diff --git a/implementation/configuration/include/servicegroup.hpp b/implementation/configuration/include/servicegroup.hpp
new file mode 100644
index 0000000..258984a
--- /dev/null
+++ b/implementation/configuration/include/servicegroup.hpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_CFG_SERVICEGROUP_HPP
+#define VSOMEIP_CFG_SERVICEGROUP_HPP
+
+namespace vsomeip {
+namespace cfg {
+
+struct servicegroup {
+ std::string name_; // Name of the ServiceGroup
+ std::string address_; // either "local" or an IP address
+
+ uint32_t initial_delay_min_;
+ uint32_t initial_delay_max_;
+ uint32_t repetition_base_delay_;
+ uint32_t cyclic_offer_delay_;
+ uint32_t cyclic_request_delay_;
+ uint8_t repetition_max_;
+};
+
+} // namespace cfg
+} // namespace vsomeip
+
+#endif // VSOMEIP_CFG_SERVICEGROUP_HPP
diff --git a/implementation/configuration/src/configuration.cpp b/implementation/configuration/src/configuration.cpp
new file mode 100644
index 0000000..b1aeefa
--- /dev/null
+++ b/implementation/configuration/src/configuration.cpp
@@ -0,0 +1,15 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/. */
+
+#include "../include/configuration_impl.hpp"
+
+namespace vsomeip {
+
+configuration * configuration::get(const std::string &_path) {
+ return cfg::configuration_impl::get(_path);
+}
+
+} // namespace vsomeip
diff --git a/implementation/configuration/src/configuration_impl.cpp b/implementation/configuration/src/configuration_impl.cpp
new file mode 100644
index 0000000..b9e58ce
--- /dev/null
+++ b/implementation/configuration/src/configuration_impl.cpp
@@ -0,0 +1,579 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/. */
+
+#include <fstream>
+#include <map>
+#include <sstream>
+
+#include <boost/algorithm/string.hpp>
+#include <boost/foreach.hpp>
+#include <boost/property_tree/xml_parser.hpp>
+
+#include <vsomeip/constants.hpp>
+
+#include "../include/configuration_impl.hpp"
+#include "../include/servicegroup.hpp"
+#include "../include/service.hpp"
+#include "../../logging/include/logger_impl.hpp"
+
+namespace vsomeip {
+namespace cfg {
+
+std::map< std::string, configuration * > configuration_impl::the_configurations;
+std::mutex configuration_impl::mutex_;
+
+configuration * configuration_impl::get(const std::string &_path) {
+ configuration *its_configuration(0);
+
+ bool is_freshly_loaded(false);
+ {
+ std::unique_lock< std::mutex > its_lock(mutex_);
+
+ auto found_configuration = the_configurations.find(_path);
+ if (found_configuration != the_configurations.end()) {
+ its_configuration = found_configuration->second;
+ } else {
+ its_configuration = new configuration_impl;
+ if (its_configuration->load(_path)) {
+ the_configurations[_path] = its_configuration;
+ is_freshly_loaded = true;
+ } else {
+ delete its_configuration;
+ its_configuration = 0;
+ }
+ }
+ }
+
+ if (is_freshly_loaded)
+ logger_impl::init(_path);
+
+ return its_configuration;
+}
+
+configuration_impl::configuration_impl()
+ : has_console_log_(true),
+ has_file_log_(false),
+ has_dlt_log_(false),
+ logfile_("/tmp/vsomeip.log"),
+ loglevel_(boost::log::trivial::severity_level::info),
+ routing_host_("vsomeipd"),
+ is_service_discovery_enabled_(false),
+ service_discovery_host_("vsomeipd") {
+
+ address_ = address_.from_string("127.0.0.1");
+}
+
+configuration_impl::~configuration_impl() {
+}
+
+bool configuration_impl::load(const std::string &_path) {
+ bool is_loaded(true);
+ boost::property_tree::ptree its_tree;
+
+ try {
+ boost::property_tree::xml_parser::read_xml(_path, its_tree);
+
+ auto its_someip = its_tree.get_child("someip");
+
+ // Read the configuration data
+ is_loaded = get_someip_configuration(its_someip);
+ is_loaded = get_logging_configuration(its_someip);
+ is_loaded = is_loaded && get_services_configuration(its_someip);
+ is_loaded = is_loaded && get_routing_configuration(its_someip);
+ is_loaded = is_loaded && get_service_discovery_configuration(its_someip);
+ is_loaded = is_loaded && get_applications_configuration(its_someip);
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+
+ return is_loaded;
+}
+
+bool configuration_impl::get_someip_configuration(boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ std::string its_value = _tree.get< std::string >("address");
+ address_ = address_.from_string(its_value);
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+ return is_loaded;
+}
+
+bool configuration_impl::get_logging_configuration(boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ auto its_logging = _tree.get_child("logging");
+ for (auto i = its_logging.begin(); i != its_logging.end(); ++i) {
+ std::string its_key(i->first);
+ std::string its_value(i->second.data());
+
+ if (its_key == "console") {
+ has_console_log_ = (its_value == "true");
+ } else if (its_key == "file") {
+ try {
+ auto its_file_properties = i->second;
+ for (auto j : its_file_properties) {
+ std::string its_file_key(j.first);
+ std::string its_file_value(j.second.data());
+
+ if (its_file_key == "enabled") {
+ has_file_log_ = (its_file_value == "true");
+ } else if (its_file_key == "path") {
+ logfile_ = its_file_value;
+ }
+ }
+ }
+ catch (...) {
+ }
+ } else if (its_key == "dlt") {
+ has_dlt_log_ = (its_value == "true");
+ } else if (its_key == "level") {
+ loglevel_ = (its_value == "trace" ? boost::log::trivial::severity_level::trace
+ : (its_value == "debug" ? boost::log::trivial::severity_level::debug
+ : (its_value == "info" ? boost::log::trivial::severity_level::info
+ : (its_value == "warning" ? boost::log::trivial::severity_level::warning
+ : (its_value == "error" ? boost::log::trivial::severity_level::error
+ : (its_value == "fatal" ? boost::log::trivial::severity_level::fatal
+ : boost::log::trivial::severity_level::info))))));
+ }
+ }
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+ return is_loaded;
+}
+
+bool configuration_impl::get_services_configuration(boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ auto its_services = _tree.get_child("services");
+ for (auto i = its_services.begin(); i != its_services.end(); ++i) {
+ std::string its_key(i->first);
+
+ if (its_key == "servicegroup") {
+ is_loaded = is_loaded && get_servicegroup_configuration(i->second);
+ }
+ }
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+ return is_loaded;
+}
+
+bool configuration_impl::get_servicegroup_configuration(const boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ boost::shared_ptr< servicegroup > its_servicegroup(new servicegroup);
+ its_servicegroup->address_ = "local"; // Default
+ for (auto i = _tree.begin(); i != _tree.end(); ++i) {
+ std::string its_key(i->first);
+
+ if (its_key == "name") {
+ its_servicegroup->name_ = i->second.data();
+ } else if (its_key == "address") {
+ its_servicegroup->address_ = i->second.data();
+ } else if (its_key == "delays") {
+ is_loaded = is_loaded && get_delays_configuration(its_servicegroup, i->second);
+ } else if (its_key == "service") {
+ is_loaded = is_loaded && get_service_configuration(its_servicegroup, i->second);
+ }
+ }
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+ return is_loaded;
+}
+
+bool configuration_impl::get_delays_configuration(boost::shared_ptr< servicegroup > &_group, const boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ std::stringstream its_converter;
+
+ for (auto i = _tree.begin(); i != _tree.end(); ++i) {
+ std::string its_key(i->first);
+
+ if (its_key == "initial") {
+ _group->initial_delay_min_ = i->second.get< uint32_t >("min");
+ _group->initial_delay_max_ = i->second.get< uint32_t >("max");
+ } else if (its_key == "repetition-base") {
+ its_converter << std::dec << i->second.data();
+ its_converter >> _group->repetition_base_delay_;
+ } else if (its_key == "repetition-max") {
+ int tmp_repetition_max;
+ its_converter << std::dec << i->second.data();
+ its_converter >> tmp_repetition_max;
+ _group->repetition_max_ = tmp_repetition_max;
+ } else if (its_key == "cyclic-offer") {
+ its_converter << std::dec << i->second.data();
+ its_converter >> _group->cyclic_offer_delay_;
+ } else if (its_key == "cyclic-request") {
+ its_converter << std::dec << i->second.data();
+ its_converter >> _group->cyclic_request_delay_;
+ }
+
+ its_converter.str("");
+ its_converter.clear();
+ }
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+ return is_loaded;
+}
+
+bool configuration_impl::get_service_configuration(boost::shared_ptr< servicegroup > &_group, const boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ boost::shared_ptr< service > its_service(new service);
+ its_service->group_ = _group;
+
+ for (auto i = _tree.begin(); i != _tree.end(); ++i) {
+ std::string its_key(i->first);
+ std::string its_value(i->second.data());
+ std::stringstream its_converter;
+
+ if (its_key == "multicast") {
+ its_service->multicast_ = its_value;
+ } else if (its_key == "ports") {
+ try {
+ its_value = i->second.get_child("reliable").data();
+ its_converter << its_value;
+ its_converter >> its_service->reliable_;
+ }
+ catch (...) {
+ its_service->reliable_ = VSOMEIP_ILLEGAL_PORT;
+ }
+ try {
+ its_converter.str("");
+ its_converter.clear();
+ its_value = i->second.get_child("unreliable").data();
+ its_converter << its_value;
+ its_converter >> its_service->unreliable_;
+ }
+ catch (...) {
+ its_service->unreliable_ = VSOMEIP_ILLEGAL_PORT;
+ }
+ } else {
+ // Trim "its_value"
+ if (its_value[0] == '0' && its_value[1] == 'x') {
+ its_converter << std::hex << its_value;
+ } else {
+ its_converter << std::dec << its_value;
+ }
+
+ if (its_key == "service-id") {
+ its_converter >> its_service->service_;
+ } else if (its_key == "instance-id") {
+ its_converter >> its_service->instance_;
+ }
+ }
+ }
+
+ auto found_service = services_.find(its_service->service_);
+ if (found_service != services_.end()) {
+ auto found_instance = found_service->second.find(its_service->instance_);
+ if (found_instance != found_service->second.end()) {
+ is_loaded = false;
+ }
+ }
+
+ if (is_loaded) {
+ services_[its_service->service_][its_service->instance_] = its_service;
+ }
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+ return is_loaded;
+}
+
+bool configuration_impl::get_routing_configuration(boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ std::stringstream its_converter;
+ auto its_service_discovery = _tree.get_child("routing");
+ for (auto i = its_service_discovery.begin(); i != its_service_discovery.end(); ++i) {
+ std::string its_key(i->first);
+ std::string its_value(i->second.data());
+
+ if (its_key == "host") {
+ routing_host_ = its_value;
+ }
+ }
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+
+ return is_loaded;
+}
+
+bool configuration_impl::get_service_discovery_configuration(boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ std::stringstream its_converter;
+ auto its_service_discovery = _tree.get_child("service-discovery");
+ for (auto i = its_service_discovery.begin(); i != its_service_discovery.end(); ++i) {
+ std::string its_key(i->first);
+ std::string its_value(i->second.data());
+
+ if (its_key == "enabled") {
+ is_service_discovery_enabled_ = (its_value == "true");
+ } else if (its_key == "host") {
+ service_discovery_host_ = its_value;
+ } else if (its_key == "protocol") {
+ service_discovery_protocol_ = its_value;
+ } else if (its_key == "port") {
+ its_converter << its_value;
+ its_converter >> service_discovery_port_;
+ its_converter.str("");
+ its_converter.clear();
+ }
+ }
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+
+ return is_loaded;
+}
+
+bool configuration_impl::get_applications_configuration(boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+ try {
+ std::stringstream its_converter;
+ auto its_applications = _tree.get_child("applications");
+ for (auto i = its_applications.begin(); i != its_applications.end(); ++i) {
+ std::string its_key(i->first);
+ if (its_key == "application") {
+ is_loaded = is_loaded && get_application_configuration(i->second);
+ }
+ }
+ }
+ catch (...) {
+ is_loaded = false;
+ }
+
+ return is_loaded;
+}
+
+bool configuration_impl::get_application_configuration(const boost::property_tree::ptree &_tree) {
+ bool is_loaded(true);
+
+ std::string its_name("");
+ client_t its_id;
+
+ for (auto i = _tree.begin(); i != _tree.end(); ++i) {
+ std::string its_key(i->first);
+ std::string its_value(i->second.data());
+ std::stringstream its_converter;
+
+ if (its_key == "name") {
+ its_name = its_value;
+ } else if (its_key == "id") {
+ if (its_value[0] == '0' && its_value[1] == 'x') {
+ its_converter << std::hex << its_value;
+ } else {
+ its_converter << std::dec << its_value;
+ }
+ its_converter >> its_id;
+ }
+ }
+
+ if (its_name != "" && its_id != 0) {
+ applications_[its_name] = its_id;
+ }
+
+ return is_loaded;
+}
+
+// Public interface
+const boost::asio::ip::address & configuration_impl::get_address() const {
+ return address_;
+}
+
+bool configuration_impl::is_v4() const {
+ return address_.is_v4();
+}
+
+bool configuration_impl::is_v6() const {
+ return address_.is_v6();
+}
+
+bool configuration_impl::has_console_log() const {
+ return has_console_log_;
+}
+
+bool configuration_impl::has_file_log() const {
+ return has_file_log_;
+}
+
+bool configuration_impl::has_dlt_log() const {
+ return has_dlt_log_;
+}
+
+const std::string & configuration_impl::get_logfile() const {
+ return logfile_;
+}
+
+boost::log::trivial::severity_level configuration_impl::get_loglevel() const {
+ return loglevel_;
+}
+
+uint32_t configuration_impl::get_min_initial_delay(service_t _service, instance_t _instance) const {
+ uint32_t its_delay = 0;
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_delay = its_service->group_->initial_delay_min_;
+
+ return its_delay;
+}
+
+uint32_t configuration_impl::get_max_initial_delay(service_t _service, instance_t _instance) const {
+ uint32_t its_delay = 0xFFFFFFFF;
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_delay = its_service->group_->initial_delay_max_;
+
+ return its_delay;
+}
+
+uint32_t configuration_impl::get_repetition_base_delay(service_t _service, instance_t _instance) const {
+ uint32_t its_delay = 0xFFFFFFFF;
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_delay = its_service->group_->repetition_base_delay_;
+
+ return its_delay;
+}
+
+uint8_t configuration_impl::get_repetition_max(service_t _service, instance_t _instance) const {
+ uint8_t its_max = 0;
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_max = its_service->group_->repetition_max_;
+
+ return its_max;
+}
+
+uint32_t configuration_impl::get_cyclic_offer_delay(service_t _service, instance_t _instance) const {
+ uint32_t its_delay = 0xFFFFFFFF;
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_delay = its_service->group_->cyclic_offer_delay_;
+
+ return its_delay;
+
+}
+
+uint32_t configuration_impl::get_cyclic_request_delay(service_t _service, instance_t _instance) const {
+ uint32_t its_delay = 0xFFFFFFFF;
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_delay = its_service->group_->cyclic_request_delay_;
+
+ return its_delay;
+}
+
+std::string configuration_impl::get_address(service_t _service, instance_t _instance) const {
+ std::string its_address("");
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service)
+ its_address = its_service->group_->address_;
+
+ return its_address;
+}
+
+uint16_t configuration_impl::get_reliable_port(service_t _service, instance_t _instance) const {
+ uint16_t its_reliable = VSOMEIP_ILLEGAL_PORT;
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_reliable = its_service->reliable_;
+
+ return its_reliable;
+}
+
+uint16_t configuration_impl::get_unreliable_port(service_t _service, instance_t _instance) const {
+ uint16_t its_unreliable = VSOMEIP_ILLEGAL_PORT;
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_unreliable = its_service->unreliable_;
+
+ return its_unreliable;
+}
+
+std::string configuration_impl::get_multicast(service_t _service, instance_t _instance) const {
+ std::string its_multicast(VSOMEIP_DEFAULT_MULTICAST);
+
+ service *its_service = find_service(_service, _instance);
+ if (its_service) its_multicast = its_service->multicast_;
+
+ return its_multicast;
+}
+
+const std::string & configuration_impl::get_routing_host() const {
+ return routing_host_;
+}
+
+bool configuration_impl::is_service_discovery_enabled() const {
+ return is_service_discovery_enabled_;
+}
+
+const std::string & configuration_impl::get_service_discovery_host() const {
+ return service_discovery_host_;
+}
+
+const std::string & configuration_impl::get_service_discovery_protocol() const {
+ return service_discovery_protocol_;
+}
+
+uint16_t configuration_impl::get_service_discovery_port() const {
+ return service_discovery_port_;
+}
+
+client_t configuration_impl::get_id(const std::string &_name) const {
+ client_t its_client = 0;
+
+ auto found_application = applications_.find(_name);
+ if (found_application != applications_.end()) {
+ its_client = found_application->second;
+ }
+
+ return its_client;
+}
+
+std::set< std::pair< service_t, instance_t > > configuration_impl::get_remote_services() const {
+ std::set< std::pair< service_t, instance_t > > its_remote_services;
+ for (auto i : services_) {
+ for (auto j : i.second) {
+ if (j.second->group_->address_ != "local")
+ its_remote_services.insert(std::make_pair(i.first, j.first));
+ }
+ }
+ return its_remote_services;
+}
+
+service *configuration_impl::find_service(service_t _service, instance_t _instance) const {
+ service *its_service = 0;
+ auto find_service = services_.find(_service);
+ if (find_service != services_.end()) {
+ auto find_instance = find_service->second.find(_instance);
+ if (find_instance != find_service->second.end()) {
+ its_service = find_instance->second.get();
+ }
+ }
+ return its_service;
+}
+
+} // namespace config
+} // namespace vsomeip
diff --git a/implementation/endpoints/include/client_endpoint_impl.hpp b/implementation/endpoints/include/client_endpoint_impl.hpp
new file mode 100644
index 0000000..52328b1
--- /dev/null
+++ b/implementation/endpoints/include/client_endpoint_impl.hpp
@@ -0,0 +1,83 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_CLIENT_ENDPOINT_IMPL_HPP
+#define VSOMEIP_CLIENT_ENDPOINT_IMPL_HPP
+
+#include <deque>
+#include <mutex>
+#include <vector>
+
+#include <boost/array.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/udp.hpp>
+#include <boost/utility.hpp>
+
+#include "endpoint_impl.hpp"
+
+namespace vsomeip {
+
+class endpoint;
+class endpoint_host;
+
+template < typename Protocol, int MaxBufferSize >
+class client_endpoint_impl
+ : public endpoint_impl< MaxBufferSize >,
+ public std::enable_shared_from_this< client_endpoint_impl< Protocol, MaxBufferSize > > {
+public:
+ typedef typename Protocol::socket socket_type;
+ typedef typename Protocol::endpoint endpoint_type;
+
+ client_endpoint_impl(std::shared_ptr< endpoint_host > _host,
+ endpoint_type _remote,
+ boost::asio::io_service &_io);
+ virtual ~client_endpoint_impl();
+
+ bool send(const uint8_t *_data, uint32_t _size, bool _flush);
+ bool flush();
+
+ void stop();
+ void restart();
+
+ bool is_client() const;
+ const uint8_t * get_buffer() const;
+
+public:
+ void connect_cbk(boost::system::error_code const &_error);
+ void wait_connect_cbk(boost::system::error_code const &_error);
+ void send_cbk(boost::system::error_code const &_error, std::size_t _bytes);
+ void flush_cbk(boost::system::error_code const &_error);
+ void receive_cbk(boost::system::error_code const &_error, std::size_t _bytes);
+
+public:
+ virtual void connect() = 0;
+ virtual void receive() = 0;
+
+protected:
+ socket_type socket_;
+ endpoint_type remote_;
+ boost::array< byte_t, MaxBufferSize > buffer_;
+
+ boost::asio::system_timer flush_timer_;
+ boost::asio::system_timer connect_timer_;
+ uint32_t connect_timeout_;
+ bool is_connected_;
+
+ // send data
+ std::deque< std::vector< byte_t > > packet_queue_;
+ std::vector< byte_t > packetizer_;
+
+ // receive data
+ std::vector< byte_t > message_;
+
+ std::mutex mutex_;
+
+ virtual void send_queued() = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_CLIENT_ENDPOINT_IMPL_HPP
diff --git a/implementation/endpoints/include/endpoint.hpp b/implementation/endpoints/include/endpoint.hpp
new file mode 100644
index 0000000..640536e
--- /dev/null
+++ b/implementation/endpoints/include/endpoint.hpp
@@ -0,0 +1,39 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ENDPOINT_HPP
+#define VSOMEIP_ENDPOINT_HPP
+
+#include <vsomeip/primitive_types.hpp>
+
+namespace vsomeip {
+
+class message_base;
+
+class endpoint
+{
+public:
+ virtual ~endpoint() {};
+
+ virtual void start() = 0;
+ virtual void stop() = 0;
+
+ virtual bool send(const byte_t *_data, uint32_t _size, bool _flush = true) = 0;
+ virtual bool flush() = 0;
+
+ virtual void open_filter(service_t _service_id) = 0;
+ virtual void close_filter(service_t _service_id) = 0;
+
+ virtual void join(const std::string &_multicast_address) = 0;
+ virtual void leave(const std::string &_multicast_address) = 0;
+
+ virtual void enable_magic_cookies() = 0;
+ virtual void disable_magic_cookies() = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ENDPOINT_HPP
diff --git a/implementation/endpoints/include/endpoint_host.hpp b/implementation/endpoints/include/endpoint_host.hpp
new file mode 100644
index 0000000..b986752
--- /dev/null
+++ b/implementation/endpoints/include/endpoint_host.hpp
@@ -0,0 +1,25 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ENDPOINT_HOST_HPP
+#define VSOMEIP_ENDPOINT_HOST_HPP
+
+#include <vsomeip/primitive_types.hpp>
+
+namespace vsomeip {
+
+class endpoint;
+
+class endpoint_host {
+public:
+ virtual ~endpoint_host() {};
+
+ virtual void on_message(const byte_t *_data, length_t _length, endpoint *_receiver) = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ENDPOINT_HOST_HPP
diff --git a/implementation/endpoints/include/endpoint_impl.hpp b/implementation/endpoints/include/endpoint_impl.hpp
new file mode 100644
index 0000000..bacb440
--- /dev/null
+++ b/implementation/endpoints/include/endpoint_impl.hpp
@@ -0,0 +1,63 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ENDPOINT_IMPL_HPP
+#define VSOMEIP_ENDPOINT_IMPL_HPP
+
+#include <map>
+#include <memory>
+
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/system_timer.hpp>
+
+#include "endpoint.hpp"
+
+namespace vsomeip {
+
+class endpoint_host;
+
+template < int MaxBufferSize >
+class endpoint_impl
+ : public endpoint
+{
+public:
+ endpoint_impl(std::shared_ptr< endpoint_host > _adapter, boost::asio::io_service &_io);
+ virtual ~endpoint_impl();
+
+ void enable_magic_cookies();
+ void disable_magic_cookies();
+
+ void open_filter(service_t _service);
+ void close_filter(service_t _service);
+
+public: // required
+ virtual bool is_client() const = 0;
+ virtual const uint8_t * get_buffer() const = 0;
+
+ virtual void receive() = 0;
+ virtual void restart() = 0;
+
+private:
+ virtual bool is_magic_cookie() const;
+ bool resync_on_magic_cookie();
+
+protected:
+ // Reference to service context
+ boost::asio::io_service &service_;
+
+ // Reference to host
+ endpoint_host *host_;
+
+ bool is_supporting_magic_cookies_;
+ bool has_enabled_magic_cookies_;
+
+ // Filter configuration
+ std::map< service_t, uint8_t > opened_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ENDPOINT_IMPL_HPP
diff --git a/implementation/endpoints/include/local_client_endpoint_impl.hpp b/implementation/endpoints/include/local_client_endpoint_impl.hpp
new file mode 100644
index 0000000..6e46ad9
--- /dev/null
+++ b/implementation/endpoints/include/local_client_endpoint_impl.hpp
@@ -0,0 +1,45 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_LOCAL_CLIENT_ENDPOINT_IMPL_HPP
+#define VSOMEIP_LOCAL_CLIENT_ENDPOINT_IMPL_HPP
+
+#include <boost/asio/local/stream_protocol.hpp>
+
+#include <vsomeip/defines.hpp>
+#include "client_endpoint_impl.hpp"
+
+namespace vsomeip {
+
+typedef client_endpoint_impl<
+ boost::asio::local::stream_protocol,
+ VSOMEIP_MAX_LOCAL_MESSAGE_SIZE > local_client_endpoint_base_impl;
+
+class local_client_endpoint_impl
+ : public local_client_endpoint_base_impl {
+public:
+ local_client_endpoint_impl(std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io);
+
+ void start();
+
+ void send_queued();
+
+ void join(const std::string &);
+ void leave(const std::string &);
+
+private:
+ void send_magic_cookie();
+
+ void connect();
+ void receive();
+
+ void send_tag_cbk(boost::system::error_code const &_error, std::size_t _bytes);
+ void receive_cbk(boost::system::error_code const &_error, std::size_t _bytes);
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_LOCAL_CLIENT_ENDPOINT_IMPL_HPP
diff --git a/implementation/endpoints/include/local_server_endpoint_impl.hpp b/implementation/endpoints/include/local_server_endpoint_impl.hpp
new file mode 100644
index 0000000..125916e
--- /dev/null
+++ b/implementation/endpoints/include/local_server_endpoint_impl.hpp
@@ -0,0 +1,87 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_LOCAL_SERVER_ENDPOINT_IMPL_HPP
+#define VSOMEIP_LOCAL_SERVER_ENDPOINT_IMPL_HPP
+
+#include <map>
+
+#include <boost/asio/local/stream_protocol.hpp>
+#include <boost/enable_shared_from_this.hpp>
+
+#include <vsomeip/defines.hpp>
+#include "server_endpoint_impl.hpp"
+
+namespace vsomeip {
+
+typedef server_endpoint_impl<
+ boost::asio::local::stream_protocol,
+ VSOMEIP_MAX_LOCAL_MESSAGE_SIZE > local_server_endpoint_base_impl;
+
+class local_server_endpoint_impl
+ : public local_server_endpoint_base_impl {
+
+public:
+ local_server_endpoint_impl(std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io);
+ virtual ~local_server_endpoint_impl();
+
+ void start();
+ void stop();
+
+ void restart();
+ void receive();
+
+ const uint8_t * get_buffer() const;
+
+ void send_queued();
+ endpoint_type get_remote() const;
+
+ void join(const std::string &);
+ void leave(const std::string &);
+
+private:
+ class connection
+ : public boost::enable_shared_from_this< connection > {
+
+ public:
+ typedef boost::shared_ptr< connection > ptr;
+
+ static ptr create(local_server_endpoint_impl *_server);
+ socket_type & get_socket();
+
+ void start();
+
+ void send_queued();
+ const uint8_t * get_buffer() const;
+
+ private:
+ connection(local_server_endpoint_impl *_owner);
+
+ void send_magic_cookie();
+
+ local_server_endpoint_impl::socket_type socket_;
+ buffer_type buffer_;
+ local_server_endpoint_impl *server_;
+
+ // the current message
+ std::vector< byte_t > message_;
+
+ private:
+ void receive_cbk(boost::system::error_code const &_error, std::size_t _bytes);
+ };
+
+ boost::asio::local::stream_protocol::acceptor acceptor_;
+ std::map< endpoint_type, connection::ptr > connections_;
+ connection *current_;
+
+private:
+ void remove_connection(connection *_connection);
+ void accept_cbk(connection::ptr _connection, boost::system::error_code const &_error);
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_LOCAL_SERVER_ENDPOINT_IMPL_HPP
diff --git a/implementation/endpoints/include/server_endpoint_impl.hpp b/implementation/endpoints/include/server_endpoint_impl.hpp
new file mode 100644
index 0000000..14e252c
--- /dev/null
+++ b/implementation/endpoints/include/server_endpoint_impl.hpp
@@ -0,0 +1,68 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SERVER_IMPL_HPP
+#define VSOMEIP_SERVER_IMPL_HPP
+
+#include <deque>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <vector>
+
+#include <boost/array.hpp>
+#include <boost/asio/io_service.hpp>
+
+#include "endpoint_impl.hpp"
+
+namespace vsomeip {
+
+template < typename Protocol, int MaxBufferSize >
+class server_endpoint_impl
+ : public endpoint_impl< MaxBufferSize >,
+ public std::enable_shared_from_this< server_endpoint_impl< Protocol, MaxBufferSize > > {
+public:
+ typedef typename Protocol::socket socket_type;
+ typedef typename Protocol::endpoint endpoint_type;
+ typedef boost::array< uint8_t, MaxBufferSize > buffer_type;
+
+ server_endpoint_impl(std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io);
+
+ bool is_client() const;
+
+ bool send(const uint8_t *_data, uint32_t _size, bool _flush);
+ bool flush();
+
+public:
+ void connect_cbk(boost::system::error_code const &_error);
+ void send_cbk(boost::system::error_code const &_error, std::size_t _bytes);
+ void flush_cbk(endpoint_type _target, const boost::system::error_code &_error);
+
+public:
+ virtual void send_queued() = 0;
+ virtual endpoint_type get_remote() const = 0;
+
+protected:
+ typedef std::map< endpoint_type, std::deque< std::vector< byte_t > > > queue_type_t;
+ queue_type_t packet_queues_;
+ typename queue_type_t::iterator current_queue_;
+ std::map< endpoint_type, std::vector< byte_t > > packetizer_;
+
+ std::map< client_t, endpoint_type > clients_;
+
+ boost::asio::system_timer flush_timer_;
+
+ endpoint_type local_;
+
+ std::mutex mutex_;
+
+private:
+ bool set_next_queue();
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERVICE_ENDPOINT_IMPL_HPP
diff --git a/implementation/endpoints/include/tcp_client_endpoint_impl.hpp b/implementation/endpoints/include/tcp_client_endpoint_impl.hpp
new file mode 100644
index 0000000..d78a8b2
--- /dev/null
+++ b/implementation/endpoints/include/tcp_client_endpoint_impl.hpp
@@ -0,0 +1,42 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_TCP_CLIENT_ENDPOINT_IMPL_HPP
+#define VSOMEIP_TCP_CLIENT_ENDPOINT_IMPL_HPP
+
+#include <boost/asio/ip/tcp.hpp>
+
+#include <vsomeip/defines.hpp>
+#include "client_endpoint_impl.hpp"
+
+namespace vsomeip {
+
+typedef client_endpoint_impl<
+ boost::asio::ip::tcp,
+ VSOMEIP_MAX_TCP_MESSAGE_SIZE > tcp_client_endpoint_base_impl;
+
+class tcp_client_endpoint_impl
+ : public tcp_client_endpoint_base_impl {
+public:
+ tcp_client_endpoint_impl(std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io);
+ virtual ~tcp_client_endpoint_impl();
+
+ void start();
+ void send_queued();
+
+ void join(const std::string &);
+ void leave(const std::string &);
+
+private:
+ void send_magic_cookie();
+
+ void connect();
+ void receive();
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_TCP_CLIENT_ENDPOINT_IMPL_HPP
diff --git a/implementation/endpoints/include/tcp_server_endpoint_impl.hpp b/implementation/endpoints/include/tcp_server_endpoint_impl.hpp
new file mode 100644
index 0000000..fccdd78
--- /dev/null
+++ b/implementation/endpoints/include/tcp_server_endpoint_impl.hpp
@@ -0,0 +1,85 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_TCP_SERVER_ENDPOINT_IMPL_HPP
+#define VSOMEIP_TCP_SERVER_ENDPOINT_IMPL_HPP
+
+#include <map>
+
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/enable_shared_from_this.hpp>
+
+#include <vsomeip/defines.hpp>
+#include "server_endpoint_impl.hpp"
+
+namespace vsomeip {
+
+typedef server_endpoint_impl<
+ boost::asio::ip::tcp,
+ VSOMEIP_MAX_TCP_MESSAGE_SIZE > tcp_server_endpoint_base_impl;
+
+class tcp_server_endpoint_impl
+ : public tcp_server_endpoint_base_impl {
+
+public:
+ tcp_server_endpoint_impl(std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io);
+ virtual ~tcp_server_endpoint_impl();
+
+ void start();
+ void stop();
+
+ void restart();
+ void receive();
+
+ const uint8_t * get_buffer() const;
+
+ void send_queued();
+ endpoint_type get_remote() const;
+
+ void join(const std::string &);
+ void leave(const std::string &);
+
+private:
+ class connection
+ : public boost::enable_shared_from_this< connection > {
+
+ public:
+ typedef boost::shared_ptr< connection > ptr;
+
+ static ptr create(tcp_server_endpoint_impl *_server);
+ socket_type & get_socket();
+
+ void start();
+ void stop();
+
+ void send_queued();
+ const uint8_t * get_buffer() const;
+
+ private:
+ connection(tcp_server_endpoint_impl *_owner);
+ void send_magic_cookie();
+
+ tcp_server_endpoint_impl::socket_type socket_;
+ buffer_type buffer_;
+ tcp_server_endpoint_impl *server_;
+
+ std::vector< byte_t > message_;
+
+ private:
+ void receive_cbk(boost::system::error_code const &_error, std::size_t _bytes);
+ };
+
+ boost::asio::ip::tcp::acceptor acceptor_;
+ std::map< endpoint_type, connection::ptr > connections_;
+ connection *current_;
+
+private:
+ void accept_cbk(connection::ptr _connection, boost::system::error_code const &_error);
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_TCP_SERVER_ENDPOINT_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/udp_client_impl.hpp b/implementation/endpoints/include/udp_client_endpoint_impl.hpp
index 788cc19..4ca8762 100644
--- a/vsomeip/include/vsomeip_internal/udp_client_impl.hpp
+++ b/implementation/endpoints/include/udp_client_endpoint_impl.hpp
@@ -12,34 +12,34 @@
#ifndef VSOMEIP_INTERNAL_UDP_CLIENT_IMPL_HPP
#define VSOMEIP_INTERNAL_UDP_CLIENT_IMPL_HPP
+#include <memory>
+
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/udp.hpp>
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/client_impl.hpp>
+#include <vsomeip/defines.hpp>
+
+#include "client_endpoint_impl.hpp"
namespace vsomeip {
-typedef client_impl< boost::asio::ip::udp,
- VSOMEIP_MAX_UDP_MESSAGE_SIZE > udp_client_base_impl;
+class endpoint_adapter;
+
+typedef client_endpoint_impl<
+ boost::asio::ip::udp,
+ VSOMEIP_MAX_UDP_MESSAGE_SIZE > udp_client_endpoint_base_impl;
-class udp_client_impl
- : virtual public udp_client_base_impl {
+class udp_client_endpoint_impl
+ : virtual public udp_client_endpoint_base_impl {
public:
- udp_client_impl(
- managing_proxy_impl *_owner, const endpoint *_location);
- virtual ~udp_client_impl();
+ udp_client_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, endpoint_type _remote, boost::asio::io_service &_io);
+ virtual ~udp_client_endpoint_impl();
void start();
void send_queued();
- const endpoint * get_local_endpoint() const;
-
- ip_address get_remote_address() const;
- ip_port get_remote_port() const;
- ip_protocol get_protocol() const;
-
void join(const std::string &_multicast_address);
void leave(const std::string &_multicast_address);
diff --git a/vsomeip/include/vsomeip_internal/udp_service_impl.hpp b/implementation/endpoints/include/udp_server_endpoint_impl.hpp
index e6d0c22..fbf4fd1 100644
--- a/vsomeip/include/vsomeip_internal/udp_service_impl.hpp
+++ b/implementation/endpoints/include/udp_server_endpoint_impl.hpp
@@ -15,43 +15,46 @@
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/udp.hpp>
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/service_impl.hpp>
+#include <vsomeip/defines.hpp>
+#include "server_endpoint_impl.hpp"
namespace vsomeip {
-typedef service_impl< boost::asio::ip::udp,
- VSOMEIP_MAX_UDP_MESSAGE_SIZE > udp_service_base_impl;
+typedef server_endpoint_impl<
+ boost::asio::ip::udp,
+ VSOMEIP_MAX_UDP_MESSAGE_SIZE > udp_server_endpoint_base_impl;
-class udp_service_impl
- : public service_impl< boost::asio::ip::udp,
- VSOMEIP_MAX_UDP_MESSAGE_SIZE > {
+class udp_server_endpoint_impl
+ : public udp_server_endpoint_base_impl {
public:
- udp_service_impl(
- managing_proxy_impl *_owner, const endpoint *_location);
- virtual ~udp_service_impl();
+ udp_server_endpoint_impl(std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io);
+ virtual ~udp_server_endpoint_impl();
void start();
void stop();
void restart();
void receive();
- void send_queued();
-
- ip_address get_remote_address() const;
- ip_port get_remote_port() const;
- ip_protocol get_protocol() const;
const uint8_t * get_buffer() const;
+ void send_queued();
+ endpoint_type get_remote() const;
+
void join(const std::string &_multicast_address);
void leave(const std::string &_multicast_address);
+public:
+ void receive_cbk(boost::system::error_code const &_error, std::size_t _size);
+
private:
buffer_type buffer_;
socket_type socket_;
+
endpoint_type remote_;
+
+ std::vector< byte_t > message_;
};
} // namespace vsomeip
diff --git a/implementation/endpoints/src/client_endpoint_impl.cpp b/implementation/endpoints/src/client_endpoint_impl.cpp
new file mode 100644
index 0000000..73934cf
--- /dev/null
+++ b/implementation/endpoints/src/client_endpoint_impl.cpp
@@ -0,0 +1,214 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <chrono>
+#include <iomanip>
+
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/ip/udp.hpp>
+#include <boost/asio/local/stream_protocol.hpp>
+
+#include <vsomeip/defines.hpp>
+
+#include "../include/client_endpoint_impl.hpp"
+#include "../include/endpoint_host.hpp"
+#include "../../configuration/include/internal.hpp"
+#include "../../utility/include/utility.hpp"
+
+namespace vsomeip {
+
+template < typename Protocol, int MaxBufferSize >
+client_endpoint_impl< Protocol, MaxBufferSize >::client_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host,
+ endpoint_type _remote,
+ boost::asio::io_service &_io)
+ : endpoint_impl< MaxBufferSize >(_host, _io),
+ socket_(_io),
+ connect_timer_(_io),
+ flush_timer_(_io),
+ remote_(_remote),
+ connect_timeout_(VSOMEIP_DEFAULT_CONNECT_TIMEOUT), // TODO: use config variable
+ is_connected_(false) {
+}
+
+template < typename Protocol, int MaxBufferSize >
+client_endpoint_impl< Protocol, MaxBufferSize >::~client_endpoint_impl() {
+}
+
+template < typename Protocol, int MaxBufferSize >
+const uint8_t * client_endpoint_impl< Protocol, MaxBufferSize >::get_buffer() const {
+ return buffer_.data();
+}
+
+template < typename Protocol, int MaxBufferSize >
+bool client_endpoint_impl< Protocol, MaxBufferSize >::is_client() const {
+ return true;
+}
+
+template < typename Protocol, int MaxBufferSize >
+void client_endpoint_impl< Protocol, MaxBufferSize >::stop() {
+ if (socket_.is_open()) {
+ socket_.close();
+ }
+}
+
+template < typename Protocol, int MaxBufferSize >
+void client_endpoint_impl< Protocol, MaxBufferSize >::restart() {
+ receive();
+}
+
+template < typename Protocol, int MaxBufferSize >
+bool client_endpoint_impl< Protocol, MaxBufferSize >::send(
+ const uint8_t *_data, uint32_t _size, bool _flush) {
+ std::unique_lock< std::mutex > its_lock(mutex_);
+
+ bool is_queue_empty(packet_queue_.empty());
+
+ if (packetizer_.size() + _size > MaxBufferSize) {
+ packet_queue_.push_back(packetizer_);
+ packetizer_.clear();
+ if (is_queue_empty && is_connected_)
+ send_queued();
+ }
+
+ packetizer_.insert(packetizer_.end(), _data, _data + _size);
+
+ if (_flush) {
+ flush_timer_.cancel();
+ packet_queue_.push_back(packetizer_);
+ packetizer_.clear();
+ if (is_queue_empty && is_connected_)
+ send_queued();
+ } else {
+ flush_timer_.expires_from_now(
+ std::chrono::milliseconds(VSOMEIP_DEFAULT_FLUSH_TIMEOUT)); // TODO: use config variable
+ flush_timer_.async_wait(
+ std::bind(
+ &client_endpoint_impl<Protocol, MaxBufferSize>::flush_cbk,
+ this->shared_from_this(),
+ std::placeholders::_1
+ )
+ );
+ }
+
+ return true;
+}
+
+template < typename Protocol, int MaxBufferSize >
+bool client_endpoint_impl< Protocol, MaxBufferSize >::flush() {
+ bool is_successful(true);
+
+ if (!packetizer_.empty()) {
+ packet_queue_.push_back(packetizer_);
+ packetizer_.clear();
+ send_queued();
+ } else {
+ is_successful = false;
+ }
+
+ return is_successful;
+}
+
+template < typename Protocol, int MaxBufferSize >
+void client_endpoint_impl< Protocol, MaxBufferSize >::connect_cbk(
+ boost::system::error_code const &_error) {
+
+ if (_error) {
+ socket_.close();
+
+ connect_timer_.expires_from_now(
+ std::chrono::milliseconds(connect_timeout_));
+ connect_timer_.async_wait(
+ std::bind(
+ &client_endpoint_impl<Protocol, MaxBufferSize>::wait_connect_cbk,
+ this->shared_from_this(),
+ std::placeholders::_1
+ )
+ );
+
+ // next time we wait longer
+ connect_timeout_ <<= 1;
+ } else {
+ connect_timer_.cancel();
+ connect_timeout_ = VSOMEIP_DEFAULT_CONNECT_TIMEOUT; // TODO: use config variable
+ is_connected_ = true;
+ if (!packet_queue_.empty()) {
+ send_queued();
+ }
+ receive();
+ }
+}
+
+template < typename Protocol, int MaxBufferSize >
+void client_endpoint_impl< Protocol, MaxBufferSize >::wait_connect_cbk(
+ boost::system::error_code const &_error) {
+
+ if (!_error) {
+ connect();
+ }
+}
+
+template < typename Protocol, int MaxBufferSize >
+void client_endpoint_impl< Protocol, MaxBufferSize >::send_cbk(
+ boost::system::error_code const &_error, std::size_t _bytes) {
+
+ if (!_error && _bytes > 0) {
+ packet_queue_.pop_front();
+
+ if (!packet_queue_.empty()) {
+ send_queued();
+ }
+ } else {
+ if (_error == boost::asio::error::broken_pipe) {
+ is_connected_ = false;
+ socket_.close();
+ connect();
+ }
+ }
+}
+
+template < typename Protocol, int MaxBufferSize >
+void client_endpoint_impl< Protocol, MaxBufferSize >::flush_cbk(
+ boost::system::error_code const &_error) {
+ if (!_error) {
+ (void)flush();
+ }
+}
+
+template < typename Protocol, int MaxBufferSize >
+void client_endpoint_impl< Protocol, MaxBufferSize >::receive_cbk(
+ boost::system::error_code const &_error, std::size_t _bytes) {
+
+ static uint32_t message_counter = 0;
+
+ if (!_error && 0 < _bytes) {
+ const uint8_t *buffer = get_buffer();
+ message_.insert(message_.end(), buffer, buffer + _bytes);
+
+ bool has_full_message;
+ do {
+ uint32_t current_message_size = utility::get_message_size(message_);
+ has_full_message = (current_message_size > 0 && current_message_size <= message_.size());
+ if (has_full_message) {
+ this->host_->on_message(&message_[0], current_message_size, this);
+ message_.erase(message_.begin(), message_.begin() + current_message_size);
+ }
+ } while (has_full_message);
+
+ restart();
+ } else {
+ receive();
+ }
+}
+
+// Instantiate template
+template class client_endpoint_impl< boost::asio::local::stream_protocol, VSOMEIP_MAX_LOCAL_MESSAGE_SIZE >;
+template class client_endpoint_impl< boost::asio::ip::tcp, VSOMEIP_MAX_TCP_MESSAGE_SIZE >;
+template class client_endpoint_impl< boost::asio::ip::udp, VSOMEIP_MAX_UDP_MESSAGE_SIZE >;
+
+} // namespace vsomeip
+
diff --git a/implementation/endpoints/src/endpoint_impl.cpp b/implementation/endpoints/src/endpoint_impl.cpp
new file mode 100644
index 0000000..fe73013
--- /dev/null
+++ b/implementation/endpoints/src/endpoint_impl.cpp
@@ -0,0 +1,131 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <vsomeip/constants.hpp>
+#include <vsomeip/defines.hpp>
+
+#include "../include/endpoint_host.hpp"
+#include "../include/endpoint_impl.hpp"
+#include "../../message/include/byteorder.hpp"
+
+namespace vsomeip {
+
+template < int MaxBufferSize >
+endpoint_impl< MaxBufferSize >::endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, boost::asio::io_service &_io)
+ : host_(_host.get()),
+ service_(_io),
+ is_supporting_magic_cookies_(false),
+ has_enabled_magic_cookies_(false) {
+}
+
+template < int MaxBufferSize >
+endpoint_impl< MaxBufferSize >::~endpoint_impl() {
+}
+
+template < int MaxBufferSize >
+void endpoint_impl< MaxBufferSize >::open_filter(service_t _service) {
+ auto find_service = opened_.find(_service);
+ if (find_service != opened_.end()) {
+ find_service->second++;
+ } else {
+ opened_[_service] = 1;
+ }
+}
+
+template < int MaxBufferSize >
+void endpoint_impl< MaxBufferSize >::close_filter(service_t _service) {
+ auto find_service = opened_.find(_service);
+ if (find_service != opened_.end()) {
+ find_service->second--;
+ if (0 == find_service->second)
+ opened_.erase(_service);
+ }
+}
+
+template < int MaxBufferSize >
+void endpoint_impl< MaxBufferSize >::enable_magic_cookies() {
+ has_enabled_magic_cookies_ = (true && is_supporting_magic_cookies_);
+}
+
+template < int MaxBufferSize >
+void endpoint_impl< MaxBufferSize >::disable_magic_cookies() {
+ has_enabled_magic_cookies_ = (false && is_supporting_magic_cookies_);
+}
+
+template < int MaxBufferSize >
+bool endpoint_impl< MaxBufferSize >::is_magic_cookie() const {
+ return false;
+}
+
+/*
+template < int MaxBufferSize >
+bool endpoint_impl< MaxBufferSize >::resync_on_magic_cookie() {
+ bool is_resynced = false;
+ if (has_enabled_magic_cookies_) {
+ uint32_t offset = 0xFFFFFFFF;
+ uint8_t cookie_identifier = (
+ is_client() ?
+ VSOMEIP_MAGIC_COOKIE_CLIENT_MESSAGE_ID :
+ VSOMEIP_MAGIC_COOKIE_SERVICE_MESSAGE_ID
+ );
+ uint8_t cookie_type = static_cast<uint8_t>(
+ is_client() ?
+ VSOMEIP_MAGIC_COOKIE_CLIENT_MESSAGE_TYPE :
+ VSOMEIP_MAGIC_COOKIE_SERVICE_MESSAGE_TYPE
+ );
+
+ do {
+ offset++;
+
+ if (message_.size() > offset + 16) {
+ is_resynced = (
+ message_[offset] == 0xFF &&
+ message_[offset+1] == 0xFF &&
+ message_[offset+2] == cookie_identifier &&
+ message_[offset+3] == 0x00 &&
+ message_[offset+4] == 0x00 &&
+ message_[offset+5] == 0x00 &&
+ message_[offset+6] == 0x00 &&
+ message_[offset+7] == 0x08 &&
+ message_[offset+8] == 0xDE &&
+ message_[offset+9] == 0xAD &&
+ message_[offset+10] == 0xBE &&
+ message_[offset+11] == 0xEF &&
+ message_[offset+12] == 0x01 &&
+ message_[offset+13] == 0x01 &&
+ message_[offset+14] == cookie_type &&
+ message_[offset+15] == 0x00
+ );
+ };
+
+ } while (!is_resynced);
+
+ if (is_resynced) {
+ message_.erase(message_.begin(),
+ message_.begin() + offset +
+ VSOMEIP_SOMEIP_HEADER_SIZE +
+ VSOMEIP_SOMEIP_MAGIC_COOKIE_SIZE);
+ } else {
+ message_.clear();
+ }
+
+ } else {
+ message_.clear();
+ }
+
+ return is_resynced;
+}
+*/
+
+// Instantiate template
+template class endpoint_impl< VSOMEIP_MAX_LOCAL_MESSAGE_SIZE >;
+template class endpoint_impl< VSOMEIP_MAX_TCP_MESSAGE_SIZE >;
+template class endpoint_impl< VSOMEIP_MAX_UDP_MESSAGE_SIZE >;
+
+} // namespace vsomeip
+
+
diff --git a/implementation/endpoints/src/local_client_endpoint_impl.cpp b/implementation/endpoints/src/local_client_endpoint_impl.cpp
new file mode 100644
index 0000000..64764c8
--- /dev/null
+++ b/implementation/endpoints/src/local_client_endpoint_impl.cpp
@@ -0,0 +1,124 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <iomanip>
+
+#include <boost/asio/write.hpp>
+
+#include <vsomeip/defines.hpp>
+
+#include "../include/endpoint_host.hpp"
+#include "../include/local_client_endpoint_impl.hpp"
+
+namespace vsomeip {
+
+local_client_endpoint_impl::local_client_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, endpoint_type _remote, boost::asio::io_service &_io)
+ : local_client_endpoint_base_impl(_host, _remote, _io) {
+ is_supporting_magic_cookies_ = false;
+}
+
+void local_client_endpoint_impl::start() {
+ connect();
+}
+
+void local_client_endpoint_impl::connect() {
+ socket_.open(remote_.protocol());
+
+ socket_.async_connect(
+ remote_,
+ std::bind(
+ &local_client_endpoint_base_impl::connect_cbk,
+ shared_from_this(),
+ std::placeholders::_1
+ )
+ );
+}
+
+void local_client_endpoint_impl::receive() {
+ socket_.async_receive(
+ boost::asio::buffer(buffer_),
+ std::bind(
+ &local_client_endpoint_impl::receive_cbk,
+ std::dynamic_pointer_cast< local_client_endpoint_impl >(shared_from_this()),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void local_client_endpoint_impl::send_queued() {
+ static byte_t its_start_tag[] = { 0x67, 0x37, 0x6D, 0x07 };
+ static byte_t its_end_tag[] = { 0x07, 0x6D, 0x37, 0x67 };
+
+ boost::asio::async_write(
+ socket_,
+ boost::asio::buffer(
+ its_start_tag,
+ sizeof(its_start_tag)
+ ),
+ std::bind(
+ &local_client_endpoint_impl::send_tag_cbk,
+ std::dynamic_pointer_cast< local_client_endpoint_impl >(shared_from_this()),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+
+#if 0
+ std::cout << "lce(s): ";
+ for (std::size_t i = 0; i < packet_queue_.front().size(); i++)
+ std::cout << std::setw(2) << std::setfill('0') << std::hex << (int)packet_queue_.front()[i] << " ";
+ std::cout << std::endl;
+#endif
+
+ boost::asio::async_write(
+ socket_,
+ boost::asio::buffer(
+ &packet_queue_.front()[0],
+ packet_queue_.front().size()
+ ),
+ std::bind(
+ &client_endpoint_impl::send_cbk,
+ this->shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+
+ boost::asio::async_write(
+ socket_,
+ boost::asio::buffer(
+ its_end_tag,
+ sizeof(its_end_tag)
+ ),
+ std::bind(
+ &local_client_endpoint_impl::send_tag_cbk,
+ std::dynamic_pointer_cast< local_client_endpoint_impl >(shared_from_this()),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void local_client_endpoint_impl::send_magic_cookie() {
+}
+
+void local_client_endpoint_impl::join(const std::string &) {
+}
+
+void local_client_endpoint_impl::leave(const std::string &) {
+}
+
+void local_client_endpoint_impl::send_tag_cbk(
+ boost::system::error_code const &_error, std::size_t _bytes) {
+}
+
+void local_client_endpoint_impl::receive_cbk(
+ boost::system::error_code const &_error, std::size_t _bytes) {
+}
+
+} // namespace vsomeip
diff --git a/implementation/endpoints/src/local_server_endpoint_impl.cpp b/implementation/endpoints/src/local_server_endpoint_impl.cpp
new file mode 100644
index 0000000..e0f25bc
--- /dev/null
+++ b/implementation/endpoints/src/local_server_endpoint_impl.cpp
@@ -0,0 +1,207 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <deque>
+#include <iomanip>
+#include <iostream>
+
+#include <boost/asio/write.hpp>
+
+#include "../include/endpoint_host.hpp"
+#include "../include/local_server_endpoint_impl.hpp"
+
+namespace vsomeip {
+
+local_server_endpoint_impl::local_server_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io)
+ : local_server_endpoint_base_impl(_host, _local, _io),
+ acceptor_(_io, _local) {
+ is_supporting_magic_cookies_ = false;
+}
+
+local_server_endpoint_impl::~local_server_endpoint_impl() {
+}
+
+void local_server_endpoint_impl::start() {
+ connection::ptr new_connection = connection::create(this);
+
+ acceptor_.async_accept(
+ new_connection->get_socket(),
+ std::bind(
+ &local_server_endpoint_impl::accept_cbk,
+ std::dynamic_pointer_cast< local_server_endpoint_impl >(shared_from_this()),
+ new_connection,
+ std::placeholders::_1
+ )
+ );
+}
+
+void local_server_endpoint_impl::stop() {
+
+}
+
+void local_server_endpoint_impl::send_queued() {
+ auto connection_iterator = connections_.find(current_queue_->first);
+ if (connection_iterator != connections_.end())
+ connection_iterator->second->send_queued();
+}
+
+void local_server_endpoint_impl::receive() {
+ // intentionally left empty
+}
+
+void local_server_endpoint_impl::restart() {
+ current_->start();
+}
+
+const uint8_t * local_server_endpoint_impl::get_buffer() const {
+ return current_->get_buffer();
+}
+
+local_server_endpoint_impl::endpoint_type local_server_endpoint_impl::get_remote() const {
+ return current_->get_socket().remote_endpoint();
+}
+
+void local_server_endpoint_impl::remove_connection(local_server_endpoint_impl::connection *_connection) {
+ std::map< endpoint_type, connection::ptr >::iterator i = connections_.end();
+ for (i = connections_.begin(); i != connections_.end(); i++) {
+ if (i->second.get() == _connection)
+ break;
+ }
+
+ if (i != connections_.end()) {
+ connections_.erase(i);
+ }
+}
+
+void local_server_endpoint_impl::join(const std::string &) {
+}
+
+void local_server_endpoint_impl::leave(const std::string &) {
+}
+
+void local_server_endpoint_impl::accept_cbk(
+ connection::ptr _connection, boost::system::error_code const &_error) {
+
+ if (!_error) {
+ socket_type &new_connection_socket = _connection->get_socket();
+ endpoint_type remote = new_connection_socket.remote_endpoint();
+
+ connections_[remote] = _connection;
+ _connection->start();
+ }
+
+ start();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class tcp_service_impl::connection
+///////////////////////////////////////////////////////////////////////////////
+local_server_endpoint_impl::connection::connection(local_server_endpoint_impl *_server)
+ : socket_(_server->service_), server_(_server) {
+}
+
+local_server_endpoint_impl::connection::ptr
+local_server_endpoint_impl::connection::create(local_server_endpoint_impl *_server) {
+ return ptr(new connection(_server));
+}
+
+local_server_endpoint_impl::socket_type & local_server_endpoint_impl::connection::get_socket() {
+ return socket_;
+}
+
+const uint8_t * local_server_endpoint_impl::connection::get_buffer() const {
+ return buffer_.data();
+}
+
+void local_server_endpoint_impl::connection::start() {
+ socket_.async_receive(
+ boost::asio::buffer(buffer_),
+ std::bind(
+ &local_server_endpoint_impl::connection::receive_cbk,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void local_server_endpoint_impl::connection::send_queued() {
+ std::deque<std::vector<uint8_t>> &current_queue
+ = server_->current_queue_->second;
+
+ boost::asio::async_write(
+ socket_,
+ boost::asio::buffer(
+ &current_queue.front()[0],
+ current_queue.front().size()
+ ),
+ std::bind(
+ &local_server_endpoint_base_impl::send_cbk,
+ server_->shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void local_server_endpoint_impl::connection::send_magic_cookie() {
+}
+
+void local_server_endpoint_impl::connection::receive_cbk(
+ boost::system::error_code const &_error, std::size_t _bytes) {
+
+ static std::size_t its_start = -1;
+ std::size_t its_end;
+
+ if (!_error && 0 < _bytes) {
+ const uint8_t *buffer = get_buffer();
+ message_.insert(message_.end(), buffer, buffer + _bytes);
+
+#if 0
+ std::cout << "lse(r): ";
+ for (std::size_t i = 0; i < _bytes; i++)
+ std::cout << std::setw(2) << std::setfill('0') << std::hex << (int)get_buffer()[i] << " ";
+ std::cout << std::endl;
+#endif
+
+ do {
+ if (its_start == -1) {
+ its_start = 0;
+ while (its_start + 3 < message_.size() &&
+ (message_[its_start] != 0x67 || message_[its_start+1] != 0x37 ||
+ message_[its_start+2] != 0x6d || message_[its_start+3] != 0x07)) {
+ its_start ++;
+ }
+
+ its_start = (its_start + 3 == message_.size() ? -1 : its_start+4);
+ }
+
+ if (its_start != -1) {
+ its_end = its_start;
+ while (its_end + 3 < message_.size() &&
+ (message_[its_end] != 0x07 || message_[its_end+1] != 0x6d ||
+ message_[its_end+2] != 0x37 || message_[its_end+3] != 0x67)) {
+ its_end ++;
+ }
+ }
+
+ if (its_start != -1 && its_end+3 < message_.size()) {
+ server_->host_->on_message(&message_[its_start], its_end - its_start, server_);
+ message_.erase(message_.begin(), message_.begin() + its_end + 4);
+ its_start = -1;
+ }
+ } while (message_.size() > 0 && its_start == -1);
+ }
+
+ if (_error == boost::asio::error::misc_errors::eof) {
+ server_->remove_connection(this);
+ } else {
+ start();
+ }
+}
+
+} // namespace vsomeip
diff --git a/implementation/endpoints/src/server_endpoint_impl.cpp b/implementation/endpoints/src/server_endpoint_impl.cpp
new file mode 100644
index 0000000..c26180b
--- /dev/null
+++ b/implementation/endpoints/src/server_endpoint_impl.cpp
@@ -0,0 +1,173 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/ip/udp.hpp>
+#include <boost/asio/local/stream_protocol.hpp>
+
+#include <vsomeip/defines.hpp>
+
+#include "../include/server_endpoint_impl.hpp"
+#include "../../configuration/include/internal.hpp"
+
+namespace vsomeip {
+
+template < typename Protocol, int MaxBufferSize >
+server_endpoint_impl< Protocol, MaxBufferSize >::server_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io)
+ : endpoint_impl< MaxBufferSize >(_host, _io),
+ current_queue_(packet_queues_.end()),
+ flush_timer_(_io) {
+}
+
+template < typename Protocol, int MaxBufferSize >
+bool server_endpoint_impl< Protocol, MaxBufferSize >::is_client() const {
+ return false;
+}
+
+template < typename Protocol, int MaxBufferSize >
+bool server_endpoint_impl< Protocol, MaxBufferSize >::send(
+ const uint8_t *_data, uint32_t _size, bool _flush) {
+
+ bool is_sent(false);
+ if (VSOMEIP_CLIENT_POS_MAX < _size) {
+ std::unique_lock< std::mutex > its_lock(mutex_);
+
+ client_t its_client;
+ std::memcpy(&its_client, &_data[VSOMEIP_CLIENT_POS_MIN], sizeof(client_t));
+
+ auto found_target = clients_.find(its_client);
+ if (found_target != clients_.end()) {
+ bool is_queue_empty(packet_queues_.empty());
+
+ endpoint_type its_target = found_target->second;
+
+ // find queue and packetizer (buffer)
+ std::deque< std::vector< uint8_t > >& target_packet_queue
+ = packet_queues_[its_target];
+ std::vector< uint8_t >& target_packetizer
+ = packetizer_[its_target];
+
+ // if the current_queue is not yet set, set it to newly created one
+ if (current_queue_ == packet_queues_.end())
+ current_queue_ = packet_queues_.find(its_target);
+
+ if (target_packetizer.size() + _size > MaxBufferSize) {
+ target_packet_queue.push_back(target_packetizer);
+ target_packetizer.clear();
+
+ if (is_queue_empty)
+ send_queued();
+ }
+
+ target_packetizer.insert(target_packetizer.end(), _data, _data + _size);
+
+ if (_flush) {
+ flush_timer_.cancel();
+
+ target_packet_queue.push_back(target_packetizer);
+ target_packetizer.clear();
+
+ if (is_queue_empty)
+ send_queued();
+ } else {
+ std::chrono::milliseconds flush_timeout(VSOMEIP_DEFAULT_FLUSH_TIMEOUT);
+ flush_timer_.expires_from_now(flush_timeout); // TODO: use configured value
+ flush_timer_.async_wait(
+ std::bind(
+ &server_endpoint_impl<Protocol, MaxBufferSize>::flush_cbk,
+ this->shared_from_this(),
+ its_target,
+ std::placeholders::_1
+ )
+ );
+ }
+ is_sent = true;
+ }
+ }
+
+ return is_sent;
+}
+
+template < typename Protocol, int MaxBufferSize >
+bool server_endpoint_impl< Protocol, MaxBufferSize >::flush() {
+ bool is_flushed = false;
+#if 0
+ auto i = packetizer_.find(_target);
+ if (i != packetizer_.end() && !i->second.empty()) {
+ std::deque< std::vector< uint8_t > >& target_packet_queue
+ = packet_queues_[i->first];
+ target_packet_queue.push_back(i->second);
+ i->second.clear();
+
+ flushed = true;
+ }
+
+ if (is_successful)
+ send_queued();
+#endif
+ return is_flushed;
+}
+
+template < typename Protocol, int MaxBufferSize >
+bool server_endpoint_impl< Protocol, MaxBufferSize >::set_next_queue() {
+ if (current_queue_->second.empty())
+ current_queue_ = packet_queues_.erase(current_queue_);
+
+ if (packet_queues_.empty())
+ return false;
+
+ if (current_queue_ == packet_queues_.end())
+ current_queue_ = packet_queues_.begin();
+
+ if (!current_queue_->second.empty())
+ return true;
+
+ auto saved_current_queue = current_queue_;
+ do {
+ current_queue_++;
+ if (current_queue_ == packet_queues_.end())
+ current_queue_ = packet_queues_.begin();
+ } while (current_queue_->second.empty() &&
+ current_queue_ != saved_current_queue);
+
+ return !current_queue_->second.empty();
+}
+
+template < typename Protocol, int MaxBufferSize >
+void server_endpoint_impl< Protocol, MaxBufferSize >::connect_cbk(
+ boost::system::error_code const &_error) {
+}
+
+template < typename Protocol, int MaxBufferSize >
+void server_endpoint_impl< Protocol, MaxBufferSize >::send_cbk(
+ boost::system::error_code const &_error, std::size_t _bytes) {
+
+ if (!_error) {
+ current_queue_->second.pop_front();
+ bool is_message_available(set_next_queue());
+ if (is_message_available) {
+ send_queued();
+ }
+ }
+}
+
+template < typename Protocol, int MaxBufferSize >
+void server_endpoint_impl< Protocol, MaxBufferSize >::flush_cbk(
+ endpoint_type _target, const boost::system::error_code &_error_code) {
+ if (!_error_code) {
+ //(void)flush(_target);
+ }
+}
+
+// Instantiate template
+template class server_endpoint_impl< boost::asio::local::stream_protocol, VSOMEIP_MAX_LOCAL_MESSAGE_SIZE >;
+template class server_endpoint_impl< boost::asio::ip::tcp, VSOMEIP_MAX_TCP_MESSAGE_SIZE >;
+template class server_endpoint_impl< boost::asio::ip::udp, VSOMEIP_MAX_UDP_MESSAGE_SIZE >;
+
+} // namespace vsomeip
+
diff --git a/implementation/endpoints/src/tcp_client_endpoint_impl.cpp b/implementation/endpoints/src/tcp_client_endpoint_impl.cpp
new file mode 100644
index 0000000..b7b5fc6
--- /dev/null
+++ b/implementation/endpoints/src/tcp_client_endpoint_impl.cpp
@@ -0,0 +1,112 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <boost/asio/write.hpp>
+
+#include <vsomeip/defines.hpp>
+
+#include "../include/tcp_client_endpoint_impl.hpp"
+
+namespace ip = boost::asio::ip;
+
+namespace vsomeip {
+
+tcp_client_endpoint_impl::tcp_client_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, endpoint_type _remote, boost::asio::io_service &_io)
+ : tcp_client_endpoint_base_impl(_host, _remote, _io) {
+ is_supporting_magic_cookies_ = true;
+}
+
+tcp_client_endpoint_impl::~tcp_client_endpoint_impl() {
+}
+
+//const endpoint * tcp_client_impl::get_local_endpoint() const {
+// return vsomeip::factory::get_instance()->get_endpoint(
+// socket_.local_endpoint().address().to_string(),
+// socket_.local_endpoint().port(),
+// ip_protocol::TCP
+// );
+//}
+
+void tcp_client_endpoint_impl::start() {
+ connect();
+}
+
+void tcp_client_endpoint_impl::connect() {
+ socket_.open(remote_.protocol());
+
+ // Nagle algorithm off
+ ip::tcp::no_delay option;
+ socket_.set_option(option);
+
+ socket_.async_connect(
+ remote_,
+ std::bind(
+ &tcp_client_endpoint_base_impl::connect_cbk,
+ shared_from_this(),
+ std::placeholders::_1
+ )
+ );
+}
+
+void tcp_client_endpoint_impl::receive() {
+ socket_.async_receive(
+ boost::asio::buffer(buffer_),
+ std::bind(
+ &tcp_client_endpoint_base_impl::receive_cbk,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void tcp_client_endpoint_impl::send_queued() {
+ if (has_enabled_magic_cookies_)
+ send_magic_cookie();
+
+ boost::asio::async_write(
+ socket_,
+ boost::asio::buffer(
+ &packet_queue_.front()[0],
+ packet_queue_.front().size()
+ ),
+ std::bind(
+ &tcp_client_endpoint_base_impl::send_cbk,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void tcp_client_endpoint_impl::send_magic_cookie() {
+ static uint8_t data[] = { 0xFF, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0xDE, 0xAD, 0xBE, 0xEF,
+ 0x01, 0x01, 0x01, 0x00 };
+
+ std::vector<uint8_t>& current_packet = packet_queue_.front();
+
+ if (VSOMEIP_MAX_TCP_MESSAGE_SIZE - current_packet.size() >=
+ VSOMEIP_SOMEIP_HEADER_SIZE + VSOMEIP_SOMEIP_MAGIC_COOKIE_SIZE) {
+ current_packet.insert(
+ current_packet.begin(),
+ data,
+ data + sizeof(data)
+ );
+ } else {
+ //VSOMEIP_WARNING << "Packet full. Cannot insert magic cookie!";
+ }
+}
+
+void tcp_client_endpoint_impl::join(const std::string &) {
+}
+
+void tcp_client_endpoint_impl::leave(const std::string &) {
+}
+
+} // namespace vsomeip
diff --git a/implementation/endpoints/src/tcp_server_endpoint_impl.cpp b/implementation/endpoints/src/tcp_server_endpoint_impl.cpp
new file mode 100644
index 0000000..b8b758b
--- /dev/null
+++ b/implementation/endpoints/src/tcp_server_endpoint_impl.cpp
@@ -0,0 +1,197 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <deque>
+
+#include <boost/asio/write.hpp>
+
+#include "../include/endpoint_host.hpp"
+#include "../include/tcp_server_endpoint_impl.hpp"
+#include "../../utility/include/utility.hpp"
+
+namespace ip = boost::asio::ip;
+
+namespace vsomeip {
+
+tcp_server_endpoint_impl::tcp_server_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io)
+ : tcp_server_endpoint_base_impl(_host, _local, _io),
+ acceptor_(_io, _local) {
+ is_supporting_magic_cookies_ = true;
+}
+
+tcp_server_endpoint_impl::~tcp_server_endpoint_impl() {
+}
+
+void tcp_server_endpoint_impl::start() {
+ connection::ptr new_connection = connection::create(this);
+
+ acceptor_.async_accept(
+ new_connection->get_socket(),
+ std::bind(
+ &tcp_server_endpoint_impl::accept_cbk,
+ std::dynamic_pointer_cast< tcp_server_endpoint_impl >(shared_from_this()),
+ new_connection,
+ std::placeholders::_1
+ )
+ );
+}
+
+void tcp_server_endpoint_impl::stop() {
+ for (auto& i : connections_)
+ i.second->stop();
+ acceptor_.close();
+}
+
+void tcp_server_endpoint_impl::receive() {
+ // intentionally left empty
+}
+
+void tcp_server_endpoint_impl::restart() {
+ current_->start();
+}
+
+const uint8_t * tcp_server_endpoint_impl::get_buffer() const {
+ return current_->get_buffer();
+}
+
+void tcp_server_endpoint_impl::send_queued() {
+ auto connection_iterator = connections_.find(current_queue_->first);
+ if (connection_iterator != connections_.end())
+ connection_iterator->second->send_queued();
+}
+
+tcp_server_endpoint_impl::endpoint_type tcp_server_endpoint_impl::get_remote() const {
+ return current_->get_socket().remote_endpoint();
+}
+
+void tcp_server_endpoint_impl::accept_cbk(
+ connection::ptr _connection, boost::system::error_code const &_error) {
+
+ if (!_error) {
+ socket_type &new_connection_socket = _connection->get_socket();
+ endpoint_type remote = new_connection_socket.remote_endpoint();
+
+ connections_[remote] = _connection;
+ _connection->start();
+ }
+
+ start();
+}
+
+void tcp_server_endpoint_impl::join(const std::string &) {
+}
+
+void tcp_server_endpoint_impl::leave(const std::string &) {
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// class tcp_service_impl::connection
+///////////////////////////////////////////////////////////////////////////////
+tcp_server_endpoint_impl::connection::connection(tcp_server_endpoint_impl *_server)
+ : socket_(_server->service_), server_(_server) {
+}
+
+tcp_server_endpoint_impl::connection::ptr
+tcp_server_endpoint_impl::connection::create(tcp_server_endpoint_impl *_server) {
+ return ptr(new connection(_server));
+}
+
+tcp_server_endpoint_impl::socket_type & tcp_server_endpoint_impl::connection::get_socket() {
+ return socket_;
+}
+
+const uint8_t * tcp_server_endpoint_impl::connection::get_buffer() const {
+ return buffer_.data();
+}
+
+void tcp_server_endpoint_impl::connection::start() {
+ socket_.async_receive(
+ boost::asio::buffer(buffer_),
+ std::bind(
+ &tcp_server_endpoint_impl::connection::receive_cbk,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void tcp_server_endpoint_impl::connection::stop() {
+ socket_.close();
+}
+
+void tcp_server_endpoint_impl::connection::send_queued() {
+ if (server_->has_enabled_magic_cookies_)
+ send_magic_cookie();
+
+ std::deque<std::vector<uint8_t>> &current_queue
+ = server_->current_queue_->second;
+
+ boost::asio::async_write(
+ socket_,
+ boost::asio::buffer(
+ &current_queue.front()[0],
+ current_queue.front().size()
+ ),
+ std::bind(
+ &tcp_server_endpoint_base_impl::send_cbk,
+ server_->shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void tcp_server_endpoint_impl::connection::send_magic_cookie() {
+ static uint8_t data[] = { 0xFF, 0xFF, 0x80, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0xDE, 0xAD, 0xBE, 0xEF,
+ 0x01, 0x01, 0x02, 0x00 };
+
+ std::vector<uint8_t>& current_packet
+ = server_->current_queue_->second.front();
+
+ if (VSOMEIP_MAX_TCP_MESSAGE_SIZE - current_packet.size() >=
+ VSOMEIP_SOMEIP_HEADER_SIZE + VSOMEIP_SOMEIP_MAGIC_COOKIE_SIZE) {
+ current_packet.insert(
+ current_packet.begin(),
+ data,
+ data + sizeof(data)
+ );
+ }
+}
+
+void tcp_server_endpoint_impl::connection::receive_cbk(
+ boost::system::error_code const &_error, std::size_t _bytes) {
+ if (!_error && 0 < _bytes) {
+ const uint8_t *buffer = get_buffer();
+ message_.insert(message_.end(), buffer, buffer + _bytes);
+
+ bool has_full_message;
+ do {
+ uint32_t current_message_size = utility::get_message_size(message_);
+ has_full_message = (current_message_size > 0 && current_message_size <= message_.size());
+ if (has_full_message) {
+ if (utility::is_request(message_[VSOMEIP_MESSAGE_TYPE_POS])) {
+ client_t its_client;
+ std::memcpy(&its_client, &message_[VSOMEIP_CLIENT_POS_MIN], sizeof(client_t));
+ server_->clients_[its_client] = socket_.remote_endpoint();
+ }
+
+ server_->host_->on_message(&message_[0], current_message_size, server_);
+ message_.erase(message_.begin(), message_.begin() + current_message_size);
+ }
+ } while (has_full_message);
+
+ server_->restart();
+ } else {
+ server_->receive();
+ }
+}
+
+} // namespace vsomeip
diff --git a/implementation/endpoints/src/udp_client_endpoint_impl.cpp b/implementation/endpoints/src/udp_client_endpoint_impl.cpp
new file mode 100644
index 0000000..4f3bc64
--- /dev/null
+++ b/implementation/endpoints/src/udp_client_endpoint_impl.cpp
@@ -0,0 +1,105 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <boost/asio/ip/multicast.hpp>
+
+#include "../include/udp_client_endpoint_impl.hpp"
+
+namespace vsomeip {
+
+udp_client_endpoint_impl::udp_client_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, endpoint_type _remote, boost::asio::io_service &_io)
+ : udp_client_endpoint_base_impl(_host, _remote, _io) {
+}
+
+udp_client_endpoint_impl::~udp_client_endpoint_impl() {
+}
+
+//const endpoint * udp_client_endpoint_impl::get_local_endpoint() const {
+// return vsomeip::factory::get_instance()->get_endpoint(
+// socket_.local_endpoint().address().to_string(),
+// socket_.local_endpoint().port(),
+// ip_protocol::UDP
+// );
+//}
+
+void udp_client_endpoint_impl::connect() {
+ socket_.async_connect(
+ remote_,
+ std::bind(
+ &udp_client_endpoint_base_impl::connect_cbk,
+ shared_from_this(),
+ std::placeholders::_1
+ )
+ );
+}
+
+void udp_client_endpoint_impl::start() {
+ socket_.open(remote_.protocol());
+ connect();
+ receive();
+}
+
+void udp_client_endpoint_impl::send_queued() {
+ socket_.async_send(
+ boost::asio::buffer(
+ &packet_queue_.front()[0],
+ packet_queue_.front().size()
+ ),
+ std::bind(
+ &udp_client_endpoint_base_impl::send_cbk,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void udp_client_endpoint_impl::receive() {
+ socket_.async_receive_from(
+ boost::asio::buffer(buffer_),
+ remote_,
+ std::bind(
+ &udp_client_endpoint_base_impl::receive_cbk,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void udp_client_endpoint_impl::join(const std::string &_multicast_address) {
+ if (remote_.address().is_v4()) {
+ try {
+ socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));
+ socket_.set_option(boost::asio::ip::multicast::join_group(
+ boost::asio::ip::address::from_string(_multicast_address)));
+ }
+ catch (...) {
+
+ }
+ } else {
+ // TODO: support multicast for IPv6
+ }
+}
+
+void udp_client_endpoint_impl::leave(const std::string &_multicast_address) {
+ if (remote_.address().is_v4()) {
+ try {
+ socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));
+ socket_.set_option(boost::asio::ip::multicast::leave_group(
+ boost::asio::ip::address::from_string(_multicast_address)));
+ }
+ catch (...) {
+
+ }
+ } else {
+ // TODO: support multicast for IPv6
+ }
+}
+
+} // namespace vsomeip
+
diff --git a/implementation/endpoints/src/udp_server_endpoint_impl.cpp b/implementation/endpoints/src/udp_server_endpoint_impl.cpp
new file mode 100644
index 0000000..71efb86
--- /dev/null
+++ b/implementation/endpoints/src/udp_server_endpoint_impl.cpp
@@ -0,0 +1,137 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <boost/asio/ip/address.hpp>
+#include <boost/asio/ip/multicast.hpp>
+
+#include "../include/endpoint_host.hpp"
+#include "../include/udp_server_endpoint_impl.hpp"
+#include "../../message/include/byteorder.hpp"
+#include "../../utility/include/utility.hpp"
+
+namespace ip = boost::asio::ip;
+
+namespace vsomeip {
+
+udp_server_endpoint_impl::udp_server_endpoint_impl(
+ std::shared_ptr< endpoint_host > _host, endpoint_type _local, boost::asio::io_service &_io)
+ : server_endpoint_impl< ip::udp, VSOMEIP_MAX_UDP_MESSAGE_SIZE >(_host, _local, _io),
+ socket_(_io, _local) {
+
+ boost::asio::socket_base::broadcast option(true);
+ socket_.set_option(option);
+}
+
+udp_server_endpoint_impl::~udp_server_endpoint_impl() {
+}
+
+void udp_server_endpoint_impl::start() {
+ receive();
+}
+
+void udp_server_endpoint_impl::stop() {
+}
+
+void udp_server_endpoint_impl::receive() {
+ socket_.async_receive_from(
+ boost::asio::buffer(buffer_),
+ remote_,
+ std::bind(
+ &udp_server_endpoint_impl::receive_cbk,
+ std::dynamic_pointer_cast< udp_server_endpoint_impl >(shared_from_this()),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+void udp_server_endpoint_impl::restart() {
+ receive();
+}
+
+const uint8_t * udp_server_endpoint_impl::get_buffer() const {
+ return buffer_.data();
+}
+
+void udp_server_endpoint_impl::send_queued() {
+ socket_.async_send_to(
+ boost::asio::buffer(
+ &current_queue_->second.front()[0],
+ current_queue_->second.front().size()
+ ),
+ current_queue_->first,
+ std::bind(
+ &udp_server_endpoint_base_impl::send_cbk,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2
+ )
+ );
+}
+
+udp_server_endpoint_impl::endpoint_type udp_server_endpoint_impl::get_remote() const {
+ return remote_;
+}
+
+void udp_server_endpoint_impl::join(const std::string &_multicast_address) {
+ if (local_.address().is_v4()) {
+ try {
+ socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));
+ socket_.set_option(boost::asio::ip::multicast::join_group(
+ boost::asio::ip::address::from_string(_multicast_address)));
+ }
+ catch (...) {
+
+ }
+ } else {
+ // TODO: support multicast for IPv6
+ }
+}
+
+void udp_server_endpoint_impl::leave(const std::string &_multicast_address) {
+ if (local_.address().is_v4()) {
+ try {
+ socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));
+ socket_.set_option(boost::asio::ip::multicast::leave_group(
+ boost::asio::ip::address::from_string(_multicast_address)));
+ }
+ catch (...) {
+
+ }
+ } else {
+ // TODO: support multicast for IPv6
+ }
+}
+
+// TODO: find a better way to structure the receive functions
+void udp_server_endpoint_impl::receive_cbk(boost::system::error_code const &_error, std::size_t _bytes) {
+ if (!_error && 0 < _bytes) {
+ const uint8_t *buffer = get_buffer();
+ message_.insert(message_.end(), buffer, buffer + _bytes);
+
+ bool has_full_message;
+ do {
+ uint32_t current_message_size = utility::get_message_size(message_);
+ has_full_message = (current_message_size > 0 && current_message_size <= message_.size());
+ if (has_full_message) {
+ if (utility::is_request(message_[VSOMEIP_MESSAGE_TYPE_POS])) {
+ client_t its_client;
+ std::memcpy(&its_client, &message_[VSOMEIP_CLIENT_POS_MIN], sizeof(client_t));
+ clients_[its_client] = remote_;
+ }
+
+ this->host_->on_message(&message_[0], current_message_size, this);
+ message_.erase(message_.begin(), message_.begin() + current_message_size);
+ }
+ } while (has_full_message);
+
+ restart();
+ } else {
+ receive();
+ }
+}
+
+} // namespace vsomeip
diff --git a/implementation/examples/client-sample.cpp b/implementation/examples/client-sample.cpp
new file mode 100644
index 0000000..6af9f68
--- /dev/null
+++ b/implementation/examples/client-sample.cpp
@@ -0,0 +1,122 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <chrono>
+#include <iomanip>
+#include <iostream>
+#include <thread>
+
+#include <vsomeip/vsomeip.hpp>
+
+#define SAMPLE_CYCLE 100
+
+#define SAMPLE_SERVICE_ID 0x1234
+#define SAMPLE_INSTANCE_ID 0x5678
+#define SAMPLE_METHOD_ID 0x0421
+
+class client_sample {
+public:
+ client_sample(const std::string &_name)
+ : app_(vsomeip::runtime::get()->create_application(_name)),
+ name_(_name), request_(vsomeip::runtime::get()->create_request()) {
+ }
+
+ void init(int argc, char **argv) {
+ app_->init(argc, argv);
+ app_->register_availability_handler(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID,
+ std::bind(&client_sample::on_availability,
+ this,
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
+ app_->request_service(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID);
+ app_->register_message_handler(
+ vsomeip::VSOMEIP_ANY_SERVICE, SAMPLE_INSTANCE_ID, vsomeip::VSOMEIP_ANY_METHOD,
+ std::bind(&client_sample::on_message,
+ this,
+ std::placeholders::_1));
+
+ request_->set_service(SAMPLE_SERVICE_ID);
+ request_->set_instance(SAMPLE_INSTANCE_ID);
+ request_->set_method(SAMPLE_METHOD_ID);
+
+ vsomeip::payload &its_payload = request_->get_payload();
+ std::vector< vsomeip::byte_t > its_sample_payload;
+ for (std::size_t i = 0; i < 10; ++i) its_sample_payload.push_back(i % 256);
+ its_payload.set_data(its_sample_payload);
+ }
+
+ void start() {
+ app_->start();
+ }
+
+ void on_availability(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available) {
+ VSOMEIP_INFO << "Service ["
+ << std::setw(4) << std::setfill('0') << std::hex << _service << "." << _instance
+ << "] is "
+ << (_is_available ? "available." : "NOT available.");
+
+ if (SAMPLE_SERVICE_ID == _service && SAMPLE_INSTANCE_ID == _instance) {
+ send();
+ }
+ }
+
+ void on_message(std::shared_ptr< vsomeip::message > &_response) {
+ VSOMEIP_INFO << "Received a response from Service ["
+ << std::setw(4) << std::setfill('0') << std::hex << _response->get_service()
+ << "."
+ << std::setw(4) << std::setfill('0') << std::hex << _response->get_instance()
+ << "] to Client/Session ["
+ << std::setw(4) << std::setfill('0') << std::hex << _response->get_client()
+ << "/"
+ << std::setw(4) << std::setfill('0') << std::hex << _response->get_session()
+ << "]";
+
+
+ //std::this_thread::sleep_for(std::chrono::milliseconds(SAMPLE_CYCLE));
+ send();
+ }
+
+ void send() {
+ app_->send(request_);
+ VSOMEIP_INFO << "Client/Session ["
+ << std::setw(4) << std::setfill('0') << std::hex << request_->get_client()
+ << "/"
+ << std::setw(4) << std::setfill('0') << std::hex << request_->get_session()
+ << "] sent a request to Service ["
+ << std::setw(4) << std::setfill('0') << std::hex << request_->get_service()
+ << "."
+ << std::setw(4) << std::setfill('0') << std::hex << request_->get_instance()
+ << "]";
+ }
+
+private:
+ std::shared_ptr< vsomeip::application > app_;
+ std::shared_ptr< vsomeip::message > request_;
+ std::string name_;
+};
+
+
+int main(int argc, char **argv) {
+ // determine path
+ std::string its_sample_name("client-sample");
+
+ int i = 0;
+ while (i < argc-1) {
+ if (std::string("--name") == argv[i]) {
+ its_sample_name = argv[i+1];
+ break;
+ }
+
+ i++;
+ }
+
+ client_sample its_sample(its_sample_name);
+ its_sample.init(argc, argv);
+ its_sample.start();
+ return 0;
+}
+
+
+
diff --git a/implementation/examples/service-sample.cpp b/implementation/examples/service-sample.cpp
new file mode 100644
index 0000000..a7147be
--- /dev/null
+++ b/implementation/examples/service-sample.cpp
@@ -0,0 +1,86 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <iomanip>
+#include <iostream>
+#include <thread>
+
+#include <vsomeip/vsomeip.hpp>
+
+#define SAMPLE_SERVICE_ID 0x1234
+#define SAMPLE_INSTANCE_ID 0x5678
+#define SAMPLE_METHOD_ID 0x0421
+
+class service_sample {
+public:
+ service_sample()
+ : app_(vsomeip::runtime::get()->create_application("service-sample")) {
+ }
+
+ void init(int argc, char **argv) {
+ app_->init(argc, argv);
+
+ app_->register_message_handler(
+ SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, SAMPLE_METHOD_ID,
+ std::bind(&service_sample::on_message,
+ this,
+ std::placeholders::_1)
+ );
+ }
+
+ void start() {
+ app_->start();
+ }
+
+ void offer() {
+ app_->offer_service(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID);
+ }
+
+ void on_message(std::shared_ptr< vsomeip::message > &_request) {
+ VSOMEIP_INFO << "Received a message with Client/Session ["
+ << std::setw(4) << std::setfill('0') << std::hex << _request->get_client()
+ << "/"
+ << std::setw(4) << std::setfill('0') << std::hex << _request->get_session()
+ << "]";
+
+ std::shared_ptr< vsomeip::message > its_response
+ = vsomeip::runtime::get()->create_response(_request);
+
+ vsomeip::payload &its_payload = its_response->get_payload();
+ std::vector< vsomeip::byte_t > its_sample_payload;
+ for (std::size_t i = 0; i < 6; ++i) its_sample_payload.push_back(i % 256);
+ its_payload.set_data(its_sample_payload);
+
+ app_->send(its_response);
+ }
+
+private:
+ std::shared_ptr< vsomeip::application > app_;
+};
+
+void run(void *arg) {
+ service_sample *its_sample = (service_sample*)arg;
+
+ VSOMEIP_INFO << "Updating offer for service ["
+ << std::hex << SAMPLE_SERVICE_ID << "." << SAMPLE_INSTANCE_ID
+ << "]";
+ its_sample->offer();
+ std::this_thread::sleep_for(std::chrono::milliseconds(2000));
+}
+
+
+int main(int argc, char **argv) {
+ service_sample its_sample;
+ its_sample.init(argc, argv);
+
+ std::thread runner(run, &its_sample);
+
+ its_sample.start();
+
+ runner.join();
+
+ return 0;
+}
diff --git a/implementation/logging/include/logger_impl.hpp b/implementation/logging/include/logger_impl.hpp
new file mode 100644
index 0000000..c2768d7
--- /dev/null
+++ b/implementation/logging/include/logger_impl.hpp
@@ -0,0 +1,58 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_LOGGER_IMPL_HPP
+#define VSOMEIP_LOGGER_IMPL_HPP
+
+#include <string>
+
+#include <boost/log/sinks/sync_frontend.hpp>
+#include <boost/log/sinks/text_ostream_backend.hpp>
+#include <boost/log/sources/severity_logger.hpp>
+#include <boost/log/trivial.hpp>
+
+#include <vsomeip/logger.hpp>
+
+namespace vsomeip {
+
+BOOST_LOG_ATTRIBUTE_KEYWORD(channel, "Channel", std::string)
+BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", boost::log::trivial::severity_level)
+
+typedef boost::log::sinks::synchronous_sink<
+ boost::log::sinks::text_ostream_backend > sink_t;
+
+class logger_impl: public logger {
+public:
+ static logger & get_logger();
+ static void init(const std::string &_path);
+
+ logger_impl();
+
+ boost::log::sources::severity_logger<
+ boost::log::trivial::severity_level > & get_internal();
+private:
+ void enable_console();
+ void enable_file(const std::string &_path);
+ void enable_dlt();
+
+private:
+ static logger_impl the_logger__;
+
+ boost::log::sources::severity_logger<
+ boost::log::trivial::severity_level > logger_;
+ boost::log::trivial::severity_level loglevel_;
+
+ sink_t *console_sink_;
+ sink_t *file_sink_;
+ //dlt_sink *dlt_sink_;
+
+private:
+ void use_null_logger();
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_INTERNAL_LOG_OWNER_HPP
diff --git a/implementation/logging/src/logger.cpp b/implementation/logging/src/logger.cpp
new file mode 100644
index 0000000..64ec36f
--- /dev/null
+++ b/implementation/logging/src/logger.cpp
@@ -0,0 +1,16 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/logger_impl.hpp"
+
+namespace vsomeip {
+
+logger & logger::get_logger() {
+ return logger_impl::get_logger();
+}
+
+} // namespace vsomeip
+
diff --git a/vsomeip/src/vsomeip/log_owner.cpp b/implementation/logging/src/logger_impl.cpp
index 5ef6385..057e983 100644
--- a/vsomeip/src/vsomeip/log_owner.cpp
+++ b/implementation/logging/src/logger_impl.cpp
@@ -1,11 +1,8 @@
-//
-// log_owner.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
#include <fstream>
@@ -31,8 +28,8 @@
#include <boost/utility/empty_deleter.hpp>
#endif
-#include <vsomeip_internal/configuration.hpp>
-#include <vsomeip_internal/log_owner.hpp>
+#include <vsomeip/configuration.hpp>
+#include "../include/logger_impl.hpp"
namespace logging = boost::log;
namespace sources = boost::log::sources;
@@ -45,51 +42,37 @@ using namespace boost::log::trivial;
namespace vsomeip {
-log_owner::log_owner(const std::string &_name)
- : owner_base(_name), loglevel_(debug), console_sink_(0), file_sink_(0) {
+logger_impl logger_impl::the_logger__;
+
+logger & logger_impl::get_logger() {
+ return the_logger__;
+}
+
+logger_impl::logger_impl()
+ : loglevel_(debug), console_sink_(0), file_sink_(0) {
logging::add_common_attributes();
}
-boost::log::sources::severity_logger< boost::log::trivial::severity_level > & log_owner::get_logger() {
+boost::log::sources::severity_logger< boost::log::trivial::severity_level > & logger_impl::get_internal() {
return logger_;
}
-void log_owner::configure_logging(bool _use_console, bool _use_file, bool _use_dlt) {
- if (_use_console)
- enable_console();
+void logger_impl::init(const std::string &_path) {
+ configuration *its_configuration = configuration::get(_path);
- if (_use_file)
- enable_file();
+ the_logger__.loglevel_ = its_configuration->get_loglevel();
- if (_use_dlt)
- enable_file();
+ if (its_configuration->has_console_log())
+ the_logger__.enable_console();
- if (!_use_console && !_use_file && !_use_dlt) {
- use_null_logger();
- }
-}
-
-void log_owner::set_channel(const std::string &_channel) {
- channel_ = _channel;
- logger_.add_attribute("Channel", attributes::constant< std::string >(_channel));
-}
+ if (its_configuration->has_file_log())
+ the_logger__.enable_file(its_configuration->get_logfile());
-void log_owner::set_loglevel(const std::string &_loglevel) {
- if (_loglevel == "fatal")
- loglevel_ = fatal;
- else if (_loglevel == "error")
- loglevel_ = error;
- else if (_loglevel == "warning")
- loglevel_ = warning;
- else if (_loglevel == "debug")
- loglevel_ = debug;
- else if (_loglevel == "verbose")
- loglevel_ = trace;
- else
- loglevel_ = info;
+ if (its_configuration->has_dlt_log())
+ the_logger__.enable_dlt();
}
-void log_owner::enable_console() {
+void logger_impl::enable_console() {
if (console_sink_)
return;
@@ -114,21 +97,12 @@ void log_owner::enable_console() {
console_sink_ = new sink_t(backend);
boost::shared_ptr< sink_t > sink(console_sink_);
-
- sink->set_filter(
- boost::phoenix::bind(
- &log_owner::filter,
- this,
- severity.or_none(),
- channel.or_none()
- )
- );
sink->set_formatter(vsomeip_log_format);
logging::core::get()->add_sink(sink);
}
-void log_owner::enable_file() {
+void logger_impl::enable_file(const std::string &_path) {
if (file_sink_)
return;
@@ -138,49 +112,24 @@ void log_owner::enable_file() {
<< " [" << expressions::attr<severity_level>("Severity") << "] "
<< expressions::smessage;
- configuration * vsomeip_configuration
- = configuration::request(name_);
-
boost::shared_ptr< sinks::text_ostream_backend > backend
= boost::make_shared< sinks::text_ostream_backend >();
backend->add_stream(
- boost::shared_ptr< std::ostream >(
- new std::ofstream(
- vsomeip_configuration->get_logfile_path()
- )
- )
+ boost::shared_ptr< std::ostream >(new std::ofstream(_path))
);
- configuration::release(name_);
-
file_sink_ = new sink_t(backend);
boost::shared_ptr< sink_t > sink(file_sink_);
-
- sink->set_filter(
- boost::phoenix::bind(
- &log_owner::filter,
- this,
- severity.or_none(),
- channel.or_none()
- )
- );
sink->set_formatter(vsomeip_log_format);
logging::core::get()->add_sink(sink);
}
-void log_owner::enable_dlt() {
+void logger_impl::enable_dlt() {
// TODO: implement
}
-bool log_owner::filter(
- logging::value_ref< severity_level, tag::severity > const &_loglevel,
- logging::value_ref< std::string, tag::channel > const &_channel) {
-
- return _channel == channel_ && _loglevel >= loglevel_;
-}
-
-void log_owner::use_null_logger() {
+void logger_impl::use_null_logger() {
boost::shared_ptr< sinks::text_ostream_backend > backend
= boost::make_shared< sinks::text_ostream_backend >();
backend->add_stream(
@@ -197,5 +146,3 @@ void log_owner::use_null_logger() {
} // namespace vsomeip
-
-
diff --git a/vsomeip/include/vsomeip_internal/byteorder.hpp b/implementation/message/include/byteorder.hpp
index aecbe30..ba04b61 100644
--- a/vsomeip/include/vsomeip_internal/byteorder.hpp
+++ b/implementation/message/include/byteorder.hpp
@@ -1,16 +1,11 @@
-//
-// byteorder.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_BYTEORDER_HPP
-#define VSOMEIP_INTERNAL_BYTEORDER_HPP
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_BYTEORDER_HPP
+#define VSOMEIP_BYTEORDER_HPP
#if defined(LINUX)
#include <endian.h>
@@ -61,4 +56,4 @@
#endif
-#endif // VSOMEIP_INTERNAL_BYTEORDER_HPP
+#endif // VSOMEIP_BYTEORDER_HPP
diff --git a/vsomeip/include/vsomeip_internal/deserializer.hpp b/implementation/message/include/deserializer.hpp
index feae470..871cbf4 100644
--- a/vsomeip/include/vsomeip_internal/deserializer.hpp
+++ b/implementation/message/include/deserializer.hpp
@@ -1,14 +1,11 @@
-//
-// deserializer.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_DESERIALIZER_HPP
-#define VSOMEIP_INTERNAL_DESERIALIZER_HPP
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_DESERIALIZER_HPP
+#define VSOMEIP_DESERIALIZER_HPP
#include <vector>
@@ -42,16 +39,16 @@ public:
bool deserialize(uint16_t& _value);
bool deserialize(uint32_t& _value, bool _omit_last_byte = false);
bool deserialize(uint8_t *_data, std::size_t _length);
- bool deserialize(std::vector<uint8_t>& _value);
+ bool deserialize(std::vector< uint8_t >& _value);
bool look_ahead(std::size_t _index, uint8_t &_value) const;
bool look_ahead(std::size_t _index, uint16_t &_value) const;
bool look_ahead(std::size_t _index, uint32_t &_value) const;
void reset();
-
+#ifdef VSOMEIP_DEBUG
void show_data() const;
-
+#endif
protected:
std::vector< uint8_t > data_;
std::vector< uint8_t >::iterator position_;
@@ -60,4 +57,4 @@ protected:
} // namespace vsomeip
-#endif // VSOMEIP_INTERNAL_DESERIALIZER_HPP
+#endif // VSOMEIP_DESERIALIZER_HPP
diff --git a/implementation/message/include/message_base_impl.hpp b/implementation/message/include/message_base_impl.hpp
new file mode 100644
index 0000000..4238168
--- /dev/null
+++ b/implementation/message/include/message_base_impl.hpp
@@ -0,0 +1,65 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_MESSAGE_BASE_IMPL_HPP
+#define VSOMEIP_MESSAGE_BASE_IMPL_HPP
+
+#include <boost/thread.hpp>
+
+#include <vsomeip/message.hpp>
+
+#include "message_header_impl.hpp"
+
+namespace vsomeip {
+
+class message_base_impl
+ : virtual public message_base {
+public:
+ message_base_impl();
+ virtual ~message_base_impl();
+
+ message_t get_message() const;
+ void set_message(message_t _message);
+
+ service_t get_service() const;
+ void set_service(service_t _service);
+
+ instance_t get_instance() const;
+ void set_instance(instance_t _instance);
+
+ method_t get_method() const;
+ void set_method(method_t _method);
+
+ request_t get_request() const;
+
+ client_t get_client() const;
+ void set_client(client_t _client);
+
+ session_t get_session() const;
+ void set_session(session_t _session);
+
+ protocol_version_t get_protocol_version() const;
+ void set_protocol_version(protocol_version_t _version);
+
+ interface_version_t get_interface_version() const;
+ void set_interface_version(interface_version_t _version);
+
+ message_type_e get_message_type() const;
+ void set_message_type(message_type_e _type);
+
+ return_code_e get_return_code() const;
+ void set_return_code(return_code_e _code);
+
+ message * get_owner() const;
+ void set_owner(message *_owner);
+
+protected: // members
+ message_header_impl header_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_INTERNAL_MESSAGE_BASE_IMPL_HPP
diff --git a/implementation/message/include/message_header_impl.hpp b/implementation/message/include/message_header_impl.hpp
new file mode 100644
index 0000000..8d0507a
--- /dev/null
+++ b/implementation/message/include/message_header_impl.hpp
@@ -0,0 +1,48 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_MESSAGE_HEADER_IMPL_HPP
+#define VSOMEIP_MESSAGE_HEADER_IMPL_HPP
+
+#include <vsomeip/primitive_types.hpp>
+#include <vsomeip/enumeration_types.hpp>
+#include <vsomeip/serializable.hpp>
+
+namespace vsomeip {
+
+class message_base;
+
+class message_header_impl : virtual public serializable {
+
+public:
+ message_header_impl();
+ message_header_impl(const message_header_impl& header);
+
+ virtual bool serialize(serializer *_to) const;
+ virtual bool deserialize(deserializer *_from);
+
+ // internal
+ message_base * get_owner() const;
+ void set_owner(message_base *_owner);
+
+public:
+ service_t service_;
+ method_t method_;
+ length_t length_;
+ client_t client_;
+ session_t session_;
+ protocol_version_t protocol_version_;
+ interface_version_t interface_version_;
+ message_type_e type_;
+ return_code_e code_;
+
+ instance_t instance_;
+ message_base *owner_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_MESSAGE_HEADER_IMPL_HPP
diff --git a/implementation/message/include/message_impl.hpp b/implementation/message/include/message_impl.hpp
new file mode 100644
index 0000000..0c1c636
--- /dev/null
+++ b/implementation/message/include/message_impl.hpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_MESSAGE_IMPL_HPP
+#define VSOMEIP_MESSAGE_IMPL_HPP
+
+#include "message_base_impl.hpp"
+#include "payload_impl.hpp"
+
+namespace vsomeip {
+
+class message_impl
+ : virtual public message,
+ virtual public message_base_impl {
+public:
+ virtual ~message_impl();
+
+ length_t get_length() const;
+ void set_length(length_t _length);
+
+ payload & get_payload();
+ const payload & get_payload() const;
+
+ bool serialize(serializer *_to) const;
+ bool deserialize(deserializer *_from);
+
+protected: // members
+ payload_impl payload_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_MESSAGE_IMPL_HPP
diff --git a/implementation/message/include/payload_impl.hpp b/implementation/message/include/payload_impl.hpp
new file mode 100644
index 0000000..79523bb
--- /dev/null
+++ b/implementation/message/include/payload_impl.hpp
@@ -0,0 +1,44 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_PAYLOAD_IMPL_HPP
+#define VSOMEIP_PAYLOAD_IMPL_HPP
+
+#include <vsomeip/payload.hpp>
+
+namespace vsomeip {
+
+class payload_owner;
+class serializer;
+class deserializer;
+
+class payload_impl : public payload {
+public:
+ payload_impl();
+ payload_impl(const payload_owner *_owner);
+ payload_impl(const payload_impl& _payload);
+ virtual ~payload_impl();
+
+ byte_t * get_data();
+ const byte_t * get_data() const;
+ length_t get_length() const;
+
+ void set_capacity(length_t _capacity);
+
+ void set_data(const byte_t *_data, length_t _length);
+ void set_data(const std::vector< byte_t > &_data);
+
+ bool serialize(serializer *_to) const;
+ bool deserialize(deserializer *_from);
+
+private:
+ std::vector< byte_t > data_;
+ const payload_owner *owner_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_PAYLOAD_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/payload_owner.hpp b/implementation/message/include/payload_owner.hpp
index 696bf64..696bf64 100644
--- a/vsomeip/include/vsomeip_internal/payload_owner.hpp
+++ b/implementation/message/include/payload_owner.hpp
diff --git a/vsomeip/include/vsomeip_internal/serializer.hpp b/implementation/message/include/serializer.hpp
index 93d6ba3..96b2c97 100644
--- a/vsomeip/include/vsomeip_internal/serializer.hpp
+++ b/implementation/message/include/serializer.hpp
@@ -1,18 +1,13 @@
-//
-// serializer.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
-#ifndef VSOMEIP_INTERNAL_SERIALIZER_HPP
-#define VSOMEIP_INTERNAL_SERIALIZER_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/enumeration_types.hpp>
+#ifndef VSOMEIP_SERIALIZER_HPP
+#define VSOMEIP_SERIALIZER_HPP
+#include <cstdint>
#include <vector>
namespace vsomeip {
@@ -51,4 +46,4 @@ private:
} // namespace vsomeip
-#endif // VSOMEIP_INTERNAL_SERIALIZER_IMPL_HPP
+#endif // VSOMEIP_SERIALIZER_IMPL_HPP
diff --git a/vsomeip/src/vsomeip/deserializer.cpp b/implementation/message/src/deserializer.cpp
index 174743d..ebd2793 100644
--- a/vsomeip/src/vsomeip/deserializer.cpp
+++ b/implementation/message/src/deserializer.cpp
@@ -1,18 +1,15 @@
-//
-// deserializer.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
#include <cstring>
#include <iostream>
-#include <vsomeip_internal/byteorder.hpp>
-#include <vsomeip_internal/message_impl.hpp>
-#include <vsomeip_internal/deserializer.hpp>
+#include "../include/byteorder.hpp"
+#include "../include/message_impl.hpp"
+#include "../include/deserializer.hpp"
namespace vsomeip {
@@ -186,6 +183,7 @@ void deserializer::reset() {
remaining_ = data_.size();
}
+#ifdef VSOMEIP_DEBUG
void deserializer::show_data() const {
std::cout << "("
<< std::hex << std::setw(2) << std::setfill('0') << (int)*position_ << ", "
@@ -194,5 +192,6 @@ void deserializer::show_data() const {
std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)data_[i] << " ";
std::cout << std::dec << std::endl;
}
+#endif
} // namespace vsomeip
diff --git a/implementation/message/src/message_base_impl.cpp b/implementation/message/src/message_base_impl.cpp
new file mode 100644
index 0000000..5bef55f
--- /dev/null
+++ b/implementation/message/src/message_base_impl.cpp
@@ -0,0 +1,105 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/byteorder.hpp"
+#include "../include/message_impl.hpp"
+
+namespace vsomeip {
+
+message_base_impl::message_base_impl() {
+ header_.set_owner(this);
+}
+
+message_base_impl::~message_base_impl() {
+};
+
+// header interface
+message_t message_base_impl::get_message() const {
+ return VSOMEIP_WORDS_TO_LONG(header_.service_, header_.method_);
+}
+
+void message_base_impl::set_message(message_t _message) {
+ header_.service_ = VSOMEIP_LONG_WORD0(_message);
+ header_.method_ = VSOMEIP_LONG_WORD1(_message);
+}
+
+service_t message_base_impl::get_service() const {
+ return header_.service_;
+}
+
+void message_base_impl::set_service(service_t _service) {
+ header_.service_ = _service;
+}
+
+instance_t message_base_impl::get_instance() const {
+ return header_.instance_;
+}
+
+void message_base_impl::set_instance(instance_t _instance) {
+ header_.instance_ = _instance;
+}
+
+method_t message_base_impl::get_method() const {
+ return header_.method_;
+}
+
+void message_base_impl::set_method(method_t _method) {
+ header_.method_ = _method;
+}
+
+request_t message_base_impl::get_request() const {
+ return VSOMEIP_WORDS_TO_LONG(header_.client_, header_.session_);
+}
+
+client_t message_base_impl::get_client() const {
+ return header_.client_;
+}
+
+void message_base_impl::set_client(client_t _client) {
+ header_.client_ = _client;
+}
+
+session_t message_base_impl::get_session() const {
+ return header_.session_;
+}
+
+void message_base_impl::set_session(session_t _session) {
+ header_.session_ = _session;
+}
+
+protocol_version_t message_base_impl::get_protocol_version() const {
+ return header_.protocol_version_;
+}
+
+void message_base_impl::set_protocol_version(protocol_version_t _protocol_version) {
+ header_.protocol_version_ = _protocol_version;
+}
+
+interface_version_t message_base_impl::get_interface_version() const {
+ return header_.interface_version_;
+}
+
+void message_base_impl::set_interface_version(interface_version_t _interface_version) {
+ header_.interface_version_ = _interface_version;
+}
+
+message_type_e message_base_impl::get_message_type() const {
+ return header_.type_;
+}
+
+void message_base_impl::set_message_type(message_type_e _type) {
+ header_.type_ = _type;
+}
+
+return_code_e message_base_impl::get_return_code() const {
+ return header_.code_;
+}
+
+void message_base_impl::set_return_code(return_code_e _code) {
+ header_.code_ = _code;
+}
+
+} // namespace vsomeip
diff --git a/implementation/message/src/message_header_impl.cpp b/implementation/message/src/message_header_impl.cpp
new file mode 100644
index 0000000..ce22920
--- /dev/null
+++ b/implementation/message/src/message_header_impl.cpp
@@ -0,0 +1,81 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <vsomeip/defines.hpp>
+
+#include "../include/message_base_impl.hpp"
+#include "../include/message_header_impl.hpp"
+#include "../include/serializer.hpp"
+#include "../include/deserializer.hpp"
+
+namespace vsomeip {
+
+message_header_impl::message_header_impl()
+ : service_(0x0), instance_(0x0), method_(0x0),
+ client_(0x0), session_(0x0),
+ protocol_version_(0x1), interface_version_(0x0),
+ type_(message_type_e::UNKNOWN),
+ code_(return_code_e::E_UNKNOWN) {
+};
+
+message_header_impl::message_header_impl(const message_header_impl& _header)
+ : service_(_header.service_), instance_(_header.instance_), method_(_header.method_),
+ client_(_header.client_), session_(_header.session_),
+ protocol_version_(_header.protocol_version_), interface_version_(_header.interface_version_),
+ type_(_header.type_),
+ code_(_header.code_) {
+};
+
+bool message_header_impl::serialize(serializer *_to) const {
+ return (0 != _to
+ && _to->serialize(service_)
+ && _to->serialize(method_)
+ && _to->serialize(owner_->get_length())
+ && _to->serialize(client_)
+ && _to->serialize(session_)
+ && _to->serialize(protocol_version_)
+ && _to->serialize(interface_version_)
+ && _to->serialize(static_cast<uint8_t>(type_))
+ && _to->serialize(static_cast<uint8_t>(code_)));
+};
+
+bool message_header_impl::deserialize(deserializer *_from) {
+ bool is_successful;
+
+ uint8_t tmp_message_type, tmp_return_code;
+ uint32_t tmp_length;
+
+ is_successful = (0 != _from
+ && _from->deserialize(service_)
+ && _from->deserialize(method_)
+ && _from->deserialize(tmp_length)
+ && _from->deserialize(client_)
+ && _from->deserialize(session_)
+ && _from->deserialize(protocol_version_)
+ && _from->deserialize(interface_version_)
+ && _from->deserialize(tmp_message_type)
+ && _from->deserialize(tmp_return_code));
+
+ if (is_successful) {
+ type_ = static_cast< message_type_e >(tmp_message_type);
+ code_ = static_cast< return_code_e >(tmp_return_code);
+ length_ = static_cast< length_t >(tmp_length - VSOMEIP_SOMEIP_HEADER_SIZE);
+ }
+
+ return is_successful;
+};
+
+message_base * message_header_impl::get_owner() const {
+ return owner_;
+}
+
+void message_header_impl::set_owner(message_base *_owner) {
+ owner_ = _owner;
+}
+
+} // namespace vsomeip
+
+
diff --git a/vsomeip/src/vsomeip/message_impl.cpp b/implementation/message/src/message_impl.cpp
index 05e969c..8088192 100644
--- a/vsomeip/src/vsomeip/message_impl.cpp
+++ b/implementation/message/src/message_impl.cpp
@@ -1,24 +1,21 @@
-//
-// message_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/byteorder.hpp>
-#include <vsomeip_internal/message_impl.hpp>
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <vsomeip/defines.hpp>
+
+#include "../include/byteorder.hpp"
+#include "../include/message_impl.hpp"
namespace vsomeip {
message_impl::~message_impl() {
};
-length message_impl::get_length() const {
- return VSOMEIP_STATIC_HEADER_SIZE + payload_.get_length();
+length_t message_impl::get_length() const {
+ return VSOMEIP_SOMEIP_HEADER_SIZE + payload_.get_length();
}
payload & message_impl::get_payload() {
diff --git a/implementation/message/src/payload_impl.cpp b/implementation/message/src/payload_impl.cpp
new file mode 100644
index 0000000..ebcd692
--- /dev/null
+++ b/implementation/message/src/payload_impl.cpp
@@ -0,0 +1,89 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/deserializer.hpp"
+#include "../include/payload_impl.hpp"
+#include "../include/payload_owner.hpp"
+#include "../include/serializer.hpp"
+
+namespace vsomeip {
+
+payload_impl::payload_impl()
+ : data_(), owner_(0) {
+}
+
+payload_impl::payload_impl(const payload_owner *_owner)
+ : data_(), owner_(_owner) {
+}
+
+payload_impl::payload_impl(const payload_impl& _payload)
+ : data_(_payload.data_) {
+}
+
+payload_impl::~payload_impl() {
+}
+
+byte_t * payload_impl::get_data() {
+ return data_.data();
+}
+
+const byte_t * payload_impl::get_data() const {
+ return data_.data();
+}
+
+length_t payload_impl::get_length() const {
+ return data_.size();
+}
+
+void payload_impl::set_capacity(length_t _capacity) {
+ data_.reserve(_capacity);
+}
+
+void payload_impl::set_data(const byte_t *_data, const length_t _length) {
+ bool is_changed = false;
+ if (data_.size() != _length) {
+ is_changed = true;
+ } else {
+ for (std::size_t i = 0; i < _length; ++i) {
+ if (data_[i] != _data[i]) {
+ is_changed = true;
+ break;
+ }
+ }
+ }
+ data_.assign(_data, _data + _length);
+
+ if (is_changed && owner_)
+ owner_->notify();
+}
+
+void payload_impl::set_data(const std::vector< byte_t > &_data) {
+ bool is_changed = false;
+ if (data_.size() != _data.size()) {
+ is_changed = true;
+ } else {
+ for (std::size_t i = 0; i < _data.size(); ++i) {
+ if (data_[i] != _data[i]) {
+ is_changed = true;
+ break;
+ }
+ }
+ }
+ data_ = _data;
+
+ if (is_changed && owner_)
+ owner_->notify();
+}
+
+bool payload_impl::serialize(serializer *_to) const {
+ return (0 != _to && _to->serialize(data_.data(), data_.size()));
+}
+
+bool payload_impl::deserialize(deserializer *_from) {
+ return (0 != _from && _from->deserialize(data_));
+}
+
+} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/serializer.cpp b/implementation/message/src/serializer.cpp
index 6d8613b..d4784c0 100644
--- a/vsomeip/src/vsomeip/serializer.cpp
+++ b/implementation/message/src/serializer.cpp
@@ -1,16 +1,15 @@
-//
-// serializer.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
#include <cstring>
#include <vsomeip/serializable.hpp>
-#include <vsomeip_internal/byteorder.hpp>
-#include <vsomeip_internal/serializer.hpp>
+
+#include "../include/byteorder.hpp"
+#include "../include/serializer.hpp"
namespace vsomeip {
@@ -117,8 +116,3 @@ void serializer::reset() {
}
} // namespace vsomeip
-
-
-
-
-
diff --git a/implementation/routing/include/local_routing_manager.hpp b/implementation/routing/include/local_routing_manager.hpp
new file mode 100644
index 0000000..63771d5
--- /dev/null
+++ b/implementation/routing/include/local_routing_manager.hpp
@@ -0,0 +1,43 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_LOCAL_ROUTING_MANAGER_HPP
+#define VSOMEIP_LOCAL_ROUTING_MANAGER_HPP
+
+#include <map>
+#include <memory>
+#include <set>
+
+#include <boost/asio/io_service.hpp>
+
+#include <vsomeip/primitive_types.hpp>
+
+#include "endpoint_host.hpp"
+
+namespace vsomeip {
+
+class endpoint;
+
+class local_routing_manager:
+public:
+ virtual ~local_routing_manager() {};
+
+ virtual endpoint * find_local_client(client_t _client) = 0;
+ virtual endpoint * create_local_client(client_t _client) = 0;
+ virtual endpoint * find_or_create_local_client(client_t _client) = 0;
+ virtual void remove_local_client(client_t) = 0;
+
+ virtual endpoint * find_local_service(service_t _service, instance_t _instance) = 0;
+ virtual void add_local_service(client_t _client, service_t _service, instance_t _instance) = 0;
+ virtual void remove_local_service(service_t _service, instance_t _instance) = 0;
+
+ // endpoint_host
+ virtual void on_message(const byte_t *_data, length_t _length, endpoint *_receiver) = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_LOCAL_ROUTING_MANAGER_HPP
diff --git a/implementation/routing/include/routing_info.hpp b/implementation/routing/include/routing_info.hpp
new file mode 100644
index 0000000..a8f7b51
--- /dev/null
+++ b/implementation/routing/include/routing_info.hpp
@@ -0,0 +1,46 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SERVICE_ROUTING_INFO_HPP
+#define VSOMEIP_SERVICE_ROUTING_INFO_HPP
+
+#include <memory>
+
+#include <vsomeip/primitive_types.hpp>
+
+namespace vsomeip {
+
+class endpoint;
+
+class routing_info {
+public:
+ routing_info(major_version_t _major, minor_version_t _minor, ttl_t _ttl);
+ ~routing_info();
+
+ major_version_t get_major() const;
+ minor_version_t get_minor() const;
+
+ ttl_t get_ttl() const;
+ void set_ttl(ttl_t _ttl);
+
+ std::shared_ptr< endpoint > & get_reliable_endpoint();
+ void set_reliable_endpoint(std::shared_ptr< endpoint > &_endpoint);
+
+ std::shared_ptr< endpoint > & get_unreliable_endpoint();
+ void set_unreliable_endpoint(std::shared_ptr< endpoint > &_endpoint);
+
+private:
+ major_version_t major_;
+ minor_version_t minor_;
+ ttl_t ttl_;
+
+ std::shared_ptr< endpoint > reliable_endpoint_;
+ std::shared_ptr< endpoint > unreliable_endpoint_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERVICE_ROUTING_INFO_HPP
diff --git a/implementation/routing/include/routing_manager.hpp b/implementation/routing/include/routing_manager.hpp
new file mode 100644
index 0000000..c807e88
--- /dev/null
+++ b/implementation/routing/include/routing_manager.hpp
@@ -0,0 +1,91 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ROUTING_MANAGER
+#define VSOMEIP_ROUTING_MANAGER
+
+#include <memory>
+#include <vector>
+
+#include <boost/asio/io_service.hpp>
+
+#include <vsomeip/message.hpp>
+
+namespace vsomeip {
+
+class endpoint;
+
+class routing_manager {
+public:
+ virtual ~routing_manager() {};
+
+ virtual boost::asio::io_service & get_io() = 0;
+
+ virtual void init() = 0;
+ virtual void start() = 0;
+ virtual void stop() = 0;
+
+ virtual void offer_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) = 0;
+
+ virtual void stop_offer_service(client_t _client,
+ service_t _service, instance_t _instance) = 0;
+
+ virtual void publish_eventgroup(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup,
+ major_version_t _major, ttl_t _ttl) = 0;
+
+ virtual void stop_publish_eventgroup(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup) = 0;
+
+ virtual void add_event(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event) = 0;
+
+ virtual void add_field(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup,
+ event_t _event, std::vector< byte_t > &_value) = 0;
+
+ virtual void remove_event_or_field(client_t _client,
+ service_t service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event) = 0;
+
+ virtual void request_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) = 0;
+
+ virtual void release_service(client_t _client,
+ service_t _service, instance_t _instance) = 0;
+
+ virtual void subscribe(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) = 0;
+
+ virtual void unsubscribe(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) = 0;
+
+ virtual void send(client_t _client,
+ std::shared_ptr< message > _message, bool _flush, bool _reliable) = 0;
+
+ virtual void send(client_t _client,
+ const byte_t *_data, uint32_t _size, instance_t _instance, bool _flush, bool _reliable) = 0;
+
+ virtual void set(client_t _client,
+ service_t _service, instance_t _instance,
+ event_t _event, const std::vector< byte_t > &_value) = 0;
+
+ virtual endpoint * find_local(client_t _client) = 0;
+ virtual endpoint * find_local(service_t _service, instance_t _instance) = 0;
+ virtual endpoint * find_or_create_local(client_t _client) = 0;
+ virtual void remove_local(client_t _client) = 0;
+};
+
+} // namespace vsomeip
+
+#endif
diff --git a/implementation/routing/include/routing_manager_adapter.hpp b/implementation/routing/include/routing_manager_adapter.hpp
new file mode 100644
index 0000000..0dea6c2
--- /dev/null
+++ b/implementation/routing/include/routing_manager_adapter.hpp
@@ -0,0 +1,24 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ROUTING_MANAGER_ADAPTER
+#define VSOMEIP_ROUTING_MANAGER_ADAPTER
+
+namespace vsomeip {
+
+class routing_manager;
+
+class routing_manager_adapter {
+public:
+ virtual ~routing_manager_adapter() {};
+
+ virtual routing_manager * get_manager() = 0;
+ virtual void process_command(const byte_t *_data, length_t _length) = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ROUTING_MANAGER_ADAPTER_HPP
diff --git a/implementation/routing/include/routing_manager_host.hpp b/implementation/routing/include/routing_manager_host.hpp
new file mode 100644
index 0000000..c0ab0ca
--- /dev/null
+++ b/implementation/routing/include/routing_manager_host.hpp
@@ -0,0 +1,35 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ROUTING_MANAGER_HOST
+#define VSOMEIP_ROUTING_MANAGER_HOST
+
+#include <memory>
+
+#include <boost/asio/io_service.hpp>
+
+namespace vsomeip {
+
+class configuration;
+class message;
+
+class routing_manager_host {
+public:
+ virtual ~routing_manager_host() {};
+
+ virtual client_t get_client() const = 0;
+ virtual const std::string & get_name() const = 0;
+ virtual std::shared_ptr< configuration > get_configuration() const = 0;
+ virtual boost::asio::io_service & get_io() = 0;
+
+ virtual void on_availability(service_t _service, instance_t _instance, bool _is_available) const = 0;
+ virtual void on_message(std::shared_ptr< message > _message) = 0;
+ virtual void on_error() = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ROUTING_MANAGER_HOST
diff --git a/implementation/routing/include/routing_manager_impl.hpp b/implementation/routing/include/routing_manager_impl.hpp
new file mode 100644
index 0000000..32d86e7
--- /dev/null
+++ b/implementation/routing/include/routing_manager_impl.hpp
@@ -0,0 +1,140 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ROUTING_MANAGER_IMPL_HPP
+#define VSOMEIP_ROUTING_MANAGER_IMPL_HPP
+
+#include <map>
+#include <memory>
+#include <mutex>
+#include <vector>
+
+#include <boost/asio/io_service.hpp>
+
+#include "../../endpoints/include/endpoint_host.hpp"
+#include "routing_manager.hpp"
+
+namespace vsomeip {
+
+class client_endpoint;
+class configuration;
+class deserializer;
+class routing_manager_host;
+class routing_info;
+class serializer;
+class service_endpoint;
+
+class routing_manager_impl:
+ public routing_manager,
+ public endpoint_host,
+ public std::enable_shared_from_this< routing_manager_impl > {
+public:
+ routing_manager_impl(routing_manager_host *_host);
+ ~routing_manager_impl();
+
+ boost::asio::io_service & get_io();
+
+ void init();
+ void start();
+ void stop();
+
+ void offer_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl);
+
+ void stop_offer_service(client_t _client,
+ service_t _service, instance_t _instance);
+
+
+ void publish_eventgroup(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup,
+ major_version_t _major, ttl_t _ttl);
+
+ void stop_publish_eventgroup(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup);
+
+ void add_event(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event);
+
+ void add_field(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ event_t _event, std::vector< byte_t > &_value);
+
+ void remove_event_or_field(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event);
+
+ void request_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl);
+
+ void release_service(client_t _client, service_t _service, instance_t _instance);
+
+ void subscribe(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup);
+
+ void unsubscribe(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup);
+
+ void send(client_t _client,
+ std::shared_ptr< message > _message, bool _reliable, bool _flush);
+
+ void send(client_t _client,
+ const byte_t *_data, uint32_t _size, instance_t _instance, bool _flush, bool _reliable);
+
+ void set(client_t _client,
+ service_t _service, instance_t _instance,
+ event_t _event, const std::vector< byte_t > &_value);
+
+ void on_message(const byte_t *_data, length_t _length, endpoint *_receiver);
+
+ endpoint * find_local(client_t _client);
+ endpoint * find_or_create_local(client_t _client);
+ void remove_local(client_t _client);
+ endpoint * find_local(service_t _service, instance_t _instance);
+
+private:
+ void on_message(const byte_t *_data, length_t _length, instance_t _instance);
+
+ client_t find_client(service_t _service, instance_t _instance);
+ instance_t find_instance(service_t _service, endpoint *_endpoint);
+
+ routing_info * find_service(service_t _service, instance_t _instance);
+ void create_service(service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl);
+
+ endpoint * find_service_endpoint(uint16_t _port, bool _reliable);
+ endpoint * create_service_endpoint(uint16_t _port, bool _reliable);
+ endpoint * find_or_create_service_endpoint(uint16_t _port, bool _reliable);
+
+ endpoint * create_local(client_t _client);
+
+private:
+ boost::asio::io_service &io_;
+
+ routing_manager_host *host_;
+ std::shared_ptr< deserializer > deserializer_;
+ std::shared_ptr< serializer > serializer_;
+ std::shared_ptr< configuration > configuration_;
+
+ std::map< client_t, std::shared_ptr< endpoint > > local_clients_;
+ std::map< service_t, std::map< instance_t, client_t > > local_services_;
+
+ std::map< client_t, std::shared_ptr< endpoint > > clients_;
+ std::map< service_t, std::map< instance_t, std::shared_ptr< routing_info > > > services_;
+ std::map< uint16_t, std::map< bool, std::shared_ptr< endpoint > > > service_endpoints_;
+ std::map< service_t, std::map< endpoint *, instance_t > > service_instances_;
+
+ std::recursive_mutex endpoint_mutex_;
+ std::mutex serialize_mutex_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ROUTING_MANAGER_IMPL_HPP
diff --git a/implementation/routing/include/routing_manager_proxy.hpp b/implementation/routing/include/routing_manager_proxy.hpp
new file mode 100644
index 0000000..f79dd00
--- /dev/null
+++ b/implementation/routing/include/routing_manager_proxy.hpp
@@ -0,0 +1,127 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ROUTING_MANAGER_PROXY_HPP
+#define VSOMEIP_ROUTING_MANAGER_PROXY_HPP
+
+#include <map>
+#include <mutex>
+
+#include <boost/asio/io_service.hpp>
+
+#include "../../endpoints/include/endpoint_host.hpp"
+#include "routing_manager.hpp"
+
+namespace vsomeip {
+
+class routing_manager_host;
+
+class routing_manager_proxy:
+ public routing_manager,
+ public endpoint_host,
+ public std::enable_shared_from_this< routing_manager_proxy > {
+public:
+ routing_manager_proxy(routing_manager_host *_host);
+ virtual ~routing_manager_proxy();
+
+ boost::asio::io_service & get_io();
+
+ void init();
+ void start();
+ void stop();
+
+ void offer_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl);
+
+ void stop_offer_service(client_t _client,
+ service_t _service, instance_t _instance);
+
+
+ void publish_eventgroup(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ major_version_t _major, ttl_t _ttl);
+
+ void stop_publish_eventgroup(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup);
+
+ void add_event(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event);
+
+ void add_field(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event, std::vector< byte_t > &_value);
+
+ void remove_event_or_field(client_t _client,
+ service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event);
+
+ void request_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl);
+
+ void release_service(client_t _client,
+ service_t _service, instance_t _instance);
+
+ void subscribe(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup);
+
+ void unsubscribe(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup);
+
+ void send(client_t _client,
+ std::shared_ptr< message > _message, bool _flush, bool _reliable);
+
+ void send(client_t _client,
+ const byte_t *_data, uint32_t _size, instance_t _instance, bool _flush = true, bool _reliable = false);
+
+ void set(client_t _client,
+ service_t _service, instance_t _instance,
+ event_t _event, const std::vector< byte_t > &_value);
+
+ void on_register_application(client_t _client);
+ void on_deregister_application(client_t _client);
+ void on_message(const byte_t *_data, length_t _length, endpoint *_receiver);
+ void on_routing_info(const byte_t *_data, uint32_t _size);
+
+ endpoint * find_local(client_t _client);
+ endpoint * find_local(service_t _service, instance_t _instance);
+ endpoint * find_or_create_local(client_t _client);
+ void remove_local(client_t _client);
+
+private:
+ void register_application();
+ void deregister_application();
+
+ endpoint * create_local(client_t _client);
+
+ bool is_request(byte_t _message_type) const;
+
+ void send_pong() const;
+
+private:
+ boost::asio::io_service &io_;
+ routing_manager_host *host_;
+ client_t client_; // store locally as it is needed in each message
+
+ std::shared_ptr< serializer > serializer_;
+ std::shared_ptr< deserializer > deserializer_;
+
+ std::shared_ptr< endpoint > sender_; // --> stub
+ std::shared_ptr< endpoint > receiver_; // --> from everybody
+
+ std::map< client_t, std::shared_ptr< endpoint > > local_endpoints_;
+ std::map< service_t, std::map< instance_t, client_t > > local_services_;
+
+ std::mutex send_mutex_;
+ std::mutex serialize_mutex_;
+ std::mutex deserialize_mutex_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ROUTING_MANAGER_PROXY_HPP
diff --git a/implementation/routing/include/routing_manager_stub.hpp b/implementation/routing/include/routing_manager_stub.hpp
new file mode 100644
index 0000000..3a59b4b
--- /dev/null
+++ b/implementation/routing/include/routing_manager_stub.hpp
@@ -0,0 +1,72 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ROUTING_MANAGER_STUB
+#define VSOMEIP_ROUTING_MANAGER_STUB
+
+#include <list>
+#include <map>
+#include <memory>
+#include <set>
+
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/system_timer.hpp>
+
+#include "../../endpoints/include/endpoint_host.hpp"
+
+namespace vsomeip {
+
+class routing_manager_stub:
+ public endpoint_host,
+ public std::enable_shared_from_this< routing_manager_stub > {
+public:
+ routing_manager_stub(routing_manager *_its_routing);
+ ~routing_manager_stub();
+
+ void init();
+ void start();
+ void stop();
+
+ routing_manager * get_manager();
+ void on_message(const byte_t *_data, const length_t _length, endpoint *_receiver);
+
+private:
+ void broadcast(std::vector< byte_t > &_command) const;
+
+ void on_register_application(client_t _client);
+ void on_deregister_application(client_t _client);
+
+ void on_offer_service(client_t _client, service_t _service, instance_t _instance);
+ void on_stop_offer_service(client_t _client, service_t _service, instance_t _instance);
+
+ void broadcast_routing_info();
+ void send_routing_info(client_t _client);
+
+ void broadcast_ping() const;
+ void on_pong(client_t _client);
+ void start_watchdog();
+ void check_watchdog();
+ void send_application_lost(std::list< client_t > &_lost);
+
+private:
+ boost::asio::io_service &io_;
+ boost::asio::system_timer watchdog_timer_;
+
+ routing_manager *routing_;
+ std::shared_ptr< endpoint > endpoint_;
+ std::map< client_t,
+ std::pair< uint8_t,
+ std::map< service_t,
+ std::set< instance_t > > > > routing_info_;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ROUTING_MANAGER_STUB
+
+
+
+
diff --git a/implementation/routing/src/routing_info.cpp b/implementation/routing/src/routing_info.cpp
new file mode 100644
index 0000000..7299cff
--- /dev/null
+++ b/implementation/routing/src/routing_info.cpp
@@ -0,0 +1,53 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/routing_info.hpp"
+
+namespace vsomeip {
+
+routing_info::routing_info(major_version_t _major, minor_version_t _minor, ttl_t _ttl)
+ : major_(_major), minor_(_minor), ttl_(_ttl) {
+}
+
+routing_info::~routing_info() {
+}
+
+major_version_t routing_info::get_major() const {
+ return major_;
+}
+
+minor_version_t routing_info::get_minor() const {
+ return minor_;
+}
+
+ttl_t routing_info::get_ttl() const {
+ return ttl_;
+}
+
+void routing_info::set_ttl(ttl_t _ttl) {
+ ttl_ = _ttl;
+}
+
+std::shared_ptr< endpoint > & routing_info::get_reliable_endpoint() {
+ return reliable_endpoint_;
+}
+
+void routing_info::set_reliable_endpoint(std::shared_ptr< endpoint > &_endpoint) {
+ reliable_endpoint_ = _endpoint;
+}
+
+std::shared_ptr< endpoint > & routing_info::get_unreliable_endpoint() {
+ return unreliable_endpoint_;
+}
+
+void routing_info::set_unreliable_endpoint(std::shared_ptr< endpoint > &_endpoint) {
+ unreliable_endpoint_ = _endpoint;
+}
+
+} // namespace vsomeip
+
+
+
diff --git a/implementation/routing/src/routing_manager_impl.cpp b/implementation/routing/src/routing_manager_impl.cpp
new file mode 100644
index 0000000..24979aa
--- /dev/null
+++ b/implementation/routing/src/routing_manager_impl.cpp
@@ -0,0 +1,419 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <iomanip>
+#include <memory>
+
+#include <vsomeip/configuration.hpp>
+#include <vsomeip/constants.hpp>
+#include <vsomeip/logger.hpp>
+#include <vsomeip/message.hpp>
+
+#include "../include/routing_info.hpp"
+#include "../include/routing_manager_impl.hpp"
+#include "../include/routing_manager_host.hpp"
+#include "../../configuration/include/internal.hpp"
+#include "../../endpoints/include/local_client_endpoint_impl.hpp"
+#include "../../endpoints/include/tcp_client_endpoint_impl.hpp"
+#include "../../endpoints/include/tcp_server_endpoint_impl.hpp"
+#include "../../endpoints/include/udp_client_endpoint_impl.hpp"
+#include "../../endpoints/include/udp_server_endpoint_impl.hpp"
+#include "../../message/include/byteorder.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+#include "../../utility/include/utility.hpp"
+
+namespace vsomeip {
+
+routing_manager_impl::routing_manager_impl(routing_manager_host *_host)
+ : host_(_host),
+ io_(_host->get_io()),
+ deserializer_(new deserializer),
+ serializer_(new serializer),
+ configuration_(host_->get_configuration()) {
+}
+
+routing_manager_impl::~routing_manager_impl() {
+}
+
+boost::asio::io_service & routing_manager_impl::get_io() {
+ return io_;
+}
+
+void routing_manager_impl::init() {
+ uint32_t its_max_message_size = VSOMEIP_MAX_LOCAL_MESSAGE_SIZE;
+ if (VSOMEIP_MAX_TCP_MESSAGE_SIZE > its_max_message_size)
+ its_max_message_size = VSOMEIP_MAX_TCP_MESSAGE_SIZE;
+ if (VSOMEIP_MAX_UDP_MESSAGE_SIZE > its_max_message_size)
+ its_max_message_size = VSOMEIP_MAX_UDP_MESSAGE_SIZE;
+
+ serializer_->create_data(its_max_message_size);
+ if (!configuration_->is_service_discovery_enabled()) {
+ for (auto s : configuration_->get_remote_services()) {
+ VSOMEIP_DEBUG << "Remote service loaded ["
+ << std::hex << s.first << "." << s.second << "]";
+ }
+ }
+}
+
+void routing_manager_impl::start() {
+}
+
+void routing_manager_impl::stop() {
+
+}
+
+void routing_manager_impl::offer_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) {
+#if 0
+ std::cout << "RM: Service [" << std::hex << _service << "." << _instance << "] is offered." << std::endl;
+#endif
+ // Local route
+ local_services_[_service][_instance] = _client;
+
+ /* Remote route (incoming only)
+ routing_info *its_info = find_service(_service, _instance);
+ if (its_info) {
+ if (its_info->get_major() == _major && its_info->get_minor() == _minor) {
+ its_info->set_ttl(_ttl);
+ } else {
+ host_->on_error();
+ }
+ } else {
+ create_service(_service, _instance, _major, _minor, _ttl);
+ } */
+
+ host_->on_availability(_service, _instance, true);
+}
+
+void routing_manager_impl::stop_offer_service(client_t its_client,
+ service_t _service, instance_t _instance) {
+ auto found_service = services_.find(_service);
+ if (found_service != services_.end()) {
+ auto found_instance = found_service->second.find(_instance);
+ if (found_instance != found_service->second.end()) {
+ found_service->second.erase(found_instance);
+ if (0 == found_service->second.size())
+ services_.erase(found_service);
+ }
+ }
+ host_->on_availability(_service, _instance, false);
+}
+
+void routing_manager_impl::publish_eventgroup(client_t its_client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ major_version_t _major, ttl_t _ttl) {
+
+}
+
+void routing_manager_impl::stop_publish_eventgroup(client_t its_client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+
+}
+
+void routing_manager_impl::add_event(client_t its_client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ event_t _event) {
+
+}
+
+void routing_manager_impl::add_field(client_t its_client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ event_t _event, std::vector< byte_t > &_value) {
+
+}
+
+void routing_manager_impl::remove_event_or_field(client_t its_client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ event_t _event) {
+
+}
+
+void routing_manager_impl::request_service(client_t its_client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) {
+
+
+}
+
+void routing_manager_impl::release_service(client_t its_client,
+ service_t _service, instance_t _instance) {
+
+}
+
+void routing_manager_impl::subscribe(client_t its_client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+}
+
+void routing_manager_impl::unsubscribe(client_t its_client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+}
+
+void routing_manager_impl::send(client_t its_client,
+ std::shared_ptr< message > _message, bool _reliable, bool _flush) {
+ std::unique_lock< std::mutex > its_lock(serialize_mutex_);
+ if (serializer_->serialize(_message.get())) {
+ send(its_client, serializer_->get_data(), serializer_->get_size(), _message->get_instance(), _reliable, _flush);
+ serializer_->reset();
+ }
+}
+
+void routing_manager_impl::send(client_t _client,
+ const byte_t *_data, length_t _size, instance_t _instance, bool _flush, bool _reliable) {
+ endpoint *its_target(0);
+
+ client_t its_client = VSOMEIP_BYTES_TO_WORD(_data[VSOMEIP_CLIENT_POS_MIN], _data[VSOMEIP_CLIENT_POS_MAX]);
+ service_t its_service = VSOMEIP_BYTES_TO_WORD(_data[VSOMEIP_SERVICE_POS_MIN], _data[VSOMEIP_SERVICE_POS_MAX]);
+ bool is_request = utility::is_request(_data[VSOMEIP_MESSAGE_TYPE_POS]);
+#if 0
+ std::cout << "Message ["
+ << std::hex << its_service << "." << _instance
+ << "] "
+ << (is_request ? "from " : "to ")
+ << "client ["
+ << std::hex << its_client
+ << "]" << std::endl;
+#endif
+ if (_size > VSOMEIP_MESSAGE_TYPE_POS) {
+ if (is_request) {
+ its_target = find_local(its_service, _instance);
+ } else {
+ its_target = find_local(its_client);
+ }
+
+ if (its_target) {
+ std::vector< byte_t > its_command(VSOMEIP_COMMAND_HEADER_SIZE + _size + sizeof(instance_t) + sizeof(bool) + sizeof(bool));
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_SEND;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_CLIENT_POS], &_client, sizeof(client_t));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &_size, sizeof(_size));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS], _data, _size);
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS + _size], &_instance, sizeof(instance_t));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS + _size + sizeof(instance_t)], &_reliable, sizeof(bool));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS + _size + sizeof(instance_t) + sizeof(bool)] , &_flush, sizeof(bool));
+ its_target->send(&its_command[0], its_command.size(), _flush);
+ } else {
+ // Check whether hosting application should get the message
+ // If not, check routes to external
+ if ((its_client == host_->get_client() && !is_request) ||
+ (find_client(its_service, _instance) == host_->get_client() && is_request)) {
+ on_message(_data, _size, _instance);
+ } else {
+ VSOMEIP_ERROR << "Must route to other device. Not implemented yet.";
+ }
+ }
+ }
+}
+
+void routing_manager_impl::set(client_t its_client,
+ service_t _service, instance_t _instance,
+ event_t _event, const std::vector< byte_t > &_value) {
+}
+
+void routing_manager_impl::on_message(const byte_t *_data, length_t _size, endpoint *_receiver) {
+ if (_size >= VSOMEIP_SOMEIP_HEADER_SIZE) {
+ service_t its_service = VSOMEIP_BYTES_TO_WORD(_data[VSOMEIP_SERVICE_POS_MIN], _data[VSOMEIP_SERVICE_POS_MAX]);
+ instance_t its_instance = find_instance(its_service, _receiver);
+ if (its_instance != VSOMEIP_ANY_INSTANCE) {
+ on_message(_data, _size, its_instance);
+ }
+ } else {
+ //send_error(); // TODO: send error "malformed message"
+ }
+}
+
+void routing_manager_impl::on_message(const byte_t *_data, length_t _size, instance_t _instance) {
+#if 0
+ std::cout << "rmi::on_message: ";
+ for (int i = 0; i < _size; ++i)
+ std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)_data[i] << " ";
+ std::cout << std::endl;
+#endif
+
+ deserializer_->set_data(_data, _size);
+ std::shared_ptr< message > its_message(deserializer_->deserialize_message());
+ if (its_message) {
+ its_message->set_instance(_instance);
+ host_->on_message(its_message);
+ } else {
+ // TODO: send error "Malformed Message"
+ //send_error();
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// PRIVATE
+///////////////////////////////////////////////////////////////////////////////
+routing_info * routing_manager_impl::find_service(
+ service_t _service, instance_t _instance) {
+ routing_info *its_info = 0;
+
+ auto found_service = services_.find(_service);
+ if (found_service != services_.end()) {
+ auto found_instance = found_service->second.find(_instance);
+ if (found_instance != found_service->second.end()) {
+ its_info = found_instance->second.get();
+ }
+ }
+
+ return its_info;
+}
+
+void routing_manager_impl::create_service(
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) {
+
+ if (configuration_) {
+ std::shared_ptr< routing_info > its_info(new routing_info(_major, _minor, _ttl));
+
+ uint16_t its_reliable_port = configuration_->get_reliable_port(_service, _instance);
+ uint16_t its_unreliable_port = configuration_->get_unreliable_port(_service, _instance);
+
+ if (its_reliable_port != VSOMEIP_ILLEGAL_PORT) {
+ std::shared_ptr< endpoint > its_reliable_endpoint(
+ find_or_create_service_endpoint(its_reliable_port, true));
+ its_info->set_reliable_endpoint(its_reliable_endpoint);
+
+ // TODO: put this in a method and check whether an assignment already exists!
+ service_instances_[_service][its_reliable_endpoint.get()] = _instance;
+ }
+
+ if (its_unreliable_port != VSOMEIP_ILLEGAL_PORT) {
+ std::shared_ptr< endpoint > its_unreliable_endpoint(
+ find_or_create_service_endpoint(its_unreliable_port, false));
+ its_info->set_unreliable_endpoint(its_unreliable_endpoint);
+
+ service_instances_[_service][its_unreliable_endpoint.get()] = _instance;
+ }
+
+ if (VSOMEIP_ILLEGAL_PORT != its_reliable_port || VSOMEIP_ILLEGAL_PORT != its_unreliable_port) {
+ services_[_service][_instance] = its_info;
+ } else {
+ host_->on_error(); // TODO: Define configuration error "No valid port for service!"
+ }
+ } else {
+ host_->on_error(); // TODO: Define configuration error!
+ }
+}
+
+endpoint * routing_manager_impl::find_service_endpoint(uint16_t _port, bool _reliable) {
+ endpoint *its_endpoint(0);
+
+ auto found_port = service_endpoints_.find(_port);
+ if (found_port != service_endpoints_.end()) {
+ auto found_endpoint = found_port->second.find(_reliable);
+ if (found_endpoint != found_port->second.end()) {
+ its_endpoint = found_endpoint->second.get();
+ }
+ }
+
+ return its_endpoint;
+}
+
+endpoint * routing_manager_impl::create_service_endpoint(uint16_t _port, bool _reliable) {
+ endpoint *its_endpoint(0);
+
+ try {
+ boost::asio::ip::address its_address = configuration_->get_address();
+ if (_reliable) {
+ its_endpoint = new tcp_server_endpoint_impl(
+ shared_from_this(),
+ boost::asio::ip::tcp::endpoint(its_address, _port),
+ io_
+ );
+ } else {
+ its_endpoint = new udp_server_endpoint_impl(
+ shared_from_this(),
+ boost::asio::ip::udp::endpoint(its_address, _port),
+ io_
+ );
+ }
+ }
+ catch (std::exception &e) {
+ host_->on_error(); // Define error for "Server endpoint could not be created. Reason: ...
+ }
+
+ return its_endpoint;
+}
+
+endpoint * routing_manager_impl::find_or_create_service_endpoint(uint16_t _port, bool _reliable) {
+ endpoint *its_endpoint = find_service_endpoint(_port, _reliable);
+ if (0 == its_endpoint) {
+ its_endpoint = create_service_endpoint(_port, _reliable);
+ }
+ return its_endpoint;
+}
+
+endpoint * routing_manager_impl::find_local(client_t _client) {
+ std::unique_lock< std::recursive_mutex > its_lock(endpoint_mutex_);
+ endpoint *its_endpoint(0);
+ auto found_endpoint = clients_.find(_client);
+ if (found_endpoint != clients_.end()) {
+ its_endpoint = found_endpoint->second.get();
+ }
+ return its_endpoint;
+}
+
+endpoint * routing_manager_impl::create_local(client_t _client) {
+ std::unique_lock< std::recursive_mutex > its_lock(endpoint_mutex_);
+
+ std::stringstream its_path;
+ its_path << VSOMEIP_ROUTING_BASE_PATH << std::hex << _client;
+
+ std::shared_ptr< endpoint > its_endpoint
+ = std::make_shared< local_client_endpoint_impl >(
+ shared_from_this(),
+ boost::asio::local::stream_protocol::endpoint(its_path.str()),
+ io_);
+ clients_[_client] = its_endpoint;
+ its_endpoint->start();
+ return its_endpoint.get();
+}
+
+endpoint * routing_manager_impl::find_or_create_local(client_t _client) {
+ endpoint *its_endpoint(find_local(_client));
+ if (0 == its_endpoint) {
+ its_endpoint = create_local(_client);
+ }
+ return its_endpoint;
+}
+
+void routing_manager_impl::remove_local(client_t _client) {
+ std::unique_lock< std::recursive_mutex > its_lock(endpoint_mutex_);
+ endpoint *its_endpoint = find_local(_client);
+ its_endpoint->stop();
+ clients_.erase(_client);
+}
+
+endpoint * routing_manager_impl::find_local(service_t _service, instance_t _instance) {
+ return find_local(find_client(_service, _instance));
+}
+
+client_t routing_manager_impl::find_client(service_t _service, instance_t _instance) {
+ client_t its_client(0);
+ auto found_service = local_services_.find(_service);
+ if (found_service != local_services_.end()) {
+ auto found_instance = found_service->second.find(_instance);
+ if (found_instance != found_service->second.end()) {
+ its_client = found_instance->second;
+ }
+ }
+ return its_client;
+}
+
+instance_t routing_manager_impl::find_instance(service_t _service, endpoint * _endpoint) {
+ instance_t its_instance(0xFFFF);
+ auto found_service = service_instances_.find(_service);
+ if (found_service != service_instances_.end()) {
+ auto found_endpoint = found_service->second.find(_endpoint);
+ if (found_endpoint != found_service->second.end()) {
+ its_instance = found_endpoint->second;
+ }
+ }
+ return its_instance;
+}
+
+} // namespace vsomeip
diff --git a/implementation/routing/src/routing_manager_proxy.cpp b/implementation/routing/src/routing_manager_proxy.cpp
new file mode 100644
index 0000000..23dd00f
--- /dev/null
+++ b/implementation/routing/src/routing_manager_proxy.cpp
@@ -0,0 +1,498 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <iomanip>
+#include <mutex>
+
+#include <vsomeip/constants.hpp>
+#include <vsomeip/logger.hpp>
+
+#include "../include/routing_manager_host.hpp"
+#include "../include/routing_manager_proxy.hpp"
+#include "../../configuration/include/internal.hpp"
+#include "../../endpoints/include/local_client_endpoint_impl.hpp"
+#include "../../endpoints/include/local_server_endpoint_impl.hpp"
+#include "../../message/include/byteorder.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+
+routing_manager_proxy::routing_manager_proxy(routing_manager_host *_host)
+ : io_(_host->get_io()),
+ host_(_host),
+ client_(_host->get_client()),
+ sender_(0),
+ receiver_(0),
+ serializer_(new serializer),
+ deserializer_(new deserializer) {
+}
+
+routing_manager_proxy::~routing_manager_proxy() {
+}
+
+boost::asio::io_service & routing_manager_proxy::get_io() {
+ return io_;
+}
+
+void routing_manager_proxy::init() {
+ uint32_t its_max_message_size = VSOMEIP_MAX_LOCAL_MESSAGE_SIZE;
+ if (VSOMEIP_MAX_TCP_MESSAGE_SIZE > its_max_message_size)
+ its_max_message_size = VSOMEIP_MAX_TCP_MESSAGE_SIZE;
+ if (VSOMEIP_MAX_UDP_MESSAGE_SIZE > its_max_message_size)
+ its_max_message_size = VSOMEIP_MAX_UDP_MESSAGE_SIZE;
+
+ serializer_->create_data(its_max_message_size);
+
+ std::string its_sender_path(VSOMEIP_ROUTING_BASE_PATH + VSOMEIP_ROUTING_ENDPOINT);
+ sender_ = std::make_shared< local_client_endpoint_impl >(
+ shared_from_this(),
+ boost::asio::local::stream_protocol::endpoint(its_sender_path),
+ io_);
+
+ std::stringstream its_client;
+ its_client << VSOMEIP_ROUTING_BASE_PATH << std::hex << client_;
+
+ ::unlink(its_client.str().c_str());
+ receiver_ = std::make_shared< local_server_endpoint_impl >(
+ shared_from_this(),
+ boost::asio::local::stream_protocol::endpoint(its_client.str()),
+ io_);
+
+ VSOMEIP_DEBUG << "Routing to " << its_sender_path;
+ VSOMEIP_DEBUG << "Listening at " << its_client.str();
+}
+
+void routing_manager_proxy::start() {
+ if (sender_)
+ sender_->start();
+
+ if (receiver_)
+ receiver_->start();
+
+ // Tell the stub where to find us
+ register_application();
+}
+
+void routing_manager_proxy::stop() {
+ // Tell the stub we are no longer active
+ deregister_application();
+
+ receiver_->stop();
+
+ std::stringstream its_client;
+ its_client << VSOMEIP_ROUTING_BASE_PATH << std::hex << client_;
+ ::unlink(its_client.str().c_str());
+}
+
+void routing_manager_proxy::offer_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) {
+
+ byte_t its_command[VSOMEIP_OFFER_SERVICE_COMMAND_SIZE];
+ uint32_t its_size = VSOMEIP_OFFER_SERVICE_COMMAND_SIZE - VSOMEIP_COMMAND_HEADER_SIZE;
+
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_OFFER_SERVICE;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_CLIENT_POS], &client_, sizeof(client_));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &its_size, sizeof(its_size));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS], &_service, sizeof(_service));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+2], &_instance, sizeof(_instance));
+ its_command[VSOMEIP_COMMAND_PAYLOAD_POS+4] = _major;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+5], &_minor, sizeof(_minor));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+9], &_ttl, sizeof(_ttl));
+
+ if (sender_)
+ sender_->send(its_command, sizeof(its_command));
+}
+
+void routing_manager_proxy::stop_offer_service(client_t _client,
+ service_t _service, instance_t _instance) {
+
+ byte_t its_command[VSOMEIP_STOP_OFFER_SERVICE_COMMAND_SIZE];
+ uint32_t its_size = VSOMEIP_STOP_OFFER_SERVICE_COMMAND_SIZE - VSOMEIP_COMMAND_HEADER_SIZE;
+
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_STOP_OFFER_SERVICE;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_CLIENT_POS], &client_, sizeof(client_));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &its_size, sizeof(its_size));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS], &_service, sizeof(_service));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+2], &_instance, sizeof(_instance));
+
+ if (sender_)
+ sender_->send(its_command, sizeof(its_command));
+}
+
+void routing_manager_proxy::publish_eventgroup(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ major_version_t _major, ttl_t _ttl) {
+
+ byte_t its_command[VSOMEIP_PUBLISH_EVENTGROUP_COMMAND_SIZE];
+ uint32_t its_size = VSOMEIP_PUBLISH_EVENTGROUP_COMMAND_SIZE - VSOMEIP_COMMAND_HEADER_SIZE;
+
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_PUBLISH_EVENTGROUP;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_CLIENT_POS], &client_, sizeof(client_));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &its_size, sizeof(its_size));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS], &_service, sizeof(_service));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+2], &_instance, sizeof(_instance));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+4], &_eventgroup, sizeof(_eventgroup));
+ its_command[VSOMEIP_COMMAND_PAYLOAD_POS+6] = _major;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+7], &_ttl, sizeof(_ttl));
+
+ if (sender_)
+ sender_->send(its_command, sizeof(its_command));
+}
+
+void routing_manager_proxy::stop_publish_eventgroup(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+ byte_t its_command[VSOMEIP_STOP_PUBLISH_EVENTGROUP_COMMAND_SIZE];
+ uint32_t its_size = VSOMEIP_STOP_PUBLISH_EVENTGROUP_COMMAND_SIZE - VSOMEIP_COMMAND_HEADER_SIZE;
+
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_PUBLISH_EVENTGROUP;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_CLIENT_POS], &client_, sizeof(client_));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &its_size, sizeof(its_size));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS], &_service, sizeof(_service));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+2], &_instance, sizeof(_instance));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+4], &_eventgroup, sizeof(_eventgroup));
+
+ if (sender_)
+ sender_->send(its_command, sizeof(its_command));
+}
+
+void routing_manager_proxy::add_event(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ event_t _event) {
+}
+
+void routing_manager_proxy::add_field(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ event_t _event, std::vector< byte_t > &_value) {
+}
+
+void routing_manager_proxy::remove_event_or_field(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup,
+ event_t _event) {
+}
+
+void routing_manager_proxy::request_service(client_t _client,
+ service_t _service, instance_t _instance,
+ major_version_t _major, minor_version_t _minor, ttl_t _ttl) {
+}
+
+void routing_manager_proxy::release_service(client_t _client,
+ service_t _service, instance_t _instance) {
+}
+
+void routing_manager_proxy::subscribe(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+}
+
+void routing_manager_proxy::unsubscribe(client_t _client,
+ service_t _service, instance_t _instance, eventgroup_t _eventgroup) {
+}
+
+void routing_manager_proxy::send(client_t its_client,
+ std::shared_ptr< message > _message,
+ bool _flush, bool _reliable) {
+ std::unique_lock< std::mutex > its_lock(serialize_mutex_);
+ if (serializer_->serialize(_message.get())) {
+ send(its_client, serializer_->get_data(), serializer_->get_size(), _message->get_instance(), _flush, _reliable);
+ serializer_->reset();
+ }
+}
+
+void routing_manager_proxy::send(client_t _client,
+ const byte_t *_data, length_t _size,
+ instance_t _instance,
+ bool _flush, bool _reliable) {
+ endpoint *its_target(0);
+
+ if (_size > VSOMEIP_MESSAGE_TYPE_POS) {
+ if (is_request(_data[VSOMEIP_MESSAGE_TYPE_POS])) {
+ service_t its_service = VSOMEIP_BYTES_TO_WORD(_data[VSOMEIP_SERVICE_POS_MIN], _data[VSOMEIP_SERVICE_POS_MAX]);
+ std::unique_lock< std::mutex > its_lock(send_mutex_);
+ its_target = find_local(its_service, _instance);
+ } else {
+ client_t its_client = VSOMEIP_BYTES_TO_WORD(_data[VSOMEIP_CLIENT_POS_MIN], _data[VSOMEIP_CLIENT_POS_MAX]);
+ std::unique_lock< std::mutex > its_lock(send_mutex_);
+ its_target = find_local(its_client);
+ }
+
+ // If no direct endpoint could be found, route to stub
+ if (!its_target)
+ its_target = sender_.get();
+
+ std::vector< byte_t > its_command(VSOMEIP_COMMAND_HEADER_SIZE + _size +
+ sizeof(instance_t) + sizeof(bool) + sizeof(bool));
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_SEND;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_CLIENT_POS], &_client, sizeof(client_t));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &_size, sizeof(_size));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS], _data, _size);
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS + _size], &_instance, sizeof(instance_t));
+ its_command[VSOMEIP_COMMAND_PAYLOAD_POS + _size + sizeof(instance_t)] = _flush;
+ its_command[VSOMEIP_COMMAND_PAYLOAD_POS + _size + sizeof(instance_t) + sizeof(bool)] = _reliable;
+
+#if 0
+ std::cout << "rmp:send: ";
+ for (int i = 0; i < its_command.size(); i++)
+ std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)its_command[i] << " ";
+ std::cout << std::endl;
+#endif
+
+ its_target->send(&its_command[0], its_command.size());
+ }
+}
+
+void routing_manager_proxy::set(client_t _client,
+ service_t _service, instance_t _instance,
+ event_t _event, const std::vector< byte_t > &_value) {
+}
+
+void routing_manager_proxy::on_register_application(client_t _client) {
+}
+
+void routing_manager_proxy::on_deregister_application(client_t _client) {
+}
+
+void routing_manager_proxy::on_message(
+ const byte_t *_data, length_t _size, endpoint *_receiver) {
+#if 0
+ std::cout << "rmp::on_message: ";
+ for (int i = 0; i < _size; ++i)
+ std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)_data[i] << " ";
+ std::cout << std::endl;
+#endif
+
+ byte_t its_command;
+ client_t its_client;
+ length_t its_length;
+
+ if (_size > VSOMEIP_COMMAND_SIZE_POS_MAX) {
+ its_command = _data[VSOMEIP_COMMAND_TYPE_POS];
+ std::memcpy(&its_client, &_data[VSOMEIP_COMMAND_CLIENT_POS], sizeof(its_client));
+ std::memcpy(&its_length, &_data[VSOMEIP_COMMAND_SIZE_POS_MIN], sizeof(its_length));
+
+ switch (its_command) {
+ case VSOMEIP_SEND:
+ {
+ instance_t its_instance;
+ std::memcpy(&its_instance,
+ &_data[_size - sizeof(instance_t) - sizeof(bool) - sizeof(bool)],
+ sizeof(instance_t));
+ deserializer_->set_data(&_data[VSOMEIP_COMMAND_PAYLOAD_POS], its_length);
+ std::shared_ptr< message > its_message(deserializer_->deserialize_message());
+ if (its_message) {
+ its_message->set_instance(its_instance);
+ host_->on_message(its_message);
+ } else {
+ // TODO: send_error(return_code_e::E_MALFORMED_MESSAGE);
+ }
+ deserializer_->reset();
+ }
+ break;
+
+ case VSOMEIP_ROUTING_INFO:
+ on_routing_info(&_data[VSOMEIP_COMMAND_PAYLOAD_POS], its_length);
+ break;
+
+ case VSOMEIP_PING:
+ send_pong();
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+void routing_manager_proxy::on_routing_info(const byte_t *_data, uint32_t _size) {
+#if 1
+ std::cout << "rmp::on_routing_info: ";
+ for (int i = 0; i < _size; ++i)
+ std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)_data[i] << " ";
+ std::cout << std::endl;
+#endif
+
+ std::map< service_t, std::map< instance_t, client_t > > old_local_services
+ = local_services_;
+ local_services_.clear();
+
+ uint32_t i = 0;
+ while (i + sizeof(uint32_t) <= _size) {
+ uint32_t its_client_size;
+ std::memcpy(&its_client_size, &_data[i], sizeof(uint32_t));
+ i += sizeof(uint32_t);
+
+ if (i + sizeof(client_t) <= _size) {
+ client_t its_client;
+ std::memcpy(&its_client, &_data[i], sizeof(client_t));
+ i += sizeof(client_t);
+
+ if (its_client != client_) {
+ (void)find_or_create_local(its_client);
+ }
+
+ if (i + sizeof(uint32_t) <= _size) {
+ uint32_t its_services_size;
+ std::memcpy(&its_services_size, &_data[i], sizeof(uint32_t));
+ i += sizeof(uint32_t);
+
+ uint32_t j = 0;
+ while (j + sizeof(service_t) + sizeof(instance_t) <= its_services_size) {
+ service_t its_service;
+ std::memcpy(&its_service, &_data[i+j], sizeof(service_t));
+ j += sizeof(service_t);
+
+ instance_t its_instance;
+ std::memcpy(&its_instance, &_data[i+j], sizeof(instance_t));
+ j += sizeof(instance_t);
+
+ if (its_client != client_)
+ local_services_[its_service][its_instance] = its_client;
+
+ host_->on_availability(its_service, its_instance, true);
+ }
+
+ i += its_services_size;
+ }
+ }
+ }
+
+ // Check for services that are no longer available
+ for (auto i : old_local_services) {
+ auto found_service = local_services_.find(i.first);
+ if (found_service != local_services_.end()) {
+ for (auto j : i.second) {
+ auto found_instance = found_service->second.find(j.first);
+ if (found_instance == found_service->second.end()) {
+ host_->on_availability(i.first, j.first, false);
+ }
+ }
+ } else {
+ for (auto j : i.second) {
+ host_->on_availability(i.first, j.first, false);
+ }
+ }
+ }
+
+ // Check for services that are newly available
+ for (auto i : local_services_) {
+ auto found_service = old_local_services.find(i.first);
+ if (found_service != old_local_services.end()) {
+ for (auto j : i.second) {
+ auto found_instance = found_service->second.find(j.first);
+ if (found_instance == found_service->second.end()) {
+ host_->on_availability(i.first, j.first, true);
+ }
+ }
+ } else {
+ for (auto j : i.second) {
+ host_->on_availability(i.first, j.first, true);
+ }
+ }
+ }
+}
+
+void routing_manager_proxy::register_application() {
+ byte_t its_command[] = {
+ VSOMEIP_REGISTER_APPLICATION,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00
+ };
+
+ std::memcpy(&its_command[VSOMEIP_COMMAND_CLIENT_POS], &client_, sizeof(client_));
+ std::memset(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], 0, sizeof(uint32_t));
+
+ if (sender_)
+ sender_->send(its_command, sizeof(its_command));
+}
+
+void routing_manager_proxy::deregister_application() {
+ uint32_t its_size = sizeof(client_);
+
+ std::vector< byte_t > its_command(VSOMEIP_COMMAND_HEADER_SIZE + its_size);
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_DEREGISTER_APPLICATION;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_CLIENT_POS], &client_, sizeof(client_));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &its_size, sizeof(its_size));
+ if (sender_)
+ sender_->send(&its_command[0], its_command.size());
+}
+
+
+endpoint * routing_manager_proxy::find_local(client_t _client) {
+ endpoint *its_endpoint(0);
+ auto found_endpoint = local_endpoints_.find(_client);
+ if (found_endpoint != local_endpoints_.end()) {
+ its_endpoint = found_endpoint->second.get();
+ }
+ return its_endpoint;
+}
+
+endpoint * routing_manager_proxy::create_local(client_t _client) {
+ std::stringstream its_path;
+ its_path << VSOMEIP_ROUTING_BASE_PATH << std::hex << _client;
+
+ VSOMEIP_DEBUG << "Connecting to [" << std::hex << _client
+ << "] at " << its_path.str();
+
+ std::shared_ptr< endpoint > its_endpoint
+ = std::make_shared< local_client_endpoint_impl >(
+ shared_from_this(),
+ boost::asio::local::stream_protocol::endpoint(its_path.str()),
+ io_);
+
+ local_endpoints_[_client] = its_endpoint;
+ its_endpoint->start();
+
+ return its_endpoint.get();
+}
+
+endpoint * routing_manager_proxy::find_or_create_local(client_t _client) {
+ endpoint *its_endpoint(find_local(_client));
+ if (0 == its_endpoint) {
+ its_endpoint = create_local(_client);
+ }
+ return its_endpoint;
+}
+
+void routing_manager_proxy::remove_local(client_t _client) {
+ endpoint *its_endpoint = find_local(_client);
+ if (its_endpoint)
+ its_endpoint->stop();
+ local_endpoints_.erase(_client);
+}
+
+endpoint * routing_manager_proxy::find_local(service_t _service, instance_t _instance) {
+ client_t its_client(0);
+ auto found_service = local_services_.find(_service);
+ if (found_service != local_services_.end()) {
+ auto found_instance = found_service->second.find(_instance);
+ if (found_instance != found_service->second.end()) {
+ its_client = found_instance->second;
+ }
+ }
+ return find_local(its_client);
+}
+
+bool routing_manager_proxy::is_request(byte_t _message_type) const {
+ message_type_e its_type = static_cast< message_type_e >(_message_type);
+ return (its_type < message_type_e::NOTIFICATION ||
+ its_type == message_type_e::REQUEST_ACK ||
+ its_type == message_type_e::REQUEST_NO_RETURN_ACK);
+}
+
+void routing_manager_proxy::send_pong() const {
+ byte_t its_pong[] = {
+ VSOMEIP_PONG,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ };
+
+ std::memcpy(&its_pong[VSOMEIP_COMMAND_CLIENT_POS], &client_, sizeof(client_t));
+
+ if (sender_)
+ sender_->send(its_pong, sizeof(its_pong));
+}
+
+} // namespace vsomeip
diff --git a/implementation/routing/src/routing_manager_stub.cpp b/implementation/routing/src/routing_manager_stub.cpp
new file mode 100644
index 0000000..cd3262d
--- /dev/null
+++ b/implementation/routing/src/routing_manager_stub.cpp
@@ -0,0 +1,352 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <chrono>
+#include <functional>
+#include <iomanip>
+
+#include <boost/system/error_code.hpp>
+
+#include <vsomeip/constants.hpp>
+#include <vsomeip/logger.hpp>
+#include <vsomeip/primitive_types.hpp>
+
+#include "../include/routing_manager.hpp"
+#include "../include/routing_manager_stub.hpp"
+#include "../../configuration/include/internal.hpp"
+#include "../../endpoints/include/local_server_endpoint_impl.hpp"
+
+namespace vsomeip {
+
+routing_manager_stub::routing_manager_stub(routing_manager *_routing)
+ : routing_(_routing), io_(_routing->get_io()), watchdog_timer_(_routing->get_io()) {
+}
+
+routing_manager_stub::~routing_manager_stub() {
+}
+
+void routing_manager_stub::init() {
+ std::string its_endpoint_path(VSOMEIP_ROUTING_BASE_PATH + VSOMEIP_ROUTING_ENDPOINT);
+ ::unlink(its_endpoint_path.c_str());
+ VSOMEIP_DEBUG << "Routing endpoint at " << its_endpoint_path;
+ endpoint_ = std::make_shared< local_server_endpoint_impl >(
+ shared_from_this(),
+ boost::asio::local::stream_protocol::endpoint(its_endpoint_path),
+ io_
+ );
+}
+
+void routing_manager_stub::start() {
+ endpoint_->start();
+
+ // Start watchdog (TODO: only if configured)
+ start_watchdog();
+}
+
+void routing_manager_stub::stop() {
+ watchdog_timer_.cancel();
+ endpoint_->stop();
+
+ std::string its_endpoint_path(VSOMEIP_ROUTING_BASE_PATH + VSOMEIP_ROUTING_ENDPOINT);
+ ::unlink(its_endpoint_path.c_str());
+}
+
+routing_manager * routing_manager_stub::get_manager() {
+ return routing_;
+}
+
+void routing_manager_stub::on_message(const byte_t *_data, length_t _size, endpoint *_receiver) {
+#if 0
+ std::cout << "rms::on_message: ";
+ for (int i = 0; i < _size; ++i)
+ std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)_data[i] << " ";
+ std::cout << std::endl;
+#endif
+
+ if (VSOMEIP_COMMAND_SIZE_POS_MAX < _size) {
+ byte_t its_command;
+ client_t its_client;
+ std::string its_client_endpoint;
+ service_t its_service;
+ instance_t its_instance;
+ eventgroup_t its_eventgroup;
+ event_t its_event;
+ major_version_t its_major;
+ minor_version_t its_minor;
+ ttl_t its_ttl;
+ std::vector< byte_t > its_value;
+ const byte_t *its_data;
+ uint32_t its_size;
+ bool its_reliable;
+ bool its_flush;
+
+ its_command = _data[VSOMEIP_COMMAND_TYPE_POS];
+ std::memcpy(&its_client, &_data[VSOMEIP_COMMAND_CLIENT_POS], sizeof(its_client));
+ std::memcpy(&its_size, &_data[VSOMEIP_COMMAND_SIZE_POS_MIN], sizeof(its_size));
+
+ if (its_size <= _size - VSOMEIP_COMMAND_HEADER_SIZE) {
+ switch (its_command) {
+ case VSOMEIP_REGISTER_APPLICATION:
+ (void)routing_->find_or_create_local(its_client);
+ routing_info_[its_client].first = 0;
+ broadcast_routing_info();
+ VSOMEIP_DEBUG << "Application/Client " << its_client << " got registered!";
+ break;
+
+ case VSOMEIP_DEREGISTER_APPLICATION:
+ on_deregister_application(its_client);
+ VSOMEIP_DEBUG << "Application/Client " << its_client << " got deregistered!";
+ break;
+
+ case VSOMEIP_PONG:
+ on_pong(its_client);
+ break;
+
+ case VSOMEIP_OFFER_SERVICE:
+ std::memcpy(&its_service, &_data[VSOMEIP_COMMAND_PAYLOAD_POS], sizeof(its_service));
+ std::memcpy(&its_instance, &_data[VSOMEIP_COMMAND_PAYLOAD_POS+2], sizeof(its_instance));
+ std::memcpy(&its_major, &_data[VSOMEIP_COMMAND_PAYLOAD_POS+4], sizeof(its_major));
+ std::memcpy(&its_minor, &_data[VSOMEIP_COMMAND_PAYLOAD_POS+5], sizeof(its_minor));
+ std::memcpy(&its_ttl, &_data[VSOMEIP_COMMAND_PAYLOAD_POS+9], sizeof(its_ttl));
+ routing_->offer_service(its_client, its_service, its_instance, its_major, its_minor, its_ttl);
+ on_offer_service(its_client, its_service, its_instance);
+ break;
+
+ case VSOMEIP_STOP_OFFER_SERVICE:
+ std::memcpy(&its_service, &_data[VSOMEIP_COMMAND_PAYLOAD_POS], sizeof(its_service));
+ std::memcpy(&its_instance, &_data[VSOMEIP_COMMAND_PAYLOAD_POS+2], sizeof(its_instance));
+ routing_->stop_offer_service(its_client, its_service, its_instance);
+ on_stop_offer_service(its_client, its_service, its_instance);
+ break;
+
+ case VSOMEIP_PUBLISH_EVENTGROUP:
+ routing_->publish_eventgroup(its_client, its_service, its_instance, its_eventgroup, its_major, its_ttl);
+ break;
+
+ case VSOMEIP_STOP_PUBLISH_EVENTGROUP:
+ routing_->stop_publish_eventgroup(its_client, its_service, its_instance, its_eventgroup);
+ break;
+
+ case VSOMEIP_ADD_EVENT:
+ routing_->add_event(its_client, its_service, its_instance, its_eventgroup, its_event);
+ break;
+
+ case VSOMEIP_REMOVE_EVENT_OR_FIELD:
+ routing_->remove_event_or_field(its_client, its_service, its_instance, its_eventgroup, its_event);
+ break;
+
+ case VSOMEIP_ADD_FIELD:
+ routing_->add_field(its_client, its_service, its_instance, its_eventgroup, its_event, its_value);
+ break;
+
+ case VSOMEIP_SEND:
+ its_data = &_data[VSOMEIP_COMMAND_PAYLOAD_POS];
+ std::memcpy(&its_instance, &_data[_size-4], sizeof(its_instance));
+ its_flush = static_cast< bool >(_data[_size-2]);
+ its_reliable = static_cast< bool >(_data[_size-1]);
+ routing_->send(its_client, its_data, its_size, its_instance, its_flush, its_reliable);
+ break;
+
+ case VSOMEIP_SET:
+ routing_->set(its_client, its_service, its_instance, its_event, its_value);
+ break;
+ }
+ }
+ }
+}
+
+void routing_manager_stub::on_register_application(client_t _client) {
+
+}
+
+void routing_manager_stub::on_deregister_application(client_t _client) {
+ auto its_info = routing_info_.find(_client);
+ if (its_info != routing_info_.end()) {
+ for (auto &its_service : its_info->second.second) {
+ for (auto &its_instance : its_service.second) {
+ routing_->stop_offer_service(_client, its_service.first, its_instance);
+ }
+ }
+ }
+
+ routing_->remove_local(_client);
+ routing_info_.erase(_client);
+ broadcast_routing_info();
+}
+
+void routing_manager_stub::on_offer_service(
+ client_t _client, service_t _service, instance_t _instance) {
+
+ routing_info_[_client].second[_service].insert(_instance);
+ broadcast_routing_info();
+}
+
+void routing_manager_stub::on_stop_offer_service(
+ client_t _client, service_t _service, instance_t _instance) {
+ auto found_client = routing_info_.find(_client);
+ if (found_client != routing_info_.end()) {
+ auto found_service = found_client->second.second.find(_service);
+ if (found_service != found_client->second.second.end()) {
+ auto found_instance = found_service->second.find(_instance);
+ if (found_instance != found_service->second.end()) {
+ found_service->second.erase(_instance);
+ broadcast_routing_info();
+ }
+ }
+ }
+}
+
+void routing_manager_stub::send_routing_info(client_t _client) {
+ endpoint *its_endpoint = routing_->find_local(_client);
+ if (0 != its_endpoint) {
+ uint32_t its_capacity = 4096; // TODO: dynamic resizing
+ std::vector< byte_t > its_command(its_capacity);
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_ROUTING_INFO;
+ std::memset(&its_command[VSOMEIP_COMMAND_CLIENT_POS], 0, sizeof(client_t));
+ uint32_t its_size = VSOMEIP_COMMAND_PAYLOAD_POS;
+ for (auto &info : routing_info_) {
+ uint32_t its_size_pos = its_size;
+ uint32_t its_entry_size = its_size;
+
+ its_size += sizeof(uint32_t); // placeholder
+
+ std::memcpy(&its_command[its_size], &info.first, sizeof(client_t));
+ its_size += sizeof(client_t);
+
+ for (auto &service : info.second.second) {
+ uint32_t its_service_entry_size = sizeof(service_t) + service.second.size() * sizeof(instance_t);
+
+ std::memcpy(&its_command[its_size], &its_service_entry_size, sizeof(uint32_t));
+ its_size += sizeof(uint32_t);
+
+ std::memcpy(&its_command[its_size], &service.first, sizeof(service_t));
+ its_size += sizeof(service_t);
+
+ for (auto &instance : service.second) {
+ std::memcpy(&its_command[its_size], &instance, sizeof(instance_t));
+ its_size += sizeof(instance_t);
+ }
+ }
+
+ its_entry_size = its_size - its_entry_size - sizeof(uint32_t);
+ std::memcpy(&its_command[its_size_pos], &its_entry_size, sizeof(uint32_t));
+ }
+
+ its_size -= VSOMEIP_COMMAND_PAYLOAD_POS;
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &its_size, sizeof(its_size));
+ its_size += VSOMEIP_COMMAND_PAYLOAD_POS;
+#if 0
+ std::cout << "rms::send_routing_info ";
+ for (int i = 0; i < its_size; ++i)
+ std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)its_command[i] << " ";
+ std::cout << std::endl;
+#endif
+ its_endpoint->send(&its_command[0], its_size, true);
+ }
+}
+
+void routing_manager_stub::broadcast_routing_info() {
+ for (auto& info : routing_info_) {
+ send_routing_info(info.first);
+ }
+}
+
+void routing_manager_stub::broadcast(std::vector< byte_t > &_command) const {
+ for (auto a : routing_info_) {
+ endpoint *its_endpoint = routing_->find_local(a.first);
+ if (its_endpoint) {
+ its_endpoint->send(&_command[0], _command.size(), true);
+ }
+ }
+}
+
+// Watchdog
+void routing_manager_stub::broadcast_ping() const {
+ const byte_t its_ping[] = {
+ VSOMEIP_PING,
+ 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ };
+
+ std::vector< byte_t > its_command(sizeof(its_ping));
+ its_command.assign(its_ping, its_ping + sizeof(its_ping));
+ broadcast(its_command);
+}
+
+void routing_manager_stub::on_pong(client_t _client) {
+ auto found_info = routing_info_.find(_client);
+ if (found_info != routing_info_.end()) {
+ found_info->second.first = 0;
+ } else {
+ std::cerr << "Received PONG from unregistered application!" << std::endl;
+ }
+}
+
+void routing_manager_stub::start_watchdog() {
+ watchdog_timer_.expires_from_now(
+ std::chrono::milliseconds(VSOMEIP_DEFAULT_WATCHDOG_CYCLE)); // TODO: use config variable
+
+ std::function< void (boost::system::error_code const &) > its_callback =
+ [this](boost::system::error_code const &_error) {
+ if (!_error)
+ check_watchdog();
+ };
+
+ watchdog_timer_.async_wait(its_callback);
+}
+
+void routing_manager_stub::check_watchdog() {
+ for (auto i = routing_info_.begin(); i != routing_info_.end(); ++i) {
+ i->second.first++;
+ }
+ broadcast_ping();
+
+ watchdog_timer_.expires_from_now(
+ std::chrono::milliseconds(VSOMEIP_DEFAULT_WATCHDOG_TIMEOUT)); // TODO: use config variable
+
+ std::function< void (boost::system::error_code const &) > its_callback =
+ [this](boost::system::error_code const &_error) {
+ std::list< client_t > lost;
+
+ for (auto i : routing_info_) {
+ if (i.second.first > VSOMEIP_DEFAULT_MAX_MISSING_PONGS) { // TODO: use config variable
+ VSOMEIP_WARNING << "Lost contact to application " << std::hex << (int)i.first;
+ lost.push_back(i.first);
+
+ }
+ }
+
+ for (auto i : lost) {
+ routing_info_.erase(i);
+ }
+
+ if (0 < lost.size())
+ send_application_lost(lost);
+
+ start_watchdog();
+ };
+
+ watchdog_timer_.async_wait(its_callback);
+}
+
+void routing_manager_stub::send_application_lost(std::list< client_t > &_lost) {
+ uint32_t its_size = _lost.size() * sizeof(client_t);
+ std::vector< byte_t > its_command(VSOMEIP_COMMAND_HEADER_SIZE + its_size);
+ its_command[VSOMEIP_COMMAND_TYPE_POS] = VSOMEIP_APPLICATION_LOST;
+ std::memset(&its_command[VSOMEIP_COMMAND_CLIENT_POS], 0, sizeof(client_t));
+ std::memcpy(&its_command[VSOMEIP_COMMAND_SIZE_POS_MIN], &its_size, sizeof(uint32_t));
+
+ uint32_t its_offset = 0;
+ for (auto i : _lost) {
+ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS+its_offset], &i, sizeof(client_t));
+ its_offset += sizeof(client_t);
+ }
+
+ broadcast(its_command);
+}
+
+
+} // namespace vsomeip
diff --git a/implementation/service_discovery/include/configuration_option_impl.hpp b/implementation/service_discovery/include/configuration_option_impl.hpp
new file mode 100644
index 0000000..de753a7
--- /dev/null
+++ b/implementation/service_discovery/include/configuration_option_impl.hpp
@@ -0,0 +1,47 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_CONFIGURATION_OPTION_IMPL_HPP
+#define VSOMEIP_SD_CONFIGURATION_OPTION_IMPL_HPP
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "option_impl.hpp"
+
+namespace vsomeip {
+
+class serializer;
+class deserializer;
+
+namespace sd {
+
+class configuration_option_impl: public option_impl {
+
+public:
+ configuration_option_impl();
+ virtual ~configuration_option_impl();
+ bool operator==(const option_impl &_other) const;
+
+ void add_item(const std::string &_key, const std::string &_value);
+ void remove_item(const std::string &_key);
+
+ std::vector<std::string> get_keys() const;
+ std::vector<std::string> get_values() const;
+ std::string get_value(const std::string &_key) const;
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+private:
+ std::map< std::string, std::string > configuration_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_CONFIGURATION_OPTION_IMPL_HPP
diff --git a/implementation/service_discovery/include/constants.hpp b/implementation/service_discovery/include/constants.hpp
new file mode 100644
index 0000000..412c39d
--- /dev/null
+++ b/implementation/service_discovery/include/constants.hpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_CONSTANTS_HPP
+#define VSOMEIP_SD_CONSTANTS_HPP
+
+#include <vsomeip/enumeration_types.hpp>
+#include <vsomeip/primitive_types.hpp>
+
+namespace vsomeip {
+namespace sd {
+
+const service_t VSOMEIP_SERVICE_DISCOVERY_SERVICE = 0xFFFF;
+const instance_t VSOMEIP_SERVICE_DISCOVERY_INSTANCE = 0x0000;
+const method_t VSOMEIP_SERVICE_DISCOVERY_METHOD = 0x8100;
+const client_t VSOMEIP_SERVICE_DISCOVERY_CLIENT = 0x0000;
+const protocol_version_t VSOMEIP_SERVICE_DISCOVERY_PROTOCOL_VERSION = 0x01;
+const interface_version_t VSOMEIP_SERVICE_DISCOVERY_INTERFACE_VERSION = 0x01;
+const message_type_e VSOMEIP_SERVICE_DISCOVERY_MESSAGE_TYPE = message_type_e::NOTIFICATION;
+const return_code_e VSOMEIP_SERVICE_DISCOVERY_RETURN_CODE = return_code_e::E_OK;
+
+} // namespace sd
+
+namespace protocol {
+
+const uint8_t reserved_byte = 0x0;
+const uint16_t reserved_word = 0x0;
+const uint32_t reserved_long = 0x0;
+
+} // namespace protocol
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_CONSTANTS_HPP
diff --git a/implementation/service_discovery/include/defines.hpp b/implementation/service_discovery/include/defines.hpp
new file mode 100644
index 0000000..ae15416
--- /dev/null
+++ b/implementation/service_discovery/include/defines.hpp
@@ -0,0 +1,14 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_DEFINES_HPP
+#define VSOMEIP_SD_DEFINES_HPP
+
+#define VSOMEIP_SOMEIP_SD_DATA_SIZE 12
+#define VSOMEIP_SOMEIP_SD_ENTRY_SIZE 16
+#define VSOMEIP_SOMEIP_SD_OPTION_HEADER_SIZE 3
+
+#endif // VSOMEIP_SD_DEFINES_HPP
diff --git a/implementation/service_discovery/include/deserializer.hpp b/implementation/service_discovery/include/deserializer.hpp
new file mode 100755
index 0000000..d6f3312
--- /dev/null
+++ b/implementation/service_discovery/include/deserializer.hpp
@@ -0,0 +1,31 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_DESERIALIZER_HPP
+#define VSOMEIP_SD_DESERIALIZER_HPP
+
+#include "../../message/include/deserializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class message_impl;
+
+class deserializer
+ : public vsomeip::deserializer {
+public:
+ deserializer();
+ deserializer(uint8_t *_data, std::size_t _length);
+ deserializer(const deserializer &_other);
+ virtual ~deserializer();
+
+ message_impl * deserialize_sd_message();
+};
+
+} // namespace sd
+} // vsomeip
+
+#endif // VSOMEIP_SD_DESERIALIZER_HPP
diff --git a/implementation/service_discovery/include/entry_impl.hpp b/implementation/service_discovery/include/entry_impl.hpp
new file mode 100755
index 0000000..b544230
--- /dev/null
+++ b/implementation/service_discovery/include/entry_impl.hpp
@@ -0,0 +1,75 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_ENTRY_IMPL_HPP
+#define VSOMEIP_SD_ENTRY_IMPL_HPP
+
+#include <vector>
+
+#include <vsomeip/primitive_types.hpp>
+#include <vsomeip/serializable.hpp>
+
+#include "enumeration_types.hpp"
+#include "message_element_impl.hpp"
+
+#define VSOMEIP_MAX_OPTION_RUN 2
+
+namespace vsomeip {
+
+class deserializer;
+
+namespace sd {
+
+class option_impl;
+class message_impl;
+
+class entry_impl: public message_element_impl {
+public:
+ virtual ~entry_impl();
+
+ // public interface
+ entry_type_e get_type() const;
+
+ service_t get_service() const;
+ void set_service(service_t _service);
+
+ instance_t get_instance() const;
+ void set_instance(instance_t _instance);
+
+ major_version_t get_major_version() const;
+ void set_major_version(major_version_t _version);
+
+ ttl_t get_ttl() const;
+ void set_ttl(ttl_t _ttl);
+
+ const std::vector< uint8_t > & get_options(uint8_t _run) const;
+ void assign_option(const option_impl &_option, uint8_t _run);
+
+ bool is_service_entry() const;
+ bool is_eventgroup_entry() const;
+
+ void set_type(entry_type_e _type);
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+protected:
+ entry_type_e type_;
+ service_t service_;
+ instance_t instance_;
+ major_version_t major_version_;
+ ttl_t ttl_;
+
+ std::vector< uint8_t > options_[VSOMEIP_MAX_OPTION_RUN];
+
+ entry_impl();
+ entry_impl(const entry_impl &entry_);
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_ENTRY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip/sd/enumeration_types.hpp b/implementation/service_discovery/include/enumeration_types.hpp
index d7ce5a4..b2f7414 100644
--- a/vsomeip/include/vsomeip/sd/enumeration_types.hpp
+++ b/implementation/service_discovery/include/enumeration_types.hpp
@@ -1,47 +1,44 @@
-//
-// enumeration_types.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_ENUMERATION_TYPES_HPP
-#define VSOMEIP_SD_ENUMERATION_TYPES_HPP
-
-#include <cstdint>
-
-namespace vsomeip {
-namespace sd {
-
-enum class option_type : uint8_t {
- CONFIGURATION = 0x1,
- LOAD_BALANCING = 0x2,
- PROTECTION = 0x3,
- IP4_ENDPOINT = 0x4,
- IP6_ENDPOINT = 0x6,
- IP4_MULTICAST = 0x14,
- IP6_MULTICAST = 0x16,
- UNKNOWN = 0xFF
-};
-
-enum class entry_type : uint8_t {
- FIND_SERVICE = 0x00,
- OFFER_SERVICE = 0x01,
- STOP_OFFER_SERVICE = 0x01,
- REQUEST_SERVICE = 0x2,
- FIND_EVENT_GROUP = 0x4,
- PUBLISH_EVENTGROUP = 0x5,
- STOP_PUBLISH_EVENTGROUP = 0x5,
- SUBSCRIBE_EVENTGROUP = 0x06,
- STOP_SUBSCRIBE_EVENTGROUP = 0x06,
- SUBSCRIBE_EVENTGROUP_ACK = 0x07,
- STOP_SUBSCRIBE_EVENTGROUP_ACK = 0x07,
- UNKNOWN = 0xFF
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_ENUMERATION_TYPES_HPP
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <cstdint>
+
+#ifndef VSOMEIP_SD_ENUMERATION_TYPES_HPP
+#define VSOMEIP_SD_ENUMERATION_TYPES_HPP
+
+namespace vsomeip {
+namespace sd {
+
+enum class option_type_e : uint8_t {
+ CONFIGURATION = 0x1,
+ LOAD_BALANCING = 0x2,
+ PROTECTION = 0x3,
+ IP4_ENDPOINT = 0x4,
+ IP6_ENDPOINT = 0x6,
+ IP4_MULTICAST = 0x14,
+ IP6_MULTICAST = 0x16,
+ UNKNOWN = 0xFF
+};
+
+enum class entry_type_e : uint8_t {
+ FIND_SERVICE = 0x00,
+ OFFER_SERVICE = 0x01,
+ STOP_OFFER_SERVICE = 0x01,
+ REQUEST_SERVICE = 0x2,
+ FIND_EVENT_GROUP = 0x4,
+ PUBLISH_EVENTGROUP = 0x5,
+ STOP_PUBLISH_EVENTGROUP = 0x5,
+ SUBSCRIBE_EVENTGROUP = 0x06,
+ STOP_SUBSCRIBE_EVENTGROUP = 0x06,
+ SUBSCRIBE_EVENTGROUP_ACK = 0x07,
+ STOP_SUBSCRIBE_EVENTGROUP_ACK = 0x07,
+ UNKNOWN = 0xFF
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_ENUMERATION_TYPES_HPP
diff --git a/implementation/service_discovery/include/eventgroupentry_impl.hpp b/implementation/service_discovery/include/eventgroupentry_impl.hpp
new file mode 100755
index 0000000..9f94cf9
--- /dev/null
+++ b/implementation/service_discovery/include/eventgroupentry_impl.hpp
@@ -0,0 +1,34 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_EVENTGROUPENTRY_IMPL_HPP
+#define VSOMEIP_SD_EVENTGROUPENTRY_IMPL_HPP
+
+#include "entry_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class eventgroupentry_impl: public entry_impl {
+public:
+ eventgroupentry_impl();
+ eventgroupentry_impl(const eventgroupentry_impl &_entry);
+ virtual ~eventgroupentry_impl();
+
+ eventgroup_t get_eventgroup() const;
+ void set_eventgroup(eventgroup_t _eventgroup);
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+private:
+ eventgroup_t eventgroup_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_INTERNAL_SD_EVENTGROUPENTRY_IMPL_HPP
diff --git a/implementation/service_discovery/include/ipv4_option_impl.hpp b/implementation/service_discovery/include/ipv4_option_impl.hpp
new file mode 100644
index 0000000..0d04a49
--- /dev/null
+++ b/implementation/service_discovery/include/ipv4_option_impl.hpp
@@ -0,0 +1,33 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_IPV4_OPTION_IMPL_HPP
+#define VSOMEIP_SD_IPV4_OPTION_IMPL_HPP
+
+#include "option_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class ipv4_option_impl: public option_impl {
+public:
+ ipv4_option_impl(bool _is_multicast);
+ virtual ~ipv4_option_impl();
+ bool operator == (const option_impl &_option) const;
+
+ bool is_multicast() const;
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+protected:
+ // TODO: add endpoint description based on boost classes
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_IPV4_OPTION_IMPL_HPP
diff --git a/implementation/service_discovery/include/ipv6_option_impl.hpp b/implementation/service_discovery/include/ipv6_option_impl.hpp
new file mode 100644
index 0000000..4e11cde
--- /dev/null
+++ b/implementation/service_discovery/include/ipv6_option_impl.hpp
@@ -0,0 +1,32 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_IPV6_OPTION_IMPL_HPP
+#define VSOMEIP_SD_IPV6_OPTION_IMPL_HPP
+
+#include "option_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class ipv6_option_impl: public option_impl {
+public:
+ ipv6_option_impl(bool _is_multicast);
+ virtual ~ipv6_option_impl();
+ bool operator == (const option_impl &_option) const;
+
+ bool is_multicast() const;
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+protected:
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_IPV6_OPTION_IMPL_HPP
diff --git a/implementation/service_discovery/include/load_balancing_option_impl.hpp b/implementation/service_discovery/include/load_balancing_option_impl.hpp
new file mode 100755
index 0000000..4d43f43
--- /dev/null
+++ b/implementation/service_discovery/include/load_balancing_option_impl.hpp
@@ -0,0 +1,39 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_LOAD_BALANCING_OPTION_IMPL_HPP
+#define VSOMEIP_SD_LOAD_BALANCING_OPTION_IMPL_HPP
+
+#include "primitive_types.hpp"
+#include "option_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class load_balancing_option_impl: public option_impl {
+public:
+ load_balancing_option_impl();
+ virtual ~load_balancing_option_impl();
+ bool operator ==(const option_impl &_other) const;
+
+ priority_t get_priority() const;
+ void set_priority(priority_t _priority);
+
+ weight_t get_weight() const;
+ void set_weight(weight_t _weight);
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+private:
+ priority_t priority_;
+ weight_t weight_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_LOAD_BALANCING_OPTION_IMPL_HPP
diff --git a/implementation/service_discovery/include/message_element_impl.hpp b/implementation/service_discovery/include/message_element_impl.hpp
new file mode 100755
index 0000000..ee67563
--- /dev/null
+++ b/implementation/service_discovery/include/message_element_impl.hpp
@@ -0,0 +1,29 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_MESSAGE_ELEMENT_IMPL_HPP
+#define VSOMEIP_SD_MESSAGE_ELEMENT_IMPL_HPP
+
+namespace vsomeip {
+namespace sd {
+
+class message_impl;
+
+class message_element_impl {
+public:
+ message_element_impl();
+
+ message_impl * get_owning_message() const;
+ void set_owning_message(message_impl *_owner);
+
+protected:
+ message_impl *owner_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_MESSAGE_ELEMENT_IMPL_HPP
diff --git a/implementation/service_discovery/include/message_impl.hpp b/implementation/service_discovery/include/message_impl.hpp
new file mode 100755
index 0000000..bad1cd4
--- /dev/null
+++ b/implementation/service_discovery/include/message_impl.hpp
@@ -0,0 +1,75 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_MESSAGE_IMPL_HPP
+#define VSOMEIP_SD_MESSAGE_IMPL_HPP
+
+#include <memory>
+#include <vector>
+
+#include "../include/primitive_types.hpp"
+#include "../../message/include/message_base_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class entry_impl;
+class eventgroupentry_impl;
+class serviceentry_impl;
+
+class option_impl;
+class configuration_option_impl;
+class ipv4_option_impl;
+class ipv6_option_impl;
+class load_balancing_option_impl;
+class protection_option_impl;
+
+class message_impl: public vsomeip::message_base_impl {
+public:
+ message_impl();
+ virtual ~message_impl();
+
+ length_t get_length() const;
+ void set_length(length_t _length);
+
+ bool get_reboot_flag() const;
+ void set_reboot_flag(bool _is_set);
+
+ bool get_unicast_flag() const;
+ void set_unicast_flag(bool _is_set);
+
+ std::shared_ptr< eventgroupentry_impl > create_eventgroup_entry();
+ std::shared_ptr< serviceentry_impl > create_service_entry();
+
+ std::shared_ptr< configuration_option_impl > create_configuration_option();
+ std::shared_ptr< ipv4_option_impl > create_ipv4_option(bool _is_multicast);
+ std::shared_ptr< ipv6_option_impl > create_ipv6_option(bool _is_multicast);
+ std::shared_ptr< load_balancing_option_impl > create_load_balancing_option();
+ std::shared_ptr< protection_option_impl > create_protection_option();
+
+ const std::vector< std::shared_ptr< entry_impl > > get_entries() const;
+ const std::vector< std::shared_ptr< option_impl > > get_options() const;
+
+ int16_t get_option_index(const option_impl &_option) const;
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+private:
+ entry_impl * deserialize_entry(vsomeip::deserializer *_from);
+ option_impl * deserialize_option(vsomeip::deserializer *_from);
+
+private:
+ flags_t flags_;
+
+ std::vector< std::shared_ptr< entry_impl > > entries_;
+ std::vector< std::shared_ptr< option_impl > > options_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_INTERNAL_SD_MESSAGE_IMPL_HPP
diff --git a/implementation/service_discovery/include/option_impl.hpp b/implementation/service_discovery/include/option_impl.hpp
new file mode 100644
index 0000000..59acb5f
--- /dev/null
+++ b/implementation/service_discovery/include/option_impl.hpp
@@ -0,0 +1,45 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_OPTION_IMPL_HPP
+#define VSOMEIP_SD_OPTION_IMPL_HPP
+
+#include <cstdint>
+
+#include "enumeration_types.hpp"
+#include "message_element_impl.hpp"
+
+namespace vsomeip {
+
+class serializer;
+class deserializer;
+
+namespace sd {
+
+class message_impl;
+
+class option_impl: public message_element_impl {
+public:
+ option_impl();
+ virtual ~option_impl();
+
+ virtual bool operator ==(const option_impl &_other) const;
+
+ uint16_t get_length() const;
+ option_type_e get_type() const;
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+protected:
+ uint16_t length_;
+ option_type_e type_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_INTERNAL_SD_OPTION_IMPL_HPP
diff --git a/implementation/service_discovery/include/primitive_types.hpp b/implementation/service_discovery/include/primitive_types.hpp
new file mode 100644
index 0000000..14b6549
--- /dev/null
+++ b/implementation/service_discovery/include/primitive_types.hpp
@@ -0,0 +1,29 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <cstdint>
+
+#ifndef VSOMEIP_SD_PRIMITIVE_TYPES_HPP
+#define VSOMEIP_SD_PRIMITIVE_TYPES_HPP
+
+namespace vsomeip {
+namespace sd {
+
+// Load balancing
+typedef uint16_t priority_t;
+typedef uint16_t weight_t;
+
+// Protection
+typedef uint32_t alive_counter_t;
+typedef uint32_t crc_t;
+
+//
+typedef uint8_t flags_t;
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_PRIMITIVE_TYPES_HPP
diff --git a/implementation/service_discovery/include/protection_option_impl.hpp b/implementation/service_discovery/include/protection_option_impl.hpp
new file mode 100755
index 0000000..5d2dd6b
--- /dev/null
+++ b/implementation/service_discovery/include/protection_option_impl.hpp
@@ -0,0 +1,39 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_PROTECTION_OPTION_IMPL_HPP
+#define VSOMEIP_SD_PROTECTION_OPTION_IMPL_HPP
+
+#include "../include/primitive_types.hpp"
+#include "../include/option_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class protection_option_impl: public option_impl {
+public:
+ protection_option_impl();
+ virtual ~protection_option_impl();
+ virtual bool operator ==(const option_impl &_other) const;
+
+ alive_counter_t get_alive_counter() const;
+ void set_alive_counter(alive_counter_t _counter);
+
+ crc_t get_crc() const;
+ void set_crc(crc_t _crc);
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+private:
+ alive_counter_t counter_;
+ crc_t crc_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_PROTECTION_OPTION_IMPL_HPP
diff --git a/implementation/service_discovery/include/runtime.hpp b/implementation/service_discovery/include/runtime.hpp
new file mode 100644
index 0000000..fe6154f
--- /dev/null
+++ b/implementation/service_discovery/include/runtime.hpp
@@ -0,0 +1,34 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_RUNTIME_HPP
+#define VSOMEIP_SD_RUNTIME_HPP
+
+#include <memory>
+
+namespace vsomeip {
+namespace sd {
+
+class service_discovery;
+class service_discovery_host;
+class service_discovery_stub;
+
+class runtime {
+public:
+ virtual ~runtime() {};
+
+ static runtime * get();
+
+ virtual std::shared_ptr< service_discovery > create_service_discovery(service_discovery_host *_host) = 0;
+ virtual std::shared_ptr< service_discovery_stub > create_service_discovery_stub(service_discovery *_discovery) = 0;
+ virtual std::shared_ptr< service_discovery > create_service_discovery_proxy(service_discovery_host *_host) = 0;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_RUNTIME_HPP
+
diff --git a/implementation/service_discovery/include/runtime_impl.hpp b/implementation/service_discovery/include/runtime_impl.hpp
new file mode 100644
index 0000000..fff05aa
--- /dev/null
+++ b/implementation/service_discovery/include/runtime_impl.hpp
@@ -0,0 +1,29 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_RUNTIME_IMPL_HPP
+#define VSOMEIP_SD_RUNTIME_IMPL_HPP
+
+#include "runtime.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class runtime_impl: public runtime {
+public:
+ static runtime * get();
+
+ virtual ~runtime_impl();
+
+ std::shared_ptr< service_discovery > create_service_discovery(service_discovery_host *_host);
+ std::shared_ptr< service_discovery_stub > create_service_discovery_stub(service_discovery *_discovery);
+ std::shared_ptr< service_discovery > create_service_discovery_proxy(service_discovery_host *_host);
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_RUNTIME_IMPL_HPP
diff --git a/implementation/service_discovery/include/service_discovery.hpp b/implementation/service_discovery/include/service_discovery.hpp
new file mode 100644
index 0000000..b37bec9
--- /dev/null
+++ b/implementation/service_discovery/include/service_discovery.hpp
@@ -0,0 +1,33 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SERVICE_DISCOVERY_HPP
+#define VSOMEIP_SERVICE_DISCOVERY_HPP
+
+#include <boost/asio/io_service.hpp>
+
+namespace vsomeip {
+namespace sd {
+
+class service_discovery {
+public:
+ virtual ~service_discovery() {};
+
+ virtual boost::asio::io_service & get_io() = 0;
+
+ virtual void init() = 0;
+ virtual void start() = 0;
+ virtual void stop() = 0;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERVICE_DISCOVERY_HPP
+
+
+
+
diff --git a/implementation/service_discovery/include/service_discovery_host.hpp b/implementation/service_discovery/include/service_discovery_host.hpp
new file mode 100644
index 0000000..be38973
--- /dev/null
+++ b/implementation/service_discovery/include/service_discovery_host.hpp
@@ -0,0 +1,33 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_SERVICE_DISCOVERY_HOST
+#define VSOMEIP_SD_SERVICE_DISCOVERY_HOST
+
+#include <memory>
+
+#include <boost/asio/io_service.hpp>
+
+namespace vsomeip {
+namespace sd {
+
+class service_discovery;
+
+class service_discovery_host {
+public:
+ virtual ~service_discovery_host() {};
+
+ virtual boost::asio::io_service & get_io() = 0;
+
+private:
+ std::shared_ptr< service_discovery > discovery_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_SERVICE_DISCOVERY_HOST
+
diff --git a/implementation/service_discovery/include/service_discovery_impl.hpp b/implementation/service_discovery/include/service_discovery_impl.hpp
new file mode 100644
index 0000000..89b02d2
--- /dev/null
+++ b/implementation/service_discovery/include/service_discovery_impl.hpp
@@ -0,0 +1,38 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SERVICE_DISCOVERY_IMPL
+#define VSOMEIP_SERVICE_DISCOVERY_IMPL
+
+#include <memory>
+
+#include "service_discovery.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class service_discovery_host;
+
+class service_discovery_impl: public service_discovery {
+public:
+ service_discovery_impl(service_discovery_host *_host);
+ virtual ~service_discovery_impl();
+
+ boost::asio::io_service & get_io();
+
+ void init();
+ void start();
+ void stop();
+
+private:
+ boost::asio::io_service &io_;
+ service_discovery_host *host_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERVICE_DISCOVERY_IMPL
diff --git a/implementation/service_discovery/include/service_discovery_proxy.hpp b/implementation/service_discovery/include/service_discovery_proxy.hpp
new file mode 100644
index 0000000..448447e
--- /dev/null
+++ b/implementation/service_discovery/include/service_discovery_proxy.hpp
@@ -0,0 +1,42 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SERVICE_DISCOVERY_PROXY
+#define VSOMEIP_SERVICE_DISCOVERY_PROXY
+
+#include <memory>
+
+#include "service_discovery.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class service_discovery_host;
+
+class service_discovery_proxy: public service_discovery {
+public:
+ service_discovery_proxy(service_discovery_host *_host);
+ virtual ~service_discovery_proxy();
+
+ boost::asio::io_service & get_io();
+
+ void init();
+ void start();
+ void stop();
+
+private:
+ boost::asio::io_service &io_;
+ service_discovery_host *host_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERVICE_DISCOVERY_PROXY
+
+
+
+
diff --git a/implementation/service_discovery/include/service_discovery_stub.hpp b/implementation/service_discovery/include/service_discovery_stub.hpp
new file mode 100644
index 0000000..44b4672
--- /dev/null
+++ b/implementation/service_discovery/include/service_discovery_stub.hpp
@@ -0,0 +1,31 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SERVICE_DISCOVERY_STUB_HPP
+#define VSOMEIP_SERVICE_DISCOVERY_STUB_HPP
+
+#include <memory>
+
+#include <boost/asio/io_service.hpp>
+
+namespace vsomeip {
+namespace sd {
+
+class service_discovery;
+
+class service_discovery_stub {
+public:
+ virtual ~service_discovery_stub() {};
+
+ virtual void init() = 0;
+ virtual void start() = 0;
+ virtual void stop() = 0;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERVICE_DISCOVERY_STUB_HPP
diff --git a/implementation/service_discovery/include/service_discovery_stub_impl.hpp b/implementation/service_discovery/include/service_discovery_stub_impl.hpp
new file mode 100644
index 0000000..06aa05a
--- /dev/null
+++ b/implementation/service_discovery/include/service_discovery_stub_impl.hpp
@@ -0,0 +1,38 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SERVICE_DISCOVERY_STUB_IMPL_HPP
+#define VSOMEIP_SERVICE_DISCOVERY_STUB_IMPL_HPP
+
+#include <memory>
+
+#include <boost/asio/io_service.hpp>
+
+#include "service_discovery_stub.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class service_discovery;
+
+class service_discovery_stub_impl: public service_discovery_stub {
+public:
+ service_discovery_stub_impl(service_discovery *_discovery);
+ ~service_discovery_stub_impl();
+
+ void init();
+ void start();
+ void stop();
+
+private:
+ boost::asio::io_service &io_;
+ service_discovery *discovery_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERVICE_DISCOVERY_STUB_HPP
diff --git a/implementation/service_discovery/include/serviceentry_impl.hpp b/implementation/service_discovery/include/serviceentry_impl.hpp
new file mode 100644
index 0000000..3065418
--- /dev/null
+++ b/implementation/service_discovery/include/serviceentry_impl.hpp
@@ -0,0 +1,33 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SD_SERVICEENTRY_IMPL_HPP
+#define VSOMEIP_SD_SERVICEENTRY_IMPL_HPP
+
+#include "entry_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+class serviceentry_impl: public entry_impl {
+public:
+ serviceentry_impl();
+ virtual ~serviceentry_impl();
+
+ minor_version_t get_minor_version() const;
+ void set_minor_version(minor_version_t _version);
+
+ bool serialize(vsomeip::serializer *_to) const;
+ bool deserialize(vsomeip::deserializer *_from);
+
+private:
+ minor_version_t minor_version_;
+};
+
+} // namespace sd
+} // namespace vsomeip
+
+#endif // VSOMEIP_SD_SERVICEENTRY_IMPL_HPP
diff --git a/vsomeip/src/vsomeip.sd/configuration_option_impl.cpp b/implementation/service_discovery/src/configuration_option_impl.cpp
index fc81162..f1b5284 100755
--- a/vsomeip/src/vsomeip.sd/configuration_option_impl.cpp
+++ b/implementation/service_discovery/src/configuration_option_impl.cpp
@@ -1,30 +1,28 @@
-//
-// configuration_option_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
#include <cstring>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/configuration_option_impl.hpp>
+#include "../include/configuration_option_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
namespace vsomeip {
namespace sd {
configuration_option_impl::configuration_option_impl() {
length_ = 2; // always contains "Reserved" and the trailing '\0'
- type_ = option_type::CONFIGURATION;
+ type_ = option_type_e::CONFIGURATION;
}
configuration_option_impl::~configuration_option_impl() {
}
-bool configuration_option_impl::operator ==(const option &_other) const {
- if (_other.get_type() != option_type::CONFIGURATION)
+bool configuration_option_impl::operator ==(const option_impl &_other) const {
+ if (_other.get_type() != option_type_e::CONFIGURATION)
return false;
const configuration_option_impl& other
@@ -121,4 +119,3 @@ bool configuration_option_impl::deserialize(vsomeip::deserializer *_from) {
} // namespace sd
} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.sd/deserializer.cpp b/implementation/service_discovery/src/deserializer.cpp
index 7ea0a3d..4fcdaa5 100644
--- a/vsomeip/src/vsomeip.sd/deserializer.cpp
+++ b/implementation/service_discovery/src/deserializer.cpp
@@ -1,14 +1,11 @@
-//
-// deserializer.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/sd/deserializer.hpp>
-#include <vsomeip_internal/sd/message_impl.hpp>
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/deserializer.hpp"
+#include "../include/message_impl.hpp"
namespace vsomeip {
namespace sd {
@@ -28,7 +25,7 @@ deserializer::deserializer(const deserializer &_other)
deserializer::~deserializer() {
}
-message * deserializer::deserialize_sd_message() {
+message_impl * deserializer::deserialize_sd_message() {
message_impl* deserialized_message = new message_impl;
if (0 != deserialized_message) {
if (false == deserialized_message->deserialize(this)) {
diff --git a/implementation/service_discovery/src/entry_impl.cpp b/implementation/service_discovery/src/entry_impl.cpp
new file mode 100755
index 0000000..75b2642
--- /dev/null
+++ b/implementation/service_discovery/src/entry_impl.cpp
@@ -0,0 +1,175 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <algorithm>
+
+#include "../include/entry_impl.hpp"
+#include "../include/message_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+// TODO: throw exception if this constructor is used
+entry_impl::entry_impl() {
+ type_ = entry_type_e::UNKNOWN;
+ major_version_ = 0;
+ service_ = 0x0;
+ instance_ = 0x0;
+ ttl_ = 0x0;
+}
+
+entry_impl::entry_impl(const entry_impl &_entry) {
+ type_ = _entry.type_;
+ major_version_ = _entry.major_version_;
+ service_ = _entry.service_;
+ instance_ = _entry.instance_;
+ ttl_ = _entry.ttl_;
+}
+
+entry_impl::~entry_impl() {
+}
+
+entry_type_e entry_impl::get_type() const {
+ return type_;
+}
+
+void entry_impl::set_type(entry_type_e _type) {
+ type_ = _type;
+}
+
+service_t entry_impl::get_service() const {
+ return service_;
+}
+
+void entry_impl::set_service(service_t _service) {
+ service_ = _service;
+}
+
+instance_t entry_impl::get_instance() const {
+ return instance_;
+}
+
+void entry_impl::set_instance(instance_t _instance) {
+ instance_ = _instance;
+}
+
+major_version_t entry_impl::get_major_version() const {
+ return major_version_;
+}
+
+void entry_impl::set_major_version(major_version_t _major_version) {
+ major_version_ = _major_version;
+}
+
+ttl_t entry_impl::get_ttl() const {
+ return ttl_;
+}
+
+void entry_impl::set_ttl(ttl_t _ttl) {
+ ttl_ = _ttl;
+}
+
+const std::vector< uint8_t > & entry_impl::get_options(uint8_t _run) const {
+ static std::vector< uint8_t > invalid_options;
+ if (_run > 0 && _run <= VSOMEIP_MAX_OPTION_RUN)
+ return options_[_run-1];
+
+ return invalid_options;
+}
+
+void entry_impl::assign_option(const option_impl &_option, uint8_t _run) {
+ if (_run > 0 && _run <= VSOMEIP_MAX_OPTION_RUN) {
+ _run--; // Index = Run-1
+
+ uint8_t option_index = get_owning_message()->get_option_index(_option);
+ if (0x10 > option_index) { // as we have only a nibble for the option counter
+ options_[_run].push_back(option_index);
+ std::sort(options_[_run].begin(), options_[_run].end());
+ } else {
+ // TODO: decide what to do if option does not belong to the message.
+ }
+ } else {
+ // TODO: decide what to do if an illegal index for the option run is provided
+ }
+}
+
+bool entry_impl::serialize(vsomeip::serializer *_to) const {
+ bool is_successful = (0 != _to && _to->serialize(static_cast<uint8_t>(type_)));
+
+ uint8_t index_first_option_run = 0;
+ if (options_[0].size() > 0)
+ index_first_option_run = options_[0][0];
+ is_successful = is_successful
+ && _to->serialize(index_first_option_run);
+
+ uint8_t index_second_option_run = 0;
+ if (options_[1].size() > 0)
+ index_second_option_run = options_[1][0];
+ is_successful = is_successful
+ && _to->serialize(index_second_option_run);
+
+ uint8_t number_of_options = ((((uint8_t)options_[0].size()) << 4)
+ | (((uint8_t)options_[1].size()) & 0x0F));
+ is_successful = is_successful
+ && _to->serialize(number_of_options);
+
+ is_successful = is_successful
+ && _to->serialize(static_cast< uint16_t >(service_));
+
+ is_successful = is_successful
+ && _to->serialize(static_cast< uint16_t >(instance_));
+
+ return is_successful;
+}
+
+bool entry_impl::deserialize(vsomeip::deserializer *_from) {
+ bool is_successful = (0 != _from);
+
+ uint8_t its_type;
+ is_successful = is_successful && _from->deserialize(its_type);
+ type_ = static_cast< entry_type_e >(its_type);
+
+ uint8_t its_index1;
+ is_successful = is_successful && _from->deserialize(its_index1);
+
+ uint8_t its_index2;
+ is_successful = is_successful && _from->deserialize(its_index2);
+
+ uint8_t its_numbers;
+ is_successful = is_successful && _from->deserialize(its_numbers);
+
+ uint8_t its_numbers1 = (its_numbers >> 4);
+ uint8_t its_numbers2 = (its_numbers & 0xF);
+
+ for (uint8_t i = its_index1; i < its_index1 + its_numbers1; ++i)
+ options_[0].push_back(i);
+
+ for (uint8_t i = its_index2; i < its_index2 + its_numbers2; ++i)
+ options_[1].push_back(i);
+
+ uint16_t its_id;
+ is_successful = is_successful && _from->deserialize(its_id);
+ service_ = static_cast< service_t >(its_id);
+
+ is_successful = is_successful && _from->deserialize(its_id);
+ instance_ = static_cast< instance_t >(its_id);
+
+ return is_successful;
+}
+
+bool entry_impl::is_service_entry() const {
+ return (type_ <= entry_type_e::REQUEST_SERVICE);
+}
+
+bool entry_impl::is_eventgroup_entry() const {
+ return (type_ >= entry_type_e::FIND_EVENT_GROUP
+ && type_ <= entry_type_e::SUBSCRIBE_EVENTGROUP_ACK);
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/eventgroupentry_impl.cpp b/implementation/service_discovery/src/eventgroupentry_impl.cpp
new file mode 100755
index 0000000..ddfe58c
--- /dev/null
+++ b/implementation/service_discovery/src/eventgroupentry_impl.cpp
@@ -0,0 +1,75 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/constants.hpp"
+#include "../include/eventgroupentry_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+eventgroupentry_impl::eventgroupentry_impl() {
+ eventgroup_ = 0xFFFF;
+}
+
+eventgroupentry_impl::eventgroupentry_impl(const eventgroupentry_impl &_entry)
+ : entry_impl(_entry) {
+
+ eventgroup_ = _entry.eventgroup_;
+}
+
+eventgroupentry_impl::~eventgroupentry_impl() {
+}
+
+eventgroup_t eventgroupentry_impl::get_eventgroup() const {
+ return eventgroup_;
+}
+
+void eventgroupentry_impl::set_eventgroup(eventgroup_t _eventgroup) {
+ eventgroup_ = _eventgroup;
+}
+
+bool eventgroupentry_impl::serialize(vsomeip::serializer *_to) const {
+ bool is_successful = entry_impl::serialize(_to);
+
+ is_successful = is_successful
+ && _to->serialize(vsomeip::protocol::reserved_byte);
+
+ is_successful = is_successful
+ && _to->serialize(static_cast< uint32_t >(ttl_), true);
+
+ is_successful = is_successful
+ && _to->serialize(vsomeip::protocol::reserved_word);
+
+ is_successful = is_successful
+ && _to->serialize(static_cast< uint16_t >(eventgroup_));
+
+ return is_successful;
+}
+
+bool eventgroupentry_impl::deserialize(vsomeip::deserializer *_from) {
+ bool is_successful = entry_impl::deserialize(_from);
+
+ uint8_t its_reserved0;
+ is_successful = is_successful && _from->deserialize(its_reserved0);
+
+ uint32_t its_ttl;
+ is_successful = is_successful && _from->deserialize(its_ttl, true);
+ ttl_ = static_cast< ttl_t >(its_ttl);
+
+ uint16_t its_reserved1;
+ is_successful = is_successful && _from->deserialize(its_reserved1);
+
+ uint16_t its_eventgroup = 0;
+ is_successful = is_successful && _from->deserialize(its_eventgroup);
+ eventgroup_ = static_cast< eventgroup_t >(its_eventgroup);
+
+ return is_successful;
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/ipv4_endpoint_option_impl.cpp b/implementation/service_discovery/src/ipv4_endpoint_option_impl.cpp
new file mode 100644
index 0000000..272330b
--- /dev/null
+++ b/implementation/service_discovery/src/ipv4_endpoint_option_impl.cpp
@@ -0,0 +1,50 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <vsomeip/constants.hpp>
+
+#include "../include/ipv4_option_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+ipv4_option_impl::ipv4_option_impl(bool _is_multicast) {
+ length_ = (1 + 4 + 1 + 1 + 2);
+ type_ = (_is_multicast ? option_type_e::IP4_MULTICAST : option_type_e::IP4_ENDPOINT);
+}
+
+ipv4_option_impl::~ipv4_option_impl() {
+}
+
+bool ipv4_option_impl::operator ==(const option_impl &_other) const {
+ if (type_ != _other.get_type())
+ return false;
+
+ const ipv4_option_impl & other = dynamic_cast< const ipv4_option_impl & >(_other);
+ return true;
+}
+
+bool ipv4_option_impl::is_multicast() const {
+ return (type_ == option_type_e::IP4_MULTICAST);
+}
+
+bool ipv4_option_impl::serialize(vsomeip::serializer *_to) const {
+ bool is_successful = option_impl::serialize(_to);
+ // TODO: serialize specific part
+ return is_successful;
+}
+
+bool ipv4_option_impl::deserialize(vsomeip::deserializer *_from) {
+ bool is_successful = option_impl::deserialize(_from);
+ // TODO: serialize specific part
+ return is_successful;
+}
+
+} // namespace sd
+} // namespace vsomeip
+
diff --git a/implementation/service_discovery/src/ipv6_endpoint_option_impl.cpp b/implementation/service_discovery/src/ipv6_endpoint_option_impl.cpp
new file mode 100755
index 0000000..20a7988
--- /dev/null
+++ b/implementation/service_discovery/src/ipv6_endpoint_option_impl.cpp
@@ -0,0 +1,51 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <cstring>
+
+#include "../include/ipv6_option_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+ipv6_option_impl::ipv6_option_impl(bool _is_multicast) {
+ length_ = (1 + 16 + 1 + 1 + 2);
+ type_ = (_is_multicast ? option_type_e::IP6_MULTICAST : option_type_e::IP6_ENDPOINT) ;
+}
+
+ipv6_option_impl::~ipv6_option_impl() {
+}
+
+bool ipv6_option_impl::operator ==(const option_impl &_other) const {
+ if (_other.get_type() != option_type_e::IP6_ENDPOINT)
+ return false;
+
+ const ipv6_option_impl& other
+ = dynamic_cast< const ipv6_option_impl & >(_other);
+
+ return true; // TODO:
+}
+
+
+bool ipv6_option_impl::serialize(vsomeip::serializer *_to) const {
+ bool is_successful = option_impl::serialize(_to);
+ // TODO: deserialize content
+ return is_successful;
+}
+
+bool ipv6_option_impl::deserialize(vsomeip::deserializer *_from) {
+ bool is_successful = option_impl::deserialize(_from);
+ // TODO: deserialize content
+ return is_successful;
+}
+
+} // namespace sd
+} // namespace vsomeip
+
+
+
diff --git a/implementation/service_discovery/src/load_balancing_option_impl.cpp b/implementation/service_discovery/src/load_balancing_option_impl.cpp
new file mode 100755
index 0000000..feea545
--- /dev/null
+++ b/implementation/service_discovery/src/load_balancing_option_impl.cpp
@@ -0,0 +1,73 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/load_balancing_option_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+load_balancing_option_impl::load_balancing_option_impl() {
+ length_ = 1 + 2 + 2;
+ type_ = option_type_e::LOAD_BALANCING;
+ priority_ = 0;
+ weight_ = 0;
+}
+
+load_balancing_option_impl::~load_balancing_option_impl() {
+}
+
+bool load_balancing_option_impl::operator ==(const option_impl &_other) const {
+ if (_other.get_type() != option_type_e::LOAD_BALANCING)
+ return false;
+
+ const load_balancing_option_impl& other
+ = dynamic_cast< const load_balancing_option_impl & >(_other);
+
+ return (priority_ == other.priority_
+ && weight_ == other.weight_);
+}
+
+priority_t load_balancing_option_impl::get_priority() const {
+ return priority_;
+}
+
+void load_balancing_option_impl::set_priority(priority_t _priority) {
+ priority_ = _priority;
+}
+
+weight_t load_balancing_option_impl::get_weight() const {
+ return weight_;
+}
+
+void load_balancing_option_impl::set_weight(weight_t _weight) {
+ weight_ = _weight;
+}
+
+bool load_balancing_option_impl::serialize(vsomeip::serializer *_to) const {
+ bool is_successful = option_impl::serialize(_to);
+ is_successful = is_successful && _to->serialize(static_cast< uint16_t >(priority_));
+ is_successful = is_successful && _to->serialize(static_cast< uint16_t >(weight_));
+ return is_successful;
+}
+
+bool load_balancing_option_impl::deserialize(vsomeip::deserializer *_from) {
+ bool is_successful = option_impl::deserialize(_from);
+
+ uint16_t tmp_priority = 0;
+ is_successful = is_successful && _from->deserialize(tmp_priority);
+ priority_ = static_cast< priority_t >(tmp_priority);
+
+ uint16_t tmp_weight = 0;
+ is_successful = is_successful && _from->deserialize(tmp_weight);
+ weight_ = static_cast< weight_t >(tmp_weight);
+
+ return is_successful;
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/message_element_impl.cpp b/implementation/service_discovery/src/message_element_impl.cpp
new file mode 100755
index 0000000..bb7a319
--- /dev/null
+++ b/implementation/service_discovery/src/message_element_impl.cpp
@@ -0,0 +1,25 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/message_element_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+message_element_impl::message_element_impl() {
+ owner_ = 0;
+}
+
+message_impl * message_element_impl::get_owning_message() const {
+ return owner_;
+}
+
+void message_element_impl::set_owning_message(message_impl *_owner) {
+ owner_ = _owner;
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/message_impl.cpp b/implementation/service_discovery/src/message_impl.cpp
new file mode 100755
index 0000000..bc713ba
--- /dev/null
+++ b/implementation/service_discovery/src/message_impl.cpp
@@ -0,0 +1,323 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <typeinfo>
+
+#include <vsomeip/constants.hpp>
+#include <vsomeip/defines.hpp>
+
+#include "../include/constants.hpp"
+#include "../include/defines.hpp"
+#include "../include/eventgroupentry_impl.hpp"
+#include "../include/serviceentry_impl.hpp"
+#include "../include/configuration_option_impl.hpp"
+#include "../include/ipv4_option_impl.hpp"
+#include "../include/ipv6_option_impl.hpp"
+#include "../include/load_balancing_option_impl.hpp"
+#include "../include/protection_option_impl.hpp"
+#include "../include/message_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+message_impl::message_impl() {
+ header_.service_ = 0xFFFF;
+ header_.method_ = 0x8100;
+ header_.protocol_version_ = 0x01;
+ flags_ = 0x00;
+}
+
+message_impl::~message_impl() {
+}
+
+length_t message_impl::get_length() const {
+ length_t current_length = VSOMEIP_SOMEIP_HEADER_SIZE + VSOMEIP_SOMEIP_SD_DATA_SIZE;
+
+ current_length += (entries_.size() * VSOMEIP_SOMEIP_SD_ENTRY_SIZE);
+
+ for (size_t i = 0; i < options_.size(); ++i) {
+ current_length += (options_[i]->get_length() + VSOMEIP_SOMEIP_SD_OPTION_HEADER_SIZE);
+ }
+
+ return current_length;
+}
+
+#define VSOMEIP_REBOOT_FLAG 0x80
+
+bool message_impl::get_reboot_flag() const {
+ return ((flags_ & VSOMEIP_REBOOT_FLAG) != 0);
+}
+
+void message_impl::set_reboot_flag(bool _is_set) {
+ if (_is_set)
+ flags_ |= VSOMEIP_REBOOT_FLAG;
+ else
+ flags_ &= ~VSOMEIP_REBOOT_FLAG;
+}
+
+#define VSOMEIP_UNICAST_FLAG 0x40
+
+bool message_impl::get_unicast_flag() const {
+ return ((flags_ & VSOMEIP_UNICAST_FLAG) != 0);
+}
+
+void message_impl::set_unicast_flag(bool _is_set) {
+ if (_is_set)
+ flags_ |= VSOMEIP_UNICAST_FLAG;
+ else
+ flags_ &= ~VSOMEIP_UNICAST_FLAG;
+}
+
+void message_impl::set_length(length_t _length) {
+}
+
+std::shared_ptr< eventgroupentry_impl > message_impl::create_eventgroup_entry() {
+ std::shared_ptr< eventgroupentry_impl > its_entry(new eventgroupentry_impl);
+ //TODO: throw OutOfMemoryException if allocation fails
+ its_entry->set_owning_message(this);
+ entries_.push_back(its_entry);
+ return its_entry;
+}
+
+std::shared_ptr< serviceentry_impl > message_impl::create_service_entry() {
+ std::shared_ptr< serviceentry_impl > its_entry(new serviceentry_impl);
+ //TODO: throw OutOfMemoryException if allocation fails
+ its_entry->set_owning_message(this);
+ entries_.push_back(its_entry);
+ return its_entry;
+}
+
+std::shared_ptr< configuration_option_impl > message_impl::create_configuration_option() {
+ std::shared_ptr< configuration_option_impl > its_option(new configuration_option_impl);
+ //TODO: throw OutOfMemoryException if allocation fails
+ its_option->set_owning_message(this);
+ options_.push_back(its_option);
+ return its_option;
+}
+
+std::shared_ptr< ipv4_option_impl > message_impl::create_ipv4_option(bool _is_multicast) {
+ std::shared_ptr< ipv4_option_impl > its_option(new ipv4_option_impl(_is_multicast));
+ //TODO: throw OutOfMemoryException if allocation fails
+ its_option->set_owning_message(this);
+ options_.push_back(its_option);
+ return its_option;
+}
+
+std::shared_ptr< ipv6_option_impl > message_impl::create_ipv6_option(bool _is_multicast) {
+ std::shared_ptr< ipv6_option_impl > its_option(new ipv6_option_impl(_is_multicast));
+ //TODO: throw OutOfMemoryException if allocation fails
+ its_option->set_owning_message(this);
+ options_.push_back(its_option);
+ return its_option;
+}
+
+std::shared_ptr< load_balancing_option_impl > message_impl::create_load_balancing_option() {
+ std::shared_ptr< load_balancing_option_impl > its_option(new load_balancing_option_impl);
+ //TODO: throw OutOfMemoryException if allocation fails
+ its_option->set_owning_message(this);
+ options_.push_back(its_option);
+ return its_option;
+}
+
+std::shared_ptr< protection_option_impl > message_impl::create_protection_option() {
+ std::shared_ptr< protection_option_impl > its_option(new protection_option_impl);
+ //TODO: throw OutOfMemoryException if allocation fails
+ its_option->set_owning_message(this);
+ options_.push_back(its_option);
+ return its_option;
+}
+
+const std::vector< std::shared_ptr< entry_impl > > message_impl::get_entries() const {
+ return entries_;
+}
+
+const std::vector< std::shared_ptr< option_impl > > message_impl::get_options() const {
+ return options_;
+}
+
+// TODO: throw exception to signal "OptionNotFound"
+int16_t message_impl::get_option_index(const option_impl &_option) const {
+ int16_t i = 0;
+
+ while (i < options_.size()) {
+ if (*(options_[i].get()) == _option)
+ return i;
+ i++;
+ }
+
+ return -1;
+}
+
+bool message_impl::serialize(vsomeip::serializer *_to) const {
+ bool is_successful = header_.serialize(_to);
+
+ is_successful = is_successful && _to->serialize(flags_);
+ is_successful = is_successful
+ && _to->serialize(vsomeip::protocol::reserved_long, true);
+
+ uint32_t entries_length = (entries_.size() * VSOMEIP_SOMEIP_SD_ENTRY_SIZE);
+ is_successful = is_successful && _to->serialize(entries_length);
+
+ for (auto it = entries_.begin(); it != entries_.end(); ++it)
+ is_successful = is_successful && (*it)->serialize(_to);
+
+ uint32_t options_length = 0;
+ for (size_t i = 0; i < options_.size(); ++i)
+ options_length += (options_[i]->get_length() + VSOMEIP_SOMEIP_HEADER_SIZE);
+ is_successful = is_successful && _to->serialize(options_length);
+
+ for (auto it = options_.begin(); it != options_.end(); ++it)
+ is_successful = is_successful && (*it)->serialize(_to);
+
+ return is_successful;
+}
+
+bool message_impl::deserialize(vsomeip::deserializer *_from) {
+ bool is_successful;
+
+ // header
+ is_successful = header_.deserialize(_from);
+
+ // flags
+ is_successful = is_successful && _from->deserialize(flags_);
+
+ // reserved
+ uint32_t reserved;
+ is_successful = is_successful && _from->deserialize(reserved, true);
+
+ // entries
+ uint32_t entries_length = 0;
+ is_successful = is_successful && _from->deserialize(entries_length);
+
+ // backup the current remaining length
+ uint32_t save_remaining = _from->get_remaining();
+
+ // set remaining bytes to length of entries array
+ _from->set_remaining(entries_length);
+
+ // deserialize the entries
+ while (is_successful && _from->get_remaining()) {
+ std::shared_ptr< entry_impl > its_entry(deserialize_entry(_from));
+ if (its_entry) {
+ entries_.push_back(its_entry);
+ } else {
+ is_successful = false;
+ }
+ }
+
+ // set length to remaining bytes after entries array
+ _from->set_remaining(save_remaining - entries_length);
+
+ // deserialize the options
+ uint32_t options_length = 0;
+ is_successful = is_successful && _from->deserialize(options_length);
+
+ while (is_successful && _from->get_remaining()) {
+ std::shared_ptr< option_impl > its_option(deserialize_option(_from));
+ if (its_option) {
+ options_.push_back(its_option);
+ } else {
+ is_successful = false;
+ }
+ }
+
+ return is_successful;
+}
+
+entry_impl * message_impl::deserialize_entry(vsomeip::deserializer *_from) {
+ entry_impl *deserialized_entry = 0;
+ uint8_t tmp_entry_type;
+
+ if (_from->look_ahead(0, tmp_entry_type)) {
+ entry_type_e deserialized_entry_type =
+ static_cast< entry_type_e >(tmp_entry_type);
+
+ switch (deserialized_entry_type) {
+ case entry_type_e::FIND_SERVICE:
+ case entry_type_e::OFFER_SERVICE:
+ //case entry_type_e::STOP_OFFER_SERVICE:
+ case entry_type_e::REQUEST_SERVICE:
+ deserialized_entry = new serviceentry_impl;
+ break;
+
+ case entry_type_e::FIND_EVENT_GROUP:
+ case entry_type_e::PUBLISH_EVENTGROUP:
+ //case entry_type_e::STOP_PUBLISH_EVENTGROUP:
+ case entry_type_e::SUBSCRIBE_EVENTGROUP:
+ //case entry_type_e::STOP_SUBSCRIBE_EVENTGROUP:
+ case entry_type_e::SUBSCRIBE_EVENTGROUP_ACK:
+ //case entry_type_e::STOP_SUBSCRIBE_EVENTGROUP_ACK:
+ deserialized_entry = new eventgroupentry_impl;
+ break;
+
+ default:
+ break;
+ };
+
+ // deserialize object
+ if (0 != deserialized_entry) {
+ if (!deserialized_entry->deserialize(_from)) {
+ delete deserialized_entry;
+ deserialized_entry = 0;
+ };
+ }
+ }
+
+ return deserialized_entry;
+}
+
+option_impl * message_impl::deserialize_option(vsomeip::deserializer *_from) {
+ option_impl *deserialized_option = 0;
+ uint8_t tmp_option_type;
+
+ if (_from->look_ahead(2, tmp_option_type)) {
+
+ option_type_e deserialized_option_type =
+ static_cast< option_type_e >(tmp_option_type);
+
+ switch (deserialized_option_type) {
+
+ case option_type_e::CONFIGURATION:
+ deserialized_option = new configuration_option_impl;
+ break;
+ case option_type_e::LOAD_BALANCING:
+ deserialized_option = new load_balancing_option_impl;
+ break;
+ case option_type_e::PROTECTION:
+ deserialized_option = new protection_option_impl;
+ break;
+ case option_type_e::IP4_ENDPOINT:
+ deserialized_option = new ipv4_option_impl(false);
+ break;
+ case option_type_e::IP4_MULTICAST:
+ deserialized_option = new ipv4_option_impl(true);
+ break;
+ case option_type_e::IP6_ENDPOINT:
+ deserialized_option = new ipv6_option_impl(false);
+ break;
+ case option_type_e::IP6_MULTICAST:
+ deserialized_option = new ipv6_option_impl(true);
+ break;
+
+ default:
+ break;
+ };
+
+ // deserialize object
+ if (0 != deserialized_option
+ && !deserialized_option->deserialize(_from)) {
+ delete deserialized_option;
+ deserialized_option = 0;
+ };
+ }
+
+ return deserialized_option;
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/option_impl.cpp b/implementation/service_discovery/src/option_impl.cpp
new file mode 100755
index 0000000..552aad8
--- /dev/null
+++ b/implementation/service_discovery/src/option_impl.cpp
@@ -0,0 +1,58 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/constants.hpp"
+#include "../include/option_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+option_impl::option_impl() {
+ length_ = 0;
+ type_ = option_type_e::UNKNOWN;
+}
+
+option_impl::~option_impl() {
+}
+
+bool option_impl::operator ==(const option_impl &_other) const {
+ return false;
+}
+
+uint16_t option_impl::get_length() const {
+ return length_;
+}
+
+option_type_e option_impl::get_type() const {
+ return type_;
+}
+
+bool option_impl::serialize(vsomeip::serializer *_to) const {
+ return (0 != _to
+ && _to->serialize(length_)
+ && _to->serialize(static_cast<uint8_t>(type_))
+ && _to->serialize(vsomeip::protocol::reserved_byte));
+}
+
+bool option_impl::deserialize(vsomeip::deserializer *_from) {
+ uint8_t its_type, reserved;
+ bool l_result = (0 != _from
+ && _from->deserialize(length_)
+ && _from->deserialize(its_type)
+ && _from->deserialize(reserved));
+
+ if (l_result) {
+ type_ = static_cast< option_type_e >(its_type);
+ }
+
+ return l_result;
+}
+
+} // namespace sd
+} // namespace vsomeip
+
diff --git a/implementation/service_discovery/src/protection_option_impl.cpp b/implementation/service_discovery/src/protection_option_impl.cpp
new file mode 100755
index 0000000..15593a5
--- /dev/null
+++ b/implementation/service_discovery/src/protection_option_impl.cpp
@@ -0,0 +1,72 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/protection_option_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+protection_option_impl::protection_option_impl() {
+ length_ = 1 + 4 + 4;
+ type_ = option_type_e::PROTECTION;
+ counter_ = 0;
+ crc_ = 0;
+}
+
+protection_option_impl::~protection_option_impl() {
+}
+
+bool protection_option_impl::operator ==(const option_impl &_other) const {
+ if (_other.get_type() != option_type_e::PROTECTION)
+ return false;
+
+ const protection_option_impl& other
+ = dynamic_cast< const protection_option_impl & >(_other);
+
+ return (counter_ == other.counter_ && crc_ == other.crc_);
+}
+
+alive_counter_t protection_option_impl::get_alive_counter() const {
+ return counter_;
+}
+
+void protection_option_impl::set_alive_counter(alive_counter_t _counter) {
+ counter_ = _counter;
+}
+
+crc_t protection_option_impl::get_crc() const {
+ return crc_;
+}
+
+void protection_option_impl::set_crc(crc_t _crc) {
+ crc_ = _crc;
+}
+
+bool protection_option_impl::serialize(vsomeip::serializer *_to) const {
+ bool is_successful = option_impl::serialize(_to);
+ is_successful = is_successful && _to->serialize(static_cast< uint32_t >(counter_));
+ is_successful = is_successful && _to->serialize(static_cast< uint32_t >(crc_));
+ return is_successful;
+}
+
+bool protection_option_impl::deserialize(vsomeip::deserializer *_from) {
+ bool is_successful = option_impl::deserialize(_from);
+
+ uint32_t its_alive_counter = 0;
+ is_successful = is_successful && _from->deserialize(its_alive_counter);
+ counter_ = static_cast< alive_counter_t >(its_alive_counter);
+
+ uint32_t its_crc = 0;
+ is_successful = is_successful && _from->deserialize(its_crc);
+ crc_ = static_cast< crc_t >(its_crc);
+
+ return is_successful;
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/runtime.cpp b/implementation/service_discovery/src/runtime.cpp
new file mode 100644
index 0000000..d642cf1
--- /dev/null
+++ b/implementation/service_discovery/src/runtime.cpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/runtime_impl.hpp"
+#include "../../configuration/include/internal.hpp"
+
+vsomeip::sd::runtime * VSOMEIP_SD_RUNTIME_SYMBOL;
+
+static void init_vsomeip_sd() __attribute__((constructor));
+static void init_vsomeip_sd() {
+ VSOMEIP_SD_RUNTIME_SYMBOL = vsomeip::sd::runtime::get();
+}
+
+namespace vsomeip {
+namespace sd {
+
+runtime * runtime::get() {
+ return runtime_impl::get();
+}
+
+} // namespace sd
+} // namespace vsomeip
+
+
+
diff --git a/implementation/service_discovery/src/runtime_impl.cpp b/implementation/service_discovery/src/runtime_impl.cpp
new file mode 100644
index 0000000..f2b114d
--- /dev/null
+++ b/implementation/service_discovery/src/runtime_impl.cpp
@@ -0,0 +1,38 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <vsomeip/defines.hpp>
+
+#include "../include/runtime_impl.hpp"
+#include "../include/service_discovery_impl.hpp"
+#include "../include/service_discovery_proxy.hpp"
+#include "../include/service_discovery_stub_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+runtime * runtime_impl::get() {
+ static runtime_impl the_runtime;
+ return &the_runtime;
+}
+
+runtime_impl::~runtime_impl() {
+}
+
+std::shared_ptr< service_discovery > runtime_impl::create_service_discovery(service_discovery_host *_host) {
+ return std::make_shared< service_discovery_impl >(_host);
+}
+
+std::shared_ptr< service_discovery_stub > runtime_impl::create_service_discovery_stub(service_discovery *_discovery) {
+ return std::make_shared< service_discovery_stub_impl >(_discovery);
+}
+
+std::shared_ptr< service_discovery > runtime_impl::create_service_discovery_proxy(service_discovery_host *_host) {
+ return std::make_shared< service_discovery_proxy >(_host);
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/service_discovery_impl.cpp b/implementation/service_discovery/src/service_discovery_impl.cpp
new file mode 100644
index 0000000..cc4e17b
--- /dev/null
+++ b/implementation/service_discovery/src/service_discovery_impl.cpp
@@ -0,0 +1,37 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/service_discovery_host.hpp"
+#include "../include/service_discovery_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+service_discovery_impl::service_discovery_impl(service_discovery_host *_host)
+ : host_(_host), io_(_host->get_io()) {
+}
+
+service_discovery_impl::~service_discovery_impl() {
+}
+
+boost::asio::io_service & service_discovery_impl::get_io() {
+ return io_;
+}
+
+void service_discovery_impl::init() {
+
+}
+
+void service_discovery_impl::start() {
+
+}
+
+void service_discovery_impl::stop() {
+
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/service_discovery_proxy.cpp b/implementation/service_discovery/src/service_discovery_proxy.cpp
new file mode 100644
index 0000000..4931594
--- /dev/null
+++ b/implementation/service_discovery/src/service_discovery_proxy.cpp
@@ -0,0 +1,37 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/service_discovery_host.hpp"
+#include "../include/service_discovery_proxy.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+service_discovery_proxy::service_discovery_proxy(service_discovery_host *_host)
+ : host_(_host), io_(_host->get_io()) {
+}
+
+service_discovery_proxy::~service_discovery_proxy() {
+}
+
+boost::asio::io_service & service_discovery_proxy::get_io() {
+ return io_;
+}
+
+void service_discovery_proxy::init() {
+
+}
+
+void service_discovery_proxy::start() {
+
+}
+
+void service_discovery_proxy::stop() {
+
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/service_discovery_stub_impl.cpp b/implementation/service_discovery/src/service_discovery_stub_impl.cpp
new file mode 100644
index 0000000..6443556
--- /dev/null
+++ b/implementation/service_discovery/src/service_discovery_stub_impl.cpp
@@ -0,0 +1,35 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/service_discovery.hpp"
+#include "../include/service_discovery_stub_impl.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+service_discovery_stub_impl::service_discovery_stub_impl(
+ service_discovery *_discovery) : discovery_(_discovery), io_(_discovery->get_io()) {
+
+}
+
+service_discovery_stub_impl::~service_discovery_stub_impl() {
+
+}
+
+void service_discovery_stub_impl::init() {
+
+}
+
+void service_discovery_stub_impl::start() {
+
+}
+
+void service_discovery_stub_impl::stop() {
+
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/service_discovery/src/serviceentry_impl.cpp b/implementation/service_discovery/src/serviceentry_impl.cpp
new file mode 100755
index 0000000..e7e8c1f
--- /dev/null
+++ b/implementation/service_discovery/src/serviceentry_impl.cpp
@@ -0,0 +1,58 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include "../include/serviceentry_impl.hpp"
+#include "../../message/include/deserializer.hpp"
+#include "../../message/include/serializer.hpp"
+
+namespace vsomeip {
+namespace sd {
+
+serviceentry_impl::serviceentry_impl() {
+ minor_version_ = 0;
+}
+
+serviceentry_impl::~serviceentry_impl() {
+}
+
+minor_version_t serviceentry_impl::get_minor_version() const {
+ return minor_version_;
+}
+
+void serviceentry_impl::set_minor_version(minor_version_t _version) {
+ minor_version_ = _version;
+}
+
+bool serviceentry_impl::serialize(vsomeip::serializer *_to) const {
+ bool is_successful = entry_impl::serialize(_to);
+
+ is_successful = is_successful && _to->serialize(static_cast<uint8_t>(major_version_));
+ is_successful = is_successful && _to->serialize(static_cast<uint32_t>(ttl_), true);
+ is_successful = is_successful && _to->serialize(static_cast<uint32_t>(minor_version_));
+
+ return is_successful;
+}
+
+bool serviceentry_impl::deserialize(vsomeip::deserializer *_from) {
+ bool is_successful = entry_impl::deserialize(_from);
+
+ uint8_t tmp_major_version;
+ is_successful = is_successful && _from->deserialize(tmp_major_version);
+ major_version_ = static_cast< major_version_t >(tmp_major_version);
+
+ uint32_t tmp_ttl;
+ is_successful = is_successful && _from->deserialize(tmp_ttl, true);
+ ttl_ = static_cast< ttl_t >(tmp_ttl);
+
+ uint32_t tmp_minor_version;
+ is_successful = is_successful && _from->deserialize(tmp_minor_version);
+ minor_version_ = static_cast< minor_version_t >(tmp_minor_version);
+
+ return is_successful;
+}
+
+} // namespace sd
+} // namespace vsomeip
diff --git a/implementation/test/configuration-test.cpp b/implementation/test/configuration-test.cpp
new file mode 100644
index 0000000..f860aea
--- /dev/null
+++ b/implementation/test/configuration-test.cpp
@@ -0,0 +1,227 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <vsomeip/configuration.hpp>
+#include <vsomeip/constants.hpp>
+#include <vsomeip/logger.hpp>
+
+#define DESIRED_ADDRESS "10.0.2.15"
+#define DESIRED_HAS_CONSOLE true
+#define DESIRED_HAS_FILE true
+#define DESIRED_HAS_DLT false
+#define DESIRED_LOGLEVEL "debug"
+#define DESIRED_LOGFILE "/home/someip/another-file.log"
+#define DESIRED_HOST "my_application"
+#define DESIRED_PROTOCOL "tcp"
+#define DESIRED_PORT 30666
+
+#define DESIRED_RELIABLE_1234_0022 30506
+#define DESIRED_UNRELIABLE_1234_0022 31000
+#define DESIRED_MULTICAST_1234_0022 "225.225.225.1"
+
+#define DESIRED_RELIABLE_1234_0023 30503
+#define DESIRED_UNRELIABLE_1234_0023 vsomeip::VSOMEIP_ILLEGAL_PORT
+#define DESIRED_MULTICAST_1234_0023 "225.225.225.2"
+
+#define DESIRED_RELIABLE_2277_0022 30505
+#define DESIRED_UNRELIABLE_2277_0022 31001
+#define DESIRED_MULTICAST_2277_0022 "225.225.225.3"
+
+#define DESIRED_RELIABLE_2266_0022 30505
+#define DESIRED_UNRELIABLE_2266_0022 30507
+#define DESIRED_MULTICAST_2266_0022 "225.225.226.1"
+
+#define DESIRED_RELIABLE_4466_0321 30506
+#define DESIRED_UNRELIABLE_4466_0321 30444
+#define DESIRED_MULTICAST_4466_0321 "225.225.228.1"
+
+#define DESIRED_ADDRESS_1234_0022 "local"
+#define DESIRED_MIN_INITIAL_DELAY_1234_0022 10
+#define DESIRED_MAX_INITIAL_DELAY_1234_0022 100
+#define DESIRED_REPETITION_BASE_DELAY_1234_0022 200
+#define DESIRED_REPETITION_MAX_1234_0022 7
+#define DESIRED_CYCLIC_OFFER_DELAY_1234_0022 2000
+#define DESIRED_CYCLIC_REQUEST_DELAY_1234_0022 2001
+
+#define DESIRED_ADDRESS_2277_0022 "local"
+#define DESIRED_MIN_INITIAL_DELAY_2277_0022 100
+#define DESIRED_MAX_INITIAL_DELAY_2277_0022 200
+#define DESIRED_REPETITION_BASE_DELAY_2277_0022 300
+#define DESIRED_REPETITION_MAX_2277_0022 5
+#define DESIRED_CYCLIC_OFFER_DELAY_2277_0022 2500
+#define DESIRED_CYCLIC_REQUEST_DELAY_2277_0022 2221
+
+#define DESIRED_ADDRESS_4466_0321 "10.0.2.23"
+
+template<class T>
+void check(const T &_is, const T &_desired, const std::string &_test) {
+ if (_is == _desired) {
+ VSOMEIP_INFO << "Test \"" << _test << "\" succeeded.";
+ } else {
+ VSOMEIP_ERROR << "Test \"" << _test << "\" failed! (" << _is << " != " << _desired << ")";
+ }
+}
+
+int main(int argc, char **argv) {
+ std::string its_path;
+
+ int i = 0;
+ while (i < argc-1) {
+ if (std::string("--someip") == argv[i]) {
+ its_path = argv[i+1];
+ break;
+ }
+
+ i++;
+ }
+
+ if (its_path == "") {
+ std::cerr << "Usage: " << argv[0] << " --someip <path>" << std::endl;
+ return -1;
+ }
+
+ vsomeip::configuration *its_configuration = vsomeip::configuration::get(its_path);
+
+ // 1. Did we get a configuration object?
+ if (0 == its_configuration) {
+ VSOMEIP_ERROR << "No configuration object. Either memory overflow or loading error detected!";
+ return -1;
+ }
+
+ // 2. Check host address
+ boost::asio::ip::address its_address = its_configuration->get_address();
+ check<std::string>(its_address.to_string(), DESIRED_ADDRESS, "HOST ADDRESS");
+
+ // 3. Check logging
+ bool has_console = its_configuration->has_console_log();
+ bool has_file = its_configuration->has_file_log();
+ bool has_dlt = its_configuration->has_dlt_log();
+ std::string logfile = its_configuration->get_logfile();
+ boost::log::trivial::severity_level loglevel = its_configuration->get_loglevel();
+
+ check<bool>(has_console, DESIRED_HAS_CONSOLE, "HAS CONSOLE");
+ check<bool>(has_file, DESIRED_HAS_FILE, "HAS FILE");
+ check<bool>(has_dlt, DESIRED_HAS_DLT, "HAS DLT");
+ check<std::string>(logfile, DESIRED_LOGFILE, "LOGFILE");
+ check<std::string>(boost::log::trivial::to_string(loglevel), DESIRED_LOGLEVEL, "LOGLEVEL");
+
+ // 4. Services
+ uint16_t its_reliable = its_configuration->get_reliable_port(0x1234, 0x0022);
+ uint16_t its_unreliable = its_configuration->get_unreliable_port(0x1234, 0x0022);
+ std::string its_multicast = its_configuration->get_multicast(0x1234, 0x0022);
+
+ check<uint16_t>(its_reliable, DESIRED_RELIABLE_1234_0022, "RELIABLE_TEST_1234_0022");
+ check<uint16_t>(its_unreliable, DESIRED_UNRELIABLE_1234_0022, "UNRELIABLE_TEST_1234_0022");
+ check<std::string>(its_multicast, DESIRED_MULTICAST_1234_0022, "MULTICAST_TEST_1234_0022");
+
+ its_reliable = its_configuration->get_reliable_port(0x1234, 0x0023);
+ its_unreliable = its_configuration->get_unreliable_port(0x1234, 0x0023);
+ its_multicast = its_configuration->get_multicast(0x1234, 0x0023);
+
+
+ check<uint16_t>(its_reliable, DESIRED_RELIABLE_1234_0023, "RELIABLE_TEST_1234_0023");
+ check<uint16_t>(its_unreliable, DESIRED_UNRELIABLE_1234_0023, "UNRELIABLE_TEST_1234_0023");
+ check<std::string>(its_multicast, DESIRED_MULTICAST_1234_0023, "MULTICAST_TEST_1234_0023");
+
+ its_reliable = its_configuration->get_reliable_port(0x2277, 0x0022);
+ its_unreliable = its_configuration->get_unreliable_port(0x2277, 0x0022);
+ its_multicast = its_configuration->get_multicast(0x2277, 0x0022);
+
+ check<uint16_t>(its_reliable, DESIRED_RELIABLE_2277_0022, "RELIABLE_TEST_2277_0022");
+ check<uint16_t>(its_unreliable, DESIRED_UNRELIABLE_2277_0022, "UNRELIABLE_TEST_2277_0022");
+ check<std::string>(its_multicast, DESIRED_MULTICAST_2277_0022, "MULTICAST_TEST_2277_0022");
+
+ its_reliable = its_configuration->get_reliable_port(0x4466, 0x0321);
+ its_unreliable = its_configuration->get_unreliable_port(0x4466, 0x0321);
+ its_multicast = its_configuration->get_multicast(0x4466, 0x0321);
+
+ check<uint16_t>(its_reliable, DESIRED_RELIABLE_4466_0321, "RELIABLE_TEST_4466_0321");
+ check<uint16_t>(its_unreliable, DESIRED_UNRELIABLE_4466_0321, "UNRELIABLE_TEST_4466_0321");
+ check<std::string>(its_multicast, DESIRED_MULTICAST_4466_0321, "MULTICAST_TEST_4466_0321");
+
+ its_reliable = its_configuration->get_reliable_port(0x2277, 0x0022);
+ its_unreliable = its_configuration->get_unreliable_port(0x2277, 0x0022);
+ its_multicast = its_configuration->get_multicast(0x2277, 0x0022);
+
+ check<uint16_t>(its_reliable, DESIRED_RELIABLE_2277_0022, "RELIABLE_TEST_2277_0022");
+ check<uint16_t>(its_unreliable, DESIRED_UNRELIABLE_2277_0022, "UNRELIABLE_TEST_2277_0022");
+ check<std::string>(its_multicast, DESIRED_MULTICAST_2277_0022, "MULTICAST_TEST_2277_0022");
+
+ std::string its_address_s = its_configuration->get_address(0x1234, 0x0022);
+ uint32_t its_min_initial_delay = its_configuration->get_min_initial_delay(0x1234, 0x0022);
+ uint32_t its_max_initial_delay = its_configuration->get_max_initial_delay(0x1234, 0x0022);
+ uint32_t its_repetition_base_delay = its_configuration->get_repetition_base_delay(0x1234, 0x0022);
+ uint8_t its_repetition_max = its_configuration->get_repetition_max(0x1234, 0x0022);
+ uint32_t its_cyclic_offer_delay = its_configuration->get_cyclic_offer_delay(0x1234, 0x0022);
+ uint32_t its_cyclic_request_delay = its_configuration->get_cyclic_request_delay(0x1234, 0x0022);
+
+ check<std::string>(its_address_s, DESIRED_ADDRESS_1234_0022, "ADDRESS_TEST_1234_0022");
+ check<uint32_t>(its_min_initial_delay, DESIRED_MIN_INITIAL_DELAY_1234_0022, "MIN_INITIAL_DELAY_TEST_1234_0022");
+ check<uint32_t>(its_max_initial_delay, DESIRED_MAX_INITIAL_DELAY_1234_0022, "MAX_INITIAL_DELAY_TEST_1234_0022");
+ check<uint32_t>(its_repetition_base_delay, DESIRED_REPETITION_BASE_DELAY_1234_0022, "REPETITION_BASE_DELAY_TEST_1234_0022");
+ check<uint8_t>(its_repetition_max, DESIRED_REPETITION_MAX_1234_0022, "REPETITION_MAX_TEST_1234_0022");
+ check<uint32_t>(its_cyclic_offer_delay, DESIRED_CYCLIC_OFFER_DELAY_1234_0022, "CYCLIC_OFFER_DELAY_TEST_1234_0022");
+ check<uint32_t>(its_cyclic_request_delay, DESIRED_CYCLIC_REQUEST_DELAY_1234_0022, "CYCLIC_REQUEST_DELAY_TEST_1234_0022");
+
+ its_min_initial_delay = its_configuration->get_min_initial_delay(0x1234, 0x0023);
+ its_max_initial_delay = its_configuration->get_max_initial_delay(0x1234, 0x0023);
+ its_repetition_base_delay = its_configuration->get_repetition_base_delay(0x1234, 0x0023);
+ its_repetition_max = its_configuration->get_repetition_max(0x1234, 0x0023);
+ its_cyclic_offer_delay = its_configuration->get_cyclic_offer_delay(0x1234, 0x0023);
+ its_cyclic_request_delay = its_configuration->get_cyclic_request_delay(0x1234, 0x0023);
+
+ check<uint32_t>(its_min_initial_delay, DESIRED_MIN_INITIAL_DELAY_1234_0022, "MIN_INITIAL_DELAY_TEST_1234_0023");
+ check<uint32_t>(its_max_initial_delay, DESIRED_MAX_INITIAL_DELAY_1234_0022, "MAX_INITIAL_DELAY_TEST_1234_0023");
+ check<uint32_t>(its_repetition_base_delay, DESIRED_REPETITION_BASE_DELAY_1234_0022, "REPETITION_BASE_DELAY_TEST_1234_0023");
+ check<uint8_t>(its_repetition_max, DESIRED_REPETITION_MAX_1234_0022, "REPETITION_MAX_TEST_1234_0023");
+ check<uint32_t>(its_cyclic_offer_delay, DESIRED_CYCLIC_OFFER_DELAY_1234_0022, "CYCLIC_OFFER_DELAY_TEST_1234_0023");
+ check<uint32_t>(its_cyclic_request_delay, DESIRED_CYCLIC_REQUEST_DELAY_1234_0022, "CYCLIC_REQUEST_DELAY_TEST_1234_0023");
+
+ its_min_initial_delay = its_configuration->get_min_initial_delay(0x2277, 0x0022);
+ its_max_initial_delay = its_configuration->get_max_initial_delay(0x2277, 0x0022);
+ its_repetition_base_delay = its_configuration->get_repetition_base_delay(0x2277, 0x0022);
+ its_repetition_max = its_configuration->get_repetition_max(0x2277, 0x0022);
+ its_cyclic_offer_delay = its_configuration->get_cyclic_offer_delay(0x2277, 0x0022);
+ its_cyclic_request_delay = its_configuration->get_cyclic_request_delay(0x2277, 0x0022);
+
+ check<uint32_t>(its_min_initial_delay, DESIRED_MIN_INITIAL_DELAY_2277_0022, "MIN_INITIAL_DELAY_TEST_2277_0022");
+ check<uint32_t>(its_max_initial_delay, DESIRED_MAX_INITIAL_DELAY_2277_0022, "MAX_INITIAL_DELAY_TEST_2277_0022");
+ check<uint32_t>(its_repetition_base_delay, DESIRED_REPETITION_BASE_DELAY_2277_0022, "REPETITION_BASE_DELAY_TEST_2277_0022");
+ check<uint8_t>(its_repetition_max, DESIRED_REPETITION_MAX_2277_0022, "REPETITION_MAX_TEST_2277_0022");
+ check<uint32_t>(its_cyclic_offer_delay, DESIRED_CYCLIC_OFFER_DELAY_2277_0022, "CYCLIC_OFFER_DELAY_TEST_2277_0022");
+ check<uint32_t>(its_cyclic_request_delay, DESIRED_CYCLIC_REQUEST_DELAY_2277_0022, "CYCLIC_REQUEST_DELAY_TEST_2277_0022");
+
+ its_min_initial_delay = its_configuration->get_min_initial_delay(0x2266, 0x0022);
+ its_max_initial_delay = its_configuration->get_max_initial_delay(0x2266, 0x0022);
+ its_repetition_base_delay = its_configuration->get_repetition_base_delay(0x2266, 0x0022);
+ its_repetition_max = its_configuration->get_repetition_max(0x2266, 0x0022);
+ its_cyclic_offer_delay = its_configuration->get_cyclic_offer_delay(0x2266, 0x0022);
+ its_cyclic_request_delay = its_configuration->get_cyclic_request_delay(0x2266, 0x0022);
+
+ check<uint32_t>(its_min_initial_delay, DESIRED_MIN_INITIAL_DELAY_2277_0022, "MIN_INITIAL_DELAY_TEST_2266_0022");
+ check<uint32_t>(its_max_initial_delay, DESIRED_MAX_INITIAL_DELAY_2277_0022, "MAX_INITIAL_DELAY_TEST_2266_0022");
+ check<uint32_t>(its_repetition_base_delay, DESIRED_REPETITION_BASE_DELAY_2277_0022, "REPETITION_BASE_DELAY_TEST_2266_0022");
+ check<uint8_t>(its_repetition_max, DESIRED_REPETITION_MAX_2277_0022, "REPETITION_MAX_TEST_2266_0022");
+ check<uint32_t>(its_cyclic_offer_delay, DESIRED_CYCLIC_OFFER_DELAY_2277_0022, "CYCLIC_OFFER_DELAY_TEST_2266_0022");
+ check<uint32_t>(its_cyclic_request_delay, DESIRED_CYCLIC_REQUEST_DELAY_2277_0022, "CYCLIC_REQUEST_DELAY_TEST_2266_0022");
+
+ its_address_s = its_configuration->get_address(0x4466, 0x0321);
+ check<std::string>(its_address_s, DESIRED_ADDRESS_4466_0321, "ADDRESS_TEST_4466_0321");
+
+ // 5. Service discovery
+ std::string host = its_configuration->get_service_discovery_host();
+ std::string protocol = its_configuration->get_service_discovery_protocol();
+ uint16_t port = its_configuration->get_service_discovery_port();
+
+ check<std::string>(host, DESIRED_HOST, "SERVICE DISCOVERY HOST");
+ check<std::string>(protocol, DESIRED_PROTOCOL, "SERVICE DISCOVERY PROTOCOL");
+ check<uint16_t>(port, DESIRED_PORT, "SERVICE DISCOVERY PORT");
+
+ return 0;
+}
+
+
+
diff --git a/implementation/utility/include/utility.hpp b/implementation/utility/include/utility.hpp
new file mode 100644
index 0000000..bb5c040
--- /dev/null
+++ b/implementation/utility/include/utility.hpp
@@ -0,0 +1,41 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_UTILITY_HPP
+#define VSOMEIP_UTILITY_HPP
+
+#include <memory>
+#include <vector>
+
+#include <vsomeip/enumeration_types.hpp>
+#include <vsomeip/message.hpp>
+
+namespace vsomeip {
+
+class utility {
+public:
+ static void * load_library(const std::string &_path, const std::string &_symbol);
+
+ static inline bool is_request(std::shared_ptr< message > _message) {
+ return (_message ? is_request(_message->get_message_type()) : false);
+ }
+
+ static inline bool is_request(byte_t _type) {
+ return is_request(static_cast< message_type_e >(_type));
+ }
+
+ static inline bool is_request(message_type_e _type) {
+ return ((_type < message_type_e::NOTIFICATION) ||
+ (_type >= message_type_e::REQUEST_ACK &&
+ _type <= message_type_e::REQUEST_NO_RETURN_ACK));
+ }
+
+ static uint32_t get_message_size(std::vector< byte_t > &_data);
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_UTILITY_HPP
diff --git a/implementation/utility/src/utility.cpp b/implementation/utility/src/utility.cpp
new file mode 100644
index 0000000..bdeca6c
--- /dev/null
+++ b/implementation/utility/src/utility.cpp
@@ -0,0 +1,40 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#include <dlfcn.h>
+
+#include <vsomeip/defines.hpp>
+#include <vsomeip/logger.hpp>
+
+#include "../include/utility.hpp"
+#include "../../message/include/byteorder.hpp"
+
+namespace vsomeip {
+
+uint32_t utility::get_message_size(std::vector< byte_t > &_data) {
+ uint32_t its_size(0);
+ if (VSOMEIP_SOMEIP_HEADER_SIZE <= _data.size()) {
+ its_size = VSOMEIP_SOMEIP_HEADER_SIZE +
+ VSOMEIP_BYTES_TO_LONG(
+ _data[4], _data[5], _data[6], _data[7]);
+ }
+ return its_size;
+}
+
+void * utility::load_library(const std::string &_path, const std::string &_symbol) {
+ void * its_symbol = 0;
+
+ void *handle = dlopen(_path.c_str(), RTLD_LAZY | RTLD_GLOBAL);
+ if (0 != handle) {
+ its_symbol = dlsym(handle, _symbol.c_str());
+ } else {
+ VSOMEIP_ERROR << "Loading failed: (" << dlerror() << ")";
+ }
+
+ return its_symbol;
+}
+
+} // namespace vsomeip
diff --git a/interface/vsomeip/application.hpp b/interface/vsomeip/application.hpp
new file mode 100644
index 0000000..72ae28c
--- /dev/null
+++ b/interface/vsomeip/application.hpp
@@ -0,0 +1,89 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_APPLICATION_HPP
+#define VSOMEIP_APPLICATION_HPP
+
+#include <vector>
+
+#include <vsomeip/primitive_types.hpp>
+#include <vsomeip/enumeration_types.hpp>
+#include <vsomeip/constants.hpp>
+#include <vsomeip/handler.hpp>
+
+namespace vsomeip {
+
+class application {
+public:
+ virtual ~application() {};
+
+ // Lifecycle
+ virtual bool init(int _argc, char **_argv) = 0;
+ virtual void start() = 0;
+ virtual void stop() = 0;
+
+ // Provide services
+ virtual void offer_service(service_t _service, instance_t _instance,
+ major_version_t _major = VSOMEIP_DEFAULT_MAJOR,
+ minor_version_t _minor = VSOMEIP_DEFAULT_MINOR,
+ ttl_t _ttl = VSOMEIP_DEFAULT_TTL) = 0;
+
+ virtual void stop_offer_service(service_t _service, instance_t _instance) = 0;
+
+ virtual void publish_eventgroup(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup,
+ major_version_t _major, ttl_t _ttl) = 0;
+
+ virtual void stop_publish_eventgroup(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup) = 0;
+
+ // Consume services
+ virtual void request_service(service_t _service, instance_t _instance,
+ major_version_t _major = VSOMEIP_ANY_MAJOR,
+ minor_version_t _minor = VSOMEIP_ANY_MINOR,
+ ttl_t _ttl = VSOMEIP_ANY_TTL) = 0;
+
+ virtual void release_service(service_t _service, instance_t _instance) = 0;
+
+ virtual void subscribe(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup) = 0;
+
+ virtual void unsubscribe(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup) = 0;
+
+ virtual bool is_available(service_t _service, instance_t _instance) = 0;
+
+ // Define content of eventgroups
+ virtual void add_event(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event) = 0;
+
+ virtual void add_field(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event,
+ std::vector< byte_t > &_value) = 0;
+
+ virtual void remove_event_or_field(service_t _service, instance_t _instance,
+ eventgroup_t _eventgroup, event_t _event) = 0;
+
+ // Send messages
+ virtual void send(std::shared_ptr< message > _message,
+ bool _flush = true, bool _reliable = false) = 0;
+
+ // Set events/fields
+ virtual void set(service_t _service, instance_t _instance,
+ event_t _event, std::vector< byte_t > &_value) = 0;
+
+ // Receive messages
+ virtual bool register_message_handler(service_t _service, instance_t _instance, method_t _method, message_handler_t _handler) = 0;
+ virtual bool unregister_message_handler(service_t _service, instance_t _instance, method_t _method) = 0;
+
+ // Receive availability
+ virtual bool register_availability_handler(service_t _service, instance_t _instance, availability_handler_t _handler) = 0;
+ virtual bool unregister_availability_handler(service_t _service, instance_t _instance) = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_APPLICATION_HPP
diff --git a/interface/vsomeip/configuration.hpp b/interface/vsomeip/configuration.hpp
new file mode 100644
index 0000000..f3d1cc0
--- /dev/null
+++ b/interface/vsomeip/configuration.hpp
@@ -0,0 +1,67 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_CONFIGURATION_HPP
+#define VSOMEIP_CONFIGURATION_HPP
+
+#include <set>
+#include <string>
+
+#include <boost/asio/ip/address.hpp>
+#include <boost/log/trivial.hpp>
+
+#include <vsomeip/defines.hpp>
+#include <vsomeip/primitive_types.hpp>
+
+namespace vsomeip {
+
+class configuration {
+public:
+ static configuration * get(const std::string &_path = VSOMEIP_DEFAULT_CONFIGURATION_FILE_PATH);
+ virtual ~configuration() {};
+
+ virtual bool load(const std::string &_path) = 0;
+
+ virtual const boost::asio::ip::address & get_address() const = 0;
+ virtual bool is_v4() const = 0;
+ virtual bool is_v6() const = 0;
+
+ virtual bool has_console_log() const = 0;
+ virtual bool has_file_log() const = 0;
+ virtual bool has_dlt_log() const = 0;
+ virtual const std::string & get_logfile() const = 0;
+ virtual boost::log::trivial::severity_level get_loglevel() const = 0;
+
+ virtual const std::string & get_routing_host() const = 0;
+
+ virtual bool is_service_discovery_enabled() const = 0;
+ virtual const std::string & get_service_discovery_host() const = 0;
+ virtual const std::string & get_service_discovery_protocol() const = 0;
+ virtual uint16_t get_service_discovery_port() const = 0;
+
+ virtual std::string get_address(service_t _service, instance_t _instance) const = 0;
+
+ virtual uint32_t get_min_initial_delay(service_t _service, instance_t _instance) const = 0;
+ virtual uint32_t get_max_initial_delay(service_t _service, instance_t _instance) const = 0;
+
+ virtual uint32_t get_repetition_base_delay(service_t _service, instance_t _instance) const = 0;
+ virtual uint8_t get_repetition_max(service_t _service, instance_t _instance) const = 0;
+
+ virtual uint32_t get_cyclic_offer_delay(service_t _service, instance_t _instance) const = 0;
+ virtual uint32_t get_cyclic_request_delay(service_t _service, instance_t _instance) const = 0;
+
+ virtual uint16_t get_reliable_port(service_t _service, instance_t _instance) const = 0;
+ virtual uint16_t get_unreliable_port(service_t _service, instance_t _instance) const = 0;
+ virtual std::string get_multicast(service_t _service, instance_t _instance) const = 0;
+
+ virtual std::set< std::pair< service_t, instance_t > > get_remote_services() const = 0;
+
+ virtual client_t get_id(const std::string &_name) const = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_CONFIGURATION_HPP
diff --git a/interface/vsomeip/constants.hpp b/interface/vsomeip/constants.hpp
new file mode 100644
index 0000000..0727ce8
--- /dev/null
+++ b/interface/vsomeip/constants.hpp
@@ -0,0 +1,46 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_CONSTANTS_HPP
+#define VSOMEIP_CONSTANTS_HPP
+
+#include <string>
+
+#include <vsomeip/primitive_types.hpp>
+#include <vsomeip/enumeration_types.hpp>
+
+namespace vsomeip {
+
+const std::string VSOMEIP_ROUTING_BASE_PATH = "/tmp/vsomeip-";
+
+const major_version_t VSOMEIP_DEFAULT_MAJOR = 0x01;
+const minor_version_t VSOMEIP_DEFAULT_MINOR = 0x000000;
+const ttl_t VSOMEIP_DEFAULT_TTL = 3600;
+
+const std::string VSOMEIP_DEFAULT_MULTICAST = "224.0.0.0";
+const uint16_t VSOMEIP_DEFAULT_PORT = 30500;
+const uint16_t VSOMEIP_ILLEGAL_PORT = 0xFFFF;
+
+const service_t VSOMEIP_ANY_SERVICE = 0xFFFF;
+const instance_t VSOMEIP_ANY_INSTANCE = 0xFFFF;
+const method_t VSOMEIP_ANY_METHOD = 0xFFFF;
+const major_version_t VSOMEIP_ANY_MAJOR = 0xFF;
+const minor_version_t VSOMEIP_ANY_MINOR = 0xFFFFFF;
+const ttl_t VSOMEIP_ANY_TTL = 1;
+
+const byte_t VSOMEIP_MAGIC_COOKIE_CLIENT_MESSAGE_ID = 0x00;
+const byte_t VSOMEIP_MAGIC_COOKIE_SERVICE_MESSAGE_ID = 0x80;
+const length_t VSOMEIP_MAGIC_COOKIE_SIZE = 0x00000008;
+const request_t VSOMEIP_MAGIC_COOKIE_REQUEST_ID = 0xDEADBEEF;
+const protocol_version_t VSOMEIP_MAGIC_COOKIE_PROTOCOL_VERSION = 0x01;
+const interface_version_t VSOMEIP_MAGIC_COOKIE_INTERFACE_VERSION = 0x01;
+const message_type_e VSOMEIP_MAGIC_COOKIE_CLIENT_MESSAGE_TYPE = message_type_e::REQUEST_NO_RETURN;
+const message_type_e VSOMEIP_MAGIC_COOKIE_SERVICE_MESSAGE_TYPE = message_type_e::NOTIFICATION;
+const return_code_e VSOMEIP_MAGIC_COOKIE_RETURN_CODE = return_code_e::E_OK;
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_CONSTANTS_HPP
diff --git a/interface/vsomeip/defines.hpp b/interface/vsomeip/defines.hpp
new file mode 100644
index 0000000..a7dde6c
--- /dev/null
+++ b/interface/vsomeip/defines.hpp
@@ -0,0 +1,37 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_DEFINES_HPP
+#define VSOMEIP_DEFINES_HPP
+
+#define VSOMEIP_DEFAULT_CONFIGURATION_FILE_PATH "/etc/vsomeip.conf"
+
+#define VSOMEIP_PROTOCOL_VERSION 0x1
+
+
+#define VSOMEIP_MAX_LOCAL_MESSAGE_SIZE 32768
+#define VSOMEIP_MAX_TCP_MESSAGE_SIZE 4095
+#define VSOMEIP_MAX_UDP_MESSAGE_SIZE 1446
+
+#define VSOMEIP_SOMEIP_HEADER_SIZE 8
+#define VSOMEIP_SOMEIP_MAGIC_COOKIE_SIZE 8
+
+#define VSOMEIP_SERVICE_POS_MIN 0
+#define VSOMEIP_SERVICE_POS_MAX 1
+#define VSOMEIP_METHOD_POS_MIN 2
+#define VSOMEIP_METHOD_POS_MAX 3
+#define VSOMEIP_LENGTH_POS_MIN 4
+#define VSOMEIP_LENGTH_POS_MAX 7
+#define VSOMEIP_CLIENT_POS_MIN 8
+#define VSOMEIP_CLIENT_POS_MAX 9
+#define VSOMEIP_SESSION_POS_MIN 10
+#define VSOMEIP_SESSION_POS_MAX 11
+#define VSOMEIP_PROTOCOL_VERSION_POS 12
+#define VSOMEIP_INTERFACE_VERSION_POS 13
+#define VSOMEIP_MESSAGE_TYPE_POS 14
+#define VSOMEIP_RETURN_CODE_POS 15
+
+#endif // VSOMEIP_DEFINES_HPP
diff --git a/interface/vsomeip/deserializable.hpp b/interface/vsomeip/deserializable.hpp
new file mode 100644
index 0000000..1743c5d
--- /dev/null
+++ b/interface/vsomeip/deserializable.hpp
@@ -0,0 +1,22 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_DESERIALIZABLE_HPP
+#define VSOMEIP_DESERIALIZABLE_HPP
+
+namespace vsomeip {
+
+class deserializer;
+
+class deserializable {
+public:
+ virtual ~deserializable() {};
+ virtual bool deserialize(deserializer *_from) = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERIALIZABLE_HPP
diff --git a/interface/vsomeip/enumeration_types.hpp b/interface/vsomeip/enumeration_types.hpp
new file mode 100644
index 0000000..cd40e30
--- /dev/null
+++ b/interface/vsomeip/enumeration_types.hpp
@@ -0,0 +1,47 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_ENUMERATION_TYPES_HPP
+#define VSOMEIP_ENUMERATION_TYPES_HPP
+
+#include <cstdint>
+
+namespace vsomeip {
+
+// SIP_RPC_684
+enum class message_type_e : uint8_t {
+ REQUEST = 0x00,
+ REQUEST_NO_RETURN = 0x01,
+ NOTIFICATION = 0x02,
+ REQUEST_ACK = 0x40,
+ REQUEST_NO_RETURN_ACK = 0x41,
+ NOTIFICATION_ACK = 0x42,
+ RESPONSE = 0x80,
+ ERROR = 0x81,
+ RESPONSE_ACK = 0xC0,
+ ERROR_ACK = 0xC1,
+ UNKNOWN = 0xFF
+};
+
+// SIP_RPC_371
+enum class return_code_e : uint8_t {
+ E_OK = 0x00,
+ E_NOT_OK = 0x01,
+ E_UNKNOWN_SERVICE = 0x02,
+ E_UNKNOWN_METHOD = 0x03,
+ E_NOT_READY = 0x04,
+ E_NOT_REACHABLE = 0x05,
+ E_TIMEOUT = 0x06,
+ E_WRONG_PROTOCOL_VERSION = 0x07,
+ E_WRONG_INTERFACE_VERSION = 0x08,
+ E_MALFORMED_MESSAGE = 0x09,
+ E_WRONG_MESSAGE_TYPE = 0xA,
+ E_UNKNOWN = 0xFF
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_ENUMERATION_TYPES_HPP
diff --git a/interface/vsomeip/handler.hpp b/interface/vsomeip/handler.hpp
new file mode 100644
index 0000000..04b1247
--- /dev/null
+++ b/interface/vsomeip/handler.hpp
@@ -0,0 +1,24 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_HANDLER_HPP
+#define VSOMEIP_HANDLER_HPP
+
+#include <functional>
+#include <memory>
+
+#include <vsomeip/primitive_types.hpp>
+
+namespace vsomeip {
+
+class message;
+
+typedef std::function< void (std::shared_ptr< message > &) > message_handler_t;
+typedef std::function< void (service_t, instance_t, bool) > availability_handler_t;
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_HANDLER_HPP
diff --git a/interface/vsomeip/logger.hpp b/interface/vsomeip/logger.hpp
new file mode 100644
index 0000000..7a6843c
--- /dev/null
+++ b/interface/vsomeip/logger.hpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_LOGGER_HPP
+#define VSOMEIP_LOGGER_HPP
+
+#include <string>
+
+#include <boost/log/sources/severity_logger.hpp>
+#include <boost/log/trivial.hpp>
+
+namespace vsomeip {
+
+class logger {
+public:
+ static logger & get_logger();
+
+ virtual ~logger() {};
+
+ virtual boost::log::sources::severity_logger<
+ boost::log::trivial::severity_level > & get_internal() = 0;
+};
+
+#define VSOMEIP_FATAL BOOST_LOG_SEV(vsomeip::logger::get_logger().get_internal(), boost::log::trivial::severity_level::fatal)
+#define VSOMEIP_ERROR BOOST_LOG_SEV(vsomeip::logger::get_logger().get_internal(), boost::log::trivial::severity_level::error)
+#define VSOMEIP_WARNING BOOST_LOG_SEV(vsomeip::logger::get_logger().get_internal(), boost::log::trivial::severity_level::warning)
+#define VSOMEIP_INFO BOOST_LOG_SEV(vsomeip::logger::get_logger().get_internal(), boost::log::trivial::severity_level::info)
+#define VSOMEIP_DEBUG BOOST_LOG_SEV(vsomeip::logger::get_logger().get_internal(), boost::log::trivial::severity_level::debug)
+#define VSOMEIP_TRACE BOOST_LOG_SEV(vsomeip::logger::get_logger().get_internal(), boost::log::trivial::severity_level::trace)
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_LOGGER_HPP
diff --git a/interface/vsomeip/message.hpp b/interface/vsomeip/message.hpp
new file mode 100644
index 0000000..4f16d25
--- /dev/null
+++ b/interface/vsomeip/message.hpp
@@ -0,0 +1,27 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_MESSAGE_HPP
+#define VSOMEIP_MESSAGE_HPP
+
+#include <vsomeip/message_base.hpp>
+
+namespace vsomeip {
+
+class payload;
+
+class message
+ : virtual public message_base {
+public:
+ virtual ~message() {};
+
+ virtual payload & get_payload() = 0;
+ virtual const payload & get_payload() const = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_MESSAGE_HPP
diff --git a/interface/vsomeip/message_base.hpp b/interface/vsomeip/message_base.hpp
new file mode 100644
index 0000000..b80d0b6
--- /dev/null
+++ b/interface/vsomeip/message_base.hpp
@@ -0,0 +1,59 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_MESSAGE_BASE_HPP
+#define VSOMEIP_MESSAGE_BASE_HPP
+
+#include <vsomeip/primitive_types.hpp>
+#include <vsomeip/enumeration_types.hpp>
+#include <vsomeip/deserializable.hpp>
+#include <vsomeip/serializable.hpp>
+
+namespace vsomeip {
+
+class message_base
+ : public serializable,
+ public deserializable {
+public:
+ virtual ~message_base() {};
+
+ virtual message_t get_message() const = 0;
+ virtual void set_message(message_t _message) = 0;
+
+ virtual service_t get_service() const = 0;
+ virtual void set_service(service_t _service) = 0;
+
+ virtual instance_t get_instance() const = 0;
+ virtual void set_instance(instance_t _instance) = 0;
+
+ virtual method_t get_method() const = 0;
+ virtual void set_method(method_t _method) = 0;
+
+ virtual length_t get_length() const = 0;
+
+ virtual request_t get_request() const = 0;
+
+ virtual client_t get_client() const = 0;
+ virtual void set_client(client_t _client) = 0;
+
+ virtual session_t get_session() const = 0;
+ virtual void set_session(session_t _session) = 0;
+
+ virtual protocol_version_t get_protocol_version() const = 0;
+
+ virtual interface_version_t get_interface_version() const = 0;
+ virtual void set_interface_version(interface_version_t _version) = 0;
+
+ virtual message_type_e get_message_type() const = 0;
+ virtual void set_message_type(message_type_e _type) = 0;
+
+ virtual return_code_e get_return_code() const = 0;
+ virtual void set_return_code(return_code_e _code) = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_MESSAGE_BASE_HPP
diff --git a/interface/vsomeip/payload.hpp b/interface/vsomeip/payload.hpp
new file mode 100644
index 0000000..e683521
--- /dev/null
+++ b/interface/vsomeip/payload.hpp
@@ -0,0 +1,31 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_PAYLOAD_HPP
+#define VSOMEIP_PAYLOAD_HPP
+
+#include <vector>
+#include <vsomeip/primitive_types.hpp>
+
+namespace vsomeip {
+
+class payload {
+public:
+ virtual ~payload() {};
+
+ virtual byte_t * get_data() = 0;
+ virtual const byte_t * get_data() const = 0;
+ virtual void set_data(const byte_t *_data, length_t _length) = 0;
+ virtual void set_data(const std::vector< byte_t > &_data) = 0;
+
+ virtual length_t get_length() const = 0;
+
+ virtual void set_capacity(length_t _length) = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_PAYLOAD_HPP
diff --git a/interface/vsomeip/primitive_types.hpp b/interface/vsomeip/primitive_types.hpp
new file mode 100644
index 0000000..9ad4ff7
--- /dev/null
+++ b/interface/vsomeip/primitive_types.hpp
@@ -0,0 +1,40 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_PRIMITIVE_TYPES_HPP
+#define VSOMEIP_PRIMITIVE_TYPES_HPP
+
+#include <cstdint>
+
+namespace vsomeip {
+
+typedef uint32_t message_t;
+typedef uint16_t service_t;
+typedef uint16_t method_t;
+typedef uint16_t event_t;
+
+typedef uint16_t instance_t;
+typedef uint16_t eventgroup_t;
+
+typedef uint8_t major_version_t;
+typedef uint32_t minor_version_t;
+
+typedef uint32_t ttl_t;
+
+typedef uint32_t request_t;
+typedef uint16_t client_t;
+typedef uint16_t session_t;
+
+typedef uint32_t length_t;
+
+typedef uint8_t protocol_version_t;
+typedef uint8_t interface_version_t;
+
+typedef uint8_t byte_t;
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_PRIMITIVE_TYPES_HPP
diff --git a/interface/vsomeip/runtime.hpp b/interface/vsomeip/runtime.hpp
new file mode 100644
index 0000000..d25f63e
--- /dev/null
+++ b/interface/vsomeip/runtime.hpp
@@ -0,0 +1,31 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_RUNTIME_HPP
+#define VSOMEIP_RUNTIME_HPP
+
+#include <memory>
+#include <string>
+
+namespace vsomeip {
+
+class application;
+class message;
+
+class runtime {
+public:
+ static runtime * get();
+
+ virtual ~runtime() {};
+
+ virtual std::shared_ptr< application > create_application(const std::string &_name) const = 0;
+ virtual std::shared_ptr< message > create_request() const = 0;
+ virtual std::shared_ptr< message > create_response(std::shared_ptr< message > &_request) const = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_RUNTIME_HPP
diff --git a/interface/vsomeip/serializable.hpp b/interface/vsomeip/serializable.hpp
new file mode 100644
index 0000000..86714ed
--- /dev/null
+++ b/interface/vsomeip/serializable.hpp
@@ -0,0 +1,22 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_SERIALIZABLE_HPP
+#define VSOMEIP_SERIALIZABLE_HPP
+
+namespace vsomeip {
+
+class serializer;
+
+class serializable {
+public:
+ virtual ~serializable() {};
+ virtual bool serialize(serializer *_to) const = 0;
+};
+
+} // namespace vsomeip
+
+#endif // VSOMEIP_SERIALIZABLE_HPP
diff --git a/interface/vsomeip/vsomeip.hpp b/interface/vsomeip/vsomeip.hpp
new file mode 100644
index 0000000..cd1aa33
--- /dev/null
+++ b/interface/vsomeip/vsomeip.hpp
@@ -0,0 +1,18 @@
+// Copyright (C) 2014 BMW Group
+// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// 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/.
+
+#ifndef VSOMEIP_VSOMEIP_HPP
+#define VSOMEIP_VSOMEIP_HPP
+
+#include <vsomeip/constants.hpp>
+#include <vsomeip/defines.hpp>
+#include <vsomeip/application.hpp>
+#include <vsomeip/logger.hpp>
+#include <vsomeip/message.hpp>
+#include <vsomeip/payload.hpp>
+#include <vsomeip/runtime.hpp>
+
+#endif // VSOMEIP_VSOMEIP_HPP
diff --git a/vsomeip/vSomeIPConfig.cmake.in b/vSomeIPConfig.cmake.in
index 822a9d1..516f54e 100644
--- a/vsomeip/vSomeIPConfig.cmake.in
+++ b/vSomeIPConfig.cmake.in
@@ -12,4 +12,4 @@ if (NOT TARGET vsomeip AND NOT vSomeIP_BINARY_DIR)
endif ()
# These are IMPORTED targets created by vSomeIPTargets.cmake
-set (VSOMEIP_LIBRARIES vsomeip vsomeip-sd)
+set (VSOMEIP_LIBRARIES vsomeip)
diff --git a/vsomeip/vSomeIPConfigVersion.cmake.in b/vSomeIPConfigVersion.cmake.in
index 69988bd..69988bd 100644
--- a/vsomeip/vSomeIPConfigVersion.cmake.in
+++ b/vSomeIPConfigVersion.cmake.in
diff --git a/vsomeip-documentation/lh/LH10162833-SOMEIP.pdf b/vsomeip-documentation/lh/LH10162833-SOMEIP.pdf
deleted file mode 100755
index ef51bdd..0000000
--- a/vsomeip-documentation/lh/LH10162833-SOMEIP.pdf
+++ /dev/null
Binary files differ
diff --git a/vsomeip-documentation/lh/LH10162833_SOMEIP_Middleware_v02.pdf b/vsomeip-documentation/lh/LH10162833_SOMEIP_Middleware_v02.pdf
deleted file mode 100755
index 845d779..0000000
--- a/vsomeip-documentation/lh/LH10162833_SOMEIP_Middleware_v02.pdf
+++ /dev/null
Binary files differ
diff --git a/vsomeip-documentation/vsomeip-doxygen.conf b/vsomeip-documentation/vsomeip-doxygen.conf
deleted file mode 100644
index 9be4871..0000000
--- a/vsomeip-documentation/vsomeip-doxygen.conf
+++ /dev/null
@@ -1,2303 +0,0 @@
-# Doxyfile 1.8.6
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME = "Virtual Some/IP"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER =
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF = "vsomeip"
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
-# the documentation. The maximum height of the logo should not exceed 55 pixels
-# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
-# to the output directory.
-
-PROJECT_LOGO =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
-OUTPUT_DIRECTORY =
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES = YES
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
-# new page for each member. If set to NO, the documentation of a member will be
-# part of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE = 4
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:\n"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
-
-ALIASES =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding "class=itcl::class"
-# will allow you to use the command class in the itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C.
-#
-# Note For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT = YES
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by by putting a % sign in front of the word
-# or globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO these classes will be included in the various overviews. This option has
-# no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO these declarations will be
-# included in the documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-# The default value is: system dependent.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
-# todo list. This list is created by putting \todo commands in the
-# documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
-# test list. This list is created by putting \test commands in the
-# documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES the list
-# will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. Do not use file names with spaces, bibtex cannot handle them. See
-# also \cite for info how to create references.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO doxygen will only warn about wrong or incomplete parameter
-# documentation, but not about the absence of documentation.
-# The default value is: NO.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr).
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces.
-# Note: If this tag is empty the current directory is searched.
-
-INPUT = ../vsomeip/include/vsomeip ../vsomeip/include/vsomeip/service_discovery
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
-# possible encodings.
-# The default value is: UTF-8.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank the
-# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
-# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
-# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
-# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
-# *.qsf, *.as and *.js.
-
-FILE_PATTERNS = *.hpp
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER ) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
-ALPHABETICAL_INDEX = YES
-
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
-# defined cascading style sheet that is included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefor more robust against future updates.
-# Doxygen will copy the style sheet file to the output directory. For an example
-# see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the stylesheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_HUE = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_SAT = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_GAMMA = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler ( hhc.exe). If non-empty
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated (
-# YES) or that it should be included in the master .chm file ( NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated (
-# YES) or a normal table of contents ( NO) in the .chm file.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
-# folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS =
-
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW = NO
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using prerendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX = NO
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
-# are two flavours of web server based searching depending on the
-# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
-# searching and an index file used by the script. When EXTERNAL_SEARCH is
-# enabled the indexing and searching needs to be provided by external tools. See
-# the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SERVER_BASED_SEARCH = NO
-
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
-# Searching" for details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
-# The default value is: YES.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PAPER_TYPE = a4
-
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. To get the times font for
-# instance you can specify
-# EXTRA_PACKAGES=times
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
-#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
-# replace them by respectively the title of the page, the current date and time,
-# only the current date, the version number of doxygen, the project name (see
-# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PDF_HYPERLINKS = YES
-
-# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES to get a
-# higher quality PDF documentation.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BATCHMODE = NO
-
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HIDE_INDICES = NO
-
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_SOURCE_CODE = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE = plain
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
-# validating XML parser to check the syntax of the XML files.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
-# validating XML parser to check the syntax of the XML files.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT = docbook
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
-# Definitions (see http://autogen.sf.net) file that captures the structure of
-# the code including all documentation. Note that this feature is still
-# experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
-# in the source code. If set to NO only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES the includes files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all refrences to function-like macros that are alone on a line, have an
-# all uppercase name, and do not end with a semicolon. Such function macros are
-# typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have an unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
-# class index. If set to NO only the inherited external classes will be listed.
-# The default value is: NO.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
-# the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
-
-EXTERNAL_GROUPS = YES
-
-# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: NO.
-
-HAVE_DOT = NO
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NUM_THREADS = 0
-
-# When you want a differently looking font n the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTNAME = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LOOK = NO
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LIMIT_NUM_FIELDS = 10
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-TEMPLATE_RELATIONS = NO
-
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDE_GRAPH = YES
-
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot.
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, jpg, gif and svg.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_IMAGE_FORMAT = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS =
-
-# The DIAFILE_DIRS tag can be used to specify one or more directories that
-# contain dia files that are included in the documentation (see the \diafile
-# command).
-
-DIAFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
-# files that are used to generate the various graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_CLEANUP = YES
diff --git a/vsomeip/.cproject b/vsomeip/.cproject
deleted file mode 100644
index 6fec042..0000000
--- a/vsomeip/.cproject
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
- <storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1538001612">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.1538001612" moduleId="org.eclipse.cdt.core.settings" name="Default">
- <externalSettings/>
- <extensions>
- <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
- </extensions>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="vsomeip" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.1538001612" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="cdt.managedbuild.toolchain.gnu.base.1538001612.211409989" name="/" resourcePath="">
- <toolChain id="cdt.managedbuild.toolchain.gnu.base.380084093" name="cdt.managedbuild.toolchain.gnu.base" superClass="cdt.managedbuild.toolchain.gnu.base">
- <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.458522511" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
- <builder arguments="-C ${ProjDirPath}/build" command="make" id="cdt.managedbuild.target.gnu.builder.base.1324818350" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
- <tool id="cdt.managedbuild.tool.gnu.archiver.base.2106204695" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
- <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1514960538" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
- <option id="gnu.cpp.compiler.option.include.paths.438053815" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="/usr/include/c++/4.6.3"/>
- </option>
- <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1425046678" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
- </tool>
- <tool id="cdt.managedbuild.tool.gnu.c.compiler.base.125794219" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
- <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.682023459" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
- </tool>
- <tool id="cdt.managedbuild.tool.gnu.c.linker.base.1016765402" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
- <tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.503949080" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
- <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1133443621" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
- <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
- <additionalInput kind="additionalinput" paths="$(LIBS)"/>
- </inputType>
- </tool>
- <tool id="cdt.managedbuild.tool.gnu.assembler.base.948864063" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
- <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1647146464" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
- </tool>
- </toolChain>
- </folderInfo>
- </configuration>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
- </cconfiguration>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="vsomeip.null.1480451156" name="vsomeip"/>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="refreshScope" versionNumber="2">
- <configuration configurationName="Default">
- <resource resourceType="PROJECT" workspacePath="/vsomeip"/>
- </configuration>
- </storageModule>
- <storageModule moduleId="scannerConfiguration">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1538001612;cdt.managedbuild.toolchain.gnu.base.1538001612.211409989;cdt.managedbuild.tool.gnu.c.compiler.base.125794219;cdt.managedbuild.tool.gnu.c.compiler.input.682023459">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- </scannerConfigBuildInfo>
- <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1538001612;cdt.managedbuild.toolchain.gnu.base.1538001612.211409989;cdt.managedbuild.tool.gnu.cpp.compiler.base.1514960538;cdt.managedbuild.tool.gnu.cpp.compiler.input.1425046678">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- </scannerConfigBuildInfo>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
- <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
- <buildTargets>
- <target name="Run cmake" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
- <buildCommand>cmake</buildCommand>
- <buildArguments>-E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=debug ../</buildArguments>
- <buildTarget/>
- <stopOnError>true</stopOnError>
- <useDefaultCommand>false</useDefaultCommand>
- <runAllBuilders>true</runAllBuilders>
- </target>
- </buildTargets>
- </storageModule>
-</cproject>
diff --git a/vsomeip/.gitignore b/vsomeip/.gitignore
deleted file mode 100644
index 3804c7e..0000000
--- a/vsomeip/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/build/*
-/.settings
diff --git a/vsomeip/.project b/vsomeip/.project
deleted file mode 100644
index b9969e8..0000000
--- a/vsomeip/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>vsomeip</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
- <triggers>clean,full,incremental,</triggers>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.cdt.core.cnature</nature>
- <nature>org.eclipse.cdt.core.ccnature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
- </natures>
-</projectDescription>
diff --git a/vsomeip/.settings/org.eclipse.core.resources.prefs b/vsomeip/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 9b5a6ec..0000000
--- a/vsomeip/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,16 +0,0 @@
-eclipse.preferences.version=1
-encoding//include/vsomeip/application.hpp=UTF-8
-encoding//include/vsomeip_internal/application_impl.hpp=UTF-8
-encoding//include/vsomeip_internal/client_impl.hpp=UTF-8
-encoding//include/vsomeip_internal/constants.hpp=UTF-8
-encoding//include/vsomeip_internal/participant.hpp=UTF-8
-encoding//include/vsomeip_internal/participant_impl.hpp=UTF-8
-encoding//include/vsomeip_internal/service_impl.hpp=UTF-8
-encoding//include/vsomeip_internal/statistics_owner_impl.hpp=UTF-8
-encoding//include/vsomeip_internal/tcp_client_impl.hpp=UTF-8
-encoding//include/vsomeip_internal/udp_client_impl.hpp=UTF-8
-encoding//src/vsomeip.base/application_impl.cpp=UTF-8
-encoding//src/vsomeip.base/client_impl.cpp=UTF-8
-encoding//src/vsomeip.base/participant_impl.cpp=UTF-8
-encoding//src/vsomeip.base/service_impl.cpp=UTF-8
-encoding//src/vsomeip.daemon/daemon_impl.cpp=UTF-8
diff --git a/vsomeip/build/.gitkeep b/vsomeip/build/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/vsomeip/build/.gitkeep
+++ /dev/null
diff --git a/vsomeip/include/boost_ext/asio/mq.hpp b/vsomeip/include/boost_ext/asio/mq.hpp
deleted file mode 100644
index 650f49e..0000000
--- a/vsomeip/include/boost_ext/asio/mq.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef BOOST_EXT_ASIO_MQ_HPP
-#define BOOST_EXT_ASIO_MQ_HPP
-
-#include <boost_ext/asio/mq/basic_message_queue.hpp>
-#include <boost_ext/asio/mq/basic_message_queue_service.hpp>
-
-namespace boost_ext {
-namespace asio {
-
-typedef mq::basic_message_queue< mq::basic_message_queue_service<> > message_queue;
-
-} // namespace asio
-} // namespace boost
-
-#endif // BOOST_ASIO_MQ_HPP
diff --git a/vsomeip/include/boost_ext/asio/mq/basic_message_queue.hpp b/vsomeip/include/boost_ext/asio/mq/basic_message_queue.hpp
deleted file mode 100644
index da253a1..0000000
--- a/vsomeip/include/boost_ext/asio/mq/basic_message_queue.hpp
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef BOOST_EXT_ASIO_MQ_BASIC_MESSAGE_QUEUE_HPP
-#define BOOST_EXT_ASIO_MQ_BASIC_MESSAGE_QUEUE_HPP
-
-#include <cstddef>
-#include <string>
-#include <boost/asio.hpp>
-
-namespace boost_ext {
-namespace asio {
-namespace mq {
-
-template <typename Service>
-class basic_message_queue
- : public boost::asio::basic_io_object<Service> {
-public:
- explicit basic_message_queue(boost::asio::io_service &io_service)
- : boost::asio::basic_io_object<Service>(io_service) {
- }
-
- void create(const std::string &name, std::size_t max_num_msgs, std::size_t max_msg_size) {
- return this->service.create(this->implementation, name, max_num_msgs, max_msg_size);
- }
-
- template <typename Handler>
- void async_create(const std::string &name, std::size_t max_num_msgs, std::size_t max_msg_size, Handler handler) {
- return this->service.async_create(this->implementation, name, max_num_msgs, max_msg_size, handler);
- }
-
- void open(const std::string &name) {
- return this->service.open(this->implementation, name);
- }
-
- template <typename Handler>
- void async_open(const std::string &name, Handler handler) {
- this->service.async_open(this->implementation, name, handler);
- }
-
- void close() {
- return this->service.close(this->implementation);
- }
-
- template <typename Handler>
- void async_close(Handler handler) {
- this->service.async_close(this->implementation, handler);
- }
-
- void unlink() {
- return this->service.unlink(this->implementation);
- }
-
- template <typename Handler>
- void async_unlink(Handler handler) {
- this->service.async_unlink(this->implementation, handler);
- }
-
- void send(const void *buffer, std::size_t buffer_size, unsigned int priority) {
- return this->service.send(this->implementation, buffer, buffer_size, priority);
- }
-
- template <typename Handler>
- void async_send(const void *buffer, std::size_t buffer_size, int priority, Handler handler) {
- return this->service.async_send(this->implementation, buffer, buffer_size, priority, handler);
- }
-
- void receive(void *buffer, std::size_t buffer_size, std::size_t &received_size, unsigned int &priority) {
- return this->service.receive(this->implementation, buffer, buffer_size, received_size, priority);
- }
-
- template <typename Handler>
- void async_receive(void *buffer, std::size_t buffer_size, Handler handler) {
- return this->service.async_receive(this->implementation, buffer, buffer_size, handler);
- }
-
- const std::string get_name() const {
- return this->service.get_name(this->implementation);
- }
-};
-
-} // mq
-} // asio
-} // boost_ext
-
-#endif // BOOST_EXT_ASIO_MQ_BASIC_MESSAGE_QUEUE
-
diff --git a/vsomeip/include/boost_ext/asio/mq/basic_message_queue_service.hpp b/vsomeip/include/boost_ext/asio/mq/basic_message_queue_service.hpp
deleted file mode 100644
index 691bb00..0000000
--- a/vsomeip/include/boost_ext/asio/mq/basic_message_queue_service.hpp
+++ /dev/null
@@ -1,290 +0,0 @@
-#ifndef BOOST_EXT_ASIO_MQ_BASIC_MESSAGE_QUEUE_SERVICE_HPP
-#define BOOST_EXT_ASIO_MQ_BASIC_MESSAGE_QUEUE_SERVICE_HPP
-
-#include <boost/asio/io_service.hpp>
-#include <boost/bind.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/weak_ptr.hpp>
-#include <boost/system/error_code.hpp>
-#include <boost/thread.hpp>
-#include <boost_ext/asio/mq/message_queue_adapter.hpp>
-
-namespace boost_ext {
-namespace asio {
-namespace mq {
-
-template <typename MessageQueueImpl = message_queue_adapter>
-class basic_message_queue_service
- : public boost::asio::io_service::service {
-
-public:
- static boost::asio::io_service::id id;
-
- explicit basic_message_queue_service(boost::asio::io_service &io_service)
- : boost::asio::io_service::service(io_service),
- async_work_(new boost::asio::io_service::work(async_io_service_)),
- async_thread_(boost::bind(&boost::asio::io_service::run, &async_io_service_)) {
- }
-
- typedef boost::shared_ptr<MessageQueueImpl> implementation_type;
-
- void construct(implementation_type &impl) {
- impl.reset(new MessageQueueImpl);
- }
-
- void destroy(implementation_type &impl) {
- impl.reset();
- }
-
- const std::string & get_name(const implementation_type &impl) const {
- return impl->get_name();
- }
-
- void create(implementation_type &impl, const std::string &name, std::size_t max_num_msgs, std::size_t max_msg_size) {
- boost::system::error_code ec;
- impl->create(name, max_num_msgs, max_msg_size, ec);
- boost::asio::detail::throw_error(ec);
- }
-
- template <typename Handler>
- class create_operation {
- public:
- create_operation(implementation_type &impl, boost::asio::io_service &io_service, const std::string &name, std::size_t max_num_msgs, std::size_t max_msg_size, Handler handler)
- : impl_(impl), io_service_(io_service), work_(io_service), name_(name), max_num_msgs_(max_num_msgs), max_msg_size_(max_msg_size), handler_(handler) {
- }
-
- void operator()() const {
- implementation_type impl = impl_.lock();
- if (impl) {
- boost::system::error_code ec;
- impl->create(name_, max_num_msgs_, max_msg_size_, ec);
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, ec));
- } else {
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, boost::asio::error::operation_aborted));
- }
- }
-
- private:
- boost::weak_ptr<MessageQueueImpl> impl_;
- boost::asio::io_service &io_service_;
- boost::asio::io_service::work work_;
- std::string name_;
- std::size_t max_num_msgs_;
- std::size_t max_msg_size_;
- Handler handler_;
- };
-
- template <typename Handler>
- void async_create(implementation_type &impl, const std::string &name, std::size_t max_num_msgs, std::size_t max_msg_size, Handler handler) {
- this->async_io_service_.post(create_operation<Handler>(impl, this->get_io_service(), name, max_num_msgs, max_msg_size, handler));
- }
-
- void open(implementation_type &impl, const std::string &name) {
- boost::system::error_code ec;
- impl->open(name, ec);
- boost::asio::detail::throw_error(ec);
- }
-
- template <typename Handler>
- class open_operation {
- public:
- open_operation(implementation_type &impl, boost::asio::io_service &io_service, const std::string &name, Handler handler)
- : impl_(impl), io_service_(io_service), work_(io_service), name_(name), handler_(handler) {
- }
-
- void operator()() const {
- implementation_type impl = impl_.lock();
- if (impl) {
- boost::system::error_code ec;
- impl->open(name_, ec);
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, ec));
- } else {
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, boost::asio::error::operation_aborted));
- }
- }
-
- private:
- boost::weak_ptr<MessageQueueImpl> impl_;
- boost::asio::io_service &io_service_;
- boost::asio::io_service::work work_;
- std::string name_;
- Handler handler_;
- };
-
- template <typename Handler>
- void async_open(implementation_type &impl, const std::string &name, Handler handler) {
- this->async_io_service_.post(open_operation<Handler>(impl, this->get_io_service(), name, handler));
- }
-
- void close(implementation_type &impl) {
- boost::system::error_code ec;
- impl->close(ec);
- boost::asio::detail::throw_error(ec);
- }
-
- template <typename Handler>
- class close_operation {
- public:
- close_operation(implementation_type &impl, boost::asio::io_service &io_service, Handler handler)
- : impl_(impl), io_service_(io_service), work_(io_service), handler_(handler) {
- }
-
- void operator()() const {
- implementation_type impl = impl_.lock();
- if (impl) {
- boost::system::error_code ec;
- impl->close(ec);
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, ec));
- } else {
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, boost::asio::error::operation_aborted));
- }
- }
-
- private:
- boost::weak_ptr<MessageQueueImpl> impl_;
- boost::asio::io_service &io_service_;
- boost::asio::io_service::work work_;
- Handler handler_;
- };
-
- template <typename Handler>
- void async_close(implementation_type &impl, Handler handler) {
- this->async_io_service_.post(close_operation<Handler>(impl, this->get_io_service(), handler));
- }
-
- void unlink(implementation_type &impl) {
- boost::system::error_code ec;
- impl->unlink(ec);
- boost::asio::detail::throw_error(ec);
- }
-
- template <typename Handler>
- class unlink_operation {
- public:
- unlink_operation(implementation_type &impl, boost::asio::io_service &io_service, Handler handler)
- : impl_(impl), io_service_(io_service), work_(io_service), handler_(handler) {
- }
-
- void operator()() const {
- implementation_type impl = impl_.lock();
- if (impl) {
- boost::system::error_code ec;
- impl->unlink(ec);
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, ec));
- } else {
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, boost::asio::error::operation_aborted));
- }
- }
-
- private:
- boost::weak_ptr<MessageQueueImpl> impl_;
- boost::asio::io_service &io_service_;
- boost::asio::io_service::work work_;
- Handler handler_;
- };
-
- template <typename Handler>
- void async_unlink(implementation_type &impl, Handler handler) {
- this->async_io_service_.post(unlink_operation<Handler>(impl, this->get_io_service(), handler));
- }
-
- void send(implementation_type &impl, const void *buffer, std::size_t buffer_size, unsigned int priority) {
- boost::system::error_code ec;
- impl->send(buffer, buffer_size, priority, ec);
- boost::asio::detail::throw_error(ec);
- }
-
- template <typename Handler>
- class send_operation {
- public:
- send_operation(implementation_type &impl, boost::asio::io_service &io_service, const void *buffer, std::size_t buffer_size, unsigned int priority, Handler handler)
- : impl_(impl), io_service_(io_service), work_(io_service), buffer_(buffer), buffer_size_(buffer_size), priority_(priority), handler_(handler) {
- }
-
- void operator()() const {
- implementation_type impl = impl_.lock();
- if (impl) {
- boost::system::error_code ec;
- impl->send(buffer_, buffer_size_, priority_, ec);
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, ec));
- } else {
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, boost::asio::error::operation_aborted));
- }
- }
-
- private:
- boost::weak_ptr<MessageQueueImpl> impl_;
- boost::asio::io_service &io_service_;
- boost::asio::io_service::work work_;
- const void *buffer_;
- std::size_t buffer_size_;
- unsigned int priority_;
- Handler handler_;
- };
-
- template <typename Handler>
- void async_send(implementation_type &impl, const void *buffer, std::size_t buffer_size, unsigned int priority, Handler handler) {
- this->async_io_service_.post(send_operation<Handler>(impl, this->get_io_service(), buffer, buffer_size, priority, handler));
- }
-
- void receive(implementation_type &impl, void *buffer, std::size_t buffer_size, std::size_t &received_size, unsigned int &priority) {
- boost::system::error_code ec;
- impl->receive(buffer, buffer_size, priority, ec);
- boost::asio::detail::throw_error(ec);
- }
-
- template <typename Handler>
- class receive_operation {
- public:
- receive_operation(implementation_type &impl, boost::asio::io_service &io_service, void *buffer, std::size_t buffer_size, Handler handler)
- : impl_(impl), io_service_(io_service), work_(io_service), buffer_(buffer), buffer_size_(buffer_size), received_size_(0), priority_(0), handler_(handler) {
- }
-
- void operator()() {
- implementation_type impl = impl_.lock();
- if (impl) {
- boost::system::error_code ec;
- impl->receive(buffer_, buffer_size_, received_size_, priority_, ec);
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, ec, received_size_, priority_));
- } else {
- this->io_service_.post(boost::asio::detail::bind_handler(handler_, boost::asio::error::operation_aborted, received_size_, priority_));
- }
- }
-
- private:
- boost::weak_ptr<MessageQueueImpl> impl_;
- boost::asio::io_service &io_service_;
- boost::asio::io_service::work work_;
- void *buffer_;
- std::size_t buffer_size_;
- std::size_t received_size_;
- unsigned int priority_;
- Handler handler_;
- };
-
- template <typename Handler>
- void async_receive(implementation_type &impl, void *buffer, std::size_t buffer_size, Handler handler) {
- this->async_io_service_.post(receive_operation<Handler>(impl, this->get_io_service(), buffer, buffer_size, handler));
- }
-
-private:
- void shutdown_service() {
- async_work_.reset();
- async_io_service_.stop();
- async_thread_.join();
- }
-
- boost::asio::io_service async_io_service_;
- boost::scoped_ptr<boost::asio::io_service::work> async_work_;
- boost::thread async_thread_;
-};
-
-template <typename MessageQueueImpl>
-boost::asio::io_service::id basic_message_queue_service<MessageQueueImpl>::id;
-
-} // mq
-} // asio
-} // boost_ext
-
-#endif // BOOST_EXT_ASIO_MQ_BASIC_MESSAGE_QUEUE_SERVICE_HPP
-
diff --git a/vsomeip/include/boost_ext/asio/mq/message_queue_adapter.hpp b/vsomeip/include/boost_ext/asio/mq/message_queue_adapter.hpp
deleted file mode 100644
index e4603ff..0000000
--- a/vsomeip/include/boost_ext/asio/mq/message_queue_adapter.hpp
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifndef BOOST_EXT_ASIO_MQ_MESSAGE_QUEUE_ADAPTER_HPP
-#define BOOST_EXT_ASIO_MQ_MESSAGE_QUEUE_ADAPTER_HPP
-
-#include <cstddef>
-#include <string>
-
-#include <mqueue.h>
-
-#include <boost/asio/error.hpp>
-#include <boost/system/error_code.hpp>
-
-namespace boost_ext {
-namespace asio {
-namespace mq {
-
-#if defined(LINUX)
-const mqd_t INVALID = -1;
-#elif defined(FREEBSD)
-const mqd_t INVALID(reinterpret_cast< mqd_t >(-1));
-#else
-#error "OS undefined (only Linux and FreeBSD are currently supported)"
-#endif
-
-class message_queue_adapter {
-public:
- message_queue_adapter() : id_(INVALID) {
- timeout_.tv_sec = 0;
- timeout_.tv_nsec = 5000000;
- }
-
- ~message_queue_adapter() {
- }
-
- void create(const std::string &name, std::size_t max_num_msgs, std::size_t max_msg_size, boost::system::error_code &ec) {
- struct mq_attr config;
- config.mq_maxmsg = max_num_msgs;
- config.mq_msgsize = max_msg_size;
- name_ = name;
-
- id_ = mq_open(name.c_str(), O_CREAT|O_RDWR, S_IRWXU|S_IRWXG, &config);
- if (id_ != INVALID) {
- ec = boost::system::error_code();
- } else {
- ec = boost::asio::error::operation_aborted;
- }
- }
-
- void open(const std::string &name, boost::system::error_code &ec) {
- name_ = name;
- id_ = mq_open(name.c_str(), O_WRONLY);
- if (id_ != INVALID) {
- ec = boost::system::error_code();
- } else {
- ec = boost::asio::error::operation_aborted;
- }
- }
-
- void close(boost::system::error_code &ec) {
- int e = mq_close(id_);
- if (e > 0) {
- ec = boost::system::error_code();
- } else {
- ec = boost::asio::error::operation_aborted;
- }
- }
-
- void unlink(boost::system::error_code &ec) {
- int e = mq_unlink(name_.c_str());
- if (e > 0) {
- ec = boost::system::error_code();
- } else {
- ec = boost::asio::error::operation_aborted;
- }
- }
-
- void send(const void *buffer, std::size_t buffer_size, unsigned int priority, boost::system::error_code &ec) {
- int e = mq_send(id_, (const char*)buffer, buffer_size, priority);
- if (e > -1) {
- ec = boost::system::error_code();
- } else {
- ec = boost::asio::error::operation_aborted;
- struct mq_attr config;
- e = mq_getattr(id_, &config);
-#ifdef VSOMEIP_QUEUE_DEBUG
- std::cout << "Queue ("
- << name_
- << ") state ["
- << config.mq_maxmsg
- << ", "
- << config.mq_msgsize
- << ", "
- << config.mq_curmsgs
- << ", "
- << config.mq_flags
- << "]" << std::endl;
-#endif
- }
- }
-
- void receive(void *buffer, std::size_t buffer_size, std::size_t &received_size, unsigned int &priority, boost::system::error_code &ec) {
- ssize_t bytes = mq_receive(id_, (char *)buffer, buffer_size, &priority);
- if (bytes > -1) {
- received_size = static_cast<std::size_t>(bytes);
- ec = boost::system::error_code();
- } else {
- received_size = 0;
- ec = boost::asio::error::operation_aborted;
- }
- }
-
- const std::string & get_name() const {
- return name_;
- }
-
-private:
- struct timespec timeout_;
- mqd_t id_;
- std::string name_;
-};
-
-} // namespace mq
-} // namespace asio
-} // namespace boost_ext
-
-#endif // BOOST_EXT_ASIO_MQ_MESSAGE_QUEUE_ADAPTER_HPP
-
diff --git a/vsomeip/include/boost_ext/asio/placeholders.hpp b/vsomeip/include/boost_ext/asio/placeholders.hpp
deleted file mode 100644
index 8930524..0000000
--- a/vsomeip/include/boost_ext/asio/placeholders.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef BOOST_EXT_ASIO_MQ_PLACEHOLDERS_HPP
-#define BOOST_EXT_ASIO_MQ_PLACEHOLDERS_HPP
-
-#include <boost/asio/placeholders.hpp>
-
-namespace boost_ext {
-namespace asio {
-namespace placeholders {
-
-#if defined(GENERATING_DOCUMENTATION)
-
-unspecified priority;
-
-#elif defined(BOOST_ASIO_HAS_BOOST_BIND)
-# if defined(__BORLANDC__) || defined(__GNUC__)
-
-inline boost::arg<2> priority()
-{
- return boost::arg<2>();
-}
-
-# else
-
-namespace detail
-{
- template <int Number>
- struct placeholder
- {
- static boost::arg<Number>& get()
- {
- static boost::arg<Number> result;
- return result;
- }
- };
-}
-
-# if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC < 1400)
-
-static boost::arg<2>& priority
- = boost::asio::placeholders::detail::placeholder<2>::get();
-
-# else
-
-namespace
-{
- boost::arg<2>& priority
- = boost::asio::placeholders::detail::placeholder<2>::get();
-} // namespace
-
-# endif
-# endif
-#endif
-
-} // namespace placeholders
-} // namespace asio
-} // namespace boost_ext
-
-#endif // BOOST_EXT_ASIO_MQ_PLACEHOLDERS_HPP
-
diff --git a/vsomeip/include/boost_ext/process.hpp b/vsomeip/include/boost_ext/process.hpp
deleted file mode 100644
index 97289b6..0000000
--- a/vsomeip/include/boost_ext/process.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef BOOST_EXT_PROCESS_HPP
-#define BOOST_EXT_PROCESS_HPP
-
-#if defined(_MSC_VER)&&(_MSC_VER>=1200)
-#pragma once
-#endif
-
-#include <boost/config.hpp>
-
-#if defined(BOOST_WINDOWS)&&!defined(BOOST_DISABLE_WIN32)
-
-#if defined(BOOST_USE_WINDOWS_H)
-#include <windows.h>
-#else
-namespace boost _ext {
-namespace process {
-
-extern "C" __declspec(dllimport)
-unsigned long __stdcall GetCurrentProcessId(void);
-
-} /* namespace process */
-} /* namespace boost_ext */
-#endif
-
-namespace boost{
-namespace flyweights{
-
-typedef unsigned long process_id_t;
-
-inline process_id_t process_id()
-{
- return GetCurrentProcessId();
-}
-
-} /* namespace flyweights::detail */
-
-} /* namespace flyweights */
-
-} /* namespace boost */
-
-#elif defined(BOOST_HAS_UNISTD_H)
-
-#include <unistd.h>
-
-namespace boost_ext {
-namespace process {
-
-typedef pid_t process_id_t;
-
-inline process_id_t process_id()
-{
- return ::getpid();
-}
-
-} /* namespace process */
-} /* namespace boost_ext */
-
-#else
-#error Unknown platform
-#endif
-
-#endif // BOOST_EXT_PROCESS_HPP
diff --git a/vsomeip/include/vsomeip/application.hpp b/vsomeip/include/vsomeip/application.hpp
deleted file mode 100644
index 69a5439..0000000
--- a/vsomeip/include/vsomeip/application.hpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// application.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_APPLICATION_HPP
-#define VSOMEIP_APPLICATION_HPP
-
-#include <functional>
-#include <memory>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-class field;
-class message;
-
-typedef std::function< void (std::shared_ptr< message > &) > message_handler_t;
-typedef std::function< void (service_id, instance_id, bool) > availability_handler_t;
-
-class application {
-public:
- virtual ~application() {};
-
- virtual std::string get_name() const = 0;
-
- virtual void init(int _options_count, char **_options) = 0;
- virtual void start() = 0;
- virtual void stop() = 0;
-
- // services (service side)
- virtual bool provide_service(
- service_id _service, instance_id _instance,
- const endpoint *_location) = 0;
- virtual bool withdraw_service(
- service_id _service, instance_id _instance,
- const endpoint *_location = 0) = 0;
-
- virtual bool start_service(
- service_id _service, instance_id _instance) = 0;
- virtual bool stop_service(
- service_id _service, instance_id _instance) = 0;
-
- // services (client side)
- virtual bool request_service(
- service_id _service, instance_id _instance,
- const endpoint *_location = 0) = 0;
- virtual bool release_service(
- service_id _service, instance_id _instance) = 0;
-
- virtual bool is_service_available(service_id _service, instance_id _instance) const = 0;
- virtual bool register_availability_handler(service_id _service, instance_id _instance,
- availability_handler_t _handler) = 0;
- virtual void deregister_availability_handler(service_id _service, instance_id _instance) = 0;
-
- // eventgroups (service side)
- virtual bool provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup,
- const endpoint *_location) = 0;
- virtual bool withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup,
- const endpoint *_location) = 0;
-
- virtual bool add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) = 0;
- virtual bool remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) = 0;
- virtual bool update_field(const field *_field) = 0;
-
- // eventgroups (client side)
- virtual bool request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) = 0;
- virtual bool release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) = 0;
-
- // send & receive
- virtual bool send(message *_message, bool _reliable = true, bool _flush = true) = 0;
-
- virtual bool enable_magic_cookies(service_id _service, instance_id _instance) = 0;
- virtual bool disable_magic_cookies(service_id _service, instance_id _instance) = 0;
-
- virtual bool register_message_handler(
- service_id _service, instance_id _instance, method_id _method, message_handler_t _handler) = 0;
- virtual void deregister_message_handler(
- service_id _service, instance_id _instance, method_id _method) = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_APPLICATION_HPP
diff --git a/vsomeip/include/vsomeip/config.hpp b/vsomeip/include/vsomeip/config.hpp
deleted file mode 100644
index b165c8d..0000000
--- a/vsomeip/include/vsomeip/config.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// config.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/protocol.hpp>
-
-#ifndef VSOMEIP_CONFIG_HPP
-#define VSOMEIP_CONFIG_HPP
-
-#define VSOMEIP_DEFAULT_CONFIGURATION_FILE_PATH "../vsomeip.conf"
-
-#define VSOMEIP_MAX_TCP_MESSAGE_SIZE 4095
-#define VSOMEIP_MAX_UDP_MESSAGE_SIZE 1446
-#define VSOMEIP_MIN_ENDPOINT_SIZE 6
-#define VSOMEIP_MAX_ENDPOINT_SIZE 131
-
-#define VSOMEIP_DEFAULT_QUEUE_SIZE (VSOMEIP_MAX_TCP_MESSAGE_SIZE \
- + VSOMEIP_MAX_ENDPOINT_SIZE \
- + VSOMEIP_PROTOCOL_OVERHEAD \
- + VSOMEIP_PROTOCOL_RESERVED)
-
-#define VSOMEIP_DEFAULT_CONNECT_TIMEOUT 1000
-#define VSOMEIP_DEFAULT_FLUSH_TIMEOUT 1000
-#define VSOMEIP_DEFAULT_RETRY_TIMEOUT 20
-
-#define VSOMEIP_DEFAULT_WATCHDOG_CYCLE 1000
-#define VSOMEIP_DEFAULT_WATCHDOG_TIMEOUT 200
-#define VSOMEIP_DEFAULT_MAX_MISSING_PONGS 3
-
-#define VSOMEIP_ANY_SERVICE 0xFFFF
-#define VSOMEIP_ANY_INSTANCE 0xFFFF
-#define VSOMEIP_ANY_METHOD 0xFFFF
-
-#define VSOMEIP_MIN_MULTICAST 0xE0000000
-
-#endif // VSOMEIP_CONFIG_HPP
diff --git a/vsomeip/include/vsomeip/deserializable.hpp b/vsomeip/include/vsomeip/deserializable.hpp
deleted file mode 100644
index a3bc705..0000000
--- a/vsomeip/include/vsomeip/deserializable.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// deserializable.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_DESERIALIZABLE_HPP
-#define VSOMEIP_DESERIALIZABLE_HPP
-
-namespace vsomeip {
-
-class deserializer;
-
-class deserializable {
-public:
- virtual bool deserialize(deserializer *_from) = 0;
-
-protected:
- virtual ~deserializable() {};
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_SERIALIZABLE_HPP
diff --git a/vsomeip/include/vsomeip/endpoint.hpp b/vsomeip/include/vsomeip/endpoint.hpp
deleted file mode 100644
index e8d37c4..0000000
--- a/vsomeip/include/vsomeip/endpoint.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// endpoint.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_ENDPOINT_HPP
-#define VSOMEIP_ENDPOINT_HPP
-
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/serializable.hpp>
-
-namespace vsomeip {
-
-class endpoint
- : public serializable {
-public:
- virtual ~endpoint() {};
-
- virtual ip_address get_address() const = 0;
- virtual ip_port get_port() const = 0;
- virtual ip_protocol get_protocol() const = 0;
- virtual ip_protocol_version get_version() const = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_ENDPOINT_HPP
diff --git a/vsomeip/include/vsomeip/enumeration_types.hpp b/vsomeip/include/vsomeip/enumeration_types.hpp
deleted file mode 100644
index 1d6ac27..0000000
--- a/vsomeip/include/vsomeip/enumeration_types.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// enumeration_types.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_ENUMERATION_TYPES_HPP
-#define VSOMEIP_ENUMERATION_TYPES_HPP
-
-#include <cstdint>
-
-namespace vsomeip {
-
-/// \enum message_type
-/// Message type constants according to Some/IP specificiation.
-enum class message_type_enum : uint8_t {
- REQUEST = 0x0,
- REQUEST_NO_RETURN = 0x1,
- NOTIFICATION = 0x2,
- REQUEST_ACK = 0x40,
- REQUEST_NO_RETURN_ACK = 0x41,
- NOTIFICATION_ACK = 0x42,
- RESPONSE = 0x80,
- ERROR = 0x81,
- RESPONSE_ACK = 0xC0,
- ERROR_ACK = 0xC1,
- UNKNOWN = 0xFF
-};
-
-/// \enum return_code
-/// Return code constants according to Some/IP specificiation.
-enum class return_code_enum : uint8_t {
- OK = 0x0,
- NOT_OK = 0x1,
- UNKNOWN_SERVICE = 0x2,
- UNKNOWN_METHOD = 0x3,
- NOT_READY = 0x4,
- NOT_REACHABLE = 0x5,
- TIMEOUT = 0x6,
- WRONG_PROTOCOL_VERSION = 0x7,
- WRONG_INTERFACE_VERSION = 0x8,
- MALFORMED_MESSAGE = 0x9,
- UNKNOWN = 0xFF
-};
-
-/// \enum ip_protocol
-/// Constants representing the supported transport protocols.
-enum class ip_protocol : uint8_t {
- UDP = 0x06,
- TCP = 0x11,
- UNKNOWN = 0xFF
-};
-
-/// \enum ip_protocol_version
-/// Constants representing the supported transport protocol versions.
-enum class ip_protocol_version : uint8_t {
- V4 = 0x04,
- V6 = 0x06,
- UNKNOWN = 0xFF
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_ENUMERATION_TYPES_HPP
diff --git a/vsomeip/include/vsomeip/factory.hpp b/vsomeip/include/vsomeip/factory.hpp
deleted file mode 100644
index e6220f0..0000000
--- a/vsomeip/include/vsomeip/factory.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// factory.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_FACTORY_HPP
-#define VSOMEIP_FACTORY_HPP
-
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class application;
-class endpoint;
-class field;
-class message;
-
-class factory {
-public:
- virtual ~factory() {};
-
- static factory * get_instance();
-
- virtual application * create_application(const std::string &_name) const = 0;
-
- virtual endpoint * get_endpoint(ip_address _address, ip_port _port, ip_protocol _protocol) = 0;
- virtual endpoint * get_endpoint(const uint8_t *_bytes, uint32_t _size) = 0;
-
- virtual message * create_message() const = 0;
- virtual message * create_response(const message *_request) const = 0;
-
- virtual field * create_field(application *_application, service_id _service, instance_id _instance, event_id _event) const = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_FACTORY_HPP
-
diff --git a/vsomeip/include/vsomeip/field.hpp b/vsomeip/include/vsomeip/field.hpp
deleted file mode 100644
index 0cd8c78..0000000
--- a/vsomeip/include/vsomeip/field.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// field.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_FIELD_HPP
-#define VSOMEIP_FIELD_HPP
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-class payload;
-
-class field {
-public:
- virtual ~field() {};
-
- virtual service_id get_service() const = 0;
- virtual instance_id get_instance() const = 0;
- virtual event_id get_event() const = 0;
-
- virtual uint32_t get_update_cycle() const = 0;
- virtual void set_update_cycle(uint32_t _cycle) = 0;
-
- virtual const payload & get_payload() const = 0;
- virtual payload & get_payload() = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_FIELD_HPP
diff --git a/vsomeip/include/vsomeip/message.hpp b/vsomeip/include/vsomeip/message.hpp
deleted file mode 100644
index 6ed6c0e..0000000
--- a/vsomeip/include/vsomeip/message.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// message.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_MESSAGE_HPP
-#define VSOMEIP_MESSAGE_HPP
-
-#include <vsomeip/payload.hpp>
-#include <vsomeip/message_base.hpp>
-
-namespace vsomeip {
-
-/// Interface for application messages, consisting of header and payload.
-/// The header is accessible by methods inherited from the #message_base
-/// interface.
-class message : virtual public message_base {
-public:
- virtual ~message() {};
-
- /// Get a reference to the payload of the message object.
- /// \returns Reference to the message payload
- virtual payload & get_payload() = 0;
-
- /// Get a const reference to the payload of the message object
- /// \returns constant reference to the message payload
- virtual const payload & get_payload() const = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_MESSAGE_HPP
diff --git a/vsomeip/include/vsomeip/message_base.hpp b/vsomeip/include/vsomeip/message_base.hpp
deleted file mode 100644
index a5a1934..0000000
--- a/vsomeip/include/vsomeip/message_base.hpp
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// message_base.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_MESSAGE_BASE_HPP
-#define VSOMEIP_MESSAGE_BASE_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/deserializable.hpp>
-#include <vsomeip/serializable.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-/// Common base interface for application and service discovery messages. The
-/// interface provides set- and get-methods for all elements of a Some/IP
-/// message header and for the endpoint a message is sent to or received from.
-class message_base
- : public serializable,
- public deserializable {
-public:
- virtual ~message_base() {};
-
- virtual const endpoint * get_source() const = 0;
- virtual void set_source(const endpoint *_target) = 0;
- virtual const endpoint * get_target() const = 0;
- virtual void set_target(const endpoint *_target) = 0;
-
- /// Returns the message identifier of the Some/IP message, which is
- /// composed from the service identifier and the method identifier.
- /// \returns message identifier of the Some/IP message
- virtual message_id get_message_id() const = 0;
-
- /// Sets service identifier and method identifier. The message identifier
- /// itself is not stored.
- /// \param _id New message identifier
- virtual void set_message_id(message_id _id) = 0;
-
- /// Returns the service identifier of the Some/IP message.
- /// \returns service identifier of the Some/IP message
- virtual service_id get_service_id() const = 0;
-
- /// Sets the service identifier within the Some/IP message header.
- /// \param _id New service identifier
- virtual void set_service_id(service_id _id) = 0;
-
- /// Returns the instance identifier of the service that has sent the Some/IP message.
- /// \returns instance identifier
- virtual instance_id get_instance_id() const = 0;
-
- /// Set the instance id. The instance id is NOT part of the SOME/IP
- /// header but can be used to provide the necessary routing information
- /// \param _id instance identifier
- virtual void set_instance_id(instance_id _id) = 0;
-
- /// Returns the method identifier of the Some/IP message.
- /// \returns method identifier of the Some/IP message
- virtual method_id get_method_id() const = 0;
-
- /// Sets the method identifier within the Some/IP message header.
- /// \param _id New method identifier
- virtual void set_method_id(method_id _id) = 0;
-
- /// Returns the length of the Some/IP message. The returned value is the
- /// length of the payload plus the static header part (request identifier
- /// and flags).
- /// \returns length of the message
- virtual length get_length() const = 0;
-
- /// Returns the message identifier of the Some/IP message, which is
- /// composed from the client identifier and the session identifier.
- /// \returns message identifier of the Some/IP message
- virtual request_id get_request_id() const = 0;
-
- /// Sets client identifier and session identifier. The request identifier
- /// itself is not stored.
- /// \param _id New request identifier
- virtual void set_request_id(request_id _id) = 0;
-
- /// Returns the client identifier of the Some/IP message.
- /// \returns client identifier of the Some/IP message
- virtual client_id get_client_id() const = 0;
-
- /// Sets the client identifier within the Some/IP message header.
- /// \param _id New client identifier
- virtual void set_client_id(client_id _id) = 0;
-
- /// Returns the session identifier of the Some/IP message.
- /// \returns session identifier of the Some/IP message
- virtual session_id get_session_id() const = 0;
-
- /// Sets the session identifier of a message object.
- /// \param _id New session identifier
- virtual void set_session_id(session_id _id) = 0;
-
- /// Returns the protocol version of the Some/IP message. Defaults to 0x1.
- /// \returns protocol version of the Some/IP message
- virtual protocol_version get_protocol_version() const = 0;
-
- /// Sets the protocol version within the Some/IP message header.
- /// \param _id New protocol version
- /// \warning There is currently no need to call this method from an
- /// application.
- virtual void set_protocol_version(protocol_version _version) = 0;
-
- /// Returns the interface version of the Some/IP message header.
- /// \returns interface version of the Some/IP message
- virtual interface_version get_interface_version() const = 0;
-
- /// Sets the interface version within the Some/IP message header.
- /// \param _id New interface version
- virtual void set_interface_version(interface_version _version) = 0;
-
- /// Returns the method type of the Some/IP message header.
- /// \returns message type of the Some/IP message
- virtual message_type_enum get_message_type() const = 0;
-
- /// Sets the message type within the Some/IP message header.
- /// \param _id New message type
- virtual void set_message_type(message_type_enum _type) = 0;
-
- /// Returns the return code of the Some/IP message header.
- /// \returns return code of the Some/IP message
- virtual return_code_enum get_return_code() const = 0;
-
- /// Sets the return code within the Some/IP message header.
- /// \param _id New return code
- virtual void set_return_code(return_code_enum _code) = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_MESSAGE_BASE_HPP
diff --git a/vsomeip/include/vsomeip/payload.hpp b/vsomeip/include/vsomeip/payload.hpp
deleted file mode 100644
index ba62d6f..0000000
--- a/vsomeip/include/vsomeip/payload.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// payload.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_PAYLOAD_HPP
-#define VSOMEIP_PAYLOAD_HPP
-
-#include <vector>
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-/// Interface for the payload of a Some/IP message. Contains method
-/// to set the data within the payload.
-class payload {
-public:
- /// Get the internal data buffer of the payload object.
- /// \returns Pointer to the internal data buffer
- virtual uint8_t * get_data() = 0;
-
- /// Get a read-only pointer to the internal data
- virtual const uint8_t * get_data() const = 0;
-
- /// Get the length of the internal data buffer of the payload object. The
- /// length is the valid part of the internal buffer and is not necessarily
- /// the same as the buffers capacity.
- /// \returns Length of the internal data buffer
- virtual uint32_t get_length() const = 0;
-
- /// Set the maximum number of bytes the internal buffer can contain.
- /// \param _length New capacity of the internal buffer.
- /// \warning If the new length is smaller than the current length, data will be lost.
- virtual void set_capacity(uint32_t _length) = 0;
-
- /// Set the values of the internal data buffer of a payload object. Copies
- /// #_length bytes from #_data to the internal buffer.
- /// \param _data Pointer to the source data buffer
- /// \param _length Number of bytes that will be copied from #_data
- virtual void set_data(const uint8_t *_data, uint32_t _length) = 0;
-
- /// Set the values of the internal data buffer of a payload object. Copies
- /// #_data.size() bytes from #_data to the internal buffer.
- /// \param _data Reference to the source data buffer.
- virtual void set_data(const std::vector<uint8_t>& _data) = 0;
-
-protected:
- /// Intentionally undocumented.
- virtual ~payload() {};
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_PAYLOAD_HPP
diff --git a/vsomeip/include/vsomeip/primitive_types.hpp b/vsomeip/include/vsomeip/primitive_types.hpp
deleted file mode 100644
index c807502..0000000
--- a/vsomeip/include/vsomeip/primitive_types.hpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// primitive_types.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_PRIMITIVE_TYPES_HPP
-#define VSOMEIP_PRIMITIVE_TYPES_HPP
-
-#include <cstdint>
-#include <string>
-
-namespace vsomeip {
-
-typedef uint32_t message_id;
-typedef uint16_t service_id;
-typedef uint16_t method_id;
-typedef uint16_t event_id;
-
-typedef uint32_t length;
-
-typedef uint32_t request_id;
-typedef uint16_t client_id;
-typedef uint16_t session_id;
-
-typedef uint8_t protocol_version;
-typedef uint8_t interface_version;
-
-typedef uint8_t flags;
-typedef uint8_t event_type;
-typedef uint8_t option_index;
-typedef uint16_t instance_id;
-typedef uint8_t major_version;
-typedef uint32_t time_to_live;
-typedef uint32_t minor_version;
-typedef uint16_t eventgroup_id;
-
-typedef std::string ip_address;
-typedef uint32_t ipv4_address;
-typedef uint8_t ipv6_address[128];
-typedef uint16_t ip_port;
-
-typedef uint16_t priority;
-typedef uint16_t weight;
-
-typedef uint32_t alive_counter;
-typedef uint32_t crc;
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_PRIMITIVE_TYPES_HPP
diff --git a/vsomeip/include/vsomeip/sd/configuration_option.hpp b/vsomeip/include/vsomeip/sd/configuration_option.hpp
deleted file mode 100644
index 44fb7a9..0000000
--- a/vsomeip/include/vsomeip/sd/configuration_option.hpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// configuration_option.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_CONFIGURATION_OPTION_HPP
-#define VSOMEIP_SD_CONFIGURATION_OPTION_HPP
-
-#include <string>
-#include <vsomeip/sd/option.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class configuration_option
- : virtual public option {
-public:
- virtual ~configuration_option() {};
-
- virtual void add_item(const std::string &_key, const std::string &_value) = 0;
- virtual void remove_item(const std::string &_key) = 0;
-
- virtual std::vector<std::string> get_keys() const = 0;
- virtual std::vector<std::string> get_values() const = 0;
-
- virtual std::string get_value(const std::string &_key) const = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_CONFIGURATION_OPTION_HPP
diff --git a/vsomeip/include/vsomeip/sd/constants.hpp b/vsomeip/include/vsomeip/sd/constants.hpp
deleted file mode 100644
index 227f278..0000000
--- a/vsomeip/include/vsomeip/sd/constants.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// entry.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_CONFIG_HPP
-#define VSOMEIP_SD_CONFIG_HPP
-
-#define VSOMEIP_SERVICE_DISCOVERY_HEADER 0xFFFF8100
-
-#endif // VSOMEIP_SD_CONFIG_HPP
diff --git a/vsomeip/include/vsomeip/sd/entry.hpp b/vsomeip/include/vsomeip/sd/entry.hpp
deleted file mode 100755
index 52b0eef..0000000
--- a/vsomeip/include/vsomeip/sd/entry.hpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// entry.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_ENTRY_HPP
-#define VSOMEIP_SD_ENTRY_HPP
-
-#include <vector>
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/serializable.hpp>
-#include <vsomeip/deserializable.hpp>
-#include <vsomeip/sd/enumeration_types.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class option;
-
-class entry
- : virtual public serializable,
- virtual public deserializable {
-public:
- virtual ~entry() {};
-
- virtual entry_type get_type() const = 0;
- virtual void set_type(entry_type _type) = 0;
-
- virtual service_id get_service_id() const = 0;
- virtual void set_service_id(service_id _id) = 0;
-
- virtual instance_id get_instance_id() const = 0;
- virtual void set_instance_id(instance_id _id) = 0;
-
- virtual major_version get_major_version() const = 0;
- virtual void set_major_version(major_version _version) = 0;
-
- virtual time_to_live get_time_to_live() const = 0;
- virtual void set_time_to_live(time_to_live _ttl) = 0;
-
- const virtual std::vector< uint8_t > & get_options(uint8_t _run) const = 0;
- virtual void assign_option(const option& _option, uint8_t _run) = 0;
-
- virtual bool is_service_entry() const = 0;
- virtual bool is_eventgroup_entry() const = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_ENTRY_HPP
diff --git a/vsomeip/include/vsomeip/sd/eventgroup_entry.hpp b/vsomeip/include/vsomeip/sd/eventgroup_entry.hpp
deleted file mode 100644
index b3866ac..0000000
--- a/vsomeip/include/vsomeip/sd/eventgroup_entry.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// eventgroup_entry.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_EVENTGROUP_ENTRY_HPP
-#define VSOMEIP_SD_EVENTGROUP_ENTRY_HPP
-
-#include <vsomeip/sd/entry.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class eventgroup_entry
- : virtual public entry {
-public:
- virtual ~eventgroup_entry() {};
-
- virtual eventgroup_id get_eventgroup_id() const = 0;
- virtual void set_eventgroup_id(eventgroup_id _id) = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_EVENTGROUP_ENTRY_HPP
diff --git a/vsomeip/include/vsomeip/sd/factory.hpp b/vsomeip/include/vsomeip/sd/factory.hpp
deleted file mode 100644
index effd392..0000000
--- a/vsomeip/include/vsomeip/sd/factory.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// factory.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_FACTORY_HPP
-#define VSOMEIP_SD_FACTORY_HPP
-
-#include <boost/asio/io_service.hpp>
-
-#define VSOMEIP_SD_LIBRARY "libvsomeip-sd.so"
-#define VSOMEIP_SD_FACTORY_SYMBOL VSOMEIP_SD_FACTORY
-#define VSOMEIP_SD_FACTORY_SYMBOL_STRING "VSOMEIP_SD_FACTORY"
-
-namespace vsomeip {
-
-class daemon;
-
-namespace sd {
-
-class message;
-class service_discovery;
-
-class factory {
-public:
- virtual ~factory() {};
-
- static factory * get_instance();
-
- virtual service_discovery * create_service_discovery(daemon &_daemon) const = 0;
-
- virtual message * create_message() const = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_FACTORY_HPP
diff --git a/vsomeip/include/vsomeip/sd/ipv4_endpoint_option.hpp b/vsomeip/include/vsomeip/sd/ipv4_endpoint_option.hpp
deleted file mode 100644
index 89c983b..0000000
--- a/vsomeip/include/vsomeip/sd/ipv4_endpoint_option.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// ip4endpoint_option.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_IPV4_ENDPOINT_OPTION_HPP
-#define VSOMEIP_SD_IPV4_ENDPOINT_OPTION_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/sd/option.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class ipv4_endpoint_option
- : virtual public option {
-public:
- virtual ~ipv4_endpoint_option() {};
-
- virtual ipv4_address get_address() const = 0;
- virtual void set_address(ipv4_address _address) = 0;
-
- virtual ip_port get_port() const = 0;
- virtual void set_port(ip_port _port) = 0;
-
- virtual ip_protocol get_protocol() const = 0;
- virtual void set_protocol(ip_protocol _protocol) = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_IPV4_ENDPOINT_OPTION_HPP
diff --git a/vsomeip/include/vsomeip/sd/ipv4_multicast_option.hpp b/vsomeip/include/vsomeip/sd/ipv4_multicast_option.hpp
deleted file mode 100644
index 673c85b..0000000
--- a/vsomeip/include/vsomeip/sd/ipv4_multicast_option.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// ipv4_multicast_option.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_IPV4_MULTICAST_OPTION_HPP
-#define VSOMEIP_SD_IPV4_MULTICAST_OPTION_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/sd/ipv4_endpoint_option.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class ipv4_multicast_option
- : virtual public ipv4_endpoint_option {
-public:
- virtual ~ipv4_multicast_option() {};
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_IPV4_MULTICAST_OPTION_HPP
diff --git a/vsomeip/include/vsomeip/sd/ipv6_endpoint_option.hpp b/vsomeip/include/vsomeip/sd/ipv6_endpoint_option.hpp
deleted file mode 100644
index 1483070..0000000
--- a/vsomeip/include/vsomeip/sd/ipv6_endpoint_option.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// ipv6endpoint_option.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_IPV6_ENDPOINT_OPTION_HPP
-#define VSOMEIP_SD_IPV6_ENDPOINT_OPTION_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/sd/option.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class ipv6_endpoint_option
- : virtual public option {
-public:
- virtual ~ipv6_endpoint_option() {};
-
- virtual const ipv6_address& get_address() const = 0;
- virtual void set_address(const ipv6_address &_address) = 0;
-
- virtual ip_port get_port() const = 0;
- virtual void set_port(ip_port _port) = 0;
-
- virtual ip_protocol get_protocol() const = 0;
- virtual void set_protocol(ip_protocol _protocol) = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_IPV6_ENDPOINT_OPTION_HPP
diff --git a/vsomeip/include/vsomeip/sd/ipv6_multicast_option.hpp b/vsomeip/include/vsomeip/sd/ipv6_multicast_option.hpp
deleted file mode 100644
index 299a89a..0000000
--- a/vsomeip/include/vsomeip/sd/ipv6_multicast_option.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// ipv6_multicast_option.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_IPV6_MULTICAST_OPTION_HPP
-#define VSOMEIP_SD_IPV6_MULTICAST_OPTION_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/sd/ipv6_endpoint_option.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class ipv6_multicast_option
- : virtual public ipv6_endpoint_option {
-public:
- virtual ~ipv6_multicast_option() {};
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_IPV6_MULTICAST_OPTION_HPP
diff --git a/vsomeip/include/vsomeip/sd/load_balancing_option.hpp b/vsomeip/include/vsomeip/sd/load_balancing_option.hpp
deleted file mode 100644
index 33f7133..0000000
--- a/vsomeip/include/vsomeip/sd/load_balancing_option.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// load_balancing_option.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_LOAD_BALANCING_OPTION_HPP
-#define VSOMEIP_SD_LOAD_BALANCING_OPTION_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/sd/option.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class load_balancing_option
- : virtual public option {
-public:
- virtual ~load_balancing_option() {};
-
- virtual priority get_priority() const = 0;
- virtual void set_priority(priority _priority) = 0;
-
- virtual weight get_weight() const = 0;
- virtual void set_weight(weight _weight) = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_LOAD_BALANCING_OPTION_HPP
diff --git a/vsomeip/include/vsomeip/sd/message.hpp b/vsomeip/include/vsomeip/sd/message.hpp
deleted file mode 100644
index bcde4c0..0000000
--- a/vsomeip/include/vsomeip/sd/message.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// message.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_MESSAGE_HPP
-#define VSOMEIP_SD_MESSAGE_HPP
-
-#include <vector>
-
-#include <vsomeip/message_base.hpp>
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class entry;
-class eventgroup_entry;
-class service_entry;
-
-class option;
-class configuration_option;
-class ipv4_endpoint_option;
-class ipv4_multicast_option;
-class ipv6_endpoint_option;
-class ipv6_multicast_option;
-class load_balancing_option;
-class protection_option;
-
-class message : virtual public vsomeip::message_base {
-public:
- virtual ~message() {};
-
- virtual bool get_reboot_flag() const = 0;
- virtual void set_reboot_flag(bool _is_set) = 0;
-
- virtual bool get_unicast_flag() const = 0;
- virtual void set_unicast_flag(bool _is_set) = 0;
-
- virtual eventgroup_entry & create_eventgroup_entry() = 0;
- virtual service_entry & create_service_entry() = 0;
-
- virtual configuration_option & create_configuration_option() = 0;
- virtual ipv4_endpoint_option & create_ipv4_endpoint_option() = 0;
- virtual ipv4_multicast_option & create_ipv4_multicast_option() = 0;
- virtual ipv6_endpoint_option & create_ipv6_endpoint_option() = 0;
- virtual ipv6_multicast_option & create_ipv6_multicast_option() = 0;
- virtual load_balancing_option & create_load_balancing_option() = 0;
- virtual protection_option & create_protection_option() = 0;
-
- virtual const std::vector<entry *> get_entries() const = 0;
- virtual const std::vector<option *> get_options() const = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_MESSAGE_HPP
diff --git a/vsomeip/include/vsomeip/sd/option.hpp b/vsomeip/include/vsomeip/sd/option.hpp
deleted file mode 100644
index 99164c1..0000000
--- a/vsomeip/include/vsomeip/sd/option.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// option.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_OPTION_HPP
-#define VSOMEIP_SD_OPTION_HPP
-
-#include <vsomeip/deserializable.hpp>
-#include <vsomeip/serializable.hpp>
-#include <vsomeip/sd/enumeration_types.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class option
- : public serializable,
- public deserializable {
-public:
- virtual ~option() {};
- virtual bool operator==(const option &_option) const = 0;
-
- virtual uint16_t get_length() const = 0;
- virtual option_type get_type() const = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_OPTION_HPP
diff --git a/vsomeip/include/vsomeip/sd/protection_option.hpp b/vsomeip/include/vsomeip/sd/protection_option.hpp
deleted file mode 100644
index cdc1c45..0000000
--- a/vsomeip/include/vsomeip/sd/protection_option.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// protection_option.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_PROTECTION_OPTION_HPP
-#define VSOMEIP_SD_PROTECTION_OPTION_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/sd/option.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class protection_option
- : virtual public option {
-public:
- virtual ~protection_option() {};
-
- virtual alive_counter get_alive_counter() const = 0;
- virtual void set_alive_counter(alive_counter _counter) = 0;
-
- virtual crc get_crc() const = 0;
- virtual void set_crc(crc _crc) = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_SD_PROTECTION_OPTION_HPP
diff --git a/vsomeip/include/vsomeip/sd/service_entry.hpp b/vsomeip/include/vsomeip/sd/service_entry.hpp
deleted file mode 100644
index ebbbb05..0000000
--- a/vsomeip/include/vsomeip/sd/service_entry.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// service_entry.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_SERVICE_ENTRY_HPP
-#define VSOMEIP_SD_SERVICE_ENTRY_HPP
-
-#include <vsomeip/sd/entry.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class service_entry
- : virtual public entry {
-public:
- virtual ~service_entry() {};
-
- virtual minor_version get_minor_version() const = 0;
- virtual void set_minor_version(minor_version version) = 0;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-
-#endif // VSOMEIP_SD_SERVICE_ENTRY_HPP
diff --git a/vsomeip/include/vsomeip/sd/vsomeip.hpp b/vsomeip/include/vsomeip/sd/vsomeip.hpp
deleted file mode 100644
index 587d324..0000000
--- a/vsomeip/include/vsomeip/sd/vsomeip.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// vsomeip.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SD_VSOMEIP_HPP
-#define VSOMEIP_SD_VSOMEIP_HPP
-
-#include <vsomeip/vsomeip.hpp>
-
-#include <vsomeip/sd/factory.hpp>
-
-#include <vsomeip/sd/eventgroup_entry.hpp>
-#include <vsomeip/sd/service_entry.hpp>
-
-#include <vsomeip/sd/configuration_option.hpp>
-#include <vsomeip/sd/ipv4_endpoint_option.hpp>
-#include <vsomeip/sd/ipv4_multicast_option.hpp>
-#include <vsomeip/sd/ipv6_endpoint_option.hpp>
-#include <vsomeip/sd/ipv6_multicast_option.hpp>
-#include <vsomeip/sd/load_balancing_option.hpp>
-#include <vsomeip/sd/protection_option.hpp>
-
-#include <vsomeip/sd/message.hpp>
-
-#endif // VSOMEIP_SD_VSOMEIP_HPP
diff --git a/vsomeip/include/vsomeip/serializable.hpp b/vsomeip/include/vsomeip/serializable.hpp
deleted file mode 100644
index a671c7d..0000000
--- a/vsomeip/include/vsomeip/serializable.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// serializable.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_SERIALIZABLE_HPP
-#define VSOMEIP_SERIALIZABLE_HPP
-
-namespace vsomeip {
-
-class serializer;
-
-class serializable {
-public:
- virtual bool serialize(serializer *_to) const = 0;
-
-protected:
- virtual ~serializable() {};
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_SERIALIZABLE_HPP
diff --git a/vsomeip/include/vsomeip/statistics.hpp b/vsomeip/include/vsomeip/statistics.hpp
deleted file mode 100644
index 4a4eed3..0000000
--- a/vsomeip/include/vsomeip/statistics.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// statistics.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_STATISTICS_HPP
-#define VSOMEIP_STATISTICS_HPP
-
-#ifdef USE_VSOMEIP_STATISTICS
-
-namespace vsomeip {
-
-/// Interface for sender/receiver statistics. Instances are embedded into
-/// #statistics_owner instances and provide methods to retrieve the current
-/// number of sent/received messages and bytes.
-class statistics {
-public:
- /// Intentionally undocumented.
- virtual ~statistics() {};
-
- /// Get the number of messages that were sent at the time of calling.
- /// \returns number of sent messages
- virtual uint32_t get_sent_messages_count() const = 0;
-
- /// Get the number of bytes that were sent at the time of calling.
- /// \returns number of sent bytes
- virtual uint32_t get_sent_bytes_count() const = 0;
-
- /// Get the number of messages that were received at the time of calling.
- /// \returns number of received messages
- virtual uint32_t get_received_messages_count() const = 0;
-
- /// Get the number of bytes that were received at the time of calling.
- /// \returns number of received bytes
- virtual uint32_t get_received_bytes_count() const = 0;
-
- /// Set the counters for sent/received messages and bytes to 0.
- virtual void reset() = 0;
-};
-
-} // namespace vsomeip
-
-#endif // USE_VSOMEIP_STATISTICS
-
-#endif // VSOMEIP_STATISTICS_HPP
diff --git a/vsomeip/include/vsomeip/version.hpp b/vsomeip/include/vsomeip/version.hpp
deleted file mode 100644
index 722eb94..0000000
--- a/vsomeip/include/vsomeip/version.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// version.hpp
-//
-// Author: Lutz Bichler
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_VERSION_HPP
-#define VSOMEIP_VERSION_HPP
-
-#define VSOMEIP_VERSION "0.1.0"
-
-#endif // VSOMEIP_VERSION_HPP
diff --git a/vsomeip/include/vsomeip/vsomeip.hpp b/vsomeip/include/vsomeip/vsomeip.hpp
deleted file mode 100644
index 90c9dd0..0000000
--- a/vsomeip/include/vsomeip/vsomeip.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// vsomeip.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_VSOMEIP_HPP
-#define VSOMEIP_VSOMEIP_HPP
-
-#include <vsomeip/config.hpp>
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/field.hpp>
-#include <vsomeip/message.hpp>
-#include <vsomeip/application.hpp>
-#include <vsomeip/factory.hpp>
-
-#endif // VSOMEIP_VSOMEIP_HPP
diff --git a/vsomeip/include/vsomeip_internal/administration_proxy_impl.hpp b/vsomeip/include/vsomeip_internal/administration_proxy_impl.hpp
deleted file mode 100644
index b7b6116..0000000
--- a/vsomeip/include/vsomeip_internal/administration_proxy_impl.hpp
+++ /dev/null
@@ -1,188 +0,0 @@
-//
-// administration_proxy_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_ADMINISTRATION_PROXY_IMPL_HPP
-#define VSOMEIP_ADMINISTRATION_PROXY_IMPL_HPP
-
-#include <deque>
-#include <map>
-#include <set>
-#include <vector>
-
-#include <boost/asio/system_timer.hpp>
-#include <boost/intrusive_ptr.hpp>
-#include <boost/shared_ptr.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/enumeration_types.hpp>
-#include <vsomeip_internal/message_queue.hpp>
-#include <vsomeip_internal/method_info.hpp>
-#include <vsomeip_internal/proxy_base_impl.hpp>
-
-namespace vsomeip {
-
-class payload;
-
-class administration_proxy_impl
- : virtual public proxy_base_impl {
-public:
- administration_proxy_impl(application_base_impl &_owner);
- virtual ~administration_proxy_impl();
-
- void init();
- void start();
- void stop();
-
- bool provide_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool withdraw_service(service_id _service, instance_id _instance, const endpoint *_location);
-
- bool start_service(service_id _service, instance_id _instance);
- bool stop_service(service_id _service, instance_id _instance);
-
- bool request_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool release_service(service_id _servive, instance_id _instance);
-
- void register_method(service_id _service, instance_id _instance, method_id _method);
- void deregister_method(service_id _service, instance_id _instance, method_id _method);
-
- bool provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location);
- bool withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location);
-
- bool request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
- bool release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
-
- bool add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field);
- bool remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field);
-
- void remove_queue(const std::string &_name);
-
-protected:
- void catch_up_registrations();
-
- void do_send(const std::vector< uint8_t > &_buffer);
- void do_send_buffer(const std::vector< uint8_t > &_buffer);
-
- void send_pong();
- void send_register_application();
- void send_deregister_application();
- void send_service_command(command_enum _command, service_id _service, instance_id _instance, const endpoint * _location = 0);
- void send_eventgroup_command(command_enum _command, service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint * _location = 0);
- void send_field_command(command_enum _command, service_id _service, instance_id _instance, eventgroup_id _eventgroup, event_id _field, const payload &_payload);
- void send_registration_command(command_enum _command, service_id _service, instance_id _instance, method_id _method);
-
- void do_receive();
-
- void process_message(std::size_t _bytes);
- virtual void process_command(command_enum _command, client_id _client, const uint8_t *_payload, uint32_t payload_size);
-
- void on_application_info(client_id _client, const uint8_t *_data, uint32_t _size);
- void on_application_lost(const uint8_t *_data, uint32_t _size);
- void on_request_service_ack(service_id _service, instance_id _instance, const std::string &_queue_name);
- virtual void on_service_availability(service_id _service, instance_id _instance, const endpoint *_location, bool _is_available);
-
- void remove_requested_services(message_queue *_queue);
-
-private:
- void create_cbk(boost::system::error_code const &);
- void open_cbk(boost::system::error_code const &);
- void retry_open_cbk(boost::system::error_code const &);
- void close_cbk(boost::system::error_code const &);
- void send_cbk(boost::system::error_code const &);
- void receive_cbk(boost::system::error_code const &, std::size_t, unsigned int);
- void request_cbk(boost::system::error_code const &, service_id, instance_id, message_queue *, const std::string &);
-
-protected:
- // Queues
- std::string queue_name_prefix_;
-
- std::string daemon_queue_name_;
- boost::shared_ptr< message_queue > daemon_queue_;
-
- std::string application_queue_name_;
- boost::shared_ptr< message_queue > application_queue_;
- int slots_;
-
- boost::asio::system_timer retry_timer_;
- uint32_t retry_timeout_;
-
- // Flags
- bool is_open_;
- bool is_created_;
- bool is_registered_;
-
- // Buffers
- std::deque< std::vector< uint8_t > > send_buffers_;
- uint8_t receive_buffer_[VSOMEIP_DEFAULT_QUEUE_SIZE];
-
- // Eventgroups consist of events/field and may contain a multicast
- struct eventgroup_info {
- eventgroup_info(const endpoint *_multicast)
- : multicast_(_multicast) {};
-
- const endpoint *multicast_;
- std::set< field * > fields_;
- };
-
- // Provided & requested services / eventgroups
- struct service_state {
- service_state()
- : is_started_(false) {};
-
- service_state(bool _is_started, const endpoint *_location)
- : is_started_(_is_started) {};
-
- bool is_started_;
- std::set< const endpoint * > locations_;
- std::map< eventgroup_id, eventgroup_info > eventgroups_;
- };
-
- typedef std::map< service_id,
- std::map< instance_id,
- service_state > > provided_services_t;
-
- typedef boost::intrusive_ptr< message_queue > message_queue_ptr_t;
-
- struct request_state {
- request_state()
- : queue_(0), location_(0) {};
-
- request_state(message_queue_ptr_t _queue, const endpoint *_location)
- : queue_(_queue), location_(_location) {};
-
- request_state & operator=(const request_state &_source) {
- queue_ = _source.queue_;
- location_ = _source.location_;
- eventgroups_ = _source.eventgroups_;
-
- return (*this);
- }
-
- const endpoint *location_;
- message_queue_ptr_t queue_;
- std::set< eventgroup_id > eventgroups_;
- };
-
- typedef std::map< service_id,
- std::map< instance_id,
- request_state > > requested_services_t;
-
- provided_services_t provided_;
- requested_services_t requested_;
-
- std::map< std::string, message_queue * > queues_;
- std::map< client_id, std::string > other_queue_names_;
-
- std::set< method_info > methods_;
-
- boost::mutex mutex_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_PROXY_HPP
diff --git a/vsomeip/include/vsomeip_internal/application_base_impl.hpp b/vsomeip/include/vsomeip_internal/application_base_impl.hpp
deleted file mode 100644
index a1012fe..0000000
--- a/vsomeip/include/vsomeip_internal/application_base_impl.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// application_base_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_APPLICATION_BASE_IMPL_HPP
-#define VSOMEIP_INTERNAL_APPLICATION_BASE_IMPL_HPP
-
-#include <boost/asio/io_service.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/log_owner.hpp>
-#include <vsomeip_internal/proxy_owner.hpp>
-#include <vsomeip_internal/serializer.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-class message;
-
-class application_base_impl :
- virtual public log_owner,
- virtual public proxy_owner {
-public:
- application_base_impl(const std::string &_name);
- virtual ~application_base_impl();
-
- virtual client_id get_id() const = 0;
- virtual void set_id(client_id _id) = 0;
-
- virtual std::string get_name() const = 0;
- virtual void set_name(const std::string &_name) = 0;
-
- virtual bool is_managing() const = 0;
-
- virtual boost::asio::io_service & get_sender_service() = 0;
- virtual boost::asio::io_service & get_receiver_service() = 0;
-
- virtual boost::shared_ptr< serializer > & get_serializer() = 0;
- virtual boost::shared_ptr< deserializer > & get_deserializer() = 0;
-
- virtual void catch_up_registrations() = 0;
- virtual void handle_message(std::shared_ptr< message > &_message) = 0;
- virtual void handle_availability(
- service_id _service, instance_id _instance,
- const endpoint *_location, bool _is_available) = 0;
- virtual void handle_subscription(
- service_id _service, instance_id _instance, eventgroup_id _eventgroup,
- const endpoint *_location, bool _is_subscribing) = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_APPLICATION_BASE_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/application_impl.hpp b/vsomeip/include/vsomeip_internal/application_impl.hpp
deleted file mode 100644
index c6c53e1..0000000
--- a/vsomeip/include/vsomeip_internal/application_impl.hpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// application_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_APPLICATION_IMPL_HPP
-#define VSOMEIP_APPLICATION_IMPL_HPP
-
-#include <map>
-#include <set>
-
-#include <boost/asio/io_service.hpp>
-#include <boost/thread.hpp>
-
-#include <vsomeip/application.hpp>
-#include <vsomeip_internal/application_base_impl.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-
-namespace vsomeip {
-
-class application_impl
- : public application,
- public application_base_impl {
-public:
- application_impl(const std::string &_name);
- virtual ~application_impl();
-
- client_id get_id() const;
- void set_id(client_id _id);
-
- std::string get_name() const;
- void set_name(const std::string &_name);
-
- bool is_managing() const;
-
- boost::asio::io_service & get_sender_service();
- boost::asio::io_service & get_receiver_service();
-
- void init(int _options_count, char **_options);
- void start();
- void stop();
-
- bool provide_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool withdraw_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool start_service(service_id _service, instance_id _instance);
- bool stop_service(service_id _service, instance_id _instance);
-
- bool request_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool release_service(service_id _service, instance_id _instance);
-
- bool is_service_available(service_id _service, instance_id _instance) const;
- bool register_availability_handler(service_id _service, instance_id _instance,
- availability_handler_t _handler);
- void deregister_availability_handler(service_id _service, instance_id _instance);
-
- bool provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup,
- const endpoint *_location);
- bool withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup,
- const endpoint *_location);
-
- bool add_field(service_id _service, instance_id _instance, eventgroup_id _event, field *_field);
- bool remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field);
- bool update_field(const field *_field);
-
- bool request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
- bool release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
-
- bool send(message *_message, bool _reliable, bool _flush);
-
- bool enable_magic_cookies(service_id _service, instance_id _instance);
- bool disable_magic_cookies(service_id _service, instance_id _instance);
-
- bool register_message_handler(
- service_id _service, instance_id _instance, method_id _method,
- message_handler_t _handler);
- void deregister_message_handler(
- service_id _service, instance_id _instance, method_id _method);
-
- void catch_up_registrations();
- void handle_message(std::shared_ptr< message > &_message);
- void handle_availability(service_id _service, instance_id _instance, const endpoint *_location, bool _is_available);
- void handle_subscription(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location, bool _is_subscribing);
-
- boost::shared_ptr< serializer > & get_serializer();
- boost::shared_ptr< deserializer > & get_deserializer();
-
-protected:
- void service(boost::asio::io_service &_service);
- void send_error_message(std::shared_ptr< message > &_request, return_code_enum _error);
- std::set< field * > * find_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
-
-protected:
- // Threads for independently run sending & receiving
- boost::shared_ptr< boost::thread > sender_thread_;
- boost::shared_ptr< boost::thread > receiver_thread_;
-
- // IO objects to independently control sending & receiving
- boost::asio::io_service sender_service_;
- boost::asio::io_service receiver_service_;
-
- // Work objects for each service to avoid processing being
- // stopped because of an empty queue
- boost::asio::io_service::work sender_work_;
- boost::asio::io_service::work receiver_work_;
-
-protected:
- // Application info (Client-Id / Session-Id)
- client_id id_;
- session_id session_;
-
- // Application properties
- bool is_managing_;
- bool is_service_discovery_enabled_;
-
- // Eventgroups
- typedef std::map< service_id,
- std::map< instance_id,
- std::map< eventgroup_id,
- std::set< field * > > > > eventgroup_map_t;
- eventgroup_map_t eventgroups_;
-
- // Callbacks for incoming messages
- typedef std::map< service_id,
- std::map< instance_id,
- std::map< method_id,
- message_handler_t > > > message_handler_map_t;
- message_handler_map_t message_handlers_;
-
- boost::shared_ptr< serializer > serializer_;
- boost::shared_ptr< deserializer > deserializer_;
-
- // Available services
- std::map< service_id, std::set< instance_id > > availability_;
- std::map< service_id, std::map< instance_id, availability_handler_t > > availability_handlers_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_APPLICATION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/client.hpp b/vsomeip/include/vsomeip_internal/client.hpp
deleted file mode 100644
index cf76ddb..0000000
--- a/vsomeip/include/vsomeip_internal/client.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// client.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_CLIENT_HPP
-#define VSOMEIP_INTERNAL_CLIENT_HPP
-
-#include <vsomeip_internal/participant.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-class client
- : virtual public participant {
-public:
- virtual ~client() {};
-
- virtual const endpoint * get_local_endpoint() const = 0;
-
- virtual bool send(
- const uint8_t *_data, uint32_t _size, bool _flush = true) = 0;
- virtual bool flush() = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_CLIENT_HPP
diff --git a/vsomeip/include/vsomeip_internal/client_impl.hpp b/vsomeip/include/vsomeip_internal/client_impl.hpp
deleted file mode 100644
index 6bb684d..0000000
--- a/vsomeip/include/vsomeip_internal/client_impl.hpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// client_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_CLIENT_IMPL_HPP
-#define VSOMEIP_INTERNAL_CLIENT_IMPL_HPP
-
-#include <deque>
-#include <vector>
-
-#include <boost/array.hpp>
-#include <boost/asio/io_service.hpp>
-#include <boost/asio/ip/udp.hpp>
-#include <boost/utility.hpp>
-
-#include <vsomeip_internal/client.hpp>
-#include <vsomeip_internal/participant_impl.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-template < typename Protocol, int MaxBufferSize >
-class client_impl
- : virtual public client,
- public participant_impl< MaxBufferSize > {
-public:
- client_impl(managing_proxy_impl *_owner, const endpoint *_location);
- virtual ~client_impl();
-
- bool send(const uint8_t *_data, uint32_t _size, bool _flush);
- bool flush();
-
- void stop();
- void restart();
-
- bool is_client() const;
- const uint8_t * get_buffer() const;
-
-public:
- void connect_cbk(boost::system::error_code const &_error);
- void wait_connect_cbk(boost::system::error_code const &_error);
- void send_cbk(
- boost::system::error_code const &_error, std::size_t _bytes);
- void flush_cbk(boost::system::error_code const &_error);
-
-public:
- virtual void connect() = 0;
- virtual void receive() = 0;
-
-protected:
- typedef typename Protocol::socket socket_type;
- typedef typename Protocol::endpoint endpoint_type;
- typedef boost::array<uint8_t, MaxBufferSize> buffer_type;
-
- socket_type socket_;
- endpoint_type local_;
- buffer_type buffer_;
-
- boost::asio::system_timer flush_timer_;
- boost::asio::system_timer connect_timer_;
- uint32_t connect_timeout_;
- bool is_connected_;
-
- std::deque<std::vector< uint8_t > > packet_queue_;
- std::vector< uint8_t > packetizer_;
-
- virtual void send_queued() = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_CLIENT_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/configuration.hpp b/vsomeip/include/vsomeip_internal/configuration.hpp
deleted file mode 100644
index e168e61..0000000
--- a/vsomeip/include/vsomeip_internal/configuration.hpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// configuration.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef VSOMEIP_INTERNAL_CONFIGURATION_HPP
-#define VSOMEIP_INTERNAL_CONFIGURATION_HPP
-
-#include <map>
-
-namespace vsomeip {
-
-class configuration {
-public:
- static void init(int _option_count, char **_options);
- static configuration * request(const std::string &_name = "");
- static void release(const std::string &_name = "");
-
- ~configuration();
-
- bool use_console_logger() const;
- bool use_file_logger() const;
- bool use_dlt_logger() const;
- const std::string & get_loglevel() const;
- const std::string & get_logfile_path() const;
-
- bool is_service_discovery_enabled() const;
- bool is_watchdog_enabled() const;
- bool is_endpoint_manager_enabled() const;
-
- uint16_t get_client_id() const;
- uint8_t get_slots() const;
-
- const std::string & get_protocol() const;
- const std::string & get_unicast_address() const;
- const std::string & get_multicast_address() const;
- const std::string & get_netmask() const;
- uint16_t get_port() const;
-
- uint32_t get_min_initial_delay() const;
- uint32_t get_max_initial_delay() const;
- uint32_t get_repetition_base_delay() const;
- uint8_t get_repetition_max() const;
- uint32_t get_ttl() const;
- uint32_t get_cyclic_offer_delay() const;
- uint32_t get_cyclic_request_delay() const;
- uint32_t get_request_response_delay() const;
-
-private:
- configuration();
- void read_configuration(const std::string &);
- void read_loggers(const std::string &);
- void read_loglevel(const std::string &);
-
-private:
- // Logging
- bool use_console_logger_;
- bool use_file_logger_;
- bool use_dlt_logger_;
- std::string loglevel_;
- std::string logfile_path_;
-
- // Daemon
- bool is_service_discovery_enabled_;
-
- // Application
- uint16_t client_id_;
- uint8_t slots_;
- bool is_watchdog_enabled_;
- bool is_endpoint_manager_enabled_;
-
- // Service Discovery
- std::string protocol_;
- std::string unicast_address_;
- std::string multicast_address_;
- std::string netmask_;
- uint16_t port_;
- uint32_t min_initial_delay_;
- uint32_t max_initial_delay_;
- uint32_t repetition_base_delay_;
- uint8_t repetition_max_;
- uint32_t ttl_;
- uint32_t cyclic_offer_delay_;
- uint32_t cyclic_request_delay_;
- uint32_t request_response_delay_;
-
- uint8_t ref_;
-
- static std::string configuration_file_path_;
- static std::map< std::string, configuration * > configurations__;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_CONFIGURATION_HPP
diff --git a/vsomeip/include/vsomeip_internal/constants.hpp b/vsomeip/include/vsomeip_internal/constants.hpp
deleted file mode 100644
index c2ddb0e..0000000
--- a/vsomeip/include/vsomeip_internal/constants.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// constants.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_CONSTANTS_HPP
-#define VSOMEIP_INTERNAL_CONSTANTS_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/enumeration_types.hpp>
-
-namespace vsomeip {
-
-const uint8_t vsomeip_protocol_reserved_byte
- = 0x00;
-
-const uint16_t vsomeip_protocol_reserved_word
- = 0x0000;
-
-const uint32_t vsomeip_protocol_reserved_long
- = 0x00000000;
-
-const uint32_t VSOMEIP_STATIC_HEADER_SIZE = 8;
-
-const uint8_t VSOMEIP_MAGIC_COOKIE_CLIENT_MESSAGE_ID = 0x00;
-const uint8_t VSOMEIP_MAGIC_COOKIE_SERVICE_MESSAGE_ID = 0x80;
-const length VSOMEIP_MAGIC_COOKIE_SIZE
- = 0x00000008;
-const request_id VSOMEIP_MAGIC_COOKIE_REQUEST_ID
- = 0xDEADBEEF;
-const protocol_version VSOMEIP_MAGIC_COOKIE_PROTOCOL_VERSION
- = 0x01;
-const interface_version VSOMEIP_MAGIC_COOKIE_INTERFACE_VERSION
- = 0x01;
-const message_type_enum VSOMEIP_MAGIC_COOKIE_CLIENT_MESSAGE_TYPE
- = message_type_enum::REQUEST_NO_RETURN;
-const message_type_enum VSOMEIP_MAGIC_COOKIE_SERVICE_MESSAGE_TYPE
- = message_type_enum::NOTIFICATION;
-const return_code_enum VSOMEIP_MAGIC_COOKIE_RETURN_CODE
- = return_code_enum::OK;
-
-const uint8_t VSOMEIP_LENGTH_POSITION = 4;
-const uint8_t VSOMEIP_STATIC_SERVICE_DISCOVERY_DATA_LENGTH = 12;
-const uint8_t VSOMEIP_ENTRY_LENGTH = 16;
-const uint8_t VSOMEIP_OPTION_HEADER_LENGTH = 3;
-
-#define VSOMEIP_POS_MESSAGE_TYPE 14
-
-#define VSOMEIP_UNKNOWN_ID 0xFFFF
-#define VSOMEIP_METHOD_ID_ZERO 0x0000
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_CONSTANTS_HPP
diff --git a/vsomeip/include/vsomeip_internal/daemon.hpp b/vsomeip/include/vsomeip_internal/daemon.hpp
deleted file mode 100644
index 987686b..0000000
--- a/vsomeip/include/vsomeip_internal/daemon.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// daemon.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_DAEMON_HPP
-#define VSOMEIP_INTERNAL_DAEMON_HPP
-
-#include <string>
-
-#include <boost/asio/io_service.hpp>
-#include <boost/log/sources/severity_logger.hpp>
-#include <boost/log/trivial.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-class client;
-class service;
-class message_base;
-
-class daemon {
-public:
- static daemon * get_instance();
-
- virtual ~daemon() {};
-
- virtual std::string get_name() const = 0;
- virtual boost::asio::io_service & get_service() = 0;
- virtual boost::log::sources::severity_logger< boost::log::trivial::severity_level > & get_logger() = 0;
-
- virtual void init(int _count, char **_options) = 0;
- virtual void start() = 0;
- virtual void stop() = 0;
-
- virtual bool send(message_base *_message, bool _reliable, bool _flush) = 0;
-
- virtual service * find_multicast_service(ip_port port) const = 0;
-
- virtual void on_service_availability(client_id _client, service_id _service, instance_id _instance, const endpoint *_location, bool _is_available) = 0;
- virtual void on_subscription(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location, bool _is_subscribing) = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_DAEMON_HPP
diff --git a/vsomeip/include/vsomeip_internal/debug.hpp b/vsomeip/include/vsomeip_internal/debug.hpp
deleted file mode 100644
index 4334b40..0000000
--- a/vsomeip/include/vsomeip_internal/debug.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// debug.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_DEBUG_HPP
-#define VSOMEIP_INTERNAL_DEBUG_HPP
-
-namespace vsomeip {
-
-extern bool disable_internal_routing;
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_DEBUG_HPP
diff --git a/vsomeip/include/vsomeip_internal/endpoint_impl.hpp b/vsomeip/include/vsomeip_internal/endpoint_impl.hpp
deleted file mode 100644
index cf873b7..0000000
--- a/vsomeip/include/vsomeip_internal/endpoint_impl.hpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// endpoint_impl.hpp
-//
-// Author: Lutz Bichler <Lutz.Bichler@bmwgroup.com>
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_ENDPOINT_IMPL_HPP
-#define VSOMEIP_INTERNAL_ENDPOINT_IMPL_HPP
-
-#include <boost/asio/ip/address.hpp>
-
-#include <vsomeip/endpoint.hpp>
-
-namespace vsomeip {
-
-class endpoint_impl
- : virtual public endpoint {
-public:
- endpoint_impl(boost::asio::ip::address _address, ip_port _port, ip_protocol _protocol);
- virtual ~endpoint_impl();
-
- ip_address get_address() const;
- ip_port get_port() const;
- ip_protocol get_protocol() const;
- ip_protocol_version get_version() const;
-
- bool serialize(serializer *_to) const;
-
-private:
- boost::asio::ip::address address_;
- uint16_t port_;
- ip_protocol protocol_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_ENDPOINT_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/enumeration_types.hpp b/vsomeip/include/vsomeip_internal/enumeration_types.hpp
deleted file mode 100644
index 03f2863..0000000
--- a/vsomeip/include/vsomeip_internal/enumeration_types.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// enumeration_types.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_ENUMERATION_TYPES_HPP
-#define VSOMEIP_INTERNAL_ENUMERATION_TYPES_HPP
-
-#include <cstdint>
-
-namespace vsomeip {
-
-enum class command_enum : uint8_t {
- REGISTER_APPLICATION = 0x10,
- DEREGISTER_APPLICATION = 0x11,
-
- PROVIDE_SERVICE = 0x12,
- WITHDRAW_SERVICE = 0x13,
- START_SERVICE = 0x14,
- STOP_SERVICE = 0x15,
- REQUEST_SERVICE = 0x16,
- RELEASE_SERVICE = 0x17,
-
- REGISTER_METHOD = 0x18,
- DEREGISTER_METHOD = 0x19,
-
- PROVIDE_SERVICE_ACK = 0x22,
- WITHDRAW_SERVICE_ACK = 0x23,
- START_SERVICE_ACK = 0x24,
- STOP_SERVICE_ACK = 0x25,
- REQUEST_SERVICE_ACK = 0x26,
- RELEASE_SERVICE_ACK = 0x27,
-
- APPLICATION_INFO = 0x31,
- APPLICATION_LOST = 0x32,
-
- SOMEIP_MESSAGE = 0x40,
- SOMEIP_FIELD = 0x41,
-
- SOMEIP_SERVICE_AVAILABLE = 0x50,
- SOMEIP_SERVICE_NOT_AVAILABLE = 0x51,
-
- PROVIDE_EVENTGROUP = 0x60,
- WITHDRAW_EVENTGROUP = 0x61,
- REQUEST_EVENTGROUP = 0x64,
- RELEASE_EVENTGROUP = 0x65,
-
- ADD_EVENT = 0x66,
- REMOVE_EVENT = 0x67,
- ADD_FIELD = 0x68,
- REMOVE_FIELD = 0x69,
-
- SOMEIP_SUBSCRIBE = 0x70,
- SOMEIP_UNSUBSCRIBE = 0x71,
-
- PING = 0xE0,
- PONG = 0xE1
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_ENUMERATION_TYPES_HPP
diff --git a/vsomeip/include/vsomeip_internal/factory_impl.hpp b/vsomeip/include/vsomeip_internal/factory_impl.hpp
deleted file mode 100644
index 5a687d0..0000000
--- a/vsomeip/include/vsomeip_internal/factory_impl.hpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// factory_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_FACTORY_IMPL_HPP
-#define VSOMEIP_INTERNAL_FACTORY_IMPL_HPP
-
-#include <map>
-#include <string>
-
-#include <vsomeip/factory.hpp>
-
-namespace vsomeip {
-
-class factory_impl : public factory {
-public:
- virtual ~factory_impl();
-
- static factory * get_instance();
-
- application * create_application(const std::string &_name) const;
-
- endpoint * get_endpoint(ip_address _address, ip_port _port, ip_protocol _protocol);
- endpoint * get_endpoint(const uint8_t *_bytes, uint32_t _size);
-
- message * create_message() const;
- message * create_response(const message *_request) const;
-
- field * create_field(application *_application, service_id _service, instance_id _instance, event_id _event) const;
-
-private:
- std::map< uint32_t, std::map< std::string, endpoint * > > endpoints_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_FACTORY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/field_impl.hpp b/vsomeip/include/vsomeip_internal/field_impl.hpp
deleted file mode 100644
index f6c32da..0000000
--- a/vsomeip/include/vsomeip_internal/field_impl.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// field_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_FIELD_IMPL_HPP
-#define VSOMEIP_INTERNAL_FIELD_IMPL_HPP
-
-#include <map>
-
-#include <vsomeip/field.hpp>
-#include <vsomeip_internal/payload_impl.hpp>
-#include <vsomeip_internal/payload_owner.hpp>
-
-namespace vsomeip {
-
-class field_impl
- : public field,
- public payload_owner {
-public:
- field_impl(application *_application, service_id _service, instance_id _instance, event_id _event);
- virtual ~field_impl();
-
- service_id get_service() const;
- instance_id get_instance() const;
- event_id get_event() const;
-
- uint32_t get_update_cycle() const;
- void set_update_cycle(uint32_t _cycle);
-
- const payload & get_payload() const;
- payload & get_payload();
-
- void notify() const;
-
-private:
- application *application_;
-
- service_id service_;
- instance_id instance_;
- event_id event_;
-
- uint32_t update_cycle_;
- payload_impl payload_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_FIELD_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/log_macros.hpp b/vsomeip/include/vsomeip_internal/log_macros.hpp
deleted file mode 100644
index a1a4178..0000000
--- a/vsomeip/include/vsomeip_internal/log_macros.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// log_macros.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef LOG_MACROS_HPP_
-#define VSOMEIP_INTERNAL_LOG_MACROS_HPPL_LOG_MACROS_HPP
-
-#define VSOMEIP_FATAL BOOST_LOG_SEV(this->logger_, boost::log::trivial::severity_level::fatal)
-#define VSOMEIP_ERROR BOOST_LOG_SEV(this->logger_, boost::log::trivial::severity_level::error)
-#define VSOMEIP_WARNING BOOST_LOG_SEV(this->logger_, boost::log::trivial::severity_level::warning)
-#define VSOMEIP_INFO BOOST_LOG_SEV(this->logger_, boost::log::trivial::severity_level::info)
-#define VSOMEIP_DEBUG BOOST_LOG_SEV(this->logger_, boost::log::trivial::severity_level::debug)
-#define VSOMEIP_TRACE BOOST_LOG_SEV(this->logger_, boost::log::trivial::severity_level::trace)
-
-#endif // VSOMEIP_INTERNAL_LOG_MACROS_HPP
diff --git a/vsomeip/include/vsomeip_internal/log_owner.hpp b/vsomeip/include/vsomeip_internal/log_owner.hpp
deleted file mode 100644
index 6d8f1d1..0000000
--- a/vsomeip/include/vsomeip_internal/log_owner.hpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// log_owner.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef VSOMEIP_INTERNAL_LOG_OWNER_HPP
-#define VSOMEIP_INTERNAL_LOG_OWNER_HPP
-
-#include <string>
-
-#include <boost/log/sinks/sync_frontend.hpp>
-#include <boost/log/sinks/text_ostream_backend.hpp>
-#include <boost/log/sources/severity_logger.hpp>
-#include <boost/log/trivial.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip_internal/owner_base.hpp>
-
-namespace vsomeip {
-
-BOOST_LOG_ATTRIBUTE_KEYWORD(channel, "Channel",
- std::string)
-BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity",
- boost::log::trivial::severity_level)
-
-typedef boost::log::sinks::synchronous_sink<
- boost::log::sinks::text_ostream_backend > sink_t;
-
-class log_owner : virtual public owner_base {
-public:
- log_owner(const std::string &_name);
-
- boost::log::sources::severity_logger<
- boost::log::trivial::severity_level > & get_logger();
-
- void configure_logging(bool _use_console, bool _use_file, bool _use_dlt);
-
- void set_channel(const std::string &_id);
- void set_loglevel(const std::string &_loglevel);
-
- void enable_console();
- void enable_file();
- void enable_dlt();
-
-protected:
- boost::log::sources::severity_logger<
- boost::log::trivial::severity_level > logger_;
- boost::log::trivial::severity_level loglevel_;
- std::string channel_;
-
- sink_t *console_sink_;
- sink_t *file_sink_;
- //dlt_sink *dlt_sink_;
-
-private:
- bool filter(boost::log::value_ref< boost::log::trivial::severity_level,
- tag::severity > const &_loglevel,
- boost::log::value_ref< std::string,
- tag::channel > const &_channel);
-
- void use_null_logger();
-
-friend class log_user;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_LOG_OWNER_HPP
diff --git a/vsomeip/include/vsomeip_internal/log_user.hpp b/vsomeip/include/vsomeip_internal/log_user.hpp
deleted file mode 100644
index 252fd02..0000000
--- a/vsomeip/include/vsomeip_internal/log_user.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// log_user.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_LOG_USER_HPP
-#define VSOMEIP_INTERNAL_LOG_USER_HPP
-
-#include <boost/log/sources/severity_logger.hpp>
-#include <boost/log/trivial.hpp>
-
-namespace vsomeip {
-
-class log_owner;
-
-class log_user {
-public:
- log_user(log_owner &_owner);
- log_user(log_user &_other);
-
-protected:
- boost::log::sources::severity_logger<
- boost::log::trivial::severity_level > &logger_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_LOG_USER_HPP
diff --git a/vsomeip/include/vsomeip_internal/managed_proxy_impl.hpp b/vsomeip/include/vsomeip_internal/managed_proxy_impl.hpp
deleted file mode 100644
index 47101f4..0000000
--- a/vsomeip/include/vsomeip_internal/managed_proxy_impl.hpp
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// managed_proxy_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_MANAGED_PROXY_IMPL_HPP
-#define VSOMEIP_INTERNAL_MANAGED_PROXY_IMPL_HPP
-
-#include <deque>
-#include <vector>
-
-#include <boost/shared_ptr.hpp>
-#include <boost/system/error_code.hpp>
-#include <boost/thread/mutex.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip_internal/administration_proxy_impl.hpp>
-#include <vsomeip_internal/message_queue.hpp>
-#include <vsomeip_internal/proxy.hpp>
-
-namespace vsomeip {
-
-class deserializer;
-class serializer;
-
-class managed_proxy_impl
- : public administration_proxy_impl {
-public:
- managed_proxy_impl(application_base_impl &_owner);
- virtual ~managed_proxy_impl();
-
- void init();
- void start();
- void stop();
-
- bool send(message_base *_message, bool _reliable, bool _flush);
-
- bool enable_magic_cookies(service_id _service, instance_id _instance);
- bool disable_magic_cookies(service_id _service, instance_id _instance);
-
-private: // internal
- virtual void catch_up_registrations();
-
- void process_command(command_enum _command, client_id _client, const uint8_t *_payload, uint32_t payload_size);
-
- void on_message(client_id _id, const uint8_t *_data, uint32_t _size);
-
- message_queue * find_target_queue(service_id, instance_id) const;
- message_queue * find_target_queue(client_id);
-
-private:
- void send_cbk(boost::system::error_code const &);
- void response_cbk(boost::system::error_code const &_error, message_queue *_queue);
-
-private:
- // Serialization & deserialization
- boost::shared_ptr< serializer > serializer_;
- boost::shared_ptr< deserializer > deserializer_;
-
- // buffers
- std::deque< std::vector< uint8_t > > send_buffers_;
-
- // Mutex to lock while manipulating sender queue
- boost::mutex mutex_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_MANAGED_PROXY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/managing_proxy_impl.hpp b/vsomeip/include/vsomeip_internal/managing_proxy_impl.hpp
deleted file mode 100644
index dd83c16..0000000
--- a/vsomeip/include/vsomeip_internal/managing_proxy_impl.hpp
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// managing_proxy_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_MANAGING_PROXY_IMPL_HPP
-#define VSOMEIP_MANAGING_PROXY_IMPL_HPP
-
-#include <map>
-
-#include <boost/asio/io_service.hpp>
-
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip_internal/proxy_base_impl.hpp>
-#include <vsomeip_internal/log_user.hpp>
-
-namespace vsomeip {
-
-class client;
-class deserializer;
-class endpoint;
-class message_base;
-class serializer;
-class service;
-
-class managing_proxy_impl
- : virtual public proxy_base_impl {
-public:
- managing_proxy_impl(application_base_impl &_owner);
- virtual ~managing_proxy_impl();
-
- void init();
- void start();
- void stop();
-
- boost::asio::io_service & get_service();
-
- bool provide_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool withdraw_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool start_service(service_id _service, instance_id _instance);
- bool stop_service(service_id _service, instance_id _instance);
-
- bool request_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool release_service(service_id _service, instance_id _instance);
-
- void register_method(service_id _service, instance_id _instance, method_id _method);
- void deregister_method(service_id _service, instance_id _instance, method_id _method);
-
- bool provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location);
- bool withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location);
-
- bool add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field);
- bool remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field);
-
- bool request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
- bool release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
-
- bool send(message_base *_message, bool _reliable, bool _flush);
-
- bool enable_magic_cookies(service_id _service, instance_id _instance);
- bool disable_magic_cookies(service_id _service, instance_id _instance);
-
- virtual void receive(const uint8_t *_data, uint32_t _size,
- const endpoint *_source, const endpoint *_target);
-
- // The following methods are specific for this proxy type and
- // used by the daemon implementation only...
- const endpoint * find_client_location(service_id, instance_id, bool) const;
- const endpoint * find_service_location(service_id, instance_id, bool) const;
-
- client * find_client(const endpoint *) const;
- client * create_client(const endpoint *);
- client * find_or_create_client(const endpoint *);
-
- service * find_service(const endpoint *) const;
- service * create_service(const endpoint *);
- service * find_or_create_service(const endpoint *);
-
- instance_id find_instance(const endpoint *, service_id, message_type_enum) const;
-
-private:
- // locations of clients & services
- typedef std::map< service_id,
- std::map< instance_id,
- std::map< bool,
- const endpoint * > > > location_map_t;
-
- location_map_t client_locations_;
- location_map_t service_locations_;
-
- // clients & services at endpoints
- std::map< const endpoint *, client * > managed_clients_;
- std::map< const endpoint *, service * > managed_services_;
-
- // instances on an endpoint
- typedef std::map< const endpoint *,
- std::map< service_id,
- instance_id > > instance_map_t;
-
- instance_map_t client_instances_;
- instance_map_t service_instances_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_MANAGING_PROXY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/message_base_impl.hpp b/vsomeip/include/vsomeip_internal/message_base_impl.hpp
deleted file mode 100644
index 65af965..0000000
--- a/vsomeip/include/vsomeip_internal/message_base_impl.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// message_base_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_MESSAGE_BASE_IMPL_HPP
-#define VSOMEIP_INTERNAL_MESSAGE_BASE_IMPL_HPP
-
-#include <boost/thread.hpp>
-
-#include <vsomeip/message.hpp>
-#include <vsomeip_internal/message_header_impl.hpp>
-
-namespace vsomeip {
-
-class message_base_impl
- : virtual public message_base {
-public:
- message_base_impl();
- virtual ~message_base_impl();
-
- const endpoint * get_source() const;
- void set_source(const endpoint *_source);
- const endpoint * get_target() const;
- void set_target(const endpoint *_target);
-
- message_id get_message_id() const;
- void set_message_id(message_id _id);
- service_id get_service_id() const;
- void set_service_id(service_id _id);
- instance_id get_instance_id() const;
- void set_instance_id(instance_id _id);
- method_id get_method_id() const;
- void set_method_id(method_id _id);
- request_id get_request_id() const;
- void set_request_id(request_id _id);
- client_id get_client_id() const;
- void set_client_id(client_id _id);
- session_id get_session_id() const;
- void set_session_id(session_id _id);
- protocol_version get_protocol_version() const;
- void set_protocol_version(protocol_version _version);
- interface_version get_interface_version() const;
- void set_interface_version(interface_version _version);
- message_type_enum get_message_type() const;
- void set_message_type(message_type_enum _type);
- return_code_enum get_return_code() const;
- void set_return_code(return_code_enum _code);
-
- message * get_owner() const;
- void set_owner(message *_owner);
-
-protected: // members
- message_header_impl header_;
-
- const endpoint *source_;
- const endpoint *target_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_MESSAGE_BASE_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/message_header_impl.hpp b/vsomeip/include/vsomeip_internal/message_header_impl.hpp
deleted file mode 100644
index b9d5824..0000000
--- a/vsomeip/include/vsomeip_internal/message_header_impl.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// message_header_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_MESSAGE_HEADER_IMPL_HPP
-#define VSOMEIP_INTERNAL_MESSAGE_HEADER_IMPL_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/serializable.hpp>
-
-namespace vsomeip {
-
-class message_base;
-
-class message_header_impl : virtual public serializable {
-
-public:
- message_header_impl();
- message_header_impl(const message_header_impl& header);
-
- virtual bool serialize(serializer *_to) const;
- virtual bool deserialize(deserializer *_from);
-
- // internal
- message_base * get_owner() const;
- void set_owner(message_base *_owner);
-
-public:
- service_id service_id_;
- instance_id instance_id_; // NOT(!) part of the SOME/IP header
- method_id method_id_;
- length length_;
- client_id client_id_;
- session_id session_id_;
- protocol_version protocol_version_;
- interface_version interface_version_;
- message_type_enum message_type_;
- return_code_enum return_code_;
-
- message_base *owner_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_MESSAGE_HEADER_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/message_impl.hpp b/vsomeip/include/vsomeip_internal/message_impl.hpp
deleted file mode 100644
index c7fab3e..0000000
--- a/vsomeip/include/vsomeip_internal/message_impl.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// message_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_MESSAGE_IMPL_HPP
-#define VSOMEIP_INTERNAL_MESSAGE_IMPL_HPP
-
-#include <vsomeip_internal/message_base_impl.hpp>
-#include <vsomeip_internal/payload_impl.hpp>
-
-namespace vsomeip {
-
-class message_impl
- : virtual public message,
- virtual public message_base_impl {
-public:
- virtual ~message_impl();
-
- length get_length() const;
- void set_length(length _length);
-
- payload & get_payload();
- const payload & get_payload() const;
-
- bool serialize(serializer *_to) const;
- bool deserialize(deserializer *_from);
-
-protected: // members
- payload_impl payload_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_MESSAGE_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/message_queue.hpp b/vsomeip/include/vsomeip_internal/message_queue.hpp
deleted file mode 100644
index 7b6a04a..0000000
--- a/vsomeip/include/vsomeip_internal/message_queue.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// message_queue.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_MESSAGE_QUEUE_HPP
-#define VSOMEIP_INTERNAL_MESSAGE_QUEUE_HPP
-
-#include <boost_ext/asio/mq.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class administration_proxy_impl;
-
-class message_queue
- : public boost_ext::asio::message_queue {
-
-public:
- message_queue(boost::asio::io_service &_service, administration_proxy_impl *_owner = 0)
- : boost_ext::asio::message_queue(_service),
- owner_(_owner),
- ref_(0) {
- };
-
- inline administration_proxy_impl * get_owner() const {
- return owner_;
- };
-
- inline void add_ref() { ref_++; };
- inline void release() { ref_--; };
- inline uint8_t get_ref() const { return ref_; };
-
-private:
- administration_proxy_impl *owner_;
- uint8_t ref_;
-};
-
-void intrusive_ptr_add_ref(class vsomeip::message_queue *);
-void intrusive_ptr_release(class vsomeip::message_queue *);
-
-} // namespace vsomeip
-
-#endif // VSOME_INTERNAL_MESSAGE_QUEUE_HPP
diff --git a/vsomeip/include/vsomeip_internal/method_info.hpp b/vsomeip/include/vsomeip_internal/method_info.hpp
deleted file mode 100644
index dfe28f6..0000000
--- a/vsomeip/include/vsomeip_internal/method_info.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// message_queue.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_METHOD_INFO_HPP
-#define VSOMEIP_INTERNAL_METHOD_INFO_HPP
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-struct method_info {
- service_id service_;
- instance_id instance_;
- method_id method_;
-
- bool operator<(const method_info &_other) const {
- return (service_ < _other.service_ ||
- (service_ == _other.service_ && instance_ < _other.instance_) ||
- (service_ == _other.service_ && instance_ == _other.instance_ && method_ < _other.method_));
- }
-};
-
-};
-
-#endif // VSOMEIP_INTERNAL_METHOD_INFO_HPP
diff --git a/vsomeip/include/vsomeip_internal/owner_base.hpp b/vsomeip/include/vsomeip_internal/owner_base.hpp
deleted file mode 100644
index 72b434b..0000000
--- a/vsomeip/include/vsomeip_internal/owner_base.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// owner_base.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_OWNER_BASE_HPP
-#define VSOMEIP_INTERNAL_OWNER_BASE_HPP
-
-#include <string>
-
-namespace vsomeip {
-
-class owner_base {
-public:
- owner_base(const std::string &_name);
- virtual ~owner_base();
-
-protected:
- std::string name_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_OWNER_BASE_HPP
diff --git a/vsomeip/include/vsomeip_internal/participant.hpp b/vsomeip/include/vsomeip_internal/participant.hpp
deleted file mode 100644
index 59270bc..0000000
--- a/vsomeip/include/vsomeip_internal/participant.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// participant.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_PARTICIPANT_HPP
-#define VSOMEIP_INTERNAL_PARTICIPANT_HPP
-
-#include <vsomeip_internal/constants.hpp>
-
-#ifdef USE_VSOMEIP_STATISTICS
-#include <vsomeip_internal/statistics_owner.hpp>
-#endif
-
-namespace vsomeip {
-
-class message_base;
-
-/// \interface participant
-/// Common base class for participants (clients and services) in a Some/IP
-/// communication. This interface provides the methods control the lifecycle
-/// of the participant as well as access to the service registration that is
-/// used to filter incoming messages and the Some/IP synchronization mechanism
-/// (Magic Cookies).
-class participant
-#ifdef USE_VSOMEIP_STATISTICS
-: virtual public statistics_owner
-#endif
-{
-public:
- virtual ~participant() {};
-
- virtual void start() = 0;
- virtual void stop() = 0;
-
- virtual void open_filter(service_id _service_id) = 0;
- virtual void close_filter(service_id _service_id) = 0;
-
- virtual void join(const std::string &_multicast_address) = 0;
- virtual void leave(const std::string &_multicast_address) = 0;
-
- virtual void enable_magic_cookies() = 0;
- virtual void disable_magic_cookies() = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_PARTICIPANT_HPP
diff --git a/vsomeip/include/vsomeip_internal/participant_impl.hpp b/vsomeip/include/vsomeip_internal/participant_impl.hpp
deleted file mode 100644
index e683210..0000000
--- a/vsomeip/include/vsomeip_internal/participant_impl.hpp
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// participant_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_PARTICIPANT_IMPL_HPP
-#define VSOMEIP_INTERNAL_PARTICIPANT_IMPL_HPP
-
-#include <map>
-
-#include <boost/asio/io_service.hpp>
-#include <boost/asio/system_timer.hpp>
-
-#include <vsomeip_internal/log_user.hpp>
-#include <vsomeip_internal/participant.hpp>
-#include <vsomeip_internal/statistics_owner_impl.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-class managing_proxy_impl;
-
-template < int MaxBufferSize >
-class participant_impl
- : virtual public participant,
- public log_user
-#ifdef USE_VSOMEIP_STATISTICS
- , virtual public statistics_owner_impl
-#endif
-{
-public: // provided
- participant_impl(managing_proxy_impl *_owner, const endpoint *_location);
- virtual ~participant_impl();
-
- void enable_magic_cookies();
- void disable_magic_cookies();
-
- void open_filter(service_id _service);
- void close_filter(service_id _service);
-
- void receive_cbk(
- boost::system::error_code const &_error, std::size_t _bytes);
-
-public: // required
- virtual bool is_client() const = 0;
- virtual const uint8_t * get_buffer() const = 0;
-
- virtual void receive() = 0;
- virtual void restart() = 0;
-
- virtual ip_address get_remote_address() const = 0;
- virtual ip_port get_remote_port() const = 0;
- virtual ip_protocol get_protocol() const = 0;
-
-private:
- uint32_t get_message_size() const;
-
- virtual bool is_magic_cookie() const;
- bool resync_on_magic_cookie();
-
-protected:
- // Reference to service context
- boost::asio::io_service &service_;
-
- // Reference to managing proxy
- managing_proxy_impl *owner_;
-
- // The local endpoint
- const endpoint *location_;
-
- bool is_supporting_magic_cookies_;
- bool has_enabled_magic_cookies_;
-
- // Data of the current message
- std::vector< uint8_t > message_;
-
- // Filter configuration
- std::map< service_id, uint8_t > opened_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_PARTICIPANT_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/payload_impl.hpp b/vsomeip/include/vsomeip_internal/payload_impl.hpp
deleted file mode 100644
index f8a6bf8..0000000
--- a/vsomeip/include/vsomeip_internal/payload_impl.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// payload_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_PAYLOAD_IMPL_HPP
-#define VSOMEIP_INTERNAL_PAYLOAD_IMPL_HPP
-
-#include <vsomeip/payload.hpp>
-#include <vector>
-
-namespace vsomeip {
-
-class payload_owner;
-class serializer;
-class deserializer;
-
-class payload_impl : public payload {
-public:
- payload_impl();
- payload_impl(const payload_owner *_owner);
- payload_impl(const payload_impl& _payload);
- virtual ~payload_impl();
-
- uint8_t * get_data();
- const uint8_t * get_data() const;
- uint32_t get_length() const;
-
- void set_capacity(uint32_t _capacity);
-
- void set_data(const uint8_t *data, uint32_t length);
- void set_data(const std::vector<uint8_t>& data);
-
- bool serialize(serializer *_to) const;
- bool deserialize(deserializer *_from);
-
-private:
- std::vector< uint8_t > data_;
- const payload_owner *owner_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_PAYLOAD_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/primitive_types.hpp b/vsomeip/include/vsomeip_internal/primitive_types.hpp
deleted file mode 100644
index f90cd31..0000000
--- a/vsomeip/include/vsomeip_internal/primitive_types.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// primitive_types.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_PRIMITIVE_TYPES_HPP
-#define VSOMEIP_INTERNAL_PRIMITIVE_TYPES_HPP
-
-#include <cstdint>
-#include <string>
-
-namespace vsomeip {
-
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_PRIMITIVE_TYPES_HPP
diff --git a/vsomeip/include/vsomeip_internal/protocol.hpp b/vsomeip/include/vsomeip_internal/protocol.hpp
deleted file mode 100644
index e3f6a15..0000000
--- a/vsomeip/include/vsomeip_internal/protocol.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// protocol.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <cstdint>
-
-#include <vsomeip_internal/byteorder.hpp>
-
-#ifndef VSOMEIP_INTERNAL_PROTOCOL_HPP
-#define VSOMEIP_INTERNAL_PROTOCOL_HPP
-
-#define VSOMEIP_PROTOCOL_OVERHEAD 15
-#define VSOMEIP_PROTOCOL_RESERVED 0
-
-#define VSOMEIP_PROTOCOL_ID 4
-#define VSOMEIP_PROTOCOL_COMMAND 6
-#define VSOMEIP_PROTOCOL_PAYLOAD_SIZE 7
-#define VSOMEIP_PROTOCOL_PAYLOAD 11
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-const uint32_t VSOMEIP_PROTOCOL_START_TAG = 0x076D3767;
-const uint32_t VSOMEIP_PROTOCOL_END_TAG = 0x67376D07;
-#else
-const uint32_t VSOMEIP_PROTOCOL_START_TAG = 0x67376D07;
-const uint32_t VSOMEIP_PROTOCOL_END_TAG = 0x076D3767;
-#endif
-
-#endif // VSOMEIP_INTERNAL_PROTOCOL_HPP
diff --git a/vsomeip/include/vsomeip_internal/proxy.hpp b/vsomeip/include/vsomeip_internal/proxy.hpp
deleted file mode 100644
index 7765f5b..0000000
--- a/vsomeip/include/vsomeip_internal/proxy.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// proxy.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_PROXY_HPP
-#define VSOMEIP_INTERNAL_PROXY_HPP
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-class field;
-class message_base;
-
-class proxy {
-public:
- virtual ~proxy() {};
-
- virtual void init() = 0;
- virtual void start() = 0;
- virtual void stop() = 0;
-
- virtual bool provide_service(service_id _service, instance_id _instance, const endpoint *_location) = 0;
- virtual bool withdraw_service(service_id _service, instance_id _instance, const endpoint *_location) = 0;
-
- virtual bool start_service(service_id _service, instance_id _instance) = 0;
- virtual bool stop_service(service_id _service, instance_id _instance) = 0;
-
- virtual bool request_service(service_id _service, instance_id _instance, const endpoint *_location) = 0;
- virtual bool release_service(service_id _servive, instance_id _instance) = 0;
-
- virtual bool provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) = 0;
- virtual bool withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) = 0;
-
- virtual bool request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) = 0;
- virtual bool release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) = 0;
-
- virtual bool add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) = 0;
- virtual bool remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) = 0;
-
- virtual void register_method(service_id _service, instance_id _instance, method_id _method) = 0;
- virtual void deregister_method(service_id _service, instance_id _instance, method_id _method) = 0;
-
- virtual bool send(message_base *_message, bool _reliable, bool _flush) = 0;
-
- virtual bool enable_magic_cookies(service_id _service, instance_id _instance) = 0;
- virtual bool disable_magic_cookies(service_id _service, instance_id _instance) = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_PROXY_HPP
diff --git a/vsomeip/include/vsomeip_internal/proxy_base_impl.hpp b/vsomeip/include/vsomeip_internal/proxy_base_impl.hpp
deleted file mode 100644
index b6c7d32..0000000
--- a/vsomeip/include/vsomeip_internal/proxy_base_impl.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// proxy_base_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_PROXY_BASE_IMPL_HPP
-#define VSOMEIP_PROXY_BASE_IMPL_HPP
-
-#include <vsomeip_internal/proxy.hpp>
-#include <vsomeip_internal/log_user.hpp>
-
-namespace vsomeip {
-
-class application_base_impl;
-
-class proxy_base_impl
- : virtual public proxy,
- virtual public log_user {
-public:
- proxy_base_impl(application_base_impl &_owner);
- virtual ~proxy_base_impl();
-
-protected:
- application_base_impl &owner_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_PROXY_BASE_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/proxy_owner.hpp b/vsomeip/include/vsomeip_internal/proxy_owner.hpp
deleted file mode 100644
index a36948f..0000000
--- a/vsomeip/include/vsomeip_internal/proxy_owner.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// proxy_owner.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_PROXY_OWNER_HPP
-#define VSOMEIP_INTERNAL_PROXY_OWNER_HPP
-
-#include <string>
-
-#include <boost/shared_ptr.hpp>
-
-#include <vsomeip_internal/owner_base.hpp>
-
-namespace vsomeip {
-
-class proxy;
-
-class proxy_owner : virtual public owner_base {
-public:
- proxy_owner(const std::string &_name);
- ~proxy_owner();
-
-protected:
- boost::shared_ptr< proxy > proxy_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_PROXY_OWNER_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/client_proxy.hpp b/vsomeip/include/vsomeip_internal/sd/client_proxy.hpp
deleted file mode 100644
index 13e46c1..0000000
--- a/vsomeip/include/vsomeip_internal/sd/client_proxy.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// client_proxy.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_CLIENT_PROXY_HPP
-#define VSOMEIP_INTERNAL_SD_CLIENT_PROXY_HPP
-
-#include <map>
-#include <set>
-
-#include <boost/shared_ptr.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-namespace sd {
-
-class eventgroup_client_proxy;
-class group;
-
-class client_proxy {
-public:
- client_proxy(group *_group, service_id _service, instance_id _instance);
-
- service_id get_service() const;
- instance_id get_instance() const;
- major_version get_major_version() const;
- minor_version get_minor_version() const;
- time_to_live get_time_to_live() const;
-
- bool is_available() const;
- void set_available(const endpoint *_tcp, const endpoint *_udp, bool _is_available);
-
- void request(client_id _client);
- void release(client_id _client);
-
- void subscribe(client_id _client, eventgroup_id _eventgroup);
- void unsubscribe(client_id _client, eventgroup_id _eventgroup);
-
- const std::map< eventgroup_id, boost::shared_ptr< eventgroup_client_proxy > > & get_eventgroups() const;
-
- void set_local(const endpoint *_reliable, const endpoint *_unreliable);
-
-private:
- void update_clients(const endpoint *_location, bool _is_available);
-
-private:
- group *group_;
-
- service_id service_;
- instance_id instance_;
-
- const endpoint *reliable_local_;
- const endpoint *reliable_remote_;
-
- const endpoint *unreliable_local_;
- const endpoint *unreliable_remote_;
-
- std::set< client_id > requesters_;
- std::map< eventgroup_id, boost::shared_ptr< eventgroup_client_proxy > > eventgroups_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_CLIENT_PROXY_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/configuration_option_impl.hpp b/vsomeip/include/vsomeip_internal/sd/configuration_option_impl.hpp
deleted file mode 100644
index a323538..0000000
--- a/vsomeip/include/vsomeip_internal/sd/configuration_option_impl.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// configuration_option_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_CONFIGURATION_OPTION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_CONFIGURATION_OPTION_IMPL_HPP
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include <vsomeip/sd/configuration_option.hpp>
-#include <vsomeip_internal/sd/option_impl.hpp>
-
-namespace vsomeip {
-
-class serializer;
-class deserializer;
-
-namespace sd {
-
-class configuration_option_impl :
- virtual public configuration_option,
- virtual public option_impl {
-
-public:
- configuration_option_impl();
- virtual ~configuration_option_impl();
- bool operator==(const option& _other) const;
-
- void add_item(const std::string &_key, const std::string &_value);
- void remove_item(const std::string &_key);
-
- std::vector<std::string> get_keys() const;
- std::vector<std::string> get_values() const;
- std::string get_value(const std::string &_key) const;
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-private:
- std::map< std::string, std::string> configuration_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_CONFIGURATION_OPTION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/constants.hpp b/vsomeip/include/vsomeip_internal/sd/constants.hpp
deleted file mode 100644
index 330a743..0000000
--- a/vsomeip/include/vsomeip_internal/sd/constants.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// constants.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_CONSTANTS_HPP
-#define VSOMEIP_INTERNAL_SD_CONSTANTS_HPP
-
-#include <string>
-
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-const service_id VSOMEIP_SERVICE_DISCOVERY_SERVICE = 0xFFFF;
-const instance_id VSOMEIP_SERVICE_DISCOVERY_INSTANCE = 0x0000;
-const method_id VSOMEIP_SERVICE_DISCOVERY_METHOD = 0x8100;
-const client_id VSOMEIP_SERVICE_DISCOVERY_CLIENT = 0x0000;
-const protocol_version VSOMEIP_SERVICE_DISCOVERY_PROTOCOL_VERSION = 0x01;
-const interface_version VSOMEIP_SERVICE_DISCOVERY_INTERFACE_VERSION = 0x01;
-const message_type_enum VSOMEIP_SERVICE_DISCOVERY_MESSAGE_TYPE = message_type_enum::NOTIFICATION;
-const return_code_enum VSOMEIP_SERVICE_DISCOVERY_RETURN_CODE = return_code_enum::OK;
-
-const std::string VSOMEIP_SERVICE_DISCOVERY_DEFAULT_NETMASK = "255.255.255.0";
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_CONSTANTS_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/deserializer.hpp b/vsomeip/include/vsomeip_internal/sd/deserializer.hpp
deleted file mode 100755
index 78d783e..0000000
--- a/vsomeip/include/vsomeip_internal/sd/deserializer.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// deserializer.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_DESERIALIZER_HPP
-#define VSOMEIP_INTERNAL_SD_DESERIALIZER_HPP
-
-#include <vsomeip_internal/deserializer.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class message;
-
-class deserializer
- : public vsomeip::deserializer {
-public:
- deserializer();
- deserializer(uint8_t *_data, std::size_t _length);
- deserializer(const deserializer &_other);
- virtual ~deserializer();
-
- message * deserialize_sd_message();
-};
-
-} // namespace sd
-} // vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_DESERIALIZER_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/entry_impl.hpp b/vsomeip/include/vsomeip_internal/sd/entry_impl.hpp
deleted file mode 100755
index d0cdf7d..0000000
--- a/vsomeip/include/vsomeip_internal/sd/entry_impl.hpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// entry_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef VSOMEIP_INTERNAL_SD_ENTRY_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_ENTRY_IMPL_HPP
-
-#include <vector>
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/serializable.hpp>
-#include <vsomeip/sd/entry.hpp>
-#include <vsomeip_internal/sd/message_element_impl.hpp>
-
-#define VSOMEIP_MAX_OPTION_RUN 2
-
-namespace vsomeip {
-namespace sd {
-
-class option;
-class message_impl;
-
-class entry_impl
- : virtual public entry,
- virtual public message_element_impl {
-public:
- virtual ~entry_impl();
-
- // public interface
- entry_type get_type() const;
-
- service_id get_service_id() const;
- void set_service_id(service_id _id);
-
- instance_id get_instance_id() const;
- void set_instance_id(instance_id _id);
-
- major_version get_major_version() const;
- void set_major_version(major_version _version);
-
- time_to_live get_time_to_live() const;
- void set_time_to_live(time_to_live _time_to_live);
-
- const std::vector< uint8_t > & get_options(uint8_t _run) const;
- void assign_option(const option& _option, uint8_t _run);
-
- bool is_service_entry() const;
- bool is_eventgroup_entry() const;
-
- void set_type(entry_type _type);
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-protected:
- entry_type type_;
- service_id service_id_;
- instance_id instance_id_;
- major_version major_version_;
- time_to_live time_to_live_;
-
- std::vector< uint8_t > options_[VSOMEIP_MAX_OPTION_RUN];
-
- entry_impl();
- entry_impl(const entry_impl &entry_);
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_ENTRY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/eventgroup_client_proxy.hpp b/vsomeip/include/vsomeip_internal/sd/eventgroup_client_proxy.hpp
deleted file mode 100644
index d4541f2..0000000
--- a/vsomeip/include/vsomeip_internal/sd/eventgroup_client_proxy.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// eventgroup_client_proxy.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_EVENTGROUP_CLIENT_PROXY_HPP
-#define VSOMEIP_INTERNAL_SD_EVENTGROUP_CLIENT_PROXY_HPP
-
-#include <set>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-namespace sd {
-
-class client_proxy;
-
-class eventgroup_client_proxy {
-public:
- eventgroup_client_proxy(client_proxy *_client, eventgroup_id _eventgroup);
-
- const endpoint * get_multicast() const;
- void set_multicast(const endpoint *_multicast);
-
- bool is_acknowledged() const;
- void set_acknowledged(bool _is_acknowledged);
-
- void subscribe(client_id _client);
- void unsubscribe(client_id _client);
-
-private:
- client_proxy *client_;
- eventgroup_id eventgroup_;
-
- bool is_acknowledged_;
- const endpoint *multicast_;
-
- std::set< client_id > subscribers_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_EVENTGROUP_SERVICE_PROXY_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/eventgroup_entry_impl.hpp b/vsomeip/include/vsomeip_internal/sd/eventgroup_entry_impl.hpp
deleted file mode 100755
index 729b812..0000000
--- a/vsomeip/include/vsomeip_internal/sd/eventgroup_entry_impl.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// eventgroup_entry_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_EVENTGROUP_ENTRY_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_EVENTGROUP_ENTRY_IMPL_HPP
-
-#include <vsomeip/sd/eventgroup_entry.hpp>
-#include <vsomeip_internal/sd/entry_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class eventgroup_entry_impl
- : virtual public eventgroup_entry,
- virtual public entry_impl {
-public:
- eventgroup_entry_impl();
- eventgroup_entry_impl(const eventgroup_entry_impl &entry_);
- virtual ~eventgroup_entry_impl();
-
- eventgroup_id get_eventgroup_id() const;
- void set_eventgroup_id(eventgroup_id _id);
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-private:
- eventgroup_id eventgroup_id_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_EVENTGROUP_ENTRY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/eventgroup_service_proxy.hpp b/vsomeip/include/vsomeip_internal/sd/eventgroup_service_proxy.hpp
deleted file mode 100644
index 47b27bc..0000000
--- a/vsomeip/include/vsomeip_internal/sd/eventgroup_service_proxy.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// eventgroup_service_proxy.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_EVENTGROUP_SERVICE_PROXY_HPP
-#define VSOMEIP_INTERNAL_SD_EVENTGROUP_SERVICE_PROXY_HPP
-
-#include <set>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-namespace sd {
-
-class service_proxy;
-
-class eventgroup_service_proxy {
-public:
- eventgroup_service_proxy(service_proxy *_service, eventgroup_id _eventgroup);
-
- const endpoint * get_multicast() const;
- void set_multicast(const endpoint *_multicast);
-
- void subscribe(const endpoint *_reliable, const endpoint *_unreliable);
- void unsubscribe(const endpoint *_reliable, const endpoint *_unreliable);
-
-private:
- service_proxy *service_;
- eventgroup_id eventgroup_;
-
- major_version version_;
- time_to_live ttl_;
-
- const endpoint *multicast_;
-
- std::set< const endpoint * > subscribers_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_EVENTGROUP_SERVICE_PROXY_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/events.hpp b/vsomeip/include/vsomeip_internal/sd/events.hpp
deleted file mode 100644
index 8f9527b..0000000
--- a/vsomeip/include/vsomeip_internal/sd/events.hpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// events.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_EVENTS_HPP
-#define VSOMEIP_INTERNAL_SD_EVENTS_HPP
-
-#include <boost/statechart/event.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-namespace sd {
-
-struct ev_none
- : boost::statechart::event< ev_none > {
-};
-
-struct ev_timeout_expired
- : boost::statechart::event< ev_timeout_expired > {
-};
-
-struct ev_status_change
- : boost::statechart::event< ev_status_change > {
-};
-
-/*
-struct ev_network_status_change
- : boost::statechart::event< ev_network_status_change > {
-
- ev_network_status_change(bool _is_configured, bool _is_up)
- : is_configured_(_is_configured), is_up_(_is_up) {};
-
- bool is_configured_;
- bool is_up_;
-};
-
-struct ev_service_status_change
- : boost::statechart::event< ev_service_status_change > {
-
- ev_service_status_change(bool _is_ready) : is_ready_(_is_ready) {};
-
- bool is_ready_;
-};
-*/
-
-struct ev_request_status_change
- : boost::statechart::event< ev_request_status_change > {
-
- ev_request_status_change(bool _is_requested) : is_requested_(_is_requested) {};
-
- bool is_requested_;
-};
-
-struct ev_find_service
- : boost::statechart::event< ev_find_service > {
-
- ev_find_service(service_id _service, instance_id _instance,
- const endpoint *_source, bool _is_unicast_enabled)
- : service_(_service), instance_(_instance),
- source_(_source), is_unicast_enabled_(_is_unicast_enabled) {};
-
- service_id service_;
- instance_id instance_;
- const endpoint *source_;
- bool is_unicast_enabled_;
-};
-
-struct ev_offer_service
- : boost::statechart::event< ev_offer_service > {
-};
-
-struct ev_stop_offer_service
- : boost::statechart::event< ev_stop_offer_service > {
-};
-
-struct ev_request_eventgroup
- : boost::statechart::event< ev_request_eventgroup > {
-
- ev_request_eventgroup(eventgroup_id _id)
- : id_(_id) {};
-
- eventgroup_id id_;
-};
-
-struct ev_release_eventgroup
- : boost::statechart::event< ev_release_eventgroup > {
-
- ev_release_eventgroup(eventgroup_id _id)
- : id_(_id) {};
-
- eventgroup_id id_;
-};
-
-struct ev_subscribe_eventgroup_ack
- : boost::statechart::event< ev_subscribe_eventgroup_ack > {
-
- ev_subscribe_eventgroup_ack(eventgroup_id _id, const endpoint *_address)
- : id_(_id), address_(_address) {};
-
- eventgroup_id id_;
- const endpoint *address_;
-};
-
-struct ev_unsubscribe_eventgroup_ack
- : boost::statechart::event< ev_unsubscribe_eventgroup_ack > {
-
- ev_unsubscribe_eventgroup_ack(eventgroup_id _id, const endpoint *_address)
- : id_(_id), address_(_address) {};
-
- eventgroup_id id_;
- const endpoint *address_;
-};
-
-struct ev_subscribe_eventgroup
- : boost::statechart::event< ev_subscribe_eventgroup > {
-
- ev_subscribe_eventgroup(const endpoint *_source, eventgroup_id _id, const endpoint *_address)
- : source_(_source), id_(_id), address_(_address) {};
-
- const endpoint *source_;
- eventgroup_id id_;
- const endpoint *address_;
-};
-
-struct ev_unsubscribe_eventgroup
- : boost::statechart::event< ev_unsubscribe_eventgroup > {
-
- ev_unsubscribe_eventgroup(const endpoint *_source, eventgroup_id _id, const endpoint *_address)
- : source_(_source), id_(_id), address_(_address) {};
-
- const endpoint *source_;
- eventgroup_id id_;
- const endpoint *address_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_EVENTS_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/factory_impl.hpp b/vsomeip/include/vsomeip_internal/sd/factory_impl.hpp
deleted file mode 100644
index d9b8ca1..0000000
--- a/vsomeip/include/vsomeip_internal/sd/factory_impl.hpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// factory_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_FACTORY_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_FACTORY_IMPL_HPP
-
-#include <vsomeip/sd/factory.hpp>
-
-namespace vsomeip {
-
-class daemon;
-
-namespace sd {
-
-class factory_impl
- : virtual public factory {
-public:
- static factory * get_instance();
-
- virtual ~factory_impl();
-
- service_discovery * create_service_discovery(daemon &_owner) const;
-
- message * create_message() const;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_FACTORY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/group.hpp b/vsomeip/include/vsomeip_internal/sd/group.hpp
deleted file mode 100644
index 8063bb6..0000000
--- a/vsomeip/include/vsomeip_internal/sd/group.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// group.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_GROUP_HPP
-#define VSOMEIP_INTERNAL_SD_GROUP_HPP
-
-#include <set>
-#include <string>
-
-#include <boost/asio/io_service.hpp>
-#include <boost/shared_ptr.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip_internal/sd/group_machine.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-namespace sd {
-
-class client_proxy;
-class message;
-class option;
-class service_discovery;
-class service_proxy;
-
-class group {
-public:
- group(const std::string &_name, service_discovery *_owner);
-
- inline service_discovery * get_owner() const { return owner_; };
-
- void init();
- void start();
-
- const std::string & get_name() const;
- boost::asio::io_service & get_service();
-
- bool is_started() const;
- bool is_network_configured() const;
-
- void send_services_status(service_id _service, instance_id _instance, const endpoint *_target, bool _is_announcing);
-
- client_proxy * find_client(service_id _service, instance_id _instance);
- client_proxy * add_client(service_id _service, instance_id _instance);
- void remove_client(service_id _service, instance_id _instance);
-
- service_proxy * find_service(service_id _service, instance_id _instance);
- service_proxy * add_service(service_id _service, instance_id _instance);
- void remove_service(service_id _service, instance_id _instance);
-
- void on_service_withdraw();
- void on_service_started();
- void on_service_stopped();
-
- void on_service_requested();
- void on_service_released();
-
- void on_eventgroup_provided();
- void on_eventgroup_withdrawn();
-
- void on_eventgroup_requested();
- void on_eventgroup_released();
-
- void on_find_service(service_id _service, instance_id _instance, const endpoint *_source, bool _is_unicast_enabled);
- void on_offer_service(service_id _service, instance_id _instance, const endpoint *_source,
- const endpoint *_reliable, const endpoint *_unreliable);
- void on_subscribe_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup,
- const endpoint *_source, const endpoint *_multicast,
- bool _stop);
-
-private:
- option * add_endpoint_option(message *_message, const endpoint *_endpoint) const;
-
-private:
- std::string name_;
- service_discovery *owner_;
-
- std::set< boost::shared_ptr< client_proxy > > clients_;
- std::set< boost::shared_ptr< service_proxy > > services_;
-
- bool is_client_started_;
- bool is_service_started_;
-
- group_machine machine_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-
-
-#endif // VSOMEIP_INTERNAL_SD_SERVICE_GROUP_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/group_machine.hpp b/vsomeip/include/vsomeip_internal/sd/group_machine.hpp
deleted file mode 100644
index a1289e5..0000000
--- a/vsomeip/include/vsomeip_internal/sd/group_machine.hpp
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// group_machine.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_GROUP_MACHINE_HPP
-#define VSOMEIP_INTERNAL_SD_GROUP_MACHINE_HPP
-
-#include <iomanip>
-#include <set>
-
-#include <boost/mpl/list.hpp>
-#include <boost/statechart/custom_reaction.hpp>
-#include <boost/statechart/state.hpp>
-#include <boost/statechart/state_machine.hpp>
-#include <boost/statechart/transition.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/sd/events.hpp>
-#include <vsomeip_internal/sd/timer_service.hpp>
-
-namespace mpl = boost::mpl;
-namespace sc = boost::statechart;
-
-namespace vsomeip {
-namespace sd {
-
-class group;
-
-namespace _group {
-
-struct inactive;
-struct machine
- : sc::state_machine< machine, inactive >,
- public timer_service {
-
- machine(group *_group);
- virtual ~machine();
-
- bool is_active() const;
-
- void send(service_id _service = VSOMEIP_ANY_SERVICE,
- instance_id _instance = VSOMEIP_ANY_INSTANCE,
- const endpoint *_target = 0,
- bool _is_announcing = false);
-
- void timer_expired(const boost::system::error_code &_error);
- void log(const std::string &_message);
-
- // Delays within the different phases
- uint32_t initial_delay_;
- uint32_t repetition_base_delay_;
- uint32_t cyclic_offer_delay_;
-
- // The management for a group of service that share
- // the same behavior with regard to service discovery
- // timings.
- group *group_;
-
- // Repetitions
- uint8_t repetition_max_;
- uint8_t run_;
-};
-
-struct inactive
- : sc::state< inactive, machine > {
-
- inactive(my_context _context);
-
- typedef mpl::list<
- sc::custom_reaction< ev_none >,
- sc::custom_reaction< ev_status_change >
- > reactions;
-
- sc::result react(const ev_none &_event);
- sc::result react(const ev_status_change &_event);
-};
-
-struct initial;
-struct active
- : sc::state< active, machine, initial > {
-
- active(my_context _context);
- ~active();
-
- typedef sc::custom_reaction< ev_status_change > reactions;
-
- sc::result react(const ev_status_change &_event);
-};
-
-struct initial
- : sc::state< initial, active > {
-
- initial(my_context _context);
-
- typedef sc::custom_reaction< ev_timeout_expired > reactions;
-
- sc::result react(const ev_timeout_expired &_event);
-};
-
-struct repeat
- : sc::state< repeat, active > {
-
- repeat(my_context _context);
-
- typedef mpl::list<
- sc::custom_reaction< ev_timeout_expired >,
- sc::custom_reaction< ev_find_service >
- > reactions;
-
- sc::result react(const ev_timeout_expired &_event);
- sc::result react(const ev_find_service &_event);
-};
-
-struct announce
- : sc::state< announce, active > {
-
- announce(my_context _context);
-
- typedef mpl::list<
- sc::custom_reaction< ev_timeout_expired >,
- sc::custom_reaction< ev_find_service >
- > reactions;
-
- sc::result react(const ev_timeout_expired &_event);
- sc::result react(const ev_find_service &_event);
-};
-
-} // namespace _group
-
-typedef _group::machine group_machine;
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_GROUP_MACHINE_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/ipv4_endpoint_option_impl.hpp b/vsomeip/include/vsomeip_internal/sd/ipv4_endpoint_option_impl.hpp
deleted file mode 100644
index a180717..0000000
--- a/vsomeip/include/vsomeip_internal/sd/ipv4_endpoint_option_impl.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// ipv4_endpoint_option_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef VSOMEIP_INTERNAL_SD_IPV4_ENDPOINT_OPTION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_IPV4_ENDPOINT_OPTION_IMPL_HPP
-
-#include <vsomeip/sd/ipv4_endpoint_option.hpp>
-#include <vsomeip_internal/sd/option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class ipv4_endpoint_option_impl
- : virtual public ipv4_endpoint_option,
- virtual public option_impl {
-public:
- ipv4_endpoint_option_impl();
- virtual ~ipv4_endpoint_option_impl();
- bool operator == (const option &_option) const;
-
- ipv4_address get_address() const;
- void set_address(ipv4_address _address);
-
- ip_port get_port() const;
- void set_port(ip_port _port);
-
- ip_protocol get_protocol() const;
- void set_protocol(ip_protocol _protocol);
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-protected:
- ipv4_address address_;
- ip_port port_;
- ip_protocol protocol_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_IPV4_ENDPOINT_OPTION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/ipv4_multicast_option_impl.hpp b/vsomeip/include/vsomeip_internal/sd/ipv4_multicast_option_impl.hpp
deleted file mode 100755
index 4b7e5b3..0000000
--- a/vsomeip/include/vsomeip_internal/sd/ipv4_multicast_option_impl.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// ipv4_multicast_option_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef VSOMEIP_INTERNAL_SD_IPV4_MULTICAST_OPTION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_IPV4_MULTICAST_OPTION_IMPL_HPP
-
-#include <vsomeip/sd/ipv4_multicast_option.hpp>
-#include <vsomeip_internal/sd/ipv4_endpoint_option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class ipv4_multicast_option_impl
- : virtual public ipv4_multicast_option,
- virtual public ipv4_endpoint_option_impl {
-public:
- ipv4_multicast_option_impl();
- virtual ~ipv4_multicast_option_impl();
- bool operator == (const option &_option) const;
-
- void set_protocol(ip_protocol _protocol);
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_IPV4_MULTICAST_OPTION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/ipv6_endpoint_option_impl.hpp b/vsomeip/include/vsomeip_internal/sd/ipv6_endpoint_option_impl.hpp
deleted file mode 100644
index f2c0e27..0000000
--- a/vsomeip/include/vsomeip_internal/sd/ipv6_endpoint_option_impl.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// ipv6_endpoint_option_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef VSOMEIP_INTERNAL_SD_IPV6_ENDPOINT_OPTION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_IPV6_ENDPOINT_OPTION_IMPL_HPP
-
-#include <vsomeip/sd/ipv6_endpoint_option.hpp>
-#include <vsomeip_internal/sd/option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class ipv6_endpoint_option_impl
- : virtual public ipv6_endpoint_option,
- virtual public option_impl {
-public:
- ipv6_endpoint_option_impl();
- virtual ~ipv6_endpoint_option_impl();
- bool operator == (const option& _option) const;
-
- const ipv6_address & get_address() const;
- void set_address(const ipv6_address &_address);
-
- ip_port get_port() const;
- void set_port(ip_port _port);
-
- ip_protocol get_protocol() const;
- void set_protocol(ip_protocol _protocol);
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-protected:
- ipv6_address address_;
- ip_port port_;
- ip_protocol protocol_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_IPV6_ENDPOINT_OPTION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/ipv6_multicast_option_impl.hpp b/vsomeip/include/vsomeip_internal/sd/ipv6_multicast_option_impl.hpp
deleted file mode 100755
index bd8f8ed..0000000
--- a/vsomeip/include/vsomeip_internal/sd/ipv6_multicast_option_impl.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// ipv6_multicast_option_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef VSOMEIP_INTERNAL_SD_IPV6_MULTICAST_OPTION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_IPV6_MULTICAST_OPTION_IMPL_HPP
-
-#include <vsomeip/sd/ipv6_multicast_option.hpp>
-#include <vsomeip_internal/sd/ipv6_endpoint_option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class ipv6_multicast_option_impl
- : virtual public ipv6_multicast_option,
- virtual public ipv6_endpoint_option_impl {
-public:
- ipv6_multicast_option_impl();
- virtual ~ipv6_multicast_option_impl();
- bool operator == (const option& _option) const;
-
- void set_protocol(ip_protocol _protocol);
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_IPV6_MULTICAST_OPTION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/load_balancing_option_impl.hpp b/vsomeip/include/vsomeip_internal/sd/load_balancing_option_impl.hpp
deleted file mode 100755
index 117f218..0000000
--- a/vsomeip/include/vsomeip_internal/sd/load_balancing_option_impl.hpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// load_balancing_option_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_LOAD_BALANCING_OPTION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_LOAD_BALANCING_OPTION_IMPL_HPP
-
-#include <vsomeip/sd/load_balancing_option.hpp>
-#include <vsomeip_internal/sd/option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class load_balancing_option_impl
- : virtual public load_balancing_option,
- virtual public option_impl {
-public:
- load_balancing_option_impl();
- virtual ~load_balancing_option_impl();
- bool operator ==(const option& _other) const;
-
- priority get_priority() const;
- void set_priority(priority _priority);
-
- weight get_weight() const;
- void set_weight(weight _weight);
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-private:
- priority priority_;
- weight weight_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-
-#endif // VSOMEIP_INTERNAL_SD_LOAD_BALANCING_OPTION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/managing_application_impl.hpp b/vsomeip/include/vsomeip_internal/sd/managing_application_impl.hpp
deleted file mode 100644
index b7acbcf..0000000
--- a/vsomeip/include/vsomeip_internal/sd/managing_application_impl.hpp
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// managing_application_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_MANAGING_APPLICATION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_MANAGING_APPLICATION_IMPL_HPP
-
-#include <boost/shared_ptr.hpp>
-
-#include <vsomeip_internal/sd/client_behavior.hpp>
-#include <vsomeip_internal/managing_application_impl.hpp>
-
-namespace vsomeip {
-
-class client;
-
-namespace sd {
-
-class managing_application_impl : public vsomeip::managing_application_impl {
-public:
- managing_application_impl(const std::string &_name);
- virtual ~managing_application_impl();
-
- void init(int _options_count, char **_options);
- void start();
- void stop();
-
- bool request_service(service_id _service, instance_id _instance,
- const endpoint * /* unused */);
- bool release_service(service_id _service, instance_id _instance);
-
- bool provide_service(service_id _service, instance_id _instance,
- const endpoint *_location);
- bool withdraw_service(service_id _service, instance_id _instance,
- const endpoint *_location);
-
- bool start_service(service_id _service, instance_id _instance);
- bool stop_service(service_id _service, instance_id _instance);
-
-private:
- void open_cbk(boost::system::error_code const &);
- void retry_open_cbk(boost::system::error_code const &);
-
-private:
- boost::asio::io_service queue_service_;
- boost::asio::system_timer retry_timer_;
-
- std::string queue_name_prefix_;
-
- // Message queue to communicate to the vsomeip-daemon
- std::string daemon_queue_name_;
- boost::shared_ptr< message_queue > daemon_queue_;
-
- uint32_t retry_timeout_;
- bool is_open_;
-
- typedef std::map< service_id,
- std::map< instance_id,
- boost::shared_ptr< client_fsm::behavior > > > client_behavior_t;
-
- client_behavior_t used_clients_;
- boost::shared_ptr< client > sd_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_MANAGING_APPLICATION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/message_element_impl.hpp b/vsomeip/include/vsomeip_internal/sd/message_element_impl.hpp
deleted file mode 100755
index 52ce7ee..0000000
--- a/vsomeip/include/vsomeip_internal/sd/message_element_impl.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// message_element.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_MESSAGE_ELEMENT_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_MESSAGE_ELEMENT_IMPL_HPP
-
-namespace vsomeip {
-namespace sd {
-
-class message_impl;
-
-class message_element_impl {
-public:
- message_element_impl();
-
- message_impl * get_owning_message() const;
- void set_owning_message(message_impl *_owner);
-
-protected:
- message_impl *owner_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_MESSAGE_ELEMENT_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/message_impl.hpp b/vsomeip/include/vsomeip_internal/sd/message_impl.hpp
deleted file mode 100755
index ef289bb..0000000
--- a/vsomeip/include/vsomeip_internal/sd/message_impl.hpp
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// message_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_MESSAGE_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_MESSAGE_IMPL_HPP
-
-#include <vector>
-
-#include <vsomeip/sd/message.hpp>
-#include <vsomeip_internal/message_base_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class entry;
-class option;
-
-class message_impl
- : virtual public message,
- virtual public vsomeip::message_base_impl {
-public:
- message_impl();
- virtual ~message_impl();
-
- length get_length() const;
- void set_length(length _length);
-
- bool get_reboot_flag() const;
- void set_reboot_flag(bool _is_set);
-
- bool get_unicast_flag() const;
- void set_unicast_flag(bool _is_set);
-
- eventgroup_entry & create_eventgroup_entry();
- service_entry & create_service_entry();
-
- configuration_option & create_configuration_option();
- ipv4_endpoint_option & create_ipv4_endpoint_option();
- ipv4_multicast_option & create_ipv4_multicast_option();
- ipv6_endpoint_option & create_ipv6_endpoint_option();
- ipv6_multicast_option & create_ipv6_multicast_option();
- load_balancing_option & create_load_balancing_option();
- protection_option & create_protection_option();
-
- const std::vector< entry * > get_entries() const;
- const std::vector< option * > get_options() const;
-
- int16_t get_option_index(const option &_option) const;
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-private:
- entry * deserialize_entry(vsomeip::deserializer *_from);
- option * deserialize_option(vsomeip::deserializer *_from);
-
-private:
- flags flags_;
-
- std::vector< entry * > entries_;
- std::vector< option * > options_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_MESSAGE_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/option_impl.hpp b/vsomeip/include/vsomeip_internal/sd/option_impl.hpp
deleted file mode 100644
index 591aaee..0000000
--- a/vsomeip/include/vsomeip_internal/sd/option_impl.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// option_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifndef VSOMEIP_INTERNAL_SD_OPTION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_OPTION_IMPL_HPP
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip/sd/enumeration_types.hpp>
-#include <vsomeip/sd/option.hpp>
-#include <vsomeip_internal/sd/message_element_impl.hpp>
-
-namespace vsomeip {
-
-class serializer;
-class deserializer;
-
-namespace sd {
-
-class message_impl;
-
-class option_impl
- : virtual public option,
- virtual public message_element_impl {
-public:
- option_impl();
- virtual ~option_impl();
-
- uint16_t get_length() const;
- option_type get_type() const;
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-protected:
- uint16_t length_;
- option_type type_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_OPTION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/protection_option_impl.hpp b/vsomeip/include/vsomeip_internal/sd/protection_option_impl.hpp
deleted file mode 100755
index 6a33254..0000000
--- a/vsomeip/include/vsomeip_internal/sd/protection_option_impl.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// protection_option_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_PROTECTION_OPTION_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_PROTECTION_OPTION_IMPL_HPP
-
-#include <vsomeip/sd/protection_option.hpp>
-#include <vsomeip_internal/sd/option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class protection_option_impl
- : virtual public protection_option,
- virtual public option_impl {
-public:
- protection_option_impl();
- virtual ~protection_option_impl();
- bool operator ==(const option &_other) const;
-
- alive_counter get_alive_counter() const;
- void set_alive_counter(alive_counter _counter);
-
- crc get_crc() const;
- void set_crc(crc _crc);
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-private:
- alive_counter counter_;
- crc crc_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_PROTECTION_OPTION_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/service.hpp b/vsomeip/include/vsomeip_internal/sd/service.hpp
deleted file mode 100644
index 94a97ab..0000000
--- a/vsomeip/include/vsomeip_internal/sd/service.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// service_manager.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_SERVICE_HPP
-#define VSOMEIP_INTERNAL_SD_SERVICE_HPP
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class service {
-public:
- service(service_id _service, instance_id _instance);
-
- service_id get_service_id() const;
- instance_id get_instance_id() const;
-
- const std::set< eventgroup_id > & get_eventgroups() const;
- void add_eventgroup(eventgroup_id _eventgroup);
- void remove_eventgroup(eventgroup_id _eventgroup);
-
- bool is_local() const;
-
- bool is_active() const;
- void set_active(bool _is_active);
-
-private:
- service_id service_;
- instance_id instance_;
-
- std::set< eventgroup_id > eventgroups_;
-
- bool is_local_;
- bool is_active_;
- std::set< client_id > requesters_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_SERVICE_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/service_discovery.hpp b/vsomeip/include/vsomeip_internal/sd/service_discovery.hpp
deleted file mode 100644
index 6bfb858..0000000
--- a/vsomeip/include/vsomeip_internal/sd/service_discovery.hpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// service_discovery.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_SERVICE_DISCOVERY_HPP
-#define VSOMEIP_INTERNAL_SD_SERVICE_DISCOVERY_HPP
-
-#include <boost/asio/io_service.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class daemon;
-class endpoint;
-class message_base;
-class message;
-
-namespace sd {
-
-class service_discovery {
-public:
- virtual ~service_discovery() {};
-
- virtual boost::asio::io_service & get_service() = 0;
-
- virtual void init() = 0;
- virtual void start() = 0;
- virtual void stop() = 0;
-
- virtual void on_provide_service(service_id _service, instance_id _instance, const endpoint *_location) = 0;
- virtual void on_withdraw_service(service_id _service, instance_id _instance, const endpoint *_location) = 0;
- virtual void on_start_service(service_id _service, instance_id _instance) = 0;
- virtual void on_stop_service(service_id _service, instance_id _instance) = 0;
-
- virtual void on_request_service(client_id _client, service_id _service, instance_id _instance) = 0;
- virtual void on_release_service(client_id _client, service_id _service, instance_id _instance) = 0;
-
- virtual void on_provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_multicast) = 0;
- virtual void on_withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_multicast) = 0;
-
- virtual void on_request_eventgroup(client_id _client, service_id _service, instance_id _instance, eventgroup_id _eventgroup) = 0;
- virtual void on_release_eventgroup(client_id _client, service_id _service, instance_id _instance, eventgroup_id _eventgroup) = 0;
-
- virtual void on_message(const uint8_t *_data, uint32_t _size, const endpoint *_source, const endpoint *_target) = 0;
-
- virtual void on_service_available(service_id _service, instance_id _instance, const endpoint *_reliable, const endpoint *_unreliable) = 0;
-
- virtual bool send(message *_message) = 0;
-
- virtual bool update_client(client_id _client,
- service_id _service, instance_id _instance, const endpoint *_location,
- bool _is_available) = 0;
-};
-
-} // sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_SERVICE_DISCOVERY_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/service_discovery_impl.hpp b/vsomeip/include/vsomeip_internal/sd/service_discovery_impl.hpp
deleted file mode 100644
index f17f383..0000000
--- a/vsomeip/include/vsomeip_internal/sd/service_discovery_impl.hpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// service_discovery_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_SERVICE_DISCOVERY_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_SERVICE_DISCOVERY_IMPL_HPP
-
-#include <map>
-#include <set>
-
-#include <boost/log/sources/severity_logger.hpp>
-#include <boost/log/trivial.hpp>
-#include <boost/shared_ptr.hpp>
-
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip_internal/sd/service_discovery.hpp>
-
-namespace vsomeip {
-
-class application;
-class daemon;
-class endpoint;
-class message_base;
-
-namespace sd {
-
-class client_proxy;
-class deserializer;
-class group;
-class service_proxy;
-
-class service_discovery_impl
- : public service_discovery {
-public:
- service_discovery_impl(daemon& _owner);
- virtual ~service_discovery_impl();
-
- void init();
- void start();
- void stop();
-
- boost::asio::io_service & get_service();
-
- void on_provide_service(service_id _service, instance_id _instance, const endpoint *_location);
- void on_withdraw_service(service_id _service, instance_id _instance, const endpoint *_location);
-
- void on_start_service(service_id _service, instance_id _instance);
- void on_stop_service(service_id _service, instance_id _instance);
-
- void on_request_service(client_id _client, service_id _service, instance_id _instance);
- void on_release_service(client_id _client, service_id _service, instance_id _instance);
-
- void on_provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location);
- void on_withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location);
-
- void on_request_eventgroup(client_id _client, service_id _service, instance_id _instance, eventgroup_id _eventgroup);
- void on_release_eventgroup(client_id _client, service_id _service, instance_id _instance, eventgroup_id _eventgroup);
-
- void on_service_available(service_id _service, instance_id _instance, const endpoint *_reliable, const endpoint *_unreliable);
-
- void on_message(const uint8_t *_data, uint32_t _size,
- const endpoint *_source, const endpoint *_target);
-
- bool send(message *_message);
-
- bool update_client(client_id _client, service_id _service, instance_id _instance, const endpoint *_location, bool _is_available);
-
-private:
- client_proxy * find_client(service_id _service, instance_id _instance) const;
- client_proxy * find_or_create_client(service_id _service, instance_id _instance);
-
- service_proxy * find_service(service_id _service, instance_id _instance) const;
- service_proxy * find_or_create_service(service_id _service, instance_id _instance);
-
- group * find_client_group(service_id _service, instance_id _instance) const;
- group * find_service_group(service_id _service, instance_id _instance) const;
-
- std::string get_broadcast_address(const std::string &_address, const std::string &_mask) const;
-
- void on_find_service(const service_entry *_entry, const std::vector< option * > &_options, const endpoint *_source, bool _is_unicast_enabled);
- void on_offer_service(const service_entry *_entry, const std::vector< option * > &_options, const endpoint *_source);
-
- void on_subscribe_eventgroup(const eventgroup_entry *_entry, const std::vector< option * > &_options, const endpoint *_source);
- void on_subscribe_eventgroup_ack(const eventgroup_entry *_entry, const std::vector< option * > &_options);
-
-private:
- daemon &owner_;
- boost::asio::io_service &service_;
- boost::log::sources::severity_logger<
- boost::log::trivial::severity_level > & logger_;
-
- std::set< boost::shared_ptr< group > > groups_;
- boost::shared_ptr< group > default_group_;
-
- // Broadcast address of the network
- const endpoint *broadcast_;
-
- // Multicast address used to distribute service discovery messages
- const endpoint *multicast_;
-
- // Session - ID (incremented for each message that is sent to the network)
- session_id session_;
-
- // Helper to receive and send messages
- boost::shared_ptr< deserializer > deserializer_;
- factory *factory_;
-};
-
-} // sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_SERVICE_DISCOVERY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/service_entry_impl.hpp b/vsomeip/include/vsomeip_internal/sd/service_entry_impl.hpp
deleted file mode 100644
index c08e2f6..0000000
--- a/vsomeip/include/vsomeip_internal/sd/service_entry_impl.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// service_entry_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_SERVICE_ENTRY_IMPL_HPP
-#define VSOMEIP_INTERNAL_SD_SERVICE_ENTRY_IMPL_HPP
-
-#include <vsomeip/sd/service_entry.hpp>
-#include <vsomeip_internal/sd/entry_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-class service_entry_impl
- : virtual public service_entry,
- virtual public entry_impl {
-public:
- service_entry_impl();
- virtual ~service_entry_impl();
-
- minor_version get_minor_version() const;
- void set_minor_version(minor_version _version);
-
- bool serialize(vsomeip::serializer *_to) const;
- bool deserialize(vsomeip::deserializer *_from);
-
-private:
- minor_version minor_version_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_SERVICE_ENTRY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/service_proxy.hpp b/vsomeip/include/vsomeip_internal/sd/service_proxy.hpp
deleted file mode 100644
index 9a2244e..0000000
--- a/vsomeip/include/vsomeip_internal/sd/service_proxy.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// service_proxy.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_SERVICE_PROXY_HPP
-#define VSOMEIP_INTERNAL_SD_SERVICE_PROXY_HPP
-
-#include <map>
-#include <set>
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-namespace sd {
-
-class group;
-class eventgroup_service_proxy;
-
-class service_proxy {
-public:
- service_proxy(group *_group, service_id _service, instance_id _instance);
-
- service_id get_service() const;
- instance_id get_instance() const;
- major_version get_major_version() const;
- minor_version get_minor_version() const;
- time_to_live get_time_to_live() const;
-
- const endpoint * get_reliable() const;
- const endpoint * get_unreliable() const;
-
- bool is_local() const;
- bool is_started() const;
-
- void provide(const endpoint *_location);
- void withdraw(const endpoint *_location);
-
- void start();
- void stop();
-
- void provide_eventgroup(eventgroup_id _eventgroup, const endpoint *_location);
- void withdraw_eventgroup(eventgroup_id _eventgroup);
-
- void subscribe(eventgroup_id _eventgroup, const endpoint *_source, const endpoint *_reliable, const endpoint *_unreliable, bool _stop);
-
- const std::set< client_id > & get_requesters() const;
- void add_requester(client_id _client);
- void remove_requester(client_id _client);
-
-private:
- group *group_;
-
- service_id service_;
- instance_id instance_;
- major_version major_version_;
- minor_version minor_version_;
- time_to_live ttl_;
-
- bool is_local_;
- bool is_started_;
-
- const endpoint *unreliable_;
- const endpoint *reliable_;
-
- std::map< eventgroup_id, boost::shared_ptr< eventgroup_service_proxy > > eventgroups_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_SERVICE_STATE_HPP
diff --git a/vsomeip/include/vsomeip_internal/sd/timer_service.hpp b/vsomeip/include/vsomeip_internal/sd/timer_service.hpp
deleted file mode 100644
index 6e099f2..0000000
--- a/vsomeip/include/vsomeip_internal/sd/timer_service.hpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// timer_service.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_TIMER_SERVICE_HPP
-#define VSOMEIP_INTERNAL_SD_TIMER_SERVICE_HPP
-
-#include <boost/asio/system_timer.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-struct timer_service {
- timer_service(boost::asio::io_service &_service);
- ~timer_service();
-
- void start_timer(uint32_t _milliseconds);
- void stop_timer();
-
- uint32_t expired_from_now();
-
- virtual void timer_expired(const boost::system::error_code &_error) = 0;
-private:
-
- boost::asio::system_timer timer_;
-};
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_TIMER_SERVICE_HPP
diff --git a/vsomeip/include/vsomeip_internal/service.hpp b/vsomeip/include/vsomeip_internal/service.hpp
deleted file mode 100644
index 5e5469f..0000000
--- a/vsomeip/include/vsomeip_internal/service.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// service.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SERVICE_HPP
-#define VSOMEIP_INTERNAL_SERVICE_HPP
-
-#include <vsomeip_internal/participant.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-class service
- : virtual public participant {
-public:
- virtual ~service() {};
-
- virtual bool send(const uint8_t *_data, uint32_t _size,
- const endpoint *_target, bool _flush = true) = 0;
- virtual bool flush(const endpoint *_target = 0) = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SERVICE_HPP
diff --git a/vsomeip/include/vsomeip_internal/service_impl.hpp b/vsomeip/include/vsomeip_internal/service_impl.hpp
deleted file mode 100644
index dd9ba1d..0000000
--- a/vsomeip/include/vsomeip_internal/service_impl.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// service_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SERVICE_IMPL_HPP
-#define VSOMEIP_INTERNAL_SERVICE_IMPL_HPP
-
-#include <deque>
-#include <map>
-#include <vector>
-
-#include <boost/array.hpp>
-#include <boost/asio/io_service.hpp>
-
-#include <vsomeip_internal/service.hpp>
-#include <vsomeip_internal/participant_impl.hpp>
-
-namespace vsomeip {
-
-template < typename Protocol, int MaxBufferSize >
-class service_impl
- : virtual public service,
- public participant_impl< MaxBufferSize > {
-public:
- service_impl(managing_proxy_impl *_owner, const endpoint *_location);
-
- bool is_client() const;
-
- bool send(const uint8_t *_data, uint32_t _size, const endpoint *_target, bool _flush);
- bool flush(const endpoint *_target);
-
- typedef typename Protocol::socket socket_type;
- typedef typename Protocol::endpoint endpoint_type;
- typedef boost::array< uint8_t, MaxBufferSize > buffer_type;
-
-public:
- void connect_cbk(boost::system::error_code const &_error);
- void send_cbk(
- boost::system::error_code const &_error, std::size_t _bytes);
- void flush_cbk(
- const endpoint *_target, const boost::system::error_code &_error);
-
-public:
- virtual void send_queued() = 0;
-
-protected:
- std::map< const endpoint *,
- std::deque< std::vector< uint8_t > > > packet_queues_;
-
- std::map< const endpoint *,
- std::deque< std::vector< uint8_t > > >::iterator current_queue_;
-
- std::map< const endpoint *,
- std::vector< uint8_t > > packetizer_;
-
- boost::asio::system_timer flush_timer_;
-
-private:
- bool set_next_queue();
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SERVICE_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/statistics_impl.hpp b/vsomeip/include/vsomeip_internal/statistics_impl.hpp
deleted file mode 100644
index 93170cd..0000000
--- a/vsomeip/include/vsomeip_internal/statistics_impl.hpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// statistics_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_STATISTICS_IMPL_HPP
-#define VSOMEIP_INTERNAL_STATISTICS_IMPL_HPP
-
-#ifdef USE_VSOMEIP_STATISTICS
-
-#include <cstdint>
-#include <vsomeip/statistics.hpp>
-
-namespace vsomeip {
-
-class statistics_impl : public statistics {
-public:
- statistics_impl();
- virtual ~statistics_impl();
-
- uint32_t get_sent_messages_count() const;
- uint32_t get_sent_bytes_count() const;
- uint32_t get_received_messages_count() const;
- uint32_t get_received_bytes_count() const;
-
- void reset();
-
- uint32_t sent_messages_;
- uint32_t sent_bytes_;
-
- uint32_t received_messages_;
- uint32_t received_bytes_;
-};
-
-} // namespace vsomeip
-
-#endif // USE_VSOMEIP_STATISTICS
-
-#endif // VSOMEIP_INTERNAL_STATISTICS_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/statistics_owner.hpp b/vsomeip/include/vsomeip_internal/statistics_owner.hpp
deleted file mode 100644
index f86be3c..0000000
--- a/vsomeip/include/vsomeip_internal/statistics_owner.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// statistics_owner.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_STATISTICS_OWNER_HPP
-#define VSOMEIP_STATISTICS_OWNER_HPP
-
-namespace vsomeip {
-
-/// Basic interface for all vsomeip library interfaces that contains
-/// informations about the number of messages/bytes it has sent and
-/// received.
-class statistics_owner {
-public:
- virtual ~statistics_owner() {};
-
- /// Get access to the statistics object.
- /// \returns Pointer to the contained statistics object.
- virtual const class statistics * get_statistics() const = 0;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_STATISTICS_OWNER_HPP
diff --git a/vsomeip/include/vsomeip_internal/statistics_owner_impl.hpp b/vsomeip/include/vsomeip_internal/statistics_owner_impl.hpp
deleted file mode 100644
index c48aadc..0000000
--- a/vsomeip/include/vsomeip_internal/statistics_owner_impl.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// statistics_owner_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_STATISTICS_OWNER_IMPL_HPP
-#define VSOMEIP_INTERNAL_STATISTICS_OWNER_IMPL_HPP
-
-#ifdef USE_VSOMEIP_STATISTICS
-#include <vsomeip_internal/statistics_owner.hpp>
-#include <vsomeip_internal/statistics_impl.hpp>
-
-namespace vsomeip {
-
-class statistics_owner_impl
- : virtual public statistics_owner {
-protected:
- virtual ~statistics_owner_impl();
-
-public:
- const statistics * get_statistics() const;
-
-protected:
- statistics_impl statistics_;
-};
-
-} // namespace vsomeip
-#endif // USE_VSOMEIP_STATISTICS
-#endif // VSOMEIP_INTERNAL_STATISTICS_OWNER_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/supervised_managing_proxy_impl.hpp b/vsomeip/include/vsomeip_internal/supervised_managing_proxy_impl.hpp
deleted file mode 100644
index ed93672..0000000
--- a/vsomeip/include/vsomeip_internal/supervised_managing_proxy_impl.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-//supervised_managing_proxy_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SUPERVISED_MANAGING_PROXY_IMPL_HPP
-#define VSOMEIP_INTERNAL_SUPERVISED_MANAGING_PROXY_IMPL_HPP
-
-#include <vsomeip_internal/administration_proxy_impl.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-
-namespace vsomeip {
-
-class supervised_managing_proxy_impl
- : virtual public administration_proxy_impl,
- virtual public managing_proxy_impl {
-public:
- supervised_managing_proxy_impl(application_base_impl &_owner);
- virtual ~supervised_managing_proxy_impl();
-
- void init();
- void start();
- void stop();
-
- bool provide_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool withdraw_service(service_id _service, instance_id _instance, const endpoint *_location);
-
- bool start_service(service_id _service, instance_id _instance);
- bool stop_service(service_id _service, instance_id _instance);
-
- bool request_service(service_id _service, instance_id _instance, const endpoint *_location);
- bool release_service(service_id _service, instance_id _instance);
-
- void register_method(service_id _service, instance_id _instance, method_id _method);
- void deregister_method(service_id _service, instance_id _instance, method_id _method);
-
- bool provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location);
- bool withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location);
-
- bool add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field);
- bool remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field);
-
- bool request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
- bool release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup);
-
- bool enable_magic_cookies(service_id _service, instance_id _instance);
- bool disable_magic_cookies(service_id _service, instance_id _instance);
-
- void on_service_availability(service_id _service, instance_id _instance, const endpoint *_location, bool _is_available);
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SUPERVISED_MANAGING_PROXY_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/tcp_client_impl.hpp b/vsomeip/include/vsomeip_internal/tcp_client_impl.hpp
deleted file mode 100644
index 2b1bfa1..0000000
--- a/vsomeip/include/vsomeip_internal/tcp_client_impl.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// tcp_client_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_TCP_CLIENT_IMPL_HPP
-#define VSOMEIP_INTERNAL_TCP_CLIENT_IMPL_HPP
-
-#include <boost/asio/ip/tcp.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/client_impl.hpp>
-
-namespace vsomeip {
-
-typedef client_impl< boost::asio::ip::tcp,
- VSOMEIP_MAX_TCP_MESSAGE_SIZE > tcp_client_base_impl;
-
-class tcp_client_impl
- : public tcp_client_base_impl {
-public:
- tcp_client_impl(
- managing_proxy_impl *_owner, const endpoint *_location);
- virtual ~tcp_client_impl();
-
- void start();
- void send_queued();
-
- const endpoint *get_local_endpoint() const;
- ip_address get_remote_address() const;
- ip_port get_remote_port() const;
- ip_protocol get_protocol() const;
-
- void join(const std::string &);
- void leave(const std::string &);
-
-private:
- void send_magic_cookie();
-
- void connect();
- void receive();
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_TCP_CLIENT_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/tcp_service_impl.hpp b/vsomeip/include/vsomeip_internal/tcp_service_impl.hpp
deleted file mode 100644
index eb29cdb..0000000
--- a/vsomeip/include/vsomeip_internal/tcp_service_impl.hpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// tcp_service_impl.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_TCP_SERVICE_IMPL_HPP
-#define VSOMEIP_INTERNAL_TCP_SERVICE_IMPL_HPP
-
-#include <map>
-
-#include <boost/asio/ip/tcp.hpp>
-#include <boost/enable_shared_from_this.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/service_impl.hpp>
-
-namespace vsomeip {
-
-typedef service_impl< boost::asio::ip::tcp,
- VSOMEIP_MAX_TCP_MESSAGE_SIZE > tcp_service_base_impl;
-
-class tcp_service_impl
- : public service_impl< boost::asio::ip::tcp, VSOMEIP_MAX_TCP_MESSAGE_SIZE > {
-
-public:
- tcp_service_impl(
- managing_proxy_impl *_owner, const endpoint *_location);
- virtual ~tcp_service_impl();
-
- void start();
- void stop();
-
- void send_queued();
- void restart();
- void receive();
-
- ip_address get_remote_address() const;
- ip_port get_remote_port() const;
- ip_protocol get_protocol() const;
-
- const uint8_t * get_buffer() const;
-
- void join(const std::string &);
- void leave(const std::string &);
-
-private:
- class connection
- : public boost::enable_shared_from_this<connection> {
-
- public:
- typedef boost::shared_ptr<connection> ptr;
-
- static ptr create(tcp_service_impl *_owner);
- socket_type & get_socket();
-
- void start();
-
- void send_queued();
- const uint8_t * get_buffer() const;
-
- private:
- connection(tcp_service_impl *_owner);
- void send_magic_cookie();
-
- tcp_service_impl::socket_type socket_;
- buffer_type buffer_;
- tcp_service_impl *owner_;
-
- private:
- void receive_cbk(
- boost::system::error_code const &_error, std::size_t _bytes);
- };
-
- boost::asio::ip::tcp::acceptor acceptor_;
- std::map< const endpoint *, connection::ptr > connections_;
- connection *current_;
-
-private:
- void accept_cbk(
- connection::ptr _connection, boost::system::error_code const &_error);
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_TCP_SERVICE_IMPL_HPP
diff --git a/vsomeip/include/vsomeip_internal/utility.hpp b/vsomeip/include/vsomeip_internal/utility.hpp
deleted file mode 100644
index 2ace631..0000000
--- a/vsomeip/include/vsomeip_internal/utility.hpp
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// utility.hpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_UTILITY_HPP
-#define VSOMEIP_INTERNAL_UTILITY_HPP
-
-#include <string>
-
-namespace vsomeip {
-
-class utility {
-public:
- static void * load_library(const std::string &_path, const std::string &_symbol);
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_UTILITY_HPP
diff --git a/vsomeip/src/vsomeip.backup/client_group_machine.cpp b/vsomeip/src/vsomeip.backup/client_group_machine.cpp
deleted file mode 100644
index aa8fd42..0000000
--- a/vsomeip/src/vsomeip.backup/client_group_machine.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-// client_behavior.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iomanip>
-
-#include <vsomeip/application.hpp>
-#include <vsomeip_internal/sd/client_state_machine.hpp>
-#include <vsomeip_internal/sd/eventgroup_client_state_machine.hpp>
-#include <vsomeip_internal/sd/service_discovery.hpp>
-
-namespace vsomeip {
-namespace sd {
-namespace _client_group {
-
-machine::machine(service_discovery *_discovery)
- : timer_service(_discovery->get_service()),
- discovery_(_discovery),
- tcp_local_(0),
- udp_local_(0),
- tcp_remote_(0),
- udp_remote_(0) {
-}
-
-machine::~machine() {
-}
-
-eventgroup_machine * machine::find_eventgroup_machine(eventgroup_id _eventgroup) {
- eventgroup_machine *its_machine = 0;
- auto found_eventgroup = eventgroups_.find(_eventgroup);
- if (found_eventgroup != eventgroups_.end()) {
- its_machine = found_eventgroup->second;
- }
- return its_machine;
-}
-
-void machine::request_eventgroup(client_id _client, eventgroup_id _eventgroup) {
- std::cout << "CLIENT IS REQUESTING AN EVENTGROUP!!!" << std::endl;
- eventgroup_machine *its_machine = find_eventgroup_machine(_eventgroup);
- if (0 == its_machine) {
- its_machine = new eventgroup_machine(this);
- eventgroups_[_eventgroup] = its_machine;
- std::cout << "STATE MACHINE STARTS!!!" << std::endl;
- its_machine->initiate();
- }
-
- its_machine->clients_.insert(_client);
-}
-
-void machine::release_eventgroup(client_id _client, eventgroup_id _eventgroup) {
- eventgroup_machine *its_machine = find_eventgroup_machine(_eventgroup);
- if (0 != its_machine) {
- its_machine->clients_.erase(_client);
- if (0 == its_machine->clients_.size()) {
- eventgroups_.erase(_eventgroup); // TODO: handle lifecycle of eventgroup machine
- }
- }
-}
-
-void machine::announce_service_state(bool _is_available) {
- discovery_->send_service_state(service_, instance_, _is_available);
-}
-
-void machine::send_find_service() {
- discovery_->send_find_service(this);
-}
-
-void machine::send_subscribe() {
- discovery_->send_subscribe(this);
-}
-
-void machine::timer_expired(const boost::system::error_code &_error) {
- if (0 == _error) {
- process_event(ev_timeout_expired());
- }
-}
-
-void machine::log(const std::string &_message) {
-#ifdef VSOMEIP_SD_DEBUG
- std::cout << "Client ["
- << std::hex << std::setfill('0') << std::setw(4) << service_
- << "."
- << std::hex << std::setfill('0') << std::setw(4) << instance_
- << "] enters state \""
- << _message
- << "\""
- << std::endl;
-#endif
-}
-
-
-// State "not_seen"
-not_seen::not_seen(my_context ctx)
- : sc::state< not_seen, machine, waiting >(ctx) {
- outermost_context().log("NotSeen");
- outermost_context().announce_service_state(false);
-}
-
-sc::result not_seen::react(const ev_offer_service &_event) {
- return transit< seen >();
-}
-
-// State "waiting"
-waiting::waiting(my_context ctx)
- : sc::state< waiting, not_seen >(ctx) {
- outermost_context().log("NotSeen.Waiting");
-}
-
-sc::result waiting::react(const ev_none &_event) {
- if (outermost_context().is_ready() && outermost_context().is_service_requested_)
- return transit< initializing >();
-
- return discard_event();
-}
-
-sc::result waiting::react(const ev_network_status_change &_event) {
- outermost_context().is_network_up_ = _event.is_up_;
- outermost_context().is_network_configured_ = _event.is_configured_;
-
- if (outermost_context().is_ready() && outermost_context().is_service_requested_)
- return transit< initializing >();
-
- return discard_event();
-}
-
-sc::result waiting::react(const ev_request_status_change &_event) {
- outermost_context().is_service_requested_ = _event.is_requested_;
-
- if (outermost_context().is_ready() && outermost_context().is_service_requested_)
- return transit< initializing >();
-
- return discard_event();
-}
-
-// State "initializing"
-initializing::initializing(my_context ctx)
- : sc::state< initializing, not_seen >(ctx) {
- outermost_context().log("NotSeen.Initializing");
-}
-
-sc::result initializing::react(const ev_timeout_expired &_event) {
- return transit< searching >();
-}
-
-// State "searching"
-searching::searching(my_context ctx)
- : sc::state< searching, not_seen >(ctx) {
- outermost_context().log("Searching");
-}
-
-sc::result searching::react(const ev_timeout_expired &_event) {
- return transit< searching >();
-}
-
-// State "seen"
-seen::seen(my_context ctx)
- : sc::state< seen, machine, not_requested >(ctx) {
- outermost_context().log("Seen");
- outermost_context().announce_service_state(true);
- post_event(ev_none());
-}
-
-sc::result seen::react(const ev_timeout_expired &_event) {
- return transit< not_seen >();
-}
-
-sc::result seen::react(const ev_stop_offer_service &_event) {
- return transit< not_seen >();
-}
-
-sc::result seen::react(const ev_network_status_change &_event) {
- outermost_context().is_network_up_ = _event.is_up_;
- outermost_context().is_network_configured_ = _event.is_configured_;
-
- if (!outermost_context().is_ready())
- return transit< not_seen >();
-
- return discard_event();
-}
-
-// State "not_requested"
-not_requested::not_requested(my_context ctx)
- : sc::state< not_requested, seen >(ctx) {
- outermost_context().log("Seen.NotRequested");
-}
-
-sc::result not_requested::react(const ev_none &_event) {
- if (outermost_context().is_service_requested_)
- return transit< requested >();
-
- return discard_event();
-}
-
-sc::result not_requested::react(const ev_request_status_change &_event) {
- outermost_context().is_service_requested_ = _event.is_requested_;
-
- if (outermost_context().is_service_requested_)
- return transit< requested >();
-
- return discard_event();
-}
-
-// State "requested"
-requested::requested(my_context ctx)
- : sc::state< requested, seen >(ctx) {
- outermost_context().log("Seen.Requested");
-}
-
-sc::result requested::react(const ev_request_status_change &_event) {
- outermost_context().is_service_requested_ = _event.is_requested_;
-
- if (!outermost_context().is_service_requested_)
- return transit< not_requested >();
-
- return discard_event();
-}
-
-sc::result requested::react(const ev_timeout_expired &_event) {
- return transit< requested >();
-}
-
-} // namespace _client_group
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.backup/client_group_machine.hpp b/vsomeip/src/vsomeip.backup/client_group_machine.hpp
deleted file mode 100644
index 8619d27..0000000
--- a/vsomeip/src/vsomeip.backup/client_group_machine.hpp
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// client_state_machine.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_INTERNAL_SD_CLIENT_STATE_MACHINE_HPP
-#define VSOMEIP_INTERNAL_SD_CLIENT_STATE_MACHINE_HPP
-
-#define VSOMEIP_SD_DEBUG
-
-#include <set>
-
-#include <boost/mpl/list.hpp>
-#include <boost/statechart/custom_reaction.hpp>
-#include <boost/statechart/state.hpp>
-#include <boost/statechart/state_machine.hpp>
-#include <boost/statechart/transition.hpp>
-
-#include <vsomeip_internal/sd/events.hpp>
-#include <vsomeip_internal/sd/timer_service.hpp>
-
-namespace mpl = boost::mpl;
-namespace sc = boost::statechart;
-
-namespace vsomeip {
-namespace sd {
-
-class client_group;
-
-namespace _client_group {
-
-struct eventgroup_machine;
-
-struct not_seen;
-struct machine
- : sc::state_machine< machine, not_seen >,
- public timer_service {
-
- machine(client_group *_group);
- ~machine();
-
- eventgroup_machine * find_eventgroup_machine(eventgroup_id _eventgroup);
- void request_eventgroup(client_id _client, eventgroup_id _eventgroup);
- void release_eventgroup(client_id _client, eventgroup_id _eventgroup);
-
- inline bool is_ready() { return (is_network_up_ && is_network_configured_); };
-
- void announce_service_state(bool _is_available);
-
- void send_find_service();
- void send_subscribe();
-
- void timer_expired(const boost::system::error_code &_error);
-
- void log(const std::string &_message);
-
- uint32_t initial_delay_;
-
- uint32_t repetition_base_delay_;
- uint8_t repetition_max_;
- uint8_t run_;
-
- uint32_t cyclic_offer_delay_;
-
- bool is_network_up_;
- bool is_network_configured_;
-
- // Service data
- service_id service_;
- instance_id instance_;
- major_version major_;
- minor_version minor_;
-
- const endpoint *sd_;
-
- std::map< eventgroup_id, eventgroup_machine * > eventgroups_;
-
- service_discovery *discovery_;
-};
-
-struct waiting;
-struct not_seen
- : sc::state< not_seen, machine, waiting > {
-
- not_seen(my_context ctx);
-
- typedef sc::custom_reaction< ev_offer_service > reactions;
-
- sc::result react(const ev_offer_service &_event);
-};
-
-struct waiting
- : sc::state< waiting, not_seen > {
-
- waiting(my_context ctx);
-
- typedef mpl::list<
- sc::custom_reaction< ev_none >,
- sc::custom_reaction< ev_network_status_change >,
- sc::custom_reaction< ev_request_status_change >
- > reactions;
-
- sc::result react(const ev_none &_event);
- sc::result react(const ev_network_status_change &_event);
- sc::result react(const ev_request_status_change &_event);
-};
-
-struct initializing
- : sc::state< initializing, not_seen > {
-
- initializing(my_context ctx);
-
- typedef sc::custom_reaction< ev_timeout_expired > reactions;
-
- sc::result react(const ev_timeout_expired &_event);
-};
-
-struct searching
- : sc::state< searching, not_seen > {
-
- searching(my_context ctx);
-
- typedef sc::custom_reaction< ev_timeout_expired > reactions;
-
- sc::result react(const ev_timeout_expired &_event);
-};
-
-
-struct not_requested;
-struct not_subscribed;
-struct seen
- : sc::state< seen, machine, not_requested > {
-
- seen(my_context ctx);
-
- typedef mpl::list<
- sc::custom_reaction< ev_timeout_expired >,
- sc::custom_reaction< ev_stop_offer_service >,
- sc::custom_reaction< ev_network_status_change >
- > reactions;
-
- sc::result react(const ev_timeout_expired &_event);
- sc::result react(const ev_stop_offer_service &_event);
- sc::result react(const ev_network_status_change &_event);
-};
-
-struct not_requested
- : sc::state< not_requested, seen > {
-
- not_requested(my_context ctx);
-
- typedef mpl::list<
- sc::custom_reaction< ev_none >,
- sc::custom_reaction< ev_request_status_change >
- > reactions;
-
- sc::result react(const ev_none &_event);
- sc::result react(const ev_request_status_change &_event);
-};
-
-struct requested
- : sc::state< requested, seen > {
-
- requested(my_context ctx);
-
- typedef mpl::list<
- sc::custom_reaction< ev_request_status_change >,
- sc::custom_reaction< ev_timeout_expired >
- > reactions;
-
- sc::result react(const ev_request_status_change &_event);
- sc::result react(const ev_timeout_expired &_event);
-};
-
-} // namespace _client_group
-
-typedef _client_group::machine client_state_machine;
-
-} // namespace sd
-} // namespace vsomeip
-
-#endif // VSOMEIP_INTERNAL_SD_CLIENT_STATE_MACHINE_HPP
diff --git a/vsomeip/src/vsomeip.backup/eventgroup_client_state_machine.cpp b/vsomeip/src/vsomeip.backup/eventgroup_client_state_machine.cpp
deleted file mode 100644
index 04983b2..0000000
--- a/vsomeip/src/vsomeip.backup/eventgroup_client_state_machine.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// eventgroup_client_state_machine.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iomanip>
-
-#include <vsomeip_internal/sd/client_state_machine.hpp>
-#include <vsomeip_internal/sd/eventgroup_client_state_machine.hpp>
-#include <vsomeip_internal/sd/service_discovery.hpp>
-
-namespace vsomeip {
-namespace sd {
-namespace client {
-
-eventgroup_machine::eventgroup_machine(machine *_owner)
- : timer_service(_owner->discovery_->get_service()),
- owner_(_owner) {
-}
-
-void eventgroup_machine::timer_expired(const boost::system::error_code &_error) {
-}
-
-// State "not_subscribed"
-not_subscribed::not_subscribed(my_context ctx)
- : sc::state< not_subscribed, eventgroup_machine >(ctx) {
- outermost_context().owner_->log("NotSubscribed");
- outermost_context().owner_->send_subscribe();
-}
-
-sc::result not_subscribed::react(const ev_timeout_expired &_event) {
- return discard_event();
-}
-
-sc::result not_subscribed::react(const ev_subscribe_eventgroup_ack &_event) {
- return transit< subscribed >();
-}
-
-sc::result not_subscribed::react(const ev_request_eventgroup &_event) {
- return discard_event();
-}
-
-sc::result not_subscribed::react(const ev_release_eventgroup &_event) {
- return discard_event();
-}
-
-subscribed::subscribed(my_context ctx)
- : sc::state< subscribed, eventgroup_machine >(ctx) {
- outermost_context().owner_->log("Seen.Subscribed");
-}
-
-sc::result subscribed::react(const ev_request_eventgroup &_event) {
- return discard_event();
-}
-
-sc::result subscribed::react(const ev_release_eventgroup &_event) {
- return discard_event();
-}
-
-} // namespace client
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.backup/eventgroup_service_state_machine.cpp b/vsomeip/src/vsomeip.backup/eventgroup_service_state_machine.cpp
deleted file mode 100644
index 962c169..0000000
--- a/vsomeip/src/vsomeip.backup/eventgroup_service_state_machine.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// eventgroup_service_state_machine.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/sd/eventgroup_service_state_machine.hpp>
-#include <vsomeip_internal/sd/service_discovery.hpp>
-
-namespace vsomeip {
-namespace sd {
-namespace service {
-
-eventgroup_machine::eventgroup_machine(machine *_owner)
- : owner_(_owner),
- timer_service(_owner->discovery_->get_service()) {
-}
-
-void eventgroup_machine::timer_expired(const boost::system::error_code &_error) {
-
-}
-
-not_subscribed::not_subscribed(my_context ctx)
- : sc::state< not_subscribed, eventgroup_machine >(ctx) {
- outermost_context().owner_->log("Ready.NotSubscribed");
-}
-
-sc::result not_subscribed::react(const ev_subscribe_eventgroup &_event) {
- outermost_context().owner_->add_subscription(_event.source_, _event.id_);
- return transit< subscribed >();
-}
-
-subscribed::subscribed(my_context ctx)
- : sc::state< subscribed, eventgroup_machine >(ctx) {
- outermost_context().owner_->log("Ready.Subscribed");
-}
-
-sc::result subscribed::react(const ev_subscribe_eventgroup &_event) {
- outermost_context().owner_->add_subscription(_event.source_, _event.id_);
- return transit< subscribed >();
-}
-
-sc::result subscribed::react(const ev_unsubscribe_eventgroup &_event) {
- return transit< not_subscribed >();
-}
-
-sc::result subscribed::react(const ev_timeout_expired &_event) {
- return transit< not_subscribed >();
-}
-
-} // service
-} // namespace sd
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.daemon/application_info.hpp b/vsomeip/src/vsomeip.daemon/application_info.hpp
deleted file mode 100644
index 7c61ae0..0000000
--- a/vsomeip/src/vsomeip.daemon/application_info.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// application_info.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_DAEMON_APPLICATION_INFO_HPP
-#define VSOMEIP_DAEMON_APPLICATION_INFO_HPP
-
-#include <map>
-#include <set>
-
-namespace vsomeip {
-
-class endpoint;
-
-struct application_info {
- // IP endpoint are managed by the daemon (true) or by the application (false).
- bool is_managing_;
-
- // If watchdog_ is greater than VSOMEIP_MAX_MISSING_PONGS
- // the application is considered unavailable
- int8_t watchdog_;
-
- // Queue the application wants to receive messages
- boost_ext::asio::message_queue *queue_;
-
- // Name to open the applications message queue. This name
- // can be provided to other application to enable p2p
- std::string queue_name_;
-
- // Services provided by the application
- std::map< service_id, std::map< instance_id, std::set< const endpoint * > > > services_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_DAEMON_APPLICATION_INFO_HPP
diff --git a/vsomeip/src/vsomeip.daemon/client_info.hpp b/vsomeip/src/vsomeip.daemon/client_info.hpp
deleted file mode 100644
index 27d2298..0000000
--- a/vsomeip/src/vsomeip.daemon/client_info.hpp
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// client_info.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_DAEMON_CLIENT_INFO_HPP
-#define VSOMEIP_DAEMON_CLIENT_INFO_HPP
-
-#include <map>
-#include <set>
-
-namespace vsomeip {
-
-class endpoint;
-
-struct client_info {
-
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_DAEMON_CLIENT_INFO_HPP
diff --git a/vsomeip/src/vsomeip.daemon/daemon.cpp b/vsomeip/src/vsomeip.daemon/daemon.cpp
deleted file mode 100644
index 6cf2acc..0000000
--- a/vsomeip/src/vsomeip.daemon/daemon.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include "daemon_impl.hpp"
-
-namespace vsomeip {
-
-daemon * daemon::get_instance() {
- return daemon_impl::get_instance();
-}
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.daemon/daemon_impl.cpp b/vsomeip/src/vsomeip.daemon/daemon_impl.cpp
deleted file mode 100644
index d17eace..0000000
--- a/vsomeip/src/vsomeip.daemon/daemon_impl.cpp
+++ /dev/null
@@ -1,1345 +0,0 @@
-//
-// daemon_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iomanip>
-
-#include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/ip/udp.hpp>
-#include <boost/chrono.hpp>
-#include <boost/log/trivial.hpp>
-
-#include <boost_ext/asio/mq.hpp>
-#include <boost_ext/asio/placeholders.hpp>
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/factory.hpp>
-#include <vsomeip/message.hpp>
-#include <vsomeip/version.hpp>
-#include <vsomeip_internal/byteorder.hpp>
-#include <vsomeip_internal/configuration.hpp>
-#include <vsomeip_internal/enumeration_types.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/protocol.hpp>
-#include <vsomeip_internal/tcp_client_impl.hpp>
-#include <vsomeip_internal/tcp_service_impl.hpp>
-#include <vsomeip_internal/udp_client_impl.hpp>
-#include <vsomeip_internal/udp_service_impl.hpp>
-#include <vsomeip_internal/utility.hpp>
-
-#include <vsomeip/sd/factory.hpp>
-#include <vsomeip_internal/sd/constants.hpp>
-#include <vsomeip_internal/sd/service_discovery.hpp>
-
-#include "daemon_impl.hpp"
-#include "daemon_proxy_impl.hpp"
-
-using boost::asio::ip::tcp;
-using boost::asio::ip::udp;
-
-using namespace boost::log::trivial;
-
-namespace vsomeip {
-
-client_id daemon_impl::id__ = 1; // ID 0 is reserved for the daemon
-
-daemon * daemon_impl::get_instance() {
- static daemon_impl the_daemon;
- return &the_daemon;
-}
-
-daemon_impl::daemon_impl()
- : application_base_impl(get_name()),
- log_owner(get_name()),
- proxy_owner(get_name()),
- owner_base(get_name()),
- daemon_queue_(receiver_service_),
- queue_name_prefix_("/vsomeip-"),
- daemon_queue_name_("0"),
- sender_work_(sender_service_),
- receiver_work_(receiver_service_),
- network_work_(network_service_),
- watchdog_timer_(sender_service_),
- service_discovery_(0),
- serializer_(new serializer),
- deserializer_(new deserializer)
-#ifdef VSOMEIP_DAEMON_DEBUG
- ,dump_timer_(sender_service_)
-#endif
-{
- serializer_->create_data(VSOMEIP_MAX_TCP_MESSAGE_SIZE);
-}
-
-daemon_impl::~daemon_impl() {
-}
-
-client_id daemon_impl::get_id() const {
- return 0;
-}
-
-void daemon_impl::set_id(client_id _id) {
- // intentionally left empty
-}
-
-std::string daemon_impl::get_name() const {
- return std::string("vsomeipd");
-}
-
-void daemon_impl::set_name(const std::string &_name) {
- // intentionally left empty
-}
-
-bool daemon_impl::is_managing() const {
- return true;
-}
-
-boost::log::sources::severity_logger< boost::log::trivial::severity_level > & daemon_impl::get_logger() {
- return logger_;
-}
-
-boost::shared_ptr< serializer > & daemon_impl::get_serializer() {
- return serializer_;
-}
-
-boost::shared_ptr< deserializer > & daemon_impl::get_deserializer() {
- return deserializer_;
-}
-
-boost::asio::io_service & daemon_impl::get_service() {
- return get_sender_service();
-}
-
-boost::asio::io_service & daemon_impl::get_sender_service() {
- return sender_service_;
-}
-
-boost::asio::io_service & daemon_impl::get_receiver_service() {
- return sender_service_;
-}
-
-void daemon_impl::init(int _count, char **_options) {
- proxy_.reset(new daemon_proxy_impl(*this));
-
- configuration::init(_count, _options);
- configuration *its_configuration = configuration::request();
-
- configure_logging(
- its_configuration->use_console_logger(),
- its_configuration->use_file_logger(),
- its_configuration->use_dlt_logger()
- );
-
- set_channel("0");
- set_loglevel(its_configuration->get_loglevel());
-
- VSOMEIP_INFO << "vsomeipd v" << VSOMEIP_VERSION << ": initializing.";
- daemon_queue_.async_create(
- queue_name_prefix_ + daemon_queue_name_,
- 10, // TODO: replace
- VSOMEIP_DEFAULT_QUEUE_SIZE,
- boost::bind(&daemon_impl::create_cbk, this,
- boost::asio::placeholders::error));
-
- if (its_configuration->is_service_discovery_enabled()) {
- sd::factory **its_factory = static_cast< sd::factory ** >(
- utility::load_library(
- VSOMEIP_SD_LIBRARY,
- VSOMEIP_SD_FACTORY_SYMBOL_STRING
- )
- );
-
- if (0 != its_factory && 0 != (*its_factory)) {
- service_discovery_ = (*its_factory)->create_service_discovery(*this);
- if (0 != service_discovery_) {
- VSOMEIP_INFO << "vsomeipd v" << VSOMEIP_VERSION << ": Service Discovery Module loaded.";
-
- unicast_ = its_configuration->get_unicast_address();
- std::string its_multicast = its_configuration->get_multicast_address();
- uint16_t its_port = its_configuration->get_port();
- ip_protocol its_protocol =
- (its_configuration->get_protocol() == "tcp" ?
- ip_protocol::TCP : ip_protocol::UDP);
-
- const endpoint *its_location =
- vsomeip::factory::get_instance()->get_endpoint(unicast_, its_port, its_protocol);
-
- if (proxy_->provide_service(VSOMEIP_SERVICE_DISCOVERY_SERVICE,
- VSOMEIP_SERVICE_DISCOVERY_INSTANCE,
- its_location)) {
-
- if (ip_protocol::UDP == its_protocol) {
- service *its_service = proxy_->find_service(its_location);
- if (0 != its_service) {
- its_service->join(its_multicast);
- }
- }
-
- service_discovery_->init();
- VSOMEIP_INFO << "vsomeipd v" << VSOMEIP_VERSION << ": Service Discovery Module initialized.";
- }
- } else {
- VSOMEIP_ERROR << "vsomeipd v" << VSOMEIP_VERSION << ": Loading Service Discovery Module failed!";
- }
- }
- }
-
-#ifdef VSOMEIP_DAEMON_DEBUG
- start_dump_cycle();
-#endif
-
- configuration::release();
-
- VSOMEIP_INFO << "vsomeipd v" << VSOMEIP_VERSION << ": initializing done.";
-}
-
-void daemon_impl::run_receiver() {
- receiver_service_.run();
- VSOMEIP_DEBUG << "Receiver services stopped.";
-}
-
-void daemon_impl::run_sender() {
- sender_service_.run();
- VSOMEIP_DEBUG << "Sender services stopped.";
-}
-
-void daemon_impl::start() {
- VSOMEIP_INFO << "vsomeipd v" << VSOMEIP_VERSION << ": starting.";
-
- boost::thread sender_thread(boost::bind(&daemon_impl::run_sender, this));
- boost::thread receiver_thread(boost::bind(&daemon_impl::run_receiver, this));
-
- VSOMEIP_INFO << "vsomeipd v" << VSOMEIP_VERSION << ": starting done.";
-
- sender_thread.join();
- receiver_thread.join();
-}
-
-void daemon_impl::stop() {
- VSOMEIP_INFO << "vsomeipd v" << VSOMEIP_VERSION << ": stopped.";
-}
-
-bool daemon_impl::send(message_base *_message, bool _reliable, bool _flush) {
- return proxy_->send(_message, _reliable, _flush);
-}
-
-void daemon_impl::on_service_availability(client_id _client, service_id _service, instance_id _instance, const endpoint *_location, bool _is_available) {
- uint32_t location_size = 0;
- if (_location) {
- proxy_->request_service(_service, _instance, _location);
-
- if (service_discovery_)
- service_discovery_->on_service_available(
- _service, _instance,
- proxy_->find_client_location(_service, _instance, true),
- proxy_->find_client_location(_service, _instance, false));
-
- serializer_->serialize(_location);
- location_size = serializer_->get_size();
- }
-
- uint32_t payload_size = 4 + location_size;
-
- std::vector< uint8_t > data(VSOMEIP_PROTOCOL_OVERHEAD + payload_size);
-
- std::memcpy(&data[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memset(&data[VSOMEIP_PROTOCOL_ID], 0, sizeof(client_id));
-
- if (_is_available) {
- data[VSOMEIP_PROTOCOL_COMMAND] = static_cast< uint8_t >(command_enum::SOMEIP_SERVICE_AVAILABLE);
- } else {
- data[VSOMEIP_PROTOCOL_COMMAND] = static_cast< uint8_t >(command_enum::SOMEIP_SERVICE_NOT_AVAILABLE);
- }
-
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD], &_service, sizeof(_service));
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD+2], &_instance, sizeof(_instance));
- if (_location) {
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD+4], serializer_->get_data(), serializer_->get_size());
- serializer_->reset();
- }
-
- std::memcpy(&data[payload_size + VSOMEIP_PROTOCOL_PAYLOAD], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
-
- do_send(_client, data);
-}
-
-void daemon_impl::on_subscription(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location, bool _is_subscribing) {
- client_id id = find_local(_service, _instance, VSOMEIP_ANY_METHOD);
- if (id != VSOMEIP_UNKNOWN_ID && 0 != _location) {
- serializer_->serialize(_location);
-
- uint32_t payload_size = 6 + serializer_->get_size();
-
- std::vector< uint8_t > data(VSOMEIP_PROTOCOL_OVERHEAD + payload_size);
-
- std::memcpy(&data[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memset(&data[VSOMEIP_PROTOCOL_ID], id, sizeof(id));
-
- if (_is_subscribing) {
- data[VSOMEIP_PROTOCOL_COMMAND] = static_cast< uint8_t >(command_enum::SOMEIP_SUBSCRIBE);
- } else {
- data[VSOMEIP_PROTOCOL_COMMAND] = static_cast< uint8_t >(command_enum::SOMEIP_UNSUBSCRIBE);
- }
-
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD], &_service, sizeof(_service));
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD+2], &_instance, sizeof(_instance));
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD+4], &_eventgroup, sizeof(_eventgroup));
- std::memcpy(&data[VSOMEIP_PROTOCOL_PAYLOAD+6], serializer_->get_data(), serializer_->get_size());
- std::memcpy(&data[payload_size + VSOMEIP_PROTOCOL_PAYLOAD], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
-
- serializer_->reset();
-
- do_send(id, data);
- }
-}
-
-void daemon_impl::handle_message(std::shared_ptr< message > &_message) {
-}
-
-void daemon_impl::handle_availability(service_id _service, instance_id _instance, const endpoint *_location, bool _is_available) {
-}
-
-void daemon_impl::handle_subscription(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location, bool _is_subscribing) {
-}
-
-void daemon_impl::start_watchdog_cycle() {
- watchdog_timer_.expires_from_now(
- std::chrono::milliseconds(VSOMEIP_DEFAULT_WATCHDOG_CYCLE)); // TODO: use config variable
-
- watchdog_timer_.async_wait(
- boost::bind(&daemon_impl::watchdog_cycle_cbk, this,
- boost::asio::placeholders::error));
-}
-
-void daemon_impl::start_watchdog_check() {
- for (auto i = applications_.begin(); i != applications_.end(); ++i) {
- i->second.watchdog_++;
- send_ping(i->first);
- }
-
- watchdog_timer_.expires_from_now(
- std::chrono::milliseconds(VSOMEIP_DEFAULT_WATCHDOG_TIMEOUT)); // TODO: use config variable
-
- watchdog_timer_.async_wait(
- boost::bind(&daemon_impl::watchdog_check_cbk, this,
- boost::asio::placeholders::error));
-}
-
-void daemon_impl::do_send(client_id _id, std::vector< uint8_t > &_data) {
- auto found_application = applications_.find(_id);
- if (found_application != applications_.end()) {
- std::memcpy(&_data[VSOMEIP_PROTOCOL_ID], &_id, sizeof(_id));
- send_buffers_.push_back(_data);
- std::vector<uint8_t> &send_data = send_buffers_.back();
-
- found_application->second.queue_->async_send(
- send_data.data(),
- send_data.size(),
- 0,
- boost::bind(
- &daemon_impl::send_cbk,
- this,
- boost::asio::placeholders::error,
- _id
- )
- );
- } else {
- VSOMEIP_WARNING << "No queue for application " << _id;
- }
-}
-
-void daemon_impl::do_broadcast(std::vector< uint8_t > &_data) {
- for (auto a : applications_) {
- do_send(a.first, _data);
- }
-}
-
-void daemon_impl::do_receive() {
- daemon_queue_.async_receive(receive_buffer_, sizeof(receive_buffer_),
- boost::bind(&daemon_impl::receive_cbk, this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- boost_ext::asio::placeholders::priority));
-}
-
-void daemon_impl::receive(
- const uint8_t *_data, uint32_t _size,
- const endpoint *_source, const endpoint *_target) {
-
-#ifdef VSOMEIP_DAEMON_DEBUG
- std::cout << "Daemon: ";
- for (int i = 0; i <_size; ++i)
- std::cout << std::setw(2) << std::setfill('0') << (int)_data[i] << " ";
- std::cout << std::endl;
-#endif
-
- // Read routing information
- service_id its_service = VSOMEIP_BYTES_TO_WORD(_data[0], _data[1]);
- method_id its_method = VSOMEIP_BYTES_TO_WORD(_data[2], _data[3]);
-
- // Service Discovery?
- if (its_service == VSOMEIP_SERVICE_DISCOVERY_SERVICE
- && its_method == VSOMEIP_SERVICE_DISCOVERY_METHOD) {
-
- // Forward to Service Manager
- if (service_discovery_)
- service_discovery_->on_message(_data, _size, _source, _target);
-
- return;
- }
-
- client_id its_client = VSOMEIP_BYTES_TO_WORD(_data[8], _data[9]);
- message_type_enum its_message_type = static_cast< message_type_enum >(_data[14]);
-
- instance_id its_instance = 0;
-
- client_id its_target = VSOMEIP_UNKNOWN_ID;
- if (its_message_type < message_type_enum::RESPONSE) {
- save_client_location(its_client, _source);
-
- auto found_service = service_channels_.find(its_service);
- if (found_service != service_channels_.end()) {
- its_instance = proxy_->find_instance(_target, its_service, its_message_type);
-
- auto found_instance = found_service->second.find(its_instance);
- if (found_instance != found_service->second.end()) {
- auto found_method = found_instance->second.find(its_method);
- if (found_method != found_instance->second.end()) {
- its_target = found_method->second;
- } else {
- found_method = found_instance->second.find(VSOMEIP_ANY_METHOD);
- if (found_method != found_instance->second.end()) {
- its_target = found_method->second;
- }
- }
- }
- }
- } else {
- auto found_client = client_channels_.find(its_client);
- if (found_client != client_channels_.end()) {
- auto found_service = found_client->second.find(its_service);
- if (found_service != found_client->second.end()) {
- its_instance = proxy_->find_instance(_source, its_service, its_message_type);
- auto found_instance = found_service->second.find(its_instance);
- if (found_instance != found_service->second.end()) {
- auto found_method = found_instance->second.find(its_method);
- if (found_method == found_instance->second.end()) {
- found_method = found_instance->second.find(VSOMEIP_ANY_METHOD);
- }
-
- if (found_method != found_instance->second.end()) {
- its_target = its_client;
- }
- }
- }
- }
- }
-
- // If the target application could be found, forward the message
- if (its_target != VSOMEIP_UNKNOWN_ID) {
- std::vector< uint8_t > message_buffer(
- _size +
- 3 +
- VSOMEIP_PROTOCOL_OVERHEAD
- );
-
- // Fill in start tag and command
- std::memcpy(&message_buffer[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- message_buffer[VSOMEIP_PROTOCOL_COMMAND] = static_cast< uint8_t >(command_enum::SOMEIP_MESSAGE);
-
- // Set source application identifier
- std::memset(&message_buffer[VSOMEIP_PROTOCOL_ID], 0, sizeof(client_id));
-
- // Fill in message data
- std::memcpy(&message_buffer[VSOMEIP_PROTOCOL_PAYLOAD], _data, _size);
-
- // Fill in instance identifier
- std::memcpy(&message_buffer[VSOMEIP_PROTOCOL_PAYLOAD+_size], &its_instance, sizeof(its_instance));
-
- // Fill in (unneeded) flush parameter
- message_buffer[VSOMEIP_PROTOCOL_PAYLOAD + _size + 2] = 0x0;
-
- uint32_t payload_size = _size + 3;
- std::memcpy(&message_buffer[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
- std::memcpy(&message_buffer[VSOMEIP_PROTOCOL_PAYLOAD + _size + 3], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
- message_buffer.resize(VSOMEIP_PROTOCOL_OVERHEAD + payload_size);
-
- do_send(its_target, message_buffer);
- } else {
- VSOMEIP_WARNING << "Could not find target application!";
- }
-}
-
-void daemon_impl::on_register_application(client_id _id, const std::string &_name, bool _is_managing) {
- boost_ext::asio::message_queue *application_queue =
- new boost_ext::asio::message_queue(sender_service_);
-
- VSOMEIP_INFO << "Registering application " << _id << " for queue " << _name;
-
- application_info info;
- info.is_managing_ = _is_managing;
- info.queue_ = application_queue;
- info.queue_name_ = _name;
- info.watchdog_ = 0;
-
- auto found_application = applications_.find(_id);
- if (found_application != applications_.end()) {
- while ((found_application = applications_.find(id__)) != applications_.end()) {
- id__++;
- }
-
- VSOMEIP_WARNING << "As an application with id=\"" << _id << "\" is already registered, "
- "the application id will be modified to \"" << id__ << "\"";
- _id = id__;
- }
-
- applications_[_id] = info;
-
- application_queue->async_open(
- queue_name_prefix_ + _name,
- boost::bind(&daemon_impl::open_cbk, this,
- boost::asio::placeholders::error, _id));
-}
-
-void daemon_impl::on_deregister_application(client_id _id) {
- applications_.erase(_id);
-
- /*
- application_queue->async_close(
- _name.c_str(),
- boost::bind(
- &daemon_impl::close_cbk,
- this,
- boost::asio::placeholders::error,
- id__
- )
- );
- */
-}
-
-void daemon_impl::on_provide_service(client_id _id, service_id _service, instance_id _instance, const endpoint *_location) {
- auto find_application = applications_.find(_id);
- if (find_application != applications_.end()) {
- if (!find_application->second.is_managing_) {
- auto find_service = find_application->second.services_.find(_service);
- if (find_service != find_application->second.services_.end()) {
- // the given location must not be used for another instance of the service
- for (auto i : find_service->second) {
- if (i.first != _instance) {
- for (auto j : i.second) {
- if (j == _location) {
- // TODO: send message to application that registration has failed (reason: another service is already registered)
- VSOMEIP_ERROR
- << "Registration failed as another instance of the service is already registered to the same endpoint";
- return;
- }
- }
- }
- }
-
- auto find_instance = find_service->second.find(_instance);
- if (find_instance != find_service->second.end()) {
- find_instance->second.insert(_location);
- } else {
- find_service->second[_instance].insert(_location);
- }
- } else {
- find_application->second.services_[_service][_instance].insert(_location);
- }
-
- // create a channel for the new service
- service_channels_[_service][_instance][VSOMEIP_ANY_METHOD] = _id;
-
- // maybe the new provided service was already requested
- for (auto r : requests_) {
- if (r.service_ == _service && r.instance_ == _instance) {
- VSOMEIP_INFO << " reporting service location to application " << r.id_;
- on_request_service(r.id_, r.service_, r.instance_, r.location_);
- } else {
- VSOMEIP_INFO << std::hex << r.service_ << " == " << _service << ", " << r.instance_ << " == " << _instance;
- }
- }
-
- proxy_->provide_service(_service, _instance, _location);
- }
-
- // Service Discovery needs to be informed in any case.
- if (service_discovery_)
- service_discovery_->on_provide_service(_service, _instance, _location);
- } else {
- VSOMEIP_ERROR << "Attempting to register service for unknown application!";
- }
-}
-
-void daemon_impl::on_withdraw_service(client_id _id, service_id _service, instance_id _instance, const endpoint *_location) {
- VSOMEIP_DEBUG
- << "APPLICATION " << "(" << _id
- << ") WITHDRAWS ("
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << ", " << _instance
- << ")";
-
- auto find_application = applications_.find(_id);
- if (find_application != applications_.end()) {
- if (!find_application->second.is_managing_) {
- auto find_service = find_application->second.services_.find(_service);
- if (find_service != find_application->second.services_.end()) {
- if (0 == _location) {
- find_service->second.erase(_instance);
- } else {
- auto find_instance = find_service->second.find(_instance);
- if (find_instance != find_service->second.end()) {
- find_instance->second.erase(_location);
- }
- }
- if (find_service->second.size() == 0)
- find_application->second.services_.erase(_service);
- }
- }
-
- proxy_->withdraw_service(_service, _instance, _location);
- }
-
- if (service_discovery_)
- service_discovery_->on_withdraw_service(_service, _instance, _location);
-}
-
-void daemon_impl::on_start_service(client_id _id, service_id _service, instance_id _instance) {
- VSOMEIP_DEBUG
- << "APPLICATION " << "(" << _id
- << ") STARTS ("
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << ", " << _instance
- << ")";
-
- if (service_discovery_)
- service_discovery_->on_start_service(_service, _instance);
-}
-
-void daemon_impl::on_stop_service(client_id _id, service_id _service, instance_id _instance) {
- VSOMEIP_DEBUG
- << "APPLICATION " << "(" << _id
- << ") STOPS ("
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << ", " << _instance
- << ")";
-
- if (service_discovery_)
- service_discovery_->on_stop_service(_service, _instance);
-}
-
-void daemon_impl::on_request_service(client_id _id, service_id _service, instance_id _instance, const endpoint *_location) {
- VSOMEIP_DEBUG
- << "APPLICATION " << "(" << _id
- << ") REQUESTS ("
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << ", " << _instance
- << ")";
-
- // TODO: do not simply insert but check whether or not the client is already inserted
- request_info info(_id, _service, _instance, _location);
- requests_.insert(info);
-
- // create a channel for the new service if the application is managed
- auto found_application = applications_.find(_id);
- if (found_application != applications_.end()) {
- if (!found_application->second.is_managing_) {
- client_channels_[_id][_service][_instance] = std::set< method_id >();
- }
- }
-
- if (0 == service_discovery_)
- proxy_->request_service(_service, _instance, _location);
- else
- service_discovery_->on_request_service(_id, _service, _instance);
-
- for (auto a : applications_) {
- auto s = a.second.services_.find(_service);
- if (s != a.second.services_.end()) {
- if (_instance == VSOMEIP_ANY_INSTANCE && 0 < s->second.size()) {
- send_request_service_ack(_id, _service, s->second.begin()->first, a.second.queue_name_);
- return;
- } else {
- auto i = s->second.find(_instance);
- if (i != s->second.end()) {
- send_request_service_ack(_id, _service, _instance, a.second.queue_name_);
- return;
- }
- }
- }
- }
-}
-
-void daemon_impl::on_release_service(client_id _id, service_id _service, instance_id _instance, const endpoint *_location) {
- VSOMEIP_DEBUG
- << "APPLICATION " << "(" << _id
- << ") RELEASES ("
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << ", " << _instance
- << ")";
-
- // remove the channel for the client
- auto found_client = client_channels_.find(_id);
- if (found_client != client_channels_.end()) {
- found_client->second.erase(_service);
- if (0 == found_client->second.size()) {
- client_channels_.erase(_id);
- }
- }
-
- proxy_->release_service(_service, _instance);
-
- request_info info(_id, _service, _instance, _location);
- requests_.erase(info);
-
- if (service_discovery_)
- service_discovery_->on_release_service(_id, _service, _instance);
-}
-
-void daemon_impl::on_register_method(client_id _id, service_id _service, instance_id _instance, method_id _method) {
- auto found_client = client_channels_.find(_id);
- if (found_client != client_channels_.end()) {
- auto found_service = found_client->second.find(_service);
- if (found_service != found_client->second.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- found_instance->second.insert(_method);
- } else {
- found_service->second[_instance].insert(_method);
- }
- } else {
- found_client->second[_service][_instance].insert(_method);
- }
- } else {
- client_channels_[_id][_service][_instance].insert(_method);
- }
-}
-
-void daemon_impl::on_deregister_method(client_id _id, service_id _service, instance_id _instance, method_id _method) {
- auto found_client = client_channels_.find(_id);
- if (found_client != client_channels_.end()) {
- auto found_service = found_client->second.find(_service);
- if (found_service != found_client->second.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- found_instance->second.erase(_method);
- if (0 == found_instance->second.size()) {
- found_service->second.erase(_instance);
- if (0 == found_service->second.size()) {
- found_client->second.erase(_service);
- }
- }
- }
- }
- }
-}
-
-void daemon_impl::on_request_eventgroup(client_id _client, service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- eventgroups_[_service][_instance][_eventgroup].clients_.insert(_client);
-
- for (auto e : eventgroups_[_service][_instance][_eventgroup].events_) {
- events_[e]._clients.insert(_client);
- }
-
- if (service_discovery_)
- service_discovery_->on_request_eventgroup(_client, _service, _instance, _eventgroup);
-}
-
-void daemon_impl::on_release_eventgroup(client_id _client, service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- auto found_service = eventgroups_.find(_service);
- if (found_service != eventgroups_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_eventgroup = found_instance->second.find(_eventgroup);
- if (found_eventgroup != found_instance->second.end()) {
- found_eventgroup->second.clients_.erase(_client);
- if (service_discovery_)
- service_discovery_->on_request_eventgroup(_client, _service, _instance, _eventgroup);
- }
- }
- }
-}
-
-void daemon_impl::on_add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, event_id _field,
- const uint8_t *_payload, uint32_t _payload_size) {
- eventgroups_[_service][_instance][_eventgroup].events_.insert(_field);
- events_[_field].payload_.assign(_payload, _payload + _payload_size);
-
- for (auto c : eventgroups_[_service][_instance][_eventgroup].clients_) {
- events_[_field]._clients.insert(c);
- }
-}
-
-void daemon_impl::on_pong(client_id _id) {
- auto info = applications_.find(_id);
- if (info != applications_.end()) {
- VSOMEIP_TRACE << "Received PONG from registered application " << _id;
- info->second.watchdog_ = 0;
- } else {
- VSOMEIP_WARNING << "Received PONG from unregistered application " << _id;
- }
-}
-
-void daemon_impl::on_send_message(client_id _id, const uint8_t *_data, uint32_t _size) {
- const uint8_t *payload = &_data[VSOMEIP_PROTOCOL_PAYLOAD];
- uint32_t payload_size;
- std::memcpy(&payload_size, &_data[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], sizeof(payload_size));
-
- length message_size = VSOMEIP_BYTES_TO_LONG(
- payload[4], payload[5], payload[6], payload[7]
- ) + VSOMEIP_STATIC_HEADER_SIZE;
-
- // extract service & client identifiers from SOME/IP message
- service_id its_service = VSOMEIP_BYTES_TO_WORD(payload[0], payload[1]);
- method_id its_method = VSOMEIP_BYTES_TO_WORD(payload[2], payload[3]);
- client_id its_client = VSOMEIP_BYTES_TO_WORD(payload[8], payload[9]);
-
- // extract instance identifier & flush parameter from internal message part
- instance_id its_instance;
- std::memcpy(&its_instance, &_data[_size - 9], sizeof(instance_id));
-
- bool reliable = static_cast< bool >(_data[_size - 7]);
- bool flush = static_cast< bool >(_data[_size - 5]);
-
- // route message
- if (is_request(payload, payload_size)) {
- client_id its_application = find_local(its_service, its_instance, its_method);
- if (VSOMEIP_UNKNOWN_ID != its_application) {
- std::vector< uint8_t > buffer(_data, _data + _size);
- do_send(its_application, buffer);
- } else {
- client *target = find_remote(its_service, its_instance, reliable);
- if (0 != target) {
- target->send(payload, payload_size - 3, flush);
- } else {
- VSOMEIP_ERROR << "Route to service ["
- << std::setw(4) << std::setfill('0') << std::hex
- << its_service
- << "."
- << its_instance
- << "] is unknown!";
- }
- }
- } else {
- if (is_local(its_client)) {
- std::vector< uint8_t > buffer(_data, _data + _size);
- do_send(its_client, buffer);
- } else {
- const endpoint *location = proxy_->find_service_location(its_service, its_instance, reliable);
- service *source = proxy_->find_service(location);
- const endpoint *target = find_remote(its_client);
-
- if (0 != source && 0 != target) {
- source->send(payload, payload_size - 3, target);
- } else {
- VSOMEIP_ERROR << "Route to client ["
- << std::setw(4) << std::setfill('0') << std::hex
- << its_client
- << "] for service ["
- << its_service
- << "."
- << its_instance
- << "] is unknown!";
- }
- }
- }
-}
-
-void daemon_impl::on_update_field(uint8_t *_data, uint32_t _size) {
- if (service_discovery_) { // as SOME/IP Eventgroups do not work without
- uint8_t *payload = &_data[VSOMEIP_PROTOCOL_PAYLOAD];
- method_id its_field = VSOMEIP_BYTES_TO_WORD(payload[2], payload[3]);
-
- auto found_event = events_.find(its_field);
- if (found_event != events_.end()) {
- _data[VSOMEIP_PROTOCOL_COMMAND] = static_cast< uint8_t >(command_enum::SOMEIP_MESSAGE);
- for (auto c : found_event->second._clients) {
- payload[8] = VSOMEIP_WORD_BYTE1(c);
- payload[9] = VSOMEIP_WORD_BYTE0(c);
- on_send_message(c, _data, _size);
- }
- }
- }
-}
-
-bool daemon_impl::is_request(const message *_message) const {
- return (_message->get_message_type() < message_type_enum::NOTIFICATION);
-}
-
-bool daemon_impl::is_request(const uint8_t *_data, uint32_t _size) const {
- return (_size >= VSOMEIP_POS_MESSAGE_TYPE &&
- static_cast< message_type_enum >(_data[VSOMEIP_POS_MESSAGE_TYPE]) < message_type_enum::NOTIFICATION);
-}
-
-void daemon_impl::send_request_service_ack(client_id _id, service_id _service, instance_id _instance, const std::string &_queue_name) {
- std::vector< uint8_t > request_ack_buffer;
-
- // Resize to the needed size
- uint32_t payload_size = 4 + _queue_name.size();
- request_ack_buffer.resize(payload_size + VSOMEIP_PROTOCOL_OVERHEAD);
-
- std::memcpy(&request_ack_buffer[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memset(&request_ack_buffer[VSOMEIP_PROTOCOL_ID], 0, sizeof(client_id));
- request_ack_buffer[VSOMEIP_PROTOCOL_COMMAND] = static_cast< uint8_t >(command_enum::REQUEST_SERVICE_ACK);
- std::memcpy(&request_ack_buffer[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
- std::memcpy(&request_ack_buffer[VSOMEIP_PROTOCOL_PAYLOAD], &_service, sizeof(_service));
- std::memcpy(&request_ack_buffer[VSOMEIP_PROTOCOL_PAYLOAD+2], &_instance, sizeof(_instance));
- std::copy(_queue_name.begin(), _queue_name.end(), request_ack_buffer.begin() + VSOMEIP_PROTOCOL_PAYLOAD+4);
- std::memcpy(&request_ack_buffer[payload_size + VSOMEIP_PROTOCOL_PAYLOAD], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
-
- do_send(_id, request_ack_buffer);
-}
-
-void daemon_impl::send_ping(client_id _id) {
- uint8_t ping_message[] = {
- 0x67, 0x37, 0x6D, 0x07,
- 0x00, 0x00,
- static_cast<uint8_t>(command_enum::PING), 0x00, 0x00, 0x00, 0x00,
- 0x07, 0x6D, 0x37, 0x67
- };
-
- std::vector<uint8_t> ping_buffer(ping_message,
- ping_message + sizeof(ping_message));
-
- do_send(_id, ping_buffer);
-}
-
-void daemon_impl::send_application_info() {
- // determine the message size
- std::size_t message_size = VSOMEIP_PROTOCOL_OVERHEAD;
- for (auto a: applications_) {
- if (!a.second.is_managing_) {
- message_size += (8 + a.second.queue_name_.size());
- }
- }
-
- // resize vector and fill in the static part
- std::vector< uint8_t > message_data(message_size);
- std::memcpy(&message_data[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memcpy(&message_data[message_size-4], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
- message_data[VSOMEIP_PROTOCOL_COMMAND] = static_cast<uint8_t>(command_enum::APPLICATION_INFO);
-
- if (message_size > VSOMEIP_PROTOCOL_OVERHEAD) {
- message_size -= VSOMEIP_PROTOCOL_OVERHEAD;
- std::memcpy(&message_data[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &message_size, sizeof(message_size));
-
- std::size_t position = VSOMEIP_PROTOCOL_PAYLOAD;
- for (auto a: applications_) {
- if (!a.second.is_managing_) {
- std::size_t queue_name_size = a.second.queue_name_.size();
-
- // Application Id
- std::memcpy(&message_data[position], &a.first, sizeof(a.first));
- position += 4;
-
- // Queue name size
- std::memcpy(&message_data[position], &queue_name_size, sizeof(message_size));
- position += 4;
-
- // Queue name
- std::copy(a.second.queue_name_.begin(), a.second.queue_name_.end(),
- message_data.begin() + position);
- position += queue_name_size;
- }
- }
- }
-
- do_broadcast(message_data);
-}
-
-void daemon_impl::send_application_lost(const std::list< client_id > &_lost_applications) {
- uint32_t message_size = VSOMEIP_PROTOCOL_OVERHEAD
- + _lost_applications.size() * sizeof(client_id);
-
- std::vector< uint8_t > message_data(message_size);
-
- std::memcpy(&message_data[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memcpy(&message_data[message_size-4], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
- std::memset(&message_data[VSOMEIP_PROTOCOL_ID], 0, sizeof(client_id));
- message_data[VSOMEIP_PROTOCOL_COMMAND] = static_cast<uint8_t>(command_enum::APPLICATION_LOST);
- message_size -= VSOMEIP_PROTOCOL_OVERHEAD;
- std::memcpy(&message_data[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &message_size, sizeof(message_size));
-
- uint32_t position = VSOMEIP_PROTOCOL_PAYLOAD;
- for (auto a : _lost_applications) {
- std::memcpy(&message_data[position], &a, sizeof(a));
- position += sizeof(a);
- }
-
- do_broadcast(message_data);
-}
-
-void daemon_impl::process_command(std::size_t _bytes) {
- uint32_t start_tag, end_tag, payload_size;
- command_enum its_command;
- client_id its_id;
- service_id its_service;
- instance_id its_instance;
- eventgroup_id its_eventgroup;
- event_id its_field;
- method_id its_method;
- endpoint *its_location = 0;
-
-#if 0
- std::cout << "COMMAND: ";
- for (int i = 0; i < _bytes; ++i) {
- std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)receive_buffer_[i] << " ";
- }
- std::cout << std::endl;
-#endif
-
- std::memcpy(&start_tag, &receive_buffer_[0], sizeof(start_tag));
- std::memcpy(&end_tag, &receive_buffer_[_bytes-4], sizeof(end_tag));
-
- std::memcpy(&its_id, &receive_buffer_[VSOMEIP_PROTOCOL_ID], sizeof(its_id));
- its_command = static_cast<command_enum>(receive_buffer_[VSOMEIP_PROTOCOL_COMMAND]);
- std::memcpy(&payload_size, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], sizeof(payload_size));
-
- switch (its_command) {
- case command_enum::REGISTER_APPLICATION: {
- std::string queue_name((char*) &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], payload_size-1);
- bool is_managed = static_cast< bool >(receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD + payload_size - 1]);
- on_register_application(its_id, queue_name, is_managed);
- }
- break;
-
- case command_enum::DEREGISTER_APPLICATION:
- on_deregister_application(its_id);
- break;
-
- case command_enum::PROVIDE_SERVICE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- if (payload_size > 4)
- its_location = factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], payload_size - 4);
- on_provide_service(its_id, its_service, its_instance, its_location);
- break;
-
- case command_enum::WITHDRAW_SERVICE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- if (payload_size > 4)
- its_location = factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], payload_size - 4);
- on_withdraw_service(its_id, its_service, its_instance, its_location);
- break;
-
- case command_enum::START_SERVICE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- on_start_service(its_id, its_service, its_instance);
- break;
-
- case command_enum::STOP_SERVICE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- on_stop_service(its_id, its_service, its_instance);
- break;
-
- case command_enum::REQUEST_SERVICE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- if (payload_size > 4)
- its_location = factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], payload_size - 4);
- on_request_service(its_id, its_service, its_instance, its_location);
- break;
-
- case command_enum::RELEASE_SERVICE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- if (payload_size > 4)
- its_location = factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], payload_size - 4);
- on_release_service(its_id, its_service, its_instance, its_location);
- break;
-
- case command_enum::PROVIDE_EVENTGROUP:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_eventgroup, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_eventgroup));
- if (payload_size > 6)
- its_location = factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+6], payload_size - 6);
- if (service_discovery_)
- service_discovery_->on_provide_eventgroup(its_service, its_instance, its_eventgroup, its_location);
- break;
-
- case command_enum::WITHDRAW_EVENTGROUP:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_eventgroup, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_eventgroup));
- if (payload_size > 6)
- its_location = factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+6], payload_size - 6);
- if (service_discovery_)
- service_discovery_->on_withdraw_eventgroup(its_service, its_instance, its_eventgroup, its_location);
- break;
-
- case command_enum::ADD_FIELD:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_eventgroup, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_eventgroup));
- std::memcpy(&its_field, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+6], sizeof(its_field));
- on_add_field(its_service, its_instance, its_eventgroup, its_field,
- &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+8], payload_size-8);
- break;
-
- case command_enum::REMOVE_FIELD:
- VSOMEIP_WARNING << "Removing fields is not (yet) implemented!";
- break;
-
- case command_enum::REQUEST_EVENTGROUP:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_eventgroup, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_eventgroup));
- on_request_eventgroup(its_id, its_service, its_instance, its_eventgroup);
- break;
-
- case command_enum::RELEASE_EVENTGROUP:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_eventgroup, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_eventgroup));
- on_release_eventgroup(its_id, its_service, its_instance, its_eventgroup);
- break;
-
- case command_enum::REGISTER_METHOD:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_method, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_method));
- on_register_method(its_id, its_service, its_instance, its_method);
- break;
-
- case command_enum::DEREGISTER_METHOD:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_method, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_method));
- on_deregister_method(its_id, its_service, its_instance, its_method);
- break;
-
- case command_enum::PONG:
- on_pong(its_id);
- break;
-
- case command_enum::SOMEIP_MESSAGE:
- on_send_message(its_id, receive_buffer_, _bytes);
- break;
-
- case command_enum::SOMEIP_FIELD:
- on_update_field(receive_buffer_, _bytes);
- break;
-
- default:
- VSOMEIP_WARNING << "Unknown command " << (int)its_command << " received.";
- break;
- }
-}
-
-client_id daemon_impl::find_local(service_id _service, instance_id _instance, method_id _method) const {
- client_id found_client = VSOMEIP_UNKNOWN_ID;
-
- auto found_service = service_channels_.find(_service);
- if (found_service != service_channels_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_method = found_instance->second.find(_method);
- if (found_method != found_instance->second.end()) {
- found_client = found_method->second;
- }
- }
- }
-
- return found_client;
-}
-
-client * daemon_impl::find_remote(service_id _service, instance_id _instance, bool _reliable) const {
- client * found_client = 0;
-
- const endpoint *found_location = proxy_->find_client_location(_service, _instance, _reliable);
- if (0 != found_location) {
- found_client = proxy_->find_client(found_location);
- }
-
- return found_client;
-}
-
-bool daemon_impl::is_local(client_id _client) const {
- bool is_local_client = false;
-
- auto found_client_channel = client_channels_.find(_client);
- if (found_client_channel != client_channels_.end()) {
- is_local_client = true;
- }
-
- return is_local_client;
-}
-
-const endpoint * daemon_impl::find_remote(client_id _client) const {
- auto found_client = client_locations_.find(_client);
- if (found_client != client_locations_.end()) {
- return found_client->second;
- }
-
- return 0;
-}
-
-void daemon_impl::save_client_location(client_id _client, const endpoint *_location) {
- auto found_client = client_locations_.find(_client);
- if (found_client != client_locations_.end()) {
- if (found_client->second != _location) {
- VSOMEIP_WARNING << "Location of client " << std::hex << _client << " has changed.";
- found_client->second = _location;
- }
- } else {
- client_locations_[_client] = _location;
- }
-}
-
-void daemon_impl::catch_up_registrations() {
- // intentionally left empty!
-}
-
-service * daemon_impl::find_multicast_service(ip_port _port) const {
- const endpoint *its_location = vsomeip::factory::get_instance()->get_endpoint(
- unicast_,
- _port,
- ip_protocol::UDP
- );
- return proxy_->find_or_create_service(its_location);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Callbacks
-///////////////////////////////////////////////////////////////////////////////
-void daemon_impl::open_cbk(boost::system::error_code const &_error, client_id _id) {
- if (!_error) {
- VSOMEIP_INFO << "Distributing application info";
- send_application_info();
- } else {
- VSOMEIP_ERROR << "Opening queue for " << _id << " failed!";
- // TODO: implement retry
- }
-}
-
-void daemon_impl::create_cbk(boost::system::error_code const &_error) {
- if (!_error) {
- start_watchdog_cycle();
- do_receive();
- } else {
- // Try destroying before creating
- daemon_queue_.async_close(
- boost::bind(
- &daemon_impl::destroy_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-
- // TODO: define maximum number of retries
- daemon_queue_.async_create(
- queue_name_prefix_ + daemon_queue_name_,
- 10,
- VSOMEIP_DEFAULT_QUEUE_SIZE,
- boost::bind(
- &daemon_impl::create_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
- }
-}
-
-void daemon_impl::destroy_cbk(boost::system::error_code const &_error) {
-
-}
-
-void daemon_impl::send_cbk(boost::system::error_code const &_error,
- client_id _id) {
- if (_error) {
- VSOMEIP_ERROR << "Message sending failed (Application " << _id << ")";
- }
-}
-
-void daemon_impl::receive_cbk(boost::system::error_code const &_error,
- std::size_t _bytes, unsigned int _priority) {
-
- if (!_error) {
- process_command(_bytes);
- }
-
- do_receive();
-}
-
-void daemon_impl::watchdog_cycle_cbk(boost::system::error_code const &_error) {
- if (!_error) {
- start_watchdog_check();
- }
-}
-
-void daemon_impl::watchdog_check_cbk(boost::system::error_code const &_error) {
- if (!_error) {
- std::list< client_id > gone;
-
- for (auto i : applications_) {
- if (i.second.watchdog_ > VSOMEIP_DEFAULT_MAX_MISSING_PONGS) { // TODO: use config variable
- VSOMEIP_WARNING << "Lost contact to application " << (int)i.first;
- gone.push_back(i.first);
- try {
- i.second.queue_->unlink();
- }
- catch (...) {
- // we tried to clean up and do not care about errors...
- }
- }
- }
-
- for (auto i : gone) {
- applications_.erase(i);
- }
-
- if (0 < gone.size())
- send_application_lost(gone);
-
- start_watchdog_cycle();
- }
-}
-
-#ifdef VSOMEIP_DAEMON_DEBUG
-#define VSOMEIP_DUMP_CYCLE 10000
-
-void daemon_impl::start_dump_cycle() {
- dump_timer_.expires_from_now(
- std::chrono::milliseconds(VSOMEIP_DUMP_CYCLE));
-
- dump_timer_.async_wait(
- boost::bind(&daemon_impl::dump_cycle_cbk, this,
- boost::asio::placeholders::error));
-}
-
-void daemon_impl::dump_cycle_cbk(boost::system::error_code const &_error) {
- if (!_error) {
- for (auto a : applications_) {
- VSOMEIP_TRACE << "App (" << a.first << ") ";
-
- for (auto s : a.second.services_) {
- VSOMEIP_TRACE << " " << std::hex << s.first;
- for (auto i : s.second) {
- VSOMEIP_TRACE << " " << std::hex << i.first;
-
- for (auto e : i.second) {
- VSOMEIP_TRACE << " ["
- << e->get_address() << ":" << std::dec << e->get_port()
- << " " << (e->get_protocol() == ip_protocol::UDP ? "udp" : "tcp")
- << "]";
- }
- }
- }
- }
- }
-
- start_dump_cycle();
-}
-#endif
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.daemon/daemon_impl.hpp b/vsomeip/src/vsomeip.daemon/daemon_impl.hpp
deleted file mode 100644
index 3173cf4..0000000
--- a/vsomeip/src/vsomeip.daemon/daemon_impl.hpp
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// daemon_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_DAEMON_DAEMON_IMPL_HPP
-#define VSOMEIP_DAEMON_DAEMON_IMPL_HPP
-
-#include <map>
-#include <set>
-
-#include <boost/array.hpp>
-#include <boost/asio/io_service.hpp>
-#include <boost/asio/system_timer.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/scoped_ptr.hpp>
-
-#include <boost_ext/asio/mq.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip/primitive_types.hpp>
-#include <vsomeip_internal/application_base_impl.hpp>
-#include <vsomeip_internal/daemon.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-#include <vsomeip_internal/serializer.hpp>
-
-#include "application_info.hpp"
-#include "client_info.hpp"
-#include "request_info.hpp"
-#include "service_info.hpp"
-
-//#define VSOMEIP_DAEMON_DEBUG
-
-namespace vsomeip {
-
-class endpoint;
-class client;
-class service;
-
-namespace sd {
-class service_discovery;
-} // namespace sd
-
-class daemon_impl
- : public daemon,
- public application_base_impl {
-public:
- static daemon * get_instance();
-
- daemon_impl();
- ~daemon_impl();
-
- boost::log::sources::severity_logger< boost::log::trivial::severity_level > & get_logger();
-
- client_id get_id() const;
- void set_id(client_id _id);
-
- std::string get_name() const;
- void set_name(const std::string &_name);
-
- bool is_managing() const;
-
- boost::asio::io_service & get_service();
- boost::asio::io_service & get_sender_service();
- boost::asio::io_service & get_receiver_service();
-
- void init(int _count, char **_options);
- void start();
- void stop();
-
- bool send(message_base *_message, bool _reliable, bool _flush);
-
- void catch_up_registrations();
- void on_service_availability(client_id _client, service_id _service, instance_id _instance, const endpoint *_location, bool _is_available);
- void on_subscription(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location, bool _is_subscribing);
- void on_add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, event_id _field, const uint8_t *payload, uint32_t payload_size);
-
- // Dummies
- void handle_message(std::shared_ptr< message > &_message);
- void handle_availability(service_id _service, instance_id _instance, const endpoint *_location, bool _is_available);
- void handle_subscription(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location, bool _is_subscribing);
-
- boost::shared_ptr< serializer > & get_serializer();
- boost::shared_ptr< deserializer > & get_deserializer();
-
- void receive(const uint8_t *, uint32_t, const endpoint *, const endpoint *);
-
- service * find_multicast_service(ip_port _port) const;
-
-private:
- void run_receiver();
- void run_sender();
-
- bool is_request(const message *_message) const;
- bool is_request(const uint8_t *, uint32_t) const;
-
- void do_send(client_id, std::vector< uint8_t > &);
- void do_broadcast(std::vector< uint8_t > &);
- void do_receive();
-
- void on_register_application(client_id, const std::string &, bool);
- void on_deregister_application(client_id);
- void on_provide_service(client_id, service_id, instance_id, const endpoint *);
- void on_withdraw_service(client_id, service_id, instance_id, const endpoint *);
- void on_start_service(client_id, service_id, instance_id);
- void on_stop_service(client_id, service_id, instance_id);
- void on_request_service(client_id, service_id, instance_id, const endpoint *);
- void on_release_service(client_id, service_id, instance_id, const endpoint *);
- void on_request_eventgroup(client_id, service_id, instance_id, eventgroup_id);
- void on_release_eventgroup(client_id, service_id, instance_id, eventgroup_id);
-
- void on_pong(client_id);
-
- void on_send_message(client_id, const uint8_t *, uint32_t);
- void on_update_field(uint8_t *, uint32_t);
-
- void on_register_method(client_id, service_id, instance_id, method_id);
- void on_deregister_method(client_id, service_id, instance_id, method_id);
-
- void send_ping(client_id);
- void send_application_info();
- void send_application_lost(const std::list< client_id > &);
-
- void send_request_service_ack(client_id, service_id, instance_id, const std::string &);
- void send_release_service_ack(client_id, service_id, instance_id);
-
- void process_command(std::size_t _bytes);
- void start_watchdog_cycle();
- void start_watchdog_check();
-
-private:
- void open_cbk(boost::system::error_code const &_error, client_id _id);
- void create_cbk(boost::system::error_code const &_error);
- void destroy_cbk(boost::system::error_code const &_error);
- void send_cbk(boost::system::error_code const &_error, client_id _id);
- void receive_cbk(
- boost::system::error_code const &_error,
- std::size_t _bytes, unsigned int _priority);
-
- void watchdog_cycle_cbk(boost::system::error_code const &_error);
- void watchdog_check_cbk(boost::system::error_code const &_error);
-
- client_id find_local(service_id, instance_id, method_id) const;
- client * find_remote(service_id _service, instance_id _instance, bool _is_reliable) const;
-
- bool is_local(client_id) const;
- const endpoint * find_remote(client_id) const;
-
- void save_client_location(client_id, const endpoint *);
-
-private:
- boost::shared_ptr< managing_proxy_impl > proxy_;
-
- boost::asio::io_service sender_service_;
- boost::asio::io_service::work sender_work_;
- boost::asio::io_service receiver_service_;
- boost::asio::io_service::work receiver_work_;
- boost::asio::io_service network_service_;
- boost::asio::io_service::work network_work_;
-
- boost::asio::system_timer watchdog_timer_;
-
- std::string queue_name_prefix_;
- std::string daemon_queue_name_;
- boost_ext::asio::message_queue daemon_queue_;
-
- uint8_t receive_buffer_[VSOMEIP_DEFAULT_QUEUE_SIZE];
-
- // buffers for sending messages
- std::deque< std::vector< uint8_t > > send_buffers_;
-
- // applications
- std::map< client_id, application_info > applications_;
-
- // requests (need to be stored as services may leave and come back)
- std::set< request_info > requests_;
-
- // Communication channels
- typedef std::map< client_id,
- std::map< service_id,
- std::map< instance_id,
- std::set< method_id > > > > client_channel_map_t;
- typedef std::map< service_id,
- std::map< instance_id,
- std::map< method_id,
- client_id > > > service_channel_map_t;
-
- client_channel_map_t client_channels_;
- service_channel_map_t service_channels_;
-
- // Client endpoints
- typedef std::map< client_id, const endpoint * > client_location_map_t;
-
- client_location_map_t client_locations_;
-
- // Events(?) & Fields
- struct eventgroup_info {
- std::set< client_id > clients_;
- std::set< event_id > events_;
- };
- std::map< service_id,
- std::map< instance_id,
- std::map< eventgroup_id,
- eventgroup_info > > > eventgroups_;
-
- struct field_info {
- std::vector< uint8_t > payload_;
- std::set< client_id > _clients;
- };
- std::map< event_id, field_info > events_;
-
-private:
- static client_id id__;
- sd::service_discovery *service_discovery_;
-
- std::string unicast_;
-
- boost::shared_ptr< serializer > serializer_;
- boost::shared_ptr< deserializer > deserializer_;
-
-#ifdef VSOMEIP_DAEMON_DEBUG
-private:
- void start_dump_cycle();
- void dump_cycle_cbk(boost::system::error_code const &);
- boost::asio::system_timer dump_timer_;
-#endif
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_DAEMON_DAEMON_IMPL_HPP
diff --git a/vsomeip/src/vsomeip.daemon/daemon_proxy_impl.cpp b/vsomeip/src/vsomeip.daemon/daemon_proxy_impl.cpp
deleted file mode 100644
index e5203b7..0000000
--- a/vsomeip/src/vsomeip.daemon/daemon_proxy_impl.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// daemon_proxy_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include "daemon_impl.hpp"
-#include "daemon_proxy_impl.hpp"
-
-namespace vsomeip {
-
-daemon_proxy_impl::daemon_proxy_impl(daemon_impl &_owner)
- : managing_proxy_impl(_owner), proxy_base_impl(_owner), log_user(_owner), daemon_(_owner) {
-};
-
-daemon_proxy_impl::~daemon_proxy_impl() {
-};
-
-void daemon_proxy_impl::receive(const uint8_t *_data, uint32_t _size, const endpoint *_source, const endpoint *_target) {
- daemon_.receive(_data, _size, _source, _target);
-}
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.daemon/daemon_proxy_impl.hpp b/vsomeip/src/vsomeip.daemon/daemon_proxy_impl.hpp
deleted file mode 100644
index 3214923..0000000
--- a/vsomeip/src/vsomeip.daemon/daemon_proxy_impl.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// daemon_proxy_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_DAEMON_DAEMON_PROXY_IMPL_HPP
-#define VSOMEIP_DAEMON_DAEMON_PROXY_IMPL_HPP
-
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-
-namespace vsomeip {
-
-class daemon_impl;
-
-class daemon_proxy_impl : public managing_proxy_impl {
-public:
- daemon_proxy_impl(daemon_impl &_owner);
- virtual ~daemon_proxy_impl();
-
- void receive(const uint8_t *_data, uint32_t _size, const endpoint *_source, const endpoint *_target);
-
-private:
- daemon_impl &daemon_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_DAEMON_DAEMON_PROXY_IMPL_HPP
diff --git a/vsomeip/src/vsomeip.daemon/main.cpp b/vsomeip/src/vsomeip.daemon/main.cpp
deleted file mode 100644
index 00d14e2..0000000
--- a/vsomeip/src/vsomeip.daemon/main.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// main.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/daemon.hpp>
-
-int
-main(int argc, char **argv) {
- vsomeip::daemon *the_daemon
- = vsomeip::daemon::get_instance();
-
- // create argument vector and pass it to the daemon object
- the_daemon->init(argc, argv);
-
- // start the daemon
- the_daemon->start();
-}
diff --git a/vsomeip/src/vsomeip.daemon/request_info.hpp b/vsomeip/src/vsomeip.daemon/request_info.hpp
deleted file mode 100644
index 59d62b2..0000000
--- a/vsomeip/src/vsomeip.daemon/request_info.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// request_info.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_DAEMON_REQUEST_INFO_HPP
-#define VSOMEIP_DAEMON_REQUEST_INFO_HPP
-
-#include <vsomeip/primitive_types.hpp>
-
-namespace vsomeip {
-
-class endpoint;
-
-struct request_info {
- request_info(client_id _id, service_id _service, instance_id _instance, const endpoint *_location)
- : id_(_id), service_(_service), instance_(_instance), location_(_location) {
- }
-
- client_id id_;
- service_id service_;
- instance_id instance_;
- const endpoint *location_;
-
- // as it is used in a set
- bool operator <(const request_info &_other) const {
- return (id_ < _other.id_
- || service_ < _other.service_
- || instance_ < _other.instance_
- || location_ < _other.location_);
- }
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_DAEMON_REQUEST_INFO_HPP
diff --git a/vsomeip/src/vsomeip.daemon/service_info.hpp b/vsomeip/src/vsomeip.daemon/service_info.hpp
deleted file mode 100644
index 8c0b26d..0000000
--- a/vsomeip/src/vsomeip.daemon/service_info.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// service_info.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#ifndef VSOMEIP_DAEMON_SERVICE_INFO_HPP
-#define VSOMEIP_DAEMON_SERVICE_INFO_HPP
-
-#include <map>
-#include <set>
-
-namespace vsomeip {
-
-class endpoint;
-
-struct service_info {
- client_id id_;
- std::set< client_id > clients_;
- bool is_started_;
- bool has_service_discovery;
- std::set< const endpoint *> locations_;
-};
-
-} // namespace vsomeip
-
-#endif // VSOMEIP_DAEMON_SERVICE_INFO_HPP
diff --git a/vsomeip/src/vsomeip.datatypes/README b/vsomeip/src/vsomeip.datatypes/README
deleted file mode 100644
index db6a1d5..0000000
--- a/vsomeip/src/vsomeip.datatypes/README
+++ /dev/null
@@ -1,3 +0,0 @@
-This folder shall contain (optional) implementations of the SOME/IP datatypes.
-These shall be used as an alternative way to define the content of payloads
-of messages or events. \ No newline at end of file
diff --git a/vsomeip/src/vsomeip.examples/application_sample.cpp b/vsomeip/src/vsomeip.examples/application_sample.cpp
deleted file mode 100644
index 2072317..0000000
--- a/vsomeip/src/vsomeip.examples/application_sample.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-#include <chrono>
-
-#include <boost/thread.hpp>
-
-#include <vsomeip/application.hpp>
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/factory.hpp>
-
-//#define SAMPLE_MULTITHREAD
-
-vsomeip::factory * the_factory = vsomeip::factory::get_instance();
-
-int options_count = 0;
-char **options = 0;
-
-vsomeip::application * the_application;
-vsomeip::endpoint * an_endpoint = the_factory->get_endpoint("10.0.2.15", 30499, vsomeip::ip_protocol::UDP);
-vsomeip::endpoint * another_endpoint = the_factory->get_endpoint("10.0.2.15", 30506, vsomeip::ip_protocol::TCP);
-
-void on_off() {
- bool is_on = true;
- while (1) {
- usleep(8000000);
- if (is_on) {
- the_application->provide_service(0x2234, 0x4455, an_endpoint);
- the_application->provide_service(0x2234, 0x4455, another_endpoint);
- } else
- the_application->withdraw_service(0x2234, 0x4455);
-
- is_on = !is_on;
- }
-}
-
-void run(const char *name) {
- the_application = the_factory->create_application(name);
-
- the_application->init(options_count, options);
-
- the_application->provide_service(0x2233, 0x4455, an_endpoint);
- the_application->provide_service(0x2233, 0x4456, an_endpoint);
- the_application->provide_service(0x2234, 0x4455, an_endpoint);
-
- the_application->provide_service(0x2234, 0x4455, another_endpoint);
- the_application->provide_service(0x2235, 0x4460, another_endpoint);
-
- the_application->start();
-}
-
-
-int main(int argc, char **argv) {
- options_count = argc;
- options = argv;
-
- boost::thread t00(run, "alpha");
- boost::thread t00_a(on_off);
-#ifdef SAMPLE_MULTITHREAD
- boost::thread t01(run, "bravo");
- boost::thread t02(run, "charly");
- boost::thread t03(run, "delta");
- boost::thread t04(run, "echo");
- boost::thread t05(run, "foxtrott");
- boost::thread t06(run, "golf");
- boost::thread t07(run, "hotel");
- boost::thread t08(run, "indian");
- boost::thread t09(run, "juliet");
- boost::thread t10(run, "kilo");
- boost::thread t11(run, "lima");
-#endif
-
- t00.join();
-#ifdef SAMPLE_MULTITHREAD
- t01.join();
- t02.join();
- t03.join();
- t04.join();
- t05.join();
- t06.join();
- t07.join();
- t08.join();
- t09.join();
- t10.join();
- t11.join();
-#endif
-
- return 0;
-}
-
-
-
-
diff --git a/vsomeip/src/vsomeip.examples/client_sample-sd.cpp b/vsomeip/src/vsomeip.examples/client_sample-sd.cpp
deleted file mode 100644
index c222f22..0000000
--- a/vsomeip/src/vsomeip.examples/client_sample-sd.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-#include <chrono>
-#include <iostream>
-
-#include <boost/bind/placeholders.hpp>
-#include <boost/bind.hpp>
-#include <boost/thread.hpp>
-
-#include <vsomeip/vsomeip.hpp>
-
-//#define SAMPLE_MULTITHREAD
-#define SAMPLE_MESSAGE_SIZE 60
-
-#define INTERNAL_SAMPLE_SERVICE 0x1234
-#define INTERNAL_SAMPLE_SERVICE_INSTANCE 0x5678
-#define INTERNAL_SAMPLE_METHOD 0x0205
-#define INTERNAL_SAMPLE_EVENTGROUP 0x4263
-#define INTERNAL_SAMPLE_EVENT 0x0077
-
-#define EXTERNAL_SAMPLE_SERVICE 0x1234
-#define EXTERNAL_SAMPLE_SERVICE_INSTANCE 0x2356
-#define EXTERNAL_SAMPLE_METHOD 0x0203
-#define EXTERNAL_SAMPLE_EVENTGROUP 0x4815
-#define EXTERNAL_SAMPLE_EVENT 0x0077
-
-using namespace vsomeip;
-
-factory * the_factory = factory::get_instance();
-application * the_application = the_factory->create_application("InternalClientSample");
-
-message * the_message = the_factory->create_message();
-
-class Connection {
-public:
- void on_method(std::shared_ptr< message > &_message) {
- static int i = 0;
-
- const payload &its_payload = _message->get_payload();
- uint32_t length = its_payload.get_length();
- const uint8_t *data = its_payload.get_data();
-
- std::cout << "[" << std::dec << std::setw(4) << std::setfill('0') << i++
- << "] Service has answered to client "
- << std::hex << _message->get_client_id()
- << " with [ ";
- for (uint32_t j = 0; j < length; ++j)
- std::cout << std::setw(2) << std::setfill('0') << std::hex << (int)data[j] << " ";
- std::cout << "]" << std::endl;
- }
-
- void on_event(std::shared_ptr< message > &_message) {
- static int i = 0;
-
- const payload &its_payload = _message->get_payload();
- uint32_t length = its_payload.get_length();
- const uint8_t *data = its_payload.get_data();
-
- std::cout << "[" << std::dec << std::setw(4) << std::setfill('0') << i++
- << "] Service has updated field ["
- << std::hex << _message->get_method_id()
- << "] for client ["
- << std::hex << _message->get_client_id()
- << "] to [ ";
- for (uint32_t j = 0; j < length; ++j)
- std::cout << std::setw(2) << std::setfill('0') << std::hex << (int)data[j] << " ";
- std::cout << "]" << std::endl;
- }
-
- void on_avail(service_id s, instance_id i, bool a) {
- std::cout << "Service [" << std::hex << s << "." << i << "] is "
- << (a ? "available!" : "not available!") << std::endl;
- }
-};
-
-void worker() {
- bool is_sending_to_internal = true;
- while (1) {
- bool is_available;
-
- if (is_sending_to_internal) {
- the_message->set_service_id(INTERNAL_SAMPLE_SERVICE);
- the_message->set_instance_id(INTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_message->set_method_id(INTERNAL_SAMPLE_METHOD);
- is_available = the_application->is_service_available(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE);
- } else {
- the_message->set_service_id(EXTERNAL_SAMPLE_SERVICE);
- the_message->set_instance_id(EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_message->set_method_id(EXTERNAL_SAMPLE_METHOD);
- is_available = the_application->is_service_available(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- }
-
- usleep(100000);
-
- if (is_available)
- the_application->send(the_message, true);
-
- is_sending_to_internal = !is_sending_to_internal;
- }
-}
-
-void run() {
- the_application->start();
-}
-
-
-int main(int argc, char **argv) {
- the_application->init(argc, argv);
- Connection the_connection;
- std::function< void (service_id, instance_id, bool) > avail_handler
- = std::bind(&Connection::on_avail, &the_connection, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
- the_application->register_availability_handler(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, avail_handler);
-
- the_message->set_session_id(0x4234);
- the_message->set_message_type(message_type_enum::REQUEST);
- the_message->set_return_code(return_code_enum::OK);
-
- uint8_t sample_message_data[SAMPLE_MESSAGE_SIZE];
- for (int i = 0; i < SAMPLE_MESSAGE_SIZE; ++i) {
- sample_message_data[i] = (i % 256);
- }
- the_message->get_payload().set_data(sample_message_data, sizeof(sample_message_data));
-
- the_application->request_service(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_application->request_service(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE);
-
- the_application->request_eventgroup(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_EVENTGROUP);
- the_application->request_eventgroup(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_EVENTGROUP);
-
- boost::function< void (std::shared_ptr< message > &) > method_handler = boost::bind(&Connection::on_method, &the_connection, _1);
- boost::function< void (std::shared_ptr< message > &) > event_handler = boost::bind(&Connection::on_event, &the_connection, _1);
-
- the_application->register_message_handler(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_METHOD, method_handler);
- the_application->register_message_handler(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_METHOD, method_handler);
-
- the_application->register_message_handler(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_EVENT, event_handler);
-
- boost::thread framework_thread(run);
- boost::thread application_thread(worker);
-
- framework_thread.join();
- application_thread.join();
-
- return 0;
-}
-
-
-
-
diff --git a/vsomeip/src/vsomeip.examples/client_sample.cpp b/vsomeip/src/vsomeip.examples/client_sample.cpp
deleted file mode 100644
index a84875b..0000000
--- a/vsomeip/src/vsomeip.examples/client_sample.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-#include <chrono>
-#include <iostream>
-
-#include <boost/bind/placeholders.hpp>
-#include <boost/bind.hpp>
-#include <boost/thread.hpp>
-
-#include <vsomeip/vsomeip.hpp>
-
-//#define SAMPLE_MULTITHREAD
-#define SAMPLE_MESSAGE_SIZE 60
-
-#define INTERNAL_SAMPLE_SERVICE 0x1234
-#define INTERNAL_SAMPLE_SERVICE_INSTANCE 0x5678
-#define INTERNAL_SAMPLE_METHOD 0x0205
-
-#define EXTERNAL_SAMPLE_SERVICE 0x1234
-#define EXTERNAL_SAMPLE_SERVICE_INSTANCE 0x2356
-#define EXTERNAL_SAMPLE_METHOD 0x0203
-
-using namespace vsomeip;
-
-factory * the_factory = factory::get_instance();
-application * the_application = the_factory->create_application("InternalClientSample");
-
-endpoint *internal_endpoint = the_factory->get_endpoint("10.0.2.15", 30499, ip_protocol::TCP);
-endpoint *external_endpoint = the_factory->get_endpoint("127.0.0.1", 30498, ip_protocol::TCP);
-
-message * the_message = the_factory->create_message();
-
-class Connection {
-public:
- void receive(std::shared_ptr< message > &_message) {
- static int i = 0;
-
- std::cout << "[" << std::dec << std::setw(4) << std::setfill('0') << i++
- << "] Service has answered to client "
- << std::hex << _message->get_client_id()
- << " with "
- << std::dec << _message->get_length() << " bytes [ ";
-
- const payload & its_payload = _message->get_payload();
- for (int i = 0; i < its_payload.get_length(); ++i)
- std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)its_payload.get_data()[i] << " ";
- std::cout << "]" << std::endl;
- }
-};
-
-void worker() {
- bool is_sending_to_internal = true;
- while (1) {
- bool is_available;
-
- if (is_sending_to_internal) {
- the_message->set_service_id(INTERNAL_SAMPLE_SERVICE);
- the_message->set_instance_id(INTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_message->set_method_id(INTERNAL_SAMPLE_METHOD);
- is_available = the_application->is_service_available(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE);
- } else {
- the_message->set_service_id(EXTERNAL_SAMPLE_SERVICE);
- the_message->set_instance_id(EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_message->set_method_id(EXTERNAL_SAMPLE_METHOD);
- is_available = the_application->is_service_available(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- }
-
- usleep(100000);
-
- if (is_available)
- the_application->send(the_message, true);
-
- is_sending_to_internal = !is_sending_to_internal;
- }
-}
-
-void run() {
- the_application->start();
-}
-
-
-int main(int argc, char **argv) {
- the_application->init(argc, argv);
-
- the_message->set_session_id(0x4234);
- the_message->set_message_type(message_type_enum::REQUEST);
- the_message->set_return_code(return_code_enum::OK);
-
- uint8_t sample_message_data[SAMPLE_MESSAGE_SIZE];
- for (int i = 0; i < SAMPLE_MESSAGE_SIZE; ++i) {
- sample_message_data[i] = (i % 256);
- }
- the_message->get_payload().set_data(sample_message_data, sizeof(sample_message_data));
-
- the_application->request_service(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, internal_endpoint);
- the_application->request_service(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, external_endpoint);
-
- Connection the_connection;
- boost::function< void (std::shared_ptr< message > &) > func = boost::bind(&Connection::receive, &the_connection, _1);
-
- the_application->register_message_handler(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_METHOD, func);
- the_application->register_message_handler(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_METHOD, func);
-
- boost::thread framework_thread(run);
- boost::thread application_thread(worker);
-
- framework_thread.join();
- application_thread.join();
-
- return 0;
-}
-
-
-
-
diff --git a/vsomeip/src/vsomeip.examples/external-client_sample-sd.cpp b/vsomeip/src/vsomeip.examples/external-client_sample-sd.cpp
deleted file mode 100644
index 7fe8af0..0000000
--- a/vsomeip/src/vsomeip.examples/external-client_sample-sd.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <chrono>
-#include <iostream>
-
-#include <boost/thread.hpp>
-
-#include <vsomeip/vsomeip.hpp>
-
-//#define SAMPLE_MULTITHREAD
-#define SAMPLE_MESSAGE_SIZE 30
-
-#define INTERNAL_SAMPLE_SERVICE 0x1234
-#define INTERNAL_SAMPLE_SERVICE_INSTANCE 0x5678
-#define INTERNAL_SAMPLE_METHOD 0x0205
-#define INTERNAL_SAMPLE_EVENTGROUP 0x4263
-
-#define EXTERNAL_SAMPLE_SERVICE 0x1234
-#define EXTERNAL_SAMPLE_SERVICE_INSTANCE 0x2356
-#define EXTERNAL_SAMPLE_METHOD 0x0203
-#define EXTERNAL_SAMPLE_EVENTGROUP 0x4815
-
-using namespace vsomeip;
-
-int options_count = 0;
-char **options = 0;
-
-factory * the_factory = factory::get_instance();
-application * the_application = the_factory->create_application("ExternalClientSample");
-
-message * the_message = the_factory->create_message();
-
-void receive(std::shared_ptr< message > &_message) {
- static int i = 0;
-
- std::cout << "[" << std::dec << std::setw(4) << std::setfill('0') << i++
- << "] Service has answered to Client "
- << std::hex << _message->get_client_id()
- << " with "
- << std::dec << _message->get_length() << " bytes."
- << std::endl;
-}
-
-void worker() {
- bool is_sending_to_internal = true;
- while (1) {
- bool is_available;
-
- if (is_sending_to_internal) {
- the_message->set_service_id(INTERNAL_SAMPLE_SERVICE);
- the_message->set_instance_id(INTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_message->set_method_id(INTERNAL_SAMPLE_METHOD);
- is_available = the_application->is_service_available(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE);
- } else {
- the_message->set_service_id(EXTERNAL_SAMPLE_SERVICE);
- the_message->set_instance_id(EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_message->set_method_id(EXTERNAL_SAMPLE_METHOD);
- is_available = the_application->is_service_available(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- }
-
- usleep(100000);
-
- if (is_available)
- the_application->send(the_message, true);
-
- is_sending_to_internal = !is_sending_to_internal;
- }
-}
-
-void run() {
- the_application->init(options_count, options);
-
- // Client-Id will be automatically set by the application
- the_message->set_session_id(0x4234);
- the_message->set_message_type(message_type_enum::REQUEST);
- the_message->set_return_code(return_code_enum::OK);
-
- uint8_t sample_message_data[SAMPLE_MESSAGE_SIZE];
- for (int i = 0; i < SAMPLE_MESSAGE_SIZE; ++i) {
- sample_message_data[i] = (i % 256);
- }
- the_message->get_payload().set_data(sample_message_data, sizeof(sample_message_data));
-
- the_application->request_service(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_application->request_service(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE);
-
- the_application->request_eventgroup(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_EVENTGROUP);
- the_application->request_eventgroup(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_EVENTGROUP);
-
- the_application->register_message_handler(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_METHOD, receive);
- the_application->register_message_handler(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_METHOD, receive);
-
- the_application->start();
-}
-
-
-int main(int argc, char **argv) {
- options_count = argc;
- options = argv;
-
- boost::thread receiver(run);
- boost::thread sender(worker);
-
- sender.join();
- receiver.join();
-
- return 0;
-}
diff --git a/vsomeip/src/vsomeip.examples/external-client_sample.cpp b/vsomeip/src/vsomeip.examples/external-client_sample.cpp
deleted file mode 100644
index 6e2f2d8..0000000
--- a/vsomeip/src/vsomeip.examples/external-client_sample.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-#include <chrono>
-#include <iostream>
-
-#include <boost/thread.hpp>
-
-#include <vsomeip/vsomeip.hpp>
-
-//#define SAMPLE_MULTITHREAD
-#define SAMPLE_MESSAGE_SIZE 30
-
-#define INTERNAL_SAMPLE_SERVICE 0x1234
-#define INTERNAL_SAMPLE_SERVICE_INSTANCE 0x5678
-#define INTERNAL_SAMPLE_METHOD 0x0205
-
-#define EXTERNAL_SAMPLE_SERVICE 0x1234
-#define EXTERNAL_SAMPLE_SERVICE_INSTANCE 0x2356
-#define EXTERNAL_SAMPLE_METHOD 0x0203
-
-using namespace vsomeip;
-
-int options_count = 0;
-char **options = 0;
-
-factory * the_factory = factory::get_instance();
-application * the_application = the_factory->create_application("ExternalClientSample");
-
-endpoint *internal_endpoint = the_factory->get_endpoint("10.0.2.15", 30499, ip_protocol::TCP);
-endpoint *external_endpoint = the_factory->get_endpoint("127.0.0.1", 30498, ip_protocol::TCP);
-
-message * the_message = the_factory->create_message();
-
-void receive(std::shared_ptr< message > &_message) {
- static int i = 0;
-
- std::cout << "[" << std::dec << std::setw(4) << std::setfill('0') << i++
- << "] Service has answered to Client "
- << std::hex << _message->get_client_id()
- << " with "
- << std::dec << _message->get_length() << " bytes."
- << std::endl;
-}
-
-void worker() {
- bool is_sending_to_internal = true;
- while (1) {
- bool is_available;
-
- if (is_sending_to_internal) {
- the_message->set_service_id(INTERNAL_SAMPLE_SERVICE);
- the_message->set_instance_id(INTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_message->set_method_id(INTERNAL_SAMPLE_METHOD);
- is_available = the_application->is_service_available(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE);
- } else {
- the_message->set_service_id(EXTERNAL_SAMPLE_SERVICE);
- the_message->set_instance_id(EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- the_message->set_method_id(EXTERNAL_SAMPLE_METHOD);
- is_available = the_application->is_service_available(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- }
-
- usleep(100000);
-
- if (is_available)
- the_application->send(the_message, true);
-
- is_sending_to_internal = !is_sending_to_internal;
- }
-}
-
-void run() {
- the_application->init(options_count, options);
-
- // Client-Id will be automatically set by the application
- the_message->set_session_id(0x4234);
- the_message->set_message_type(message_type_enum::REQUEST);
- the_message->set_return_code(return_code_enum::OK);
-
- uint8_t sample_message_data[SAMPLE_MESSAGE_SIZE];
- for (int i = 0; i < SAMPLE_MESSAGE_SIZE; ++i) {
- sample_message_data[i] = (i % 256);
- }
- the_message->get_payload().set_data(sample_message_data, sizeof(sample_message_data));
-
- the_application->request_service(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, internal_endpoint);
- the_application->request_service(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, external_endpoint);
-
- the_application->register_message_handler(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_METHOD, receive);
- the_application->register_message_handler(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_METHOD, receive);
-
- the_application->start();
-}
-
-
-int main(int argc, char **argv) {
- options_count = argc;
- options = argv;
-
- boost::thread receiver(run);
- boost::thread sender(worker);
-
- sender.join();
- receiver.join();
-
- return 0;
-}
diff --git a/vsomeip/src/vsomeip.examples/external-service_sample.cpp b/vsomeip/src/vsomeip.examples/external-service_sample.cpp
deleted file mode 100644
index c3ccc85..0000000
--- a/vsomeip/src/vsomeip.examples/external-service_sample.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#include <iomanip>
-#include <iostream>
-
-#include <boost/thread.hpp>
-
-#include <vsomeip/vsomeip.hpp>
-
-using namespace vsomeip;
-
-#define EXTERNAL_SAMPLE_SERVICE 0x1234
-#define EXTERNAL_SAMPLE_SERVICE_INSTANCE 0x2356
-#define EXTERNAL_SAMPLE_METHOD 0x0203
-#define EXTERNAL_SAMPLE_EVENTGROUP 0x4815
-#define EXTERNAL_SAMPLE_FIELD 0x0077
-
-factory *the_factory = 0;
-application *the_application = 0;
-
-void on_off() {
- static bool is_on = false;
-
- while (true) {
- usleep(3000000);
-
- if (is_on) {
- std::cout << "Stopping service" << std::endl;
- the_application->stop_service(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- } else {
- std::cout << "Starting service" << std::endl;
- the_application->start_service(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE);
- }
-
- is_on = !is_on;
- }
-}
-
-void receive_message(std::shared_ptr< message > &_message) {
- static int i = 0;
-
- std::cout << "[" << std::dec << std::setw(4) << std::setfill('0') << i++
- << "] Client "
- << std::hex << _message->get_client_id()
- << " has sent a request with "
- << std::dec << _message->get_length() << " bytes."
- << std::endl;
-
- message *response = the_factory->create_response(_message.get());
-
- uint8_t payload_data[] = { 0x11, 0x22, 0x44, 0x66, 0x88 };
- response->get_payload().set_data(payload_data, sizeof(payload_data));
-
- the_application->send(response);
-}
-
-int main(int argc, char **argv) {
- the_factory = factory::get_instance();
- endpoint *location = the_factory->get_endpoint("127.0.0.1", 30498, ip_protocol::TCP);
-
- // create the application and provide a service at the defined location
- the_application = the_factory->create_application("ExternalServiceSample");
- the_application->init(argc, argv);
-
- the_application->provide_service(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, location);
- the_application->provide_eventgroup(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_EVENTGROUP, 0);
-
- field *sample_field = the_factory->create_field(the_application, EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_FIELD);
-
- the_application->add_field(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_EVENTGROUP, sample_field);
-
- the_application->register_message_handler(EXTERNAL_SAMPLE_SERVICE, EXTERNAL_SAMPLE_SERVICE_INSTANCE, EXTERNAL_SAMPLE_METHOD, receive_message);
-
- boost::thread on_off_thread(on_off);
-
- the_application->start();
-}
diff --git a/vsomeip/src/vsomeip.examples/service_sample.cpp b/vsomeip/src/vsomeip.examples/service_sample.cpp
deleted file mode 100644
index f291b87..0000000
--- a/vsomeip/src/vsomeip.examples/service_sample.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-#include <chrono>
-
-#include <boost/thread.hpp>
-
-#include <vsomeip/vsomeip.hpp>
-
-using namespace vsomeip;
-
-#define INTERNAL_SAMPLE_SERVICE 0x1234
-#define INTERNAL_SAMPLE_SERVICE_INSTANCE 0x5678
-#define INTERNAL_SAMPLE_METHOD 0x0205
-#define INTERNAL_SAMPLE_EVENTGROUP 0x4263
-#define INTERNAL_SAMPLE_FIELD 0x0077
-
-int options_count = 0;
-char **options = 0;
-
-factory *the_factory = 0;
-application *the_application = 0;
-field *the_field;
-
-void on_off() {
- static bool is_on = false;
- int i = 0;
-
- payload &its_payload = the_field->get_payload();
- uint8_t data[2];
-
- while (true) {
- usleep(1000000);
-
- if (i < 9) {
- if (is_on) {
- data[0] = i;
- data[1] = 10-i;
- std::cout << "Updating field ["
- << std::hex << INTERNAL_SAMPLE_FIELD
- << "] to ["
- << std::setw(2) << std::setfill('0') << (int)data[0] << " "
- << std::setw(2) << std::setfill('0') << (int)data[1] << "]"
- << std::endl;
- its_payload.set_data(data, sizeof(data));
- }
- } else {
- if (is_on) {
- std::cout << "Stopping service" << std::endl;
- the_application->stop_service(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE);
- } else {
- std::cout << "Starting service" << std::endl;
- the_application->start_service(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE);
- }
-
- is_on = !is_on;
- }
-
- i ++;
- if (i == 10) i = 0;
- }
-}
-
-void receive_message(std::shared_ptr< message > &_message) {
- static int i = 0;
-
- std::cout << "[" << std::dec << std::setw(4) << std::setfill('0') << i++
- << "] Client "
- << std::hex << _message->get_client_id()
- << " has sent a request with "
- << std::dec << _message->get_length() << " bytes."
- << std::endl;
-
- message *response = the_factory->create_response(_message.get());
-
- uint8_t payload_data[] = { 0x11, 0x22, 0x44, 0x66, 0x88 };
- response->get_payload().set_data(payload_data, sizeof(payload_data));
-
- the_application->send(response);
-}
-
-int main(int argc, char **argv) {
- the_factory = factory::get_instance();
- endpoint *location = the_factory->get_endpoint("127.0.0.1", 30498, ip_protocol::UDP);
- endpoint *multicast = the_factory->get_endpoint("224.0.0.1", 31000, ip_protocol::UDP);
-
- // create the application and provide a service at the defined location
- the_application = the_factory->create_application("InternalServiceSample");
- the_application->init(argc, argv);
-
- the_application->provide_service(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, location);
- the_application->provide_eventgroup(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_EVENTGROUP, multicast);
-
- the_field = the_factory->create_field(the_application, INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_FIELD);
-
- uint8_t data[] = { 0x77, 0x88, 0x99 };
- the_field->get_payload().set_data(data, sizeof(data));
-
- the_application->add_field(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_EVENTGROUP, the_field);
-
- the_application->register_message_handler(INTERNAL_SAMPLE_SERVICE, INTERNAL_SAMPLE_SERVICE_INSTANCE, INTERNAL_SAMPLE_METHOD, receive_message);
-
- boost::thread on_off_thread(on_off);
-
- the_application->start();
-}
-
-
-
-
diff --git a/vsomeip/src/vsomeip.sd/client_proxy.cpp b/vsomeip/src/vsomeip.sd/client_proxy.cpp
deleted file mode 100644
index f54d543..0000000
--- a/vsomeip/src/vsomeip.sd/client_proxy.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// client_proxy.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iostream>
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip_internal/sd/client_proxy.hpp>
-#include <vsomeip_internal/sd/eventgroup_client_proxy.hpp>
-#include <vsomeip_internal/sd/group.hpp>
-#include <vsomeip_internal/sd/service_discovery.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-client_proxy::client_proxy(group *_group, service_id _service, instance_id _instance)
- : group_(_group), service_(_service), instance_(_instance),
- reliable_local_(0), reliable_remote_(0), unreliable_local_(0), unreliable_remote_(0) {
-}
-
-service_id client_proxy::get_service() const {
- return service_;
-}
-
-instance_id client_proxy::get_instance() const {
- return instance_;
-}
-
-major_version client_proxy::get_major_version() const {
- return 0x1;
-}
-
-minor_version client_proxy::get_minor_version() const {
- return 0x1;
-}
-
-time_to_live client_proxy::get_time_to_live() const {
- return 0x3600;
-}
-
-bool client_proxy::is_available() const {
- return (reliable_remote_ || unreliable_remote_);
-}
-
-void client_proxy::set_available(const endpoint *_reliable, const endpoint *_unreliable, bool _is_available) {
- if (_is_available) {
- if (0 != _reliable) {
- reliable_remote_ = _reliable;
- update_clients(_reliable, true);
- }
-
- if (0 != _unreliable) {
- unreliable_remote_ = _unreliable;
- update_clients(_unreliable, true);
- }
- } else {
- if (0 != _reliable && reliable_remote_ == _reliable) {
- reliable_remote_ = 0;
- update_clients(_reliable, false);
- }
-
- if (0 != _unreliable && unreliable_remote_ == _unreliable) {
- unreliable_remote_ = 0;
- update_clients(_unreliable, false);
- }
-
- if (0 == _reliable && 0 == _unreliable) {
- reliable_remote_ = unreliable_remote_ = 0;
- update_clients(0, false);
- }
- }
-}
-
-void client_proxy::update_clients(const endpoint *_location, bool _is_available) {
- for (auto a_client : requesters_)
- group_->get_owner()->update_client(a_client, service_, instance_, _location, _is_available);
-
- if (_is_available) {
- group_->on_offer_service(service_, instance_, _location, reliable_local_, unreliable_local_);
- } else {
- if (0 == reliable_remote_ && 0 == unreliable_remote_) {
- for (auto i : eventgroups_) {
- // TODO: leave Multicast group(s)
- }
- }
- }
-}
-
-void client_proxy::request(client_id _client) {
- requesters_.insert(_client);
- group_->on_service_requested();
-}
-
-void client_proxy::release(client_id _client) {
- requesters_.erase(_client);
- group_->on_service_released();
-}
-
-void client_proxy::subscribe(client_id _client, eventgroup_id _eventgroup) {
- eventgroup_client_proxy *its_eventgroup = 0;
-
- auto found_eventgroup = eventgroups_.find(_eventgroup);
- if (found_eventgroup != eventgroups_.end()) {
- its_eventgroup = found_eventgroup->second.get();
- } else {
- its_eventgroup = new eventgroup_client_proxy(this, _eventgroup);
- eventgroups_[_eventgroup].reset(its_eventgroup);
- }
-
- its_eventgroup->subscribe(_client);
-}
-
-void client_proxy::unsubscribe(client_id _client, eventgroup_id _eventgroup) {
- auto found_eventgroup = eventgroups_.find(_eventgroup);
- if (found_eventgroup != eventgroups_.end()) {
- found_eventgroup->second->unsubscribe(_client);
- }
-}
-
-const std::map< eventgroup_id, boost::shared_ptr< eventgroup_client_proxy > > & client_proxy::get_eventgroups() const {
- return eventgroups_;
-}
-
-void client_proxy::set_local(const endpoint *_reliable, const endpoint *_unreliable) {
- reliable_local_ = _reliable;
- unreliable_local_ = _unreliable;
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/entry_impl.cpp b/vsomeip/src/vsomeip.sd/entry_impl.cpp
deleted file mode 100755
index a1df9ba..0000000
--- a/vsomeip/src/vsomeip.sd/entry_impl.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-//
-// entry_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <algorithm>
-
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/entry_impl.hpp>
-#include <vsomeip_internal/sd/message_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-// TODO: throw exception if this constructor is used
-entry_impl::entry_impl() {
- type_ = entry_type::UNKNOWN;
- major_version_ = 0;
- service_id_ = 0x0;
- instance_id_ = 0x0;
- time_to_live_ = 0x0;
-}
-
-entry_impl::entry_impl(const entry_impl &_entry) {
- type_ = _entry.type_;
- major_version_ = _entry.major_version_;
- service_id_ = _entry.service_id_;
- instance_id_ = _entry.instance_id_;
- time_to_live_ = _entry.time_to_live_;
-}
-
-entry_impl::~entry_impl() {
-}
-
-entry_type entry_impl::get_type() const {
- return type_;
-}
-
-void entry_impl::set_type(entry_type _type) {
- type_ = _type;
-}
-
-service_id entry_impl::get_service_id() const {
- return service_id_;
-}
-
-void entry_impl::set_service_id(service_id _service_id) {
- service_id_ = _service_id;
-}
-
-instance_id entry_impl::get_instance_id() const {
- return instance_id_;
-}
-
-void entry_impl::set_instance_id(instance_id _instance_id) {
- instance_id_ = _instance_id;
-}
-
-major_version entry_impl::get_major_version() const {
- return major_version_;
-}
-
-void entry_impl::set_major_version(major_version _major_version) {
- major_version_ = _major_version;
-}
-
-time_to_live entry_impl::get_time_to_live() const {
- return time_to_live_;
-}
-
-void entry_impl::set_time_to_live(time_to_live _ttl) {
- time_to_live_ = _ttl;
-}
-
-const std::vector< uint8_t > & entry_impl::get_options(uint8_t _run) const {
- static std::vector< uint8_t > invalid_options;
- if (_run > 0 && _run <= VSOMEIP_MAX_OPTION_RUN)
- return options_[_run-1];
-
- return invalid_options;
-}
-
-void entry_impl::assign_option(const option &_option, uint8_t _run) {
- if (_run > 0 && _run <= VSOMEIP_MAX_OPTION_RUN) {
- _run--; // Index = Run-1
-
- uint8_t option_index = get_owning_message()->get_option_index(_option);
- if (0x10 > option_index) { // as we have only a nibble for the option counter
- options_[_run].push_back(option_index);
- std::sort(options_[_run].begin(), options_[_run].end());
- } else {
- // TODO: decide what to do if option does not belong to the message.
- }
- } else {
- // TODO: decide what to do if an illegal index for the option run is provided
- }
-}
-
-bool entry_impl::serialize(vsomeip::serializer *_to) const {
- bool is_successful = (0 != _to && _to->serialize(static_cast<uint8_t>(type_)));
-
- uint8_t index_first_option_run = 0;
- if (options_[0].size() > 0)
- index_first_option_run = options_[0][0];
- is_successful = is_successful
- && _to->serialize(index_first_option_run);
-
- uint8_t index_second_option_run = 0;
- if (options_[1].size() > 0)
- index_second_option_run = options_[1][0];
- is_successful = is_successful
- && _to->serialize(index_second_option_run);
-
- uint8_t number_of_options = ((((uint8_t)options_[0].size()) << 4)
- | (((uint8_t)options_[1].size()) & 0x0F));
- is_successful = is_successful
- && _to->serialize(number_of_options);
-
- is_successful = is_successful
- && _to->serialize(static_cast< uint16_t >(service_id_));
-
- is_successful = is_successful
- && _to->serialize(static_cast< uint16_t >(instance_id_));
-
- return is_successful;
-}
-
-bool entry_impl::deserialize(vsomeip::deserializer *_from) {
- bool is_successful = (0 != _from);
-
- uint8_t tmp_type;
- is_successful = is_successful && _from->deserialize(tmp_type);
- type_ = static_cast< entry_type >(tmp_type);
-
- uint8_t tmp_index1;
- is_successful = is_successful && _from->deserialize(tmp_index1);
-
- uint8_t tmp_index2;
- is_successful = is_successful && _from->deserialize(tmp_index2);
-
- uint8_t tmp_numbers;
- is_successful = is_successful && _from->deserialize(tmp_numbers);
-
- uint8_t tmp_numbers1 = (tmp_numbers >> 4);
- uint8_t tmp_numbers2 = (tmp_numbers & 0xF);
-
- for (uint8_t i = tmp_index1; i < tmp_index1 + tmp_numbers1; ++i)
- options_[0].push_back(i);
-
- for (uint8_t i = tmp_index2; i < tmp_index2 + tmp_numbers2; ++i)
- options_[1].push_back(i);
-
- uint16_t tmp_id;
- is_successful = is_successful && _from->deserialize(tmp_id);
- service_id_ = static_cast< service_id >(tmp_id);
-
- is_successful = is_successful && _from->deserialize(tmp_id);
- instance_id_ = static_cast< instance_id >(tmp_id);
-
- return is_successful;
-}
-
-bool entry_impl::is_service_entry() const {
- return (type_ <= entry_type::REQUEST_SERVICE);
-}
-
-bool entry_impl::is_eventgroup_entry() const {
- return (type_ >= entry_type::FIND_EVENT_GROUP
- && type_ <= entry_type::SUBSCRIBE_EVENTGROUP_ACK);
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/eventgroup_client_proxy.cpp b/vsomeip/src/vsomeip.sd/eventgroup_client_proxy.cpp
deleted file mode 100644
index 72c052a..0000000
--- a/vsomeip/src/vsomeip.sd/eventgroup_client_proxy.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// eventgroup_client_proxy.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/sd/client_proxy.hpp>
-#include <vsomeip_internal/sd/eventgroup_client_proxy.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-eventgroup_client_proxy::eventgroup_client_proxy(client_proxy *_client, eventgroup_id _eventgroup)
- : client_(_client),
- eventgroup_(_eventgroup),
- is_acknowledged_(false),
- multicast_(0) {
-}
-
-bool eventgroup_client_proxy::is_acknowledged() const {
- return is_acknowledged_;
-}
-
-void eventgroup_client_proxy::set_acknowledged(bool _is_acknowledged) {
- is_acknowledged_ = _is_acknowledged;
-}
-
-const endpoint * eventgroup_client_proxy::get_multicast() const {
- return multicast_;
-}
-
-void eventgroup_client_proxy::set_multicast(const endpoint *_multicast) {
- multicast_ = _multicast;
-}
-
-void eventgroup_client_proxy::subscribe(client_id _client) {
- subscribers_.insert(_client);
-}
-
-void eventgroup_client_proxy::unsubscribe(client_id _client) {
- subscribers_.erase(_client);
-}
-
-} // namespace sd
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip.sd/eventgroup_service_proxy.cpp b/vsomeip/src/vsomeip.sd/eventgroup_service_proxy.cpp
deleted file mode 100644
index 35bfa20..0000000
--- a/vsomeip/src/vsomeip.sd/eventgroup_service_proxy.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// eventgroup_service_proxy.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/sd/eventgroup_service_proxy.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-eventgroup_service_proxy::eventgroup_service_proxy(service_proxy *_service, eventgroup_id _eventgroup)
- : service_(_service),
- eventgroup_(_eventgroup) {
-}
-
-const endpoint * eventgroup_service_proxy::get_multicast() const {
- return multicast_;
-}
-
-void eventgroup_service_proxy::set_multicast(const endpoint *_multicast) {
- multicast_ = _multicast;
-}
-
-void eventgroup_service_proxy::subscribe(const endpoint *_reliable, const endpoint *_unreliable) {
- if (0 != multicast_ && 0 == _reliable) {
- subscribers_.insert(_unreliable);
- } else {
- subscribers_.insert(_reliable);
- }
-}
-
-void eventgroup_service_proxy::unsubscribe(const endpoint *_reliable, const endpoint *_unreliable) {
- if (0 != _reliable) subscribers_.erase(_reliable);
- if (0 != _unreliable) subscribers_.erase(_unreliable);
-}
-
-} // namespace sd
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip.sd/eventgroupentry_impl.cpp b/vsomeip/src/vsomeip.sd/eventgroupentry_impl.cpp
deleted file mode 100755
index c5d0f72..0000000
--- a/vsomeip/src/vsomeip.sd/eventgroupentry_impl.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// eventgroup_entry_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iostream>
-
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/eventgroup_entry_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-eventgroup_entry_impl::eventgroup_entry_impl() {
- eventgroup_id_ = 0xFFFF;
-}
-
-eventgroup_entry_impl::eventgroup_entry_impl(const eventgroup_entry_impl &_entry)
- : entry_impl(_entry) {
-
- eventgroup_id_ = _entry.eventgroup_id_;
-}
-
-eventgroup_entry_impl::~eventgroup_entry_impl() {
-}
-
-eventgroup_id eventgroup_entry_impl::get_eventgroup_id() const {
- return eventgroup_id_;
-}
-
-void eventgroup_entry_impl::set_eventgroup_id(eventgroup_id _eventgroup_id) {
- eventgroup_id_ = _eventgroup_id;
-}
-
-bool eventgroup_entry_impl::serialize(vsomeip::serializer *_to) const {
- bool is_successful = entry_impl::serialize(_to);
-
- is_successful = is_successful
- && _to->serialize(vsomeip_protocol_reserved_byte);
-
- is_successful = is_successful
- && _to->serialize(static_cast< uint32_t >(time_to_live_), true);
-
- is_successful = is_successful
- && _to->serialize(vsomeip_protocol_reserved_word);
-
- is_successful = is_successful
- && _to->serialize(static_cast< uint16_t >(eventgroup_id_));
-
- return is_successful;
-}
-
-bool eventgroup_entry_impl::deserialize(vsomeip::deserializer *_from) {
- bool is_successful = entry_impl::deserialize(_from);
-
- uint8_t reserved0;
- is_successful = is_successful && _from->deserialize(reserved0);
-
- uint32_t tmp_time_to_live;
- is_successful = is_successful && _from->deserialize(tmp_time_to_live, true);
- time_to_live_ = static_cast<time_to_live>(tmp_time_to_live);
-
- uint16_t reserved1;
- is_successful = is_successful && _from->deserialize(reserved1);
-
- uint16_t tmp_eventgroup_id = 0;
- is_successful = is_successful && _from->deserialize(tmp_eventgroup_id);
- eventgroup_id_ = static_cast< eventgroup_id >(tmp_eventgroup_id);
-
- return is_successful;
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/factory.cpp b/vsomeip/src/vsomeip.sd/factory.cpp
deleted file mode 100644
index a23cfac..0000000
--- a/vsomeip/src/vsomeip.sd/factory.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// factory_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip/sd/factory.hpp>
-#include <vsomeip_internal/sd/factory_impl.hpp>
-
-vsomeip::sd::factory * VSOMEIP_SD_FACTORY_SYMBOL;
-
-
-static void init_vsomeip_sd() __attribute__((constructor));
-
-static void init_vsomeip_sd() {
- VSOMEIP_SD_FACTORY_SYMBOL = vsomeip::sd::factory::get_instance();
-}
-
-namespace vsomeip {
-namespace sd {
-
-factory * factory::get_instance() {
- return factory_impl::get_instance();
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/factory_impl.cpp b/vsomeip/src/vsomeip.sd/factory_impl.cpp
deleted file mode 100644
index efaee98..0000000
--- a/vsomeip/src/vsomeip.sd/factory_impl.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// factory_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/sd/constants.hpp>
-#include <vsomeip_internal/sd/factory_impl.hpp>
-#include <vsomeip_internal/sd/message_impl.hpp>
-#include <vsomeip_internal/sd/service_discovery_impl.hpp>
-
-namespace vsomeip {
-
-class daemon_impl;
-
-namespace sd {
-
-factory * factory_impl::get_instance() {
- static factory_impl the_factory;
- return &the_factory;
-}
-
-factory_impl::~factory_impl() {
-}
-
-service_discovery * factory_impl::create_service_discovery(daemon &_owner) const {
- return new service_discovery_impl(_owner);
-}
-
-message * factory_impl::create_message() const {
- message *its_message = new message_impl;
- if (0 != its_message) {
- its_message->set_service_id(VSOMEIP_SERVICE_DISCOVERY_SERVICE);
- its_message->set_method_id(VSOMEIP_SERVICE_DISCOVERY_METHOD);
- its_message->set_client_id(VSOMEIP_SERVICE_DISCOVERY_CLIENT);
- // Session-ID will be set when the message is sent
- its_message->set_protocol_version(VSOMEIP_SERVICE_DISCOVERY_PROTOCOL_VERSION);
- its_message->set_interface_version(VSOMEIP_SERVICE_DISCOVERY_INTERFACE_VERSION);
- its_message->set_message_type(VSOMEIP_SERVICE_DISCOVERY_MESSAGE_TYPE);
- its_message->set_return_code(VSOMEIP_SERVICE_DISCOVERY_RETURN_CODE);
- }
- return its_message;
-}
-
-} // namespace sd
-} // namespace vsomeip
-
-
diff --git a/vsomeip/src/vsomeip.sd/group.cpp b/vsomeip/src/vsomeip.sd/group.cpp
deleted file mode 100644
index 1055dd6..0000000
--- a/vsomeip/src/vsomeip.sd/group.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-//
-// group.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iomanip>
-
-#include <boost/asio/ip/address.hpp>
-#include <boost/random/mersenne_twister.hpp>
-#include <boost/random/uniform_int_distribution.hpp>
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/sd/enumeration_types.hpp>
-#include <vsomeip/sd/eventgroup_entry.hpp>
-#include <vsomeip/sd/factory.hpp>
-#include <vsomeip/sd/ipv4_endpoint_option.hpp>
-#include <vsomeip/sd/ipv4_multicast_option.hpp>
-#include <vsomeip/sd/ipv6_endpoint_option.hpp>
-#include <vsomeip/sd/ipv6_multicast_option.hpp>
-#include <vsomeip/sd/message.hpp>
-#include <vsomeip/sd/option.hpp>
-#include <vsomeip/sd/service_entry.hpp>
-#include <vsomeip_internal/configuration.hpp>
-#include <vsomeip_internal/sd/client_proxy.hpp>
-#include <vsomeip_internal/sd/eventgroup_client_proxy.hpp>
-#include <vsomeip_internal/sd/group.hpp>
-#include <vsomeip_internal/sd/service_discovery.hpp>
-#include <vsomeip_internal/sd/service_proxy.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-group::group(const std::string &_name, service_discovery *_owner)
- : name_(_name), owner_(_owner), machine_(this), is_client_started_(false), is_service_started_(false) {
-}
-
-void group::init() {
- configuration *the_configuration = configuration::request();
-
- boost::random::mt19937 random_generator;
- boost::random::uniform_int_distribution<> distribution(
- the_configuration->get_min_initial_delay(),
- the_configuration->get_max_initial_delay()
- );
-
- machine_.initial_delay_ = distribution(random_generator);
- machine_.repetition_base_delay_ = the_configuration->get_repetition_base_delay();
- machine_.cyclic_offer_delay_ = the_configuration->get_cyclic_offer_delay();
- machine_.repetition_max_ = the_configuration->get_repetition_max();
-
- machine_.initiate();
-}
-
-void group::start() {
- machine_.process_event(ev_none());
-}
-
-boost::asio::io_service & group::get_service() {
- return owner_->get_service();
-}
-
-const std::string & group::get_name() const {
- return name_;
-}
-
-bool group::is_started() const {
- return (is_service_started_ || is_client_started_);
-}
-
-bool group::is_network_configured() const {
- return true; // TODO: use "real" network status
-}
-
-void group::send_services_status(
- service_id _service, instance_id _instance,
- const endpoint *_target,
- bool _is_announcing) {
- factory *its_factory = factory::get_instance();
- std::map< const endpoint *, option * > endpoint_options;
-
- boost::shared_ptr< message > its_message(its_factory->create_message());
- its_message->set_target(_target);
-
- bool has_entry = false;
-
-#if 0
- if (!_is_announcing) {
- for (auto a_client : clients_) {
- if (!a_client->is_available()) {
- service_entry &its_entry = its_message->create_service_entry();
- its_entry.set_type(entry_type::FIND_SERVICE);
- its_entry.set_service_id(a_client->get_service());
- its_entry.set_instance_id(a_client->get_instance());
- its_entry.set_major_version(a_client->get_major_version());
- its_entry.set_minor_version(a_client->get_minor_version());
- its_entry.set_time_to_live(a_client->get_time_to_live());
- has_entry = true;
- }
- }
- }
-#endif
- for (auto a_service : services_) {
- if ((_service == VSOMEIP_ANY_SERVICE || _service == a_service->get_service()) &&
- (_instance == VSOMEIP_ANY_INSTANCE || _instance == a_service->get_instance())) {
-
- if (a_service->is_local()) {
- service_entry & its_entry = its_message->create_service_entry();
- its_entry.set_type(entry_type::OFFER_SERVICE);
- its_entry.set_service_id(a_service->get_service());
- its_entry.set_instance_id(a_service->get_instance());
- its_entry.set_major_version(a_service->get_major_version());
- its_entry.set_minor_version(a_service->get_minor_version());
- its_entry.set_time_to_live(a_service->get_time_to_live());
- has_entry = true;
-
- const endpoint *reliable = a_service->get_reliable();
- option *reliable_option = 0;
- if (0 != reliable) {
- auto found_option = endpoint_options.find(reliable);
- if (found_option == endpoint_options.end()) {
- reliable_option = add_endpoint_option(its_message.get(), reliable);
- if (0 != reliable_option) {
- endpoint_options[reliable] = reliable_option;
- }
- } else {
- reliable_option = found_option->second;
- }
-
- if (0 != reliable_option) {
- its_entry.assign_option(*reliable_option, 1);
- }
- }
-
- const endpoint *unreliable = a_service->get_unreliable();
- option *unreliable_option = 0;
- if (0 != unreliable) {
- auto found_option = endpoint_options.find(unreliable);
- if (found_option == endpoint_options.end()) {
- unreliable_option = add_endpoint_option(its_message.get(), unreliable);
- if (0 != unreliable_option) {
- endpoint_options[unreliable] = unreliable_option;
- }
- } else {
- unreliable_option = found_option->second;
- }
-
- if (0 != unreliable_option) {
- its_entry.assign_option(*unreliable_option, 1);
- }
- }
- }
- }
- }
-
- if (has_entry)
- owner_->send(its_message.get());
-}
-
-option * group::add_endpoint_option(message *_message, const endpoint *_endpoint) const {
- option *its_new_option = 0;
-
- if (0 != _endpoint) {
- if (ip_protocol_version::V4 == _endpoint->get_version()) {
- ipv4_address its_address = boost::asio::ip::address_v4::from_string(
- _endpoint->get_address()).to_ulong();
-
- if (its_address < VSOMEIP_MIN_MULTICAST) {
- ipv4_endpoint_option & its_option = _message->create_ipv4_endpoint_option();
- its_option.set_address(its_address);
- its_option.set_port(_endpoint->get_port());
- its_option.set_protocol(_endpoint->get_protocol());
-
- its_new_option = &its_option;
- } else {
- ipv4_multicast_option & its_option = _message->create_ipv4_multicast_option();
- its_option.set_address(its_address);
- its_option.set_port(_endpoint->get_port());
-
- its_new_option = &its_option;
- }
- } else { // TODO: support IPv6
- ipv6_address its_address; // = boost::asio::ip::address_v6::from_string(_endpoint->get_address())
-
- ipv6_endpoint_option & its_option = _message->create_ipv6_endpoint_option();
- its_option.set_address(its_address);
- its_option.set_port(_endpoint->get_port());
- its_option.set_protocol(_endpoint->get_protocol());
-
- its_new_option = &its_option;
- }
- }
-
- return its_new_option;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Client management
-///////////////////////////////////////////////////////////////////////////////
-client_proxy * group::find_client(service_id _service, instance_id _instance) {
- client_proxy *its_proxy = 0;
- for (auto i : clients_) {
- if (_service == i->get_service() && _instance == i->get_instance()) {
- its_proxy = i.get();
- break;
- }
- }
- return its_proxy;
-}
-
-client_proxy * group::add_client(service_id _service, instance_id _instance) {
- client_proxy *its_proxy = find_client(_service, _instance);
- if (0 == its_proxy) {
- its_proxy = new client_proxy(this, _service, _instance);
- clients_.insert(boost::shared_ptr< client_proxy >(its_proxy));
- }
- return its_proxy;
-}
-
-void group::remove_client(service_id _service, instance_id _instance) {
- for (auto i : clients_) {
- if (i->get_service() == _service &&
- i->get_instance() == _instance) {
- clients_.erase(i);
- break;
- }
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Service management
-///////////////////////////////////////////////////////////////////////////////
-service_proxy * group::find_service(service_id _service, instance_id _instance) {
- service_proxy *its_proxy = 0;
- for (auto i : services_) {
- if (_service == i->get_service() && _instance == i->get_instance()) {
- its_proxy = i.get();
- break;
- }
- }
- return its_proxy;
-}
-
-service_proxy * group::add_service(service_id _service, instance_id _instance) {
- service_proxy *its_proxy = find_service(_service, _instance);
- if (0 == its_proxy) {
- its_proxy = new service_proxy(this, _service, _instance);
- services_.insert(boost::shared_ptr< service_proxy >(its_proxy));
- }
- return its_proxy;
-}
-
-void group::remove_service(service_id _service, instance_id _instance) {
- for (auto i : services_) {
- if (i->get_service() == _service &&
- i->get_instance() == _instance) {
- services_.erase(i);
- break;
- }
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-///////////////////////////////////////////////////////////////////////////////
-void group::on_service_withdraw() {
-}
-
-void group::on_service_started() {
- is_service_started_ = true;
- machine_.process_event(ev_status_change());
-}
-
-void group::on_service_stopped() {
- is_service_started_ = false;
- for (auto a_service : services_)
- is_service_started_ = is_service_started_ || a_service->is_started();
-
- if (!is_started())
- machine_.process_event(ev_status_change());
-}
-
-void group::on_service_requested() {
- is_client_started_ = true;
- machine_.process_event(ev_status_change());
-}
-
-void group::on_service_released() {
- is_client_started_ = false;
- for (auto a_service : services_)
- is_client_started_ = is_client_started_ || a_service->is_started();
-
- if (!is_started())
- machine_.process_event(ev_status_change());
-}
-
-void group::on_eventgroup_provided() {
-}
-
-void group::on_eventgroup_withdrawn() {
-}
-
-void group::on_eventgroup_requested() {
-}
-
-void group::on_eventgroup_released() {
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Message handlers
-///////////////////////////////////////////////////////////////////////////////
-
-void group::on_find_service(service_id _service, instance_id _instance, const endpoint *_source, bool _is_unicast_enabled) {
- machine_.process_event(ev_find_service(_service, _instance, _source, _is_unicast_enabled));
-}
-
-void group::on_offer_service(service_id _service, instance_id _instance, const endpoint *_source,
- const endpoint *_reliable, const endpoint *_unreliable) {
- client_proxy *its_proxy = find_client(_service, _instance);
- if (0 != its_proxy) {
- factory *its_factory = factory::get_instance();
-
- boost::shared_ptr< message > its_message(its_factory->create_message());
- auto its_eventgroups = its_proxy->get_eventgroups();
- for (auto i : its_eventgroups) {
- if (!i.second->is_acknowledged()) {
- eventgroup_entry & its_entry = its_message->create_eventgroup_entry();
- its_entry.set_type(entry_type::SUBSCRIBE_EVENTGROUP);
- its_entry.set_service_id(_service);
- its_entry.set_instance_id(_instance);
- its_entry.set_eventgroup_id(i.first);
- its_entry.set_time_to_live(0xFFFFFF); // TODO: find out where to get this value!
-
- if (0 != _reliable) {
- option *its_option = add_endpoint_option(its_message.get(), _reliable);
- its_entry.assign_option(*its_option, 1);
- }
-
- if (0 != _unreliable) {
- option *its_option = add_endpoint_option(its_message.get(), _unreliable);
- its_entry.assign_option(*its_option, 1);
- }
- }
- }
-
- if (0 < its_message->get_entries().size())
- owner_->send(its_message.get());
- }
-}
-
-void group::on_subscribe_eventgroup(
- service_id _service, instance_id _instance, eventgroup_id _eventgroup,
- const endpoint *_source, const endpoint *_multicast,
- bool _stop) {
-
- factory *its_factory = factory::get_instance();
- boost::shared_ptr< message > its_message(its_factory->create_message());
- its_message->set_target(_source);
-
- eventgroup_entry &its_entry = its_message->create_eventgroup_entry();
- its_entry.set_type(entry_type::SUBSCRIBE_EVENTGROUP_ACK);
- its_entry.set_service_id(_service);
- its_entry.set_instance_id(_instance);
- its_entry.set_eventgroup_id(_eventgroup);
- its_entry.set_time_to_live((_stop ? 0 : 0xFFFFFF)); // TODO: get ttl from eventgroup
-
- if (_multicast) {
- if (ip_protocol_version::V4 == _multicast->get_version()) {
- option *its_option = add_endpoint_option(its_message.get(), _multicast);
- its_entry.assign_option(*its_option, 1);
- } else {
- // TODO: support IPv6
- }
- }
-
- owner_->send(its_message.get());
-}
-
-} // namespace sd
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip.sd/group_machine.cpp b/vsomeip/src/vsomeip.sd/group_machine.cpp
deleted file mode 100644
index 379dbe2..0000000
--- a/vsomeip/src/vsomeip.sd/group_machine.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// service_group_machine.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip_internal/configuration.hpp>
-#include <vsomeip_internal/daemon.hpp>
-#include <vsomeip_internal/sd/group.hpp>
-#include <vsomeip_internal/sd/group_machine.hpp>
-
-namespace vsomeip {
-namespace sd {
-namespace _group {
-
-machine::machine(group *_group)
- : group_(_group),
- timer_service(_group->get_service()) {
-};
-
-machine::~machine() {
-}
-
-bool machine::is_active() const {
- return (group_->is_network_configured() && group_->is_started());
-}
-
-void machine::send(service_id _service, instance_id _instance, const endpoint *_target, bool _is_announcing) {
- group_->send_services_status(_service, _instance, _target, _is_announcing);
-}
-
-void machine::timer_expired(const boost::system::error_code &_error) {
- if (!_error) {
- process_event(ev_timeout_expired());
- }
-}
-
-void machine::log(const std::string &_message) {
-#ifdef VSOMEIP_SD_LOG
- std::cout << "[" << group_->get_name() << "] " << _message << std::endl;
-#endif
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// State "Inactive"
-///////////////////////////////////////////////////////////////////////////////
-
-inactive::inactive(my_context _context)
- : sc::state< inactive, machine >(_context) {
- outermost_context().log("Inactive");
- outermost_context().run_ = 0;
-}
-
-sc::result inactive::react(const ev_none &_event) {
- return discard_event();
-}
-
-sc::result inactive::react(const ev_status_change &_event) {
- if (outermost_context().is_active())
- return transit< active >();
-
- return discard_event();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// State "Active"
-///////////////////////////////////////////////////////////////////////////////
-
-active::active(my_context _context)
- : sc::state< active, machine, initial >(_context) {
- outermost_context().log("Active");
-}
-
-active::~active() {
- outermost_context().stop_timer();
- outermost_context().send();
-}
-
-sc::result active::react(const ev_status_change &_event) {
- if (!outermost_context().is_active())
- return transit< inactive >();
-
- return discard_event();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// State "Active.Initial"
-///////////////////////////////////////////////////////////////////////////////
-
-initial::initial(my_context _context)
- : sc::state< initial, active >(_context) {
- outermost_context().log("Initial");
- outermost_context().start_timer(outermost_context().initial_delay_);
-}
-
-sc::result initial::react(const ev_timeout_expired &_event) {
- if (outermost_context().repetition_max_ > 0)
- return transit< repeat >();
-
- return transit< announce >();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// State "Active.Repeat"
-///////////////////////////////////////////////////////////////////////////////
-
-repeat::repeat(my_context _context)
- : sc::state< repeat, active >(_context) {
- outermost_context().log("Repeat");
- outermost_context().send();
- outermost_context().start_timer(outermost_context().repetition_base_delay_);
-}
-
-sc::result repeat::react(const ev_timeout_expired &_event) {
- if (outermost_context().run_ == outermost_context().repetition_max_)
- return transit< announce >();
-
- outermost_context().run_++;
- return transit< repeat >();
-}
-
-sc::result repeat::react(const ev_find_service &_event) {
- outermost_context().stop_timer();
- outermost_context().send();
- return transit< repeat >();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// State "Active.Announce"
-///////////////////////////////////////////////////////////////////////////////
-
-announce::announce(my_context _context)
- : sc::state< announce, active >(_context) {
- outermost_context().log("Announce");
- outermost_context().send(VSOMEIP_ANY_SERVICE, VSOMEIP_ANY_INSTANCE, 0, true);
- outermost_context().start_timer(outermost_context().cyclic_offer_delay_);
-}
-
-sc::result announce::react(const ev_timeout_expired &_event) {
- return transit< announce >();
-}
-
-sc::result announce::react(const ev_find_service &_event) {
- // SIP_SD_89, SIP_SD_90, SIP_SD_91
- if (_event.is_unicast_enabled_ &&
- outermost_context().expired_from_now() > outermost_context().cyclic_offer_delay_ / 2) {
- outermost_context().send(_event.service_, _event.instance_, _event.source_, true);
- } else {
- outermost_context().send(VSOMEIP_ANY_SERVICE, VSOMEIP_ANY_INSTANCE, 0, true);
- }
-
- outermost_context().stop_timer();
- return transit< announce >();
-}
-
-} // _service_group
-} // namespace sd
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.sd/ipv4_endpoint_option_impl.cpp b/vsomeip/src/vsomeip.sd/ipv4_endpoint_option_impl.cpp
deleted file mode 100644
index 733b046..0000000
--- a/vsomeip/src/vsomeip.sd/ipv4_endpoint_option_impl.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// ipv4_endpoint_option_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/ipv4_endpoint_option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-ipv4_endpoint_option_impl::ipv4_endpoint_option_impl() {
- length_ = (1 + 4 + 1 + 1 + 2);
- type_ = option_type::IP4_ENDPOINT;
- address_ = 0;
- port_ = 0;
- protocol_ = ip_protocol::UNKNOWN;
-}
-
-ipv4_endpoint_option_impl::~ipv4_endpoint_option_impl() {
-}
-
-bool ipv4_endpoint_option_impl::operator ==(const option &_other) const {
- if (_other.get_type() != option_type::IP4_ENDPOINT)
- return false;
-
- const ipv4_endpoint_option_impl& other =
- dynamic_cast< const ipv4_endpoint_option_impl & >(_other);
-
- return (address_ == other.address_ && port_ == other.port_
- && protocol_ == other.protocol_);
-}
-
-ipv4_address ipv4_endpoint_option_impl::get_address() const {
- return address_;
-}
-
-void ipv4_endpoint_option_impl::set_address(ipv4_address _address) {
- address_ = _address;
-}
-
-ip_port ipv4_endpoint_option_impl::get_port() const {
- return port_;
-}
-
-void ipv4_endpoint_option_impl::set_port(ip_port _port) {
- port_ = _port;
-}
-
-ip_protocol ipv4_endpoint_option_impl::get_protocol() const {
- return protocol_;
-}
-
-void ipv4_endpoint_option_impl::set_protocol(ip_protocol _protocol) {
- protocol_ = _protocol;
-}
-
-bool ipv4_endpoint_option_impl::serialize(vsomeip::serializer *_to) const {
- bool is_successful = option_impl::serialize(_to);
-
- is_successful = is_successful && _to->serialize(address_);
- is_successful = is_successful
- && _to->serialize(vsomeip_protocol_reserved_byte);
- is_successful = is_successful
- && _to->serialize(static_cast<uint8_t>(protocol_));
- is_successful = is_successful && _to->serialize(port_);
-
- return is_successful;
-}
-
-bool ipv4_endpoint_option_impl::deserialize(vsomeip::deserializer *_from) {
- bool is_successful = option_impl::deserialize(_from);
-
- is_successful = is_successful && _from->deserialize(address_);
-
- uint8_t reserved;
- is_successful = is_successful && _from->deserialize(reserved);
-
- uint8_t protocol = 0xFF;
- is_successful = is_successful && _from->deserialize(protocol);
- protocol_ = static_cast<ip_protocol>(protocol);
-
- is_successful = is_successful && _from->deserialize(port_);
-
- return is_successful;
-}
-
-} // namespace sd
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.sd/ipv4_multicast_option_impl.cpp b/vsomeip/src/vsomeip.sd/ipv4_multicast_option_impl.cpp
deleted file mode 100755
index 9706b7f..0000000
--- a/vsomeip/src/vsomeip.sd/ipv4_multicast_option_impl.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// ipv4_multicast_option_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/ipv4_multicast_option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-ipv4_multicast_option_impl::ipv4_multicast_option_impl() {
- length_ = (1 + 4 + 1 + 1 + 2);
- type_ = option_type::IP4_MULTICAST;
- address_ = 0;
- port_ = 0;
- protocol_ = ip_protocol::UDP;
-}
-
-ipv4_multicast_option_impl::~ipv4_multicast_option_impl() {
-}
-
-bool ipv4_multicast_option_impl::operator ==(const option &_other) const {
- if (_other.get_type() != option_type::IP4_MULTICAST)
- return false;
-
- const ipv4_multicast_option_impl& other =
- dynamic_cast< const ipv4_multicast_option_impl & >(_other);
-
- return (address_ == other.address_ && port_ == other.port_
- && protocol_ == other.protocol_);
-}
-
-void ipv4_multicast_option_impl::set_protocol(ip_protocol _protocol) {
- // intentionally left empty
-}
-
-} // namespace sd
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.sd/ipv6_endpoint_option_impl.cpp b/vsomeip/src/vsomeip.sd/ipv6_endpoint_option_impl.cpp
deleted file mode 100755
index 387d099..0000000
--- a/vsomeip/src/vsomeip.sd/ipv6_endpoint_option_impl.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// ipv6_endpoint_option_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#include <cstring>
-
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/ipv6_endpoint_option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-ipv6_endpoint_option_impl::ipv6_endpoint_option_impl() {
- length_ = (1 + 16 + 1 + 1 + 2);
- type_ = option_type::IP6_ENDPOINT;
- memset(address_, 0, sizeof(address_));
- port_ = 0;
- protocol_ = ip_protocol::UNKNOWN;
-}
-
-ipv6_endpoint_option_impl::~ipv6_endpoint_option_impl() {
-}
-
-bool ipv6_endpoint_option_impl::operator ==(const option &_other) const {
- if (_other.get_type() != option_type::IP6_ENDPOINT)
- return false;
-
- const ipv6_endpoint_option_impl& other
- = dynamic_cast< const ipv6_endpoint_option_impl & >(_other);
-
- return (address_ == other.address_
- && port_ == other.port_
- && protocol_ == other.protocol_);
-}
-
-const ipv6_address& ipv6_endpoint_option_impl::get_address() const {
- return address_;
-}
-
-void ipv6_endpoint_option_impl::set_address(const ipv6_address &_address) {
- memcpy(address_, _address, sizeof(_address));
-}
-
-ip_port ipv6_endpoint_option_impl::get_port() const {
- return port_;
-}
-
-void ipv6_endpoint_option_impl::set_port(ip_port _port) {
- port_ = _port;
-}
-
-ip_protocol ipv6_endpoint_option_impl::get_protocol() const {
- return protocol_;
-}
-
-void ipv6_endpoint_option_impl::set_protocol(ip_protocol _protocol) {
- protocol_ = _protocol;
-}
-
-bool ipv6_endpoint_option_impl::serialize(vsomeip::serializer *_to) const {
- bool is_successful = option_impl::serialize(_to);
-
- is_successful = is_successful && _to->serialize(address_, sizeof(address_));
- is_successful = is_successful && _to->serialize(vsomeip_protocol_reserved_byte);
- is_successful = is_successful && _to->serialize(static_cast<uint8_t>(protocol_));
- is_successful = is_successful && _to->serialize(port_);
-
- return is_successful;
-}
-
-bool ipv6_endpoint_option_impl::deserialize(vsomeip::deserializer *_from) {
- bool is_successful = option_impl::deserialize(_from);
-
- is_successful = is_successful && _from->deserialize(address_, sizeof(address_));
-
- uint8_t reserved;
- is_successful = is_successful && _from->deserialize(reserved);
-
- uint8_t protocol = 0xFF;
- is_successful = is_successful && _from->deserialize(protocol);
- protocol_ = static_cast<ip_protocol>(protocol);
-
- is_successful = is_successful && _from->deserialize(port_);
-
- return is_successful;
-}
-
-} // namespace sd
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip.sd/ipv6_multicast_option_impl.cpp b/vsomeip/src/vsomeip.sd/ipv6_multicast_option_impl.cpp
deleted file mode 100644
index 5135f9d..0000000
--- a/vsomeip/src/vsomeip.sd/ipv6_multicast_option_impl.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// ipv6_multicast_option_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#include <cstring>
-
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/ipv6_multicast_option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-ipv6_multicast_option_impl::ipv6_multicast_option_impl() {
- length_ = (1 + 16 + 1 + 1 + 2);
- type_ = option_type::IP6_MULTICAST;
- memset(address_, 0, sizeof(address_));
- port_ = 0;
- protocol_ = ip_protocol::UDP;
-}
-
-ipv6_multicast_option_impl::~ipv6_multicast_option_impl() {
-}
-
-bool ipv6_multicast_option_impl::operator ==(const option &_other) const {
- if (_other.get_type() != option_type::IP6_MULTICAST)
- return false;
-
- const ipv6_multicast_option_impl& other
- = dynamic_cast< const ipv6_multicast_option_impl & >(_other);
-
- return (address_ == other.address_
- && port_ == other.port_
- && protocol_ == other.protocol_);
-}
-
-void ipv6_multicast_option_impl::set_protocol(ip_protocol _protocol) {
- // intentionally left empty
-}
-
-} // namespace sd
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip.sd/load_balancing_option_impl.cpp b/vsomeip/src/vsomeip.sd/load_balancing_option_impl.cpp
deleted file mode 100755
index 0d28a46..0000000
--- a/vsomeip/src/vsomeip.sd/load_balancing_option_impl.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// load_balancing_option.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/load_balancing_option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-load_balancing_option_impl::load_balancing_option_impl() {
- length_ = 1 + 2 + 2;
- type_ = option_type::LOAD_BALANCING;
- priority_ = 0;
- weight_ = 0;
-}
-
-load_balancing_option_impl::~load_balancing_option_impl() {
-}
-
-bool load_balancing_option_impl::operator ==(const option &_other) const {
- if (_other.get_type() != option_type::LOAD_BALANCING)
- return false;
-
- const load_balancing_option_impl& other
- = dynamic_cast< const load_balancing_option_impl & >(_other);
-
- return (priority_ == other.priority_
- && weight_ == other.weight_);
-}
-
-priority load_balancing_option_impl::get_priority() const {
- return priority_;
-}
-
-void load_balancing_option_impl::set_priority(priority _priority) {
- priority_ = _priority;
-}
-
-weight load_balancing_option_impl::get_weight() const {
- return weight_;
-}
-
-void load_balancing_option_impl::set_weight(weight _weight) {
- weight_ = _weight;
-}
-
-bool load_balancing_option_impl::serialize(vsomeip::serializer *_to) const {
- bool is_successful = option_impl::serialize(_to);
- is_successful = is_successful && _to->serialize(static_cast<uint16_t>(priority_));
- is_successful = is_successful && _to->serialize(static_cast<uint16_t>(weight_));
- return is_successful;
-}
-
-bool load_balancing_option_impl::deserialize(vsomeip::deserializer *_from) {
- bool is_successful = option_impl::deserialize(_from);
-
- uint16_t tmp_priority = 0;
- is_successful = is_successful && _from->deserialize(tmp_priority);
- priority_ = static_cast<priority>(tmp_priority);
-
- uint16_t tmp_weight = 0;
- is_successful = is_successful && _from->deserialize(tmp_weight);
- weight_ = static_cast<weight>(tmp_weight);
-
- return is_successful;
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/message_element_impl.cpp b/vsomeip/src/vsomeip.sd/message_element_impl.cpp
deleted file mode 100755
index ed207d8..0000000
--- a/vsomeip/src/vsomeip.sd/message_element_impl.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// message_element_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/sd/message_element_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-message_element_impl::message_element_impl() {
- owner_ = 0;
-}
-
-message_impl * message_element_impl::get_owning_message() const {
- return owner_;
-}
-
-void message_element_impl::set_owning_message(message_impl *_owner) {
- owner_ = _owner;
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/message_impl.cpp b/vsomeip/src/vsomeip.sd/message_impl.cpp
deleted file mode 100755
index 5e33d31..0000000
--- a/vsomeip/src/vsomeip.sd/message_impl.cpp
+++ /dev/null
@@ -1,345 +0,0 @@
-//
-// message_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/eventgroup_entry_impl.hpp>
-#include <vsomeip_internal/sd/service_entry_impl.hpp>
-#include <vsomeip_internal/sd/configuration_option_impl.hpp>
-#include <vsomeip_internal/sd/ipv4_endpoint_option_impl.hpp>
-#include <vsomeip_internal/sd/ipv4_multicast_option_impl.hpp>
-#include <vsomeip_internal/sd/ipv6_endpoint_option_impl.hpp>
-#include <vsomeip_internal/sd/ipv6_multicast_option_impl.hpp>
-#include <vsomeip_internal/sd/load_balancing_option_impl.hpp>
-#include <vsomeip_internal/sd/protection_option_impl.hpp>
-#include <vsomeip_internal/sd/message_impl.hpp>
-
-#include <iostream>
-#include <typeinfo>
-
-namespace vsomeip {
-namespace sd {
-
-message_impl::message_impl() {
- header_.service_id_ = 0xFFFF;
- header_.method_id_ = 0x8100;
- header_.protocol_version_ = 0x01;
- flags_ = 0x00;
-}
-
-message_impl::~message_impl() {
-}
-
-length message_impl::get_length() const {
- length current_length = VSOMEIP_STATIC_HEADER_SIZE
- + VSOMEIP_STATIC_SERVICE_DISCOVERY_DATA_LENGTH;
-
- current_length += (entries_.size() * VSOMEIP_ENTRY_LENGTH);
-
- for (size_t i = 0; i < options_.size(); ++i)
- current_length += (options_[i]->get_length()
- + VSOMEIP_OPTION_HEADER_LENGTH);
-
- return current_length;
-}
-
-#define VSOMEIP_REBOOT_FLAG 0x80
-
-bool message_impl::get_reboot_flag() const {
- return ((flags_ & VSOMEIP_REBOOT_FLAG) != 0);
-}
-
-void message_impl::set_reboot_flag(bool _is_set) {
- if (_is_set)
- flags_ |= VSOMEIP_REBOOT_FLAG;
- else
- flags_ &= ~VSOMEIP_REBOOT_FLAG;
-}
-
-#define VSOMEIP_UNICAST_FLAG 0x40
-
-bool message_impl::get_unicast_flag() const {
- return ((flags_ & VSOMEIP_UNICAST_FLAG) != 0);
-}
-
-void message_impl::set_unicast_flag(bool _is_set) {
- if (_is_set)
- flags_ |= VSOMEIP_UNICAST_FLAG;
- else
- flags_ &= ~VSOMEIP_UNICAST_FLAG;
-}
-
-void message_impl::set_length(length _length) {
-}
-
-eventgroup_entry& message_impl::create_eventgroup_entry() {
- eventgroup_entry_impl *tmp_entry = new eventgroup_entry_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_entry->set_owning_message(this);
- entries_.push_back(tmp_entry);
- return *tmp_entry;
-}
-
-service_entry& message_impl::create_service_entry() {
- service_entry_impl *tmp_entry = new service_entry_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_entry->set_owning_message(this);
- entries_.push_back(tmp_entry);
- return *tmp_entry;
-}
-
-configuration_option& message_impl::create_configuration_option() {
- configuration_option_impl *tmp_option = new configuration_option_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_option->set_owning_message(this);
- options_.push_back(tmp_option);
- return *tmp_option;
-}
-
-ipv4_endpoint_option& message_impl::create_ipv4_endpoint_option() {
- ipv4_endpoint_option_impl *tmp_option = new ipv4_endpoint_option_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_option->set_owning_message(this);
- options_.push_back(tmp_option);
- return *tmp_option;
-}
-
-ipv4_multicast_option& message_impl::create_ipv4_multicast_option() {
- ipv4_multicast_option_impl *tmp_option = new ipv4_multicast_option_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_option->set_owning_message(this);
- options_.push_back(tmp_option);
- return *tmp_option;
-}
-
-ipv6_endpoint_option& message_impl::create_ipv6_endpoint_option() {
- ipv6_endpoint_option_impl *tmp_option = new ipv6_endpoint_option_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_option->set_owning_message(this);
- options_.push_back(tmp_option);
- return *tmp_option;
-}
-
-ipv6_multicast_option& message_impl::create_ipv6_multicast_option() {
- ipv6_multicast_option_impl *tmp_option = new ipv6_multicast_option_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_option->set_owning_message(this);
- options_.push_back(tmp_option);
- return *tmp_option;
-}
-
-load_balancing_option& message_impl::create_load_balancing_option() {
- load_balancing_option_impl *tmp_option = new load_balancing_option_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_option->set_owning_message(this);
- options_.push_back(tmp_option);
- return *tmp_option;
-}
-
-protection_option& message_impl::create_protection_option() {
- protection_option_impl *tmp_option = new protection_option_impl;
- //TODO: throw OutOfMemoryException if allocation fails
- tmp_option->set_owning_message(this);
- options_.push_back(tmp_option);
- return *tmp_option;
-}
-
-const std::vector<entry *> message_impl::get_entries() const {
- return entries_;
-}
-
-const std::vector<option *> message_impl::get_options() const {
- return options_;
-}
-
-// TODO: throw exception to signal "OptionNotFound"
-int16_t message_impl::get_option_index(const option &_option) const {
- int16_t i = 0;
-
- while (i < options_.size()) {
- if (*(options_[i]) == _option)
- return i;
- i++;
- }
-
- return -1;
-}
-
-bool message_impl::serialize(vsomeip::serializer *_to) const {
- bool is_successful = header_.serialize(_to);
-
- is_successful = is_successful && _to->serialize(flags_);
- is_successful = is_successful
- && _to->serialize(vsomeip_protocol_reserved_long, true);
-
- uint32_t entries_length = (entries_.size() * VSOMEIP_ENTRY_LENGTH);
- is_successful = is_successful && _to->serialize(entries_length);
-
- for (auto it = entries_.begin(); it != entries_.end(); ++it)
- is_successful = is_successful && (*it)->serialize(_to);
-
- uint32_t options_length = 0;
- for (size_t i = 0; i < options_.size(); ++i)
- options_length += (options_[i]->get_length()
- + VSOMEIP_OPTION_HEADER_LENGTH);
- is_successful = is_successful && _to->serialize(options_length);
-
- for (auto it = options_.begin(); it != options_.end(); ++it)
- is_successful = is_successful && (*it)->serialize(_to);
-
- return is_successful;
-}
-
-bool message_impl::deserialize(vsomeip::deserializer *_from) {
- bool is_successful;
-
- // header
- is_successful = header_.deserialize(_from);
-
- // flags
- is_successful = is_successful && _from->deserialize(flags_);
-
- // reserved
- uint32_t reserved;
- is_successful = is_successful && _from->deserialize(reserved, true);
-
- // entries
- uint32_t entries_length = 0;
- is_successful = is_successful && _from->deserialize(entries_length);
-
- // backup the current remaining length
- uint32_t save_remaining = _from->get_remaining();
-
- // set remaining bytes to length of entries array
- _from->set_remaining(entries_length);
-
- // deserialize the entries
- while (is_successful && _from->get_remaining()) {
- entry* tmp_entry = deserialize_entry(_from);
- if (tmp_entry) {
- entries_.push_back(tmp_entry);
- } else {
- is_successful = false;
- }
- }
-
- // set length to remaining bytes after entries array
- _from->set_remaining(save_remaining - entries_length);
-
- // deserialize the options
- uint32_t options_length = 0;
- is_successful = is_successful && _from->deserialize(options_length);
-
- while (is_successful && _from->get_remaining()) {
- option *tmp_option = deserialize_option(_from);
- if (tmp_option) {
- options_.push_back(tmp_option);
- } else {
- is_successful = false;
- }
- }
-
- return is_successful;
-}
-
-entry * message_impl::deserialize_entry(vsomeip::deserializer *_from) {
- entry *deserialized_entry = 0;
- uint8_t tmp_entry_type;
-
- if (_from->look_ahead(0, tmp_entry_type)) {
- entry_type deserialized_entry_type =
- static_cast<entry_type>(tmp_entry_type);
-
- switch (deserialized_entry_type) {
- case entry_type::FIND_SERVICE:
- case entry_type::OFFER_SERVICE:
- //case entry_type::STOP_OFFER_SERVICE:
- case entry_type::REQUEST_SERVICE:
- deserialized_entry = new service_entry_impl;
- break;
-
- case entry_type::FIND_EVENT_GROUP:
- case entry_type::PUBLISH_EVENTGROUP:
- //case entry_type::STOP_PUBLISH_EVENTGROUP:
- case entry_type::SUBSCRIBE_EVENTGROUP:
- //case entry_type::STOP_SUBSCRIBE_EVENTGROUP:
- case entry_type::SUBSCRIBE_EVENTGROUP_ACK:
- //case entry_type::STOP_SUBSCRIBE_EVENTGROUP_ACK:
- deserialized_entry = new eventgroup_entry_impl;
- break;
-
- default:
- break;
- };
-
- // deserialize object
- if (0 != deserialized_entry) {
- if (!deserialized_entry->deserialize(_from)) {
- delete deserialized_entry;
- deserialized_entry = 0;
- };
- }
- }
-
- return deserialized_entry;
-}
-
-option * message_impl::deserialize_option(vsomeip::deserializer *_from) {
- option *deserialized_option = 0;
- uint8_t tmp_option_type;
-
- if (_from->look_ahead(2, tmp_option_type)) {
-
- option_type deserialized_option_type =
- static_cast<option_type>(tmp_option_type);
-
- switch (deserialized_option_type) {
-
- case option_type::CONFIGURATION:
- deserialized_option = new configuration_option_impl;
- break;
- case option_type::LOAD_BALANCING:
- deserialized_option = new load_balancing_option_impl;
- break;
- case option_type::PROTECTION:
- deserialized_option = new protection_option_impl;
- break;
- case option_type::IP4_ENDPOINT:
- deserialized_option = new ipv4_endpoint_option_impl;
- break;
- case option_type::IP4_MULTICAST:
- deserialized_option = new ipv4_multicast_option_impl;
- break;
- case option_type::IP6_ENDPOINT:
- deserialized_option = new ipv6_endpoint_option_impl;
- break;
- case option_type::IP6_MULTICAST:
- deserialized_option = new ipv6_multicast_option_impl;
- break;
-
- default:
- break;
- };
-
- // deserialize object
- if (0 != deserialized_option
- && !deserialized_option->deserialize(_from)) {
- delete deserialized_option;
- deserialized_option = 0;
- };
- }
-
- return deserialized_option;
-}
-
-} // namespace sd
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.sd/option_impl.cpp b/vsomeip/src/vsomeip.sd/option_impl.cpp
deleted file mode 100755
index ffff0bc..0000000
--- a/vsomeip/src/vsomeip.sd/option_impl.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// option_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-option_impl::option_impl() {
- length_ = 0;
- type_ = option_type::UNKNOWN;
-}
-
-option_impl::~option_impl() {
-}
-
-uint16_t option_impl::get_length() const {
- return length_;
-}
-
-option_type option_impl::get_type() const {
- return type_;
-}
-
-bool option_impl::serialize(vsomeip::serializer *_to) const {
- return (0 != _to
- && _to->serialize(length_)
- && _to->serialize(static_cast<uint8_t>(type_))
- && _to->serialize(vsomeip_protocol_reserved_byte));
-}
-
-bool option_impl::deserialize(vsomeip::deserializer *_from) {
- uint8_t tmp_type, reserved;
- bool l_result = (0 != _from
- && _from->deserialize(length_)
- && _from->deserialize(tmp_type)
- && _from->deserialize(reserved));
-
- if (l_result) {
- type_ = static_cast<option_type>(tmp_type);
- }
-
- return l_result;
-}
-
-} // namespace sd
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.sd/protection_option_impl.cpp b/vsomeip/src/vsomeip.sd/protection_option_impl.cpp
deleted file mode 100755
index 2c8868b..0000000
--- a/vsomeip/src/vsomeip.sd/protection_option_impl.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// protection_option_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/protection_option_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-protection_option_impl::protection_option_impl() {
- length_ = 1 + 4 + 4;
- type_ = option_type::PROTECTION;
- counter_ = 0;
- crc_ = 0;
-}
-
-protection_option_impl::~protection_option_impl() {
-}
-
-bool protection_option_impl::operator ==(const option &_other) const {
- if (_other.get_type() != option_type::PROTECTION)
- return false;
-
- const protection_option_impl& other
- = dynamic_cast< const protection_option_impl & >(_other);
-
- return (counter_ == other.counter_
- && crc_ == other.crc_);
-}
-
-alive_counter protection_option_impl::get_alive_counter() const {
- return counter_;
-}
-
-void protection_option_impl::set_alive_counter(alive_counter _counter) {
- counter_ = _counter;
-}
-
-crc protection_option_impl::get_crc() const {
- return crc_;
-}
-
-void protection_option_impl::set_crc(crc _crc) {
- crc_ = _crc;
-}
-
-bool protection_option_impl::serialize(vsomeip::serializer *_to) const {
- bool is_successful = option_impl::serialize(_to);
- is_successful = is_successful && _to->serialize(static_cast<uint32_t>(counter_));
- is_successful = is_successful && _to->serialize(static_cast<uint32_t>(crc_));
- return is_successful;
-}
-
-bool protection_option_impl::deserialize(vsomeip::deserializer *_from) {
- bool is_successful = option_impl::deserialize(_from);
-
- uint32_t tmp_alive_counter = 0;
- is_successful = is_successful && _from->deserialize(tmp_alive_counter);
- counter_ = static_cast<alive_counter>(tmp_alive_counter);
-
- uint32_t tmp_crc = 0;
- is_successful = is_successful && _from->deserialize(tmp_crc);
- crc_ = static_cast<crc>(tmp_crc);
-
- return is_successful;
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/service_discovery_impl.cpp b/vsomeip/src/vsomeip.sd/service_discovery_impl.cpp
deleted file mode 100644
index 8bca934..0000000
--- a/vsomeip/src/vsomeip.sd/service_discovery_impl.cpp
+++ /dev/null
@@ -1,551 +0,0 @@
-//
-// service_manager_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������������������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iomanip>
-#include <sstream>
-
-#include <boost/asio/ip/address.hpp>
-#include <boost/asio/ip/address_v4.hpp>
-#include <boost/asio/ip/address_v6.hpp>
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/factory.hpp>
-#include <vsomeip/sd/eventgroup_entry.hpp>
-#include <vsomeip/sd/factory.hpp>
-#include <vsomeip/sd/ipv4_endpoint_option.hpp>
-#include <vsomeip/sd/ipv4_multicast_option.hpp>
-#include <vsomeip/sd/ipv6_endpoint_option.hpp>
-#include <vsomeip/sd/ipv6_multicast_option.hpp>
-#include <vsomeip/sd/message.hpp>
-#include <vsomeip/sd/service_entry.hpp>
-#include <vsomeip_internal/byteorder.hpp>
-#include <vsomeip_internal/configuration.hpp>
-#include <vsomeip_internal/daemon.hpp>
-#include <vsomeip_internal/service.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/sd/client_proxy.hpp>
-#include <vsomeip_internal/sd/constants.hpp>
-#include <vsomeip_internal/sd/deserializer.hpp>
-#include <vsomeip_internal/sd/group.hpp>
-#include <vsomeip_internal/sd/service_discovery_impl.hpp>
-#include <vsomeip_internal/sd/service_proxy.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-service_discovery_impl::service_discovery_impl(daemon &_owner)
- : owner_(_owner),
- service_(_owner.get_service()),
- logger_(_owner.get_logger()),
- factory_(factory::get_instance()),
- session_(1),
- broadcast_(0),
- multicast_(0),
- deserializer_(new deserializer),
- default_group_(new group("default", this)) {
-
- groups_.insert(default_group_);
-}
-
-service_discovery_impl::~service_discovery_impl() {
-}
-
-void service_discovery_impl::init() {
- configuration *its_configuration
- = configuration::request(owner_.get_name());
-
- // Calculate the network name based on unicast address and netmask
- std::string address = its_configuration->get_unicast_address();
- std::string netmask = its_configuration->get_netmask();
- uint16_t port = its_configuration->get_port();
- std::string protocol = its_configuration->get_protocol();
-
- std::string broadcast_address = get_broadcast_address(address, netmask);
-
- vsomeip::factory *base_factory = vsomeip::factory::get_instance();
-
- broadcast_ = base_factory->get_endpoint(
- broadcast_address,
- port,
- (protocol == "tcp" ? ip_protocol::TCP : ip_protocol::UDP)
- );
-
- std::string multicast_address = its_configuration->get_multicast_address();
- if (multicast_address != "") {
- multicast_ = base_factory->get_endpoint(
- multicast_address,
- port,
- (protocol == "tcp" ? ip_protocol::TCP : ip_protocol::UDP)
- );
- }
-
- for (auto a_group : groups_)
- a_group->init();
-}
-
-void service_discovery_impl::start() {
- for (auto a_group : groups_)
- a_group->start();
-}
-
-void service_discovery_impl::stop() {
-}
-
-boost::asio::io_service & service_discovery_impl::get_service() {
- return service_;
-}
-
-std::string service_discovery_impl::get_broadcast_address(
- const std::string &_address, const std::string &_mask) const {
- std::string result(_address); // Default to host address
-
- boost::asio::ip::address its_address
- = boost::asio::ip::address::from_string(_address);
- if (its_address.is_v4()) {
- std::string its_mask;
-
- if (_mask[0] == '/') { // CIDR notation
- std::stringstream converter;
- converter << _mask.substr(1);
-
- uint32_t set_bits;
- converter >> set_bits;
-
- if (set_bits < 32) {
- uint32_t unset_bits(31 - set_bits);
-
- uint32_t its_binary_mask = 0x0;
- while (set_bits) {
- its_binary_mask |= (0x1 << (set_bits + unset_bits));
- set_bits--;
- }
-
- converter.clear();
- converter.str("");
- converter << std::dec
- << VSOMEIP_LONG_BYTE3(its_binary_mask)
- << "."
- << VSOMEIP_LONG_BYTE2(its_binary_mask)
- << "."
- << VSOMEIP_LONG_BYTE1(its_binary_mask)
- << "."
- << VSOMEIP_LONG_BYTE0(its_binary_mask);
-
- its_mask = converter.str();
- } else {
- // TODO: error message "Illegal netmask definition"
- }
- } else {
- its_mask = _mask;
- }
-
- boost::asio::ip::address_v4 its_v4_address = its_address.to_v4();
- boost::asio::ip::address_v4 its_v4_netmask;
- try {
- its_v4_netmask = boost::asio::ip::address_v4::from_string(its_mask);
- }
- catch (...) {
- its_v4_netmask = boost::asio::ip::address_v4::from_string(
- VSOMEIP_SERVICE_DISCOVERY_DEFAULT_NETMASK);
- }
- result = boost::asio::ip::address_v4::broadcast(its_v4_address, its_v4_netmask).to_string();
- } else {
- // TODO: handle IPv6 subnets
- }
-
- return result;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Helper
-///////////////////////////////////////////////////////////////////////////////
-client_proxy * service_discovery_impl::find_client(service_id _service, instance_id _instance) const {
- client_proxy *its_proxy = 0;
-
- for (auto i : groups_) {
- its_proxy = i->find_client(_service, _instance);
- if (0 != its_proxy)
- break;
- }
-
- return its_proxy;
-}
-
-client_proxy * service_discovery_impl::find_or_create_client(service_id _service, instance_id _instance) {
- client_proxy *its_proxy = find_client(_service, _instance);
- if (0 == its_proxy) {
- its_proxy = default_group_->add_client(_service, _instance);
- }
- return its_proxy;
-}
-
-service_proxy * service_discovery_impl::find_service(service_id _service, instance_id _instance) const {
- service_proxy *its_proxy = 0;
-
- for (auto i : groups_) {
- its_proxy = i->find_service(_service, _instance);
- if (0 != its_proxy)
- break;
- }
-
- return its_proxy;
-}
-
-service_proxy * service_discovery_impl::find_or_create_service(service_id _service, instance_id _instance) {
- service_proxy *its_proxy = find_service(_service, _instance);
- if (0 == its_proxy) {
- its_proxy = default_group_->add_service(_service, _instance);
- }
- return its_proxy;
-}
-
-group * service_discovery_impl::find_client_group(service_id _service, instance_id _instance) const {
- group *its_group = 0;
-
- for (auto i : groups_) {
- auto its_proxy = i->find_client(_service, _instance);
- if (0 != its_proxy) {
- its_group = i.get();
- break;
- }
- }
- return its_group;
-}
-
-group * service_discovery_impl::find_service_group(service_id _service, instance_id _instance) const {
- group *its_group = 0;
-
- for (auto i : groups_) {
- auto its_proxy = i->find_service(_service, _instance);
- if (0 != its_proxy) {
- its_group = i.get();
- break;
- }
- }
- return its_group;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Application interface
-///////////////////////////////////////////////////////////////////////////////
-void service_discovery_impl::on_provide_service(
- service_id _service, instance_id _instance, const endpoint *_location) {
- service_proxy *its_proxy = find_or_create_service(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->provide(_location);
- } else {
- VSOMEIP_ERROR << "Could not provide service ["
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << "." << _instance
- << "]. Creation of service proxy failed!";
- }
-}
-
-void service_discovery_impl::on_withdraw_service(
- service_id _service, instance_id _instance, const endpoint *_location) {
- service_proxy *its_proxy = find_service(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->withdraw(_location);
- } else {
- VSOMEIP_WARNING << "Could not withdraw service ["
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << "." << _instance
- << "]. Service proxy does not exist!";
- }
-}
-
-void service_discovery_impl::on_start_service(
- service_id _service, instance_id _instance) {
- service_proxy *its_proxy = find_service(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->start();
- }
-}
-
-void service_discovery_impl::on_stop_service(
- service_id _service, instance_id _instance) {
- service_proxy *its_proxy = find_service(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->stop();
- }
-}
-
-void service_discovery_impl::on_request_service(
- client_id _client, service_id _service, instance_id _instance) {
- client_proxy *its_proxy = find_or_create_client(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->request(_client);
- }
-}
-
-void service_discovery_impl::on_release_service(
- client_id _client, service_id _service, instance_id _instance) {
- client_proxy *its_proxy = find_client(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->release(_client);
- }
-}
-
-void service_discovery_impl::on_provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) {
- service_proxy *its_proxy = find_service(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->provide_eventgroup(_eventgroup, _location);
- }
-}
-
-void service_discovery_impl::on_withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) {
- service_proxy *its_proxy = find_service(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->withdraw_eventgroup(_eventgroup);
- }
-}
-
-void service_discovery_impl::on_request_eventgroup(client_id _client, service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- client_proxy *its_proxy = find_or_create_client(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->subscribe(_client, _eventgroup);
- }
-}
-
-void service_discovery_impl::on_release_eventgroup(client_id _client, service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- client_proxy *its_proxy = find_or_create_client(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->unsubscribe(_client, _eventgroup);
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Interface functions
-///////////////////////////////////////////////////////////////////////////////
-void service_discovery_impl::on_service_available(
- service_id _service, instance_id _instance, const endpoint *_reliable, const endpoint *_unreliable) {
- client_proxy *its_proxy = find_client(_service, _instance);
- if (0 != its_proxy) {
- its_proxy->set_local(_reliable, _unreliable);
- }
-}
-
-bool service_discovery_impl::send(message *_message) {
- // Enable Unicast
- _message->set_unicast_flag(true);
-
- // Session
- session_id old_session = session_;
- session_++;
-
- if (old_session > session_) {
- session_ = 1;
- _message->set_reboot_flag(false);
- }
-
- _message->set_session_id(session_);
-
- // Target address
- const endpoint *target = _message->get_target();
- if (0 == target) {
- if (0 != multicast_) {
- _message->set_target(multicast_);
- } else {
- _message->set_target(broadcast_);
- }
- }
-
- bool is_reliable = (ip_protocol::TCP == _message->get_target()->get_protocol());
- return owner_.send(_message, is_reliable, true);
-}
-
-void service_discovery_impl::on_message(
- const uint8_t *_data, uint32_t _size,
- const endpoint *_source, const endpoint *_target) {
-
-#if 0
- std::cout << "SD: ";
- for (uint32_t i = 0; i < _size; ++i)
- std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)_data[i] << " ";
- std::cout << std::endl;
-#endif
-
- deserializer_->set_data(_data, _size);
- boost::shared_ptr< message > its_message(deserializer_->deserialize_sd_message());
-
- if (its_message) {
- const std::vector< entry * > its_entries = its_message->get_entries();
- const std::vector< option * > its_options = its_message->get_options();
- bool is_unicast_enabled = its_message->get_unicast_flag();
-
- for (auto its_entry : its_entries) {
- switch (its_entry->get_type()) {
- case entry_type::FIND_SERVICE:
- on_find_service(dynamic_cast< service_entry * >(its_entry), its_options, _source, is_unicast_enabled);
- break;
-
- case entry_type::OFFER_SERVICE: // includes STOP_OFFER_SERVICE
- on_offer_service(dynamic_cast< service_entry * >(its_entry), its_options, _source);
- break;
-
- case entry_type::REQUEST_SERVICE:
- //on_request_service(_source, dynamic_cast< service_entry * >(its_entry), its_option);
- break;
-
- case entry_type::SUBSCRIBE_EVENTGROUP: // includes STOP_SUBSCRIBE_EVENTGROUP
- on_subscribe_eventgroup(dynamic_cast< eventgroup_entry * >(its_entry), its_options, _source);
- break;
-
- case entry_type::SUBSCRIBE_EVENTGROUP_ACK: // includes STOP_SUBSCRIBE_EVENTGROUP_ACK
- on_subscribe_eventgroup_ack(dynamic_cast< eventgroup_entry * >(its_entry), its_options);
- break;
-
- default:
- break;
- };
- }
- } else {
- VSOMEIP_ERROR << "[SD] Deserialization failed. Message discarded!";
- }
-}
-
-void service_discovery_impl::on_find_service(
- const service_entry *_entry, const std::vector< option * > &_options,
- const endpoint *_source, bool _is_unicast_enabled) {
-
- service_id its_service = _entry->get_service_id();
- instance_id its_instance = _entry->get_instance_id();
-
- group *its_group = find_service_group(its_service, its_instance);
- if (0 != its_group) {
- its_group->on_find_service(its_service, its_instance, _source, _is_unicast_enabled);
- }
-}
-
-void service_discovery_impl::on_offer_service(
- const service_entry *_entry, const std::vector< option * > &_options,
- const endpoint *_source) {
-
- service_id its_service = _entry->get_service_id();
- instance_id its_instance = _entry->get_instance_id();
-
- const endpoint *its_tcp = 0;
- const endpoint *its_udp = 0;
-
- client_proxy *its_proxy = find_or_create_client(its_service, its_instance);
- if (0 != its_proxy) {
- const std::vector< uint8_t > &its_options = _entry->get_options(1);
- for (auto i : its_options) {
- if (option_type::IP4_ENDPOINT == _options[i]->get_type()) {
- ipv4_endpoint_option *its_endpoint_option = dynamic_cast< ipv4_endpoint_option * >(_options[i]);
- if (ip_protocol::TCP == its_endpoint_option->get_protocol()) {
- its_tcp = vsomeip::factory::get_instance()->get_endpoint(
- boost::asio::ip::address_v4(its_endpoint_option->get_address()).to_string(),
- its_endpoint_option->get_port(),
- ip_protocol::TCP
- );
- } else {
- its_udp = vsomeip::factory::get_instance()->get_endpoint(
- boost::asio::ip::address_v4(its_endpoint_option->get_address()).to_string(),
- its_endpoint_option->get_port(),
- ip_protocol::UDP
- );
- }
- } else {
- // TODO: support IPv6
- }
- }
-
- its_proxy->set_available(its_tcp, its_udp, (_entry->get_time_to_live() > 0));
- }
-}
-
-void service_discovery_impl::on_subscribe_eventgroup(
- const eventgroup_entry *_entry, const std::vector< option * > &_options,
- const endpoint *_source) {
- service_id its_service = _entry->get_service_id();
- instance_id its_instance = _entry->get_instance_id();
- eventgroup_id its_eventgroup = _entry->get_eventgroup_id();
-
- const endpoint *its_reliable = 0;
- const endpoint *its_unreliable = 0;
-
- service_proxy *its_proxy = find_or_create_service(its_service, its_instance);
- if (0 != its_proxy) {
- const std::vector< uint8_t > &its_options = _entry->get_options(1);
- for (auto i : its_options) {
- if (option_type::IP4_ENDPOINT == _options[i]->get_type()) {
- ipv4_endpoint_option *its_endpoint_option = dynamic_cast< ipv4_endpoint_option * >(_options[i]);
- if (ip_protocol::TCP == its_endpoint_option->get_protocol()) {
- its_reliable = vsomeip::factory::get_instance()->get_endpoint(
- boost::asio::ip::address_v4(its_endpoint_option->get_address()).to_string(),
- its_endpoint_option->get_port(),
- ip_protocol::TCP
- );
- } else {
- its_unreliable = vsomeip::factory::get_instance()->get_endpoint(
- boost::asio::ip::address_v4(its_endpoint_option->get_address()).to_string(),
- its_endpoint_option->get_port(),
- ip_protocol::UDP
- );
- }
- } else {
- // TODO: support IPv6
- }
- }
-
- its_proxy->subscribe(its_eventgroup, _source, its_reliable, its_unreliable, (_entry->get_time_to_live() == 0));
- }
-}
-
-void service_discovery_impl::on_subscribe_eventgroup_ack(
- const eventgroup_entry *_entry, const std::vector< option * > &_options) {
- service_id its_service = _entry->get_service_id();
- instance_id its_instance = _entry->get_instance_id();
- eventgroup_id its_eventgroup = _entry->get_eventgroup_id();
-
- client_proxy *its_proxy = find_client(its_service, its_instance);
- if (0 != its_proxy) {
- option *its_multicast_option = 0;
-
- const std::vector< uint8_t > &its_options = _entry->get_options(1);
- for (auto i : its_options) {
- if (option_type::IP4_MULTICAST == _options[its_options[i]]->get_type() ||
- option_type::IP6_MULTICAST == _options[its_options[i]]->get_type()) {
- if (0 == its_multicast_option) {
- its_multicast_option = _options[0];
- } else {
- // TODO: error: "SubscribeEventgroupAck must not contain more than one option!";
- }
- } else {
- // TODO: warning: "Unsupported option!"
- }
- }
-
- ipv4_multicast_option *its_option = dynamic_cast< ipv4_multicast_option * >(its_multicast_option);
- if (0 != its_option) {
- service *the_service = owner_.find_multicast_service(its_option->get_port());
- if (0 != the_service) {
- if (_entry->get_time_to_live()) {
- the_service->join(boost::asio::ip::address_v4(its_option->get_address()).to_string());
- } else {
- the_service->leave(boost::asio::ip::address_v4(its_option->get_address()).to_string());
- }
- }
- }
-
- // TODO: support IPv6
- }
-}
-
-bool service_discovery_impl::update_client(
- client_id _client,
- service_id _service, instance_id _instance, const endpoint *_location,
- bool _is_available) {
- owner_.on_service_availability(_client, _service, _instance, _location, _is_available);
- return true;
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/service_entry_impl.cpp b/vsomeip/src/vsomeip.sd/service_entry_impl.cpp
deleted file mode 100755
index 5614c3e..0000000
--- a/vsomeip/src/vsomeip.sd/service_entry_impl.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// service_entry_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/sd/service_entry_impl.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-service_entry_impl::service_entry_impl() {
- minor_version_ = 0;
-}
-
-service_entry_impl::~service_entry_impl() {
-}
-
-minor_version service_entry_impl::get_minor_version() const {
- return minor_version_;
-}
-
-void service_entry_impl::set_minor_version(minor_version _version) {
- minor_version_ = _version;
-}
-
-bool service_entry_impl::serialize(vsomeip::serializer *_to) const {
- bool is_successful = entry_impl::serialize(_to);
-
- is_successful = is_successful && _to->serialize(static_cast<uint8_t>(major_version_));
- is_successful = is_successful && _to->serialize(static_cast<uint32_t>(time_to_live_), true);
- is_successful = is_successful && _to->serialize(static_cast<uint32_t>(minor_version_));
-
- return is_successful;
-}
-
-bool service_entry_impl::deserialize(vsomeip::deserializer *_from) {
- bool is_successful = entry_impl::deserialize(_from);
-
- uint8_t tmp_major_version;
- is_successful = is_successful && _from->deserialize(tmp_major_version);
- major_version_ = static_cast<major_version>(tmp_major_version);
-
- uint32_t tmp_time_to_live;
- is_successful = is_successful && _from->deserialize(tmp_time_to_live, true);
- time_to_live_ = static_cast<time_to_live>(tmp_time_to_live);
-
- uint32_t tmp_minor_version;
- is_successful = is_successful && _from->deserialize(tmp_minor_version);
- minor_version_ = static_cast<minor_version>(tmp_minor_version);
-
- return is_successful;
-}
-
-} // namespace sd
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip.sd/service_proxy.cpp b/vsomeip/src/vsomeip.sd/service_proxy.cpp
deleted file mode 100644
index 1217205..0000000
--- a/vsomeip/src/vsomeip.sd/service_proxy.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// service_proxy.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip_internal/sd/eventgroup_service_proxy.hpp>
-#include <vsomeip_internal/sd/group.hpp>
-#include <vsomeip_internal/sd/service_proxy.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-service_proxy::service_proxy(group *_group, service_id _service, instance_id _instance)
- : group_(_group),
- service_(_service), instance_(_instance),
- major_version_(0x01), minor_version_(0x01),
- ttl_(0),
- is_local_(true), is_started_(false),
- reliable_(0), unreliable_(0) {
-}
-
-service_id service_proxy::get_service() const {
- return service_;
-}
-
-instance_id service_proxy::get_instance() const {
- return instance_;
-}
-
-major_version service_proxy::get_major_version() const {
- return major_version_;
-}
-
-minor_version service_proxy::get_minor_version() const {
- return minor_version_;
-}
-
-time_to_live service_proxy::get_time_to_live() const {
- return ttl_;
-}
-
-const endpoint * service_proxy::get_reliable() const {
- return reliable_;
-}
-
-const endpoint * service_proxy::get_unreliable() const {
- return unreliable_;
-}
-
-bool service_proxy::is_local() const {
- return is_local_;
-}
-
-bool service_proxy::is_started() const {
- return is_started_;
-}
-
-void service_proxy::provide(const endpoint *_location) {
- if (ip_protocol::TCP == _location->get_protocol()) {
- reliable_ = _location;
- } else {
- unreliable_ = _location;
- }
-}
-
-void service_proxy::withdraw(const endpoint *_location) {
- if (reliable_ == _location) {
- reliable_ = 0;
- } else if (unreliable_ == _location) {
- unreliable_ = 0;
- }
-
- if (0 == reliable_ && 0 == unreliable_) {
- group_->on_service_withdraw();
- }
-}
-
-void service_proxy::start() {
- ttl_ = 0xFFFFFF;
- is_started_ = true;
- group_->on_service_started();
-}
-
-void service_proxy::stop() {
- ttl_ = 0;
- is_started_ = false;
- group_->on_service_stopped();
-}
-
-void service_proxy::provide_eventgroup(eventgroup_id _eventgroup, const endpoint *_multicast) {
- eventgroup_service_proxy *its_proxy = 0;
-
- auto found_proxy = eventgroups_.find(_eventgroup);
- if (found_proxy != eventgroups_.end()) {
- its_proxy = found_proxy->second.get();
- } else {
- its_proxy = new eventgroup_service_proxy(this, _eventgroup);
- eventgroups_[_eventgroup].reset(its_proxy);
- }
-
- its_proxy->set_multicast(_multicast);
-}
-
-void service_proxy::withdraw_eventgroup(eventgroup_id _eventgroup) {
- // TODO: send Nack to all subscribers!?
- eventgroups_.erase(_eventgroup);
-}
-
-void service_proxy::subscribe(
- eventgroup_id _eventgroup, const endpoint *_source,
- const endpoint *_reliable, const endpoint *_unreliable, bool _stop) {
-
- const endpoint *its_multicast = 0;
- auto found_eventgroup = eventgroups_.find(_eventgroup);
- if (found_eventgroup != eventgroups_.end()) {
- its_multicast = found_eventgroup->second->get_multicast();
-
- if (_stop) { // unsubscribe
- found_eventgroup->second->unsubscribe(_reliable, _unreliable);
- } else {
- found_eventgroup->second->subscribe(_reliable, _unreliable);
- }
- } else {
- _stop = true;
- }
-
- group_->on_subscribe_eventgroup(service_, instance_, _eventgroup, _source, its_multicast, _stop);
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip.sd/timer_service.cpp b/vsomeip/src/vsomeip.sd/timer_service.cpp
deleted file mode 100644
index 018a699..0000000
--- a/vsomeip/src/vsomeip.sd/timer_service.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// timer_service.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <boost/asio/placeholders.hpp>
-#include <boost/asio/system_timer.hpp>
-#include <boost/bind.hpp>
-
-#include <vsomeip_internal/sd/timer_service.hpp>
-
-namespace vsomeip {
-namespace sd {
-
-timer_service::timer_service(boost::asio::io_service &_service)
- : timer_(_service) {
-}
-
-timer_service::~timer_service() {
-}
-
-void timer_service::start_timer(uint32_t _milliseconds) {
- timer_.expires_from_now(std::chrono::milliseconds(_milliseconds));
- timer_.async_wait(
- boost::bind(
- &timer_service::timer_expired,
- this,
- boost::asio::placeholders::error
- )
- );
-}
-
-void timer_service::stop_timer() {
- timer_.cancel();
-}
-
-uint32_t timer_service::expired_from_now() {
- return std::chrono::duration_cast<
- std::chrono::milliseconds>(
- timer_.expires_from_now()).count();
-}
-
-} // namespace sd
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/administration_proxy_impl.cpp b/vsomeip/src/vsomeip/administration_proxy_impl.cpp
deleted file mode 100644
index 6700711..0000000
--- a/vsomeip/src/vsomeip/administration_proxy_impl.cpp
+++ /dev/null
@@ -1,1090 +0,0 @@
-//
-// administration_proxy_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <cstring>
-
-#include <boost/asio/placeholders.hpp>
-
-#include <boost_ext/asio/placeholders.hpp>
-#include <boost_ext/process.hpp>
-
-#include <vsomeip/factory.hpp>
-#include <vsomeip/field.hpp>
-#include <vsomeip/payload.hpp>
-#include <vsomeip_internal/administration_proxy_impl.hpp>
-#include <vsomeip_internal/application_impl.hpp>
-#include <vsomeip_internal/configuration.hpp>
-#include <vsomeip_internal/enumeration_types.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-
-//#define VSOMEIP_DEVEL
-
-namespace vsomeip {
-
-administration_proxy_impl::administration_proxy_impl(application_base_impl &_owner)
- : proxy_base_impl(_owner),
- log_user(_owner),
- daemon_queue_(new message_queue(_owner.get_sender_service(), this)),
- application_queue_(new message_queue(_owner.get_receiver_service(), this)),
- queue_name_prefix_("/vsomeip-"),
- daemon_queue_name_("0"),
- retry_timer_(_owner.get_sender_service()),
- retry_timeout_(VSOMEIP_DEFAULT_RETRY_TIMEOUT),
- is_registered_(false),
- is_open_(false),
- is_created_(false) {
-
- // ensure the daemon queue will not be removed
- daemon_queue_->add_ref();
-}
-
-administration_proxy_impl::~administration_proxy_impl() {
-}
-
-void administration_proxy_impl::init() {
- VSOMEIP_TRACE << "administration_proxy_impl::init";
- static boost::atomic< uint32_t > queue_id(1);
-
- // configure application message queue name (use thread id)
- std::stringstream message_queue_id_stream;
- message_queue_id_stream
- << (int)boost_ext::process::process_id()
- << "."
- << queue_id;
-
- // Message queue name
- application_queue_name_ = message_queue_id_stream.str();
-
- VSOMEIP_DEBUG << "Client-ID (configured): " << owner_.get_id();
- VSOMEIP_DEBUG << "Using queue \"" << queue_name_prefix_ << application_queue_name_ << "\"";
-
- queue_id++;
-}
-
-void administration_proxy_impl::start() {
- VSOMEIP_TRACE << "administration_proxy_impl::start";
- configuration *vsomeip_configuration = configuration::request(owner_.get_name());
-
- // Number of slots the message queue provides
- int slots = vsomeip_configuration->get_slots();
-
- VSOMEIP_DEBUG
- << owner_.get_name() << " provides "
- << slots << " message slots";
-
- daemon_queue_->async_open(
- queue_name_prefix_ + daemon_queue_name_,
- boost::bind(
- &administration_proxy_impl::open_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-
- application_queue_->async_create(
- queue_name_prefix_ + application_queue_name_,
- slots,
- VSOMEIP_DEFAULT_QUEUE_SIZE,
- boost::bind(
- &administration_proxy_impl::create_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-}
-
-void administration_proxy_impl::stop() {
-}
-
-bool administration_proxy_impl::request_service(
- service_id _service, instance_id _instance,
- const endpoint *_location) {
- VSOMEIP_TRACE << "administration_proxy_impl::request_service";
-
- bool is_requested = true;
-
- auto find_service = requested_.find(_service);
- if (find_service != requested_.end()) {
- auto find_location = find_service->second.find(_instance);
- if (find_location != find_service->second.end()) {
- if (find_location->second.location_ != _location) {
- if (owner_.get_id() != 0) {
- send_service_command(
- command_enum::RELEASE_SERVICE,
- _service,
- _instance,
- find_location->second.location_
- );
- }
- find_location->second = request_state(daemon_queue_.get(), _location);
- }
- } else {
- find_service->second[_instance] = request_state(daemon_queue_.get(), _location);
- }
- } else {
- requested_[_service][_instance] = request_state(daemon_queue_.get(), _location);
- }
-
- if (is_registered_) {
- send_service_command(
- command_enum::REQUEST_SERVICE,
- _service,
- _instance,
- _location
- );
- }
-
- return is_requested;
-}
-
-bool administration_proxy_impl::release_service(
- service_id _service, instance_id _instance) {
-
- VSOMEIP_TRACE << "administration_proxy_impl::release_service";
-
- auto find_service = requested_.find(_service);
- if (find_service != requested_.end()) {
- auto find_instance = find_service->second.find(_instance);
- if (find_instance != find_service->second.end()) {
- if (is_registered_) {
- send_service_command(
- command_enum::RELEASE_SERVICE,
- _service,
- _instance,
- find_instance->second.location_
- );
- }
- find_service->second.erase(_instance);
- }
- }
-
- return true;
-}
-
-bool administration_proxy_impl::provide_service(
- service_id _service, instance_id _instance,
- const endpoint *_location) {
-
- VSOMEIP_TRACE << "administration_proxy_impl::provide_service";
-
- if (_location) {
- provided_[_service][_instance].locations_.insert(_location);
-
- if (is_registered_) {
- send_service_command(
- command_enum::PROVIDE_SERVICE,
- _service,
- _instance,
- _location
- );
- }
- } else {
- VSOMEIP_DEBUG
- << "Specification of communication endpoint is missing.";
- }
- return true;
-}
-
-bool administration_proxy_impl::withdraw_service(
- service_id _service, instance_id _instance,
- const endpoint *_location) {
-
- VSOMEIP_TRACE << "administration_proxy_impl::withdraw_service";
-
- if (_location) {
- provided_[_service][_instance].locations_.erase(_location);
- if (provided_[_service][_instance].locations_.size() == 0)
- provided_[_service].erase(_instance);
- } else {
- provided_[_service].erase(_instance);
- }
-
- if (provided_[_service].size() == 0)
- provided_.erase(_service);
-
- if (is_registered_) {
- send_service_command(
- command_enum::WITHDRAW_SERVICE,
- _service,
- _instance,
- _location
- );
- }
-
- return true;
-}
-
-bool administration_proxy_impl::start_service(
- service_id _service, instance_id _instance) {
-
- VSOMEIP_TRACE << "administration_proxy_impl::start_service";
-
- auto found_service = provided_.find(_service);
- if (found_service == provided_.end()) {
- return false;
- }
-
- auto found_instance = found_service->second.find(_instance);
- if (found_instance == found_service->second.end()) {
- return false;
- }
-
- found_instance->second.is_started_ = true;
-
- if (is_registered_) {
- send_service_command(
- command_enum::START_SERVICE,
- _service,
- _instance
- );
- }
-
- return true;
-}
-
-bool administration_proxy_impl::stop_service(
- service_id _service, instance_id _instance) {
-
- VSOMEIP_TRACE << "administration_proxy_impl::stop_service";
-
- auto found_service = provided_.find(_service);
- if (found_service == provided_.end()) {
- return false;
- }
-
- auto found_instance = found_service->second.find(_instance);
- if (found_instance == found_service->second.end()) {
- return false;
- }
-
- found_instance->second.is_started_ = false;
-
- if (is_registered_) {
- send_service_command(
- command_enum::STOP_SERVICE,
- _service,
- _instance
- );
- }
-
- return true;
-}
-
-void administration_proxy_impl::register_method(service_id _service, instance_id _instance, method_id _method) {
- VSOMEIP_TRACE << "administration_proxy_impl::register_method";
- if (is_registered_) {
- send_registration_command(command_enum::REGISTER_METHOD, _service, _instance, _method);
- } else {
- method_info info;
- info.service_ = _service;
- info.instance_ = _instance;
- info.method_ = _method;
-
- methods_.insert(info);
- }
-}
-
-void administration_proxy_impl::deregister_method(service_id _service, instance_id _instance, method_id _method) {
- VSOMEIP_TRACE << "administration_proxy_impl::register_method";
- if (is_registered_) {
- send_registration_command(command_enum::DEREGISTER_METHOD, _service, _instance, _method);
- } else {
- method_info info;
- info.service_ = _service;
- info.instance_ = _instance;
- info.method_ = _method;
-
- methods_.erase(info);
- }
-}
-
-bool administration_proxy_impl::provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_multicast) {
- bool is_provided = false;
-
- auto found_service = provided_.find(_service);
- if (found_service != provided_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_eventgroup = found_instance->second.eventgroups_.find(_eventgroup);
- if (found_eventgroup == found_instance->second.eventgroups_.end()) {
- found_instance->second.eventgroups_.insert(std::make_pair(_eventgroup, eventgroup_info(_multicast)));
- if (is_registered_) {
- send_eventgroup_command(command_enum::PROVIDE_EVENTGROUP, _service, _instance, _eventgroup, _multicast);
- }
- }
- }
- }
-
- return is_provided;
-}
-
-bool administration_proxy_impl::withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_multicast) {
- bool is_withdrawn = false;
-
- auto found_service = provided_.find(_service);
- if (found_service != provided_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_eventgroup = found_instance->second.eventgroups_.find(_eventgroup);
- if (found_eventgroup != found_instance->second.eventgroups_.end()) {
- found_instance->second.eventgroups_.erase(_eventgroup);
- if (is_registered_) {
- send_eventgroup_command(command_enum::WITHDRAW_EVENTGROUP, _service, _instance, _eventgroup, _multicast);
- }
- }
- }
- }
-
- return is_withdrawn;
-}
-
-bool administration_proxy_impl::add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) {
- bool is_added = false;
-
- auto found_service = provided_.find(_service);
- if (found_service != provided_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_eventgroup = found_instance->second.eventgroups_.find(_eventgroup);
- if (found_eventgroup != found_instance->second.eventgroups_.end()) {
- found_eventgroup->second.fields_.insert(_field);
- if (is_registered_) {
- send_field_command(command_enum::ADD_FIELD,
- _service, _instance, _eventgroup,
- _field->get_event(), _field->get_payload());
- }
- }
- }
- }
-
- return is_added;
-}
-
-bool administration_proxy_impl::remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) {
- bool is_added = false;
-
- auto found_service = provided_.find(_service);
- if (found_service != provided_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_eventgroup = found_instance->second.eventgroups_.find(_eventgroup);
- if (found_eventgroup != found_instance->second.eventgroups_.end()) {
- found_eventgroup->second.fields_.erase(_field);
- if (is_registered_) {
- send_field_command(command_enum::REMOVE_FIELD,
- _service, _instance, _eventgroup,
- _field->get_event(), _field->get_payload());
- }
- }
- }
- }
-
- return is_added;
-}
-
-bool administration_proxy_impl::request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- bool is_requested = false;
-
- auto found_service = requested_.find(_service);
- if (found_service != requested_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_eventgroup = found_instance->second.eventgroups_.find(_eventgroup);
- if (found_eventgroup == found_instance->second.eventgroups_.end()) {
- found_instance->second.eventgroups_.insert(_eventgroup);
- if (is_registered_) {
- send_eventgroup_command(command_enum::REQUEST_EVENTGROUP, _service, _instance, _eventgroup);
- }
- }
- is_requested = true;
- }
- }
-
- return is_requested;
-}
-
-bool administration_proxy_impl::release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- bool is_released = false;
-
- auto found_service = requested_.find(_service);
- if (found_service != requested_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto find_eventgroup = found_instance->second.eventgroups_.find(_eventgroup);
- if (find_eventgroup != found_instance->second.eventgroups_.end()) {
- found_instance->second.eventgroups_.erase(_eventgroup);
- if (is_registered_) {
- send_eventgroup_command(command_enum::RELEASE_EVENTGROUP, _service, _instance, _eventgroup);
- }
- }
- }
- }
-
- return is_released;
-}
-
-void administration_proxy_impl::catch_up_registrations() {
- VSOMEIP_TRACE << "administration_proxy_impl::catch_up_registrations";
-
- for (auto s : provided_) {
- for (auto i : s.second) {
- for (auto l : i.second.locations_) {
- provide_service(s.first, i.first, l);
- }
- for (auto e : i.second.eventgroups_) {
- send_eventgroup_command(command_enum::PROVIDE_EVENTGROUP, s.first, i.first, e.first, e.second.multicast_);
- for (auto f : e.second.fields_) {
- send_field_command(command_enum::ADD_FIELD, s.first, i.first, e.first, f->get_event(), f->get_payload());
- }
- }
- }
- }
-
- for (auto s : provided_) {
- for (auto i : s.second) {
- if (i.second.is_started_) {
- start_service(s.first, i.first);
- }
- }
- }
-
- for (auto s : requested_) {
- for (auto i : s.second) {
- request_service(s.first, i.first, i.second.location_);
- for (auto e : i.second.eventgroups_) {
- send_eventgroup_command(command_enum::REQUEST_EVENTGROUP, s.first, i.first, e);
- }
- }
- }
-
- for (auto m : methods_) {
- register_method(m.service_, m.instance_, m.method_);
- }
- methods_.clear();
-}
-
-void administration_proxy_impl::do_send(const std::vector< uint8_t > &_buffer) {
- VSOMEIP_TRACE << "administration_proxy_impl::do_send";
- send_buffers_.push_back(_buffer);
- if (is_open_)
- do_send_buffer(send_buffers_.back());
-}
-
-void administration_proxy_impl::do_send_buffer(const std::vector< uint8_t > &_buffer) {
- VSOMEIP_TRACE << "administration_proxy_impl::do_send_buffer";
- daemon_queue_->async_send(
- _buffer.data(),
- _buffer.size(),
- 0,
- boost::bind(
- &administration_proxy_impl::send_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-}
-
-void administration_proxy_impl::do_receive() {
- VSOMEIP_TRACE << "administration_proxy_impl::do_receive";
- application_queue_->async_receive(
- receive_buffer_,
- sizeof(receive_buffer_),
- boost::bind(
- &administration_proxy_impl::receive_cbk,
- this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- boost_ext::asio::placeholders::priority
- )
- );
-}
-
-void administration_proxy_impl::send_register_application() {
- VSOMEIP_TRACE << "administration_proxy_impl::send_register_application";
- std::vector< uint8_t > registration;
-
- // Resize to the needed sizeid
- uint32_t payload_size = application_queue_name_.size() + 1; // "+ 1" for "is_managed"
- registration.resize(payload_size + VSOMEIP_PROTOCOL_OVERHEAD);
-
- client_id id = owner_.get_id();
-
- std::memcpy(&registration[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memcpy(&registration[VSOMEIP_PROTOCOL_ID], &id, sizeof(id));
- registration[VSOMEIP_PROTOCOL_COMMAND] = static_cast< uint8_t >(command_enum::REGISTER_APPLICATION);
- std::memcpy(&registration[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
- std::copy(application_queue_name_.begin(), application_queue_name_.end(), registration.begin() + VSOMEIP_PROTOCOL_PAYLOAD);
- registration[VSOMEIP_PROTOCOL_PAYLOAD + payload_size - 1] = static_cast< uint8_t >(owner_.is_managing());
- std::memcpy(&registration[payload_size + VSOMEIP_PROTOCOL_PAYLOAD], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
-
- // send
- do_send(registration);
-}
-
-void administration_proxy_impl::send_deregister_application() {
- VSOMEIP_TRACE << "administration_proxy_impl::send_deregister_application";
- uint8_t deregistration_message[] = {
- 0x67, 0x37, 0x6D, 0x07,
- 0x00, 0x00,
- static_cast< uint8_t >(command_enum::DEREGISTER_APPLICATION),
- 0x00, 0x00, 0x00, 0x00,
- 0x07, 0x6D, 0x37, 0x67
- };
-
- client_id id = owner_.get_id();
- std::memcpy(&deregistration_message[VSOMEIP_PROTOCOL_ID], &id, sizeof(id));
-
- std::vector< uint8_t > deregistration_buffer(
- deregistration_message,
- deregistration_message + sizeof(deregistration_message)
- );
-
- // send
- do_send(deregistration_buffer);
-}
-
-void administration_proxy_impl::send_service_command(
- command_enum _command, service_id _service, instance_id _instance, const endpoint * _location) {
- VSOMEIP_TRACE << "administration_proxy_impl::send_service_command";
-
- std::vector< uint8_t > command;
-
- client_id id = owner_.get_id();
- boost::shared_ptr< serializer > its_serializer(owner_.get_serializer());
- uint32_t payload_size = 4;
- if (_location) {
- its_serializer->serialize(reinterpret_cast<const serializable *>(_location));
- payload_size += its_serializer->get_size();
- }
-
- command.resize(payload_size + VSOMEIP_PROTOCOL_OVERHEAD);
-
- std::memcpy(&command[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memcpy(&command[VSOMEIP_PROTOCOL_ID], &id, sizeof(id));
- command[VSOMEIP_PROTOCOL_COMMAND] = static_cast<uint8_t>(_command);
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD], &_service, sizeof(_service));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+2], &_instance, sizeof(_instance));
- if (_location)
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+4], its_serializer->get_data(), its_serializer->get_size());
- std::memcpy(&command[payload_size + VSOMEIP_PROTOCOL_PAYLOAD], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
-
- its_serializer->reset();
-
- do_send(command);
-}
-
-void administration_proxy_impl::send_eventgroup_command(
- command_enum _command, service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint * _location) {
- VSOMEIP_TRACE << "administration_proxy_impl::send_service_command";
-
- client_id id = owner_.get_id();
- boost::shared_ptr< serializer > its_serializer(owner_.get_serializer());
- uint32_t payload_size = 6;
- if (_location) {
- its_serializer->serialize(reinterpret_cast<const serializable *>(_location));
- payload_size += its_serializer->get_size();
- }
-
- std::vector< uint8_t > command(payload_size + VSOMEIP_PROTOCOL_OVERHEAD);
-
- std::memcpy(&command[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memcpy(&command[VSOMEIP_PROTOCOL_ID], &id, sizeof(id));
- command[VSOMEIP_PROTOCOL_COMMAND] = static_cast<uint8_t>(_command);
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD], &_service, sizeof(_service));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+2], &_instance, sizeof(_instance));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+4], &_eventgroup, sizeof(_eventgroup));
- if (_location) {
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+6], its_serializer->get_data(), its_serializer->get_size());
- its_serializer->reset();
- }
- std::memcpy(&command[payload_size + VSOMEIP_PROTOCOL_PAYLOAD], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
-
- do_send(command);
-}
-
-void administration_proxy_impl::send_field_command(
- command_enum _command,
- service_id _service, instance_id _instance, eventgroup_id _eventgroup,
- event_id _field, const payload &_payload) {
- VSOMEIP_TRACE << "administration_proxy_impl::send_field_command";
-
- client_id id = owner_.get_id();
- boost::shared_ptr< serializer > its_serializer(owner_.get_serializer());
- uint32_t payload_size = 8 + _payload.get_length();
-
- std::vector< uint8_t > command(payload_size + VSOMEIP_PROTOCOL_OVERHEAD);
-
- std::memcpy(&command[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memcpy(&command[VSOMEIP_PROTOCOL_ID], &id, sizeof(id));
- command[VSOMEIP_PROTOCOL_COMMAND] = static_cast<uint8_t>(_command);
-
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
-
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD], &_service, sizeof(_service));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+2], &_instance, sizeof(_instance));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+4], &_eventgroup, sizeof(_eventgroup));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+6], &_field, sizeof(_field));
- std::memcpy(&command[VSOMEIP_PROTOCOL_PAYLOAD+8], _payload.get_data(), _payload.get_length());
-
- std::memcpy(&command[payload_size + VSOMEIP_PROTOCOL_PAYLOAD], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
-
- do_send(command);
-}
-
-void administration_proxy_impl::send_registration_command(
- command_enum _command, service_id _service, instance_id _instance, method_id _method) {
- VSOMEIP_TRACE << "administration_proxy_impl::send_registration_command";
-
- uint8_t command_buffer[] = {
- 0x67, 0x37, 0x6D, 0x07,
- 0x00, 0x00,
- static_cast< uint8_t >(_command),
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x07, 0x6D, 0x37, 0x67
- };
-
- uint32_t payload_size = 4;
- client_id id = owner_.get_id();
-
- std::memcpy(&command_buffer[VSOMEIP_PROTOCOL_ID], &id, sizeof(id));
- std::memcpy(&command_buffer[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &payload_size, sizeof(payload_size));
- std::memcpy(&command_buffer[VSOMEIP_PROTOCOL_PAYLOAD], &_service, sizeof(_service));
- std::memcpy(&command_buffer[VSOMEIP_PROTOCOL_PAYLOAD+2], &_instance, sizeof(_instance));
- std::memcpy(&command_buffer[VSOMEIP_PROTOCOL_PAYLOAD+4], &_method, sizeof(_method));
-
- std::vector< uint8_t > command(
- command_buffer,
- command_buffer + sizeof(command_buffer)
- );
-
- do_send(command);
-}
-
-void administration_proxy_impl::send_pong() {
- VSOMEIP_TRACE << "administration_proxy_impl::send_pong";
-#ifdef WATCHDOG_TEST
- static int pong_counter = 0;
- if (pong_counter > 20 && 0 == id_ % 3) {
- return;
- }
-
- pong_counter ++;
-#endif
-
- uint8_t pong_message[] = {
- 0x67, 0x37, 0x6D, 0x07,
- 0x00, 0x00,
- static_cast<uint8_t>(command_enum::PONG),
- 0x00, 0x00, 0x00, 0x00,
- 0x07, 0x6D, 0x37, 0x67
- };
-
- client_id id = owner_.get_id();
- std::memcpy(&pong_message[VSOMEIP_PROTOCOL_ID], &id, sizeof(id));
-
- std::vector< uint8_t > pong_buffer(
- pong_message,
- pong_message + sizeof(pong_message)
- );
-
- do_send(pong_buffer);
-}
-
-void administration_proxy_impl::process_message(std::size_t _bytes) {
- VSOMEIP_TRACE << "administration_proxy_impl::process_message";
-#if 0
- for (std::size_t i = 0; i < _bytes; ++i) {
- std::cout << std::setw(2) << std::setfill('0') << std::hex << (int)receive_buffer_[i] << " ";
- }
- std::cout << std::endl;
-#endif
-
- if (_bytes < VSOMEIP_PROTOCOL_OVERHEAD) {
- VSOMEIP_ERROR << "Message too short (< " << VSOMEIP_PROTOCOL_OVERHEAD << " bytes)";
- return;
- }
-
- uint32_t start_tag, end_tag, payload_size;
- command_enum command;
- client_id its_client;
-
- std::memcpy(&start_tag, &receive_buffer_[0], sizeof(start_tag));
- std::memcpy(&end_tag, &receive_buffer_[_bytes-4], sizeof(end_tag));
- command = static_cast< command_enum >(receive_buffer_[VSOMEIP_PROTOCOL_COMMAND]);
- std::memcpy(&payload_size, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], sizeof(payload_size));
-
- if (start_tag == VSOMEIP_PROTOCOL_START_TAG && end_tag == VSOMEIP_PROTOCOL_END_TAG) {
- if (_bytes == payload_size + VSOMEIP_PROTOCOL_OVERHEAD) {
-
- std::memcpy(&its_client, &receive_buffer_[VSOMEIP_PROTOCOL_ID], sizeof(its_client));
- process_command(command, its_client, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], payload_size);
-
- } else {
- VSOMEIP_ERROR
- << "Message has incorrect size ("
- << _bytes << "/" << payload_size + VSOMEIP_PROTOCOL_OVERHEAD << ")";
- }
- } else {
- VSOMEIP_ERROR << "Message is not correctly tagged";
- }
-}
-
-void administration_proxy_impl::process_command(command_enum _command, client_id _client, const uint8_t *_payload, uint32_t payload_size) {
- service_id its_service;
- instance_id its_instance;
- eventgroup_id its_eventgroup;
- const endpoint *its_location = 0;
-
- switch (_command) {
- case command_enum::APPLICATION_INFO:
- on_application_info(_client, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], payload_size);
- catch_up_registrations();
- break;
-
- case command_enum::APPLICATION_LOST:
- on_application_lost(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], payload_size);
- break;
-
- case command_enum::REQUEST_SERVICE_ACK:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- on_request_service_ack(its_service, its_instance,
- std::string((char*) &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], payload_size - 4));
- break;
-
- case command_enum::PING:
- send_pong();
- break;
-
- case command_enum::SOMEIP_SERVICE_AVAILABLE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- its_location = vsomeip::factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], payload_size - 4);
- on_service_availability(its_service, its_instance, its_location, true);
- break;
-
- case command_enum::SOMEIP_SERVICE_NOT_AVAILABLE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- on_service_availability(its_service, its_instance, its_location, false);
- break;
-
- case command_enum::SOMEIP_SUBSCRIBE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_eventgroup, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_eventgroup));
- its_location = vsomeip::factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+6], payload_size - 6);
- owner_.handle_subscription(its_service, its_instance, its_eventgroup, its_location, true);
- break;
-
- case command_enum::SOMEIP_UNSUBSCRIBE:
- std::memcpy(&its_service, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD], sizeof(its_service));
- std::memcpy(&its_instance, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+2], sizeof(its_instance));
- std::memcpy(&its_eventgroup, &receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+4], sizeof(its_eventgroup));
- its_location = vsomeip::factory::get_instance()->get_endpoint(&receive_buffer_[VSOMEIP_PROTOCOL_PAYLOAD+6], payload_size - 6);
- owner_.handle_subscription(its_service, its_instance, its_eventgroup, its_location, false);
- break;
-
- default:
- VSOMEIP_ERROR << "Message contains illegal command " << (int)_command;
- break;
- }
-}
-
-void administration_proxy_impl::on_application_info(client_id _client, const uint8_t *_data, uint32_t _size) {
- VSOMEIP_TRACE << "administration_proxy_impl::on_application_info";
-
- VSOMEIP_DEBUG << "Client-Id (from daemon): " << _client;
- if (_client != owner_.get_id()) {
- owner_.set_id(_client);
- }
-
- uint32_t position = 0;
- while (position + 4 < _size) {
- client_id id;
- std::memcpy(&id, &_data[position], sizeof(id));
- position += 4;
-
- if (position + 4 < _size) {
- uint32_t queue_name_size;
- std::memcpy(&queue_name_size, &_data[position], sizeof(queue_name_size));
- position += 4;
-
- if (position + queue_name_size <= _size) {
- std::string queue_name((char *)&_data[position], queue_name_size);
-
- if (queue_name != application_queue_name_) {
- VSOMEIP_DEBUG << "Found queue " << queue_name << " for application " << id;
- other_queue_names_[id] = queue_name;
- }
- position += queue_name_size;
- }
- } else {
- VSOMEIP_ERROR << "Message contains illegal queue name.";
- return;
- }
- }
-
- is_registered_ = true;
-}
-
-void administration_proxy_impl::on_application_lost(const uint8_t *_data, uint32_t _size) {
- VSOMEIP_TRACE << "administration_proxy_impl::on_application_lost";
- uint32_t position = 0;
- while (position + sizeof(client_id) <= _size) {
- client_id id;
- std::memcpy(&id, &_data[position], sizeof(id));
- position += 4;
-
- if (id == owner_.get_id()) {
- VSOMEIP_FATAL << "Daemon reported me as gone lost!";
- } else {
- VSOMEIP_DEBUG << "Client " << id << " got lost. Removing its queue reference.";
-
- mutex_.lock();
- auto find_queue_name = other_queue_names_.find(id);
- if (find_queue_name != other_queue_names_.end()) {
- auto find_queue = queues_.find(find_queue_name->second);
- if (find_queue != queues_.end()) {
- remove_requested_services(find_queue->second);
- queues_.erase(find_queue);
- }
-
- other_queue_names_.erase(find_queue_name);
- }
- mutex_.unlock();
- }
- }
-}
-
-void administration_proxy_impl::on_request_service_ack(service_id _service, instance_id _instance, const std::string &_queue_name) {
- auto find_queue = queues_.find(_queue_name);
- if (find_queue != queues_.end()) {
- auto find_service = requested_.find(_service);
- if (find_service != requested_.end()) {
- auto find_instance = find_service->second.find(_instance);
- if (find_instance != find_service->second.end()) {
- find_instance->second.queue_.reset(find_queue->second);
- }
- }
- } else {
- message_queue *queue = new message_queue(owner_.get_sender_service(), this);
- queues_[_queue_name] = queue;
- queue->async_open(
- queue_name_prefix_ + _queue_name,
- boost::bind(
- &administration_proxy_impl::request_cbk,
- this,
- boost::asio::placeholders::error,
- _service,
- _instance,
- queue,
- _queue_name
- )
- );
- }
-}
-
-void administration_proxy_impl::on_service_availability(
- service_id _service, instance_id _instance, const endpoint *_location,
- bool _is_available) {
-
- auto find_service = requested_.find(_service);
- if (find_service != requested_.end()) {
- auto find_instance = find_service->second.find(_instance);
- if (find_instance != find_service->second.end()) {
- if (_is_available) {
- find_instance->second.location_ = _location;
- } else {
- find_instance->second.location_ = 0;
- }
- }
- }
-
- owner_.handle_availability(_service, _instance, _location, _is_available);
-}
-
-void administration_proxy_impl::remove_requested_services(message_queue *_queue) {
- VSOMEIP_TRACE << "administration_proxy_impl::remove_requested_services";
- std::map< service_id, std::set< instance_id > > served_by_queue;
-
- for (auto& i : requested_) {
- for (auto& j : i.second) {
- if (j.second.queue_ == _queue) {
- j.second.queue_ = 0;
- }
- }
- }
-}
-
-void administration_proxy_impl::open_cbk(boost::system::error_code const &_error) {
- VSOMEIP_TRACE << "administration_proxy_impl::open_cbk";
- if (!_error) {
- is_open_ = true;
- retry_timeout_ = 20;
- if (is_created_) {
- send_register_application();
- do_receive();
- }
- } else {
- VSOMEIP_DEBUG << "Trying to open daemon queue in " << retry_timeout_ << "ms";
- retry_timer_.expires_from_now(
- std::chrono::milliseconds(retry_timeout_));
- retry_timer_.async_wait(
- boost::bind(
- &administration_proxy_impl::retry_open_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-
- // next time we wait longer
- retry_timeout_ <<= 1;
- }
-}
-
-void administration_proxy_impl::retry_open_cbk(boost::system::error_code const &_error) {
- VSOMEIP_TRACE << "administration_proxy_impl::retry_open_cbk";
- if (!_error) {
- daemon_queue_->async_open(
- queue_name_prefix_ + daemon_queue_name_,
- boost::bind(
- &administration_proxy_impl::open_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
- }
-}
-
-void administration_proxy_impl::create_cbk(boost::system::error_code const &_error) {
- VSOMEIP_TRACE << "administration_proxy_impl::create_cbk";
- if (_error) {
- // Try destroying before creating
- application_queue_->async_close(
- boost::bind(
- &administration_proxy_impl::close_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-
- // TODO: define maximum number of retries
- application_queue_->async_create(
- queue_name_prefix_ + application_queue_name_,
- slots_,
- VSOMEIP_DEFAULT_QUEUE_SIZE,
- boost::bind(
- &administration_proxy_impl::create_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
- } else {
- is_created_ = true;
- if (is_open_) {
- send_register_application();
- do_receive();
- }
- }
-}
-
-void administration_proxy_impl::close_cbk(
- boost::system::error_code const &_error) {
- VSOMEIP_TRACE << "administration_proxy_impl::close_cbk";
- if (!_error) {
- owner_.set_id(0);
- }
-}
-
-void administration_proxy_impl::send_cbk(
- boost::system::error_code const &_error) {
- VSOMEIP_TRACE << "administration_proxy_impl::send_cbk";
- if (_error) {
- VSOMEIP_ERROR << "Applicatiom " << owner_.get_name()
- << ": Error while sending (" << _error.message() << ")";
- }
-
- send_buffers_.pop_front();
-}
-
-void administration_proxy_impl::receive_cbk(
- boost::system::error_code const &_error,
- std::size_t _bytes, unsigned int _priority) {
- VSOMEIP_TRACE << "administration_proxy_impl::receive_cbk";
- if (!_error && _bytes) {
- process_message(_bytes);
- }
-
- do_receive();
-}
-
-void administration_proxy_impl::request_cbk(
- boost::system::error_code const &_error,
- service_id _service, instance_id _instance,
- message_queue *_queue, const std::string &_queue_name) {
-
- if (!_error) {
- VSOMEIP_DEBUG
- << "APPLICATION " << owner_.get_id() << " opened queue for service ("
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << " " << _instance << ")";
-
- auto find_service = requested_.find(_service);
- if (find_service != requested_.end()) {
- auto find_instance = find_service->second.find(_instance);
- if (find_instance != find_service->second.end()) {
- find_instance->second.queue_.reset(_queue);
- } else {
- VSOMEIP_ERROR << "Application " << application_queue_name_
- << ": Requested service instance ["
- << std::hex << _service << "." << _instance
- << "] is unknown.";
- }
- } else {
- VSOMEIP_ERROR << "Application " << application_queue_name_
- << ": Requested service ["
- << std::hex << _service
- << "] is unknown.";
- }
- } else {
- VSOMEIP_ERROR << "Application " << application_queue_name_
- << ": Error while opening queue ["
- << _queue_name << "]";
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Helper function to automate queue handling
-///////////////////////////////////////////////////////////////////////////////
-void administration_proxy_impl::remove_queue(const std::string &_name) {
- VSOMEIP_TRACE << "Removing queue " << _name;
- queues_.erase(_name);
-}
-
-void intrusive_ptr_add_ref(vsomeip::message_queue *_queue) {
- if (_queue) {
- _queue->add_ref();
- }
-}
-
-void intrusive_ptr_release(vsomeip::message_queue *_queue) {
- if (_queue) {
- _queue->release();
- if (0 == _queue->get_ref() && 0 != _queue->get_owner()) {
- _queue->get_owner()->remove_queue(_queue->get_name());
- delete _queue;
- }
- }
-}
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/application_base_impl.cpp b/vsomeip/src/vsomeip/application_base_impl.cpp
deleted file mode 100644
index 9670195..0000000
--- a/vsomeip/src/vsomeip/application_base_impl.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// application_base_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/application_base_impl.hpp>
-
-namespace vsomeip {
-
-application_base_impl::application_base_impl(const std::string &_name)
- : log_owner(_name),
- proxy_owner(_name),
- owner_base(_name) {
-}
-
-application_base_impl::~application_base_impl() {
-}
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/application_impl.cpp b/vsomeip/src/vsomeip/application_impl.cpp
deleted file mode 100644
index 77a3c3c..0000000
--- a/vsomeip/src/vsomeip/application_impl.cpp
+++ /dev/null
@@ -1,429 +0,0 @@
-//
-// application_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/factory.hpp>
-#include <vsomeip/field.hpp>
-#include <vsomeip/message.hpp>
-#include <vsomeip_internal/application_impl.hpp>
-#include <vsomeip_internal/configuration.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/managed_proxy_impl.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/supervised_managing_proxy_impl.hpp>
-#include <vsomeip_internal/utility.hpp>
-#include <vsomeip/sd/factory.hpp>
-
-namespace vsomeip {
-
-application_impl::application_impl(const std::string &_name)
- : application_base_impl(_name),
- log_owner(_name),
- proxy_owner(_name),
- owner_base(_name),
- sender_work_(sender_service_),
- receiver_work_(receiver_service_),
- id_(0),
- session_(0),
- serializer_(new serializer),
- deserializer_(new deserializer),
- is_service_discovery_enabled_(false),
- is_managing_(false) {
-
- serializer_->create_data(VSOMEIP_MAX_TCP_MESSAGE_SIZE);
-}
-
-application_impl::~application_impl() {
-}
-
-client_id application_impl::get_id() const {
- return id_;
-}
-
-void application_impl::set_id(client_id _id) {
- id_ = _id;
-}
-
-std::string application_impl::get_name() const {
- return name_;
-}
-
-void application_impl::set_name(const std::string &_name) {
- name_ = _name;
-}
-
-bool application_impl::is_managing() const {
- return is_managing_;
-}
-
-boost::asio::io_service & application_impl::get_sender_service() {
- return sender_service_;
-}
-
-boost::asio::io_service & application_impl::get_receiver_service() {
- return receiver_service_;
-}
-
-void application_impl::init(int _options_count, char **_options) {
- configuration::init(_options_count, _options);
- configuration * its_configuration = configuration::request(name_);
-
- configure_logging(
- its_configuration->use_console_logger(),
- its_configuration->use_file_logger(),
- its_configuration->use_dlt_logger()
- );
-
- set_channel(name_);
- set_loglevel(its_configuration->get_loglevel());
-
- id_ = its_configuration->get_client_id();
-
- bool is_watchdog_enabled = its_configuration->is_watchdog_enabled();
- is_service_discovery_enabled_ = its_configuration->is_service_discovery_enabled();
- bool is_endpoint_manager_enabled = its_configuration->is_endpoint_manager_enabled();
-
- if (is_endpoint_manager_enabled) {
- is_managing_ = true;
- if (is_watchdog_enabled || is_service_discovery_enabled_) {
- VSOMEIP_DEBUG << "Application \"" << name_ << "\" uses supervised managing proxy.";
- proxy_.reset(new supervised_managing_proxy_impl(*this));
- } else {
- VSOMEIP_DEBUG << "Application \"" << name_ << "\" uses managing proxy.";
- proxy_.reset(new managing_proxy_impl(*this));
- }
- } else {
- is_managing_ = false;
- VSOMEIP_DEBUG << "Application \"" << name_ << "\" uses managed proxy.";
- proxy_.reset(new managed_proxy_impl(*this));
- }
-
- configuration::release(name_);
-
- proxy_->init();
-}
-
-void application_impl::start() {
- proxy_->start();
-
- // start processing
- receiver_thread_.reset(
- new boost::thread(
- boost::bind(
- &application_impl::service,
- this,
- boost::ref(receiver_service_)
- )
- )
- );
-
- sender_thread_.reset(
- new boost::thread(
- boost::bind(
- &application_impl::service,
- this,
- boost::ref(sender_service_)
- )
- )
- );
-
- sender_thread_->join();
- receiver_thread_->join();
-}
-
-void application_impl::stop() {
- proxy_->stop();
-
- receiver_service_.stop();
- sender_service_.stop();
-
- receiver_thread_.reset();
- sender_thread_.reset();
-}
-
-void application_impl::service(boost::asio::io_service &_service) {
- _service.run();
-}
-
-bool application_impl::provide_service(service_id _service, instance_id _instance, const endpoint *_location) {
- return proxy_->provide_service(_service, _instance, _location);
-}
-
-bool application_impl::withdraw_service(service_id _service, instance_id _instance, const endpoint *_location) {
- return proxy_->withdraw_service(_service, _instance, _location);
-}
-
-bool application_impl::start_service(service_id _service, instance_id _instance) {
- return proxy_->start_service(_service, _instance);
-}
-
-bool application_impl::stop_service(service_id _service, instance_id _instance) {
- return proxy_->stop_service(_service, _instance);
-}
-
-bool application_impl::request_service(service_id _service, instance_id _instance, const endpoint *_location) {
- return proxy_->request_service(_service, _instance, _location);
-}
-
-bool application_impl::release_service(service_id _service, instance_id _instance) {
- return proxy_->release_service(_service, _instance);
-}
-
-bool application_impl::is_service_available(service_id _service, instance_id _instance) const {
- if (is_service_discovery_enabled_) {
- bool is_available = false;
- auto found_service = availability_.find(_service);
- if (found_service != availability_.end()) {
- is_available = (found_service->second.find(_instance) != found_service->second.end());
- }
- return is_available;
- }
-
- return true;
-}
-
-bool application_impl::register_availability_handler(service_id _service, instance_id _instance,
- availability_handler_t _handler) {
- if (is_service_discovery_enabled_) {
- auto found_service = availability_handlers_.find(_service);
- if (found_service != availability_handlers_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- return false;
- }
- }
-
- availability_handlers_[_service][_instance] = _handler;
- return true;
- }
-
- return false;
-}
-
-void application_impl::deregister_availability_handler(service_id _service, instance_id _instance) {
- auto found_service = availability_handlers_.find(_service);
- if (found_service != availability_handlers_.end()) {
- found_service->second.erase(_instance);
- }
-}
-
-void application_impl::handle_availability(service_id _service, instance_id _instance, const endpoint *_location, bool _is_available) {
- if (_is_available) {
- VSOMEIP_DEBUG << "Service ["
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << "." << _instance
- << "] is available on "
- << _location->get_address() << ":" << _location->get_port()
- << " (" << (ip_protocol::TCP == _location->get_protocol() ? "TCP" : "UDP") << ")";
- } else {
- VSOMEIP_DEBUG << "Service ["
- << std::hex << std::setw(4) << std::setfill('0')
- << _service << "." << _instance
- << "] is NOT available";
-
- }
-
- bool must_call_handler = false;
- auto found_service = availability_.find(_service);
- if (found_service == availability_.end()) {
- if (_is_available) {
- availability_[_service].insert(_instance);
- must_call_handler = true;
- }
- } else {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance == found_service->second.end()) {
- if (_is_available) {
- found_service->second.insert(_instance);
- must_call_handler = true;
- }
- } else {
- if (!_is_available) {
- found_service->second.erase(_instance);
- must_call_handler = true;
- }
- }
- }
-
- if (must_call_handler) {
- auto found_service_availability_handlers = availability_handlers_.find(_service);
- if (found_service_availability_handlers != availability_handlers_.end()) {
- auto found_service_instance_availability_handler = found_service_availability_handlers->second.find(_instance);
- if (found_service_instance_availability_handler != found_service_availability_handlers->second.end()) {
- found_service_instance_availability_handler->second(_service, _instance, _is_available);
- }
- }
- }
-}
-
-void application_impl::handle_subscription(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location, bool _is_subscribing) {
-}
-
-bool application_impl::provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) {
- return proxy_->provide_eventgroup(_service, _instance, _eventgroup, _location);
-}
-
-bool application_impl::withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) {
- return proxy_->withdraw_eventgroup(_service, _instance, _eventgroup, _location);
-}
-
-bool application_impl::add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) {
- return proxy_->add_field(_service, _instance, _eventgroup, _field);
-}
-
-bool application_impl::remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) {
- return proxy_->remove_field(_service, _instance, _eventgroup, _field);
-}
-
-bool application_impl::update_field(const field *_field) {
- boost::shared_ptr< message > its_message(vsomeip::factory::get_instance()->create_message());
- its_message->set_service_id(_field->get_service());
- its_message->set_instance_id(_field->get_instance());
- its_message->set_method_id(_field->get_event());
- its_message->set_message_type(message_type_enum::NOTIFICATION);
- its_message->set_return_code(return_code_enum::OK);
- its_message->get_payload().set_data(
- _field->get_payload().get_data(),
- _field->get_payload().get_length()
- );
-
- return proxy_->send(its_message.get(), false, true);
-}
-
-bool application_impl::request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- return proxy_->request_eventgroup(_service, _instance, _eventgroup);
-}
-
-bool application_impl::release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- return proxy_->release_eventgroup(_service, _instance, _eventgroup);
-}
-
-std::set< field * > * application_impl::find_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- std::set< field * > *its_eventgroup = 0;
-
- auto found_service = eventgroups_.find(_service);
- if (found_service != eventgroups_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_eventgroup = found_instance->second.find(_eventgroup);
- if (found_eventgroup != found_instance->second.end()) {
- its_eventgroup = &(found_eventgroup->second);
- }
- }
- }
-
- return its_eventgroup;
-}
-
-bool application_impl::send(message *_message, bool _reliable, bool _flush) {
- if (_message->get_message_type() < message_type_enum::NOTIFICATION) {
- _message->set_client_id(id_);
- _message->set_session_id(session_++); // Assumption: ++ is atomic...
- }
-
- return proxy_->send(_message, _reliable, _flush);
-}
-
-bool application_impl::enable_magic_cookies(service_id _service, instance_id _instance) {
- return proxy_->enable_magic_cookies(_service, _instance);
-}
-
-bool application_impl::disable_magic_cookies(service_id _service, instance_id _instance) {
- return proxy_->disable_magic_cookies(_service, _instance);
-}
-
-bool application_impl::register_message_handler(
- service_id _service, instance_id _instance, method_id _method,
- message_handler_t _handler) {
-
- auto found_service = message_handlers_.find(_service);
- if (found_service != message_handlers_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_method = found_instance->second.find(_method);
- if (found_method != found_instance->second.end()) {
- return false;
- }
- }
- }
-
- message_handlers_[_service][_instance][_method] = _handler;
- proxy_->register_method(_service, _instance, _method);
- return true;
-}
-
-void application_impl::deregister_message_handler(
- service_id _service, instance_id _instance, method_id _method) {
- auto found_service = message_handlers_.find(_service);
- if (found_service != message_handlers_.end()) {
- auto found_instance = found_service->second.find(_instance);
- if (found_instance != found_service->second.end()) {
- auto found_method = found_service->second.find(_method);
- if (found_method != found_service->second.end()) {
- found_method->second.erase(_method);
- proxy_->deregister_method(_service, _instance, _method);
- }
- }
- }
-}
-
-void application_impl::handle_message(std::shared_ptr< message > &_message) {
- auto found_service = message_handlers_.find(_message->get_service_id());
- if (found_service != message_handlers_.end()) {
- auto found_instance = found_service->second.find(_message->get_instance_id());
- if (found_instance != found_service->second.end()) {
- auto found_method = found_instance->second.find(_message->get_method_id());
- if (found_method == found_instance->second.end()) {
- found_method = found_instance->second.find(VSOMEIP_ANY_METHOD);
- }
-
- if (found_method != found_instance->second.end()) {
- found_method->second(_message);
- } else {
- if (_message->get_message_type() < message_type_enum::RESPONSE) {
- VSOMEIP_ERROR << "Unknown method " << std::hex << (int)_message->get_method_id();
- send_error_message(_message, return_code_enum::UNKNOWN_METHOD);
- }
- }
- } else {
- // It would be nice to be able to send "UNKNOWN SERVICE INSTANCE" here, but
- // SOME/IP does not define this error...
- if (_message->get_message_type() < message_type_enum::RESPONSE) {
- VSOMEIP_ERROR << "Unknown instance " << std::hex << (int)_message->get_instance_id();
- send_error_message(_message, return_code_enum::UNKNOWN_SERVICE);
- }
- }
- } else {
- if (_message->get_message_type() < message_type_enum::RESPONSE) {
- VSOMEIP_ERROR << "Unknown service " << std::hex << (int)_message->get_service_id();
- send_error_message(_message, return_code_enum::UNKNOWN_SERVICE);
- }
- }
-}
-
-void application_impl::send_error_message(std::shared_ptr< message > &_request, return_code_enum _error) {
- std::shared_ptr< message > response (vsomeip::factory::get_instance()->create_response(_request.get()));
- response->set_return_code(_error);
- send(response.get(), (ip_protocol::TCP == _request->get_source()->get_protocol()), true);
-}
-
-void application_impl::catch_up_registrations() {
-}
-
-boost::shared_ptr< serializer > & application_impl::get_serializer() {
- return serializer_;
-}
-
-boost::shared_ptr< deserializer > & application_impl::get_deserializer() {
- return deserializer_;
-}
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/client_impl.cpp b/vsomeip/src/vsomeip/client_impl.cpp
deleted file mode 100644
index f41d9e3..0000000
--- a/vsomeip/src/vsomeip/client_impl.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// client_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <boost/asio/buffer.hpp>
-#include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/ip/udp.hpp>
-#include <boost/asio/placeholders.hpp>
-#include <boost/bind.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/factory.hpp>
-#include <vsomeip_internal/client_impl.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-
-namespace vsomeip {
-
-template < typename Protocol, int MaxBufferSize >
-client_impl< Protocol, MaxBufferSize >::client_impl(
- managing_proxy_impl *_owner, const endpoint *_location)
- : participant_impl< MaxBufferSize >(_owner, _location),
- socket_(_owner->get_service()),
- connect_timer_(_owner->get_service()),
- flush_timer_(_owner->get_service()),
- local_(boost::asio::ip::address::from_string(_location->get_address()),
- _location->get_port()),
- connect_timeout_(VSOMEIP_DEFAULT_CONNECT_TIMEOUT), // TODO: use config variable
- is_connected_(false) {
-}
-
-template < typename Protocol, int MaxBufferSize >
-client_impl< Protocol, MaxBufferSize >::~client_impl() {
-}
-
-template < typename Protocol, int MaxBufferSize >
-const uint8_t * client_impl< Protocol, MaxBufferSize >::get_buffer() const {
- return buffer_.data();
-}
-
-template < typename Protocol, int MaxBufferSize >
-bool client_impl< Protocol, MaxBufferSize >::is_client() const {
- return true;
-}
-
-template < typename Protocol, int MaxBufferSize >
-void client_impl< Protocol, MaxBufferSize >::stop() {
- if (socket_.is_open())
- socket_.close();
-}
-
-template < typename Protocol, int MaxBufferSize >
-void client_impl< Protocol, MaxBufferSize >::restart() {
- receive();
-}
-
-template < typename Protocol, int MaxBufferSize >
-bool client_impl< Protocol, MaxBufferSize >::send(
- const uint8_t *_data, uint32_t _size, bool _flush) {
-
- bool is_queue_empty(packet_queue_.empty());
-
- if (packetizer_.size() + _size > MaxBufferSize) {
- VSOMEIP_WARNING << "Implicitly flushing.";
- packet_queue_.push_back(packetizer_);
- packetizer_.clear();
- if (is_queue_empty && is_connected_)
- send_queued();
- }
-
- packetizer_.insert(packetizer_.end(), _data, _data + _size);
-
- if (_flush) {
- flush_timer_.cancel();
- packet_queue_.push_back(packetizer_);
- packetizer_.clear();
- if (is_queue_empty && is_connected_)
- send_queued();
- } else {
- flush_timer_.expires_from_now(
- std::chrono::milliseconds(VSOMEIP_DEFAULT_FLUSH_TIMEOUT)); // TODO: use config variable
- flush_timer_.async_wait(
- boost::bind(
- &client_impl<Protocol, MaxBufferSize>::flush_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
- }
-
- return true;
-}
-
-template < typename Protocol, int MaxBufferSize >
-bool client_impl< Protocol, MaxBufferSize >::flush() {
- bool is_successful(true);
-
- if (!packetizer_.empty()) {
- packet_queue_.push_back(packetizer_);
- packetizer_.clear();
- send_queued();
- } else {
- is_successful = false;
- }
-
- return is_successful;
-}
-
-template < typename Protocol, int MaxBufferSize >
-void client_impl< Protocol, MaxBufferSize >::connect_cbk(
- boost::system::error_code const &_error) {
-
- if (_error) {
- socket_.close();
-
- connect_timer_.expires_from_now(
- std::chrono::milliseconds(connect_timeout_));
- connect_timer_.async_wait(
- boost::bind(
- &client_impl<Protocol, MaxBufferSize>::wait_connect_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-
- // next time we wait longer
- connect_timeout_ <<= 1;
- } else {
- connect_timer_.cancel();
- connect_timeout_ = VSOMEIP_DEFAULT_CONNECT_TIMEOUT; // TODO: use config variable
- is_connected_ = true;
- if (!packet_queue_.empty()) {
- send_queued();
- }
- receive();
- }
-}
-
-template < typename Protocol, int MaxBufferSize >
-void client_impl< Protocol, MaxBufferSize >::wait_connect_cbk(
- boost::system::error_code const &_error) {
-
- if (!_error) {
- connect();
- }
-}
-
-template < typename Protocol, int MaxBufferSize >
-void client_impl< Protocol, MaxBufferSize >::send_cbk(
- boost::system::error_code const &_error, std::size_t _bytes) {
-
- if (!_error && _bytes > 0) {
- packet_queue_.pop_front();
-
- if (!packet_queue_.empty()) {
- send_queued();
- }
- } else {
- if (_error == boost::asio::error::broken_pipe) {
- is_connected_ = false;
- socket_.close();
- connect();
- }
- }
-}
-
-template < typename Protocol, int MaxBufferSize >
-void client_impl< Protocol, MaxBufferSize >::flush_cbk(
- boost::system::error_code const &_error) {
- if (!_error) {
- (void)flush();
- }
-}
-
-// Instantiate template
-template class client_impl< boost::asio::ip::tcp, VSOMEIP_MAX_TCP_MESSAGE_SIZE >;
-template class client_impl< boost::asio::ip::udp, VSOMEIP_MAX_UDP_MESSAGE_SIZE >;
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip/configuration.cpp b/vsomeip/src/vsomeip/configuration.cpp
deleted file mode 100644
index 17b2867..0000000
--- a/vsomeip/src/vsomeip/configuration.cpp
+++ /dev/null
@@ -1,535 +0,0 @@
-//
-// configuration.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#include <fstream>
-#include <map>
-
-#include <boost/algorithm/string.hpp>
-#include <boost/program_options.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/configuration.hpp>
-
-//#define VSOMEIP_CONFIGURATION_DEBUG
-
-namespace options = boost::program_options;
-
-namespace vsomeip {
-
-std::string configuration::configuration_file_path_;
-std::map< std::string, configuration * > configuration::configurations__;
-
-void configuration::init(int _options_count, char **_options) {
- options::variables_map command_line_options;
-
- try {
- options::options_description valid_options("valid_options");
- valid_options.add_options()
- (
- "config",
- options::value< std::string >()->default_value(VSOMEIP_DEFAULT_CONFIGURATION_FILE_PATH),
- "Path to configuration file"
- );
-
- options::store(
- options::parse_command_line(
- _options_count,
- _options,
- valid_options
- ),
- command_line_options
- );
-
- options::notify(command_line_options);
- }
-
- catch (...) {
- // intentionally left empty
- }
-
- if (command_line_options.count("config")) {
- configuration_file_path_
- = command_line_options["config"].as< std::string >();
- }
-}
-
-// TODO: check whether ref_ could be replaced using shared pointers
-configuration * configuration::request(const std::string &_name) {
- configuration * requested_configuration = 0;
- auto found_configuration = configurations__.find(_name);
- if (found_configuration == configurations__.end()) {
- requested_configuration = new configuration;
- requested_configuration->read_configuration(_name);
- configurations__[_name] = requested_configuration;
- } else {
- requested_configuration = found_configuration->second;
- }
-
- requested_configuration->ref_ ++;
- return requested_configuration;
-}
-
-void configuration::release(const std::string &_name) {
- configuration * requested_configuration = 0;
- auto found_configuration = configurations__.find(_name);
- if (found_configuration != configurations__.end()) {
- requested_configuration = found_configuration->second;
- requested_configuration->ref_ --;
- if (requested_configuration->ref_ == 0) {
- configurations__.erase(_name);
- delete requested_configuration;
- }
- }
-}
-
-configuration::configuration()
- : use_console_logger_(false),
- use_file_logger_(false),
- use_dlt_logger_(false),
- loglevel_("info"),
- logfile_path_("./vsomeip.log"),
- is_service_discovery_enabled_(false),
- is_watchdog_enabled_(false),
- is_endpoint_manager_enabled_(true),
- client_id_(0),
- slots_(10),
- protocol_("udp.v4"),
- unicast_address_("127.0.0.1"),
- multicast_address_(""),
- netmask_("255.255.255.0"),
- port_(30490),
- min_initial_delay_(10),
- max_initial_delay_(100),
- repetition_base_delay_(200),
- repetition_max_(3),
- ttl_(0xFFFFFFFF),
- cyclic_offer_delay_(3000),
- cyclic_request_delay_(3000),
- request_response_delay_(2000) { // TODO: symbolic constants instead of magic values
-}
-
-configuration::~configuration() {
-}
-
-void configuration::read_configuration(const std::string &_name) {
- static bool has_read = false;
- if (!has_read) {
- options::options_description its_options_description;
- its_options_description.add_options()
- (
- "someip.loglevel",
- options::value< std::string >(),
- "Loglevel to be used by the vsomeip daemon"
- )
- (
- "someip.loggers",
- options::value< std::string >(),
- "Loggers (Console, File, DLT) to be used by vsomeip daemon"
- )
- (
- "someip.daemon.enable_service_discovery",
- options::value< bool >(),
- "Enable service discovery by vsomeip daemon"
- )
- (
- "someip.daemon.enable_watchdog",
- options::value< bool >(),
- "Enable watchdog of vsomeip daemon"
- )
- (
- "someip.application.slots",
- options::value< int >(),
- "Maximum number of received messages an application can buffer"
- )
- (
- "someip.application.client_id",
- options::value< int >(),
- "The client identifier for the application"
- )
- (
- "someip.application.enable_service_discovery",
- options::value< bool >(),
- "Applications use / do not use service discovery"
- )
- (
- "someip.application.enable_watchdog",
- options::value< bool >(),
- "Applications use / do not use watchdog"
- )
- (
- "someip.application.enable_endpoint_manager",
- options::value< bool >(),
- "Applications use / do not use endpoint manager"
- )
- (
- "someip.service_discovery.protocol",
- options::value< std::string >(),
- "Protocol used to communicate to Service Discovery"
- )
- (
- "someip.service_discovery.unicast",
- options::value< std::string >(),
- "Unicast address of Service Discovery"
- )
- (
- "someip.service_discovery.multicast",
- options::value< std::string >(),
- "Multicast address to be used by Service Discovery"
- )
- (
- "someip.service_discovery.netmask",
- options::value< std::string >(),
- "Netmask to define the subnet covered by Service Discovery"
- )
- (
- "someip.service_discovery.port",
- options::value< int >(),
- "Service discovery port"
- )
- (
- "someip.service_discovery.min_initial_delay",
- options::value< int >(),
- "Minimum initial delay before first offer message"
- )
- (
- "someip.service_discovery.max_initial_delay",
- options::value< int >(),
- "Maximum initial delay before first offer message"
- )
- (
- "someip.service_discovery.repetition_base_delay",
- options::value< int >(),
- "Base delay for the repetition phase."
- )
- (
- "someip.service_discovery.repetition_max",
- options::value< int >(),
- "Maximum number of repetitions in the repetition phase."
- )
- (
- "someip.service_discovery.ttl",
- options::value< int >(),
- "Lifetime of service discovery entry"
- )
- (
- "someip.service_discovery.cyclic_offer_delay",
- options::value< int >(),
- "Cycle of the OfferService messages in the main phase"
- )
- (
- "someip.service_discovery.cyclic_request_delay",
- options::value< int >(),
- "Cycle of the FindService messages in the main phase"
- )
- (
- "someip.service_discovery.request_response_delay",
- options::value< int >(),
- "Delay of an unicast answer to a multicast message."
- );
-
- // Local overrides
- if (_name != "") {
- std::string local_override("someip.application." + _name + ".slots");
- its_options_description.add_options()
- (
- local_override.c_str(),
- options::value< int >(),
- "Application specific setting for number of receiver slots."
- );
- local_override = "someip.application." + _name + ".client_id";
- its_options_description.add_options()
- (
- local_override.c_str(),
- options::value< int >(),
- "Application specific setting for client identifier."
- );
- local_override = "someip.application." + _name + ".enable_service_discovery";
- its_options_description.add_options()
- (
- local_override.c_str(),
- options::value< bool >(),
- "Application specific setting for service discovery usage."
- );
- local_override = "someip.application." + _name + ".enable_watchdog";
- its_options_description.add_options()
- (
- local_override.c_str(),
- options::value< bool >(),
- "Application specific setting for watchdog usage."
- );
- local_override = "someip.application." + _name + ".enable_endpoint_manager";
- its_options_description.add_options()
- (
- local_override.c_str(),
- options::value< bool >(),
- "Application specific setting for endpoint manager usage."
- );
- };
-
- options::variables_map its_options;
- std::ifstream its_configuration_file;
- its_configuration_file.open(configuration_file_path_.c_str());
- if (its_configuration_file.is_open()) {
- try {
- options::store(
- options::parse_config_file(
- its_configuration_file,
- its_options_description,
- true),
- its_options
- );
- }
-
- catch (...) {
- // Intentionally left empty
- }
-
-#ifdef VSOMEIP_CONFIGURATION_DEBUG
- for (auto i : its_options) {
- std::cout << i.first << " --> ";
- try {
- std::cout << i.second.as< std::string >();
- }
- catch (...) {
- try {
- std::cout << i.second.as< int >();
- }
- catch (...) {
- try {
- std::cout << i.second.as< bool >();
- }
- catch (...) {};
- }
- }
-
- std::cout << std::endl;
- }
-#endif
-
- // General
- if (its_options.count("someip.loggers"))
- read_loggers(its_options["someip.loggers"].as< std::string >());
-
- if (its_options.count("someip.loglevel"))
- read_loglevel(its_options["someip.loglevel"].as< std::string >());
-
- // Daemon
- if (its_options.count("someip.daemon.enable_service_discovery"))
- is_service_discovery_enabled_
- = its_options["someip.daemon.enable_service_discovery"].as< bool >();
-
- if (its_options.count("someip.daemon.enable_watchdog"))
- is_watchdog_enabled_
- = its_options["someip.daemon.enable_watchdog"].as< bool >();
-
- // Application
- if (its_options.count("someip.application.slots"))
- slots_ = its_options["someip.application.slots"].as< int >();
-
- if (its_options.count("someip.application.client_id"))
- client_id_ = its_options["someip.application.slots"].as< int >();
-
- if (its_options.count("someip.application.enable_service_discovery"))
- is_service_discovery_enabled_ = its_options["someip.application.enable_service_discovery"].as< bool >();
-
- if (its_options.count("someip.application.enable_watchdog"))
- is_watchdog_enabled_ = its_options["someip.application.enable_watchdog"].as< bool >();
-
- if (its_options.count("someip.application.enable_endpoint_manager"))
- is_endpoint_manager_enabled_ = its_options["someip.application.enable_endpoint_manager"].as< bool >();
-
- // Service Discovery
- if (its_options.count("someip.service_discovery.protocol"))
- protocol_ = its_options["someip.service_discovery.protocol"].as< std::string >();
-
- if (its_options.count("someip.service_discovery.unicast"))
- unicast_address_ = its_options["someip.service_discovery.unicast"].as< std::string >();
-
- if (its_options.count("someip.service_discovery.multicast"))
- multicast_address_ = its_options["someip.service_discovery.multicast"].as< std::string >();
-
- if (its_options.count("someip.service_discovery.netmask"))
- netmask_ = its_options["someip.service_discovery.netmask"].as< std::string >();
-
- if (its_options.count("someip.service_discovery.port"))
- port_ = its_options["someip.service_discovery.port"].as< int >();
-
- if (its_options.count("someip.service_discovery.min_initial_delay"))
- min_initial_delay_
- = its_options["someip.service_discovery.min_initial_delay"].as< int >();
-
- if (its_options.count("someip.service_discovery.max_initial_delay"))
- max_initial_delay_
- = its_options["someip.service_discovery.max_initial_delay"].as< int >();
-
- if (its_options.count("someip.service_discovery.repetition_base_delay"))
- repetition_base_delay_
- = its_options["someip.service_discovery.repetition_base_delay"].as< int >();
-
- if (its_options.count("someip.service_discovery.repetition_max"))
- repetition_max_
- = its_options["someip.service_discovery.repetition_max"].as< int >();
-
- if (its_options.count("someip.service_discovery.cyclic_offer_delay"))
- cyclic_offer_delay_
- = its_options["someip.service_discovery.cyclic_offer_delay"].as< int >();
-
- if (its_options.count("someip.service_discovery.cyclic_request_delay"))
- cyclic_request_delay_
- = its_options["someip.service_discovery.cyclic_request_delay"].as< int >();
-
- if (its_options.count("someip.service_discovery.request_response_delay"))
- request_response_delay_
- = its_options["someip.service_discovery.request_response_delay"].as< int >();
-
- if (_name != "") {
- if (its_options.count("someip.application." + _name + ".slots"))
- slots_ = its_options["someip.application." + _name + ".slots"].as< int >();
-
- if (its_options.count("someip.application." + _name + ".client_id")) {
- client_id_ = its_options["someip.application." + _name + ".client_id"].as< int >();
- }
-
- if (its_options.count("someip.application." + _name + ".enable_service_discovery")) {
- is_service_discovery_enabled_ = its_options["someip.application." + _name + ".enable_service_discovery"].as< bool >();
- }
-
- if (its_options.count("someip.application." + _name + ".enable_watchdog")) {
- is_watchdog_enabled_ = its_options["someip.application." + _name + ".enable_watchdog"].as< bool >();
- }
-
- if (its_options.count("someip.application." + _name + ".enable_endpoint_manager")) {
- is_endpoint_manager_enabled_ = its_options["someip.application." + _name + ".enable_endpoint_manager"].as< bool >();
- }
- }
- }
- }
-}
-
-bool configuration::use_console_logger() const {
- return use_console_logger_;
-}
-
-bool configuration::use_file_logger() const {
- return use_file_logger_;
-}
-
-bool configuration::use_dlt_logger() const {
- return use_dlt_logger_;
-}
-
-const std::string & configuration::get_loglevel() const {
- return loglevel_;
-}
-
-const std::string & configuration::get_logfile_path() const {
- return logfile_path_;
-}
-
-bool configuration::is_service_discovery_enabled() const {
- return is_service_discovery_enabled_;
-}
-
-bool configuration::is_watchdog_enabled() const {
- return is_watchdog_enabled_;
-}
-
-bool configuration::is_endpoint_manager_enabled() const {
- return is_endpoint_manager_enabled_;
-}
-
-uint16_t configuration::get_client_id() const {
- return client_id_;
-}
-
-uint8_t configuration::get_slots() const {
- return slots_;
-}
-
-const std::string & configuration::get_protocol() const {
- return protocol_;
-}
-
-const std::string & configuration::get_unicast_address() const {
- return unicast_address_;
-}
-
-const std::string & configuration::get_multicast_address() const {
- return multicast_address_;
-}
-
-const std::string & configuration::get_netmask() const {
- return netmask_;
-}
-
-uint16_t configuration::get_port() const {
- return port_;
-}
-
-uint32_t configuration::get_min_initial_delay() const {
- return min_initial_delay_;
-}
-
-uint32_t configuration::get_max_initial_delay() const {
- return max_initial_delay_;
-}
-
-uint32_t configuration::get_repetition_base_delay() const {
- return repetition_base_delay_;
-}
-
-uint8_t configuration::get_repetition_max() const {
- return repetition_max_;
-}
-
-uint32_t configuration::get_ttl() const {
- return ttl_;
-}
-
-uint32_t configuration::get_cyclic_offer_delay() const {
- return cyclic_offer_delay_;
-}
-
-uint32_t configuration::get_cyclic_request_delay() const {
- return cyclic_request_delay_;
-}
-
-uint32_t configuration::get_request_response_delay() const {
- return request_response_delay_;
-}
-
-void configuration::read_loggers(const std::string &_logger_configuration) {
- std::string logger_configuration(_logger_configuration);
- boost::algorithm::trim(logger_configuration);
-
- std::vector<std::string> loggers;
- boost::split(loggers, logger_configuration, boost::is_any_of("|"));
-
- for (auto i: loggers) {
- boost::algorithm::trim(i);
- if ("console" == i) use_console_logger_ = true;
- else if ("file" == i) use_file_logger_ = true;
- else if ("dlt" == i) use_dlt_logger_ = true;
- }
-}
-
-void configuration::read_loglevel(const std::string &_loglevel) {
- if (_loglevel == "info"
- || _loglevel == "debug"
- || _loglevel == "warning"
- || _loglevel == "error"
- || _loglevel == "fatal"
- || _loglevel == "verbose") {
- loglevel_ = _loglevel;
- } else {
- loglevel_ = "info";
- }
-}
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip/debug.cpp b/vsomeip/src/vsomeip/debug.cpp
deleted file mode 100644
index 33618cd..0000000
--- a/vsomeip/src/vsomeip/debug.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// debug.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#include <vsomeip_internal/debug.hpp>
-
-namespace vsomeip {
-
-bool disable_internal_routing = false;
-
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip/endpoint_impl.cpp b/vsomeip/src/vsomeip/endpoint_impl.cpp
deleted file mode 100644
index 73923d8..0000000
--- a/vsomeip/src/vsomeip/endpoint_impl.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// endpoint_impl.cpp
-//
-// Author: Lutz Bichler <Lutz.Bichler@bmwgroup.com>
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/endpoint_impl.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-
-namespace vsomeip {
-
-endpoint_impl::endpoint_impl(
- boost::asio::ip::address _address, ip_port _port, ip_protocol _protocol)
- : address_(_address),
- port_(_port),
- protocol_(_protocol) {
-}
-
-endpoint_impl::~endpoint_impl() {
-}
-
-ip_address endpoint_impl::get_address() const {
- return address_.to_string();
-}
-
-ip_port endpoint_impl::get_port() const {
- return port_;
-}
-
-ip_protocol endpoint_impl::get_protocol() const {
- return protocol_;
-}
-
-ip_protocol_version endpoint_impl::get_version() const {
- return (address_.is_v4() ?
- ip_protocol_version::V4 : ip_protocol_version::V6);
-}
-
-bool endpoint_impl::serialize(serializer *_to) const {
- bool is_successful = _to->serialize(static_cast< uint8_t >(protocol_));
- is_successful = is_successful && _to->serialize(static_cast< uint16_t >(port_));
-
- if (address_.is_v4()) {
- boost::asio::ip::address_v4 tmp_address = address_.to_v4();
- boost::asio::ip::address_v4::bytes_type bytes = tmp_address.to_bytes();
- is_successful = is_successful && _to->serialize(bytes.data(), bytes.size());
- } else {
- boost::asio::ip::address_v6 tmp_address = address_.to_v6();
- boost::asio::ip::address_v6::bytes_type bytes = tmp_address.to_bytes();
- is_successful = is_successful && _to->serialize(bytes.data(), bytes.size());
- }
-
- return is_successful;
-}
-
-} // namespace vsomeip
-
-
-
-
-
diff --git a/vsomeip/src/vsomeip/factory.cpp b/vsomeip/src/vsomeip/factory.cpp
deleted file mode 100644
index 69f18b8..0000000
--- a/vsomeip/src/vsomeip/factory.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// factory_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip/factory.hpp>
-#include <vsomeip_internal/factory_impl.hpp>
-
-namespace vsomeip {
-
-factory * factory::get_instance() {
- return factory_impl::get_instance();
-}
-
-} // namespace vsomeip
-
-
-
-
-
-
diff --git a/vsomeip/src/vsomeip/factory_impl.cpp b/vsomeip/src/vsomeip/factory_impl.cpp
deleted file mode 100644
index 3c304b2..0000000
--- a/vsomeip/src/vsomeip/factory_impl.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// factory_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <cstddef>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip_internal/application_impl.hpp>
-#include <vsomeip_internal/byteorder.hpp>
-#include <vsomeip_internal/endpoint_impl.hpp>
-#include <vsomeip_internal/application_impl.hpp>
-#include <vsomeip_internal/message_impl.hpp>
-#include <vsomeip_internal/field_impl.hpp>
-#include <vsomeip_internal/factory_impl.hpp>
-
-namespace vsomeip {
-
-factory * factory_impl::get_instance() {
- static factory_impl the_factory;
- return &the_factory;
-}
-
-factory_impl::~factory_impl() {
-}
-
-application * factory_impl::create_application(const std::string &_name) const {
- return new application_impl(_name);
-}
-
-endpoint * factory_impl::get_endpoint(ip_address _address, ip_port _port, ip_protocol _protocol) {
-
- boost::asio::ip::address endpoint_address(boost::asio::ip::address::from_string(_address));
- uint32_t version = (endpoint_address.is_v4() ? 4 : 6);
-
- uint32_t identifier = (((uint32_t) _protocol) << 24
- | ((uint32_t) version) << 16 | ((uint32_t) _port));
-
- std::map< std::string, endpoint * >& matching_identifier =
- endpoints_[identifier];
-
- endpoint *requested_endpoint = 0;
-
- auto endpoint_iterator = matching_identifier.find(_address);
- if (endpoint_iterator == matching_identifier.end())
- {
- requested_endpoint = new endpoint_impl(endpoint_address, _port, _protocol);
- matching_identifier[_address] = requested_endpoint;
- } else {
- requested_endpoint = endpoint_iterator->second;
- }
-
- return requested_endpoint;
-}
-
-endpoint * factory_impl::get_endpoint(const uint8_t *_bytes, uint32_t _size) {
- endpoint *the_endpoint = 0;
- if (0 != _bytes && _size > VSOMEIP_MIN_ENDPOINT_SIZE) {
- ip_address address;
- ip_port port;
- ip_protocol protocol;
-
- protocol = static_cast< ip_protocol >(_bytes[0]);
- port = VSOMEIP_BYTES_TO_WORD(_bytes[1], _bytes[2]);
-
- if (_size == 7) {
- ipv4_address tmp = VSOMEIP_BYTES_TO_LONG(_bytes[3], _bytes[4], _bytes[5], _bytes[6]);
- boost::asio::ip::address_v4 tmp_address(tmp);
- address = tmp_address.to_string();
- } else {
- boost::asio::ip::address_v6::bytes_type tmp;
- std::memcpy(tmp.data(), &_bytes[3], _size - 3);
- boost::asio::ip::address_v6 tmp_address(tmp);
- address = tmp_address.to_string();
- }
-
- the_endpoint = get_endpoint(address, port, protocol);
- }
-
- return the_endpoint;
-}
-
-message * factory_impl::create_message() const {
- return new message_impl;
-}
-
-message * factory_impl::create_response(const message *_request) const {
- message *response = 0;
- if (0 != _request) {
- response = new message_impl;
- response->set_source(_request->get_target());
- response->set_target(_request->get_source());
- response->set_service_id(_request->get_service_id());
- response->set_instance_id(_request->get_instance_id());
- response->set_method_id(_request->get_method_id());
- response->set_client_id(_request->get_client_id());
- response->set_session_id(_request->get_session_id());
- response->set_message_type(message_type_enum::RESPONSE);
- response->set_return_code(return_code_enum::OK);
- }
-
- return response;
-}
-
-field * factory_impl::create_field(application *_application, service_id _service, instance_id _instance, event_id _event) const {
- return new field_impl(_application, _service, _instance, _event);
-}
-
-
-} // namespace vsomeip
-
-
diff --git a/vsomeip/src/vsomeip/field_impl.cpp b/vsomeip/src/vsomeip/field_impl.cpp
deleted file mode 100644
index fe98cd8..0000000
--- a/vsomeip/src/vsomeip/field_impl.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// field_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iostream>
-
-#include <vsomeip_internal/application_impl.hpp>
-#include <vsomeip_internal/field_impl.hpp>
-
-namespace vsomeip {
-
-field_impl::field_impl(application *_application, service_id _service, instance_id _instance, event_id _event)
- : application_(_application),
- service_(_service),
- instance_(_instance),
- event_(_event),
- update_cycle_(0),
- payload_(this) {
-}
-
-field_impl::~field_impl() {
-}
-
-service_id field_impl::get_service() const {
- return service_;
-}
-
-instance_id field_impl::get_instance() const {
- return instance_;
-}
-
-
-event_id field_impl::get_event() const {
- return event_;
-}
-
-uint32_t field_impl::get_update_cycle() const {
- return update_cycle_;
-}
-
-void field_impl::set_update_cycle(uint32_t _update_cycle) {
- update_cycle_ = _update_cycle;
-}
-
-const payload & field_impl::get_payload() const {
- return payload_;
-}
-
-payload & field_impl::get_payload() {
- return payload_;
-}
-
-void field_impl::notify() const {
- application_->update_field(this);
-}
-
-
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip/log_user.cpp b/vsomeip/src/vsomeip/log_user.cpp
deleted file mode 100644
index 62f92a9..0000000
--- a/vsomeip/src/vsomeip/log_user.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// log_user.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/log_owner.hpp>
-#include <vsomeip_internal/log_user.hpp>
-
-namespace vsomeip {
-
-log_user::log_user(log_owner &_owner)
- : logger_(_owner.logger_) {
-}
-
-log_user::log_user(log_user &_other)
- : logger_(_other.logger_) {
-}
-
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip/managed_proxy_impl.cpp b/vsomeip/src/vsomeip/managed_proxy_impl.cpp
deleted file mode 100644
index 3c49fa2..0000000
--- a/vsomeip/src/vsomeip/managed_proxy_impl.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-// managed_proxy_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <cstring>
-
-#include <boost/asio/placeholders.hpp>
-#include <boost/bind.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/message.hpp>
-#include <vsomeip_internal/application_impl.hpp>
-#include <vsomeip_internal/configuration.hpp>
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/enumeration_types.hpp>
-#include <vsomeip_internal/managed_proxy_impl.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/message_queue.hpp>
-#include <vsomeip_internal/serializer.hpp>
-
-namespace vsomeip {
-
-managed_proxy_impl::managed_proxy_impl(application_base_impl &_owner)
- : administration_proxy_impl(_owner),
- log_user(_owner),
- proxy_base_impl(_owner) {
-}
-
-managed_proxy_impl::~managed_proxy_impl() {
-}
-
-void managed_proxy_impl::init() {
- administration_proxy_impl::init();
-}
-
-void managed_proxy_impl::start() {
- administration_proxy_impl::start();
-}
-
-void managed_proxy_impl::stop() {
- administration_proxy_impl::stop();
-}
-
-bool managed_proxy_impl::send(message_base *_message, bool _reliable, bool _flush) {
- if (0 == _message) {
- VSOMEIP_WARNING << "managed_proxy_impl::send: called without message object";
- return false;
- }
-
- instance_id instance = _message->get_instance_id();
- message_type_enum message_type = _message->get_message_type();
- client_id id = owner_.get_id();
-
- uint32_t message_size =
- VSOMEIP_STATIC_HEADER_SIZE
- + _message->get_length()
- + sizeof(instance)
- + sizeof(_reliable)
- + sizeof(_flush)
- + VSOMEIP_PROTOCOL_OVERHEAD;
-
- boost::shared_ptr< serializer > its_serializer(owner_.get_serializer());
- bool is_successful(its_serializer->serialize(_message));
- if (!is_successful) {
- VSOMEIP_ERROR << "managed_proxy_impl::send: message serialization failed!";
- return false;
- }
-
- std::vector< uint8_t > message_data(message_size);
-
- // Start & End Tag
- std::memcpy(&message_data[0], &VSOMEIP_PROTOCOL_START_TAG, sizeof(VSOMEIP_PROTOCOL_START_TAG));
- std::memcpy(&message_data[message_size-4], &VSOMEIP_PROTOCOL_END_TAG, sizeof(VSOMEIP_PROTOCOL_END_TAG));
-
- // Sender & Message Type
- std::memcpy(&message_data[VSOMEIP_PROTOCOL_ID], &id, sizeof(id));
-
- if (0xFE & its_serializer->get_data()[2]) {
- message_data[VSOMEIP_PROTOCOL_COMMAND] = static_cast<uint8_t>(command_enum::SOMEIP_MESSAGE);
- } else {
- message_data[VSOMEIP_PROTOCOL_COMMAND] = static_cast<uint8_t>(command_enum::SOMEIP_FIELD);
- }
-
- // Payload length & Message
- message_size -= VSOMEIP_PROTOCOL_OVERHEAD;
- std::memcpy(&message_data[VSOMEIP_PROTOCOL_PAYLOAD_SIZE], &message_size, sizeof(message_size));
- message_size = its_serializer->get_size();
- std::memcpy(&message_data[VSOMEIP_PROTOCOL_PAYLOAD], its_serializer->get_data(), message_size);
- its_serializer->reset();
-
- // Instance, Reliable & Flush Parameter
- std::memcpy(&message_data[VSOMEIP_PROTOCOL_PAYLOAD + message_size], &instance, sizeof(instance));
- message_data[VSOMEIP_PROTOCOL_PAYLOAD + message_size + sizeof(instance)] = static_cast< uint8_t >(_reliable);
- message_data[VSOMEIP_PROTOCOL_PAYLOAD + message_size + sizeof(instance) + sizeof(_reliable)] = static_cast< uint8_t >(_flush);
-
- send_buffers_.push_back(message_data);
-
- // Now we need to lock
- mutex_.lock();
-
- message_queue *target_queue = 0;
- if (message_type < message_type_enum::RESPONSE) {
- target_queue = find_target_queue(_message->get_service_id(), instance);
- } else {
- target_queue = find_target_queue(_message->get_client_id());
- }
-
- if (0 == target_queue)
- target_queue = daemon_queue_.get();
-
- if (target_queue != daemon_queue_.get() || is_open_) {
- std::vector< uint8_t >& current_message = send_buffers_.back();
- target_queue->async_send(
- current_message.data(),
- current_message.size(),
- 0,
- boost::bind(
- &managed_proxy_impl::send_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
- } else {
- VSOMEIP_FATAL << "No queue! Perhaps we need to do something now...";
- }
- mutex_.unlock();
-
- return true;
-}
-
-void managed_proxy_impl::send_cbk(boost::system::error_code const &_error) {
- if (_error) {
- VSOMEIP_ERROR << "Queue " << application_queue_name_
- << ": Error while sending (" << _error.message() << ")";
- }
- send_buffers_.pop_front();
-}
-
-bool managed_proxy_impl::enable_magic_cookies(
- service_id _service, instance_id _instance) {
- return false;
-}
-
-bool managed_proxy_impl::disable_magic_cookies(
- service_id _service, instance_id _instance) {
- return false;
-}
-
-void managed_proxy_impl::on_message(client_id _id, const uint8_t *_data, uint32_t _size) {
- if (_size < 8) {
- return;
- }
-
- // deserialize the message
- uint32_t message_size = VSOMEIP_BYTES_TO_LONG(
- _data[4], _data[5], _data[6], _data[7]);
-
- boost::shared_ptr< deserializer > its_deserializer(owner_.get_deserializer());
- its_deserializer->set_data(_data, message_size + VSOMEIP_STATIC_HEADER_SIZE);
- std::shared_ptr< message > its_message(its_deserializer->deserialize_message());
- its_deserializer->reset();
-
- if (its_message) {
- instance_id its_instance;
- std::memcpy(&its_instance, &_data[message_size + VSOMEIP_STATIC_HEADER_SIZE], sizeof(its_instance));
- its_message->set_instance_id(its_instance);
-
- owner_.handle_message(its_message);
- }
-}
-
-void managed_proxy_impl::catch_up_registrations() {
- administration_proxy_impl::catch_up_registrations();
- owner_.catch_up_registrations();
-}
-
-void managed_proxy_impl::process_command(command_enum _command, client_id _client, const uint8_t *_payload, uint32_t _payload_size) {
- client_id its_client;
-
- switch (_command) {
- case command_enum::SOMEIP_MESSAGE:
- on_message(_client, _payload, _payload_size);
- break;
-
- default:
- administration_proxy_impl::process_command(_command, _client, _payload, _payload_size);
- break;
- }
-}
-
-message_queue * managed_proxy_impl::find_target_queue(service_id _service, instance_id _instance) const {
- message_queue *requested_queue = 0;
-
- auto find_service = requested_.find(_service);
- if (find_service != requested_.end()) {
- auto find_instance = find_service->second.find(_instance);
- if (find_instance != find_service->second.end()) {
- requested_queue = find_instance->second.queue_.get();
- }
- }
-
- return requested_queue;
-}
-
-message_queue * managed_proxy_impl::find_target_queue(client_id _client) {
- message_queue *requested_queue = 0;
-
- auto found_queue_name = other_queue_names_.find(_client);
- if (found_queue_name != other_queue_names_.end()) {
- auto found_queue = queues_.find(found_queue_name->second);
- if (found_queue != queues_.end()) {
- requested_queue = found_queue->second;
- } else {
- requested_queue = new message_queue(owner_.get_sender_service(), this);
- queues_[found_queue_name->second] = requested_queue;
- requested_queue->async_open(
- queue_name_prefix_ + found_queue_name->second,
- boost::bind(
- &managed_proxy_impl::response_cbk,
- this,
- boost::asio::placeholders::error,
- requested_queue
- )
- );
- }
- }
-
- return requested_queue;
-}
-
-void managed_proxy_impl::response_cbk(
- boost::system::error_code const &_error,
- message_queue *_queue) {
-}
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/managing_proxy_impl.cpp b/vsomeip/src/vsomeip/managing_proxy_impl.cpp
deleted file mode 100644
index 7e98d8e..0000000
--- a/vsomeip/src/vsomeip/managing_proxy_impl.cpp
+++ /dev/null
@@ -1,460 +0,0 @@
-//
-// managing_proxy_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/message.hpp>
-#include <vsomeip_internal/application_impl.hpp>
-#include <vsomeip_internal/client.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/serializer.hpp>
-#include <vsomeip_internal/service.hpp>
-#include <vsomeip_internal/tcp_client_impl.hpp>
-#include <vsomeip_internal/tcp_service_impl.hpp>
-#include <vsomeip_internal/udp_client_impl.hpp>
-#include <vsomeip_internal/udp_service_impl.hpp>
-
-namespace vsomeip {
-
-managing_proxy_impl::managing_proxy_impl(application_base_impl &_owner)
- : proxy_base_impl(_owner),
- log_user(_owner) {
-}
-
-managing_proxy_impl::~managing_proxy_impl() {
-}
-
-void managing_proxy_impl::init() {
-}
-
-void managing_proxy_impl::start() {
-}
-
-void managing_proxy_impl::stop() {
-}
-
-bool managing_proxy_impl::request_service(
- service_id _service, instance_id _instance,
- const endpoint *_location) {
-
- client * its_client = 0;
-
- if (0 != _location) {
- bool is_reliable = (ip_protocol::TCP == _location->get_protocol());
-
- its_client = find_or_create_client(_location);
- if (its_client) {
- client_locations_[_service][_instance][is_reliable] = _location;
- client_instances_[_location][_service] = _instance;
-
- its_client->open_filter(_service);
- }
- } else {
- VSOMEIP_DEBUG
- << "Specification of communication endpoint is missing.";
- }
-
- return (0 != its_client);
-}
-
-bool managing_proxy_impl::release_service(
- service_id _service, instance_id _instance) {
-
- client_locations_[_service].erase(_instance);
- if (0 == client_locations_[_service].size())
- client_locations_.erase(_service);
-
- const endpoint *its_reliable = find_service_location(_service, _instance, true);
- client_instances_[its_reliable].erase(_service);
- if (0 == client_instances_[its_reliable].size())
- client_instances_.erase(its_reliable);
-
- if (its_reliable) {
- client *its_client = find_client(its_reliable);
- if (its_client) {
- its_client->close_filter(_service);
- }
- }
-
- const endpoint *its_unreliable = find_service_location(_service, _instance, false);
- client_instances_[its_unreliable].erase(_service);
- if (0 == client_instances_[its_unreliable].size())
- client_instances_.erase(its_unreliable);
-
- if (its_unreliable) {
- client *its_client = find_client(its_unreliable);
- if (its_client) {
- its_client->close_filter(_service);
- }
- }
-
- return true;
-}
-
-bool managing_proxy_impl::provide_service(
- service_id _service, instance_id _instance,
- const endpoint *_location) {
-
- service *its_service = 0;
-
- if (_location) {
- bool is_reliable = (ip_protocol::TCP == _location->get_protocol());
-
- its_service = find_or_create_service(_location);
- service_locations_[_service][_instance][is_reliable] = _location;
- service_instances_[_location][_service] = _instance;
-
- if (its_service) {
- its_service->open_filter(_service);
- }
- }
-
- return (0 != its_service);
-}
-
-bool managing_proxy_impl::withdraw_service(
- service_id _service, instance_id _instance,
- const endpoint *_location) {
-
- if (0 == _location) {
- service_locations_[_service].erase(_instance);
- if (0 == service_locations_[_service].size())
- service_locations_.erase(_service);
-
- const endpoint *its_reliable = find_service_location(_service, _instance, true);
- if (0 != its_reliable) {
- service_instances_[its_reliable].erase(_service);
- if (0 == service_instances_.size())
- service_instances_.erase(its_reliable);
-
- service *its_service = find_service(its_reliable);
- if (its_service) {
- its_service->close_filter(_service);
- }
- }
-
- const endpoint *its_unreliable = find_service_location(_service, _instance, false);
- if (0 != its_unreliable) {
- service_instances_[its_unreliable].erase(_service);
- if (0 == service_instances_.size())
- service_instances_.erase(its_unreliable);
-
- service *its_service = find_service(its_unreliable);
- if (its_service) {
- its_service->close_filter(_service);
- }
-
- }
- } else {
- service_instances_[_location].erase(_service);
- if (0 == service_instances_[_location].size())
- service_instances_.erase(_location);
-
- service *its_service = find_service(_location);
- if (its_service) {
- its_service->close_filter(_service);
- }
- }
- return true;
-}
-
-bool managing_proxy_impl::start_service(
- service_id _service, instance_id _instance) {
- bool is_started(false);
- const endpoint *its_location = find_service_location(_service, _instance, true);
- if (0 == its_location) {
- its_location = find_service_location(_service, _instance, false);
- }
-
- if (0 != its_location) {
- service *its_service = find_service(its_location);
- if (its_service) {
- its_service->start();
- is_started = true;
- }
- }
- return is_started;
-}
-
-bool managing_proxy_impl::stop_service(
- service_id _service, instance_id _instance) {
- bool is_stopped(false);
- const endpoint *its_location = find_service_location(_service, _instance, true);
- if (0 == its_location) {
- its_location = find_service_location(_service, _instance, false);
- }
-
- if (0 != its_location) {
- service *its_service = find_service(its_location);
- if (its_service) {
- its_service->stop();
- is_stopped = true;
- }
- }
- return is_stopped;
-}
-
-bool managing_proxy_impl::send(message_base *_message, bool _reliable, bool _flush) {
- bool is_sent = false;
-
- if (0 != _message) {
- message_type_enum message_type = _message->get_message_type();
- if (message_type < message_type_enum::NOTIFICATION) {
- _message->set_client_id(owner_.get_id());
- }
-
- boost::shared_ptr< serializer > its_serializer(owner_.get_serializer());
- if (its_serializer->serialize(_message)) {
- if (message_type < message_type_enum::NOTIFICATION) {
- const endpoint *target = find_client_location(
- _message->get_service_id(),
- _message->get_instance_id(),
- _reliable
- );
-
- if (0 != target) {
- client * the_client = find_client(target);
- if (the_client) {
- is_sent = the_client->send(
- its_serializer->get_data(),
- its_serializer->get_size(),
- _flush
- );
- }
- } else {
- VSOMEIP_ERROR << "Cannot determine endpoint for service!";
- }
- } else {
- const endpoint *source = find_service_location(
- _message->get_service_id(),
- _message->get_instance_id(),
- _reliable
- );
-
- service * the_service = find_service(source);
- if (the_service) {
- is_sent = the_service->send(
- its_serializer->get_data(),
- its_serializer->get_size(),
- _message->get_target(),
- _flush
- );
- } else {
- VSOMEIP_DEBUG << "Attempt to send using unknown service object.";
- }
- }
- its_serializer->reset();
- } else {
- VSOMEIP_ERROR << "SOME/IP message serialization failed.";
- }
- }
-
- return is_sent;
-}
-
-void managing_proxy_impl::register_method(service_id _service, instance_id _instance, method_id _method) {
-}
-
-void managing_proxy_impl::deregister_method(service_id _service, instance_id _instance, method_id _method) {
-}
-
-bool managing_proxy_impl::provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) {
- return false;
-}
-
-bool managing_proxy_impl::withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) {
- return false;
-}
-
-bool managing_proxy_impl::add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) {
- return false;
-}
-
-bool managing_proxy_impl::remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) {
- return false;
-}
-
-bool managing_proxy_impl::request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- return false;
-}
-
-bool managing_proxy_impl::release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- return false;
-}
-
-bool managing_proxy_impl::enable_magic_cookies( service_id _service, instance_id _instance) {
- return false;
-}
-
-bool managing_proxy_impl::disable_magic_cookies(service_id _service, instance_id _instance) {
- return false;
-}
-
-boost::asio::io_service & managing_proxy_impl::get_service() {
- return owner_.get_sender_service();
-}
-
-const endpoint * managing_proxy_impl::find_client_location(
- service_id _service, instance_id _instance, bool _is_reliable) const {
-
- const endpoint *the_location = 0;
- auto found_client = client_locations_.find(_service);
- if (found_client != client_locations_.end()) {
- auto found_instance = found_client->second.find(_instance);
- if (found_instance != found_client->second.end()) {
- auto found_reliable = found_instance->second.find(_is_reliable);
- if (found_reliable != found_instance->second.end()) {
- the_location = found_reliable->second;
- }
- }
- }
- return the_location;
-}
-
-const endpoint * managing_proxy_impl::find_service_location(
- service_id _service, instance_id _instance, bool _is_reliable) const {
-
- const endpoint *the_location = 0;
- auto found_client = service_locations_.find(_service);
- if (found_client != service_locations_.end()) {
- auto found_instance = found_client->second.find(_instance);
- if (found_instance != found_client->second.end()) {
- auto found_reliable = found_instance->second.find(_is_reliable);
- if (found_reliable != found_instance->second.end()) {
- the_location = found_reliable->second;
- }
- }
- }
- return the_location;
-}
-
-client * managing_proxy_impl::find_client(const endpoint *_location) const {
- auto found = managed_clients_.find(_location);
- if (found == managed_clients_.end())
- return 0;
-
- return found->second;
-}
-
-client * managing_proxy_impl::create_client(const endpoint *_location) {
- client *the_client = 0;
- if (0 != _location) {
- if (_location->get_protocol() == ip_protocol::TCP) {
- the_client = new tcp_client_impl(this, _location);
- } else if (_location->get_protocol() == ip_protocol::UDP) {
- the_client = new udp_client_impl(this, _location);
- } else {
- VSOMEIP_ERROR << "Unsupported/unknown transport protocol";
- }
-
- if (the_client) {
- managed_clients_[_location] = the_client;
- the_client->start();
- }
- }
- return the_client;
-}
-
-client * managing_proxy_impl::find_or_create_client(const endpoint *_location) {
- client *the_client = find_client(_location);
- if (0 == the_client)
- the_client = create_client(_location);
- return the_client;
-}
-
-service * managing_proxy_impl::find_service(const endpoint *_location) const {
- auto found = managed_services_.find(_location);
- if (found == managed_services_.end())
- return 0;
-
- return found->second;
-}
-
-service * managing_proxy_impl::create_service(const endpoint *_location) {
- service *the_service = 0;
- if (0 != _location) {
- if (_location->get_protocol() == ip_protocol::UDP) {
- the_service = new udp_service_impl(this, _location);
- } else if (_location->get_protocol() == ip_protocol::TCP) {
- the_service = new tcp_service_impl(this, _location);
- } else {
- VSOMEIP_ERROR << "Unsupported/unknown transport protocol";
- }
-
- if (the_service) {
- managed_services_[_location] = the_service;
- the_service->start();
- }
- }
-
- return the_service;
-}
-
-service * managing_proxy_impl::find_or_create_service(const endpoint *_location) {
- service *the_service = find_service(_location);
- if (0 == the_service)
- the_service = create_service(_location);
- return the_service;
-}
-
-instance_id managing_proxy_impl::find_instance(
- const endpoint *_location, service_id _service, message_type_enum _message_type) const {
-
- instance_id its_instance = 0;
-
- if (_message_type < message_type_enum::RESPONSE) {
- auto find_location = service_instances_.find(_location);
- if (find_location != service_instances_.end()) {
- auto find_service = find_location->second.find(_service);
- if (find_service != find_location->second.end()) {
- its_instance = find_service->second;
- }
- }
- } else {
- auto find_location = client_instances_.find(_location);
- if (find_location != client_instances_.end()) {
- auto find_service = find_location->second.find(_service);
- if (find_service != find_location->second.end()) {
- its_instance = find_service->second;
- }
- }
- }
-
- return its_instance;
-}
-
-void managing_proxy_impl::receive(
- const uint8_t *_data, uint32_t _size,
- const endpoint *_source, const endpoint *_target) {
-
- if (_data) {
- boost::shared_ptr< deserializer > its_deserializer(owner_.get_deserializer());
- its_deserializer->set_data(_data, _size);
- std::shared_ptr< message > its_message(its_deserializer->deserialize_message());
- its_deserializer->reset();
-
- if (its_message) {
- its_message->set_source(_source);
-
- service_id its_service = its_message->get_service_id();
- message_type_enum its_message_type = its_message->get_message_type();
-
- instance_id its_instance = find_instance(_target, its_service, its_message_type);
- its_message->set_instance_id(its_instance);
-
- owner_.handle_message(its_message);
- } else {
- VSOMEIP_ERROR << "Message deserialization error!";
- }
- }
-}
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip/message_base_impl.cpp b/vsomeip/src/vsomeip/message_base_impl.cpp
deleted file mode 100644
index 4292610..0000000
--- a/vsomeip/src/vsomeip/message_base_impl.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// message_base_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright �� 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/byteorder.hpp>
-#include <vsomeip_internal/message_impl.hpp>
-
-namespace vsomeip {
-
-message_base_impl::message_base_impl()
- : source_(0),
- target_(0) {
- header_.set_owner(this);
-}
-
-message_base_impl::~message_base_impl() {
-};
-
-const endpoint * message_base_impl::get_source() const {
- return source_;
-}
-
-void message_base_impl::set_source(const endpoint *_source) {
- source_ = _source;
-}
-
-const endpoint * message_base_impl::get_target() const {
- return target_;
-}
-
-void message_base_impl::set_target(const endpoint *_target) {
- target_ = _target;
-}
-
-// header interface
-message_id message_base_impl::get_message_id() const {
- return VSOMEIP_WORDS_TO_LONG(header_.service_id_, header_.method_id_);
-}
-
-void message_base_impl::set_message_id(message_id _id) {
- header_.service_id_ = VSOMEIP_LONG_WORD0(_id);
- header_.method_id_ = VSOMEIP_LONG_WORD1(_id);
-}
-
-service_id message_base_impl::get_service_id() const {
- return header_.service_id_;
-}
-
-void message_base_impl::set_service_id(service_id _id) {
- header_.service_id_ = _id;
-}
-
-instance_id message_base_impl::get_instance_id() const {
- return header_.instance_id_;
-}
-
-void message_base_impl::set_instance_id(instance_id _id) {
- header_.instance_id_ = _id;
-}
-
-method_id message_base_impl::get_method_id() const {
- return header_.method_id_;
-}
-
-void message_base_impl::set_method_id(method_id _id) {
- header_.method_id_ = _id;
-}
-
-request_id message_base_impl::get_request_id() const {
- return VSOMEIP_WORDS_TO_LONG(header_.client_id_, header_.session_id_);
-}
-
-void message_base_impl::set_request_id(message_id _id) {
- header_.client_id_ = VSOMEIP_LONG_WORD0(_id);
- header_.session_id_ = VSOMEIP_LONG_WORD1(_id);
-}
-
-client_id message_base_impl::get_client_id() const {
- return header_.client_id_;
-}
-
-void message_base_impl::set_client_id(client_id _id) {
- header_.client_id_ = _id;
-}
-
-session_id message_base_impl::get_session_id() const {
- return header_.session_id_;
-}
-
-void message_base_impl::set_session_id(session_id _id) {
- header_.session_id_ = _id;
-}
-
-protocol_version message_base_impl::get_protocol_version() const {
- return header_.protocol_version_;
-}
-
-void message_base_impl::set_protocol_version(protocol_version _id) {
- header_.protocol_version_ = _id;
-}
-
-interface_version message_base_impl::get_interface_version() const {
- return header_.interface_version_;
-}
-
-void message_base_impl::set_interface_version(protocol_version _id) {
- header_.interface_version_ = _id;
-}
-
-message_type_enum message_base_impl::get_message_type() const {
- return header_.message_type_;
-}
-
-void message_base_impl::set_message_type(message_type_enum _type) {
- header_.message_type_ = _type;
-}
-
-return_code_enum message_base_impl::get_return_code() const {
- return header_.return_code_;
-}
-
-void message_base_impl::set_return_code(return_code_enum _code) {
- header_.return_code_ = _code;
-}
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/message_header_impl.cpp b/vsomeip/src/vsomeip/message_header_impl.cpp
deleted file mode 100644
index 4171820..0000000
--- a/vsomeip/src/vsomeip/message_header_impl.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// message_header_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/message_base_impl.hpp>
-#include <vsomeip_internal/message_header_impl.hpp>
-#include <vsomeip_internal/serializer.hpp>
-
-namespace vsomeip {
-
-message_header_impl::message_header_impl()
- : service_id_(0x0), instance_id_(0x0), method_id_(0x0),
- client_id_(0x0), session_id_(0x0),
- protocol_version_(0x1), interface_version_(0x0),
- message_type_(message_type_enum::UNKNOWN),
- return_code_(return_code_enum::UNKNOWN) {
-};
-
-message_header_impl::message_header_impl(const message_header_impl& _header)
- : service_id_(_header.service_id_), instance_id_(_header.instance_id_), method_id_(_header.method_id_),
- client_id_(_header.client_id_), session_id_(_header.session_id_),
- protocol_version_(_header.protocol_version_), interface_version_(_header.interface_version_),
- message_type_(_header.message_type_),
- return_code_(_header.return_code_) {
-};
-
-bool message_header_impl::serialize(serializer *_to) const {
- return (0 != _to
- && _to->serialize(service_id_)
- && _to->serialize(method_id_)
- && _to->serialize(owner_->get_length())
- && _to->serialize(client_id_)
- && _to->serialize(session_id_)
- && _to->serialize(protocol_version_)
- && _to->serialize(interface_version_)
- && _to->serialize(static_cast<uint8_t>(message_type_))
- && _to->serialize(static_cast<uint8_t>(return_code_)));
-};
-
-bool message_header_impl::deserialize(deserializer *_from) {
- bool is_successful;
-
- uint8_t tmp_message_type, tmp_return_code;
- uint32_t tmp_length;
-
- is_successful = (0 != _from
- && _from->deserialize(service_id_)
- && _from->deserialize(method_id_)
- && _from->deserialize(tmp_length)
- && _from->deserialize(client_id_)
- && _from->deserialize(session_id_)
- && _from->deserialize(protocol_version_)
- && _from->deserialize(interface_version_)
- && _from->deserialize(tmp_message_type)
- && _from->deserialize(tmp_return_code));
-
- if (is_successful) {
- message_type_ = static_cast< message_type_enum >(tmp_message_type);
- return_code_ = static_cast< return_code_enum >(tmp_return_code);
- length_ = static_cast< length >(tmp_length - VSOMEIP_STATIC_HEADER_SIZE);
- }
-
- return is_successful;
-};
-
-message_base * message_header_impl::get_owner() const {
- return owner_;
-}
-
-void message_header_impl::set_owner(message_base *_owner) {
- owner_ = _owner;
-}
-
-} // namespace vsomeip
-
-
diff --git a/vsomeip/src/vsomeip/owner_base.cpp b/vsomeip/src/vsomeip/owner_base.cpp
deleted file mode 100644
index 923784d..0000000
--- a/vsomeip/src/vsomeip/owner_base.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// owner_base.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/owner_base.hpp>
-
-namespace vsomeip {
-
-owner_base::owner_base(const std::string &_name)
- : name_(_name) {
-}
-
-owner_base::~owner_base() {
-}
-
-} // namespace vsomeip
-
-
-
-
diff --git a/vsomeip/src/vsomeip/participant_impl.cpp b/vsomeip/src/vsomeip/participant_impl.cpp
deleted file mode 100644
index 39c0838..0000000
--- a/vsomeip/src/vsomeip/participant_impl.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// participant_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iomanip>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/factory.hpp>
-#include <vsomeip_internal/byteorder.hpp>
-#include <vsomeip_internal/constants.hpp>
-#include <vsomeip_internal/participant_impl.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-
-#include <vsomeip_internal/log_macros.hpp>
-
-namespace vsomeip {
-
-template < int MaxBufferSize >
-participant_impl< MaxBufferSize >::participant_impl(managing_proxy_impl *_owner, const endpoint *_location)
- : log_user(*_owner),
- owner_(_owner),
- location_(_location),
- service_(_owner->get_service()),
- is_supporting_magic_cookies_(false),
- has_enabled_magic_cookies_(false) {
-}
-
-template < int MaxBufferSize >
-participant_impl< MaxBufferSize >::~participant_impl() {
-}
-
-template < int MaxBufferSize >
-void participant_impl< MaxBufferSize >::open_filter(service_id _service) {
- auto find_service = opened_.find(_service);
- if (find_service != opened_.end()) {
- find_service->second++;
- } else {
- opened_[_service] = 1;
- }
-}
-
-template < int MaxBufferSize >
-void participant_impl< MaxBufferSize >::close_filter(service_id _service) {
- auto find_service = opened_.find(_service);
- if (find_service != opened_.end()) {
- find_service->second--;
- if (0 == find_service->second)
- opened_.erase(_service);
- }
-}
-
-template < int MaxBufferSize >
-void participant_impl< MaxBufferSize >::enable_magic_cookies() {
- has_enabled_magic_cookies_ = (true && is_supporting_magic_cookies_);
-}
-
-template < int MaxBufferSize >
-void participant_impl< MaxBufferSize >::disable_magic_cookies() {
- has_enabled_magic_cookies_ = (false && is_supporting_magic_cookies_);
-}
-
-template < int MaxBufferSize >
-uint32_t participant_impl< MaxBufferSize >::get_message_size() const {
- if (message_.size() < VSOMEIP_STATIC_HEADER_SIZE)
- return 0;
-
- return VSOMEIP_STATIC_HEADER_SIZE +
- VSOMEIP_BYTES_TO_LONG(
- message_[4], message_[5], message_[6], message_[7]);
-}
-
-template < int MaxBufferSize >
-void participant_impl< MaxBufferSize >::receive_cbk(
- boost::system::error_code const &_error, std::size_t _bytes) {
-
- static uint32_t message_counter = 0;
-
- if (!_error && 0 < _bytes) {
- #ifdef USE_VSOMEIP_STATISTICS
- statistics_.received_bytes_ += _bytes;
- #endif
-
- const uint8_t *buffer = get_buffer();
- message_.insert(message_.end(), buffer, buffer + _bytes);
-
- bool has_full_message;
- do {
- uint32_t current_message_size = get_message_size();
- has_full_message = (current_message_size > 0 && current_message_size <= message_.size());
- if (has_full_message) {
- endpoint *sender = factory::get_instance()->get_endpoint(
- get_remote_address(), get_remote_port(), get_protocol()
- );
-
- owner_->receive(&message_[0], current_message_size, sender, location_);
- message_.erase(message_.begin(), message_.begin() + current_message_size);
- }
- } while (has_full_message);
-
- restart();
- } else {
- receive();
- }
-}
-
-template < int MaxBufferSize >
-bool participant_impl< MaxBufferSize >::is_magic_cookie() const {
- return false;
-}
-
-template < int MaxBufferSize >
-bool participant_impl< MaxBufferSize >::resync_on_magic_cookie() {
- bool is_resynced = false;
- if (has_enabled_magic_cookies_) {
- uint32_t offset = 0xFFFFFFFF;
- uint8_t cookie_identifier = (
- is_client() ?
- VSOMEIP_MAGIC_COOKIE_CLIENT_MESSAGE_ID :
- VSOMEIP_MAGIC_COOKIE_SERVICE_MESSAGE_ID
- );
- uint8_t cookie_type = static_cast<uint8_t>(
- is_client() ?
- VSOMEIP_MAGIC_COOKIE_CLIENT_MESSAGE_TYPE :
- VSOMEIP_MAGIC_COOKIE_SERVICE_MESSAGE_TYPE
- );
-
- do {
- offset++;
-
- if (message_.size() > offset + 16) {
- is_resynced = (
- message_[offset] == 0xFF &&
- message_[offset+1] == 0xFF &&
- message_[offset+2] == cookie_identifier &&
- message_[offset+3] == 0x00 &&
- message_[offset+4] == 0x00 &&
- message_[offset+5] == 0x00 &&
- message_[offset+6] == 0x00 &&
- message_[offset+7] == 0x08 &&
- message_[offset+8] == 0xDE &&
- message_[offset+9] == 0xAD &&
- message_[offset+10] == 0xBE &&
- message_[offset+11] == 0xEF &&
- message_[offset+12] == 0x01 &&
- message_[offset+13] == 0x01 &&
- message_[offset+14] == cookie_type &&
- message_[offset+15] == 0x00
- );
- };
-
- } while (!is_resynced);
-
- if (is_resynced) {
- message_.erase(message_.begin(),
- message_.begin() + offset +
- VSOMEIP_STATIC_HEADER_SIZE +
- VSOMEIP_MAGIC_COOKIE_SIZE);
- } else {
- message_.clear();
- }
-
- } else {
- message_.clear();
- }
-
- return is_resynced;
-}
-
-// Instantiate template
-template class participant_impl< VSOMEIP_MAX_TCP_MESSAGE_SIZE >;
-template class participant_impl< VSOMEIP_MAX_UDP_MESSAGE_SIZE >;
-
-} // namespace vsomeip
-
-
diff --git a/vsomeip/src/vsomeip/payload_impl.cpp b/vsomeip/src/vsomeip/payload_impl.cpp
deleted file mode 100644
index 3261d88..0000000
--- a/vsomeip/src/vsomeip/payload_impl.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// payload_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/deserializer.hpp>
-#include <vsomeip_internal/payload_impl.hpp>
-#include <vsomeip_internal/payload_owner.hpp>
-#include <vsomeip_internal/serializer.hpp>
-
-namespace vsomeip {
-
-payload_impl::payload_impl()
- : data_(), owner_(0) {
-}
-
-payload_impl::payload_impl(const payload_owner *_owner)
- : data_(), owner_(_owner) {
-}
-
-payload_impl::payload_impl(const payload_impl& _payload)
- : data_(_payload.data_) {
-}
-
-payload_impl::~payload_impl() {
-}
-
-uint8_t * payload_impl::get_data() {
- return data_.data();
-}
-
-const uint8_t * payload_impl::get_data() const {
- return data_.data();
-}
-
-uint32_t payload_impl::get_length() const {
- return data_.size();
-}
-
-void payload_impl::set_capacity(uint32_t _capacity) {
- data_.reserve(_capacity);
-}
-
-void payload_impl::set_data(const uint8_t *data, const uint32_t length) {
- bool is_changed = false;
- if (data_.size() != length) {
- is_changed = true;
- } else {
- for (std::size_t i = 0; i < length; ++i) {
- if (data_[i] != data[i]) {
- is_changed = true;
- break;
- }
- }
- }
- data_.assign(data, data + length);
-
- if (is_changed && owner_)
- owner_->notify();
-}
-
-void payload_impl::set_data(const std::vector<uint8_t>& data) {
- bool is_changed = false;
- if (data_.size() != data.size()) {
- is_changed = true;
- } else {
- for (std::size_t i = 0; i < data.size(); ++i) {
- if (data_[i] != data[i]) {
- is_changed = true;
- break;
- }
- }
- }
- data_ = data;
-
- if (is_changed && owner_)
- owner_->notify();
-}
-
-bool payload_impl::serialize(serializer *_to) const {
- return (0 != _to && _to->serialize(data_.data(), data_.size()));
-}
-
-bool payload_impl::deserialize(deserializer *_from) {
- return (0 != _from && _from->deserialize(data_));
-}
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/proxy_base_impl.cpp b/vsomeip/src/vsomeip/proxy_base_impl.cpp
deleted file mode 100644
index 4076138..0000000
--- a/vsomeip/src/vsomeip/proxy_base_impl.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// proxy_base_impl.hpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������������������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/application_base_impl.hpp>
-#include <vsomeip_internal/proxy_base_impl.hpp>
-
-namespace vsomeip {
-
-proxy_base_impl::proxy_base_impl(application_base_impl &_owner)
- : log_user(_owner),
- owner_(_owner) {
-}
-
-proxy_base_impl::~proxy_base_impl() {
-}
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip/proxy_owner.cpp b/vsomeip/src/vsomeip/proxy_owner.cpp
deleted file mode 100644
index 008544c..0000000
--- a/vsomeip/src/vsomeip/proxy_owner.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// proxy_owner.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/proxy_owner.hpp>
-
-namespace vsomeip {
-
-proxy_owner::proxy_owner(const std::string &_name)
- : owner_base(_name),
- proxy_(0) {
-}
-
-proxy_owner::~proxy_owner() {
-}
-
-} // namespace vsomeip
-
-
-
-
-
diff --git a/vsomeip/src/vsomeip/service_impl.cpp b/vsomeip/src/vsomeip/service_impl.cpp
deleted file mode 100644
index d2c452c..0000000
--- a/vsomeip/src/vsomeip/service_impl.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-//
-// service_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <boost/asio/buffer.hpp>
-#include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/ip/udp.hpp>
-#include <boost/asio/placeholders.hpp>
-#include <boost/bind.hpp>
-
-#include <vsomeip/config.hpp>
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-#include <vsomeip_internal/service_impl.hpp>
-
-namespace vsomeip {
-
-template < typename Protocol, int MaxBufferSize >
-service_impl< Protocol, MaxBufferSize >::service_impl(managing_proxy_impl *_owner, const endpoint *_location)
- : participant_impl< MaxBufferSize >(_owner, _location),
- current_queue_(packet_queues_.end()),
- flush_timer_(_owner->get_service()) {
-}
-
-template < typename Protocol, int MaxBufferSize >
-bool service_impl< Protocol, MaxBufferSize >::is_client() const {
- return false;
-}
-
-template < typename Protocol, int MaxBufferSize >
-bool service_impl< Protocol, MaxBufferSize >::send(
- const uint8_t *_data, uint32_t _size, const endpoint *_target, bool _flush) {
-
- if (0 == _target)
- return false;
-
- bool is_queue_empty(packet_queues_.empty());
-
- // find queue and packetizer (buffer)
- std::deque< std::vector< uint8_t > >& target_packet_queue
- = packet_queues_[_target];
- std::vector< uint8_t >& target_packetizer
- = packetizer_[_target];
-
- // if the current_queue is not yet set, set it to newly created one
- if (current_queue_ == packet_queues_.end())
- current_queue_ = packet_queues_.find(_target);
-
- if (target_packetizer.size() + _size > MaxBufferSize) {
- VSOMEIP_WARNING << "Implicitly flushing.";
- target_packet_queue.push_back(target_packetizer);
- target_packetizer.clear();
-
- if (is_queue_empty)
- send_queued();
- }
-
- target_packetizer.insert(target_packetizer.end(), _data, _data + _size);
-
- if (_flush) {
- flush_timer_.cancel();
-
- target_packet_queue.push_back(target_packetizer);
- target_packetizer.clear();
-
- if (is_queue_empty)
- send_queued();
- } else {
- std::chrono::milliseconds flush_timeout(VSOMEIP_DEFAULT_FLUSH_TIMEOUT);
- flush_timer_.expires_from_now(flush_timeout); // TODO: use configured value
- flush_timer_.async_wait(
- boost::bind(
- &service_impl<Protocol, MaxBufferSize>::flush_cbk,
- this,
- _target,
- boost::asio::placeholders::error
- )
- );
- }
-
- return true;
-}
-
-template < typename Protocol, int MaxBufferSize >
-bool service_impl< Protocol, MaxBufferSize >::flush(const endpoint *_target) {
- bool is_successful = false;
- if (_target) {
- auto i = packetizer_.find(_target);
- if (i != packetizer_.end() && !i->second.empty()) {
- std::deque< std::vector< uint8_t > >& target_packet_queue
- = packet_queues_[i->first];
- target_packet_queue.push_back(i->second);
- i->second.clear();
-
- is_successful = true;
- }
- } else {
- for (auto i = packetizer_.begin(); i != packetizer_.end(); ++i) {
- if (!i->second.empty()) {
- std::deque< std::vector< uint8_t > >& target_packet_queue
- = packet_queues_[i->first];
- target_packet_queue.push_back(i->second);
- i->second.clear();
-
- is_successful = true;
- }
- }
- }
-
- if (is_successful)
- send_queued();
-
- return is_successful;
-}
-
-template < typename Protocol, int MaxBufferSize >
-bool service_impl< Protocol, MaxBufferSize >::set_next_queue() {
- if (current_queue_->second.empty())
- current_queue_ = packet_queues_.erase(current_queue_);
-
- if (packet_queues_.empty())
- return false;
-
- if (current_queue_ == packet_queues_.end())
- current_queue_ = packet_queues_.begin();
-
- if (!current_queue_->second.empty())
- return true;
-
- auto saved_current_queue = current_queue_;
- do {
- current_queue_++;
- if (current_queue_ == packet_queues_.end())
- current_queue_ = packet_queues_.begin();
- } while (current_queue_->second.empty() &&
- current_queue_ != saved_current_queue);
-
- return !current_queue_->second.empty();
-}
-
-template < typename Protocol, int MaxBufferSize >
-void service_impl< Protocol, MaxBufferSize >::connect_cbk(
- boost::system::error_code const &_error) {
-}
-
-template < typename Protocol, int MaxBufferSize >
-void service_impl< Protocol, MaxBufferSize >::send_cbk(
- boost::system::error_code const &_error, std::size_t _bytes) {
-
- if (!_error) {
- current_queue_->second.pop_front();
- bool is_message_available(set_next_queue());
- if (is_message_available) {
- send_queued();
- }
- }
-}
-
-template < typename Protocol, int MaxBufferSize >
-void service_impl< Protocol, MaxBufferSize >::flush_cbk(
- const endpoint *_target, const boost::system::error_code &_error_code) {
- if (!_error_code) {
- (void)flush(_target);
- }
-}
-
-// Instantiate template
-template class service_impl< boost::asio::ip::tcp, VSOMEIP_MAX_TCP_MESSAGE_SIZE >;
-template class service_impl< boost::asio::ip::udp, VSOMEIP_MAX_UDP_MESSAGE_SIZE >;
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip/statistics_impl.cpp b/vsomeip/src/vsomeip/statistics_impl.cpp
deleted file mode 100644
index 62bce57..0000000
--- a/vsomeip/src/vsomeip/statistics_impl.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// statistics_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#ifdef USE_VSOMEIP_STATISTICS
-
-#include <vsomeip_internal/statistics_impl.hpp>
-
-namespace vsomeip {
-
-statistics_impl::statistics_impl()
- : sent_messages_(0), sent_bytes_(0), received_messages_(0), received_bytes_(0) {
-}
-
-statistics_impl::~statistics_impl() {
-}
-
-uint32_t statistics_impl::get_sent_messages_count() const {
- return sent_messages_;
-}
-
-uint32_t statistics_impl::get_sent_bytes_count() const {
- return sent_bytes_;
-}
-
-uint32_t statistics_impl::get_received_messages_count() const {
- return received_messages_;
-}
-
-uint32_t statistics_impl::get_received_bytes_count() const {
- return received_bytes_;
-}
-
-void statistics_impl::reset() {
- sent_messages_ = 0;
- sent_bytes_ = 0;
- received_messages_ = 0;
- received_bytes_ = 0;
-}
-
-} // namespace vsomeip
-
-#endif // USE_VSOMEIP_STATISTICS
diff --git a/vsomeip/src/vsomeip/statistics_owner_impl.cpp b/vsomeip/src/vsomeip/statistics_owner_impl.cpp
deleted file mode 100644
index 16ad6da..0000000
--- a/vsomeip/src/vsomeip/statistics_owner_impl.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// statistic_owner_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright © 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/statistics_owner_impl.hpp>
-
-namespace vsomeip {
-
-statistics_owner_impl::~statistics_owner_impl() {
-}
-
-#ifdef USE_VSOMEIP_STATISTICS
-const statistics * statistics_owner_impl::get_statistics() const {
- return &statistics_;
-}
-#endif
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/supervised_managing_proxy_impl.cpp b/vsomeip/src/vsomeip/supervised_managing_proxy_impl.cpp
deleted file mode 100644
index 750a9d3..0000000
--- a/vsomeip/src/vsomeip/supervised_managing_proxy_impl.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// supervised_managing_proxy_impl.cpp
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright ������ 2013, 2014 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <vsomeip_internal/application_impl.hpp>
-#include <vsomeip_internal/supervised_managing_proxy_impl.hpp>
-
-namespace vsomeip {
-
-supervised_managing_proxy_impl::supervised_managing_proxy_impl(application_base_impl &_owner)
- : managing_proxy_impl(_owner),
- administration_proxy_impl(_owner),
- proxy_base_impl(_owner),
- log_user(_owner) {
-}
-
-supervised_managing_proxy_impl::~supervised_managing_proxy_impl() {
-}
-
-void supervised_managing_proxy_impl::init() {
- administration_proxy_impl::init();
- managing_proxy_impl::init();
-}
-
-void supervised_managing_proxy_impl::start() {
- administration_proxy_impl::start();
- managing_proxy_impl::start();
-}
-
-void supervised_managing_proxy_impl::stop() {
- managing_proxy_impl::stop();
- administration_proxy_impl::stop();
-}
-
-bool supervised_managing_proxy_impl::provide_service(service_id _service, instance_id _instance, const endpoint *_location) {
- bool is_successful = false;
-
- if (administration_proxy_impl::provide_service(_service, _instance, _location)) {
- if (managing_proxy_impl::provide_service(_service, _instance, _location)) {
- is_successful = true;
- } else {
- administration_proxy_impl::withdraw_service(_service, _instance, _location);
- }
- }
-
- return is_successful;
-}
-
-bool supervised_managing_proxy_impl::withdraw_service(service_id _service, instance_id _instance, const endpoint *_location) {
- bool is_successful = false;
-
- if (administration_proxy_impl::withdraw_service(_service, _instance, _location)) {
- if (managing_proxy_impl::withdraw_service(_service, _instance, _location)) {
- is_successful = true;
- } else {
- administration_proxy_impl::provide_service(_service, _instance, _location);
- }
- }
-
- return is_successful;
-}
-
-bool supervised_managing_proxy_impl::start_service(service_id _service, instance_id _instance) {
- bool is_successful = false;
-
- if (administration_proxy_impl::start_service(_service, _instance)) {
- if (managing_proxy_impl::start_service(_service, _instance)) {
- is_successful = true;
- } else {
- administration_proxy_impl::stop_service(_service, _instance);
- }
- }
-
- return is_successful;
-}
-
-bool supervised_managing_proxy_impl::stop_service(service_id _service, instance_id _instance) {
- bool is_successful = false;
-
- if (administration_proxy_impl::stop_service(_service, _instance)) {
- if (managing_proxy_impl::stop_service(_service, _instance)) {
- is_successful = true;
- } else {
- administration_proxy_impl::start_service(_service, _instance);
- }
- }
-
- return is_successful;
-}
-
-bool supervised_managing_proxy_impl::request_service(service_id _service, instance_id _instance, const endpoint *_location) {
- return administration_proxy_impl::request_service(_service, _instance, _location);
-}
-
-bool supervised_managing_proxy_impl::release_service(service_id _service, instance_id _instance) {
- bool is_successful = false;
-
- if (administration_proxy_impl::release_service(_service, _instance)) {
- if (managing_proxy_impl::release_service(_service, _instance)) {
- is_successful = true;
- } else {
- const endpoint *unreliable = find_client_location(_service, _instance, false);
- if (0 != unreliable) {
- administration_proxy_impl::request_service(_service, _instance, unreliable);
- }
-
- const endpoint *reliable = find_client_location(_service, _instance, true);
- if (0 != reliable) {
- administration_proxy_impl::request_service(_service, _instance, reliable);
- }
- }
- }
-
- return is_successful;
-}
-
-void supervised_managing_proxy_impl::register_method(service_id _service, instance_id _instance, method_id _method) {
-}
-
-void supervised_managing_proxy_impl::deregister_method(service_id _service, instance_id _instance, method_id _method) {
-}
-
-bool supervised_managing_proxy_impl::provide_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) {
- return administration_proxy_impl::provide_eventgroup(_service, _instance, _eventgroup, _location);
-}
-
-bool supervised_managing_proxy_impl::withdraw_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup, const endpoint *_location) {
- return administration_proxy_impl::withdraw_eventgroup(_service, _instance, _eventgroup, _location);
-}
-
-bool supervised_managing_proxy_impl::add_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) {
- return administration_proxy_impl::add_field(_service, _instance, _eventgroup, _field);
-}
-
-bool supervised_managing_proxy_impl::remove_field(service_id _service, instance_id _instance, eventgroup_id _eventgroup, field *_field) {
- return administration_proxy_impl::remove_field(_service, _instance, _eventgroup, _field);
-}
-
-bool supervised_managing_proxy_impl::request_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- return administration_proxy_impl::request_eventgroup(_service, _instance, _eventgroup);
-}
-
-bool supervised_managing_proxy_impl::release_eventgroup(service_id _service, instance_id _instance, eventgroup_id _eventgroup) {
- return administration_proxy_impl::release_eventgroup(_service, _instance, _eventgroup);
-}
-
-bool supervised_managing_proxy_impl::enable_magic_cookies(service_id _service, instance_id _instance) {
- return false;
-}
-
-bool supervised_managing_proxy_impl::disable_magic_cookies(service_id _service, instance_id _instance) {
- return false;
-}
-
-void supervised_managing_proxy_impl::on_service_availability(
- service_id _service, instance_id _instance, const endpoint *_location,
- bool _is_available) {
-
- if (_is_available)
- managing_proxy_impl::request_service(_service, _instance, _location);
- else
- managing_proxy_impl::release_service(_service, _instance);
-
- administration_proxy_impl::on_service_availability(_service, _instance, _location, _is_available);
-}
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/tcp_client_impl.cpp b/vsomeip/src/vsomeip/tcp_client_impl.cpp
deleted file mode 100644
index 623533f..0000000
--- a/vsomeip/src/vsomeip/tcp_client_impl.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// tcp_client_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <boost/asio/placeholders.hpp>
-#include <boost/asio/write.hpp>
-#include <boost/bind.hpp>
-
-#include <vsomeip/factory.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/tcp_client_impl.hpp>
-
-namespace ip = boost::asio::ip;
-
-namespace vsomeip {
-
-tcp_client_impl::tcp_client_impl(
- managing_proxy_impl *_owner, const endpoint *_location)
- : tcp_client_base_impl(_owner, _location) {
- is_supporting_magic_cookies_ = true;
-}
-
-tcp_client_impl::~tcp_client_impl() {
-}
-
-const endpoint * tcp_client_impl::get_local_endpoint() const {
- return vsomeip::factory::get_instance()->get_endpoint(
- socket_.local_endpoint().address().to_string(),
- socket_.local_endpoint().port(),
- ip_protocol::TCP
- );
-}
-
-void tcp_client_impl::start() {
- connect();
-}
-
-void tcp_client_impl::connect() {
- socket_.open(local_.protocol());
-
- // Nagle algorithm off
- ip::tcp::no_delay option;
- socket_.set_option(option);
-
- socket_.async_connect(
- local_,
- boost::bind(
- &tcp_client_base_impl::connect_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-}
-
-void tcp_client_impl::receive() {
- socket_.async_receive(
- boost::asio::buffer(buffer_),
- boost::bind(
- &tcp_client_base_impl::receive_cbk,
- this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
- );
-}
-
-void tcp_client_impl::send_queued() {
- if (has_enabled_magic_cookies_)
- send_magic_cookie();
-
- boost::asio::async_write(
- socket_,
- boost::asio::buffer(
- &packet_queue_.front()[0],
- packet_queue_.front().size()
- ),
- boost::bind(
- &tcp_client_base_impl::send_cbk,
- this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
- );
-}
-
-ip_address tcp_client_impl::get_remote_address() const {
- return local_.address().to_string();
-}
-
-ip_port tcp_client_impl::get_remote_port() const {
- return local_.port();
-}
-
-ip_protocol tcp_client_impl::get_protocol() const {
- return ip_protocol::TCP;
-}
-
-void tcp_client_impl::send_magic_cookie() {
- static uint8_t data[] = { 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08,
- 0xDE, 0xAD, 0xBE, 0xEF,
- 0x01, 0x01, 0x01, 0x00 };
-
- std::vector<uint8_t>& current_packet = packet_queue_.front();
-
- if (VSOMEIP_MAX_TCP_MESSAGE_SIZE - current_packet.size() >=
- VSOMEIP_STATIC_HEADER_SIZE + VSOMEIP_MAGIC_COOKIE_SIZE) {
- current_packet.insert(
- current_packet.begin(),
- data,
- data + sizeof(data)
- );
- } else {
- VSOMEIP_WARNING << "Packet full. Cannot insert magic cookie!";
- }
-}
-
-void tcp_client_impl::join(const std::string &) {
-}
-
-void tcp_client_impl::leave(const std::string &) {
-}
-
-} // namespace vsomeip
diff --git a/vsomeip/src/vsomeip/tcp_service_impl.cpp b/vsomeip/src/vsomeip/tcp_service_impl.cpp
deleted file mode 100644
index 68c87d4..0000000
--- a/vsomeip/src/vsomeip/tcp_service_impl.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-//
-// tcp_service_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <deque>
-
-#include <boost/asio/placeholders.hpp>
-#include <boost/asio/write.hpp>
-#include <boost/bind.hpp>
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/enumeration_types.hpp>
-#include <vsomeip/factory.hpp>
-#include <vsomeip_internal/log_macros.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-#include <vsomeip_internal/tcp_service_impl.hpp>
-
-namespace ip = boost::asio::ip;
-
-namespace vsomeip {
-
-tcp_service_impl::tcp_service_impl(
- managing_proxy_impl *_owner, const endpoint *_location)
- : service_impl<ip::tcp, VSOMEIP_MAX_TCP_MESSAGE_SIZE>(_owner, _location),
- acceptor_(_owner->get_service(),
- ip::tcp::endpoint(
- (_location->get_version() == ip_protocol_version::V6 ?
- ip::tcp::v6() : ip::tcp::v4()),
- _location->get_port())) {
- is_supporting_magic_cookies_ = true;
-}
-
-tcp_service_impl::~tcp_service_impl() {
-}
-
-void tcp_service_impl::start() {
- connection::ptr new_connection = connection::create(this);
-
- acceptor_.async_accept(
- new_connection->get_socket(),
- boost::bind(
- &tcp_service_impl::accept_cbk,
- this,
- new_connection,
- boost::asio::placeholders::error
- )
- );
-}
-
-void tcp_service_impl::stop() {
-
-}
-
-void tcp_service_impl::send_queued() {
- auto connection_iterator = connections_.find(current_queue_->first);
- if (connection_iterator != connections_.end())
- connection_iterator->second->send_queued();
- else
- VSOMEIP_ERROR << "No connection could not be found!";
-}
-
-void tcp_service_impl::receive() {
- // intentionally left empty
-}
-
-void tcp_service_impl::restart() {
- if (current_)
- current_->start();
-}
-
-ip_address tcp_service_impl::get_remote_address() const {
- return (current_ == 0 ?
- 0 : current_->get_socket().
- remote_endpoint().address().to_string());
-}
-
-ip_port tcp_service_impl::get_remote_port() const {
- return (current_ == 0 ?
- 0 : current_->get_socket().remote_endpoint().port());
-}
-
-ip_protocol tcp_service_impl::get_protocol() const {
- return ip_protocol::TCP;
-}
-
-const uint8_t * tcp_service_impl::get_buffer() const {
- return (current_ ? current_->get_buffer() : 0);
-}
-
-void tcp_service_impl::accept_cbk(
- connection::ptr _connection, boost::system::error_code const &_error) {
-
- if (!_error) {
- socket_type &new_connection_socket = _connection->get_socket();
- endpoint_type remote_endpoint = new_connection_socket.remote_endpoint();
- ip::address remote_address = remote_endpoint.address();
- endpoint *remote = factory::get_instance()->get_endpoint(
- remote_address.to_string(),
- remote_endpoint.port(),
- ip_protocol::TCP
- );
-
- connections_[remote] = _connection;
- _connection->start();
- }
-
- start();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// class tcp_service_impl::connection
-///////////////////////////////////////////////////////////////////////////////
-tcp_service_impl::connection::connection(tcp_service_impl *_owner)
- : socket_(_owner->service_), owner_(_owner) {
-
- //boost::asio::socket_base::broadcast option(true);
- //socket_.set_option(option);
-}
-
-tcp_service_impl::connection::ptr
-tcp_service_impl::connection::create(tcp_service_impl *_owner) {
- return ptr(new connection(_owner));
-}
-
-tcp_service_impl::socket_type & tcp_service_impl::connection::get_socket() {
- return socket_;
-}
-
-const uint8_t * tcp_service_impl::connection::get_buffer() const {
- return buffer_.data();
-}
-
-void tcp_service_impl::connection::start() {
- socket_.async_receive(
- boost::asio::buffer(buffer_),
- boost::bind(
- &tcp_service_impl::connection::receive_cbk,
- shared_from_this(),
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
- );
-}
-
-void tcp_service_impl::connection::send_queued() {
- if (owner_->has_enabled_magic_cookies_)
- send_magic_cookie();
-
- std::deque<std::vector<uint8_t>> &current_queue
- = owner_->current_queue_->second;
-
- boost::asio::async_write(
- socket_,
- boost::asio::buffer(
- &current_queue.front()[0],
- current_queue.front().size()
- ),
- boost::bind(
- &tcp_service_base_impl::send_cbk,
- owner_,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
- );
-}
-
-void tcp_service_impl::connection::send_magic_cookie() {
- static uint8_t data[] = { 0xFF, 0xFF, 0x80, 0x00,
- 0x00, 0x00, 0x00, 0x08,
- 0xDE, 0xAD, 0xBE, 0xEF,
- 0x01, 0x01, 0x02, 0x00 };
-
- std::vector<uint8_t>& current_packet
- = owner_->current_queue_->second.front();
-
- if (VSOMEIP_MAX_TCP_MESSAGE_SIZE - current_packet.size() >=
- VSOMEIP_STATIC_HEADER_SIZE + VSOMEIP_MAGIC_COOKIE_SIZE) {
- current_packet.insert(
- current_packet.begin(),
- data,
- data + sizeof(data)
- );
- }
-}
-
-void tcp_service_impl::connection::receive_cbk(
- boost::system::error_code const &_error, std::size_t _bytes) {
-
- owner_->current_ = this;
- owner_->receive_cbk(_error, _bytes);
-}
-
-void tcp_service_impl::join(const std::string &) {
-}
-
-void tcp_service_impl::leave(const std::string &) {
-}
-
-} // namespace vsomeip
-
-
-
diff --git a/vsomeip/src/vsomeip/udp_client_impl.cpp b/vsomeip/src/vsomeip/udp_client_impl.cpp
deleted file mode 100644
index d7eb633..0000000
--- a/vsomeip/src/vsomeip/udp_client_impl.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// udp_client_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <boost/asio/ip/multicast.hpp>
-#include <boost/asio/placeholders.hpp>
-#include <boost/bind.hpp>
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip/factory.hpp>
-#include <vsomeip_internal/udp_client_impl.hpp>
-
-namespace vsomeip {
-
-udp_client_impl::udp_client_impl(
- managing_proxy_impl *_owner, const endpoint *_location)
- : udp_client_base_impl(_owner, _location) {
-}
-
-udp_client_impl::~udp_client_impl() {
-}
-
-const endpoint * udp_client_impl::get_local_endpoint() const {
- return vsomeip::factory::get_instance()->get_endpoint(
- socket_.local_endpoint().address().to_string(),
- socket_.local_endpoint().port(),
- ip_protocol::UDP
- );
-}
-
-
-void udp_client_impl::connect() {
- socket_.async_connect(
- local_,
- boost::bind(
- &udp_client_base_impl::connect_cbk,
- this,
- boost::asio::placeholders::error
- )
- );
-}
-
-void udp_client_impl::start() {
- socket_.open(local_.protocol().v4());
- connect();
- receive();
-}
-
-void udp_client_impl::send_queued() {
- socket_.async_send(
- boost::asio::buffer(
- &packet_queue_.front()[0],
- packet_queue_.front().size()
- ),
- boost::bind(
- &udp_client_base_impl::send_cbk,
- this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
- );
-}
-
-void udp_client_impl::receive() {
- socket_.async_receive_from(
- boost::asio::buffer(buffer_),
- remote_,
- boost::bind(
- &udp_client_base_impl::receive_cbk,
- this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
- );
-}
-
-ip_address udp_client_impl::get_remote_address() const {
- return remote_.address().to_string();
-}
-
-ip_port udp_client_impl::get_remote_port() const {
- return remote_.port();
-}
-
-ip_protocol udp_client_impl::get_protocol() const {
- return ip_protocol::UDP;
-}
-
-void udp_client_impl::join(const std::string &_multicast_address) {
- if (ip_protocol_version::V4 == location_->get_version()) {
- try {
- socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));
- socket_.set_option(boost::asio::ip::multicast::join_group(
- boost::asio::ip::address::from_string(_multicast_address)));
- }
- catch (...) {
-
- }
- } else {
- // TODO: support multicast for IPv6
- }
-}
-
-void udp_client_impl::leave(const std::string &_multicast_address) {
- if (ip_protocol_version::V4 == location_->get_version()) {
- try {
- socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));
- socket_.set_option(boost::asio::ip::multicast::leave_group(
- boost::asio::ip::address::from_string(_multicast_address)));
- }
- catch (...) {
-
- }
- } else {
- // TODO: support multicast for IPv6
- }
-}
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip/udp_service_impl.cpp b/vsomeip/src/vsomeip/udp_service_impl.cpp
deleted file mode 100644
index ff28508..0000000
--- a/vsomeip/src/vsomeip/udp_service_impl.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// udp_service_impl.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-
-#include <iostream>
-
-#include <boost/asio/placeholders.hpp>
-#include <boost/asio/ip/address.hpp>
-#include <boost/asio/ip/multicast.hpp>
-#include <boost/bind.hpp>
-
-#include <vsomeip/endpoint.hpp>
-#include <vsomeip_internal/managing_proxy_impl.hpp>
-#include <vsomeip_internal/udp_service_impl.hpp>
-
-namespace ip = boost::asio::ip;
-
-namespace vsomeip {
-
-udp_service_impl::udp_service_impl(
- managing_proxy_impl *_owner, const endpoint *_location)
- : service_impl< ip::udp, VSOMEIP_MAX_UDP_MESSAGE_SIZE >(_owner, _location),
- socket_(_owner->get_service(),
- ip::udp::endpoint(
- (_location->get_version() == ip_protocol_version::V4 ?
- ip::udp::v4() : ip::udp::v6()),
- _location->get_port()
- )
- ) {
-
- boost::asio::socket_base::broadcast option(true);
- socket_.set_option(option);
-}
-
-udp_service_impl::~udp_service_impl() {
-}
-
-void udp_service_impl::start() {
- receive();
-}
-
-void udp_service_impl::stop() {
-}
-
-void udp_service_impl::send_queued() {
- ip::udp::endpoint target(
- ip::address::from_string(
- current_queue_->first->get_address()
- ),
- current_queue_->first->get_port()
- );
-
- socket_.async_send_to(
- boost::asio::buffer(
- &current_queue_->second.front()[0],
- current_queue_->second.front().size()
- ),
- target,
- boost::bind(
- &udp_service_base_impl::send_cbk,
- this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
- );
-}
-
-void udp_service_impl::receive() {
- socket_.async_receive_from(
- boost::asio::buffer(buffer_),
- remote_,
- boost::bind(
- &participant_impl::receive_cbk,
- this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
- );
-}
-
-void udp_service_impl::restart() {
- receive();
-}
-
-ip_address udp_service_impl::get_remote_address() const {
- return remote_.address().to_string();
-}
-
-ip_port udp_service_impl::get_remote_port() const {
- return remote_.port();
-}
-
-ip_protocol udp_service_impl::get_protocol() const {
- return ip_protocol::UDP;
-}
-
-const uint8_t * udp_service_impl::get_buffer() const {
- return buffer_.data();
-}
-
-void udp_service_impl::join(const std::string &_multicast_address) {
- if (ip_protocol_version::V4 == location_->get_version()) {
- try {
- socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));
- socket_.set_option(boost::asio::ip::multicast::join_group(
- boost::asio::ip::address::from_string(_multicast_address)));
- }
- catch (...) {
-
- }
- } else {
- // TODO: support multicast for IPv6
- }
-}
-
-void udp_service_impl::leave(const std::string &_multicast_address) {
- if (ip_protocol_version::V4 == location_->get_version()) {
- try {
- socket_.set_option(boost::asio::ip::udp::socket::reuse_address(true));
- socket_.set_option(boost::asio::ip::multicast::leave_group(
- boost::asio::ip::address::from_string(_multicast_address)));
- }
- catch (...) {
-
- }
- } else {
- // TODO: support multicast for IPv6
- }
-}
-
-} // namespace vsomeip
-
diff --git a/vsomeip/src/vsomeip/utility.cpp b/vsomeip/src/vsomeip/utility.cpp
deleted file mode 100644
index fc4d124..0000000
--- a/vsomeip/src/vsomeip/utility.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// utility.cpp
-//
-// Author: Lutz Bichler
-//
-// This file is part of the BMW Some/IP implementation.
-//
-// Copyright 2013, 2024 Bayerische Motoren Werke AG (BMW).
-// All rights reserved.
-//
-#include <dlfcn.h>
-#include <iostream>
-
-#include <vsomeip_internal/utility.hpp>
-
-namespace vsomeip {
-
-void * utility::load_library(const std::string &_path, const std::string &_symbol) {
- void * its_symbol = 0;
-
- void *handle = dlopen(_path.c_str(), RTLD_LAZY | RTLD_GLOBAL);
- if (0 != handle) {
- its_symbol = dlsym(handle, _symbol.c_str());
- } else {
- std::cerr << "Loading failed: (" << dlerror() << ")" << std::endl;
- }
-
- return its_symbol;
-}
-
-} // namespace vsomeip
-
-
-
-
diff --git a/vsomeip/vsomeip.conf b/vsomeip/vsomeip.conf
deleted file mode 100644
index 6d50f2a..0000000
--- a/vsomeip/vsomeip.conf
+++ /dev/null
@@ -1,96 +0,0 @@
-###############################################################################
-# Some/IP: Generic configuration
-###############################################################################
-[someip]
-
-# Loglevel [fatal | error | warning | info | debug | verbose]
-loglevel = debug
-
-# Loggers [console | file | dlt]
-loggers = console
-
-# Log file name
-logfilepath = ./vsomeip.log
-
-###############################################################################
-# Some/IP: Daemon configuration
-###############################################################################
-[someip.daemon]
-
-# Service discovery?
-enable_service_discovery = true
-
-# Protocol [udp.v4 | udp.v6 | tcp.v4 | tcp.v6]
-service_discovery_protocol = udp.v4
-
-###############################################################################
-# Some/IP: Application configuration
-###############################################################################
-[someip.application]
-enable_watchdog = true
-enable_service_discovery = true
-
-# Maximum number of received messages that can be buffered
-slots = 8
-
-[someip.application.InternalClientSample]
-client_id = 1248
-enable_endpoint_manager = false
-
-[someip.application.InternalServiceSample]
-client_id = 343
-enable_endpoint_manager = false
-
-[someip.application.ExternalClientSample]
-client_id = 5453
-enable_watchdog = false
-enable_endpoint_manager = true
-
-[someip.application.ExternalServiceSample]
-client_id = 6542
-enable_endpoint_manager = false
-
-###############################################################################
-# Some/IP: Service Discovery configuration
-###############################################################################
-[someip.service_discovery]
-
-# Addresses
-unicast = 10.0.2.15
-multicast = 224.223.222.221
-
-# Netmask (used to derive the subnet & broadcast address)
-netmask = /24
-
-# Port
-port = 30490
-
-# Minimum initial delay before first offer
-min_initial_delay = 10
-
-# Maximum initial delay before first offer
-max_initial_delay = 100
-
-# Delay between two offers in repetition phase
-repetition_base_delay = 50
-
-# Maximum number of repetitions in repetition phase
-repetition_max = 3
-
-# Lifetime of service
-ttl = reboot
-
-# Delay between two OfferService messages in main phase
-cyclic_offer_delay = 2000
-
-# Delay between two FindService messages
-cyclic_request_delay = 2000
-
-# Delay of an unicast answer to a multicast message
-request_response_delay = 200
-
-# Default maximum timespan between two messages updating the same field
-default_max_update_delay = 2000
-
-# Default maximum wait time for initial value
-default_max_initial_delay = 200