Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsForwardZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsForwardZone Added Files: CmpiLinux_DnsForwardZoneProvider.h Linux_DnsForwardZoneInstanceName.h Linux_DnsForwardZoneFactory.cpp Linux_DnsForwardZoneInstanceName.cpp Linux_DnsForwardZoneFakeFactory.cpp Linux_DnsForwardZoneManualInstance.h Linux_DnsForwardZoneRepositoryInstance.cpp Linux_DnsForwardZoneDefaultImplementation.h Linux_DnsForwardZoneRepositoryExternal.cpp Linux_DnsForwardZoneInstance.h Linux_DnsForwardZoneExternal.h Linux_DnsForwardZoneResourceAccess.h Linux_DnsForwardZoneDefaultImplementation.cpp Linux_DnsForwardZoneManualInstance.cpp makefile Linux_DnsForwardZoneResourceAccess.cpp Linux_DnsForwardZoneExternal.cpp Linux_DnsForwardZoneInterface.h Linux_DnsForwardZoneRepositoryExternal.h CmpiLinux_DnsForwardZoneProvider.cpp Linux_DnsForwardZoneInstance.cpp Linux_DnsForwardZoneRepositoryInstance.h setting.provider Linux_DnsForwardZoneFactory.h Log Message: WBEM-SMT DNS provider component. First initial upload. This module includes: - CIM model for DNS - CMPI provider for DNS - Resource Access layer for DNS --- NEW FILE: Linux_DnsForwardZoneFakeFactory.cpp --- /** * Linux_DnsForwardZoneFakeFactory.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include <iostream> #include <strings.h> #include "Linux_DnsForwardZoneFactory.h" using namespace std; namespace genProvider{ Linux_DnsForwardZoneInterface* Linux_DnsForwardZoneFactory::getImplementation(){ cout<<"ERROR: incomplete support library is being used"<<endl; cout<<" in provider from class Linux_DnsForwardZone"<<endl; cout<<" Use the link-install options for the makefile"<<endl; return 0; }; } --- NEW FILE: setting.provider --- #Provider configuration #CPPFLAGS.provider LDFLAGS.provider=-ldnssupport --- NEW FILE: Linux_DnsForwardZoneDefaultImplementation.h --- /** * Linux_DnsForwardZoneDefaultImplementation.h * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #ifndef Linux_DnsForwardZoneDefaultImplementation_h #define Linux_DnsForwardZoneDefaultImplementation_h #include "Linux_DnsForwardZoneInstanceName.h" #include "Linux_DnsForwardZoneManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "CIM_CollectionOfMSEsInstanceName.h" #include "CIM_ManagedSystemElementInstanceName.h" #include "Linux_DnsForwardZoneInterface.h" namespace genProvider { class Linux_DnsForwardZoneDefaultImplementation: public Linux_DnsForwardZoneInterface { public: virtual ~Linux_DnsForwardZoneDefaultImplementation() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsForwardZoneInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsForwardZoneManualInstanceEnumeration& instances); virtual Linux_DnsForwardZoneManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsForwardZoneInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsForwardZoneManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&); /* extrinsic methods */ virtual CMPIUint32 ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent); virtual CMPIUint32 ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent); virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent); virtual CMPIUint32 VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent); }; } #endif --- NEW FILE: Linux_DnsForwardZoneResourceAccess.cpp --- /** * Linux_DnsForwardZoneResourceAccess.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include <string> #include <iostream> using namespace std; #include "Linux_DnsForwardZoneResourceAccess.h" namespace genProvider { //------------------------------------------------------------------------------------ // Linux_DnsForwardZoneResourceAccess::setInstanceNameProperties() //------------------------------------------------------------------------------------ void Linux_DnsForwardZoneResourceAccess::setInstanceNameProperties(const CmpiContext& ctx, const CmpiBroker& mbp, const char* nsp, DNSZONE * zone, Linux_DnsForwardZoneInstanceName& anInstanceName) { cout << "--- setInstanceNameProperties() called" << endl; anInstanceName.setNamespace(nsp); anInstanceName.setName(zone->zoneName); cout << "--- setInstanceNameProperties() exited" << endl; } //------------------------------------------------------------------------------------ // Linux_DnsForwardZoneResourceAccess::setInstanceProperties() //------------------------------------------------------------------------------------ void Linux_DnsForwardZoneResourceAccess::setInstanceProperties(const CmpiContext& ctx, const CmpiBroker& mbp, DNSZONE * zone, const Linux_DnsForwardZoneInstanceName& anInstanceName, Linux_DnsForwardZoneManualInstance& aManualInstance) { cout<<"--- setInstanceProperties() called"<<endl; aManualInstance.setInstanceName(anInstanceName); aManualInstance.setType(DNS_ZONETYPE_FORWARD); // aManualInstance.setResourceRecordFile(zone->zoneFileName); ZONEOPTS * forward = findOptsInZone( zone, "forward" ); if ( forward ) { if ( strcmp( forward->value, "first" ) ) aManualInstance.setForward( DNS_FORWARD_FIRST ); if ( strcmp( forward->value, "only" ) ) aManualInstance.setForward( DNS_FORWARD_ONLY ); } ZONEOPTS * forwarders = findOptsInZone( zone, "forwarders" ); DnsArray da; if ( forwarders && forwarders->value ) { da.populate( forwarders->value ); aManualInstance.setForwarders( da.toArray(), da.size() ); } } //Linux_DnsForwardZoneResourceAccess::Linux_DnsForwardZoneResourceAccess(); Linux_DnsForwardZoneResourceAccess::~Linux_DnsForwardZoneResourceAccess() { }; /* intrinsic methods */ void Linux_DnsForwardZoneResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsForwardZoneInstanceNameEnumeration& instnames){ DNSZONE * zones, *all_zones; cout << "--- enumInstanceNames() called" << endl; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("forward"); all_zones = zones; if (zones) { for (; zones->zoneName; zones++) { if ( strcmp(zones->zoneType, "forward") ) continue; Linux_DnsForwardZoneInstanceName instanceName; cout << "--- Calling setInstanceNameProperties()" << endl; printf ("Zone Name is %s \n", zones->zoneName); setInstanceNameProperties(ctx, mbp, nsp, zones, instanceName); instnames.addElement(instanceName); cout << "--- Added to enumeration" << endl; } freeZones( all_zones ); cout << "--- enumInstanceNames () exited" << endl; } } void Linux_DnsForwardZoneResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsForwardZoneManualInstanceEnumeration& instances){ cout << "--- enumInstances() called" << endl; DNSZONE * zones = NULL, *all_zones; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("forward"); all_zones = zones; if (zones) { for (; zones->zoneName != NULL ; zones++) { if ( strcmp(zones->zoneType, "forward") ) continue; Linux_DnsForwardZoneManualInstance instance; Linux_DnsForwardZoneInstanceName instanceName; cout << "--- Calling setInstanceNameProperties() for zone" << endl; printf (" -----%s \n", zones->zoneName); setInstanceNameProperties(ctx, mbp, nsp, zones, instanceName); cout << "--- Calling setInstanceProperties()" << endl; setInstanceProperties(ctx, mbp, zones, instanceName, instance); instances.addElement(instance); cout << "--- Added to enumeration" << endl; } freeZones( all_zones ); } else { cout << "--- No Zones Found" << endl; } cout << "--- enumInstances() exited" << endl; }; Linux_DnsForwardZoneManualInstance Linux_DnsForwardZoneResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsForwardZoneInstanceName& anInstanceName){ cout << "--- getInstance() called" << endl; DNSZONE *zones, *myZone; Linux_DnsForwardZoneManualInstance instance; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("forward"); myZone = findZone(zones,anInstanceName.getName()); setInstanceProperties(ctx, mbp, myZone, anInstanceName, instance); cout << "--- getInstance() exited " << endl; freeZones( zones ); return instance; } void Linux_DnsForwardZoneResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsForwardZoneManualInstance& newInstance){ cout << "--- setInstance() called" << endl; DNSZONE *zones, *myZone; zones = getZones(); myZone = findZone(zones, newInstance.getInstanceName().getName()); if ( ! myZone ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); if ( strcmp(myZone->zoneType,"forward") != 0 ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); if ( newInstance.isForwardSet() ) { ZONEOPTS *zopts = findOptsInZone( myZone, "forward" ); if ( zopts ) { free( zopts->value ); if ( newInstance.getForward() == DNS_FORWARD_ONLY ) zopts->value = strdup( "only" ); if ( newInstance.getForward() == DNS_FORWARD_FIRST ) zopts->value = strdup( "first" ); } else { if ( newInstance.getForward() == DNS_FORWARD_ONLY ) addOptsToZone( myZone, "forward", "only" ); if ( newInstance.getForward() == DNS_FORWARD_FIRST ) addOptsToZone( myZone, "forward", "first" ); } } unsigned int size = 0; if ( newInstance.isForwardersSet() ) { ZONEOPTS *zopts = findOptsInZone( myZone, "forwarders" ); const char **forwardersList = newInstance.getForwarders( size ); DnsArray value_list; for (unsigned int i = 0; i < size; i++) if (! value_list.isPresent( string( forwardersList[i]) ) ) value_list.add( forwardersList[i] ); if ( zopts ) { free( zopts->value ); zopts->value = strdup ( value_list.toString().c_str() ); } else addOptsToZone( myZone,"forwarders", strdup( value_list.toString().c_str() ) ); } // option 'file' is not allowed in 'forward' zone if ( newInstance.isResourceRecordFileSet() ) { free(myZone->zoneFileName); myZone->zoneFileName = strdup(newInstance.getResourceRecordFile()); } updateZones( zones ); freeZones( zones ); }; void Linux_DnsForwardZoneResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneManualInstance& aManualInstance){ cout << "--- createInstance() called" << endl; DNSZONE * newZone = NULL; Linux_DnsForwardZoneInstanceName anInstanceName = aManualInstance.getInstanceName(); if (((anInstanceName.getName()) == NULL) || ((anInstanceName.getName()) == "" ) || ((anInstanceName.getName()) =="") ) { // throw exception that invalid key cout << "---- Zonename is invalid" << endl; throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"Zonename is invalid"); } DNSZONE * all_zones = getZones(); if ( findZone(all_zones,anInstanceName.getName()) ) { freeZones(all_zones); throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The zone already exist"); } freeZones(all_zones); newZone = (DNSZONE *)calloc(1+1,sizeof(DNSZONE)); if (newZone) { newZone->zoneName = (char *)anInstanceName.getName(); newZone->zoneType = "forward"; if ( aManualInstance.isForwardSet() ) { if ( aManualInstance.getForward() == DNS_FORWARD_ONLY ) addOptsToZone( newZone, "forward", "only" ); if ( aManualInstance.getForward() == DNS_FORWARD_FIRST ) addOptsToZone( newZone, "forward", "first" ); } unsigned int size = 0; if ( aManualInstance.isForwardersSet() ) { const char **forwardersList = aManualInstance.getForwarders( size ); DnsArray value_list; for (unsigned int i = 0; i < size; i++) if (! value_list.isPresent( string( forwardersList[i]) ) ) value_list.add( forwardersList[i] ); addOptsToZone( newZone,"forwarders", strdup( value_list.toString().c_str() ) ); } cout << "---- newZone->zoneType is "<< newZone->zoneType << endl; //option 'file' is not allowed in 'forward' zone if (aManualInstance.isResourceRecordFileSet()) { newZone->zoneFileName = strdup(aManualInstance.getResourceRecordFile()); } else { char * buffer; buffer = (char *)calloc((strlen(newZone->zoneType)+strlen(newZone->zoneName)+2),sizeof(char)); strcat(buffer, newZone->zoneType); strcat(buffer, "/"); strcat(buffer, newZone->zoneName); newZone->zoneFileName = buffer; } newZone->records = NULL; cout << "---- calling addZones() " << endl; DNSZONE * returnedZones = NULL; returnedZones = addZone(newZone, NULL); if (!returnedZones) { cout <<"---- addZone() failed " << endl; cout <<"---- createInstance Zone exited " << endl; throw CmpiStatus(CMPI_RC_ERROR,"addZone() failed"); } freeZones( returnedZones ); cout <<"---- createInstance Zone exited " << endl; } }; void Linux_DnsForwardZoneResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName& inst){ deleteZone( inst.getName() ); }; /* extrinsic methods */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ CMPIUint32 Linux_DnsForwardZoneResourceAccess::disable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName& inst) { if ( inst.getName() == NULL ) return 3; disableZone( inst.getName() ); }; CMPIUint32 Linux_DnsForwardZoneResourceAccess::enable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName& inst) { if ( inst.getName() == NULL ) return 3; enableZone( inst.getName() ); }; } --- NEW FILE: Linux_DnsForwardZoneExternal.cpp --- /** * Linux_DnsForwardZoneExternal.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsForwardZoneExternal.h" namespace genProvider{ Linux_DnsForwardZoneExternal::Linux_DnsForwardZoneExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; Linux_DnsForwardZoneExternal:: ~Linux_DnsForwardZoneExternal(){}; void Linux_DnsForwardZoneExternal::enumInstanceNames( const char *nsp, Linux_DnsForwardZoneInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsForwardZone"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsForwardZoneInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsForwardZoneExternal::enumInstances( const char *nsp, const char* *properties, Linux_DnsForwardZoneInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsForwardZone"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsForwardZoneInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsForwardZoneInstance Linux_DnsForwardZoneExternal::getInstance( const char* *properties, const Linux_DnsForwardZoneInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsForwardZoneInstance(inst,instanceName.getNamespace()); } void Linux_DnsForwardZoneExternal::setInstance( const char* *properties, const Linux_DnsForwardZoneInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsForwardZoneExternal::createInstance( const Linux_DnsForwardZoneInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsForwardZoneExternal::deleteInstance( const Linux_DnsForwardZoneInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); broker.deleteInstance(context,op); } } --- NEW FILE: makefile --- include ../setting.cmpi include setting.provider CPPFLAGS=$(CPPFLAGS.provider) -I. -I$(CIMOMINC) -I$(COMMONINC) -I$(CIMOMINC)/cpp -I../CIM_CollectionOfMSEs -I../CIM_ManagedSystemElement -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lCIM_CollectionOfMSEsSupport -lCIM_ManagedSystemElementSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsForwardZoneInstanceName.o \ Linux_DnsForwardZoneInstance.o \ Linux_DnsForwardZoneExternal.o \ Linux_DnsForwardZoneRepositoryInstance.o \ Li... [truncated message content] |