Sorry, it is developed on 5.0

 

Thanks

-Nagu 

 

From: Hans Nordebäck [mailto:[email protected]] 
Sent: 18 April 2017 19:02
To: Nagendra Kumar; Praveen Malviya; Minh Hon Chau; Gary Lee
Cc: [email protected]; Hans Nordeback
Subject: Re: [devel] [PATCH 1 of 1] amfd: disallow delete of CtCs object if Ct 
maps to comp [#2428]

 

Hi Nagu,

there are some compiler errors related to TRACE,

osaf_extended_name_borrow() is missing for SaNameT and 

c_str() for std::string.

/Thanks Hans

 

On 04/18/2017 03:04 PM, Hans Nordebäck wrote:

Hi Nagu,

Is the patch only valid for 5.1? /Regards Hans

-----Original Message-----
From: Hans Nordebäck [mailto:[email protected]] 
Sent: den 18 april 2017 14:49
To: HYPERLINK "mailto:[email protected]"[email protected]; HYPERLINK 
"mailto:[email protected]"[email protected]; Minh Hon Chau 
HYPERLINK "mailto:[email protected]";<[email protected]>; Gary Lee 
HYPERLINK "mailto:[email protected]";<[email protected]>
Cc: HYPERLINK 
"mailto:[email protected]"[email protected]
Subject: Re: [devel] [PATCH 1 of 1] amfd: disallow delete of CtCs object if Ct 
maps to comp [#2428]

Hi Nagu,

can you please use the new git submit for review. /Thanks HansN


On 04/14/2017 03:22 PM, HYPERLINK 
"mailto:[email protected]"[email protected] wrote:
>   osaf/services/saf/amf/amfd/ctcstype.cc |  60 
>++++++++++++++++++++++++++++++++-
>   1 files changed, 58 insertions(+), 2 deletions(-)
>
>
> diff --git a/osaf/services/saf/amf/amfd/ctcstype.cc 
> b/osaf/services/saf/amf/amfd/ctcstype.cc
> --- a/osaf/services/saf/amf/amfd/ctcstype.cc
> +++ b/osaf/services/saf/amf/amfd/ctcstype.cc
> @@ -26,7 +26,7 @@
>   #include <include/csi.h>
>   
>   AmfDb<std::string, AVD_CTCS_TYPE> *ctcstype_db = nullptr;
> -
> +static void find_ct_name_from_association(const SaNameT *haystack, 
> +SaNameT *dn, const char *needle);
>   static void ctcstype_db_add(AVD_CTCS_TYPE *ctcstype)
>   {
>        unsigned int rc = ctcstype_db->insert(ctcstype->name,ctcstype);
> @@ -185,17 +185,73 @@ static SaAisErrorT ctcstype_ccb_complete
>                report_ccb_validation_error(opdata, "Modification of 
>SaAmfCtCsType not supported");
>                break;
>        case CCBUTIL_DELETE:
> +             AVD_CTCS_TYPE *ctcstype;
> +             SaNameT ct_name;
> +             AVD_COMP_TYPE *comp_type;
> +             AVD_COMP *comp;
> +             CcbUtilOperationData_t *t_opData;
> +
> +                ctcstype = 
> ctcstype_db->find(Amf::to_string(&opdata->objectName));
> +                if (ctcstype != nullptr) {
> +                     find_ct_name_from_association(&opdata->objectName, 
> &ct_name, ",safVersion");
> +                     TRACE("'%s'", ct_name.value);
> +                     comp_type = comptype_db->find(Amf::to_string(&ct_name));
> +                     if ((comp_type) && (nullptr != 
> comp_type->list_of_comp)) {
> +                             /* check whether there exists a delete 
> operation for
> +                              * each of the Comp in the comp_type list in 
> the current CCB
> +                              */
> +                             bool comp_exist = false;
> +                             TRACE("SaAmfCompType '%s' has components", 
> comp_type->name.value);
> +                             comp = comp_type->list_of_comp;
> +                             while (comp != nullptr) {
> +                                     TRACE("%s", comp->comp_info.name.value);
> +                                     t_opData = 
> ccbutil_getCcbOpDataByDN(opdata->ccbId, &comp->comp_info.name);
> +                                     TRACE("%p", t_opData);
> +                                     if ((t_opData == nullptr) || 
> (t_opData->operationType != CCBUTIL_DELETE)) {
> +                                             TRACE("Here %p", t_opData);
> +                                             comp_exist = true;
> +                                             break;
> +                                     }
> +                                     comp = comp->comp_type_list_comp_next;
> +                             }
> +                             if (comp_exist == true) {
> +                                     rc = SA_AIS_ERR_BAD_OPERATION;
> +                                     report_ccb_validation_error(opdata, 
> "SaAmfCompType '%s' is in use", comp_type->name.value);
> +                                     goto done;
> +                             }
> +                     } else
> +                             TRACE("SaAmfCompType '%p'. SaAmfCompType '%s' 
> has no components", comp_type, ct_name.value);
> +             }
>                rc = SA_AIS_OK;
>                break;
>        default:
>                osafassert(0);
>                break;
>        }
> -
> +done:
>        TRACE_LEAVE2("%u", rc);
>        return rc;
>   }
>   
> +/**
> + * Initialize a DN by searching for needle in haystack where two times 
> safVersion comes.
> + * @param haystack
> + * @param dn
> + * @param needle
> + * @note: 
> "safSupportedCsType=safVersion=1\,safCSType=AmfDemo1,safVersion=1,safCompType=AmfDemo1"
> + */
> +static void find_ct_name_from_association(const SaNameT *haystack, 
> +SaNameT *dn, const char *needle) {
> +        char *p;
> +
> +        memset(dn, 0, sizeof(SaNameT));
> +        p = strstr((char*)haystack->value, needle);
> +        osafassert(p);
> +     p++; /* Increament after comma (,) */
> +        dn->length = strlen(p);
> +        memcpy(dn->value, p, dn->length); }
> +
>   static void ctcstype_ccb_apply_cb(CcbUtilOperationData_t *opdata)
>   {
>        AVD_CTCS_TYPE *ctcstype;


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech 
sites, Slashdot.org! HYPERLINK 
"https://urldefense.proofpoint.com/v2/url?u=http-3A__sdm.link_slashdot&d=DwMD-g&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=Msq2CEtg63eU7sEKWk3a28RY1AX1Y11SftpoiJrP_ek&m=M25XqQpKgTn-teynBfP5jusUkPOp2XCjjUF-90f1cZc&s=4Fv2Wh3XzdZjwoVpmpoPt9BZLVhi6IHlWlBuGU2Mpv4&e="http://sdm.link/slashdot
 _______________________________________________
Opensaf-devel mailing list
HYPERLINK 
"mailto:[email protected]"[email protected]
HYPERLINK 
"https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_opensaf-2Ddevel&d=DwMD-g&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=Msq2CEtg63eU7sEKWk3a28RY1AX1Y11SftpoiJrP_ek&m=M25XqQpKgTn-teynBfP5jusUkPOp2XCjjUF-90f1cZc&s=HZ_0P4p-WnqF_5-2EFnr28WdHLiJ-RXt1DDF1bT6FXo&e="https://lists.sourceforge.net/lists/listinfo/opensaf-devel

 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to