From: Tran Thuan <[email protected]>
This patch solves the linking issue if mds_dt.h or mds_core.h
is included in c++ sources.
---
src/mds/mds_core.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
src/mds/mds_dt.h | 4 +--
src/mds/mds_dt2c.h | 67 ----------------------------------------------
src/mds/mds_dt_tcp.c | 2 ++
src/mds/mds_dt_tcp.h | 1 -
src/mds/mds_dt_tipc.c | 2 ++
6 files changed, 80 insertions(+), 70 deletions(-)
diff --git a/src/mds/mds_core.h b/src/mds/mds_core.h
index 37696d4..c09b428 100644
--- a/src/mds/mds_core.h
+++ b/src/mds/mds_core.h
@@ -573,6 +573,80 @@ extern uint32_t mds_mcm_free_msg_uba_start(MDS_ENCODED_MSG
msg);
extern void get_adest_details(MDS_DEST adest, char *adest_details);
extern void get_subtn_adest_details(MDS_PWE_HDL pwe_hdl, MDS_SVC_ID svc_id,
MDS_DEST adest, char *adest_details);
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* ******************************************** */
+/* ******************************************** */
+/* MCM to MDTM */
+/* ******************************************** */
+/* ******************************************** */
+
+/* Initialization of MDTM Module */
+uint32_t (*mds_mdtm_init)(NODE_ID node_id, uint32_t *mds_tipc_ref);
+
+/* Destroying the MDTM Module*/
+uint32_t (*mds_mdtm_destroy)(void);
+
+uint32_t (*mds_mdtm_send)(MDTM_SEND_REQ *req);
+
+/* SVC Install */
+uint32_t (*mds_mdtm_svc_install)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
+ NCSMDS_SCOPE_TYPE install_scope,
+ V_DEST_RL role, MDS_VDEST_ID vdest_id,
+ NCS_VDEST_TYPE vdest_policy,
+ MDS_SVC_PVT_SUB_PART_VER mds_svc_pvt_ver);
+
+/* SVC Uninstall */
+uint32_t (*mds_mdtm_svc_uninstall)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
+ NCSMDS_SCOPE_TYPE install_scope,
+ V_DEST_RL role, MDS_VDEST_ID vdest_id,
+ NCS_VDEST_TYPE vdest_policy,
+ MDS_SVC_PVT_SUB_PART_VER mds_svc_pvt_ver);
+
+/* SVC Subscribe */
+uint32_t (*mds_mdtm_svc_subscribe)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
+ NCSMDS_SCOPE_TYPE subscribe_scope,
+ MDS_SVC_HDL local_svc_hdl,
+ MDS_SUBTN_REF_VAL *subtn_ref_val);
+
+/* added svc_hdl */
+/* SVC Unsubscribe */
+uint32_t (*mds_mdtm_svc_unsubscribe)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
+ NCSMDS_SCOPE_TYPE subscribe_scope,
+ MDS_SUBTN_REF_VAL subtn_ref_val);
+
+/* VDEST Install */
+uint32_t (*mds_mdtm_vdest_install)(MDS_VDEST_ID vdest_id);
+
+/* VDEST Uninstall */
+uint32_t (*mds_mdtm_vdest_uninstall)(MDS_VDEST_ID vdest_id);
+
+/* VDEST Subscribe */
+uint32_t (*mds_mdtm_vdest_subscribe)(MDS_VDEST_ID vdest_id,
+ MDS_SUBTN_REF_VAL *subtn_ref_val);
+
+/* VDEST Unsubscribe */
+uint32_t (*mds_mdtm_vdest_unsubscribe)(MDS_VDEST_ID vdest_id,
+ MDS_SUBTN_REF_VAL subtn_ref_val);
+
+/* Tx Register (For incrementing the use count) */
+uint32_t (*mds_mdtm_tx_hdl_register)(MDS_DEST adest);
+
+/* Tx Unregister (For decrementing the use count) */
+uint32_t (*mds_mdtm_tx_hdl_unregister)(MDS_DEST adest);
+
+/* Node subscription */
+uint32_t (*mds_mdtm_node_subscribe)(MDS_SVC_HDL svc_hdl,
+ MDS_SUBTN_REF_VAL *subtn_ref_val);
+
+/* Node unsubscription */
+uint32_t (*mds_mdtm_node_unsubscribe)(MDS_SUBTN_REF_VAL subtn_ref_val);
+
+#ifdef __cplusplus
+}
+#endif
+
/* ******************************************** */
/* ******************************************** */
/* MMGR Macros */
diff --git a/src/mds/mds_dt.h b/src/mds/mds_dt.h
index a6e2801..b645bb4 100644
--- a/src/mds/mds_dt.h
+++ b/src/mds/mds_dt.h
@@ -214,10 +214,10 @@ typedef struct mdtm_ref_hdl_list {
MDS_SVC_HDL svc_hdl;
} MDTM_REF_HDL_LIST;
-MDTM_REF_HDL_LIST *mdtm_ref_hdl_list_hdr;
+extern MDTM_REF_HDL_LIST *mdtm_ref_hdl_list_hdr;
+extern NCS_PATRICIA_TREE mdtm_reassembly_list;
uint32_t mdtm_attach_mbx(SYSF_MBX mbx);
void mds_buff_dump(uint8_t *buff, uint32_t len, uint32_t max);
-NCS_PATRICIA_TREE mdtm_reassembly_list;
uint32_t mdtm_set_transport(MDTM_TX_TYPE transport);
bool mdtm_mailbox_mbx_cleanup(NCSCONTEXT arg, NCSCONTEXT msg);
diff --git a/src/mds/mds_dt2c.h b/src/mds/mds_dt2c.h
index 012999c..c92fecb 100644
--- a/src/mds/mds_dt2c.h
+++ b/src/mds/mds_dt2c.h
@@ -322,73 +322,6 @@ extern uint32_t gl_mds_checksum;
/* ******************************************** */
/* ******************************************** */
-/* MCM to MDTM */
-/* ******************************************** */
-/* ******************************************** */
-
-/* Initialization of MDTM Module */
-uint32_t (*mds_mdtm_init)(NODE_ID node_id, uint32_t *mds_tipc_ref);
-
-/* Destroying the MDTM Module*/
-uint32_t (*mds_mdtm_destroy)(void);
-
-uint32_t (*mds_mdtm_send)(MDTM_SEND_REQ *req);
-
-/* SVC Install */
-uint32_t (*mds_mdtm_svc_install)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
- NCSMDS_SCOPE_TYPE install_scope,
- V_DEST_RL role, MDS_VDEST_ID vdest_id,
- NCS_VDEST_TYPE vdest_policy,
- MDS_SVC_PVT_SUB_PART_VER mds_svc_pvt_ver);
-
-/* SVC Uninstall */
-uint32_t (*mds_mdtm_svc_uninstall)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
- NCSMDS_SCOPE_TYPE install_scope,
- V_DEST_RL role, MDS_VDEST_ID vdest_id,
- NCS_VDEST_TYPE vdest_policy,
- MDS_SVC_PVT_SUB_PART_VER mds_svc_pvt_ver);
-
-/* SVC Subscribe */
-uint32_t (*mds_mdtm_svc_subscribe)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
- NCSMDS_SCOPE_TYPE subscribe_scope,
- MDS_SVC_HDL local_svc_hdl,
- MDS_SUBTN_REF_VAL *subtn_ref_val);
-
-/* added svc_hdl */
-/* SVC Unsubscribe */
-uint32_t (*mds_mdtm_svc_unsubscribe)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
- NCSMDS_SCOPE_TYPE subscribe_scope,
- MDS_SUBTN_REF_VAL subtn_ref_val);
-
-/* VDEST Install */
-uint32_t (*mds_mdtm_vdest_install)(MDS_VDEST_ID vdest_id);
-
-/* VDEST Uninstall */
-uint32_t (*mds_mdtm_vdest_uninstall)(MDS_VDEST_ID vdest_id);
-
-/* VDEST Subscribe */
-uint32_t (*mds_mdtm_vdest_subscribe)(MDS_VDEST_ID vdest_id,
- MDS_SUBTN_REF_VAL *subtn_ref_val);
-
-/* VDEST Unsubscribe */
-uint32_t (*mds_mdtm_vdest_unsubscribe)(MDS_VDEST_ID vdest_id,
- MDS_SUBTN_REF_VAL subtn_ref_val);
-
-/* Tx Register (For incrementing the use count) */
-uint32_t (*mds_mdtm_tx_hdl_register)(MDS_DEST adest);
-
-/* Tx Unregister (For decrementing the use count) */
-uint32_t (*mds_mdtm_tx_hdl_unregister)(MDS_DEST adest);
-
-/* Node subscription */
-uint32_t (*mds_mdtm_node_subscribe)(MDS_SVC_HDL svc_hdl,
- MDS_SUBTN_REF_VAL *subtn_ref_val);
-
-/* Node unsubscription */
-uint32_t (*mds_mdtm_node_unsubscribe)(MDS_SUBTN_REF_VAL subtn_ref_val);
-
-/* ******************************************** */
-/* ******************************************** */
/* MDTM to MCM */
/* ******************************************** */
/* ******************************************** */
diff --git a/src/mds/mds_dt_tcp.c b/src/mds/mds_dt_tcp.c
index 1407eb1..0aa1c59 100644
--- a/src/mds/mds_dt_tcp.c
+++ b/src/mds/mds_dt_tcp.c
@@ -66,6 +66,8 @@ extern MDS_SUBTN_REF_VAL mdtm_handle;
extern uint32_t mdtm_global_frag_num_tcp;
uint32_t mds_socket_domain = AF_UNIX;
+MDTM_REF_HDL_LIST *mdtm_ref_hdl_list_hdr;
+NCS_PATRICIA_TREE mdtm_reassembly_list;
/* Get the pid of the process */
pid_t mdtm_pid;
diff --git a/src/mds/mds_dt_tcp.h b/src/mds/mds_dt_tcp.h
index 3dc49b5..1065464 100644
--- a/src/mds/mds_dt_tcp.h
+++ b/src/mds/mds_dt_tcp.h
@@ -51,7 +51,6 @@ typedef struct mdtm_tcp_cb {
} MDTM_TCP_CB;
MDTM_TCP_CB *tcp_cb;
-NCS_PATRICIA_TREE mdtm_reassembly_list;
typedef enum mds_mdtm_dtm_msg_types {
MDS_MDTM_DTM_PID_TYPE = 1,
diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
index 7ddc9bf..86b52bb 100644
--- a/src/mds/mds_dt_tipc.c
+++ b/src/mds/mds_dt_tipc.c
@@ -159,6 +159,8 @@ struct sockaddr_tipc topsrv;
static MDS_SUBTN_REF_VAL handle;
static uint16_t num_subscriptions;
+MDTM_REF_HDL_LIST *mdtm_ref_hdl_list_hdr;
+NCS_PATRICIA_TREE mdtm_reassembly_list;
uint32_t mdtm_global_frag_num;
--
2.7.4
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel