| 1 |
/* |
| 2 |
* Copyright(c) 2006 to 2020 ZettaScale Technology and others |
| 3 |
* |
| 4 |
* This program and the accompanying materials are made available under the |
| 5 |
* terms of the Eclipse Public License v. 2.0 which is available at |
| 6 |
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License |
| 7 |
* v. 1.0 which is available at |
| 8 |
* http://www.eclipse.org/org/documents/edl-v10.php. |
| 9 |
* |
| 10 |
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause |
| 11 |
*/ |
| 12 |
#ifndef SECURITY_CORE_TEST_AUTHENTICATION_WRAPPER_H_ |
| 13 |
#define SECURITY_CORE_TEST_AUTHENTICATION_WRAPPER_H_ |
| 14 |
|
| 15 |
#include "dds/ddsi/ddsi_domaingv.h" |
| 16 |
#include "dds/security/dds_security_api.h" |
| 17 |
#include "dds/security/authentication_wrapper_export.h" |
| 18 |
#include "plugin_wrapper_msg_q.h" |
| 19 |
|
| 20 |
/* Init in wrapper mode */ |
| 21 |
SECURITY_EXPORT int init_test_authentication_wrapped(const char *argument, void **context, struct ddsi_domaingv *gv); |
| 22 |
SECURITY_EXPORT int finalize_test_authentication_wrapped(void *context); |
| 23 |
|
| 24 |
/* Init in all-ok mode: all functions return success without calling the actual plugin */ |
| 25 |
SECURITY_EXPORT int init_test_authentication_all_ok(const char *argument, void **context, struct ddsi_domaingv *gv); |
| 26 |
SECURITY_EXPORT int finalize_test_authentication_all_ok(void *context); |
| 27 |
|
| 28 |
/* Init in missing function mode: one of the function pointers is null */ |
| 29 |
SECURITY_EXPORT int init_test_authentication_missing_func(const char *argument, void **context, struct ddsi_domaingv *gv); |
| 30 |
SECURITY_EXPORT int finalize_test_authentication_missing_func(void *context); |
| 31 |
|
| 32 |
/* Init function fails */ |
| 33 |
SECURITY_EXPORT int init_test_authentication_init_error(const char *argument, void **context, struct ddsi_domaingv *gv); |
| 34 |
SECURITY_EXPORT int finalize_test_authentication_init_error(void *context); |
| 35 |
|
| 36 |
SECURITY_EXPORT enum take_message_result test_authentication_plugin_take_msg(dds_domainid_t domain_id, message_kind_t kind, DDS_Security_IdentityHandle lidHandle, DDS_Security_IdentityHandle ridHandle, DDS_Security_IdentityHandle hsHandle, dds_time_t abstimeout, struct message **msg); |
| 37 |
SECURITY_EXPORT void test_authentication_plugin_release_msg(struct message *msg); |
| 38 |
|
| 39 |
#endif /* SECURITY_CORE_TEST_AUTHENTICATION_WRAPPER_H_ */ |