osaf/libs/agents/saf/imma/imma.h        |   2 +-
 osaf/libs/agents/saf/imma/imma_cb.h     |   4 +-
 osaf/libs/agents/saf/imma/imma_mds.c    |   2 +-
 osaf/libs/agents/saf/imma/imma_mds.h    |   2 +-
 osaf/libs/agents/saf/imma/imma_oi_api.c |  12 ++++----
 osaf/libs/agents/saf/imma/imma_om_api.c |  44 +++++++++++++-------------------
 osaf/libs/agents/saf/imma/imma_proc.c   |   2 +-
 osaf/services/saf/immsv/immd/immd_mds.c |   2 +-
 osaf/services/saf/immsv/immd/immd_mds.h |   2 +-
 9 files changed, 32 insertions(+), 40 deletions(-)


Issue :
In current implementation their is a mismatch of variable sizes between SAF API 
accepting SaTimeT variable type for timeout ( 64 bit) and
MDS transport implementation accepting (32 bit) timeout variable , the MDS 
transport should adopt the size of the timeout parameter from 32 bits to 64 
bits.

Fix :
Now MDS provide interface to accept SaTimeT type timeout variable from SAF APIS

diff --git a/osaf/libs/agents/saf/imma/imma.h b/osaf/libs/agents/saf/imma/imma.h
--- a/osaf/libs/agents/saf/imma/imma.h
+++ b/osaf/libs/agents/saf/imma/imma.h
@@ -49,7 +49,7 @@ void imma_freeSearchAttrs(SaImmAttrValue
 SaAisErrorT imma_evt_fake_evs(IMMA_CB *cb,
                        IMMSV_EVT *i_evt,
                                       IMMSV_EVT **o_evt,
-                                      uint32_t timeout, SaImmHandleT 
immHandle, bool *locked, bool checkWritable);
+                                      SaTimeT timeout, SaImmHandleT immHandle, 
bool *locked, bool checkWritable);
 SaAisErrorT imma_proc_check_stale(IMMA_CB *cb, SaImmHandleT immHandle,
     SaAisErrorT defaultEr);
 
diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
b/osaf/libs/agents/saf/imma/imma_cb.h
--- a/osaf/libs/agents/saf/imma/imma_cb.h
+++ b/osaf/libs/agents/saf/imma/imma_cb.h
@@ -49,7 +49,7 @@ typedef struct imma_client_node {
        } o;
        SaUint32T mImplementerId;       /*Only used for OI.*/
        SaImmOiImplementerNameT  mImplementerName; /* needed for active 
resurrect*/
-       SaUint32T syncr_timeout;/* Timeout on syncr downcalls, dflt 10s, or 
setenv IMMA_SYNCR_TIMEOUT */
+       SaTimeT syncr_timeout;/* Timeout on syncr downcalls, dflt 10s, or 
setenv IMMA_SYNCR_TIMEOUT */
        unsigned char replyPending; /* Syncronous or asyncronous call made 
towards IMMND */
        bool isOm;              /*If true => then this is an OM client */
        bool stale;             /*Loss of connection with immnd 
@@ -76,7 +76,7 @@ typedef struct imma_client_node {
      * enviroment variable IMMA_MAX_OPEN_SEARCHES_PER_HANDLE */
     uint32_t maxSearchHandles;
        uint32_t searchHandleSize;      /* Number of open search handles */
-       uint32_t oiTimeout;     /* Timeout for OI callback. If the value is 0, 
the default timeout (6s) will be used */
+       SaTimeT oiTimeout;      /* Timeout for OI callback. If the value is 0, 
the default timeout (6s) will be used */
 } IMMA_CLIENT_NODE;
 
 /* Node to store adminOwner info */
diff --git a/osaf/libs/agents/saf/imma/imma_mds.c 
b/osaf/libs/agents/saf/imma/imma_mds.c
--- a/osaf/libs/agents/saf/imma/imma_mds.c
+++ b/osaf/libs/agents/saf/imma/imma_mds.c
@@ -574,7 +574,7 @@ static uint32_t imma_mds_dec(IMMA_CB *cb
   Notes         : None.
 ******************************************************************************/
 uint32_t imma_mds_msg_sync_send(uint32_t imma_mds_hdl,
-                            MDS_DEST *destination, IMMSV_EVT *i_evt, IMMSV_EVT 
**o_evt, uint32_t timeout)
+                            MDS_DEST *destination, IMMSV_EVT *i_evt, IMMSV_EVT 
**o_evt, SaTimeT timeout)
 {
        IMMA_CB *cb = &imma_cb;
        NCSMDS_INFO mds_info;
diff --git a/osaf/libs/agents/saf/imma/imma_mds.h 
b/osaf/libs/agents/saf/imma/imma_mds.h
--- a/osaf/libs/agents/saf/imma/imma_mds.h
+++ b/osaf/libs/agents/saf/imma/imma_mds.h
@@ -37,7 +37,7 @@ void imma_mds_unregister(IMMA_CB *cb);
 uint32_t imma_mds_callback(struct ncsmds_callback_info *info);
 /* uint32_t imma_mds_msg_sync_send (NCSCONTEXT imma_mds_hdl, */
 uint32_t imma_mds_msg_sync_send(uint32_t imma_mds_hdl,
-                                     MDS_DEST *destination, IMMSV_EVT *i_evt, 
IMMSV_EVT **o_evt, uint32_t timeout);
+                                     MDS_DEST *destination, IMMSV_EVT *i_evt, 
IMMSV_EVT **o_evt, SaTimeT timeout);
 /* uint32_t imma_mds_msg_send (NCSCONTEXT imma_mds_hdl,  */
 uint32_t imma_mds_msg_send(uint32_t imma_mds_hdl, MDS_DEST *destination, 
IMMSV_EVT *i_evt, uint32_t to_svc);
 
diff --git a/osaf/libs/agents/saf/imma/imma_oi_api.c 
b/osaf/libs/agents/saf/imma/imma_oi_api.c
--- a/osaf/libs/agents/saf/imma/imma_oi_api.c
+++ b/osaf/libs/agents/saf/imma/imma_oi_api.c
@@ -184,7 +184,7 @@ SaAisErrorT initialize_common(SaImmOiHan
 
        if((timeout_env_value = getenv("IMMA_SYNCR_TIMEOUT"))!=NULL) {
                cl_node->syncr_timeout = atoi(timeout_env_value);
-               TRACE_2("IMMA library syncronous timeout set to:%u", 
cl_node->syncr_timeout);
+               TRACE_2("IMMA library syncronous timeout set to:%lld", 
cl_node->syncr_timeout);
        }
 
        if(cl_node->syncr_timeout < NCS_SAF_MIN_ACCEPT_TIME) {
@@ -199,7 +199,7 @@ SaAisErrorT initialize_common(SaImmOiHan
                                        "OI timeout will be set to the default 
value");
                        cl_node->oiTimeout = 0;
                } else {
-                       TRACE_2("IMMA library OI timeout set to:%u", 
cl_node->oiTimeout);
+                       TRACE_2("IMMA library OI timeout set to:%lld", 
cl_node->oiTimeout);
                }
        } else {
                cl_node->oiTimeout = 0;
@@ -666,7 +666,7 @@ SaAisErrorT saImmOiFinalize(SaImmOiHandl
        uint32_t proc_rc = NCSCC_RC_SUCCESS;
        bool locked = true;
        bool agent_flag = false; /* flag = false, we should not call agent 
shutdown */
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
 
@@ -1175,7 +1175,7 @@ SaAisErrorT saImmOiImplementerSet(SaImmO
        SaUint32T proc_rc = NCSCC_RC_SUCCESS;
        bool locked = true;
        SaUint32T nameLen = 0;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
 
        if (cb->sv_id == 0) {
                TRACE_2("ERR_BAD_HANDLE: No initialized handle exists!");
@@ -2428,7 +2428,7 @@ static SaAisErrorT rt_object_update_comm
        IMMSV_EVT *out_evt = NULL;
        IMMA_CLIENT_NODE *cl_node = NULL;
        bool locked = true;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
 
        if (cb->sv_id == 0) {
                TRACE_2("ERR_BAD_HANDLE: No initialized handle exists!");
@@ -3336,7 +3336,7 @@ int imma_oi_resurrect(IMMA_CB *cb, IMMA_
        osafassert(locked && *locked);
        osafassert(cl_node && cl_node->stale);
        SaImmOiHandleT immOiHandle = cl_node->handle;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
 
        m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
        *locked = false;
diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -243,7 +243,7 @@ static SaAisErrorT initialize_common(SaI
 
        if((timeout_env_value = getenv("IMMA_SYNCR_TIMEOUT"))!=NULL) {
                cl_node->syncr_timeout = atoi(timeout_env_value);
-               TRACE_2("IMMA library syncronous timeout set to:%u", 
cl_node->syncr_timeout);
+               TRACE_2("IMMA library syncronous timeout set to:%lld", 
cl_node->syncr_timeout);
        }
 
        if(cl_node->syncr_timeout < NCS_SAF_MIN_ACCEPT_TIME) {
@@ -729,7 +729,7 @@ SaAisErrorT saImmOmFinalize(SaImmHandleT
        uint32_t proc_rc = NCSCC_RC_SUCCESS;
        bool locked = true;
        bool agent_flag = false; /* flag = false, we should not call agent 
shutdown */
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -927,7 +927,7 @@ SaAisErrorT saImmOmAdminOwnerInitialize(
        bool locked = true;
        bool isLoaderName = false;
        SaUint32T nameLen = 0;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -1181,7 +1181,7 @@ SaAisErrorT saImmOmAdminOwnerInitialize(
  *       longer possible with the same ccb_node/ccbHandle. 
  *******************************************************************/
 static SaAisErrorT imma_newCcbId(IMMA_CB *cb, IMMA_CCB_NODE *ccb_node,
-       SaUint32T adminOwnerId, bool *locked, SaUint32T timeout)
+       SaUint32T adminOwnerId, bool *locked, SaTimeT timeout)
 {
        SaAisErrorT rc = SA_AIS_OK;
        SaUint32T proc_rc = NCSCC_RC_SUCCESS;
@@ -3680,15 +3680,7 @@ static SaAisErrorT admin_op_invoke_commo
                rc = SA_AIS_ERR_INVALID_PARAM;
                goto done;
         } else if (timeout > ( SA_TIME_ONE_MILLISECOND * 
MDS_MAX_TIMEOUT_MILLISECOND)) {
-               /* Unfortunately the current MDS transport support only 
uint32_t type variable (232-1) for timeout parameter ,
-                  even though  SAF APIS supports SaTimeT (SaInt64T) type 
(263-1).
-                  So as work around currently if SAF API receives the higher 
value then  uint32_t (232-1) that it can hold , form now
-                  implicitly set  to max MDS supported value (4294967295 * 
10000000) ,  which is already very large  impractical value.
-
-                  In  Future solution : `[ticket:#1658] mds : Opensf transport 
should adopt the size of the
-                  timeout parameter from 32 bits to 64 bits`  will resolve the 
issue by matching both MDS transport and SAF API's
-                */             
-               TRACE_4("saImmOmAdminOperationInvoke: timeout > MDS_MAX_TIMEOUT 
setting to MDS max timeout value:%llu,immHandle:%llx",
+               TRACE_4("saImmOmAdminOperationInvoke: timeout>MDS_MAX_TIMEOUT 
setting to max :%lld, immHandle:%llx",
                                (SA_TIME_ONE_MILLISECOND * 
MDS_MAX_TIMEOUT_MILLISECOND) , immHandle);
                 timeout = (SA_TIME_ONE_MILLISECOND * 
MDS_MAX_TIMEOUT_MILLISECOND);
         }
@@ -4998,7 +4990,7 @@ SaAisErrorT saImmOmClassDescriptionGet_2
        IMMSV_EVT evt;
        IMMSV_EVT *out_evt = NULL;
        IMMA_CLIENT_NODE *cl_node = NULL;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -5766,7 +5758,7 @@ static SaAisErrorT accessor_get_common(S
        IMMA_SEARCH_NODE *search_node = NULL;
        IMMSV_EVT evt;
        IMMSV_EVT *out_evt = NULL;
-       SaUint32T timeout;
+       SaTimeT timeout;
 
        TRACE_ENTER();
 
@@ -6845,7 +6837,7 @@ SaAisErrorT immsv_finalize_sync(SaImmHan
        IMMSV_EVT *out_evt = NULL;
        IMMA_CLIENT_NODE *cl_node = 0;
        bool locked = true;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -7020,7 +7012,7 @@ static SaAisErrorT search_init_common(Sa
        IMMA_CLIENT_NODE *cl_node = NULL;
        IMMA_SEARCH_NODE *search_node = NULL;
        SaImmSearchHandleT tmpSearchHandle=0LL;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -7471,7 +7463,7 @@ static SaAisErrorT search_next_common(Sa
        IMMA_CLIENT_NODE *cl_node = NULL;
        IMMA_SEARCH_NODE *search_node = NULL;
        SaImmHandleT immHandle=0LL;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        IMMSV_OM_RSP_SEARCH_NEXT *res_body = NULL;
        IMMSV_OM_RSP_SEARCH_BUNDLE_NEXT *searchBundle = NULL;
        bool bFreeSearchBundle = false;
@@ -7801,7 +7793,7 @@ SaAisErrorT saImmOmSearchFinalize(SaImmS
        IMMA_SEARCH_NODE *search_node = NULL;
        SaImmHandleT immHandle=0LL;
        SaUint32T searchId = 0;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -8024,7 +8016,7 @@ static SaAisErrorT admin_owner_set_commo
        bool locked = true;
        SaImmHandleT immHandle=0LL;
        SaUint32T adminOwnerId = 0;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -8278,7 +8270,7 @@ static SaAisErrorT admin_owner_release_c
        bool locked = true;
        SaImmHandleT immHandle=0LL;
        SaUint32T adminOwnerId = 0;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -8527,7 +8519,7 @@ static SaAisErrorT admin_owner_clear_com
        IMMSV_EVT *out_evt = NULL;
        IMMA_CLIENT_NODE *cl_node = 0;
        bool locked = true;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -8687,7 +8679,7 @@ SaAisErrorT saImmOmAdminOwnerFinalize(Sa
        bool locked = false;
        SaImmHandleT immHandle;
        SaUint32T adminOwnerId;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (cb->sv_id == 0) {
@@ -8822,7 +8814,7 @@ static SaAisErrorT imma_finalizeCcb(SaIm
        SaImmHandleT immHandle = 0LL;
        SaImmAdminOwnerHandleT adminOwnerHdl = 0LL;
        SaUint32T adminOwnerId = 0;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        SaImmAccessorHandleT safeReadAccessorHandle=0LL; // Copied from 
ccb_node later.
        TRACE_ENTER();
 
@@ -9094,7 +9086,7 @@ static SaBoolT imma_re_initialize_admin_
        IMMSV_EVT *out_evt = NULL;
        IMMA_CLIENT_NODE *cl_node = NULL;
        bool locked = false;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        TRACE_ENTER();
 
        if (m_NCS_LOCK(&cb->cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) {
@@ -9249,7 +9241,7 @@ int imma_om_resurrect(IMMA_CB *cb, IMMA_
        osafassert(locked && *locked);
        osafassert(cl_node && cl_node->stale);
        SaImmHandleT immHandle = cl_node->handle;
-       SaUint32T timeout = 0;
+       SaTimeT timeout = 0;
        SaAisErrorT err_resurrect=SA_AIS_OK;
 
        m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
diff --git a/osaf/libs/agents/saf/imma/imma_proc.c 
b/osaf/libs/agents/saf/imma/imma_proc.c
--- a/osaf/libs/agents/saf/imma/imma_proc.c
+++ b/osaf/libs/agents/saf/imma/imma_proc.c
@@ -3225,7 +3225,7 @@ SaAisErrorT imma_proc_check_stale(IMMA_C
 SaAisErrorT imma_evt_fake_evs(IMMA_CB *cb,
        IMMSV_EVT *i_evt,
        IMMSV_EVT **o_evt,
-       uint32_t timeout, SaImmHandleT immHandle, bool *locked, bool 
checkWritable)
+       SaTimeT timeout, SaImmHandleT immHandle, bool *locked, bool 
checkWritable)
 {
        SaAisErrorT rc = SA_AIS_OK;
        IMMSV_EVT fevs_evt;
diff --git a/osaf/services/saf/immsv/immd/immd_mds.c 
b/osaf/services/saf/immsv/immd/immd_mds.c
--- a/osaf/services/saf/immsv/immd/immd_mds.c
+++ b/osaf/services/saf/immsv/immd/immd_mds.c
@@ -662,7 +662,7 @@ uint32_t immd_mds_send_rsp(IMMD_CB *cb, 
   Notes         : None.
 ******************************************************************************/
 uint32_t immd_mds_msg_sync_send(IMMD_CB *cb, uint32_t to_svc, MDS_DEST to_dest,
-                            IMMSV_EVT *i_evt, IMMSV_EVT **o_evt, uint32_t 
timeout)
+                            IMMSV_EVT *i_evt, IMMSV_EVT **o_evt, SaTimeT 
timeout)
 {
 
        NCSMDS_INFO mds_info;
diff --git a/osaf/services/saf/immsv/immd/immd_mds.h 
b/osaf/services/saf/immsv/immd/immd_mds.h
--- a/osaf/services/saf/immsv/immd/immd_mds.h
+++ b/osaf/services/saf/immsv/immd/immd_mds.h
@@ -23,7 +23,7 @@
 uint32_t immd_mds_register(IMMD_CB *cb, SaAmfHAStateT ha_state);
 void immd_mds_unregister(IMMD_CB *cb);
 uint32_t immd_mds_msg_sync_send(IMMD_CB *cb, uint32_t to_svc, MDS_DEST to_dest,
-                                     IMMSV_EVT *i_evt, IMMSV_EVT **o_evt, 
uint32_t timeout);
+                                     IMMSV_EVT *i_evt, IMMSV_EVT **o_evt, 
SaTimeT timeout);
 
 uint32_t immd_mds_msg_send(IMMD_CB *cb, uint32_t to_svc, MDS_DEST to_dest, 
IMMSV_EVT *evt);
 

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to