You can subscribe to this list here.
2005 |
Jan
|
Feb
(1) |
Mar
(45) |
Apr
(150) |
May
(145) |
Jun
(150) |
Jul
(79) |
Aug
(313) |
Sep
(160) |
Oct
(309) |
Nov
(115) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(160) |
Feb
(144) |
Mar
(127) |
Apr
(48) |
May
(102) |
Jun
(54) |
Jul
(245) |
Aug
(94) |
Sep
(152) |
Oct
(162) |
Nov
(166) |
Dec
(740) |
2007 |
Jan
(752) |
Feb
(437) |
Mar
(328) |
Apr
(373) |
May
(569) |
Jun
(399) |
Jul
(369) |
Aug
(627) |
Sep
(100) |
Oct
(306) |
Nov
(166) |
Dec
(282) |
2008 |
Jan
(68) |
Feb
(145) |
Mar
(180) |
Apr
(160) |
May
(277) |
Jun
(229) |
Jul
(1188) |
Aug
(51) |
Sep
(97) |
Oct
(99) |
Nov
(95) |
Dec
(170) |
2009 |
Jan
(39) |
Feb
(73) |
Mar
(120) |
Apr
(121) |
May
(104) |
Jun
(262) |
Jul
(57) |
Aug
(171) |
Sep
(131) |
Oct
(88) |
Nov
(64) |
Dec
(83) |
2010 |
Jan
(55) |
Feb
(67) |
Mar
(124) |
Apr
(64) |
May
(130) |
Jun
(75) |
Jul
(164) |
Aug
(64) |
Sep
(44) |
Oct
(17) |
Nov
(43) |
Dec
(31) |
2011 |
Jan
(21) |
Feb
(10) |
Mar
(43) |
Apr
(46) |
May
(52) |
Jun
(71) |
Jul
(7) |
Aug
(16) |
Sep
(51) |
Oct
(14) |
Nov
(33) |
Dec
(15) |
2012 |
Jan
(12) |
Feb
(61) |
Mar
(129) |
Apr
(76) |
May
(70) |
Jun
(52) |
Jul
(29) |
Aug
(41) |
Sep
(32) |
Oct
(23) |
Nov
(38) |
Dec
(26) |
2013 |
Jan
(35) |
Feb
(37) |
Mar
(51) |
Apr
(15) |
May
(52) |
Jun
(15) |
Jul
(23) |
Aug
(21) |
Sep
(46) |
Oct
(69) |
Nov
(57) |
Dec
(26) |
2014 |
Jan
(5) |
Feb
(13) |
Mar
(17) |
Apr
(1) |
May
(5) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(16) |
Nov
(8) |
Dec
(4) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Viktor M. <mih...@us...> - 2005-04-20 17:00:37
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13876 Modified Files: Makefile.am configure.ac sfcbrepos.sh.in Added Files: sfcbunstage.sh.in Log Message: Bug 1183788: Modifications to support uninstall of providers. Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/sfcb/configure.ac,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- configure.ac 19 Apr 2005 13:21:11 -0000 1.7 +++ configure.ac 20 Apr 2005 17:00:27 -0000 1.8 @@ -133,5 +133,5 @@ AC_SUBST(MOFC_DIR) fi -AC_CONFIG_FILES([Makefile sfcb.spec sfcbrepos.sh sfcbstage.sh sfcb.cfg.pre getSchema.sh.pre]) +AC_CONFIG_FILES([Makefile sfcb.spec sfcbrepos.sh sfcbstage.sh sfcbunstage.sh sfcb.cfg.pre getSchema.sh.pre]) AC_OUTPUT Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.am 11 Apr 2005 23:13:34 -0000 1.9 +++ Makefile.am 20 Apr 2005 17:00:26 -0000 1.10 @@ -155,13 +155,14 @@ EXTRA_DIST=sfcb.cfg.pre.in sfcb.spec sfcbrepos.sh.in sfcbstage.sh.in \ - sfcb.init-redhat sfcb.init-suse sfcb.init-none regressionTests doc + sfcbunstage.sh.in sfcb.init-redhat sfcb.init-suse sfcb.init-none \ + regressionTests doc dist_pkgdata_SCRIPTS=genSslCert.sh getSchema.sh dist_pkgdata_DATA=default.reg -nodist_bin_SCRIPTS=sfcbrepos sfcbstage +nodist_bin_SCRIPTS=sfcbrepos sfcbstage sfcbunstage sfcbrepos: sfcbrepos.sh sed s?$$\{prefix\}?$(prefix)?g $< > $@ @@ -169,6 +170,9 @@ sfcbstage: sfcbstage.sh sed s?$$\{prefix\}?$(prefix)?g $< > $@ +sfcbunstage: sfcbunstage.sh + sed s?$$\{prefix\}?$(prefix)?g $< > $@ + sfcb.cfg: sfcb.cfg.pre sed s?$$\{prefix\}?$(prefix)?g $< > $@ @@ -207,7 +211,7 @@ rm -f $(DESTDIR)$(initdir)/sfcb clean-local: - rm -f sfcbrepos sfcbstage sfcb.cfg getSchema.sh sfcb.init + rm -f sfcbrepos sfcbstage sfcbunstage sfcb.cfg getSchema.sh sfcb.init dist-hook: test -d "$(distdir)" && rm -rf `find $(distdir) -type d -name CVS` Index: sfcbrepos.sh.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcbrepos.sh.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sfcbrepos.sh.in 1 Apr 2005 11:55:28 -0000 1.4 +++ sfcbrepos.sh.in 20 Apr 2005 17:00:27 -0000 1.5 @@ -81,15 +81,31 @@ if [ -d $stagingdir ] && [ -f $stagingdir/default.reg ] && [ -f $cimschemadir/CIM_Schema.mof ] then - if rm -rf $registrationdir/repository && + if rm -rf $registrationdir/repository.previous && + mv -f $registrationdir/repository $registrationdir/repository.previous && + mv -f $registrationdir/providerRegister $registrationdir/providerRegister.previous && mkdir -p $registrationdir/repository/root/cimv2 && - cp $stagingdir/default.reg $registrationdir/providerRegister && - cat $stagingdir/regs/*.reg >> $registrationdir/providerRegister && - sfcbmof -o $registrationdir/repository/root/cimv2/classSchemas -I $cimschemadir -i CIM_Schema.mof $stagingdir/mofs/*.mof - then + cp $stagingdir/default.reg $registrationdir/providerRegister + then + if ls $stagingdir/regs/*.reg > /dev/null 2>&1 + then + if ! cat $stagingdir/regs/*.reg >> $registrationdir/providerRegister + then + echo Failed copying the registration files. >&2 + exit 1 + fi + fi + if ls $stagingdir/mofs/*.mof > /dev/null 2>&1 + then + if ! sfcbmof -o $registrationdir/repository/root/cimv2/classSchemas -I $cimschemadir -i CIM_Schema.mof $stagingdir/mofs/*.mof + then + echo Failed compiling the MOF files. >&2 + exit 1 + fi + fi exit 0 else - echo Failed to create sfcb registration. >&2 + echo Failed to write sfcb registration files. >&2 exit 1 fi else --- NEW FILE: sfcbunstage.sh.in --- #!/bin/sh function usage() { echo "usage: $0 [-h] [ -s stagingdir] [ -r regfile ] [ mof ... ] " 1>&2 } args=`getopt hr:s: $*` if [ $? != 0 ] then usage $0 exit 1 fi set -- $args while [ -n "$1" ] do case $1 in -h) help=1; shift;; -s) stagingdir=$2 shift 2;; -r) regfile=$2 shift 2;; --) shift; break;; **) break;; esac done if [ "$help" == "1" ] then usage echo -e "\t-h display help message" echo -e "\t-s specify staging directory [@localstatedir@/lib/sfcb/stage]" echo -e "\t-r specify sfcb registration file " echo echo Use this command to remove registration files from the sfcb staging area. exit 0 fi if [ -z "$*" ] && [ -z "$regfile" ] then usage $0 exit 1 fi if [ -z "$stagingdir" ] then stagingdir=@localstatedir@/lib/sfcb/stage fi if [ -n "$regfile" ] then if test -d $stagingdir/regs then rm -f $stagingdir/regs/$regfile || echo "Error: could not remove registration file " 1>&2 fi fi if [ -n "$*" ] then if test -d $stagingdir/mofs then cd $stagingdir/mofs rm -f $* || echo "Error: could not remove schema files " 1>&2 fi fi |
From: Heidi E. <hei...@us...> - 2005-04-20 11:40:31
|
Update of /cvsroot/sblim/cmpi-fsvol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5454 Modified Files: AUTHORS ChangeLog Makefile.am README configure.ac Added Files: OSBase_BlockStorageStatisticalData.c OSBase_BlockStorageStatisticalData.h cmpiOSBase_BlockStorageStatisticalData.c cmpiOSBase_BlockStorageStatisticalData.h cmpiOSBase_BlockStorageStatisticalDataProvider.c Log Message: feature request# 1186595: support for LogicalDisk statistical data added ... contribution by Michael Schuele :) ... thx --- NEW FILE: cmpiOSBase_BlockStorageStatisticalData.h --- #ifndef _CMPIOSBASE_BLOCKSTORAGESTATISTICALDATA_H_ #define _CMPIOSBASE_BLOCKSTORAGESTATISTICALDATA_H_ /* * cmpiOSBase_BlockStorageStatisticalData.h * * (C) Copyright IBM Corp. 2004, 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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Magabeablity Programming Interface ( CMPI ) * * Description: * This file defines the interfaces for the factory implementation of the * CIM class Linux_BlockStorageStatisticalData. * */ /* ---------------------------------------------------------------------------*/ #include "cmpidt.h" #include "OSBase_BlockStorageStatisticalData.h" /* ---------------------------------------------------------------------------*/ static char * _ClassName = "Linux_BlockStorageStatisticalData"; static const char * _INSTANCE_PREFIX = "Linux:"; static int _INSTANCE_PREFIX_LENGTH = 6; /* ---------------------------------------------------------------------------*/ /* method to create a CMPIObjectPath of this class */ CMPIObjectPath * _makePath_BlockStorageStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * cop, CMPIStatus * rc, struct disk_data *disk); /* method to create a CMPIInstance of this class */ CMPIInstance * _makeInst_BlockStorageStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * cop, const char ** properties, CMPIStatus * rc, struct disk_data *disk); /* ---------------------------------------------------------------------------*/ #endif Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/configure.ac,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configure.ac 19 Apr 2005 16:00:13 -0000 1.2 +++ configure.ac 20 Apr 2005 11:40:19 -0000 1.3 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(SBLIM BaseOS Filesystem Providers, 1.3.0, sbl...@li...,sblim-cmpi-fsvol) +AC_INIT(SBLIM BaseOS Filesystem Providers, 1.4.0, sbl...@li...,sblim-cmpi-fsvol) AC_CONFIG_SRCDIR([OSBase_CommonFsvol.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 15 Apr 2005 14:28:15 -0000 1.1 +++ Makefile.am 20 Apr 2005 11:40:19 -0000 1.2 @@ -43,6 +43,7 @@ # OSBase CMPI provider libraries provider_LTLIBRARIES = libcmpiOSBase_LocalFileSystemProvider.la \ libcmpiOSBase_NFSProvider.la \ + libcmpiOSBase_BlockStorageStatisticalDataProvider.la \ libcmpiOSBase_HostedFileSystemProvider.la \ libcmpiOSBase_BootOSFromFSProvider.la @@ -62,6 +63,14 @@ libcmpiOSBase_NFSProvider_la_LIBADD = \ -lcmpiOSBase_CommonFsvol +# Block Storage Statistical Data +libcmpiOSBase_BlockStorageStatisticalDataProvider_la_SOURCES = \ + cmpiOSBase_BlockStorageStatisticalDataProvider.c \ + cmpiOSBase_BlockStorageStatisticalData.c \ + OSBase_BlockStorageStatisticalData.c +libcmpiOSBase_BlockStorageStatisticalDataProvider_la_LIBADD = \ + -lcmpiOSBase_CommonFsvol + # Hosted Filesystem (Association) libcmpiOSBase_HostedFileSystemProvider_la_SOURCES = \ cmpiOSBase_HostedFileSystemProvider.c @@ -88,8 +97,10 @@ # Non-Installable Header Files noinst_HEADERS = OSBase_LocalFileSystem.h \ OSBase_NFS.h \ + OSBase_BlockStorageStatisticalData.h \ cmpiOSBase_LocalFileSystem.h \ cmpiOSBase_NFS.h \ + cmpiOSBase_BlockStorageStatisticalData.h \ cmpiOSBase_BootOSFromFS.h # We must explicity add the RPM spec file to the distribution package @@ -146,6 +157,7 @@ test/cim/Linux_Ext3FileSystem.cim \ test/cim/Linux_HostedFileSystem.cim \ test/cim/Linux_NFS.cim \ + test/cim/Linux_BlockStorageStatisticalData.cim \ test/cim/Linux_ReiserFileSystem.cim runtest: install Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ChangeLog 15 Apr 2005 14:28:15 -0000 1.1 +++ ChangeLog 20 Apr 2005 11:40:19 -0000 1.2 @@ -15,8 +15,15 @@ * test script accepts userID and password // =================================================================== -// new in version 1.3 : +// new in version 1.3.0 : * support for property list filter on EnumInstances and GetInstance // =================================================================== +// new in version 1.4.0 : + +* feature request# 1186595: added support for class + Linux_BlockStorageStatisticalData + ... contribution by Michael Schuele ... thx :) + +// =================================================================== Index: README =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/README,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- README 15 Apr 2005 14:28:15 -0000 1.6 +++ README 20 Apr 2005 11:40:19 -0000 1.7 @@ -32,6 +32,7 @@ - Linux_Ext3FileSystem - Linux_ReiserFileSystem - Linux_NFS +- Linux_BlockStorageStatisticalData - Linux_HostedFileSystem - Linux_BootOSFromFS @@ -138,6 +139,12 @@ - cmpiOSBase_NFS.c/.h - OSBase_NFS.c/.h +class Linux_BlockStorageStatisticalData +........................... +- cmpiOSBase_BlockStorageStatisticalDataProvider.c +- cmpiOSBase_BlockStorageStatisticalData.c/.h +- OSBase_BlockStorageStatisticalData.c/.h + association Linux_HostedFileSystem ........................... --- NEW FILE: OSBase_BlockStorageStatisticalData.h --- #ifndef _LINUX_BLOCKSTORAGESTATISTICALDATA_H_ #define _LINUX_BLOCKSTORAGESTATISTICALDATA_H_ /* * Linux_BlockStorageStatisticalData.h * * (C) Copyright IBM Corp. 2004, 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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Description: * This file defines the interfaces for the resource access implementation * of the CIM class Linux_BlockStorageStatisticalData * */ /* ---------------------------------------------------------------------------*/ //#include <pthread.h> #include <sys/types.h> #ifdef __cplusplus extern "C" { #endif //static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* ---------------------------------------------------------------------------*/ /** the data of one single drive */ struct disk_data { char *id; unsigned long long kb_read; unsigned long long kb_transfered; unsigned long long read_ios; unsigned long long write_ios; unsigned long long total_ios; unsigned long long io_time; }; /** the list of all known drives */ struct disk_list { struct disk_data *disk; struct disk_list *next; }; /** * Returns a list of all currently known disk drives * This function allocates memory which must be freed by * free_disk_list() (only if return value is not 0). * @param list the list is returned using this parameter * @return amount of available disk drives, 0 if no drive * was found. */ int enum_all_disks(struct disk_list **list); /** * Returns the current values of a specific disk drive. * This function allocates memory which must be freed by * free_disk() (only if return value is 1). * @param id a unique indentifier of the disk * @param disk the current data is returned using this parameter * @return 1 on success, 0 otherwise */ int get_disk_data(char *id, struct disk_data **disk); /** * Frees the memory allocated by enum_all_disks * @param list the list of all known drives returned by enum_all_disks * @see enum_all_disks */ void free_disk_list(struct disk_list *list); /** * Frees the memory allocated by a drive structure * @param drive the structure to free */ void free_disk(struct disk_data *disk); /** * Resets the given counters. * @param counters the counters to reset */ void reset_counters(); /* ---------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif /* ---------------------------------------------------------------------------*/ #endif --- NEW FILE: cmpiOSBase_BlockStorageStatisticalData.c --- /* * cmpiOSBase_BlockStorageStatisticalData.c * * (C) Copyright IBM Corp. 2004, 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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Magabeablity Programming Interface ( CMPI ) * * Description: * This is the factory implementation for creating instances of CIM * class Linux_BlockStorageStatisticalData. * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "cmpidt.h" #include "cmpimacs.h" #include "cmpiOSBase_Common.h" #include "OSBase_Common.h" #include "cmpiOSBase_BlockStorageStatisticalData.h" /* ---------------------------------------------------------------------------*/ /* private declarations */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Factory functions */ /* ---------------------------------------------------------------------------*/ /* ---------- method to create a CMPIObjectPath of this class ----------------*/ CMPIObjectPath * _makePath_BlockStorageStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * ref, CMPIStatus * rc, struct disk_data *disk) { CMPIObjectPath * op = NULL; char * instanceID = NULL; char * hostname = NULL; _OSBASE_TRACE(2,("--- _makePath_BlockStorageStatisticalData() called")); op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(ref,rc)), _ClassName, rc ); if (CMIsNullObject(op)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); _OSBASE_TRACE(2,("--- _makePath_BlockStorageStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } /* keys are unique identifiers for an instance */ // Linux:<hostname>_<disk_id> hostname = get_system_name(); instanceID = calloc(_INSTANCE_PREFIX_LENGTH + strlen(hostname) + 1 + strlen(disk->id) + 1, sizeof(char)); strcpy(instanceID, _INSTANCE_PREFIX); strcat(instanceID, hostname); strcat(instanceID, "_"); strcat(instanceID, disk->id); CMAddKey(op, "InstanceID", instanceID, CMPI_chars); if (instanceID) free(instanceID); exit: _OSBASE_TRACE(2,("--- _makePath_BlockStorageStatisticalData() exited")); return op; } /* ----------- method to create a CMPIInstance of this class ----------------*/ CMPIInstance * _makeInst_BlockStorageStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * ref, const char ** properties, CMPIStatus * rc, struct disk_data *disk) { CMPIObjectPath * op = NULL; CMPIInstance * ci = NULL; const char ** keys = NULL; int keyCount = 0; char * instanceID = NULL; CMPIDateTime * dt = NULL; char * hostname = NULL; _OSBASE_TRACE(2,("--- _makeInst_BlockStorageStatisticalData() called")); op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(ref,rc)), _ClassName, rc ); if (CMIsNullObject(op)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); _OSBASE_TRACE(2,("--- _makeInst_BlockStorageStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } ci = CMNewInstance( _broker, op, rc); if (CMIsNullObject(ci)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIInstance failed." ); _OSBASE_TRACE(2,("--- _makeInst_BlockStorageStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } /* set property filter */ /* keys = calloc(7,sizeof(char*)); keys[0] = strdup("CreationClassName"); keys[1] = strdup("DeviceCreationClassName"); keys[2] = strdup("DeviceID"); keys[3] = strdup("Name"); keys[4] = strdup("SystemCreationClassName"); keys[5] = strdup("SystemName"); keys[6] = NULL; CMSetPropertyFilter(ci,properties,keys); for( ;keys[keyCount]!=NULL;keyCount++) { free((char*)keys[keyCount]); } free(keys); */ // create instanceID: Linux:<hostname>_<disk_id> hostname = get_system_name(); instanceID = calloc(_INSTANCE_PREFIX_LENGTH + strlen(hostname) + 1 + strlen(disk->id) + 1, sizeof(char)); strcpy(instanceID, _INSTANCE_PREFIX); strcat(instanceID, hostname); strcat(instanceID, "_"); strcat(instanceID, disk->id); CMSetProperty(ci, "InstanceID", instanceID, CMPI_chars); if (instanceID) free(instanceID); /* from CIM_ManagedElement */ CMSetProperty(ci, "Caption", _ClassName, CMPI_chars); CMSetProperty(ci, "Description", "statistical information about disk drives", CMPI_chars); CMSetProperty(ci, "ElementName", disk->id, CMPI_chars); /* from CIM_StatisticalData */ // not supported CMSetProperty(ci, "StartStatisticTime", NULL, CMPI_dateTime); dt = CMNewDateTime(_broker,rc); CMSetProperty(ci, "StatisticTime", (CMPIValue*)&(dt), CMPI_dateTime); // there's no consistent time interval //CMSetProperty(ci, "SampleInterval", NULL, CMPI_uint64); /* from CIM_BlockStorageStatisticalData */ CMSetProperty(ci, "ReadIOs", (CMPIValue*)&(disk->read_ios), CMPI_uint64); CMSetProperty(ci, "WriteIOs", (CMPIValue*)&(disk->write_ios), CMPI_uint64); CMSetProperty(ci, "TotalIOs", (CMPIValue*)&(disk->total_ios), CMPI_uint64); CMSetProperty(ci, "KBytesRead", (CMPIValue*)&(disk->kb_read), CMPI_uint64); CMSetProperty(ci, "KBytesTransfered", (CMPIValue*)&(disk->kb_transfered), CMPI_uint64); CMSetProperty(ci, "IOTimeCounter", (CMPIValue*)&(disk->io_time), CMPI_uint64); exit: _OSBASE_TRACE(2,("--- _makeInst_BlockStorageStatisticalData() exited")); return ci; } /* ---------------------------------------------------------------------------*/ /* end of cmpiOSBase_BlockStorageStatisticalData.c */ /* ---------------------------------------------------------------------------*/ --- NEW FILE: cmpiOSBase_BlockStorageStatisticalDataProvider.c --- /* * cmpiOSBase_BlockStorageStatisticalData * * (C) Copyright IBM Corp. 2004, 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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Manageability Programming Interface ( CMPI ) * * Description: Provider for BlockStorageStatisticalData * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "cmpidt.h" #include "cmpift.h" #include "cmpimacs.h" #include "OSBase_Common.h" #include "cmpiOSBase_Common.h" #include "cmpiOSBase_BlockStorageStatisticalData.h" static CMPIBroker * _broker; /* ---------------------------------------------------------------------------*/ /* private declarations */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OSBase_BlockStorageStatisticalDataProviderCleanup(CMPIInstanceMI * mi, CMPIContext * ctx) { _OSBASE_TRACE(1,("--- %s CMPI Cleanup() called",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_BlockStorageStatisticalDataProviderEnumInstanceNames(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIObjectPath * op = NULL; struct disk_list * disk_list = NULL; struct disk_list * list_backup = NULL; _OSBASE_TRACE(4,("--- CMPI EnumInstanceNames() entered")); enum_all_disks(&disk_list); _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() called",_ClassName)); if (disk_list == NULL) { _OSBASE_TRACE(1,("--- CMPI EnumInstanceNames() failed : no disks available")); return rc; } list_backup = disk_list; while (disk_list != NULL) { op = _makePath_BlockStorageStatisticalData(_broker,ctx,ref,&rc, disk_list->disk); if (op == NULL) { if (rc.msg != NULL) { _OSBASE_TRACE(1,("--%s CMPI EnumInstanceNames() failed : %s", _ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--%s CMPI EnumInstanceNames() failed", _ClassName)); } return rc; } CMReturnObjectPath(rslt, op); disk_list = disk_list->next; } if (list_backup) { free_disk_list(list_backup); } CMReturnDone(rslt); _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderEnumInstances(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, char ** properties) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIInstance * ci = NULL; struct disk_list * disk_list = NULL; struct disk_list * list_backup = NULL; _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() called",_ClassName)); enum_all_disks(&disk_list); list_backup = disk_list; if (disk_list == NULL) { _OSBASE_TRACE(1,("--- CMPI EnumInstances() failed : no disks available")); return rc; } while (disk_list != NULL) { ci = _makeInst_BlockStorageStatisticalData(_broker, ctx, ref, properties, &rc, disk_list->disk); if (ci == NULL) { if (rc.msg != NULL) { _OSBASE_TRACE(1,("--%s CMPI EnumInstances() failed : %s", _ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--%s CMPI EnumInstances() failed", _ClassName)); } return rc; } CMReturnInstance( rslt, ci ); disk_list = disk_list->next; } if (list_backup) free_disk_list(list_backup); CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderGetInstance(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, char ** properties) { CMPIInstance * ci = NULL; CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIString * name = NULL; char * c_name = NULL; char * disk_id = NULL; struct disk_data * disk = NULL; int cmdrc = 0; _OSBASE_TRACE(1,("--- %s CMPI GetInstance() called",_ClassName)); name = CMGetKey( cop, "InstanceID", &rc).value.string; c_name = CMGetCharPtr(name); disk_id = strrchr(c_name,'_'); disk_id += 1; if (strlen(disk_id) <= 0) { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_FAILED, "Could not get disk name." ); _OSBASE_TRACE(1,("--- %s CMPI GetInstance() failed for %s : %s",_ClassName,c_name,CMGetCharPtr(rc.msg))); return rc; } cmdrc = get_disk_data(disk_id, &disk); if (cmdrc == 0 || disk == NULL) { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_FOUND, "disk does not exist"); _OSBASE_TRACE(1,("--- %s CMPI GetInstance() exited : %s",_ClassName,CMGetCharPtr(rc.msg))); if (disk) free_disk(disk); return rc; } ci = _makeInst_BlockStorageStatisticalData(_broker, ctx, cop, properties, &rc, disk); if (disk) free_disk(disk); CMReturnInstance( rslt, ci ); CMReturnDone(rslt); _OSBASE_TRACE(1,("--- %s CMPI GetInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderCreateInstance(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderSetInstance(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci, char **properties) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI SetInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI SetInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderDeleteInstance(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI DeleteInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI DeleteInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderExecQuery(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, char * lang, char * query) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI ExecQuery() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI ExecQuery() exited",_ClassName)); return rc; } /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OSBase_BlockStorageStatisticalDataProviderMethodCleanup( CMPIMethodMI * mi, CMPIContext * ctx) { _OSBASE_TRACE(1,("--- %s CMPI MethodCleanup() called",_ClassName)); _OSBASE_TRACE(1,("--- %s CMPI MethodCleanup() exited",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_BlockStorageStatisticalDataProviderInvokeMethod( CMPIMethodMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, const char * methodName, CMPIArgs * in, CMPIArgs * out) { CMPIString * class = NULL; CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI InvokeMethod() called",_ClassName)); class = CMGetClassName(ref, &rc); if( strcasecmp(CMGetCharPtr(class), _ClassName) == 0 && strcasecmp("ResetSelectedStats",methodName) == 0 ) { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, methodName ); } else { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_FOUND, methodName ); } _OSBASE_TRACE(1,("--- %s CMPI InvokeMethod() exited",_ClassName)); return rc; } /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ CMInstanceMIStub(OSBase_BlockStorageStatisticalDataProvider, OSBase_BlockStorageStatisticalDataProvider, _broker, CMNoHook); CMMethodMIStub( OSBase_BlockStorageStatisticalDataProvider, OSBase_BlockStorageStatisticalDataProvider, _broker, CMNoHook); /* ---------------------------------------------------------------------------*/ /* end of cmpiOSBase_BlockStorageStatisticalDataProvider */ /* ---------------------------------------------------------------------------*/ --- NEW FILE: OSBase_BlockStorageStatisticalData.c --- /* * Linux_BlockStorageStatisticalData.c * * (C) Copyright IBM Corp. 2004, 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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Description: * This shared library provides resource access functionality for the class * Linux_BlockStorageStatisticalData. * It is independent from any specific CIM technology. */ /* ---------------------------------------------------------------------------*/ #include "OSBase_BlockStorageStatisticalData.h" #include "OSBase_Common.h" /* logging */ #include <unistd.h> #include <errno.h> #include <dirent.h> #define CHECK_FCT_PARAM #define HD_CMD "grep \"[hs]d[a-z] \" /proc/partitions" #define HD_CMD_26 "grep \"[hs]d[a-z] \" /proc/diskstats" #define STATS_FILE "/proc/partitions" #define STATS_FILE_26 "/proc/diskstats" // uncomment to exclude CD drives //#define HD_ONLY /* ---------------------------------------------------------------------------*/ // private declarations #define IDENTIFIER_LENGTH 255 /** * Allocates memory, retrieves data from the given char array * and sets the values of a single disk_data item. * Prior to this it is checked if the given drive is really a disk * (and not a cdrom or other media) (can be changed using HD_ONLY define). * Currently only IDE disks are supported! * Returned memory has to be freed using free_disk(). * *@param ddisk one line of the file /proc/partitions (if kernel26==0) * or one line of the file /proc/diskstats (if kernel26==1) *@param kernel26 0 if passed data is formatted in kernel24 style, any other * value indicates that data has style of kernel26. * @return NULL if an error occured, otherwise a structure with the data retrieved * from ddata */ struct disk_data * create_disk_data(char *ddata, int kernel26); /** * Checks if the given name identifies a disk or not. * Only IDE disks are supported! * @param name the name to check * @return 1 if the device is a disk, 0 otherwise */ int is_disk(const char * name); /* ---------------------------------------------------------------------------*/ /* linux disk statistics (read <linux-kernel-source>/Documentation/iostats.txt for details): * * 2.4: /proc/partitions * major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq * 3 0 39082680 hda 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 * 3 1 9221278 hda1 35486 0 35496 38030 0 0 0 0 0 38030 38030 * * 2.6 /proc/diskstats: * major minor name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq * 3 0 hda 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 * 3 1 hda1 35486 38030 38030 38030 * * not supported by this implementation * 2.6 sysfs: * 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 * 35486 38030 38030 38030 */ int enum_all_disks(struct disk_list **list) { struct disk_list *disk_list_item = NULL; int i = 0; int rc = 0; int total_disks = 0; char **hdout = NULL; int kernel26 = 0; FILE *stats26 = NULL; char *cmd = NULL; struct disk_data *dd = NULL; _OSBASE_TRACE(3,("enum_all_disks called")); stats26 = fopen(STATS_FILE_26,"r"); if (stats26) { fclose(stats26); cmd = HD_CMD_26; kernel26 = 1; } else { cmd = HD_CMD; } rc = runcommand(cmd,NULL,&hdout,NULL); if (rc == 0 && hdout != NULL) { while (hdout[i]) { dd = create_disk_data(hdout[i],kernel26); if (dd != NULL) { if (total_disks == 0) { disk_list_item = (struct disk_list *)calloc(1, sizeof(struct disk_list)); disk_list_item->disk = dd; *list = disk_list_item; //disk_list_item->next = NULL; } else { disk_list_item->next = (struct disk_list *)calloc(1, sizeof(struct disk_list)); disk_list_item->next->disk = dd; disk_list_item = disk_list_item->next; //disk_list_item->next = NULL; } disk_list_item->next = NULL; total_disks++; } i++; } } else { _OSBASE_TRACE(1,("enum_all_discs: error while running %s",cmd)); } freeresultbuf(hdout); _OSBASE_TRACE(3,("enum_all_disks exited")); return total_disks; } /** * Allocates memory and gets the data for the specified drive. * @param id the id of the drive * @param disk the data will be returned through this parameter. * The memory has to be freed using free_disk_data(). * @return 1 if data is available and some memory has been assigned * to "disk", 0 otherwise. */ int get_disk_data(char *id, struct disk_data **disk) { int res = 0; int rc = 0; char *cmd; char **hdout = NULL; int kernel26 = 0; FILE *stats26 = NULL; _OSBASE_TRACE(3,("get_disk_data called")); int cmdlen = strlen(id)+31; cmd = malloc(cmdlen); strcpy(cmd, "grep \""); strcat(cmd, id); stats26 = fopen(STATS_FILE_26,"r"); if (stats26) { fclose(stats26); strcat(cmd, " \" "); strcat(cmd, STATS_FILE_26); kernel26 = 1; } else { strcat(cmd, " \" "); strcat(cmd,STATS_FILE); } rc = runcommand(cmd,NULL,&hdout,NULL); if (rc == 0 && hdout != NULL) { *disk = create_disk_data(hdout[0],kernel26); if (*disk != NULL) { res = 1; } } else { _OSBASE_TRACE(1,("get_disk_data: could not run %s (%s)",cmd,hdout)); } freeresultbuf(hdout); free(cmd); _OSBASE_TRACE(3,("get_disk_data exited")); return res; } struct disk_data * create_disk_data(char *ddisk, int kernel26) { long long rio = 0; long long rsect = 0; long long wio = 0; long long wsect = 0; long long use = 0; int sres = 0; int id_length = 0; char dname[IDENTIFIER_LENGTH]; struct disk_data * res = NULL; _OSBASE_TRACE(3,("create_disk_data called")); if (kernel26) { sres = sscanf(ddisk,"%*d %*d %s %lld %*d %lld %*d %lld %*d %lld %*d %*d %lld %*d", dname,&rio,&rsect,&wio,&wsect,&use); } else { sres = sscanf(ddisk,"%*d %*d %*d %s %lld %*d %lld %*d %lld %*d %lld %*d %*d %lld %*d", dname,&rio,&rsect,&wio,&wsect,&use); } if (sres != 6 || sres == EOF) { _OSBASE_TRACE(1,("create_disk_data: could not get data, wrong kernel version or kernel config (CONFIG_BLK_STATS)")); return 0; } #ifdef HD_ONLY if (is_disk(dname)) { #endif res = (struct disk_data *)calloc(1,sizeof(struct disk_data)); // free in free_disk id_length = strlen(dname); if (id_length > 0) { res->id = (char*)malloc(strlen(dname)+1); strncpy(res->id, dname, id_length); *(res->id+strlen(dname)) = '\0'; } else { res->id = '\0'; } // one sect has a size of 512 bytes res->kb_read = rsect * 512; res->kb_transfered = wsect * 512 + res->kb_read; res->read_ios = rio; res->write_ios = wio; res->total_ios = rio + wio; res->io_time = use; _OSBASE_TRACE(3,("name %s, rio %lld, rbw %lld, wio %lld, wbw %lld, use %lld",dname, rio,rsect*512,wio,wsect*512,use)); #ifdef HD_ONLY } #endif _OSBASE_TRACE(3,("create_disk_data exited")); return res; } void free_disk_list(struct disk_list *list) { struct disk_list *list_item = NULL; int count = 0; _OSBASE_TRACE(3,("free_disk_list called")); while (list != NULL) { if (list->disk) free_disk(list->disk); list_item = list; list = list->next; free(list_item); count++; } _OSBASE_TRACE(3,("free_disk_list exited")); } void free_disk(struct disk_data *disk) { _OSBASE_TRACE(3,("free_disk called")); #ifdef CHECK_FCT_PARAM if (disk == NULL) { _OSBASE_TRACE(2,("free_disk: called with NULL arg")); return; } #endif if (disk->id) free(disk->id); free(disk); _OSBASE_TRACE(3,("free_disk exited")); } int is_disk(const char * name) { int res = 0; FILE *f = NULL; int length = strlen(name); char filename[length+17]; char media[10]; _OSBASE_TRACE(3,("is_disk called")); // /proc/ide/<name>/media strcpy(filename,"/proc/ide/"); strcat(filename,name); strcat(filename,"/media"); if ((f = fopen(filename,"r")) != NULL) { fgets(media,9,f); if (strncmp(media,"disk",4) == 0) { res = 1; } else { _OSBASE_TRACE(2,("is_disk: %s is not a disk drive, type is %s - ",name,media)); } fclose(f); } else { _OSBASE_TRACE(1,("is_disk: could not open %s: %s",filename,strerror(errno))); } _OSBASE_TRACE(3,("is_disk ended: res=%d",res)); return res; } #warning TODO: implement reset_counters void reset_counters() { // resetting counters not yet supported //pthread_mutex_lock(&mutex); // nothing //pthread_mutex_unlock(&mutex); } /* ---------------------------------------------------------------------------*/ /* end of OSBase_BlockStorageStatisticalData.c */ /* ---------------------------------------------------------------------------*/ Index: AUTHORS =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AUTHORS 15 Apr 2005 14:28:15 -0000 1.1 +++ AUTHORS 20 Apr 2005 11:40:19 -0000 1.2 @@ -1,2 +1,7 @@ -The cmpi-base provider package was originally written by Heidi Neumann +The cmpi-fsvol provider package was originally written by Heidi Neumann <hei...@de...>. + +Contributions: + +support for class Linux_BlockStorageStatisticalData was done by +Michael Schuele <sch...@de...> ... thx :) |
From: Heidi E. <hei...@us...> - 2005-04-20 11:40:30
|
Update of /cvsroot/sblim/cmpi-fsvol/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5454/mof Modified Files: Linux_Fsvol.mof Linux_Fsvol.sfcb.reg Linux_FsvolRegister.mof Log Message: feature request# 1186595: support for LogicalDisk statistical data added ... contribution by Michael Schuele :) ... thx Index: Linux_Fsvol.mof =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/mof/Linux_Fsvol.mof,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Linux_Fsvol.mof 28 Jan 2004 16:01:09 -0000 1.7 +++ Linux_Fsvol.mof 20 Apr 2005 11:40:19 -0000 1.8 @@ -73,6 +73,114 @@ }; +// =================================================================== +// Linux_BlockStorageStatisticalData +// =================================================================== + +[ Provider("cmpi:cmpiOSBase_BlockStorageStatisticalDataProvider") ] +class Linux_BlockStorageStatisticalData : CIM_StatisticalData +{ + [ Counter, + Description("The cumulative count of I/Os for the object.") + ] + uint64 TotalIOs; + + [ Counter, + Units("KiloBytes"), + Description("The cumulative count of data transferred in " + "Kbytes (1024bytes = 1KByte).") + ] + uint64 KBytesTransfered; + + [ Counter, + Description("The cumulative elapsed I/O time (number of Clock " + "Tick Intervals) for all I/Os as defined in 'Total I/Os'. I/O " + "response time is added to this counter at the completion of " + "each measured I/O using ClockTickInterval units. This value " + "can be divided by number of IOs to obtain an average " + "response time.") + ] + uint64 IOTimeCounter; + + [ Counter, + Description("The cumulative count of all reads.") + ] + uint64 ReadIOs; + + [ Counter, + Description("The cumulative count of all read cache hits " + "(Reads from Cache).") + ] + uint64 ReadHitIOs; + + [ Counter, + Description("The cumulative elapsed time for all Read I/Os " + "for all cumulative Read I/Os.") + ] + uint64 ReadIOTimeCounter; + + [ Counter, + Description("The cumulative elapsed time for all Read I/Os " + "read from cache for all cumulative Read I/Os.") + ] + uint64 ReadHitIOTimeCounter; + + [ Counter, + Units("KiloBytes"), + Description("The cumulative count of data read in Kbytes " + "(1024bytes = 1KByte).") + ] + uint64 KBytesRead; + + [ Counter, + Description("The cumulative count of all writes.") + ] + uint64 WriteIOs; + + [ Counter, + Description("The cumulative count of Write Cache Hits " + "(Writes that went directly to Cache).") + ] + uint64 WriteHitIOs; + + [ Counter, + Description("The cumulative elapsed time for all Write " + "I/Os for all cumulative Writes.") + ] + uint64 WriteIOTimeCounter; + + [ Counter, + Description("The cumulative elapsed time using " + "ClockTickInterval units for all Write I/Os written " + "to cache for all cumulative Write I/Os.") + ] + uint64 WriteHitIOTimeCounter; + + [ Counter, + Description("The cumulative elapsed idle time using " + "ClockTickInterval units (Cumulative Number of Time " + "Units for all idle time in the array).") + ] + uint64 IdleTimeCounter; + + [ Counter, + Description("The cumulative count of all disk maintenance " + "operations (SCSI commands such as: Verify, skip-mask, XOR " + "read, XOR write-read, etc).This is needed to understand the " + "load on the disks that may interfere with normal read and " + "write operations.") + ] + uint64 MaintOp; + + [ Counter, + Description("The cumulative elapsed disk mainenance time. " + "Maintainance response time is added to this counter at the " + "completion of each measured maintenance operation using " + "ClockTickInterval units.") + ] + uint64 MaintTimeCounter; +}; + // ------------------------------------------------------------------- Index: Linux_Fsvol.sfcb.reg =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/mof/Linux_Fsvol.sfcb.reg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Linux_Fsvol.sfcb.reg 15 Apr 2005 14:28:16 -0000 1.1 +++ Linux_Fsvol.sfcb.reg 20 Apr 2005 11:40:19 -0000 1.2 @@ -22,6 +22,12 @@ type: instance namespace: root/cimv2 # +[Linux_BlockStorageStatisticalData] + provider: OSBase_BlockStorageStatisticalDataProvider + location: cmpiOSBase_BlockStorageStatisticalDataProvider + type: instance + namespace: root/cimv2 +# [Linux_HostedFileSystem] provider: OSBase_HostedFileSystemProvider location: cmpiOSBase_HostedFileSystemProvider Index: Linux_FsvolRegister.mof =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/mof/Linux_FsvolRegister.mof,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Linux_FsvolRegister.mof 15 Sep 2003 09:22:19 -0000 1.6 +++ Linux_FsvolRegister.mof 20 Apr 2005 11:40:19 -0000 1.7 @@ -25,7 +25,6 @@ // CIM_UnixLocalFileSystem // =================================================================== - instance of PG_ProviderModule { Name = "OSBase_LocalFileSystemProviderModule"; @@ -95,7 +94,6 @@ // Linux_NFS // =================================================================== - instance of PG_ProviderModule { Name = "OSBase_NFSProviderModule"; @@ -131,6 +129,44 @@ }; +// =================================================================== +// Linux_BlockStorageStatisticalData +// =================================================================== + +instance of PG_ProviderModule +{ + Name="OSBase_BlockStorageStatisticalDataProviderModule"; + // the library name + Location="cmpiOSBase_BlockStorageStatisticalDataProvider"; + Vendor="IBM"; + Version="2.0.0"; + InterfaceType="CMPI"; + InterfaceVersion="2.1.0"; +}; + +instance of PG_Provider +{ + // the provider module as defined in PG_ProviderModule + ProviderModuleName="OSBase_BlockStorageStatisticalDataProviderModule"; + // the provider name as referenced in the code + Name="OSBase_BlockStorageStatisticalDataProvider"; +}; + +instance of PG_ProviderCapabilities +{ + // provider module as defined in PG_ProviderModule + ProviderModuleName="OSBase_BlockStorageStatisticalDataProviderModule"; + // provider name as defined in PG_Provider + ProviderName="OSBase_BlockStorageStatisticalDataProvider"; + CapabilityID="1"; + // name of CIM class as defined in the mof + ClassName="Linux_BlockStorageStatisticalData"; + Namespaces={"root/cimv2"}; + ProviderType={2,5}; // Instance, Method + SupportedProperties = NULL; // All properties + SupportedMethods = NULL; // All methods +}; + // ------------------------------------------------------------------- |
From: Heidi E. <hei...@us...> - 2005-04-20 11:40:30
|
Update of /cvsroot/sblim/cmpi-fsvol/test/cim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5454/test/cim Added Files: Linux_BlockStorageStatisticalData.cim Log Message: feature request# 1186595: support for LogicalDisk statistical data added ... contribution by Michael Schuele :) ... thx --- NEW FILE: Linux_BlockStorageStatisticalData.cim --- ******************************************************************************** class : Linux_BlockStorageStatisticalData objectPath : Linux_BlockStorageStatisticalData.InstanceID=Linux:testsystem -------------------------------------------------------------------------------- Instance enumInstanceNames -------------------------------------------------------------------------------- Instance enumInstances -------------------------------------------------------------------------------- Instance get -------------------------------------------------------------------------------- Instance set Expected Exception : NOT_SUPPORTED -------------------------------------------------------------------------------- Instance create Expected Exception : NOT_SUPPORTED -------------------------------------------------------------------------------- Instance delete Expected Exception : NOT_SUPPORTED |
From: Heidi E. <hei...@us...> - 2005-04-20 11:40:30
|
Update of /cvsroot/sblim/cmpi-fsvol/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5454/test Modified Files: test-cmpi-fsvol.sh Log Message: feature request# 1186595: support for LogicalDisk statistical data added ... contribution by Michael Schuele :) ... thx Index: test-cmpi-fsvol.sh =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/test/test-cmpi-fsvol.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test-cmpi-fsvol.sh 20 Apr 2004 08:15:24 -0000 1.3 +++ test-cmpi-fsvol.sh 20 Apr 2005 11:40:19 -0000 1.4 @@ -11,9 +11,10 @@ declare -a CLASSNAMES[]; CLASSNAMES=([0]=Linux_Ext2FileSystem [1]=Linux_Ext3FileSystem \ [2]=Linux_ReiserFileSystem [3]=Linux_NFS \ -[4]=Linux_HostedFileSystem [5]=Linux_BootOSFromFS) +[4]=Linux_HostedFileSystem [5]=Linux_BootOSFromFS \ +[6]=Linux_BlockStorageStatisticalData) -declare -i max=5; +declare -i max=6; declare -i i=0; while(($i<=$max)) |
From: Heidi E. <hei...@us...> - 2005-04-20 11:35:10
|
Update of /cvsroot/sblim/cmpi-base/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2372/test Modified Files: test-cmpi-base.sh Log Message: feature request# 1186592: support for OS statistical information added ... contribution by Michael Schuele :) ... thx Index: test-cmpi-base.sh =================================================================== RCS file: /cvsroot/sblim/cmpi-base/test/test-cmpi-base.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- test-cmpi-base.sh 14 Apr 2004 19:21:10 -0000 1.3 +++ test-cmpi-base.sh 20 Apr 2005 11:34:57 -0000 1.4 @@ -11,9 +11,10 @@ declare -a CLASSNAMES[]; CLASSNAMES=([0]=Linux_ComputerSystem [1]=Linux_OperatingSystem \ [2]=Linux_UnixProcess [3]=Linux_Processor \ -[4]=Linux_RunningOS [5]=Linux_OSProcess [6]=Linux_CSProcessor) +[4]=Linux_RunningOS [5]=Linux_OSProcess [6]=Linux_CSProcessor \ +[7]=Linux_OperatingSystemStatisticalData [8]=Linux_OperatingSystemStatistics) -declare -i max=6; +declare -i max=8; declare -i i=0; while(($i<=$max)) |
From: Heidi E. <hei...@us...> - 2005-04-20 11:35:10
|
Update of /cvsroot/sblim/cmpi-base/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2372/mof Modified Files: Linux_Base.mof Linux_Base.sfcb.reg Linux_BaseRegistration.mof Log Message: feature request# 1186592: support for OS statistical information added ... contribution by Michael Schuele :) ... thx Index: Linux_Base.mof =================================================================== RCS file: /cvsroot/sblim/cmpi-base/mof/Linux_Base.mof,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Linux_Base.mof 17 Mar 2005 08:39:54 -0000 1.11 +++ Linux_Base.mof 20 Apr 2005 11:34:56 -0000 1.12 @@ -106,6 +106,62 @@ // =================================================================== +// Linux_OperatingSystemStatisticalData +// =================================================================== + +[ Provider("cmpi:cmpiOSBase_OperatingSystemStatisticalDataProvider") ] +class Linux_OperatingSystemStatisticalData : CIM_StatisticalData +{ + [ Counter, + Description("The cumulative time the system ran in user mode " + "since system startup.") + ] + uint64 CPUUserTime; + + [ Counter, + Description("The cumulative time the system ran in system mode " + "since system startup.") + ] + uint64 CPUSystemTime; + + [ Counter, + Description("The cumulative time the system waited for I/O " + "requests to be completed since system startup.") + ] + uint64 CPUWaitTime; + + [ Counter, + Description("The cumulative time the system was idle since " + "system startup.") + ] + uint64 CPUIdleTime; + + [ Counter, + Description("The amount of processes currently running or " + "ready to be run.") + ] + uint64 RunQueueLength; + + [ Counter, + Description("The amount of processes currently waiting for " + "I/O requests to be completed.") + ] + uint64 BlockQueueLength; + + [ Counter, + Description("The amount of pages paged in since system " + "startup.") + ] + uint64 PagesPagedIn; + + [ Counter, + Description("The amount of pages paged out since system " + "startup.")] + uint64 PagesPagedOut; +}; + + +// =================================================================== // Linux_UnixProcess // =================================================================== @@ -201,6 +257,28 @@ // =================================================================== +// Linux_OperatingSystemStatistics +// =================================================================== + +[ Association, + Provider("cmpi:cmpiOSBase_OperatingSystemStatisticsProvider") ] +class Linux_OperatingSystemStatistics : CIM_ElementStatisticalData +{ + [ Override("ManagedElement"), + Min(1), + Max(1), + Description("The System to which the statistics apply.") + ] + Linux_OperatingSystem REF ManagedElement; + + [ Override("Stats"), + Description("The statistical object.") + ] + Linux_OperatingSystemStatisticalData REF Stats; +}; + + +// =================================================================== // Linux_CSProcessor // =================================================================== Index: Linux_BaseRegistration.mof =================================================================== RCS file: /cvsroot/sblim/cmpi-base/mof/Linux_BaseRegistration.mof,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Linux_BaseRegistration.mof 17 Mar 2005 08:39:54 -0000 1.9 +++ Linux_BaseRegistration.mof 20 Apr 2005 11:34:57 -0000 1.10 @@ -140,6 +140,45 @@ // =================================================================== +// Linux_OperatingSystemStatisticalData +// =================================================================== + +instance of PG_ProviderModule +{ + Name="OSBase_OperatingSystemStatisticalDataProviderModule"; + // the library name + Location="cmpiOSBase_OperatingSystemStatisticalDataProvider"; + Vendor="IBM"; + Version="2.0.0"; + InterfaceType="CMPI"; + InterfaceVersion="2.1.0"; +}; + +instance of PG_Provider +{ + // the provider module as defined in PG_ProviderModule + ProviderModuleName="OSBase_OperatingSystemStatisticalDataProviderModule"; + // the provider name as referenced in the code + Name="OSBase_OperatingSystemStatisticalDataProvider"; +}; + +instance of PG_ProviderCapabilities +{ + // provider module as defined in PG_ProviderModule + ProviderModuleName="OSBase_OperatingSystemStatisticalDataProviderModule"; + // provider name as defined in PG_Provider + ProviderName="OSBase_OperatingSystemStatisticalDataProvider"; + CapabilityID="1"; + // name of CIM class as defined in the mof + ClassName="Linux_OperatingSystemStatisticalData"; + Namespaces={"root/cimv2"}; + ProviderType={2,5}; // Instance, Method + SupportedProperties=NULL; // All properties + SupportedMethods = NULL; // All methods +}; + + +// =================================================================== // Linux_UnixProcess // =================================================================== @@ -345,6 +384,45 @@ // =================================================================== +// Linux_OperatingSystemStatistics +// =================================================================== + +instance of PG_ProviderModule +{ + Name="OSBase_OperatingSystemStatisticsProviderModule"; + // the library name + Location="cmpiOSBase_OperatingSystemStatisticsProvider"; + Vendor="IBM"; + Version="2.0.0"; + InterfaceType="CMPI"; + InterfaceVersion="2.1.0"; +}; + +instance of PG_Provider +{ + // the provider module as defined in PG_ProviderModule + ProviderModuleName="OSBase_OperatingSystemStatisticsProviderModule"; + // the provider name as referenced in the code + Name="OSBase_OperatingSystemStatisticsProvider"; +}; + +instance of PG_ProviderCapabilities +{ + // provider module as defined in PG_ProviderModule + ProviderModuleName="OSBase_OperatingSystemStatisticsProviderModule"; + // provider name as defined in PG_Provider + ProviderName="OSBase_OperatingSystemStatisticsProvider"; + CapabilityID="1"; + // name of CIM class as defined in the mof + ClassName="Linux_OperatingSystemStatistics"; + Namespaces={"root/cimv2"}; + ProviderType={2,3}; // Instance, Association + SupportedProperties=NULL; // All properties + SupportedMethods=NULL; // All methods +}; + + +// =================================================================== // Linux_CSProcessor // =================================================================== Index: Linux_Base.sfcb.reg =================================================================== RCS file: /cvsroot/sblim/cmpi-base/mof/Linux_Base.sfcb.reg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Linux_Base.sfcb.reg 6 Apr 2005 16:29:48 -0000 1.1 +++ Linux_Base.sfcb.reg 20 Apr 2005 11:34:56 -0000 1.2 @@ -22,6 +22,13 @@ type: instance namespace: root/cimv2 # +# +[Linux_OperatingSystemStatisticalData] + provider: OSBase_OperatingSystemStatisticalDataProvider + location: cmpiOSBase_OperatingSystemStatisticalDataProvider + type: instance + namespace: root/cimv2 +# [Linux_BaseBoard] provider: OSBase_BaseBoardProvider location: cmpiOSBase_BaseBoardProvider @@ -40,6 +47,12 @@ type: instance association namespace: root/cimv2 # +[Linux_OperatingSystemStatistics] + provider: OSBase_OperatingSystemStatisticsProvider + location: cmpiOSBase_OperatingSystemStatisticsProvider + type: instance association + namespace: root/cimv2 +# [Linux_CSProcessor] provider: OSBase_CSProcessorProvider location: cmpiOSBase_CSProcessorProvider |
From: Heidi E. <hei...@us...> - 2005-04-20 11:35:10
|
Update of /cvsroot/sblim/cmpi-base/test/cim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2372/test/cim Added Files: Linux_OperatingSystemStatisticalData.cim Linux_OperatingSystemStatistics.cim Log Message: feature request# 1186592: support for OS statistical information added ... contribution by Michael Schuele :) ... thx --- NEW FILE: Linux_OperatingSystemStatistics.cim --- ******************************************************************************** association : Linux_OperatingSystemStatistics objectPath : Linux_OperatingSystemStatistics.ManagedElement="VALID_VALUE_NOT_NEEDED",Stats="VALID_VALUE_NOT_NEEDED" sourceRole : ManagedElement targetRole : Stats sourceClass : Linux_OperatingSystem targetClass : Linux_OperatingSystemStatisticalData -------------------------------------------------------------------------------- Instance enumInstanceNames -------------------------------------------------------------------------------- Instance enumInstances -------------------------------------------------------------------------------- Instance get -------------------------------------------------------------------------------- Instance set Expected Exception : NOT_SUPPORTED -------------------------------------------------------------------------------- Instance create Expected Exception : NOT_SUPPORTED -------------------------------------------------------------------------------- Instance delete Expected Exception : NOT_SUPPORTED -------------------------------------------------------------------------------- Association associatorNames -------------------------------------------------------------------------------- Association associators -------------------------------------------------------------------------------- Association referenceNames -------------------------------------------------------------------------------- Association references --- NEW FILE: Linux_OperatingSystemStatisticalData.cim --- ******************************************************************************** class : Linux_OperatingSystemStatisticalData objectPath : Linux_OperatingSystemStatisticalData.InstanceID=Linux:testsystem -------------------------------------------------------------------------------- Instance enumInstanceNames -------------------------------------------------------------------------------- Instance enumInstances -------------------------------------------------------------------------------- Instance get -------------------------------------------------------------------------------- Instance set Expected Exception : NOT_SUPPORTED -------------------------------------------------------------------------------- Instance create Expected Exception : NOT_SUPPORTED -------------------------------------------------------------------------------- Instance delete Expected Exception : NOT_SUPPORTED |
Update of /cvsroot/sblim/cmpi-base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2372 Modified Files: AUTHORS ChangeLog Makefile.am README cmpiOSBase_ComputerSystemProvider.c configure.ac Added Files: OSBase_OperatingSystemStatisticalData.c OSBase_OperatingSystemStatisticalData.h cmpiOSBase_OperatingSystemStatisticalData.c cmpiOSBase_OperatingSystemStatisticalData.h cmpiOSBase_OperatingSystemStatisticalDataProvider.c cmpiOSBase_OperatingSystemStatisticsProvider.c Log Message: feature request# 1186592: support for OS statistical information added ... contribution by Michael Schuele :) ... thx --- NEW FILE: cmpiOSBase_OperatingSystemStatisticalData.c --- /* * cmpiOSBase_OperatingSystemStatisticalData.c * * (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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Magabeablity Programming Interface ( CMPI ) * * Description: * This is the factory implementation for creating instances of CIM * class Linux_OperatingSystemStatisticalData. * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/time.h> #include "cmpidt.h" #include "cmpimacs.h" #include "cmpiOSBase_Common.h" #include "OSBase_Common.h" #include "cmpiOSBase_OperatingSystemStatisticalData.h" /* ---------------------------------------------------------------------------*/ /* private declarations */ /* ---------------------------------------------------------------------------*/ // stores the time when ResetSelectedStats has been called (function call not yet supported) */ // static unsigned long long last_reset = 0; /* ---------------------------------------------------------------------------*/ /* Factory functions */ /* ---------------------------------------------------------------------------*/ /* ---------- method to create a CMPIObjectPath of this class ----------------*/ CMPIObjectPath * _makePath_OperatingSystemStatisticalData( CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * ref, CMPIStatus * rc) { CMPIObjectPath * op = NULL; char * instanceID = NULL; char * hostname = NULL; _OSBASE_TRACE(2,("--- _makePath_OperatingSystemStatisticalData() called")); if (!get_os_name()) { CMSetStatusWithChars(_broker, rc, CMPI_RC_ERR_FAILED, "no OS name found"); _OSBASE_TRACE(2,("--- _makePath_OperatingSystemStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(ref,rc)), _ClassName, rc ); if (CMIsNullObject(op)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); _OSBASE_TRACE(2,("--- _makePath_OperatingSystemStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } /* keys are unique identifiers for an instance */ // instanceID: Linux:<hostname> hostname = get_system_name(); instanceID = calloc(_INSTANCE_PREFIX_LENGTH + strlen(hostname) + 1, sizeof(char)); strcpy(instanceID, _INSTANCE_PREFIX); strcat(instanceID, hostname); CMAddKey(op, "InstanceID", instanceID, CMPI_chars); if (instanceID) free(instanceID); exit: _OSBASE_TRACE(2,("--- _makePath_OperatingSystemStatisticalData() exited")); return op; } /* ----------- method to create a CMPIInstance of this class ----------------*/ CMPIInstance * _makeInst_OperatingSystemStatisticalData( CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * ref, const char ** properties, CMPIStatus * rc) { CMPIObjectPath * op = NULL; CMPIInstance * ci = NULL; const char ** keys = NULL; int keyCount = 0; unsigned short status = 2; /* Enabled */ int stats_avail = 0; CMPIDateTime * dt = NULL; char * instanceID = NULL; char * hostname = NULL; unsigned long long usecs = 0; struct os_statistics statistics; _OSBASE_TRACE(2,("--- _makeInst_OperatingSystemStatisticalData() called")); stats_avail = get_os_statistics(&statistics); if (stats_avail != 0) { _OSBASE_TRACE(2,("--- _makeInst_OperatingSystemStatisticalData() get_os_statistics failed")); CMSetStatusWithChars(_broker, rc, CMPI_RC_ERR_FAILED, "no OS statistics available"); _OSBASE_TRACE(2,("--- _makeInst_OperatingSystemStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(ref,rc)), _ClassName, rc ); if (CMIsNullObject(op)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); _OSBASE_TRACE(2,("--- _makeInst_OperatingSystemStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } ci = CMNewInstance( _broker, op, rc); if (CMIsNullObject(ci)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIInstance failed." ); _OSBASE_TRACE(2,("--- _makeInst_OperatingSystemStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } /* set property filter */ /* keys = calloc(3,sizeof(char*)); keys[0] = strdup("CreationClassName"); keys[1] = strdup("Name"); keys[2] = NULL; CMSetPropertyFilter(ci,properties,keys); for( ;keys[keyCount]!=NULL;keyCount++) { free((char*)keys[keyCount]); } free(keys); */ // Linux:<hostname> hostname = get_system_name(); instanceID = calloc(_INSTANCE_PREFIX_LENGTH + strlen(hostname) + 1, sizeof(char)); strcpy(instanceID, _INSTANCE_PREFIX); strcat(instanceID, hostname); CMSetProperty(ci, "InstanceID", instanceID, CMPI_chars); if (instanceID) free(instanceID); /* from CIM_ManagedElement */ CMSetProperty(ci, "Caption", _ClassName, CMPI_chars); CMSetProperty(ci, "Description", "statistical information about operating system", CMPI_chars); CMSetProperty(ci, "ElementName", get_os_name(), CMPI_chars); /* ResetSelectedStats is not yet supported so StartStatisticTime is always set to boottime */ usecs = _get_os_boottime(); usecs *= 1000000; /* the following can be used when ResetSelectedStats is supported * (last_reset should be updated in reset function) */ /* if (last_reset == 0) { usecs = _get_os_boottime(); usecs *= 1000000; _OSBASE_TRACE(5,("--- _makeInst_OperatingSystemStatisticalData(): 1st run: boottime:%llu us", usecs)); } else { usecs = last_reset; _OSBASE_TRACE(5,("--- _makeInst_OperatingSystemStatisticalData(): using last update: %llu us", usecs)); } */ dt = CMNewDateTimeFromBinary(_broker,(CMPIUint64)usecs,CMPI_false,rc); /* from CIM_StatisticalData */ CMSetProperty(ci, "StartStatisticTime", (CMPIValue*)&(dt), CMPI_dateTime); dt = CMNewDateTime(_broker,rc); CMSetProperty(ci, "StatisticTime", (CMPIValue*)&(dt), CMPI_dateTime); // there's no consistent time interval //CMSetProperty(ci, "SampleInterval", NULL, CMPI_uint64); /* additional properties */ CMSetProperty(ci, "CPUUserTime", (CMPIValue*)&statistics.user_time, CMPI_uint64); CMSetProperty(ci, "CPUSystemTime", (CMPIValue*)&statistics.system_time, CMPI_uint64); CMSetProperty(ci, "CPUWaitTime", (CMPIValue*)&statistics.wait_time, CMPI_uint64); CMSetProperty(ci, "CPUIdleTime", (CMPIValue*)&statistics.idle_time, CMPI_uint64); CMSetProperty(ci, "RunQueueLength", (CMPIValue*)&statistics.run_queue_length, CMPI_uint64); CMSetProperty(ci, "BlockQueueLength", (CMPIValue*)&statistics.block_queue_length, CMPI_uint64); CMSetProperty(ci, "PagesPagedIn", (CMPIValue*)&statistics.pages_in, CMPI_uint64); CMSetProperty(ci, "PagesPagedOut", (CMPIValue*)&statistics.pages_out, CMPI_uint64); exit: _OSBASE_TRACE(2,("--- _makeInst_OperatingSystemStatisticalData() exited")); return ci; } /* ---------------------------------------------------------------------------*/ /* end of cmpiOSBase_OperatingSystemStatisticalData.c */ /* ---------------------------------------------------------------------------*/ --- NEW FILE: cmpiOSBase_OperatingSystemStatisticsProvider.c --- /* * cmpiOSBase_OperatingSystemStatisticsProvider.c * * (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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Manageability Programming Interface ( CMPI ) * * Description: * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "cmpidt.h" #include "cmpift.h" #include "cmpimacs.h" #include "OSBase_Common.h" #include "cmpiOSBase_Common.h" static CMPIBroker * _broker; /* ---------------------------------------------------------------------------*/ /* private declarations */ /* ---------------------------------------------------------------------------*/ static char * _ClassName = "Linux_OperatingSystemStatistics"; static char * _RefLeft = "ManagedElement"; static char * _RefRight = "Stats"; static char * _RefLeftClass = "Linux_OperatingSystem"; static char * _RefRightClass = "Linux_OperatingSystemStatisticalData"; /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OSBase_OperatingSystemStatisticsProviderCleanup( CMPIInstanceMI * mi, CMPIContext * ctx) { _OSBASE_TRACE(1,("--- %s CMPI Cleanup() called",_ClassName)); _OSBASE_TRACE(1,("--- %s CMPI Cleanup() exited",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_OperatingSystemStatisticsProviderEnumInstanceNames( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref) { CMPIStatus rc = {CMPI_RC_OK, NULL}; int refrc = 0; _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() called",_ClassName)); refrc = _assoc_create_inst_1toN( _broker,ctx,rslt,ref, _ClassName,_RefLeftClass,_RefRightClass, _RefLeft,_RefRight, 1,0,&rc); if( refrc != 0 ) { if( rc.msg != NULL ) { _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() failed : %s",_ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() failed",_ClassName)); } return rc; } CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticsProviderEnumInstances( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, char ** properties) { CMPIStatus rc = {CMPI_RC_OK, NULL}; int refrc = 0; _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() called",_ClassName)); refrc = _assoc_create_inst_1toN( _broker,ctx,rslt,ref, _ClassName,_RefLeftClass,_RefRightClass, _RefLeft,_RefRight, 1,1,&rc); if( refrc != 0 ) { if( rc.msg != NULL ) { _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() failed : %s",_ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() failed",_ClassName)); } return rc; } CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticsProviderGetInstance( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, char ** properties) { CMPIInstance * ci = NULL; CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI GetInstance() called",_ClassName)); ci = _assoc_get_inst( _broker,ctx,cop,_ClassName,_RefLeft,_RefRight,&rc); if( ci == NULL ) { if( rc.msg != NULL ) { _OSBASE_TRACE(1,("--- %s CMPI GetInstance() failed : %s",_ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--- %s CMPI GetInstance() failed",_ClassName)); } return rc; } CMReturnInstance( rslt, ci ); CMReturnDone(rslt); _OSBASE_TRACE(1,("--- %s CMPI GetInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticsProviderCreateInstance( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticsProviderSetInstance( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci, char **properties) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI SetInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI SetInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticsProviderDeleteInstance( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI DeleteInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI DeleteInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticsProviderExecQuery( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, char * lang, char * query) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI ExecQuery() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI ExecQuery() exited",_ClassName)); return rc; } /* ---------------------------------------------------------------------------*/ /* Associator Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OSBase_OperatingSystemStatisticsProviderAssociationCleanup( CMPIAssociationMI * mi, CMPIContext * ctx) { _OSBASE_TRACE(1,("--- %s CMPI AssociationCleanup() called",_ClassName)); _OSBASE_TRACE(1,("--- %s CMPI AssociationCleanup() exited",_ClassName)); CMReturn(CMPI_RC_OK); } /* * The intention of associations is to show the relations between different * classes and their instances. Therefore an association has two properties. * Each one representing a reference to a certain instance of the specified * class. We can say, that an association has a left and the right "end". * * OperatingSystemStatistics : * < role > -> < class > * "_RefLeft" -> "_RefLeftClass" * "_RefRight" -> "_RefRightClass" * */ /* * general API information * * cop : * Specifies the CMPIObjectPath to the CMPIInstance of the known end of * the association. Its absolutelly necessary to define this anchor point, * from where the evaluation of the association starts. * assocPath : * If not NULL, it contains the name of the association the caller is * looking for. The provider should only return values, when the assocPath * contains the name(s) of the association(s) he is responsible for ! * role : * The caller can specify that the source instance ( cop ) has to play * a certain <role> in the association. The <role> is specified by the * association definition (see above). That means, role has to contain * the same value as the <role> the source instance plays in this assoc. * If this requirement is not true, the provider returns nothing. */ /* * specification of associators() and associatorNames() * * These methods return CMPIInstance ( in the case of associators() ) or * CMPIObjectPath ( in the case of associatorNames() ) object(s) of the * opposite end of the association. * * resultRole : * The caller can specify that the target instance(s) has/have to play * a certain <role> in the association. The <role> is specified by the * association definition (see above). That means, resultRole has to * contain the same value as the <role> the target instance(s) plays * in this assoc. If this requirement is not true, the provider returns * nothing. * resultClass : * The caller can specify that the target instance(s) has/have to be * instances of a certain <class>. The <class> is specified by the * association definition (see above). That means, resultClass has to * contain the same value as the <class> of the target instance(s). * If this requirement is not true, the provider returns nothing. */ CMPIStatus OSBase_OperatingSystemStatisticsProviderAssociators( CMPIAssociationMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, char * assocClass, char * resultClass, char * role, char * resultRole, char ** propertyList ) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIObjectPath * op = NULL; int refrc = 0; _OSBASE_TRACE(1,("--- %s CMPI Associators() called",_ClassName)); if( assocClass ) { op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)), _ClassName, &rc ); } if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) { if( _assoc_check_parameter_const( _broker,cop,_RefLeft,_RefRight, _RefLeftClass,_RefRightClass, resultClass,role,resultRole, &rc ) == 0 ) { goto exit; } refrc = _assoc_create_refs_1toN(_broker, ctx, rslt, cop, _ClassName,_RefLeftClass,_RefRightClass, _RefLeft,_RefRight, 1, 1, &rc); if( refrc != 0 ) { if( rc.msg != NULL ) { _OSBASE_TRACE(1,("--- %s CMPI Associators() failed : %s",_ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--- %s CMPI Associators() failed",_ClassName)); } return rc; } } exit: CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI Associators() exited",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_OperatingSystemStatisticsProviderAssociatorNames( CMPIAssociationMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, char * assocClass, char * resultClass, char * role, char * resultRole) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIObjectPath * op = NULL; int refrc = 0; _OSBASE_TRACE(1,("--- %s CMPI AssociatorNames() called",_ClassName)); if( assocClass ) { op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)), _ClassName, &rc ); } if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) { if( _assoc_check_parameter_const( _broker,cop,_RefLeft,_RefRight, _RefLeftClass,_RefRightClass, resultClass,role,resultRole, &rc ) == 0 ) { goto exit; } refrc = _assoc_create_refs_1toN(_broker, ctx, rslt, cop, _ClassName,_RefLeftClass,_RefRightClass, _RefLeft,_RefRight, 0, 1, &rc); if( refrc != 0 ) { if( rc.msg != NULL ) { _OSBASE_TRACE(1,("--- %s CMPI AssociatorNames() failed : %s",_ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--- %s CMPI AssociatorNames() failed",_ClassName)); } return rc; } } exit: CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI AssociatorNames() exited",_ClassName)); CMReturn(CMPI_RC_OK); } /* * specification of references() and referenceNames() * * These methods return CMPIInstance ( in the case of references() ) or * CMPIObjectPath ( in the case of referenceNames() ) object(s) of th * association itself. */ CMPIStatus OSBase_OperatingSystemStatisticsProviderReferences( CMPIAssociationMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, char * assocClass, char * role, char ** propertyList ) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIObjectPath * op = NULL; int refrc = 0; _OSBASE_TRACE(1,("--- %s CMPI References() called",_ClassName)); if( assocClass ) { op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)), _ClassName, &rc ); } if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) { if( _assoc_check_parameter_const( _broker,cop,_RefLeft,_RefRight, _RefLeftClass,_RefRightClass, NULL,role,NULL, &rc ) == 0 ) { goto exit; } refrc = _assoc_create_refs_1toN(_broker, ctx, rslt, cop, _ClassName,_RefLeftClass,_RefRightClass, _RefLeft,_RefRight, 1, 0, &rc); if( refrc != 0 ) { if( rc.msg != NULL ) { _OSBASE_TRACE(1,("--- %s CMPI References() failed : %s",_ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--- %s CMPI References() failed",_ClassName)); } return rc; } } exit: CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI References() exited",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_OperatingSystemStatisticsProviderReferenceNames( CMPIAssociationMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, char * assocClass, char * role) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIObjectPath * op = NULL; int refrc = 0; _OSBASE_TRACE(1,("--- %s CMPI ReferenceNames() called",_ClassName)); if( assocClass ) { op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)), _ClassName, &rc ); } if( ( assocClass==NULL ) || ( CMClassPathIsA(_broker,op,assocClass,&rc) == 1 ) ) { if( _assoc_check_parameter_const( _broker,cop,_RefLeft,_RefRight, _RefLeftClass,_RefRightClass, NULL,role,NULL, &rc ) == 0 ) { goto exit; } refrc = _assoc_create_refs_1toN(_broker, ctx, rslt, cop, _ClassName,_RefLeftClass,_RefRightClass, _RefLeft,_RefRight, 0, 0, &rc); if( refrc != 0 ) { if( rc.msg != NULL ) { _OSBASE_TRACE(1,("--- %s CMPI ReferenceNames() failed : %s",_ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--- %s CMPI ReferenceNames() failed",_ClassName)); } return rc; } } exit: CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI ReferenceNames() exited",_ClassName)); CMReturn(CMPI_RC_OK); } /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ CMInstanceMIStub( OSBase_OperatingSystemStatisticsProvider, OSBase_OperatingSystemStatisticsProvider, _broker, CMNoHook); CMAssociationMIStub( OSBase_OperatingSystemStatisticsProvider, OSBase_OperatingSystemStatisticsProvider, _broker, CMNoHook); /* ---------------------------------------------------------------------------*/ /* end of cmpiOSBase_OperatingSystemStatisticsProvider */ /* ---------------------------------------------------------------------------*/ Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/cmpi-base/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ChangeLog 14 Apr 2005 14:37:04 -0000 1.4 +++ ChangeLog 20 Apr 2005 11:34:55 -0000 1.5 @@ -78,3 +78,11 @@ the monitored OS OperationalStatus property was delivered // =================================================================== +// new in version 1.5.0 : + +* feature request# 1186592 : added support for class + Linux_OperatingSystemStatisticalData and association + Linux_OperatingSystemStatistics + ... contribution by Michael Schuele ... thx :) + +// =================================================================== --- NEW FILE: cmpiOSBase_OperatingSystemStatisticalData.h --- #ifndef _CMPIOSBASE_OPERATINGSYSTEMSTATISTICALDATA_H_ #define _CMPIOSBASE_OPERATINGSYSTEMSTATISTICALDATA_H_ /* * cmpiOSBase_OperatingSystemStatisticalData.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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Magabeablity Programming Interface ( CMPI ) * * Description: * This file defines the interfaces for the factory implementation of the * CIM class Linux_OperatingSystemStatisticalData. * */ /* ---------------------------------------------------------------------------*/ #include "cmpidt.h" #include "OSBase_OperatingSystemStatisticalData.h" /* ---------------------------------------------------------------------------*/ static char * _ClassName = "Linux_OperatingSystemStatisticalData"; static const char * _INSTANCE_PREFIX = "Linux:"; static int _INSTANCE_PREFIX_LENGTH = 6; /* ---------------------------------------------------------------------------*/ /* method to create a CMPIObjectPath of this class */ CMPIObjectPath * _makePath_OperatingSystemStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * cop, CMPIStatus * rc); /* method to create a CMPIInstance of this class */ CMPIInstance * _makeInst_OperatingSystemStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * cop, const char ** properties, CMPIStatus * rc); /* ---------------------------------------------------------------------------*/ #endif Index: AUTHORS =================================================================== RCS file: /cvsroot/sblim/cmpi-base/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AUTHORS 6 Apr 2005 16:29:38 -0000 1.1 +++ AUTHORS 20 Apr 2005 11:34:55 -0000 1.2 @@ -1,2 +1,8 @@ The cmpi-base provider package was originally written by Heidi Neumann <hei...@de...>. + +Contributions: + +support for class Linux_OperatingSytemStatisticalData and the association +Linux_OperatingSystemStatistics was done by Michael Schuele +<sch...@de...> ... thx :) Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/cmpi-base/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure.ac 13 Apr 2005 13:01:11 -0000 1.4 +++ configure.ac 20 Apr 2005 11:34:56 -0000 1.5 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(SBLIM BaseOS Providers Base, 1.4.3t, sbl...@li...,sblim-cmpi-base) +AC_INIT(SBLIM BaseOS Providers Base, 1.5.0, sbl...@li...,sblim-cmpi-base) AC_CONFIG_SRCDIR([OSBase_Common.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/cmpi-base/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 15 Apr 2005 09:00:52 -0000 1.4 +++ Makefile.am 20 Apr 2005 11:34:56 -0000 1.5 @@ -43,11 +43,13 @@ # OSBase CMPI provider libraries provider_LTLIBRARIES = libcmpiOSBase_ComputerSystemProvider.la \ libcmpiOSBase_OperatingSystemProvider.la \ + libcmpiOSBase_OperatingSystemStatisticalDataProvider.la \ libcmpiOSBase_UnixProcessProvider.la \ libcmpiOSBase_ProcessorProvider.la \ libcmpiOSBase_BaseBoardProvider.la \ libcmpiOSBase_RunningOSProvider.la \ libcmpiOSBase_OSProcessProvider.la \ + libcmpiOSBase_OperatingSystemStatisticsProvider.la \ libcmpiOSBase_CSProcessorProvider.la \ libcmpiOSBase_CSBaseBoardProvider.la @@ -69,6 +71,13 @@ # This gcc/ld specific flag is ugly - need to check in configure libcmpiOSBase_OperatingSystemProvider_la_LDFLAGS = -Wc,-nostartfiles +# Operating System Statistical Data +libcmpiOSBase_OperatingSystemStatisticalDataProvider_la_SOURCES = \ + cmpiOSBase_OperatingSystemStatisticalDataProvider.c \ + cmpiOSBase_OperatingSystemStatisticalData.c \ + OSBase_OperatingSystemStatisticalData.c +libcmpiOSBase_OperatingSystemStatisticalDataProvider_la_LIBADD = -lcmpiOSBase_Common + # Unix Process libcmpiOSBase_UnixProcessProvider_la_SOURCES = \ cmpiOSBase_UnixProcessProvider.c \ @@ -94,6 +103,8 @@ libcmpiOSBase_RunningOSProvider_la_LIBADD = -lcmpiOSBase_Common libcmpiOSBase_OSProcessProvider_la_SOURCES = cmpiOSBase_OSProcessProvider.c libcmpiOSBase_OSProcessProvider_la_LIBADD = -lcmpiOSBase_Common +libcmpiOSBase_OperatingSystemStatisticsProvider_la_SOURCES = cmpiOSBase_OperatingSystemStatisticsProvider.c +libcmpiOSBase_OperatingSystemStatisticsProvider_la_LIBADD = -lcmpiOSBase_Common libcmpiOSBase_CSProcessorProvider_la_SOURCES = cmpiOSBase_CSProcessorProvider.c libcmpiOSBase_CSProcessorProvider_la_LIBADD = -lcmpiOSBase_Common libcmpiOSBase_CSBaseBoardProvider_la_SOURCES = cmpiOSBase_CSBaseBoardProvider.c @@ -120,12 +131,14 @@ # Non-Installable Header Files noinst_HEADERS = OSBase_ComputerSystem.h \ OSBase_OperatingSystem.h \ + OSBase_OperatingSystemStatisticalData.h \ OSBase_UnixProcess.h \ OSBase_Processor.h \ OSBase_BaseBoard.h \ cmpiOSBase_Util.h \ cmpiOSBase_ComputerSystem.h \ cmpiOSBase_OperatingSystem.h \ + cmpiOSBase_OperatingSystemStatisticalData.h \ cmpiOSBase_UnixProcess.h \ cmpiOSBase_Processor.h \ cmpiOSBase_BaseBoard.h @@ -196,6 +209,8 @@ test/cim/Linux_ComputerSystem.cim \ test/cim/Linux_OSProcess.cim \ test/cim/Linux_OperatingSystem.cim \ + test/cim/Linux_OperatingSystemStatisticalData.cim \ + test/cim/Linux_OperatingSystemStatistics.cim \ test/cim/Linux_Processor.cim \ test/cim/Linux_RunningOS.cim \ test/cim/Linux_UnixProcess.cim --- NEW FILE: OSBase_OperatingSystemStatisticalData.h --- #ifndef _LINUX_OPERATINGSYSTEMSTATISTICALDATA_H_ #define _LINUX_OPERATINGSYSTEMSTATISTICALDATA_H_ /* * Linux_OperatingSystemStatisticalData.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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Description: * This file defines the interfaces for the resource access implementation * of the CIM class Linux_OperatingSystemStatisticalData. * */ /* ---------------------------------------------------------------------------*/ #include <sys/types.h> #ifdef __cplusplus extern "C" { #endif /* ---------------------------------------------------------------------------*/ struct os_statistics { unsigned long long user_time; unsigned long long system_time; unsigned long long wait_time; unsigned long long idle_time; unsigned long long run_queue_length; unsigned long long block_queue_length; unsigned long long pages_in; unsigned long long pages_out; }; /** * Returns the current values for the following OS properties: * CPU user time (msec) * CPU system time (msec) * CPU wait time (msec) * CPU idle time (msec) * run queue length * block queue length * page in rate (absolute amount of pages since startup) * page out rate (absolute amount of pages since startup) * param stats on success points to a structure with current values * return 0 if data is available, 1 if an error occured */ int get_os_statistics(struct os_statistics *stats); /* ---------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif /* ---------------------------------------------------------------------------*/ #endif --- NEW FILE: cmpiOSBase_OperatingSystemStatisticalDataProvider.c --- /* * cmpiOSBase_OperatingSystemStatisticalDataProvider.c * * (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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Manageability Programming Interface ( CMPI ) * * Description: * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "cmpidt.h" #include "cmpift.h" #include "cmpimacs.h" #include "OSBase_Common.h" #include "cmpiOSBase_Common.h" #include "cmpiOSBase_OperatingSystemStatisticalData.h" static CMPIBroker * _broker; /* ---------------------------------------------------------------------------*/ /* private declarations */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OSBase_OperatingSystemStatisticalDataProviderCleanup( CMPIInstanceMI * mi, CMPIContext * ctx) { _OSBASE_TRACE(1,("--- %s CMPI Cleanup() called",_ClassName)); _OSBASE_TRACE(1,("--- %s CMPI Cleanup() exited",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_OperatingSystemStatisticalDataProviderEnumInstanceNames( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIObjectPath *op = NULL; _OSBASE_TRACE(3,("CMPI EnumInstanceNames() called",_ClassName)); op = _makePath_OperatingSystemStatisticalData(_broker,ctx,ref,&rc); if (op == NULL) { if (rc.msg != NULL) { _OSBASE_TRACE(1,("--%s CMPI EnumInstanceNames() failed : %s", _ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--%s CMPI EnumInstanceNames() failed", _ClassName)); } return rc; } CMReturnObjectPath(rslt, op); CMReturnDone(rslt); _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticalDataProviderEnumInstances( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, char ** properties) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIInstance * ci = NULL; _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() called",_ClassName)); ci = _makeInst_OperatingSystemStatisticalData(_broker, ctx, ref, properties, &rc); if (ci == NULL) { if (rc.msg != NULL) { _OSBASE_TRACE(1,("--%s CMPI EnumInstances() failed : %s", _ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--%s CMPI EnumInstances() failed", _ClassName)); } return rc; } CMReturnInstance(rslt, ci); CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticalDataProviderGetInstance( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, char ** properties) { CMPIInstance * ci = NULL; CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI GetInstance() called",_ClassName)); ci = _makeInst_OperatingSystemStatisticalData(_broker, ctx, cop, properties, &rc); if (ci == NULL) { if (rc.msg != NULL) { _OSBASE_TRACE(1,("--%s CMPI GetInstance() failed : %s", _ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--%s CMPI GetInstance() failed", _ClassName)); } return rc; } CMReturnInstance( rslt, ci ); CMReturnDone(rslt); _OSBASE_TRACE(1,("--- %s CMPI GetInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticalDataProviderCreateInstance( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticalDataProviderSetInstance( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci, char **properties) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI SetInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI SetInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticalDataProviderDeleteInstance( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI DeleteInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI DeleteInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_OperatingSystemStatisticalDataProviderExecQuery( CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, char * lang, char * query) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI ExecQuery() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI ExecQuery() exited",_ClassName)); return rc; } /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OSBase_OperatingSystemStatisticalDataProviderMethodCleanup( CMPIMethodMI * mi, CMPIContext * ctx) { _OSBASE_TRACE(1,("--- %s CMPI MethodCleanup() called",_ClassName)); _OSBASE_TRACE(1,("--- %s CMPI MethodCleanup() exited",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_OperatingSystemStatisticalDataProviderInvokeMethod( CMPIMethodMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, const char * methodName, CMPIArgs * in, CMPIArgs * out) { CMPIString * class = NULL; CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI InvokeMethod() called",_ClassName)); class = CMGetClassName(ref, &rc); if( strcasecmp(CMGetCharPtr(class), _ClassName) == 0 && strcasecmp("ResetSelectedStats",methodName) == 0 ) { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, methodName ); } else { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_FOUND, methodName ); } _OSBASE_TRACE(1,("--- %s CMPI InvokeMethod() exited",_ClassName)); return rc; } /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ CMInstanceMIStub( OSBase_OperatingSystemStatisticalDataProvider, OSBase_OperatingSystemStatisticalDataProvider, _broker, CMNoHook); CMMethodMIStub( OSBase_OperatingSystemStatisticalDataProvider, OSBase_OperatingSystemStatisticalDataProvider, _broker, CMNoHook); /* ---------------------------------------------------------------------------*/ /* end of cmpiOSBase_OperatingSystemStatisticalDataProvider */ /* ---------------------------------------------------------------------------*/ Index: README =================================================================== RCS file: /cvsroot/sblim/cmpi-base/README,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- README 15 Apr 2005 11:23:01 -0000 1.11 +++ README 20 Apr 2005 11:34:56 -0000 1.12 @@ -18,6 +18,7 @@ -------------------------------------- + Introduction ------------ @@ -29,14 +30,17 @@ - Linux_ComputerSystem - Linux_BaseBoard - Linux_OperatingSystem +- Linux_OperatingSystemStatisticalData - Linux_UnixProcess - Linux_Processor - Linux_RunningOS - Linux_OSProcess +- Linux_OperatingSystemStatistics - Linux_CSProcessor - Linux_CSBaseBoard + Package Contents ---------------- @@ -66,7 +70,7 @@ Building CIMOM and CMPI for this CIMOM -......................................... +...................................... Please follow the instructions in the README.cmpi file of the cmpi-adapter package. CMPI support is available for OpenPegasus, OpenCimom (former @@ -103,8 +107,6 @@ ./configure CIMSERVER=pegasus PROVIDERDIR=$PEGASUS_HOME/lib - - Load Schema into CIMOM's repository ................................... @@ -121,6 +123,7 @@ schemata have to be loaded into the repository. + Common Libraries ---------------- @@ -138,6 +141,7 @@ ROOT ACCESS RIGHTS NEEDED TO EXECUTE + Class/Association specific Libraries ------------------------------------ @@ -148,7 +152,7 @@ - OSBase_ComputerSystem.c/.h class Linux_BaseBoard -.......................... +..................... - cmpiOSBase_BaseBoardProvider.c - cmpiOSBase_BaseBoard.c/.h - OSBase_BaseBoard.c/.h @@ -159,6 +163,12 @@ - cmpiOSBase_OperatingSystem.c/.h - OSBase_OperatingSystem.c/.h +class Linux_OperatingSystemStatisticalData +.......................................... +- cmpiOSBase_OperatingSystemStatisticalDataProvider.c +- cmpiOSBase_OperatingSystemStatisticalData.c/.h +- OSBase_OperatingSystemStatisticalData.c/.h + class Linux_UnixProcess ....................... - cmpiOSBase_UnixProcessProvider.c @@ -180,15 +190,20 @@ ........................... - cmpiOSBase_OSProcessProvider.c +association Linux_OperatingSystemStatistics +........................................... +- cmpiOSBase_OperatingSystemStatisticsProvider.c + association Linux_CSProcessor -........................... +............................. - cmpiOSBase_CSProcessorProvider.c association Linux_CSBaseBoard -........................... +............................. - cmpiOSBase_CSBaseBoardProvider.c + Automated Function Verifcation Test ----------------------------------- --- NEW FILE: OSBase_OperatingSystemStatisticalData.c --- /* * Linux_OperatingSystemStatisticalData.c * * (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://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Description: * This shared library provides resource access functionality for the class * Linux_OperatingSystemStatisticalData. * It is independent from any specific CIM technology. */ /* ---------------------------------------------------------------------------*/ #include "OSBase_OperatingSystemStatisticalData.h" #include "OSBase_Common.h" /* logging */ #include <unistd.h> #include <errno.h> #include <dirent.h> #include <sys/utsname.h> #define PROC_DIR "/proc" #define DATA_FILE "/proc/stat" #define PAGE_FILE_26 "/proc/vmstat" /* ---------------------------------------------------------------------------*/ // private declarations /* ---------------------------------------------------------------------------*/ /** * Checks if the currently running kernel is of version 2.6 * @return 1 if kernel is of version 2.6, 0 otherwise */ int is_kernel26() { int res = 0; _OSBASE_TRACE(3,("is_kernel26() called")); res = kernel_release() >= 26000; _OSBASE_TRACE(4,("is_kernel26(): %d",res)); _OSBASE_TRACE(3,("is_kernel26() exited")); return res; } /** * Updates the field stats->wait_time supposing that the * currently running kernel is of version 2.4. * @param stats the structure whose field will be updated * @return 1 on success, 0 otherwise */ int get_wait_time_24(struct os_statistics *stats) { int res = 0; double uptime = 0; FILE *f = NULL; _OSBASE_TRACE(3,("get_wait_time_24() called")); if ((f = fopen("/proc/uptime","r")) != NULL) { fscanf(f,"%lf",&uptime); stats->wait_time = 0; //stats->wait_time = uptime*1000 - stats->user_time - stats->system_time - stats->idle_time; fclose(f); res = 1; } else { _OSBASE_TRACE(1,("get_queue_info: could not open /proc/uptime: %s",strerror(errno))); } _OSBASE_TRACE(4,("get_wait_time_24() res: %d", res)); _OSBASE_TRACE(3,("get_wait_time_24() exited")); return res; } /** * WARNING: block_queue_length is currently not supported and will be set to zero! * Updates the fields stats->run_queue_length and stats->block_queue_length * supposing that the currently running kernel is of version 2.4. * @param stats the structure whose fields will be updated. * @return 1 on success, 0 otherwise */ int get_queue_info_24(struct os_statistics *stats) { int res = 0; FILE *f = NULL; char buf[127]; char *strptr = NULL; _OSBASE_TRACE(3,("get_queue_info_24() called")); stats->run_queue_length = 0; /** * /proc/loadavg * 0.11 0.10 0.09 <running_processes>/111 26002 * */ if ((f = fopen("/proc/loadavg","r")) != NULL) { fgets(buf,127,f); strptr = strstr(buf,"/"); *strptr = '\0'; while (*strptr != ' ') { strptr--; } stats->run_queue_length = atoll(strptr); fclose(f); res = 1; } else { _OSBASE_TRACE(1,("get_queue_info: could not open /proc/loadavg: %s",strerror(errno))); } #warning block_queue_length for kernel 2.4 not supported // not supported stats->block_queue_length = 0; _OSBASE_TRACE(4,("get_queue_info_24() res: %d",res)); _OSBASE_TRACE(3,("get_queue_info_24() exited")); return res; } /** * Updates the fields stats->user_time, stats->system_time, stats->idle_time, * stats->pages_in and stats->pages_out supposing that the * currently running kernel is of version 2.4. * @param stats the structure whose fields will be updated. * @return 1 on success, 0 otherwise */ int get_cpu_page_data_24(struct os_statistics *stats) { int res = 0; FILE *f = NULL; char buf[4096]; char *strptr = NULL; unsigned long long user = 0; unsigned long long userlow = 0; unsigned long long sys = 0; unsigned long long idle = 0; unsigned long long pages_in = 0; unsigned long long pages_out = 0; _OSBASE_TRACE(3,("get_cpu_page_data_24() called")); int read_count = 0; if ((f = fopen(DATA_FILE,"r")) != NULL) { read_count = fread(buf,sizeof(char),sizeof(buf)-1,f); buf[read_count] = '\0'; /* read cpu data * * /proc/stat * cpu <user> <user_low_prio> <system> <idle> in jiffies (1/100ths of a second) */ if (sscanf(buf,"cpu %lld %lld %lld %lld",&user,&userlow,&sys, &idle) == 4) { stats->user_time = (user + userlow) * 10; stats->system_time = sys * 10; stats->idle_time = idle * 10; stats->wait_time = 0; strptr = strstr(buf,"page"); /* read page data * * page <in> <out> */ if (sscanf(strptr,"page %lld %lld",&pages_in, &pages_out) == 2) { stats->pages_in = pages_in; stats->pages_out = pages_out; res = 1; } else { _OSBASE_TRACE(1,("get_cpu_page_data_24(): could not find page in/out data")); } } else { _OSBASE_TRACE(1,("get_cpu_page_data_24(): could not find cpu data")); } } else { _OSBASE_TRACE(1,("get_cpu_page_data_24():could not open %s: %s",DATA_FILE,strerror(errno))); } _OSBASE_TRACE(4,("get_cpu_page_data_24() res. %d",res)); _OSBASE_TRACE(3,("get_cpu_page_data_24() exited")); return res; } /** * Updates the fields stats->user_time, stats->system_time, stats->idle_time, * stats->wait_time, stats->pages_in and stats->pages_out supposing that the * currently running kernel is of version 2.6. * @param stats the structure whose fields will be updated. * They won't be changed if an error occured. * @return 1 on success, 0 otherwise */ int get_cpu_queue_data_26(struct os_statistics *stats) { int res = 0; FILE *f = NULL; char buf[4096]; char *strptr = NULL; unsigned long long user = 0; unsigned long long userlow = 0; unsigned long long sys = 0; unsigned long long idle = 0; unsigned long long wait = 0; unsigned long long p_running = 0; unsigned long long p_blocked = 0; _OSBASE_TRACE(3,("get_cpu_queue_data_26() called")); int read_count = 0; if ((f = fopen(DATA_FILE,"r")) != NULL) { read_count = fread(buf,sizeof(char),sizeof(buf)-1,f); buf[read_count] = '\0'; /* read cpu data * * /proc/stat * cpu <user> <user_low_prio> <system> <idle> <wait> in jiffies (1/100ths of a second) */ if (sscanf(buf,"cpu %lld %lld %lld %lld %lld",&user,&userlow,&sys,&idle,&wait) == 5) { stats->user_time = (user + userlow) * 10; stats->system_time = sys * 10; stats->idle_time = idle * 10; stats->wait_time = wait * 10; /* read queue data * procs_running <number> * procs_blocked <number> */ strptr = strstr(buf,"procs_running"); if (strptr != NULL && sscanf(strptr,"procs_running %lld\nprocs_blocked %lld",&p_running,&p_blocked) == 2) { stats->run_queue_length = p_running; stats->block_queue_length = p_blocked; res = 1; } else { _OSBASE_TRACE(1,("get_cpu_queue_data_26(): could not find queue info")); } } else { _OSBASE_TRACE(1,("get_cpu_queue_data_26(): could not find cpu info")); } fclose(f); } else { _OSBASE_TRACE(1,("get_cpu_queue_data_26(): could not open %s: %s",DATA_FILE,strerror(errno))); } _OSBASE_TRACE(4,("get_cpu_queue_data_26() res: %d",res)); _OSBASE_TRACE(3,("get_cpu_queue_data_26() exited")); return res; } /** * Updates the fields stats->pages_in and stats->pages_out * supposing that the currently running kernel is of version 2.6. * @param stats the structure whose fields will be updated. * They won't be changed if an error occured. * @return 1 on success, 0 otherwise */ int get_pages_26(struct os_statistics *stats) { int res = 0; FILE *f = NULL; char buf[1024]; char *strptr = NULL; int read_count = 0; _OSBASE_TRACE(3,("get_pages_26 called")); /* * pgpgin <number> * pgpgout <number> */ if ((f = fopen(PAGE_FILE_26,"r")) != NULL) { read_count = fread(buf,sizeof(char),sizeof(buf)-1,f); buf[read_count] = '\0'; strptr = strstr(buf,"pgpgin"); if (strptr != NULL && sscanf(strptr,"pgpgin %lld\npgpgout %lld",&(stats->pages_in),&(stats->pages_out)) == 2) { res = 1; } else { _OSBASE_TRACE(1,("get_pages_26(): could not find page in/out information")); } fclose(f); } else { _OSBASE_TRACE(1,("get_pages_26(): could not open %s: %s",PAGE_FILE_26,strerror(errno))); } _OSBASE_TRACE(4,("get_pages_26() res: %d",res)); _OSBASE_TRACE(3,("get_pages_26() exited")); return res; } /** * Updates all fields of the given structure. * @param stats the structure whose fields will be updated. * They will be set to zero if an error occured. */ int get_os_statistics(struct os_statistics *stats) { int res = 1; _OSBASE_TRACE(3,("get_os_statistics() called")); #ifdef CHECK_FCT_PARAMS if (stats == NULL) { return res; _OSBASE_TRACE(1,("get_os_statistics(): stats parameter is NULL")); } #endif stats->user_time = 0; stats->system_time = 0; stats->wait_time = 0; stats->idle_time = 0; stats->run_queue_length = 0; stats->block_queue_length = 0; stats->pages_in = 0; stats->pages_out = 0; if (is_kernel26()) { res = get_cpu_queue_data_26(stats); res = res && get_pages_26(stats); } else { res = get_cpu_page_data_24(stats); res = res && get_queue_info_24(stats); res = res && get_wait_time_24(stats); } _OSBASE_TRACE(4,("get_os_statistics() res: %d",res)); _OSBASE_TRACE(3,("get_os_statistics() exited")); return (res == 0); } /* ---------------------------------------------------------------------------*/ /* end of OSBase_OperatingSystemStatisticalData.c */ /* ---------------------------------------------------------------------------*/ Index: cmpiOSBase_ComputerSystemProvider.c =================================================================== RCS file: /cvsroot/sblim/cmpi-base/cmpiOSBase_ComputerSystemProvider.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- cmpiOSBase_ComputerSystemProvider.c 20 Sep 2004 12:15:43 -0000 1.7 +++ cmpiOSBase_ComputerSystemProvider.c 20 Apr 2005 11:34:56 -0000 1.8 @@ -147,7 +147,7 @@ _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, - CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); + CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() exited",_ClassName)); return rc; |
From: Viktor M. <mih...@us...> - 2005-04-20 06:21:24
|
Update of /cvsroot/sblim/cmpi-samples/autotools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31578 Modified Files: acinclude.m4 Log Message: Corrected test for cimserver. Index: acinclude.m4 =================================================================== RCS file: /cvsroot/sblim/cmpi-samples/autotools/acinclude.m4,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- acinclude.m4 20 Apr 2005 06:18:26 -0000 1.3 +++ acinclude.m4 20 Apr 2005 06:21:15 -0000 1.4 @@ -27,9 +27,11 @@ AC_DEFUN([CHECK_PEGASUS_2_3_2], [ AC_MSG_CHECKING(for Pegasus 2.3.2) - test_CIMSERVER=`cimserver -v` - if which cimserver > /dev/null 2>&1 && - test "$test_CIMSERVER" == "2.3.2"; then + if which cimserver > /dev/null 2>&1 + then + test_CIMSERVER=`cimserver -v` + fi + if test "$test_CIMSERVER" == "2.3.2"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_3_2,1,[Defined to 1 if Pegasus 2.3.2 is used]) else @@ -46,9 +48,11 @@ AC_DEFUN([CHECK_PEGASUS_2_4], [ AC_MSG_CHECKING(for Pegasus 2.4) - test_CIMSERVER=`cimserver -v` - if which cimserver > /dev/null 2>&1 && - test "$test_CIMSERVER" == "2.4"; then + if which cimserver > /dev/null 2>&1 + then + test_CIMSERVER=`cimserver -v` + fi + if test "$test_CIMSERVER" == "2.4"; then AC_MSG_RESULT(yes) CPPFLAGS="$CPPFLAGS -DPEGASUS_USE_EXPERIMENTAL_INTERFACES" AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_4,1,[Defined to 1 if Pegasus 2.4 is used]) |
From: Viktor M. <mih...@us...> - 2005-04-20 06:18:34
|
Update of /cvsroot/sblim/cmpi-samples/autotools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30162 Modified Files: acinclude.m4 Log Message: Added test for cimserver executable. Index: acinclude.m4 =================================================================== RCS file: /cvsroot/sblim/cmpi-samples/autotools/acinclude.m4,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- acinclude.m4 19 Apr 2005 11:10:27 -0000 1.2 +++ acinclude.m4 20 Apr 2005 06:18:26 -0000 1.3 @@ -28,7 +28,8 @@ [ AC_MSG_CHECKING(for Pegasus 2.3.2) test_CIMSERVER=`cimserver -v` - if test "$test_CIMSERVER" == "2.3.2"; then + if which cimserver > /dev/null 2>&1 && + test "$test_CIMSERVER" == "2.3.2"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_3_2,1,[Defined to 1 if Pegasus 2.3.2 is used]) else @@ -46,7 +47,8 @@ [ AC_MSG_CHECKING(for Pegasus 2.4) test_CIMSERVER=`cimserver -v` - if test "$test_CIMSERVER" == "2.4"; then + if which cimserver > /dev/null 2>&1 && + test "$test_CIMSERVER" == "2.4"; then AC_MSG_RESULT(yes) CPPFLAGS="$CPPFLAGS -DPEGASUS_USE_EXPERIMENTAL_INTERFACES" AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_4,1,[Defined to 1 if Pegasus 2.4 is used]) |
From: Konrad R. <kon...@us...> - 2005-04-19 16:05:01
|
Update of /cvsroot/sblim/indication_helper In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5765 Modified Files: ind_helper.c ind_helper.h Log Message: [ 1183083] CMPI-BASE: Indication Provider delivers only first occurence Added a new flag to ind_reg_pollfnc so that the developer can determine what behaviour he/she wants. Index: ind_helper.h =================================================================== RCS file: /cvsroot/sblim/indication_helper/ind_helper.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ind_helper.h 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ ind_helper.h 19 Apr 2005 16:04:16 -0000 1.2 @@ -24,6 +24,102 @@ #define IND_TIME_DEFAULT 10; +/* + The mechanism by which the check function is being compared against. + Currently there are two logics, as explained below. +*/ +typedef Uint32 IndCheckBehaviour; + +/* +The polling function (defined as the <li>check</li) will +be pooled and the value passed in +to the parameter will be checked against the previous value +that was returned earlier. If there is a change, the library +will immediately call all of the property functions, create +an instance and attempt to deliever it (if the evaluation of +the instance against the indication filter is true). + +This detection mechanism is also comonly called 'edge level +detection' or 'trigger detection'. It means that the CIM +Listener will not be bombarded with indications but only +when state changes. + +For example, if the monitor function was passing these +values through its parameter: + +0,3,3,3,3,3,0,1,1,1,1,1,0,0,0 + ^ ^ ^ ^ +(rise) (doww&rise) (level down) + +There would only be four indications sent (of course, pending +the evaluation of the constructed instance agains the indication filter). + +Caveat: On the first call to the monitor function, the +previous state is not known. The library considers this +first call as the seed call and does not deliever the +instance. Please make sure to structure your code +accordingly and have a check for the first call. + +Note: The function prototype for the monitor function is the +same as for retrieving the property values. This means you +can use the same function for both purposes. For example, +assume you have a property named 'OperationStatus' that +returns two values: 2 (OK) or 4 (Stressed). The value of +this property could be the driver for triggering the +indication. Thus you could do this: + +ind_reg_pollfnc("CIM_ModifyInstance", "OperationalStatus", +check_os, 10); +ind_set_property_f("root/cimv2","CIM_ModifyInstance","Operational +Instance", +check_os); + +*/ +#define IND_BEHAVIOUR_LEVEL_EDGE 32 + +/* +The polling function (defined as the <li>check</li) will +be pooled and the value passed in through the parameter +will be checked against the "no-event" value - zero. Any value +other than "no-event" triggers the process of attempting to +send an indication (if the evaluation of the instance against the +indication filter is true, of course). + +For example, if the monitor function was passing these +values through its parameter: + +0,3,3,3,3,3,0,1,1,1,1,1,0,0,0 + ^^^^^^^^^ ^^^^^^^^^ + 5x event 5x event + +That means that there would be 10 indications sent (any value +that is not zero is considered as the go for the indication +creation). + +Note that there is no need to have a previous state by the +"check" function (as opposed to the LEVEL type behaviour). The +library assumes it is 0 (any of the integer values). + +Usually the check functions look something akin to this: + +IndErrorT check(CMPIData *v) +{ + + ind_new = check_OperationalStatus(&ind_OperationalStatus); + + v->state = CMPI_goodValue; + v->type = CMPI_uint16; + v->value.uint16 = ind_new; + + // Resetting it to no-event state. + ind_new = 0; + return IND_OK; + +} + +*/ + +#define IND_BEHAVIOUR_AGAINST_ZERO 64 /** * Return codes. */ @@ -125,6 +221,9 @@ * @param timer Polling interval in seconds. If you have no * need for fine-grain optimization use the 'IND_TIME_DEFAULT' * value. + * @param logic The logic for polling function. There are currently + * two logics: IND_BEHAVIOUR_LEVEL_EDGE and IND_BEHAVIOUR_AGAINST_ZERO. + * Please see the comments for those defines to find the full description. * * @return IND_INVALID_ARGS The 'cn' or 'pn' values are zero length. * @return IND_MUTEX Problem locking the internal list. This is a serious @@ -139,7 +238,8 @@ IndErrorT ind_reg_pollfnc(const char *cn, char *pn, IndErrorT (*check) (CMPIData *), - IndTimeT timer ); + IndTimeT timer, + IndCheckBehaviour logic); /** * Register the polling function. This routine will call @@ -157,6 +257,9 @@ * @param timer Polling interval in seconds. If you have no * need for fine-grain optimization use the 'IND_TIME_DEFAULT' * value. + * @param logic The logic for polling function. There are currently + * two logics: IND_BEHAVIOUR_LEVEL_EDGE and IND_BEHAVIOUR_AGAINST_ZERO. + * Please see the comments for those defines to find the full description. * * @return IND_INVALID_ARGS The 'cn' or 'pn' values are zero length. * @return IND_MUTEX Problem locking the internal list. This is a serious @@ -172,7 +275,8 @@ const char *cn, char *pn, IndErrorT (*check) (CMPIData *), - IndTimeT timer ); + IndTimeT timer, + IndCheckBehaviour logic); /** Index: ind_helper.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/ind_helper.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ind_helper.c 23 Mar 2005 21:47:08 -0000 1.6 +++ ind_helper.c 19 Apr 2005 16:04:15 -0000 1.7 @@ -35,13 +35,14 @@ #if defined(DEBUG) -#define IND_HLP_DEBUG(X) fprintf(stderr, "%s:%d:[%s]\n", __FILE__, __LINE__, X); fflush(stderr); +#define IND_HLP_DEBUG(X) fprintf(stderr, "%s:%d:[%s]\n", __FILE__, __LINE__, X); fflush(stderr); #else #define IND_HLP_DEBUG(X) #endif #define DEFAULT_NAMESPACE "root/cimv2" [...3262 lines suppressed...] { - IND_HLP_DEBUG("String released."); - if (data->value.string) { - CMRelease(data->value.string); - data->value.string = NULL; - } + IND_HLP_DEBUG ("String released."); + if (data->value.string) + { + CMRelease (data->value.string); + data->value.string = NULL; + } } - - IND_HLP_DEBUG("_releaseDataValue exited."); + + IND_HLP_DEBUG ("_releaseDataValue exited."); return IND_OK; } - |
From: Konrad R. <kon...@us...> - 2005-04-19 16:04:36
|
Update of /cvsroot/sblim/indication_helper/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5765/test Modified Files: Test_addProperty.c Test_all_functions.c Test_genIndication.c Test_genIndication_fail.c Test_reg_pollfnc.c Test_reg_pollfnc2.c Test_reg_pollfnc3.c Test_reg_pollfnc3_threaded.c Log Message: [ 1183083] CMPI-BASE: Indication Provider delivers only first occurence Added a new flag to ind_reg_pollfnc so that the developer can determine what behaviour he/she wants. Index: Test_reg_pollfnc2.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc2.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_reg_pollfnc2.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_reg_pollfnc2.c 19 Apr 2005 16:04:24 -0000 1.2 @@ -87,9 +87,9 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register the test function */ - assert ( ind_reg_pollfnc("test1", "A", test1, 1) == IND_OK); - assert ( ind_reg_pollfnc("test1", "B", test2, 1) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test2, 1) == IND_OK); + assert ( ind_reg_pollfnc("test1", "A", test1, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test1", "B", test2, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test1", "C", test2, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); assert ( test1_values == 1 ); Index: Test_reg_pollfnc.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_reg_pollfnc.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_reg_pollfnc.c 19 Apr 2005 16:04:23 -0000 1.2 @@ -305,27 +305,27 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register functions with data types */ - assert ( ind_reg_pollfnc("test4", "uint16", test_uint16, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4", "uint16", test_uint16, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4", "char", test_char, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4", "char", test_char, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"string", test_string, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"string", test_string, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint64", test_uint64, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint32", test_uint32, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint8", test_uint8, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint64", test_sint64, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint32", test_sint32, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint16", test_sint16, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint8", test_sint8, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"uint64", test_uint64, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"uint32", test_uint32, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"uint8", test_uint8, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"sint64", test_sint64, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"sint32", test_sint32, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"sint16", test_sint16, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"sint8", test_sint8, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"real32", test_real32, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"real64", test_real64, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"real32", test_real32, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"real64", test_real64, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"boolean", test_boolean, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"char16", test_char16, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"boolean", test_boolean, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"char16", test_char16, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"ptr", test_ptr, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"ptr", test_ptr, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); assert ( ind_start() == IND_OK); Index: Test_addProperty.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_addProperty.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_addProperty.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_addProperty.c 19 Apr 2005 16:04:16 -0000 1.2 @@ -51,8 +51,8 @@ debug =1; /* Register functions with data types */ - assert ( ind_reg_pollfnc("test5", "test_BAD", test_BAD, 10) == -100); - assert ( ind_reg_pollfnc("test5", "test_BAD2", test_BAD2, 10) == IND_OK); + assert ( ind_reg_pollfnc("test5", "test_BAD", test_BAD, 10, IND_BEHAVIOUR_LEVEL_EDGE) == -100); + assert ( ind_reg_pollfnc("test5", "test_BAD2", test_BAD2, 10, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); assert ( ind_shutdown() == IND_OK); Index: Test_all_functions.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_all_functions.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_all_functions.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_all_functions.c 19 Apr 2005 16:04:23 -0000 1.2 @@ -37,8 +37,8 @@ assert ( IND_OK == ind_shutdown()); /* Monitored */ - assert ( IND_INVALID_ARGS == ind_reg_pollfnc("","",NULL, 0)); - assert ( IND_INVALID_ARGS == ind_reg_pollfnc_ns("","","",NULL, 0)); + assert ( IND_INVALID_ARGS == ind_reg_pollfnc("","",NULL, 0,IND_BEHAVIOUR_LEVEL_EDGE )); + assert ( IND_INVALID_ARGS == ind_reg_pollfnc_ns("","","",NULL, 0, IND_BEHAVIOUR_AGAINST_ZERO)); assert ( IND_INVALID_ARGS == ind_unreg_pollfnc("","")); assert ( IND_INVALID_ARGS == ind_unreg_pollfnc_ns("","","")); Index: Test_reg_pollfnc3_threaded.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc3_threaded.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_reg_pollfnc3_threaded.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_reg_pollfnc3_threaded.c 19 Apr 2005 16:04:24 -0000 1.2 @@ -56,7 +56,7 @@ { snprintf(pn, 100,"A%d", i); - if (ind_reg_pollfnc("test1", pn, test1, 1) == IND_MUTEX) { + if (ind_reg_pollfnc("test1", pn, test1, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_MUTEX) { rc = IND_MUTEX; return NULL; } Index: Test_genIndication_fail.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_genIndication_fail.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_genIndication_fail.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_genIndication_fail.c 19 Apr 2005 16:04:23 -0000 1.2 @@ -541,9 +541,9 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register functions with data types */ - assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "uint16", test_uint16, 1) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "uint16", test_uint16, 1,IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "string", test_string, 1) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "string", test_string, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); /* Register a property for the test9 class */ Index: Test_reg_pollfnc3.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc3.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_reg_pollfnc3.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_reg_pollfnc3.c 19 Apr 2005 16:04:24 -0000 1.2 @@ -42,15 +42,15 @@ for (loops =0; loops < 5; loops++) { /* Register */ - assert ( ind_reg_pollfnc("test1", "A", test1, 10) == IND_OK); + assert ( ind_reg_pollfnc("test1", "A", test1, 10, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test1", "A", NULL, 10) == IND_DUPLICATE); + assert ( ind_reg_pollfnc("test1", "A", NULL, 10,IND_BEHAVIOUR_LEVEL_EDGE) == IND_DUPLICATE); - assert ( ind_reg_pollfnc("test1" ,"B", test1, 20) == IND_OK); + assert ( ind_reg_pollfnc("test1" ,"B", test1, 20,IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test1, 30) == IND_OK); + assert ( ind_reg_pollfnc("test1", "C", test1, 30,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test2", "D", test2, 2) == IND_OK); + assert ( ind_reg_pollfnc("test2", "D", test2, 2,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); /* Modify the function */ @@ -87,13 +87,13 @@ } - assert ( ind_reg_pollfnc("test1", "A", test1, 10) == IND_OK); + assert ( ind_reg_pollfnc("test1", "A", test1, 10, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1" ,"B", test1, 20) == IND_OK); + assert ( ind_reg_pollfnc("test1" ,"B", test1, 20, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test1, 30) == IND_OK); + assert ( ind_reg_pollfnc("test1", "C", test1, 30, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test2", "D", test2, 2) == IND_OK); + assert ( ind_reg_pollfnc("test2", "D", test2, 2, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); /* They should be deleted in order of : D A B C */ assert ( ind_shutdown() == IND_OK); printf("+++ %s succedeed\n",__FILE__); Index: Test_genIndication.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_genIndication.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_genIndication.c 22 Mar 2005 22:02:57 -0000 1.2 +++ Test_genIndication.c 19 Apr 2005 16:04:23 -0000 1.3 @@ -114,8 +114,10 @@ /* Change the return code on odd numbers */ if (uint16_v % 2) return IND_OK; - else + else { + fprintf(stderr,"Ignore the warning. This is intended\n"); return IND_INVALID_ARGS; + } } IndErrorT get_value_string(CMPIData *v) @@ -676,9 +678,9 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register functions with data types */ - assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "string", test_string, 1) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "string", test_string, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "uint16", test_uint16, 1) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "uint16", test_uint16, 1, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); /* Register a property for the test8 class */ @@ -737,7 +739,7 @@ /* Start and stop the worker */ assert ( ind_start() == IND_OK ); - printf("Waiting 3 seconds. Ought to see two indications...\n"); + printf("Waiting 3 seconds. Ought to see three indications...\n"); sleep (3); assert ( ind_stop() == IND_OK ); @@ -746,7 +748,7 @@ two seconds will be called four times, but the test_uint16 returns -100 instead of IND_OK for every even number, hence we will only get two of them*/ - assert ( indication_count >= 2 ); + assert ( indication_count >= 3 ); /* Shutdown */ assert ( ind_shutdown() == IND_OK); |
From: Viktor M. <mih...@us...> - 2005-04-19 16:00:23
|
Update of /cvsroot/sblim/cmpi-fsvol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4669 Modified Files: configure.ac Log Message: Changed release number to 1.3.0. Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/configure.ac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- configure.ac 15 Apr 2005 14:28:15 -0000 1.1 +++ configure.ac 19 Apr 2005 16:00:13 -0000 1.2 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(SBLIM BaseOS Filesystem Providers, 1.2.6am, sbl...@li...,sblim-cmpi-fsvol) +AC_INIT(SBLIM BaseOS Filesystem Providers, 1.3.0, sbl...@li...,sblim-cmpi-fsvol) AC_CONFIG_SRCDIR([OSBase_CommonFsvol.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE |
From: Viktor M. <mih...@us...> - 2005-04-19 15:05:22
|
Update of /cvsroot/sblim/cmpi-samples/cmpi-fad In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8843 Modified Files: Makefile.am configure.ac Log Message: Bug 1186024: fixed Makefile.am. Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/cmpi-samples/cmpi-fad/configure.ac,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- configure.ac 5 Apr 2005 13:20:53 -0000 1.1.1.1 +++ configure.ac 19 Apr 2005 15:05:09 -0000 1.2 @@ -3,7 +3,7 @@ # PUT YOUR PACKAGE INFO HERE. e.g. #AC_INIT(<PACKAGE_NAME>, <PACKAGE_VERSION>, <PACKAGE_BUGREPORT>, <PACKAGE_TARBALL>) -AC_INIT(CMPI Files And Directories, 0.3.0, mih...@de..., sblim-cmpi-fad) +AC_INIT(CMPI Files And Directories, 0.3.1, mih...@de..., sblim-cmpi-fad) # CHANGE THIS TO THE RELATIVE PATHNAME OF *ONE* OF THE SOURCE FILES AC_CONFIG_SRCDIR([src/CWS_Directory.c]) Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/cmpi-samples/cmpi-fad/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Makefile.am 5 Apr 2005 13:20:53 -0000 1.1.1.1 +++ Makefile.am 19 Apr 2005 15:05:08 -0000 1.2 @@ -82,8 +82,8 @@ # Register the provider(s) and class definition(s) to the current CIM server/CIMOM postinstall: - test x"$(SCHEMAS)" != x && \ - sh provider-register.sh -t @CIMSERVER@ -s $(SCHEMAS) + test x"$(MOFS)" != x && \ + sh provider-register.sh -t @CIMSERVER@ -s $(MOFS) test x"$(REGISTRATIONS.@CIMSERVER@)" != x && \ sh provider-register.sh -t @CIMSERVER@ -r $(REGISTRATIONS.@CIMSERVER@) |
From: Viktor M. <mih...@us...> - 2005-04-19 13:21:25
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19073 Modified Files: README configure.ac sfcb.spec.in Log Message: Bug 1181627. Index: README =================================================================== RCS file: /cvsroot/sblim/sfcb/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- README 9 Mar 2005 12:25:08 -0000 1.1.1.1 +++ README 19 Apr 2005 13:21:10 -0000 1.2 @@ -52,3 +52,57 @@ the date of this writing (March 2005) this version was not yet shipped with the usual distributions. Please make sure, you have the right version of libtool installed! + +Step by Step Instructions +------------------------- + +This is a description of the minimum number of steps to get sfcb up and +running: + +If you have received as tarball, invoke + tar xvjd sfcb-<version>.tar.bz2 + +If you want to check out from CVS, invoke (with CVSROOT set correctly) + cvs co sfcb + cd sfcb + cvs co mofc + ./autoconfiscate.sh + +In both cases continue with + ./configure + make + make install (need superuser rights) + make install-cimschema (superuser, need access to internet) + +Make sure that /usr/local/bin is in the path and /usr/local/lib either in +LD_LIBRARY_PATH or /etc/ld.so.conf and invoke + sfcbrepos -f (superuser, ignore error message) + +Start the sfcb by either invoking sfcbd or /usr/local/etc/init.d/sfcb start + +Execute a CIM client request, i.e. with SBLIM wbemcli: + wbemcli -dx ec http://localhost/root/cimv2 +you should see an output similar to: + + +To server: <?xml version="1.0" encoding="utf-8" ?> +<CIM CIMVERSION="2.0" DTDVERSION="2.0"> +<MESSAGE ID="4711" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="EnumerateClasses"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="cimv2"></NAMESPACE></LOCALNAMESPACEPATH> +<IPARAMVALUE NAME="ClassName"><CLASSNAME NAME=""/></IPARAMVALUE> +<IPARAMVALUE NAME="DeepInheritance"><VALUE>TRUE</VALUE></IPARAMVALUE> +<IPARAMVALUE NAME="LocalOnly"><VALUE>FALSE</VALUE></IPARAMVALUE> +<IPARAMVALUE NAME="IncludeQualifiers"><VALUE>FALSE</VALUE></IPARAMVALUE> +<IPARAMVALUE NAME="IncludeClassOrigin"><VALUE>TRUE</VALUE></IPARAMVALUE> +</IMETHODCALL></SIMPLEREQ> +</MESSAGE></CIM> +From server: <?xml version="1.0" encoding="utf-8" ?> +<CIM CIMVERSION="2.0" DTDVERSION="1.1"> +<MESSAGE ID="4711" PROTOCOLVERSION="1.0"> +<SIMPLERSP> +<IMETHODRESPONSE NAME="EnumerateClasses"> +<IRETURNVALUE> +</IRETURNVALUE> +</IMETHODRESPONSE> +</SIMPLERSP> +</MESSAGE> +</CIM> Index: sfcb.spec.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcb.spec.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- sfcb.spec.in 1 Apr 2005 15:19:29 -0000 1.6 +++ sfcb.spec.in 19 Apr 2005 13:21:11 -0000 1.7 @@ -24,6 +24,8 @@ Summary: CIM Schema Files Copyright: (C) Distributed Management Task Force Group: Systems Management/Base +Requires: %{name} + %Description schema DMTF CIM Schema files that can be used with the Small Footprint CIM Broker. @@ -81,6 +83,10 @@ %postun /sbin/ldconfig +%post schema +sfcbrepos -f 2> /dev/null +exit 0 + %files schema %{_datadir}/%{name}/CIM Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/sfcb/configure.ac,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- configure.ac 1 Apr 2005 15:19:29 -0000 1.6 +++ configure.ac 19 Apr 2005 13:21:11 -0000 1.7 @@ -21,7 +21,7 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(Small Footprint CIM Broker, 0.8.7, sc...@de..., sfcb) +AC_INIT(Small Footprint CIM Broker, 0.8.7a, sc...@de..., sfcb) AC_CONFIG_SRCDIR([providerDrv.c]) AM_INIT_AUTOMAKE |
From: Viktor M. <mih...@us...> - 2005-04-19 12:21:19
|
Update of /cvsroot/sblim/indication_helper In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17317 Modified Files: acinclude.m4 configure.ac Log Message: Bug 1179459: Add /usr/local/include/cmpi to search list. Bug 1179463: Check for presence of cimserver executable before testing version. Index: acinclude.m4 =================================================================== RCS file: /cvsroot/sblim/indication_helper/acinclude.m4,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- acinclude.m4 14 Apr 2005 15:26:54 -0000 1.2 +++ acinclude.m4 19 Apr 2005 12:21:08 -0000 1.3 @@ -2,21 +2,22 @@ dnl $Id$ dnl dnl - dnl (C) Copyright IBM Corp. 2004 + dnl (C) Copyright IBM Corp. 2004, 2005 dnl dnl THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE dnl ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE dnl CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. dnl dnl You can obtain a current copy of the Common Public License from - dnl http://oss.software.ibm.com/developerworks/opensource/license-cpl.html + dnl http://www.opensource.org/licenses/cpl1.0.php dnl dnl Author: Konrad Rzeszutek <ko...@us...> + dnl Contributors: Viktor Mihajlovski <mih...@de...> dnl Date : 09/20/2004 dnl dnl dnl CHECK_CMPI: Check for CMPI headers and set the CPPFLAGS -dnl with the -I<dirrectory> +dnl with the -I<directory> dnl dnl CHECK_PEGASUS_2_3_2: Check for Pegasus 2.3.2 and set dnl the HAVE_PEGASUS_2_3_2 @@ -26,7 +27,10 @@ AC_DEFUN([CHECK_PEGASUS_2_3_2], [ AC_MSG_CHECKING(for Pegasus 2.3.2) - test_CIMSERVER=`cimserver -v` + if which cimserver > /dev/null 2>&1 + then + test_CIMSERVER=`cimserver -v` + fi if test "$test_CIMSERVER" == "2.3.2"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_3_2,1,[Defined to 1 if Pegasus 2.3.2 is used]) @@ -44,7 +48,10 @@ AC_DEFUN([CHECK_PEGASUS_2_4], [ AC_MSG_CHECKING(for Pegasus 2.4) - test_CIMSERVER=`cimserver -v` + if which cimserver > /dev/null 2>&1 + then + test_CIMSERVER=`cimserver -v` + fi if test "$test_CIMSERVER" == "2.4"; then AC_MSG_RESULT(yes) CPPFLAGS="$CPPFLAGS -DPEGASUS_USE_EXPERIMENTAL_INTERFACES" @@ -85,6 +92,29 @@ ]) +AC_DEFUN([_CHECK_INDHELP_HEADER], + [ + AC_MSG_CHECKING($1) + AC_TRY_COMPILE( + [ + #include <stdio.h> + #include <ind_helper.h> + ], + [ + CMPISelectExp *filter = NULL; + ind_set_select("/root/cimv2",NULL,filter); + ], + [ + have_INDHELP=yes + dnl AC_MSG_RESULT(yes) + ], + [ + have_INDHELP=no + dnl AC_MSG_RESULT(no) + ]) + +]) + dnl dnl The main function to check for CMPI headers dnl Modifies the CPPFLAGS with the right include directory and sets @@ -94,41 +124,35 @@ AC_DEFUN([CHECK_CMPI], [ AC_MSG_CHECKING(for CMPI headers) - dnl Our temporary placeholder for the CPP flags - CMPI_CPP_FLAGS="$CPPFLAGS" - have_CMPI=no dnl Check just with the standard include paths + CMPI_CPP_FLAGS="$CPPFLAGS" _CHECK_CMPI(standard) if test "$have_CMPI" == "yes"; then dnl The standard include paths worked. AC_MSG_RESULT(yes) else - found_it=no - AC_FOREACH( - [_DIR_], - dnl The different directories to check - [/usr/include/cmpi - $PEGASUS_ROOT/src/Pegasus/Provider/CMPI - /opt/tog-pegasus/include/Pegasus/Provider/CMPI - /usr/include/Pegasus/Provider/CMPI - /usr/include/openwbem - /usr/sniacimom/include], - [ + _DIRS_="/usr/include/cmpi \ + /usr/local/include/cmpi \ + $PEGASUS_ROOT/src/Pegasus/Provider/CMPI \ + /opt/tog-pegasus/include/Pegasus/Provider/CMPI \ + /usr/include/Pegasus/Provider/CMPI \ + /usr/include/openwbem \ + /usr/sniacimom/include" + for _DIR_ in $_DIRS_ + do _cppflags=$CPPFLAGS - _include_CMPI="_DIR_" + _include_CMPI="$_DIR_" CPPFLAGS="$CPPFLAGS -I$_include_CMPI" - _CHECK_CMPI(_DIR_) - if test "$have_CMPI" == "yes"; then - if test "$found_it" == no; then - dnl Found it - AC_MSG_RESULT(yes) - dnl Save the new -I parameter - CMPI_CPP_FLAGS="$CPPFLAGS" - found_it=yes - fi - fi - CPPFLAGS=$_cppflags - ]) + _CHECK_CMPI($_DIR_) + if test "$have_CMPI" == "yes"; then + dnl Found it + AC_MSG_RESULT(yes) + dnl Save the new -I parameter + CMPI_CPP_FLAGS="$CPPFLAGS" + break + fi + CPPFLAGS=$_cppflags + done fi CPPFLAGS="$CMPI_CPP_FLAGS" if test "$have_CMPI" == "no"; then @@ -136,3 +160,199 @@ fi ] ) + +dnl +dnl The main function to check for the indication_helper header. +dnl Modifies the CPPFLAGS with the right include directory and sets +dnl the 'have_INDHELP' to either 'no' or 'yes' +dnl + +AC_DEFUN([CHECK_INDHELP_HEADER], + [ + INDHELP_CPP_FLAGS="$CPPFLAGS" + AC_MSG_CHECKING(for indication helper header) + dnl Check just with the standard include paths + _CHECK_INDHELP_HEADER(standard) + if test "$have_INDHELP" == "yes"; then + dnl The standard include paths worked. + AC_MSG_RESULT(yes) + else + _DIRS_="/usr/include/sblim \ + /usr/local/include/sblim" + for _DIR_ in $_DIRS_ + do + _cppflags=$CPPFLAGS + _include_INDHELP="$_DIR_" + CPPFLAGS="$CPPFLAGS -I$_include_INDHELP" + _CHECK_INDHELP_HEADER($_DIR_) + if test "$have_INDHELP" == "yes"; then + dnl Found it + AC_MSG_RESULT(yes) + dnl Save the new -I parameter + INDHELP_CPP_FLAGS="$CPPFLAGS" + break + fi + CPPFLAGS=$_cppflags + done + fi + CPPFLAGS="$INDHELP_CPP_FLAGS" + if test "$have_INDHELP" == "no"; then + AC_MSG_RESULT(no) + fi + ] +) + +dnl +dnl The check for the CMPI provider directory +dnl Sets the PROVIDERDIR variable. +dnl + +AC_DEFUN([CHECK_PROVIDERDIR], + [ + AC_MSG_CHECKING(for CMPI provider directory) + _DIRS="$libdir/cmpi" + save_exec_prefix=${exec_prefix} + save_prefix=${prefix} + if test xNONE == x${prefix}; then + prefix=/usr/local + fi + if test xNONE == x${exec_prefix}; then + exec_prefix=$prefix + fi + for _dir in $_DIRS + do + _xdir=`eval echo $_dir` + AC_MSG_CHECKING( $_dir ) + if test -d $_xdir ; then + dnl Found it + AC_MSG_RESULT(yes) + if test x"$PROVIDERDIR" == x ; then + PROVIDERDIR=$_dir + fi + break + fi + done + if test x"$PROVIDERDIR" == x ; then + PROVIDERDIR="$libdir"/cmpi + AC_MSG_RESULT(implied: $PROVIDERDIR) + fi + exec_prefix=$save_exec_prefix + prefix=$save_prefix + ] +) + +dnl +dnl The "check" for the CIM server type +dnl Sets the CIMSERVER variable. +dnl + +AC_DEFUN([CHECK_CIMSERVER], + [ + AC_MSG_CHECKING(for CIM servers) + _SERVERS="sfcbd cimserver owcimomd" + for _name in $_SERVERS + do + AC_MSG_CHECKING( $_name ) + which $_name > /dev/null 2>&1 + if test $? == 0 ; then + dnl Found it + AC_MSG_RESULT(yes) + if test x"$CIMSERVER" == x ; then + case $_name in + sfcbd) CIMSERVER=sfcb;; + cimserver) CIMSERVER=pegasus;; + owcimomd) CIMSERVER=openwbem;; + esac + fi + break; + fi + done + if test x"$CIMSERVER" == x ; then + CIMSERVER=sfcb + AC_MSG_RESULT(implied: $CIMSERVER) + fi + ] +) + +dnl +dnl The check for the SBLIM test suite +dnl Sets the TESTSUITEDIR variable and the TESTSUITE conditional +dnl + +AC_DEFUN([CHECK_TESTSUITE], + [ + AC_MSG_CHECKING(for SBLIM testsuite) + _DIRS="$datadir/sblim-testsuite" + save_exec_prefix=${exec_prefix} + save_prefix=${prefix} + if test xNONE == x${prefix}; then + prefix=/usr/local + fi + if test xNONE == x${exec_prefix}; then + exec_prefix=$prefix + fi + for _name in $_DIRS + do + AC_MSG_CHECKING( $_name ) + _xname=`eval echo $_name` + if test -x $_xname/run.sh ; then + dnl Found it + AC_MSG_RESULT(yes) + if test x"$TESTSUITEDIR" == x; then + TESTSUITEDIR=$_name + fi + AC_SUBST(TESTSUITEDIR) + break; + fi + done + if test x"$TESTSUITEDIR" == x ; then + AC_MSG_RESULT(no) + fi + AM_CONDITIONAL(TESTSUITE,[test x"$TESTSUITEDIR" != x]) + exec_prefix=$save_exec_prefix + prefix=$save_prefix + ] +) + +dnl +dnl The main function to check for the cmpi-base common header +dnl Modifies the CPPFLAGS with the right include directory and sets +dnl the 'have_SBLIMBASE' to either 'no' or 'yes' +dnl + +AC_DEFUN([CHECK_SBLIM_BASE], + [ + AC_MSG_CHECKING(for SBLIM Base) + SBLIMBASE_CPP_FLAGS="$CPPFLAGS" + dnl Check just with the standard include paths + _CHECK_SBLIM_BASE(standard) + if test "$have_SBLIMBASE" == "yes"; then + dnl The standard include paths worked. + AC_MSG_RESULT(yes) + else + _DIRS_="/usr/include/sblim \ + /usr/local/include/sblim" + for _DIR_ in $_DIRS_ + do + _cppflags=$CPPFLAGS + _include_SBLIMBASE="$_DIR_" + CPPFLAGS="$CPPFLAGS -I$_include_SBLIMBASE" + _CHECK_SBLIM_BASE($_DIR_) + if test "$have_SBLIMBASE" == "yes"; then + dnl Found it + AC_MSG_RESULT(yes) + dnl Save the new -I parameter + SBLIMBASE_CPP_FLAGS="$CPPFLAGS" + LIBSBLIMBASE=-lcmpiOSBase_Common + break + fi + CPPFLAGS=$_cppflags + done + fi + CPPFLAGS=$SBLIMBASE_CPP_FLAGS + AC_SUBST(LIBSBLIMBASE) + if test "$have_SBLIMBASE" == "no"; then + AC_MSG_ERROR(no. The required SBLIM Base package is missing.) + fi + ] +) Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/indication_helper/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure.ac 8 Apr 2005 11:40:39 -0000 1.4 +++ configure.ac 19 Apr 2005 12:21:08 -0000 1.5 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) -AC_INIT(SBLIM Indication Helper, 0.3.1, sbl...@li...,sblim-indication_helper) +AC_INIT(SBLIM Indication Helper, 0.3.1a, sbl...@li...,sblim-indication_helper) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([ind_helper.c]) AM_CONFIG_HEADER(config.h) |
From: Viktor M. <mih...@us...> - 2005-04-19 11:10:35
|
Update of /cvsroot/sblim/cmpi-samples/autotools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11737 Modified Files: acinclude.m4 Log Message: Added sblimbase check to macro include file. Index: acinclude.m4 =================================================================== RCS file: /cvsroot/sblim/cmpi-samples/autotools/acinclude.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- acinclude.m4 19 Apr 2005 09:00:37 -0000 1.1 +++ acinclude.m4 19 Apr 2005 11:10:27 -0000 1.2 @@ -308,3 +308,45 @@ ] ) +dnl +dnl The main function to check for the cmpi-base common header +dnl Modifies the CPPFLAGS with the right include directory and sets +dnl the 'have_SBLIMBASE' to either 'no' or 'yes' +dnl + +AC_DEFUN([CHECK_SBLIM_BASE], + [ + AC_MSG_CHECKING(for SBLIM Base) + SBLIMBASE_CPP_FLAGS="$CPPFLAGS" + dnl Check just with the standard include paths + _CHECK_SBLIM_BASE(standard) + if test "$have_SBLIMBASE" == "yes"; then + dnl The standard include paths worked. + AC_MSG_RESULT(yes) + else + _DIRS_="/usr/include/sblim \ + /usr/local/include/sblim" + for _DIR_ in $_DIRS_ + do + _cppflags=$CPPFLAGS + _include_SBLIMBASE="$_DIR_" + CPPFLAGS="$CPPFLAGS -I$_include_SBLIMBASE" + _CHECK_SBLIM_BASE($_DIR_) + if test "$have_SBLIMBASE" == "yes"; then + dnl Found it + AC_MSG_RESULT(yes) + dnl Save the new -I parameter + SBLIMBASE_CPP_FLAGS="$CPPFLAGS" + LIBSBLIMBASE=-lcmpiOSBase_Common + break + fi + CPPFLAGS=$_cppflags + done + fi + CPPFLAGS=$SBLIMBASE_CPP_FLAGS + AC_SUBST(LIBSBLIMBASE) + if test "$have_SBLIMBASE" == "no"; then + AC_MSG_ERROR(no. The required SBLIM Base package is missing.) + fi + ] +) |
From: Viktor M. <mih...@us...> - 2005-04-19 09:00:47
|
Update of /cvsroot/sblim/cmpi-samples/autotools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9809/autotools Added Files: COPYING HOWTO.autoconfiscate acinclude.m4 autoconfiscate.sh provider-register.sh Log Message: Bug 1183805: added reference package for autoconfiscation. --- NEW FILE: acinclude.m4 --- dnl dnl $Id: acinclude.m4,v 1.1 2005/04/19 09:00:37 mihajlov Exp $ dnl dnl dnl (C) Copyright IBM Corp. 2004, 2005 dnl dnl THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE dnl ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE dnl CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. dnl dnl You can obtain a current copy of the Common Public License from dnl http://www.opensource.org/licenses/cpl1.0.php dnl dnl Author: Konrad Rzeszutek <ko...@us...> dnl Contributors: Viktor Mihajlovski <mih...@de...> dnl Date : 09/20/2004 dnl dnl dnl CHECK_CMPI: Check for CMPI headers and set the CPPFLAGS dnl with the -I<directory> dnl dnl CHECK_PEGASUS_2_3_2: Check for Pegasus 2.3.2 and set dnl the HAVE_PEGASUS_2_3_2 dnl flag dnl AC_DEFUN([CHECK_PEGASUS_2_3_2], [ AC_MSG_CHECKING(for Pegasus 2.3.2) test_CIMSERVER=`cimserver -v` if test "$test_CIMSERVER" == "2.3.2"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_3_2,1,[Defined to 1 if Pegasus 2.3.2 is used]) else AC_MSG_RESULT(no) fi ] ) dnl dnl CHECK_PEGASUS_2_4: Check for Pegasus 2.4 and set the dnl the -DPEGASUS_USE_EXPERIMENTAL_INTERFACES flag dnl AC_DEFUN([CHECK_PEGASUS_2_4], [ AC_MSG_CHECKING(for Pegasus 2.4) test_CIMSERVER=`cimserver -v` if test "$test_CIMSERVER" == "2.4"; then AC_MSG_RESULT(yes) CPPFLAGS="$CPPFLAGS -DPEGASUS_USE_EXPERIMENTAL_INTERFACES" AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_4,1,[Defined to 1 if Pegasus 2.4 is used]) else AC_MSG_RESULT(no) fi ] ) dnl dnl Helper functions dnl AC_DEFUN([_CHECK_CMPI], [ AC_MSG_CHECKING($1) AC_TRY_LINK( [ #include <cmpimacs.h> #include <cmpidt.h> #include <cmpift.h> ], [ CMPIBroker broker; CMPIStatus status = {CMPI_RC_OK, NULL}; CMPIString *s = CMNewString(&broker, "TEST", &status); ], [ have_CMPI=yes dnl AC_MSG_RESULT(yes) ], [ have_CMPI=no dnl AC_MSG_RESULT(no) ]) ]) AC_DEFUN([_CHECK_INDHELP_HEADER], [ AC_MSG_CHECKING($1) AC_TRY_COMPILE( [ #include <stdio.h> #include <ind_helper.h> ], [ CMPISelectExp *filter = NULL; ind_set_select("/root/cimv2",NULL,filter); ], [ have_INDHELP=yes dnl AC_MSG_RESULT(yes) ], [ have_INDHELP=no dnl AC_MSG_RESULT(no) ]) ]) dnl dnl The main function to check for CMPI headers dnl Modifies the CPPFLAGS with the right include directory and sets dnl the 'have_CMPI' to either 'no' or 'yes' dnl AC_DEFUN([CHECK_CMPI], [ AC_MSG_CHECKING(for CMPI headers) dnl Check just with the standard include paths CMPI_CPP_FLAGS="$CPPFLAGS" _CHECK_CMPI(standard) if test "$have_CMPI" == "yes"; then dnl The standard include paths worked. AC_MSG_RESULT(yes) else _DIRS_="/usr/include/cmpi \ /usr/local/include/cmpi \ $PEGASUS_ROOT/src/Pegasus/Provider/CMPI \ /opt/tog-pegasus/include/Pegasus/Provider/CMPI \ /usr/include/Pegasus/Provider/CMPI \ /usr/include/openwbem \ /usr/sniacimom/include" for _DIR_ in $_DIRS_ do _cppflags=$CPPFLAGS _include_CMPI="$_DIR_" CPPFLAGS="$CPPFLAGS -I$_include_CMPI" _CHECK_CMPI($_DIR_) if test "$have_CMPI" == "yes"; then dnl Found it AC_MSG_RESULT(yes) dnl Save the new -I parameter CMPI_CPP_FLAGS="$CPPFLAGS" break fi CPPFLAGS=$_cppflags done fi CPPFLAGS="$CMPI_CPP_FLAGS" if test "$have_CMPI" == "no"; then AC_MSG_ERROR(no. Sorry cannot find CMPI headers files.) fi ] ) dnl dnl The main function to check for the indication_helper header. dnl Modifies the CPPFLAGS with the right include directory and sets dnl the 'have_INDHELP' to either 'no' or 'yes' dnl AC_DEFUN([CHECK_INDHELP_HEADER], [ INDHELP_CPP_FLAGS="$CPPFLAGS" AC_MSG_CHECKING(for indication helper header) dnl Check just with the standard include paths _CHECK_INDHELP_HEADER(standard) if test "$have_INDHELP" == "yes"; then dnl The standard include paths worked. AC_MSG_RESULT(yes) else _DIRS_="/usr/include/sblim \ /usr/local/include/sblim" for _DIR_ in $_DIRS_ do _cppflags=$CPPFLAGS _include_INDHELP="$_DIR_" CPPFLAGS="$CPPFLAGS -I$_include_INDHELP" _CHECK_INDHELP_HEADER($_DIR_) if test "$have_INDHELP" == "yes"; then dnl Found it AC_MSG_RESULT(yes) dnl Save the new -I parameter INDHELP_CPP_FLAGS="$CPPFLAGS" break fi CPPFLAGS=$_cppflags done fi CPPFLAGS="$INDHELP_CPP_FLAGS" if test "$have_INDHELP" == "no"; then AC_MSG_RESULT(no) fi ] ) dnl dnl The check for the CMPI provider directory dnl Sets the PROVIDERDIR variable. dnl AC_DEFUN([CHECK_PROVIDERDIR], [ AC_MSG_CHECKING(for CMPI provider directory) _DIRS="$libdir/cmpi" save_exec_prefix=${exec_prefix} save_prefix=${prefix} if test xNONE == x${prefix}; then prefix=/usr/local fi if test xNONE == x${exec_prefix}; then exec_prefix=$prefix fi for _dir in $_DIRS do _xdir=`eval echo $_dir` AC_MSG_CHECKING( $_dir ) if test -d $_xdir ; then dnl Found it AC_MSG_RESULT(yes) if test x"$PROVIDERDIR" == x ; then PROVIDERDIR=$_dir fi break fi done if test x"$PROVIDERDIR" == x ; then PROVIDERDIR="$libdir"/cmpi AC_MSG_RESULT(implied: $PROVIDERDIR) fi exec_prefix=$save_exec_prefix prefix=$save_prefix ] ) dnl dnl The "check" for the CIM server type dnl Sets the CIMSERVER variable. dnl AC_DEFUN([CHECK_CIMSERVER], [ AC_MSG_CHECKING(for CIM servers) _SERVERS="sfcbd cimserver owcimomd" for _name in $_SERVERS do AC_MSG_CHECKING( $_name ) which $_name > /dev/null 2>&1 if test $? == 0 ; then dnl Found it AC_MSG_RESULT(yes) if test x"$CIMSERVER" == x ; then case $_name in sfcbd) CIMSERVER=sfcb;; cimserver) CIMSERVER=pegasus;; owcimomd) CIMSERVER=openwbem;; esac fi break; fi done if test x"$CIMSERVER" == x ; then CIMSERVER=sfcb AC_MSG_RESULT(implied: $CIMSERVER) fi ] ) dnl dnl The check for the SBLIM test suite dnl Sets the TESTSUITEDIR variable and the TESTSUITE conditional dnl AC_DEFUN([CHECK_TESTSUITE], [ AC_MSG_CHECKING(for SBLIM testsuite) _DIRS="$datadir/sblim-testsuite" save_exec_prefix=${exec_prefix} save_prefix=${prefix} if test xNONE == x${prefix}; then prefix=/usr/local fi if test xNONE == x${exec_prefix}; then exec_prefix=$prefix fi for _name in $_DIRS do AC_MSG_CHECKING( $_name ) _xname=`eval echo $_name` if test -x $_xname/run.sh ; then dnl Found it AC_MSG_RESULT(yes) if test x"$TESTSUITEDIR" == x; then TESTSUITEDIR=$_name fi AC_SUBST(TESTSUITEDIR) break; fi done if test x"$TESTSUITEDIR" == x ; then AC_MSG_RESULT(no) fi AM_CONDITIONAL(TESTSUITE,[test x"$TESTSUITEDIR" != x]) exec_prefix=$save_exec_prefix prefix=$save_prefix ] ) --- NEW FILE: HOWTO.autoconfiscate --- Author: Viktor Mihajlovski Date: 04/18/2005 Description: This document describes the steps necessary to autoconfiscate SBLIM packages. Rationale: Initially the SBLIM packages follow a simple approach for a configurable build process. Usually, there's a makefile per package (directory) which contains some generic rules and includes a configuration file (named env or setting.cmpi). The configuration file needs to be manually edited in order to adapt the package to a target system. Given the number of SBLIM packages and the interedependencies between some of the packages, this can become a major hurdle for unexperienced users of SBLIM. In order to overcome the difficulties we have chosen to change the build process to use the GNU Autotools (autconf, automake and libtool). Their utilization leads t several advantages: Standardized Build: The ./configure and make paradigm is widespread among the SBLIM target audiences (Distributors, Admins). Autoconfiguration: The site-specific configuration doesn't require editing files anymore. User can still override some settings via the configure command line. Automatic Packaging: Automake provides support for building correctly named file release packages. Further, it facilitates the building of RPMs out of a file release packages. Instructions: 1. Remove obsolete files - makefile.*, setting.cmpi/env, license.html also in subdirectories - contrib subdirectory 2. Add new files - AUTHORS (your name in it) - COPYRIGHT (use file from this directory) - NEWS (can be empty) - ChangeLog (can be empty) - acinclude.m4 (use file from this directory) - autoconfiscate.sh (use file from this directory) - README (if not already there) - configure.ac - Makefile.am - <packagename>.spec.in for provider packages add provider-install.sh (from this directory) 3. Tailor configure.ac to your purposes You may use cmpi-base or cmpi-fsvol as an example. Specifically you should support the PROVIDERDIR and TESTSUITEDIR configuration parameters. Run autoscan to generate a file configure.scan. This file contains checks specific for your provider: copy them over into your configure.ac. 4. Write your Makefile.am targets Again you may use cmpi-base or cmpi-fsvol as an example. Note that provider libraries go to a different location than regular shared libs. 5. Write an RPM spec(.in) file Use the spec.in in cmpi-base or cmpi-fsvol as an example. 6. Test your build process - try out different configurations (with/without testsuite, etc.) - make sure that all of the follonwing make targets work install uninstall distcheck - test your RPM build process make dist-bzip2 rpmbuild -ta <packagename>-<version>.tar.bz2 Words of Caution: Without specifying extra options during configure the packages will be installed into the /usr/local directory tree which is what the Linux Hierarchical Filesystem Standard suggests for local installs. On the other hand, the RPMs will install into the standard locations like /usr/lib, /usr/share, (/)etc. Make sure that you don't end up with a mixture of local and RPM installs as funny behaviour and hard to track down problems might be the result. --- NEW FILE: autoconfiscate.sh --- #!/bin/sh # # Script to setup autoconf/automake build environment. # Run this first to create the configure script aclocal --force && autoheader --force && libtoolize --force && automake --add-missing --force-missing && autoconf --force && echo "You may now run ./configure" --- NEW FILE: COPYING --- Common Public License Version 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. "Contributor" means any person or entity that distributes the Program. "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Program" means the Contributions distributed in accordance with this Agreement. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. When the Program is made available in source code form: a) it must be made available under this Agreement; and b) a copy of this Agreement must be included with each copy of the Program. Contributors may not remove or alter any copyright notices contained within the Program. Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. --- NEW FILE: provider-register.sh --- #!/bin/sh # $Id: provider-register.sh,v 1.1 2005/04/19 09:00:37 mihajlov Exp $ # ================================================================== # (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: Viktor Mihajlovski <mih...@de...> # Contributors: # Description: Script to install class definitions (MOFs) and registration data # for a variety of supported CIMOMs # ================================================================== function pegasus_install() { if ps -C cimserver > /dev/null 2>&1 then CIMMOF=cimmof state=active else CIMMOF=cimmofl state=inactive fi if test $1 == mofs then NAMESPACE=root/cimv2 action="Installing Schemas" else if test $1 == regs then NAMESPACE=root/PG_Interop action="Registering Providers" else echo "Invalid install mode " $1 return 1 fi fi shift echo $action with $state cimserver $CIMMOF -n $NAMESPACE $* } function sfcb_install() { if test $1 == mofs then action="Staging Schemas" shift params="$*" else if test $1 == regs then action="Staging Provider Registration -- rebuild repository and restart sfcb!" shift params="-r $*" else echo "Invalid install mode " $1 return 1 fi fi echo $action sfcbstage $params } function usage() { echo "usage: $0 [-h] -t <cimserver> [ -s mof ... | -r regfile ... ]" } args=`getopt ht:r:s: $*` if [ $? != 0 ] then usage $0 exit 1 fi set -- $args while [ -n "$1" ] do case $1 in -h) help=1; shift; break;; -t) cimserver=$2; shift 2;; -s) mofs=$2; shift 2;; -r) regs=$2; shift 2;; --) shift; break;; **) break;; esac done if [ "$help" == "1" ] then usage echo -e "\t-h display help message" echo -e "\t-t specify cimserver type (pegasus|sfcb|openwbem|sniacimom)" echo -e "\t-s specify schema mofs" echo -e "\t-r specify registration files" echo echo Use this command install schema mofs or register provider echo CIM Server Type is required, schema and registration files are echo mutually exclusive. exit 0 fi if test x$cimserver == x then usage $0 exit 1 fi if test x"$mofs" == x && test x"$regs" == x then usage $0 exit 1 fi if test x"$mofs" != x && test x"$regs" != x then usage $0 exit 1 fi if test x"$mofs" != x then mode=mofs mofs="$mofs $*" else if test x"$regs" != x then mode=regs regs="$regs $*" fi fi case $cimserver in pegasus) pegasus_install $mode $mofs $regs;; sfcb) sfcb_install $mode $mofs $regs;; openwbem) echo openwbem not yet supported && exit 1 ;; sniacimom) echo sniacimom not yet supported && exit 1 ;; **) echo "Invalid CIM Server Type " $cimserver && exit 1;; esac |
From: Viktor M. <mih...@us...> - 2005-04-19 08:53:35
|
Update of /cvsroot/sblim/cmpi-samples/autotools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5739/autotools Log Message: Directory /cvsroot/sblim/cmpi-samples/autotools added to the repository |
From: Heidi E. <hei...@us...> - 2005-04-19 08:33:51
|
Update of /cvsroot/sblim/cmpi-network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26359 Modified Files: README README.TEST Log Message: updated Installation Description Index: README =================================================================== RCS file: /cvsroot/sblim/cmpi-network/README,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- README 18 Apr 2005 12:06:56 -0000 1.5 +++ README 19 Apr 2005 08:33:42 -0000 1.6 @@ -49,18 +49,34 @@ Build Instructions ------------------ + Prerequisites ............. -- CIMOM is installed -- CMPI (package cmpi-adapter) latest version -- CIM Schema Version 2.7 and higher loaded into the CIMOM's +- CIMOM installed +- CMPI enabled CIMOM +- CIM Schema Version 2.7 or higher loaded into the CIMOM's repository -- cmpi-base package installed +- to enable Indication support: + SBLIM package indication_helper installed +- to enable Testsuite support: + SBLIM package sblim-testsuite installed +- sblim-cmpi-devel package installed +- sblim-cmpi-base package installed + Building CIMOM and CMPI for this CIMOM ......................................... -Please follow the instructions in the README.cmpi file of -the cmpi-adapter package. + +CMPI support is available for SBLIM's sfcb, OpenPegasus, OpenCimom +(former SNIA CIMOM) and OpenWBEM + +- sfcb ... CMPI as only provider interface +- Pegasus ... CMPI is part of Pegasus +- OpenCimom ... install SBLIM cmpi-adapter for snia (please follow + the instructions in the README.cmpi file of SBLIM's + cmpi-adapter package) +- OpenWBEM ... CMPI is part of OpenWBEM + Building cmpi-base .................. @@ -70,37 +86,49 @@ Building cmpi-network ..................... -In order to compile and install cmpi-network instrumentation, -the path to the CMPI/cmpi-base header files and the library -path to libCMPIAdapter.so needs to be added to the search path. -This is configured by editing the "setting.cmpi" file. Once -all the pathes are configured, do : -- make -- make install -> copy all shared libraries to the library - path of the CIMOM; copy some header files - to the inlcude path (necessary if other - instrumentation packages use tool functions - of cmpi-network) -- make clean -> to delete all shared libs in this source - directory +This package is now GNU autotool enabled, refer to the file +named INSTALL for generic instructions. + +The generated configure script tries to determine where the CMPI header files +are located. For this purpose it searches a set of well-known locations. +The "canonical" location is /usr/include/cmpi or /usr/local/include/cmpi, +depending on how configure is invoked. + +Further, configure "determines" where providers are to be installed. Actually, +there's no detection logic. The provider directory will always be +/usr/lib/cmpi or /usr/local/lib/cmpi. If a CIM server requires a particular +directory this can be selected by specifying the PROVIDERDIR variable. + +And finally, configure tries to find out which CIM server type is being used. +This is necessary in order to select the appropriate schema and provider +registration technique. If the CIM server is not or incorrectly identified, +it is possible to specify it via the CIMSERVER variable. +Supported values are pegasus, sfcb, openwbem and sniacimom. + +For instance, in order to configure for a locally installed Pegasus you can +issue the following command: +./configure CIMSERVER=pegasus PROVIDERDIR=$PEGASUS_HOME/lib + + Load Schema into CIMOM's repository ................................... -with Pegasus : -.............. +with Pegasus/sfcb : +................. The loading and registering of the classes/associations and -their provider is done during the "make install" process. +their provider is done during the "make postinstall". with OpenCimom/SNIA CIMOM : ........................... Start the cimbrowser (/usr/sniacimom/bin). Load the schema -file Linux_Network.mof with "File" -> "Reload Mof" into the +file Linux_Base.mof with "File" -> "Reload Mof" into the namespace root/cimv2. Before at least CIM Core and System schemata have to be loaded into the repository. + Common Libraries ---------------- @@ -153,4 +181,4 @@ of providers. How to set up and drive the test is described in the -README file of the test sub directory. +README.TEST file. Index: README.TEST =================================================================== RCS file: /cvsroot/sblim/cmpi-network/README.TEST,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README.TEST 18 Apr 2005 12:06:56 -0000 1.1 +++ README.TEST 19 Apr 2005 08:33:42 -0000 1.2 @@ -7,28 +7,20 @@ Prerequisites ............. +- sblim-testsuite package propertly installed +- sblim-cmpi-base package propertly installed - sblim-cmpi-network package propertly installed -- testsuite package - - -Pepare Test -........... - -edit the makefile and set the path to your testsuite path Install Configuration Files ........................... -make test -... to test the existence of a testsuite directory - -make install -... to install the input files into the corresponding testsuite -directories +make install +... also installs the configuration file into the testsuite directory +as indicated by configure make uninstall -... to delete the cmpi-network specific files out of the testsuite +... also deletes the cmpi-network specific files out of the testsuite directories @@ -36,4 +28,4 @@ ........ Run the test in the testsuite dir by executing -. test-cmpi-network.sh +./test-cmpi-network.sh |
From: Heidi E. <hei...@us...> - 2005-04-18 12:10:56
|
Update of /cvsroot/sblim/cmpi-network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4564 Removed Files: license.html Log Message: bug# 1183805: autoconfiscate all provider packages - cmpi-network done --- license.html DELETED --- |
From: Heidi E. <hei...@us...> - 2005-04-18 12:07:41
|
Update of /cvsroot/sblim/cmpi-network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2066 Modified Files: README Added Files: AUTHORS COPYING ChangeLog Makefile.am NEWS README.TEST acinclude.m4 autoconfiscate.sh configure.ac provider-register.sh sblim-cmpi-network.spec.in Removed Files: CHANGE.LOG makefile setting.cmpi Log Message: bug# 1183805: autoconfiscate all provider packages - cmpi-network done --- NEW FILE: sblim-cmpi-network.spec.in --- # # $Id: sblim-cmpi-network.spec.in,v 1.1 2005/04/18 12:06:56 heidineu Exp $ # # Package spec for @PACKAGE@ # BuildRoot: /var/tmp/buildroot Summary: SBLIM Network Instrumentation Name: @PACKAGE_TARNAME@ Version: @PACKAGE_VERSION@ Release: @CIMSERVER@ Group: Systems Management/Base License: Common Public License 1.0 Source0: http://prdownloads.sourceforge.net/sblim/%{name}-%{version}.tar.bz2 BuildRequires: cmpi-devel BuildRequires: sblim-cmpi-base-devel Requires: cimserver sblim-cmpi-base %Description Standards Based Linux Instrumentation Network Providers %Package devel Summary: SBLIM Network Instrumentation Header Development Files Group: Systems Management/Base Requires: %{name} = %{version} %Description devel SBLIM Base Network Development Package %Package test Summary: SBLIM Network Instrumentation Testcases Group: Systems Management/Base Requires: %{name} = %{version} Requires: sblim-testsuite %Description test SBLIM Base Network Testcase Files for SBLIM Testsuite %prep %setup -n %{name}-%{version} export PATCH_GET=0 #%patch0 -p0 %build %configure TESTSUITEDIR=%{_datadir}/sblim-testsuite make %clean if [ `id -ur` != 0 ] then # paranoia check rm -rf $RPM_BUILD_ROOT fi %install if [ `id -ur` != 0 ] then # paranoia check rm -rf $RPM_BUILD_ROOT fi make DESTDIR=$RPM_BUILD_ROOT install # remove unused libtool files rm -f $RPM_BUILD_ROOT/%{_libdir}/*a rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*a %post # Register Schema and Provider - this is higly provider specific %define SCHEMA %{_datadir}/%{name}/Linux_Network.mof %define REGISTRATION_pegasus %{_datadir}/%{name}/Linux_NetworkRegister.mof %define REGISTRATION_sfcb %{_datadir}/%{name}/Linux_Network.sfcb.reg %{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \ -s %{SCHEMA} > /dev/null %{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \ -r %{REGISTRATION_@CIMSERVER@} > /dev/null /sbin/ldconfig %postun /sbin/ldconfig %files %defattr(-,root,root) %{_datadir}/%{name} %{_datadir}/doc/%{name}-%{version} %{_libdir}/*.so* %{_libdir}/cmpi/*.so* %files devel %defattr(-,root,root) %{_includedir} %files test %defattr(-,root,root) %{_datadir}/sblim-testsuite --- NEW FILE: ChangeLog --- // =================================================================== // new in version 1.2.4 : * update to Pegasus' CIMOMINC path in setting.cmpi * support for standalone build (RPM) // ================================================================== // new in version 1.2.5 : * fixed non initialized IP addess and netmask values * test subdirectory : - test-cmpi-network script accepts userID and password - fixed wrong count of instances in Linux_IPProtocolEndpoint.system // =================================================================== // new in version 1.3 : * support for property list filter on EnumInstances and GetInstance // =================================================================== // new in version 1.3.1 : * bug# 1158159: fixed parsing of /proc/net/dev for systems with high amount of network traffic // =================================================================== // new in version 1.3.2 : * feature request# 1182259: set MAC address to property PermanentAddress of Linux_EthernetPort // =================================================================== // new in version 1.3.3 : * bug# 1183805: Autoconfiscate all Provider Packages // =================================================================== --- NEW FILE: AUTHORS --- The cmpi-network provider package was originally written by Heidi Neumann <hei...@de...>. --- makefile DELETED --- --- CHANGE.LOG DELETED --- --- NEW FILE: acinclude.m4 --- dnl dnl $Id: acinclude.m4,v 1.1 2005/04/18 12:06:56 heidineu Exp $ dnl dnl dnl (C) Copyright IBM Corp. 2004, 2005 dnl dnl THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE dnl ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE dnl CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. dnl dnl You can obtain a current copy of the Common Public License from dnl http://www.opensource.org/licenses/cpl1.0.php dnl dnl Author: Konrad Rzeszutek <ko...@us...> dnl Contributors: Viktor Mihajlovski <mih...@de...> dnl Date : 09/20/2004 dnl dnl dnl CHECK_CMPI: Check for CMPI headers and set the CPPFLAGS dnl with the -I<directory> dnl dnl CHECK_PEGASUS_2_3_2: Check for Pegasus 2.3.2 and set dnl the HAVE_PEGASUS_2_3_2 dnl flag dnl AC_DEFUN([CHECK_PEGASUS_2_3_2], [ AC_MSG_CHECKING(for Pegasus 2.3.2) test_CIMSERVER=`cimserver -v` if test "$test_CIMSERVER" == "2.3.2"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_3_2,1,[Defined to 1 if Pegasus 2.3.2 is used]) else AC_MSG_RESULT(no) fi ] ) dnl dnl CHECK_PEGASUS_2_4: Check for Pegasus 2.4 and set the dnl the -DPEGASUS_USE_EXPERIMENTAL_INTERFACES flag dnl AC_DEFUN([CHECK_PEGASUS_2_4], [ AC_MSG_CHECKING(for Pegasus 2.4) test_CIMSERVER=`cimserver -v` if test "$test_CIMSERVER" == "2.4"; then AC_MSG_RESULT(yes) CPPFLAGS="$CPPFLAGS -DPEGASUS_USE_EXPERIMENTAL_INTERFACES" AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_4,1,[Defined to 1 if Pegasus 2.4 is used]) else AC_MSG_RESULT(no) fi ] ) dnl dnl Helper functions dnl AC_DEFUN([_CHECK_CMPI], [ AC_MSG_CHECKING($1) AC_TRY_LINK( [ #include <cmpimacs.h> #include <cmpidt.h> #include <cmpift.h> ], [ CMPIBroker broker; CMPIStatus status = {CMPI_RC_OK, NULL}; CMPIString *s = CMNewString(&broker, "TEST", &status); ], [ have_CMPI=yes dnl AC_MSG_RESULT(yes) ], [ have_CMPI=no dnl AC_MSG_RESULT(no) ]) ]) AC_DEFUN([_CHECK_SBLIM_BASE], [ AC_MSG_CHECKING($1) _ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -lcmpiOSBase_Common" AC_TRY_LINK( [ #include <OSBase_Common.h> ], [ get_system_name(); ], [ have_SBLIMBASE=yes LDFLAGS=$_ldflags dnl AC_MSG_RESULT(yes) ], [ have_SBLIMBASE=no LDFLAGS=$_ldflags dnl AC_MSG_RESULT(no) ]) ]) dnl dnl The main function to check for CMPI headers dnl Modifies the CPPFLAGS with the right include directory and sets dnl the 'have_CMPI' to either 'no' or 'yes' dnl AC_DEFUN([CHECK_CMPI], [ AC_MSG_CHECKING(for CMPI headers) CMPI_CPP_FLAGS="$CPPFLAGS" dnl Check just with the standard include paths _CHECK_CMPI(standard) if test "$have_CMPI" == "yes"; then dnl The standard include paths worked. AC_MSG_RESULT(yes) else _DIRS_="/usr/include/cmpi \ /usr/local/include/cmpi \ $PEGASUS_ROOT/src/Pegasus/Provider/CMPI \ /opt/tog-pegasus/include/Pegasus/Provider/CMPI \ /usr/include/Pegasus/Provider/CMPI \ /usr/include/openwbem \ /usr/sniacimom/include" for _DIR_ in $_DIRS_ do _cppflags=$CPPFLAGS _include_CMPI="$_DIR_" CPPFLAGS="$CPPFLAGS -I$_include_CMPI" _CHECK_CMPI($_DIR_) if test "$have_CMPI" == "yes"; then dnl Found it AC_MSG_RESULT(yes) dnl Save the new -I parameter CMPI_CPP_FLAGS="$CPPFLAGS" break fi CPPFLAGS=$_cppflags done fi CPPFLAGS="$CMPI_CPP_FLAGS" if test "$have_CMPI" == "no"; then AC_MSG_ERROR(no. Sorry cannot find CMPI headers files.) fi ] ) dnl dnl The main function to check for the cmpi-base common header dnl Modifies the CPPFLAGS with the right include directory and sets dnl the 'have_SBLIMBASE' to either 'no' or 'yes' dnl AC_DEFUN([CHECK_SBLIM_BASE], [ AC_MSG_CHECKING(for SBLIM Base) SBLIMBASE_CPP_FLAGS="$CPPFLAGS" dnl Check just with the standard include paths _CHECK_SBLIM_BASE(standard) if test "$have_SBLIMBASE" == "yes"; then dnl The standard include paths worked. AC_MSG_RESULT(yes) else _DIRS_="/usr/include/sblim \ /usr/local/include/sblim" for _DIR_ in $_DIRS_ do _cppflags=$CPPFLAGS _include_SBLIMBASE="$_DIR_" CPPFLAGS="$CPPFLAGS -I$_include_SBLIMBASE" _CHECK_SBLIM_BASE($_DIR_) if test "$have_SBLIMBASE" == "yes"; then dnl Found it AC_MSG_RESULT(yes) dnl Save the new -I parameter SBLIMBASE_CPP_FLAGS="$CPPFLAGS" LIBSBLIMBASE=-lcmpiOSBase_Common break fi CPPFLAGS=$_cppflags done fi CPPFLAGS=$SBLIMBASE_CPP_FLAGS AC_SUBST(LIBSBLIMBASE) if test "$have_SBLIMBASE" == "no"; then AC_MSG_ERROR(no. The required SBLIM Base package is missing.) fi ] ) dnl dnl The check for the CMPI provider directory dnl Sets the PROVIDERDIR variable. dnl AC_DEFUN([CHECK_PROVIDERDIR], [ AC_MSG_CHECKING(for CMPI provider directory) _DIRS="$libdir/cmpi" for _dir in $_DIRS do AC_MSG_CHECKING( $_dir ) if test -d $_dir ; then dnl Found it AC_MSG_RESULT(yes) if test x"$PROVIDERDIR" == x ; then PROVIDERDIR=$_dir fi break fi done if test x"$PROVIDERDIR" == x ; then PROVIDERDIR="$libdir"/cmpi AC_MSG_RESULT(implied: $PROVIDERDIR) fi ] ) dnl dnl The "check" for the CIM server type dnl Sets the CIMSERVER variable. dnl AC_DEFUN([CHECK_CIMSERVER], [ AC_MSG_CHECKING(for CIM servers) _SERVERS="sfcbd cimserver owcimomd" for _name in $_SERVERS do AC_MSG_CHECKING( $_name ) which $_name > /dev/null 2>&1 if test $? == 0 ; then dnl Found it AC_MSG_RESULT(yes) if test x"$CIMSERVER" == x ; then case $_name in sfcbd) CIMSERVER=sfcb;; cimserver) CIMSERVER=pegasus;; owcimomd) CIMSERVER=openwbem;; esac fi break; fi done if test x"$CIMSERVER" == x ; then CIMSERVER=sfcb AC_MSG_RESULT(implied: $CIMSERVER) fi ] ) dnl dnl The check for the SBLIM test suite dnl Sets the TESTSUITEDIR variable and the TESTSUITE conditional dnl AC_DEFUN([CHECK_TESTSUITE], [ AC_MSG_CHECKING(for SBLIM testsuite) _DIRS="$datadir/sblim-testsuite" save_exec_prefix=${exec_prefix} save_prefix=${prefix} if test xNONE == x${prefix}; then prefix=/usr/local fi if test xNONE == x${exec_prefix}; then exec_prefix=$prefix fi for _name in $_DIRS do AC_MSG_CHECKING( $_name ) _xname=`eval echo $_name` if test -x $_xname/run.sh ; then dnl Found it AC_MSG_RESULT(yes) if test x"$TESTSUITEDIR" == x; then TESTSUITEDIR=$_name fi AC_SUBST(TESTSUITEDIR) break; fi done if test x"$TESTSUITEDIR" == x ; then AC_MSG_RESULT(no) fi AM_CONDITIONAL(TESTSUITE,[test x"$TESTSUITEDIR" != x]) exec_prefix=$save_exec_prefix prefix=$save_prefix ] ) --- NEW FILE: configure.ac --- # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(SBLIM BaseOS Network Providers, 1.3.3am, sbl...@li...,sblim-cmpi-network) AC_CONFIG_SRCDIR([OSBase_CommonNetwork.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE AC_CANONICAL_HOST case $host_cpu in i*86) HW=INTEL;; s390*) HW=S390;; ppc*) HW=PPC;; x86_64) HW=X86_64;; ia64) HW=IA64;; **) HW=GENERIC;; esac # Configuration Arguments AC_ARG_VAR([TESTSUITEDIR],[the directory where the SBLIM testsuite resides.]) AC_ARG_VAR([PROVIDERDIR],[the directory where the CMPI providers will be installed.]) AC_ARG_VAR([CIMSERVER],[the target CIM server (pegasus|sfcb|openwbem|sniacimom).]) # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL # Check for required CMPI header files (defined in acinclude.m4) CHECK_CMPI # Check for required libraries (defined in acinclude.m4) CHECK_PROVIDERDIR # Check for CIM Server (defined in acinclude.m4) CHECK_CIMSERVER # Check for SBLIM Base CHECK_SBLIM_BASE # Check for SBLIM Testsuite CHECK_TESTSUITE # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST # Checks for library functions. AC_FUNC_GETMNTENT AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([memset strcasecmp strchr strdup strstr]) AC_CONFIG_FILES([Makefile sblim-cmpi-network.spec]) if test x"$TESTSUITEDIR" == x; then TESTSUITE_SUPPORT=Disabled else TESTSUITE_SUPPORT=Enabled fi # Display configuration options echo "-------------------------------------------------------" echo "Configuration for $PACKAGE complete." echo "" echo "The following configuration options have been selected:" echo "CIMSERVER: " $CIMSERVER echo "PROVIDERDIR: " $PROVIDERDIR echo "CPPFLAGS:" $CPPFLAGS echo "Test Suite Support" $TESTSUITE_SUPPORT if test x"$TESTSUITEDIR" != x; then echo "TESTSUITEDIR " $TESTSUITEDIR fi echo "-------------------------------------------------------" AC_OUTPUT echo "You may now run make" --- NEW FILE: README.TEST --- Test Environment for SBLIM Network Instrumentation The SBLIM project offers a Test Suite to perform tests against the provider implementation and consistence tests against system values. Prerequisites ............. - sblim-cmpi-network package propertly installed - testsuite package Pepare Test ........... edit the makefile and set the path to your testsuite path Install Configuration Files ........................... make test ... to test the existence of a testsuite directory make install ... to install the input files into the corresponding testsuite directories make uninstall ... to delete the cmpi-network specific files out of the testsuite directories Run Test ........ Run the test in the testsuite dir by executing . test-cmpi-network.sh --- NEW FILE: autoconfiscate.sh --- #!/bin/sh # # Script to setup autoconf/automake build environment. # Run this first to create the configure script aclocal --force && autoheader --force && libtoolize --force && automake --add-missing --force-missing && autoconf --force && echo "You may now run ./configure" --- NEW FILE: COPYING --- Common Public License Version 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. "Contributor" means any person or entity that distributes the Program. "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Program" means the Contributions distributed in accordance with this Agreement. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. When the Program is made available in source code form: a) it must be made available under this Agreement; and b) a copy of this Agreement must be included with each copy of the Program. Contributors may not remove or alter any copyright notices contained within the Program. Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. --- setting.cmpi DELETED --- Index: README =================================================================== RCS file: /cvsroot/sblim/cmpi-network/README,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- README 23 Mar 2004 10:41:48 -0000 1.4 +++ README 18 Apr 2005 12:06:56 -0000 1.5 @@ -46,8 +46,8 @@ -CIMOM Build Instructions ------------------------- +Build Instructions +------------------ Prerequisites ............. --- NEW FILE: NEWS --- --- NEW FILE: Makefile.am --- # $Id: Makefile.am,v 1.1 2005/04/18 12:06:55 heidineu Exp $ # ================================================================== # (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: Viktor Mihajlovski <mih...@de...> # Contributors: Dr. Gareth S. Bestor <bes...@us...> # Description: Automake input file for OS Base Providers # ================================================================== # SBLIM Include Directory sblimincdir = $(includedir)/sblim # Start from an empty extra distribution file list EXTRA_DIST= # docdir defines where the documentation goes docdir=$(datadir)/doc/$(PACKAGE)-$(VERSION) # # Automake instructions for documentation # doc_DATA=README AUTHORS COPYING # ADD EXTRA DOC FILES IF PRESENT doc_DATA+=DEBUG EXTRA_DIST+=DEBUG # providerdir defines where provider libraries will be installed (@PROVIDERDIR@ is set by the configure script). providerdir = @PROVIDERDIR@ # # Automake instructions for main dir # # OSBase CMPI provider libraries provider_LTLIBRARIES = libcmpiOSBase_EthernetPortProvider.la \ libcmpiOSBase_TokenRingPortProvider.la \ libcmpiOSBase_LocalLoopbackPortProvider.la \ libcmpiOSBase_IPProtocolEndpointProvider.la \ libcmpiOSBase_CSNetworkPortProvider.la \ libcmpiOSBase_NetworkPortImplementsIPEndpointProvider.la # Ethernet Port libcmpiOSBase_EthernetPortProvider_la_SOURCES = \ cmpiOSBase_EthernetPortProvider.c \ cmpiOSBase_EthernetPort.c libcmpiOSBase_EthernetPortProvider_la_LIBADD = \ -lOSBase_CommonNetwork # Token Ring Port libcmpiOSBase_TokenRingPortProvider_la_SOURCES = \ cmpiOSBase_TokenRingPortProvider.c \ cmpiOSBase_TokenRingPort.c libcmpiOSBase_TokenRingPortProvider_la_LIBADD = \ -lOSBase_CommonNetwork # Local Loopback Port libcmpiOSBase_LocalLoopbackPortProvider_la_SOURCES = \ cmpiOSBase_LocalLoopbackPortProvider.c \ cmpiOSBase_LocalLoopbackPort.c libcmpiOSBase_LocalLoopbackPortProvider_la_LIBADD = \ -lOSBase_CommonNetwork # IP Protocol Endpoint libcmpiOSBase_IPProtocolEndpointProvider_la_SOURCES = \ cmpiOSBase_IPProtocolEndpointProvider.c \ cmpiOSBase_IPProtocolEndpoint.c \ OSBase_IPProtocolEndpoint.c libcmpiOSBase_IPProtocolEndpointProvider_la_LIBADD = \ -lOSBase_CommonNetwork # CS Network Port (Association) libcmpiOSBase_CSNetworkPortProvider_la_SOURCES = \ cmpiOSBase_CSNetworkPortProvider.c libcmpiOSBase_CSNetworkPortProvider_la_LIBADD = \ -lOSBase_CommonNetwork # Network Port Implements IP Endpoint (Association) libcmpiOSBase_NetworkPortImplementsIPEndpointProvider_la_SOURCES = \ cmpiOSBase_NetworkPortImplementsIPEndpointProvider.c \ cmpiOSBase_NetworkPortImplementsIPEndpoint.c libcmpiOSBase_NetworkPortImplementsIPEndpointProvider_la_LIBADD = \ -lOSBase_CommonNetwork # OSBase support utility libraries lib_LTLIBRARIES = libOSBase_CommonNetwork.la libOSBase_CommonNetwork_la_SOURCES=OSBase_CommonNetwork.c libOSBase_CommonNetwork_la_LIBADD=@LIBSBLIMBASE@ # Installable Header Files sbliminc_HEADERS = OSBase_CommonNetwork.h # Non-Installable Header Files noinst_HEADERS = OSBase_IPProtocolEndpoint.h \ cmpiOSBase_EthernetPort.h \ cmpiOSBase_TokenRingPort.h \ cmpiOSBase_LocalLoopbackPort.h \ cmpiOSBase_IPProtocolEndpoint.h \ cmpiOSBase_NetworkPortImplementsIPEndpoint.h # We must explicity add the RPM spec file to the distribution package EXTRA_DIST+=$(PACKAGE).spec # # Automake instructions for ./mof subdir # SCHEMAS=mof/Linux_Network.mof REGISTRATIONS.pegasus=mof/Linux_NetworkRegister.mof REGISTRATIONS.sfcb=mof/Linux_Network.sfcb.reg REGISTRATIONS.openwbem= REGISTRATIONS.sniacimom= REGISTRATIONS=$(REGISTRATIONS.pegasus) \ $(REGISTRATIONS.sfcb) \ $(REGISTRATIONS.openwbem) \ $(REGISTRATIONS.sniacimom) # We must explicity add all the schema files to the distribution package pkgdata_DATA=$(SCHEMAS) $(REGISTRATIONS) pkgdata_SCRIPTS=provider-register.sh EXTRA_DIST+=mof $(pkgdata_SCRIPTS) # Register the provider(s) and class definition(s) to the current CIM server/CIMOM postinstall: test x"$(SCHEMAS)" != x && \ sh provider-register.sh -t @CIMSERVER@ -s $(SCHEMAS) test x"$(REGISTRATIONS.@CIMSERVER@)" != x && \ sh provider-register.sh -t @CIMSERVER@ -r $(REGISTRATIONS.@CIMSERVER@) dist-hook: test -d "$(distdir)" && rm -rf `find $(distdir) -type d -name CVS` # # Automake instructions for ./test subdir # EXTRA_DIST+=test README.TEST if TESTSUITE testsuitedir=@TESTSUITEDIR@ testsuitesystemdir=@TESTSUITEDIR@/system/linux testsuitecimdir=@TESTSUITEDIR@/cim testsuite_SCRIPTS=test/test-cmpi-network.sh testsuitesystem_DATA=test/system/linux/Linux_CSNetworkPort.system \ test/system/linux/Linux_EthernetPort.system \ test/system/linux/Linux_IPProtocolEndpoint.system \ test/system/linux/Linux_LocalLoopbackPort.system \ test/system/linux/Linux_TokenRingPort.system testsuitesystem_SCRIPTS=test/system/linux/Linux_EthernetPort.pl \ test/system/linux/Linux_IPProtocolEndpoint.pl \ test/system/linux/Linux_LocalLoopbackPort.pl \ test/system/linux/Linux_TokenRingPort.pl testsuitecim_DATA=test/cim/Linux_CSNetworkPort.cim \ test/cim/Linux_EthernetPort.cim \ test/cim/Linux_IPProtocolEndpoint.cim \ test/cim/Linux_LocalLoopbackPort.cim \ test/cim/Linux_NetworkPortImplementsIPEndpoint.cim \ test/cim/Linux_TokenRingPort.cim runtest: install cd $(DESTDIR)$(TESTSUITEDIR) && ./test-cmpi-network.sh doc_DATA+=README.TEST endif --- NEW FILE: provider-register.sh --- #!/bin/sh # $Id: provider-register.sh,v 1.1 2005/04/18 12:06:56 heidineu Exp $ # ================================================================== # (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: Viktor Mihajlovski <mih...@de...> # Contributors: # Description: Script to install class definitions (MOFs) and registration data # for a variety of supported CIMOMs # ================================================================== function pegasus_install() { if ps -C cimserver > /dev/null 2>&1 then CIMMOF=cimmof state=active else CIMMOF=cimmofl state=inactive fi if test $1 == mofs then NAMESPACE=root/cimv2 action="Installing Schemas" else if test $1 == regs then NAMESPACE=root/PG_Interop action="Registering Providers" else echo "Invalid install mode " $1 return 1 fi fi shift echo $action with $state cimserver $CIMMOF -n $NAMESPACE $* } function sfcb_install() { if test $1 == mofs then action="Staging Schemas" shift params="$*" else if test $1 == regs then action="Staging Provider Registration -- rebuild repository and restart sfcb!" shift params="-r $*" else echo "Invalid install mode " $1 return 1 fi fi echo $action sfcbstage $params } function usage() { echo "usage: $0 [-h] -t <cimserver> [ -s mof ... | -r regfile ... ]" } args=`getopt ht:r:s: $*` if [ $? != 0 ] then usage $0 exit 1 fi set -- $args while [ -n "$1" ] do case $1 in -h) help=1; shift; break;; -t) cimserver=$2; shift 2;; -s) mofs=$2; shift 2;; -r) regs=$2; shift 2;; --) shift; break;; **) break;; esac done if [ "$help" == "1" ] then usage echo -e "\t-h display help message" echo -e "\t-t specify cimserver type (pegasus|sfcb|openwbem|sniacimom)" echo -e "\t-s specify schema mofs" echo -e "\t-r specify registration files" echo echo Use this command install schema mofs or register provider echo CIM Server Type is required, schema and registration files are echo mutually exclusive. exit 0 fi if test x$cimserver == x then usage $0 exit 1 fi if test x"$mofs" == x && test x"$regs" == x then usage $0 exit 1 fi if test x"$mofs" != x && test x"$regs" != x then usage $0 exit 1 fi if test x"$mofs" != x then mode=mofs mofs="$mofs $*" else if test x"$regs" != x then mode=regs regs="$regs $*" fi fi case $cimserver in pegasus) pegasus_install $mode $mofs $regs;; sfcb) sfcb_install $mode $mofs $regs;; openwbem) echo openwbem not yet supported && exit 1 ;; sniacimom) echo sniacimom not yet supported && exit 1 ;; **) echo "Invalid CIM Server Type " $cimserver && exit 1;; esac |
From: Heidi E. <hei...@us...> - 2005-04-18 12:07:10
|
Update of /cvsroot/sblim/cmpi-network/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2066/test Removed Files: README makefile Log Message: bug# 1183805: autoconfiscate all provider packages - cmpi-network done --- README DELETED --- --- makefile DELETED --- |
From: Heidi E. <hei...@us...> - 2005-04-18 12:07:08
|
Update of /cvsroot/sblim/cmpi-network/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2066/mof Added Files: Linux_Network.sfcb.reg Linux_NetworkRegister.mof Removed Files: Linux_NetworkRegistration.mof makefile.pegasus makefile.standalone Log Message: bug# 1183805: autoconfiscate all provider packages - cmpi-network done --- NEW FILE: Linux_Network.sfcb.reg --- [Linux_EthernetPort] provider: OSBase_EthernetPortProvider location: cmpiOSBase_EthernetPortProvider type: instance namespace: root/cimv2 # [Linux_TokenRingPort] provider: OSBase_TokenRingPortProvider location: cmpiOSBase_TokenRingPortProvider type: instance namespace: root/cimv2 # [Linux_LocalLoopbackPort] provider: OSBase_LocalLoopbackPortProvider location: cmpiOSBase_LocalLoopbackPortProvider type: instance namespace: root/cimv2 # [Linux_IPProtocolEndpoint] provider: OSBase_IPProtocolEndpointProvider location: cmpiOSBase_IPProtocolEndpointProvider type: instance namespace: root/cimv2 # [Linux_CSNetworkPort] provider: OSBase_CSNetworkPortProvider location: cmpiOSBase_CSNetworkPortProvider type: instance association namespace: root/cimv2 # [Linux_NetworkPortImplementsIPEndpoint] provider: OSBase_NetworkPortImplementsIPEndpointProvider location: cmpiOSBase_NetworkPortImplementsIPEndpointProvider type: instance association namespace: root/cimv2 --- Linux_NetworkRegistration.mof DELETED --- --- makefile.standalone DELETED --- --- makefile.pegasus DELETED --- --- NEW FILE: Linux_NetworkRegister.mof --- // // Linux_NetworkRegistration.mof // // (C) Copyright IBM Corp. 2002 // // 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://oss.software.ibm.com/developerworks/opensource/license-cpl.html // // Author: Heidi Neumann <hei...@de...> // Contributors: // // Description: // CIM classes for Linux Network Instrumentation // #pragma locale ("en_US") #pragma namespace ("root/PG_InterOp") // =================================================================== // Linux_IPProtocolEndpoint // =================================================================== instance of PG_ProviderModule { Name = "OSBase_IPProtocolEndpointProviderModule"; //The library name on disk Location = "cmpiOSBase_IPProtocolEndpointProvider"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_IPProtocolEndpointProviderModule"; // The provider name as referenced in the code Name = "OSBase_IPProtocolEndpointProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_IPProtocolEndpointProviderModule"; //The provider name as defined in PG_Provider ProviderName = "OSBase_IPProtocolEndpointProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_IPProtocolEndpoint"; Namespaces = {"root/cimv2"}; ProviderType = { 2 }; // Instance SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; // =================================================================== // Linux_LocalLoopbackPort // =================================================================== instance of PG_ProviderModule { Name = "OSBase_LocalLoopbackPortProviderModule"; //The library name on disk Location = "cmpiOSBase_LocalLoopbackPortProvider"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_LocalLoopbackPortProviderModule"; // The provider name as referenced in the code Name = "OSBase_LocalLoopbackPortProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_LocalLoopbackPortProviderModule"; //The provider name as defined in PG_Provider ProviderName = "OSBase_LocalLoopbackPortProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_LocalLoopbackPort"; Namespaces = {"root/cimv2"}; ProviderType = { 2,5 }; // Instance, Method SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; // =================================================================== // Linux_EthernetPort // =================================================================== instance of PG_ProviderModule { Name = "OSBase_EthernetPortProviderModule"; //The library name on disk Location = "cmpiOSBase_EthernetPortProvider"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_EthernetPortProviderModule"; // The provider name as referenced in the code Name = "OSBase_EthernetPortProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_EthernetPortProviderModule"; //The provider name as defined in PG_Provider ProviderName = "OSBase_EthernetPortProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_EthernetPort"; Namespaces = {"root/cimv2"}; ProviderType = { 2,5 }; // Instance, Method SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; // =================================================================== // Linux_TokenRingPort // =================================================================== instance of PG_ProviderModule { Name = "OSBase_TokenRingPortProviderModule"; //The library name on disk Location = "cmpiOSBase_TokenRingPortProvider"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_TokenRingPortProviderModule"; // The provider name as referenced in the code Name = "OSBase_TokenRingPortProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_TokenRingPortProviderModule"; //The provider name as defined in PG_Provider ProviderName = "OSBase_TokenRingPortProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_TokenRingPort"; Namespaces = {"root/cimv2"}; ProviderType = { 2,5 }; // Instance, Method SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; // ------------------------------------------------------------------- // ******************************************************************* // Associations // ******************************************************************* // ------------------------------------------------------------------- // =================================================================== // Linux_CSNetworkPort // =================================================================== instance of PG_ProviderModule { Name = "OSBase_CSNetworkPortProviderModule"; //The library name on disk Location = "cmpiOSBase_CSNetworkPortProvider"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_CSNetworkPortProviderModule"; // The provider name as referenced in the code Name = "OSBase_CSNetworkPortProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_CSNetworkPortProviderModule"; //The provider name as defined in PG_Provider ProviderName = "OSBase_CSNetworkPortProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_CSNetworkPort"; Namespaces = {"root/cimv2"}; ProviderType = { 2,3 }; // Instance, Association SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; // =================================================================== // Linux_PortImplementsEndpoint // =================================================================== instance of PG_ProviderModule { Name = "OSBase_NetworkPortImplementsIPEndpointProviderModule"; //The library name on disk Location = "cmpiOSBase_NetworkPortImplementsIPEndpointProvider"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_NetworkPortImplementsIPEndpointProviderModule"; // The provider name as referenced in the code Name = "OSBase_NetworkPortImplementsIPEndpointProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "OSBase_NetworkPortImplementsIPEndpointProviderModule"; //The provider name as defined in PG_Provider ProviderName = "OSBase_NetworkPortImplementsIPEndpointProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_NetworkPortImplementsIPEndpoint"; Namespaces = {"root/cimv2"}; ProviderType = { 2,3 }; // Instance, Association SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; |