osaf/libs/common/amf/include/amf_defs.h | 9 +++++
osaf/services/saf/amf/amfd/comptype.cc | 12 +++++++
osaf/services/saf/amf/amfnd/compdb.cc | 41 ++++++++++++++++++++++++-
osaf/services/saf/amf/amfnd/di.cc | 3 +
osaf/services/saf/amf/amfnd/include/avnd_comp.h | 2 +
5 files changed, 66 insertions(+), 1 deletions(-)
Added support for saAmfNumMaxInstantiateWithoutDelay
diff --git a/osaf/libs/common/amf/include/amf_defs.h
b/osaf/libs/common/amf/include/amf_defs.h
--- a/osaf/libs/common/amf/include/amf_defs.h
+++ b/osaf/libs/common/amf/include/amf_defs.h
@@ -272,6 +272,15 @@ typedef enum
saAmfHctDefMaxDuration_ID = 2,
} AVSV_AMF_HEALTHCHECK_TYPE_ATTR_ID;
+/* Attribute ID enum for the SaAmfCompGlobalAttributes class */
+typedef enum
+{
+ saAmfNumMaxInstantiateWithoutDelay_ID = 1,
+ saAmfNumMaxInstantiateWithDelay_ID = 2,
+ saAmfNumMaxAmStartAttempts_ID = 3,
+ saAmfNumMaxAmStopAttempts_ID = 4,
+ saAmfDelayBetweenInstantiateAttempts_ID = 5
+} AVSV_AMF_COMP_GLOBAL_ATTRIBUTES_ATTR_ID;
#define AVSV_COMMON_SUB_ID_DEFAULT_VAL 1
#define SA_AMF_PRESENCE_ORPHANED (SA_AMF_PRESENCE_TERMINATION_FAILED+1)
diff --git a/osaf/services/saf/amf/amfd/comptype.cc
b/osaf/services/saf/amf/amfd/comptype.cc
--- a/osaf/services/saf/amf/amfd/comptype.cc
+++ b/osaf/services/saf/amf/amfd/comptype.cc
@@ -748,12 +748,23 @@ static void avd_compglobalattrs_ccb_appl
switch (opdata->operationType) {
case CCBUTIL_MODIFY:
while ((attrMod = opdata->param.modify.attrMods[i++]) != NULL) {
+ AVSV_PARAM_INFO param;
+ memset(¶m, 0, sizeof(param));
+ param.class_id = AVSV_SA_AMF_COMP_GLOBAL_ATTR;
+ param.act = AVSV_OBJ_OPR_MOD;
+ param.name = opdata->objectName;
+
if (!strcmp("saAmfNumMaxInstantiateWithoutDelay",
attrMod->modAttr.attrName)) {
TRACE("saAmfNumMaxInstantiateWithoutDelay
modified from '%u' to '%u'",
avd_comp_global_attrs.saAmfNumMaxInstantiateWithoutDelay,
*((SaUint32T
*)attrMod->modAttr.attrValues[0]));
avd_comp_global_attrs.saAmfNumMaxInstantiateWithoutDelay =
*((SaUint32T
*)attrMod->modAttr.attrValues[0]);
+
+ param.value_len =
sizeof(avd_comp_global_attrs.saAmfNumMaxInstantiateWithoutDelay);
+ memcpy(param.value,
&avd_comp_global_attrs.saAmfNumMaxInstantiateWithoutDelay, param.value_len);
+ param.attr_id =
saAmfNumMaxInstantiateWithoutDelay_ID;
+ avd_snd_op_req_msg(avd_cb, NULL, ¶m);
}
if (!strcmp("saAmfNumMaxInstantiateWithDelay",
attrMod->modAttr.attrName)) {
TRACE("saAmfNumMaxInstantiateWithDelay modified
from '%u' to '%u'",
@@ -789,6 +800,7 @@ static void avd_compglobalattrs_ccb_appl
osafassert(0);
break;
}
+ TRACE_LEAVE();
}
static SaAisErrorT avd_compglobalattrs_ccb_completed_cb(CcbUtilOperationData_t
*opdata)
diff --git a/osaf/services/saf/amf/amfnd/compdb.cc
b/osaf/services/saf/amf/amfnd/compdb.cc
--- a/osaf/services/saf/amf/amfnd/compdb.cc
+++ b/osaf/services/saf/amf/amfnd/compdb.cc
@@ -889,6 +889,43 @@ done:
return rc;
}
+uint32_t avnd_globalattr_oper_req(AVND_CB *cb, AVSV_PARAM_INFO *param)
+{
+ uint32_t rc = NCSCC_RC_FAILURE;
+ TRACE_ENTER();
+
+ switch (param->act) {
+ case AVSV_OBJ_OPR_MOD: {
+ AVND_COMP *comp = (AVND_COMP *)
ncs_patricia_tree_getnext(&cb->compdb, (uint8_t *) 0);
+ while (comp != 0) {
+ switch (param->attr_id) {
+ case saAmfNumMaxInstantiateWithoutDelay_ID: {
+ SaUint32T
saAmfNumMaxInstantiateWithoutDelay = *((SaUint32T *) param->value);;
+ if
(comp->use_comptype_attr->test(GlobalNumMaxInstantiateWithoutDelay)) {
+ comp->clc_info.inst_retry_max =
saAmfNumMaxInstantiateWithoutDelay;
+
TRACE("comp->clc_info.inst_retry_max modified to '%u' for %s",
+
comp->clc_info.inst_retry_max, comp->name.value);
+ }
+ break;
+ }
+ default:
+ LOG_WA("Unexpected attribute id: %d",
param->attr_id);
+ }
+ comp = (AVND_COMP *)
ncs_patricia_tree_getnext(&cb->compdb, (uint8_t *) &comp->name);
+ }
+ }
+ case AVSV_OBJ_OPR_DEL: {
+ // Do nothing
+ break;
+ }
+
+ }
+
+ TRACE_LEAVE();
+ rc = NCSCC_RC_SUCCESS;
+ return rc;
+}
+
uint32_t avnd_comptype_oper_req(AVND_CB *cb, AVSV_PARAM_INFO *param)
{
uint32_t rc = NCSCC_RC_FAILURE;
@@ -1564,8 +1601,10 @@ static int comp_init(AVND_COMP *comp, co
}
if
(immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCompNumMaxInstantiateWithoutDelay"),
attributes,
- 0, &comp->clc_info.inst_retry_max) != SA_AIS_OK)
+ 0, &comp->clc_info.inst_retry_max) != SA_AIS_OK) {
comp->clc_info.inst_retry_max =
comp_global_attrs.saAmfNumMaxInstantiateWithoutDelay;
+
comp->use_comptype_attr->set(GlobalNumMaxInstantiateWithoutDelay);
+ }
#if 0
// TODO
diff --git a/osaf/services/saf/amf/amfnd/di.cc
b/osaf/services/saf/amf/amfnd/di.cc
--- a/osaf/services/saf/amf/amfnd/di.cc
+++ b/osaf/services/saf/amf/amfnd/di.cc
@@ -225,6 +225,9 @@ uint32_t avnd_evt_avd_operation_request_
case AVSV_SA_AMF_COMP:
rc = avnd_comp_oper_req(cb, param);
break;
+ case AVSV_SA_AMF_COMP_GLOBAL_ATTR:
+ rc = avnd_globalattr_oper_req(cb, param);
+ break;
case AVSV_SA_AMF_COMP_TYPE:
rc = avnd_comptype_oper_req(cb, param);
break;
diff --git a/osaf/services/saf/amf/amfnd/include/avnd_comp.h
b/osaf/services/saf/amf/amfnd/include/avnd_comp.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_comp.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_comp.h
@@ -296,6 +296,7 @@ enum UsedComptypeAttrs {
DefDisableRestart,
DefQuiescingCompleteTimeout,
CompInstantiationLevel,
+ GlobalNumMaxInstantiateWithoutDelay,
NumAttrs
};
@@ -899,6 +900,7 @@ extern void avnd_mbcsv_comp_hc_rec_del(s
extern uint32_t avnd_comp_oper_req(struct avnd_cb_tag *cb, AVSV_PARAM_INFO
*param);
extern uint32_t avnd_comptype_oper_req(struct avnd_cb_tag *cb, AVSV_PARAM_INFO
*param);
+extern uint32_t avnd_globalattr_oper_req(struct avnd_cb_tag *cb,
AVSV_PARAM_INFO *param);
extern unsigned int avnd_comp_config_get_su(struct avnd_su_tag *su);
extern int avnd_comp_config_reinit(AVND_COMP *comp);
extern void avnd_comp_delete(AVND_COMP *comp);
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel