| 84 | } |
| 85 | |
| 86 | bool security::load() { |
| 87 | if (auto its_manager = plugin_manager::get()) { |
| 88 | if (auto its_library = its_manager->load_library(VSOMEIP_SEC_LIBRARY)) { |
| 89 | |
| 90 | VSOMEIP_SECURITY_POLICY_LOAD(initialize); |
| 91 | VSOMEIP_SECURITY_POLICY_LOAD(authenticate_router); |
| 92 | VSOMEIP_SECURITY_POLICY_LOAD(is_client_allowed_to_offer); |
| 93 | VSOMEIP_SECURITY_POLICY_LOAD(is_client_allowed_to_request); |
| 94 | VSOMEIP_SECURITY_POLICY_LOAD(is_client_allowed_to_access_member); |
| 95 | VSOMEIP_SECURITY_LOAD(sync_client); |
| 96 | |
| 97 | // All symbols could be loaded, assign them |
| 98 | VSOMEIP_SECURITY_ASSIGN_FUNCTION(initialize); |
| 99 | VSOMEIP_SECURITY_ASSIGN_FUNCTION(authenticate_router); |
| 100 | VSOMEIP_SECURITY_ASSIGN_FUNCTION(is_client_allowed_to_offer); |
| 101 | VSOMEIP_SECURITY_ASSIGN_FUNCTION(is_client_allowed_to_request); |
| 102 | VSOMEIP_SECURITY_ASSIGN_FUNCTION(is_client_allowed_to_access_member); |
| 103 | VSOMEIP_SECURITY_ASSIGN_FUNCTION(sync_client); |
| 104 | |
| 105 | // Symbol loading complete, success! |
| 106 | return true; |
| 107 | } else { |
| 108 | #ifdef _WIN32 |
| 109 | VSOMEIP_ERROR << "vSomeIP Security: Loading " << VSOMEIP_SEC_LIBRARY << " failed."; |
| 110 | #else |
| 111 | VSOMEIP_ERROR << "vSomeIP Security: " << dlerror(); |
| 112 | #endif |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | return false; |
| 117 | } |
| 118 | |
| 119 | // |
| 120 | // Default interface implementation |