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: Adrian S. <a3s...@us...> - 2005-04-27 11:11:05
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2174 Modified Files: cimXmlParser.c cimXmlRequest.c classProvider.c providerDrv.c providerMgr.h Log Message: Added deleteClass support Index: cimXmlRequest.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlRequest.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- cimXmlRequest.c 26 Apr 2005 21:58:47 -0000 1.8 +++ cimXmlRequest.c 27 Apr 2005 11:10:41 -0000 1.9 @@ -551,6 +551,53 @@ _SFCB_RETURN(ctxErrResponse(hdr, &binCtx,0)); } +static RespSegments deleteClass(CimXmlRequestContext * ctx, RequestHdr * hdr) +{ + CMPIObjectPath *path; + int irc; + BinRequestContext binCtx; + BinResponseHdr *resp; + DeleteClassReq sreq; + + _SFCB_ENTER(TRACE_CIMXMLPROC, "deleteClass"); + + memset(&binCtx,0,sizeof(BinRequestContext)); + XtokDeleteClass *req = (XtokDeleteClass *) hdr->cimRequest; + + memset(&sreq,0,sizeof(sreq)); + sreq.operation=OPS_DeleteClass; + sreq.count=2; + + path = NewCMPIObjectPath(req->op.nameSpace.data, req->op.className.data, NULL); + sreq.objectPath = setObjectPathMsgSegment(path); + sreq.principal = setCharsMsgSegment(ctx->principal); + + binCtx.oHdr = (OperationHdr *) req; + binCtx.bHdr = &sreq.hdr; + binCtx.bHdr->flags = 0; + binCtx.rHdr = hdr; + binCtx.bHdrSize = sizeof(sreq); + binCtx.chunkedMode=binCtx.xmlAs=binCtx.noResp=0; + binCtx.pAs=NULL; + + _SFCB_TRACE(1, ("--- Getting Provider context")); + irc = getProviderContext(&binCtx, (OperationHdr *) req); + + _SFCB_TRACE(1, ("--- Provider context gotten")); + if (irc == MSG_X_PROVIDER) { + resp = invokeProvider(&binCtx); + closeProviderContext(&binCtx); + resp->rc--; + if (resp->rc == CMPI_RC_OK) { + _SFCB_RETURN(iMethodResponse(hdr, NULL)); + } + _SFCB_RETURN(iMethodErrResponse(hdr, getErrSegment(resp->rc, + (char*)resp->object[0].data))); + } + closeProviderContext(&binCtx); + _SFCB_RETURN(ctxErrResponse(hdr, &binCtx,0)); +} + static RespSegments createClass(CimXmlRequestContext * ctx, RequestHdr * hdr) { _SFCB_ENTER(TRACE_CIMXMLPROC, "createClass"); @@ -1650,7 +1697,7 @@ {notSupported}, //dummy {getClass}, //OPS_GetClass 1 {getInstance}, //OPS_GetInstance 2 - {notSupported}, //OPS_DeleteClass 3 + {deleteClass}, //OPS_DeleteClass 3 {deleteInstance}, //OPS_DeleteInstance 4 {createClass}, //OPS_CreateClass 5 {createInstance}, //OPS_CreateInstance 6 Index: cimXmlParser.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlParser.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cimXmlParser.c 25 Apr 2005 14:40:42 -0000 1.3 +++ cimXmlParser.c 27 Apr 2005 11:10:41 -0000 1.4 @@ -472,6 +472,8 @@ if (strcasecmp(attr[0].attr, "createClass") == 0) return XTOK_CREATECLASS; + if (strcasecmp(attr[0].attr, "deleteClass") == 0) + return XTOK_DELETECLASS; if (strcasecmp(attr[0].attr, "deleteClass") == 0) return unsupported(parm); Index: providerMgr.h =================================================================== RCS file: /cvsroot/sblim/sfcb/providerMgr.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- providerMgr.h 11 Apr 2005 23:13:42 -0000 1.3 +++ providerMgr.h 27 Apr 2005 11:10:55 -0000 1.4 @@ -353,6 +353,19 @@ }; } DeleteInstanceReq; +typedef union deleteClassReq { + BinRequestHdr hdr; + struct { + unsigned short operation; + unsigned short options; + void *provId; + unsigned int flags; + unsigned long count; // maps to MsgList + MsgSegment principal; + MsgSegment objectPath; + }; +} DeleteClassReq; + typedef union invokeMethodReq { BinRequestHdr hdr; struct { Index: providerDrv.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- providerDrv.c 26 Apr 2005 21:58:47 -0000 1.9 +++ providerDrv.c 27 Apr 2005 11:10:42 -0000 1.10 @@ -685,6 +685,35 @@ return l; } +static BinResponseHdr *deleteClass(BinRequestHdr * hdr, ProviderInfo * info, int requestor) +{ + _SFCB_ENTER(TRACE_PROVIDERDRV, "deleteClass"); + DeleteClassReq *req = (DeleteClassReq *) hdr; + CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); + CMPIStatus rci = { CMPI_RC_OK, NULL }; + CMPIResult *result = native_new_CMPIResult(0,1,NULL); + CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + BinResponseHdr *resp; + CMPIFlags flgs=0; + + ctx->ft->addEntry(ctx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32); + ctx->ft->addEntry(ctx,CMPIPrincipal,(CMPIValue*)&req->principal.data,CMPI_chars); + + _SFCB_TRACE(1, ("--- Calling provider %s",info->providerName)); + rci = info->classMI->ft->deleteClass(info->classMI, ctx, result,path); + _SFCB_TRACE(1, ("--- Back from provider rc: %d", rci.rc)); + + if (rci.rc == CMPI_RC_OK) { + resp = (BinResponseHdr *) calloc(1,sizeof(BinResponseHdr)); + resp->count = 0; + resp->moreChunks=0; + resp->rc = 1; + } + else resp = errorResp(&rci); + + _SFCB_RETURN(resp); +} + static BinResponseHdr *getClass(BinRequestHdr * hdr, ProviderInfo * info, int requestor) { GetClassReq *req = (GetClassReq *) hdr; @@ -1685,7 +1714,7 @@ {opNotSupported}, //dummy {getClass}, //OPS_GetClass 1 {getInstance}, //OPS_GetInstance 2 - {opNotSupported}, //OPS_DeleteClass 3 + {deleteClass}, //OPS_DeleteClass 3 {deleteInstance}, //OPS_DeleteInstance 4 {createClass}, //OPS_CreateClass 5 {createInstance}, //OPS_CreateInstance 6 Index: classProvider.c =================================================================== RCS file: /cvsroot/sblim/sfcb/classProvider.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- classProvider.c 26 Apr 2005 21:58:47 -0000 1.10 +++ classProvider.c 27 Apr 2005 11:10:41 -0000 1.11 @@ -74,6 +74,7 @@ ClassRegister *(*clone) (ClassRegister * br); CMPIConstClass *(*getClass) (ClassRegister * br, const char *clsName); int (*putClass) (ClassRegister * br, CMPIConstClass * cls); + int (*removeClass) (ClassRegister * br, const char *className); UtilList *(*getChildren) (ClassRegister * br, const char *className); void (*rLock)(ClassRegister * cr); void (*wLock)(ClassRegister * cr); @@ -159,6 +160,20 @@ return cb->it->ft->get(cb->it, className); } +static void removeChild(ClassRegister * cr, const char* pn, const char *chd) +{ + ClassBase *cb = (ClassBase *) (cr + 1); + char *child; + UtilList *ul=cb->it->ft->get(cb->it, pn); + + if (ul) for (child =(char*)ul->ft->getFirst(ul); child; child=(char*)ul->ft->getNext(ul)) { + if (strcasecmp(child,chd)==0) { + ul->ft->removeCurrent(ul); + break; + } + } +} + static ClassRegister *newClassRegister(char *fname) { ClassRegister *cr = @@ -450,6 +465,54 @@ return cb->ht->ft->put(cb->ht, cls->ft->getCharClassName(cls), cls); } +static void removeClass(ClassRegister * cr, const char *clsName) +{ + FILE *repold,*repnew; + char *tmpfn; + int s; + ClObjectHdr hdr; + ClassBase *cb = (ClassBase *) cr->hdl; + + cb->ht->ft->remove(cb->ht, clsName); + + repold = fopen(cr->fn, "r"); + tmpfn=malloc(strlen(cr->fn)+8); + strcpy(tmpfn,cr->fn); + strcat(tmpfn,".tmp"); + repnew = fopen(tmpfn, "w"); + + while ((s = fread(&hdr, 1, sizeof(hdr), repold)) == sizeof(hdr)) { + CMPIConstClass cc; + char *buf=NULL; + char *cn; + + buf = (char *) malloc(hdr.size); + *((ClObjectHdr *) buf) = hdr; + + if (fread(buf + sizeof(hdr), 1, hdr.size - sizeof(hdr), repold) == hdr.size - sizeof(hdr)) { + if (hdr.type==HDR_Class) { + cc.hdl = buf; + cc.ft = CMPIConstClassFT; + cc.ft->relocate(&cc); + cn=(char*)cc.ft->getCharClassName(&cc); + if (strcasecmp(clsName,cn)==0) { + free(buf); + continue; + } + } + fwrite(buf,1,hdr.size,repnew); + free(buf); + } + } + fclose(repold); + fclose(repnew); + + unlink(cr->fn); + rename(tmpfn, cr->fn); + + free(tmpfn); +} + static CMPIConstClass *getClass(ClassRegister * cr, const char *clsName) { @@ -466,6 +529,7 @@ regClone, getClass, putClass, + removeClass, getChildren, rLock, wLock, @@ -725,12 +789,13 @@ st.rc = CMPI_RC_ERR_ALREADY_EXISTS; _SFCB_RETURN(st); } - if (pn && (cl=getClass(cReg,cn))==NULL) { + if (pn && (cl=getClass(cReg,pn))==NULL) { st.rc = CMPI_RC_ERR_INVALID_SUPERCLASS; _SFCB_RETURN(st); } cReg->ft->wLock(cReg); + addClass(cReg,cc,cn,pn); cReg->ft->wUnLock(cReg); @@ -752,8 +817,44 @@ CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop) { - CMPIStatus st = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; - return st; + ClassRegister *cReg; + CMPIConstClass * cl; + int rc; + + CMPIStatus st = { CMPI_RC_OK, NULL }; + + _SFCB_ENTER(TRACE_PROVIDERS, "ClassProviderDeleteClass"); + + cReg=getNsReg(cop, &rc); + if (cReg==NULL) { + CMPIStatus st = { CMPI_RC_ERR_INVALID_NAMESPACE, NULL }; + _SFCB_RETURN(st); + } + + char *cn = (char*)cop->ft->getClassName(cop,NULL)->hdl; + + cl = getClass(cReg,cn); + if (cl==NULL) { + st.rc = CMPI_RC_ERR_NOT_FOUND; + _SFCB_RETURN(st); + } + + UtilList *ul = getChildren(cReg,cn); + if (ul) { + st.rc = CMPI_RC_ERR_CLASS_HAS_CHILDREN; + _SFCB_RETURN(st); + } + + char *pn = (char*)cl->ft->getCharSuperClassName(cl); + + cReg->ft->wLock(cReg); + + if (pn) removeChild(cReg, pn, cn); + removeClass(cReg, cn); + + cReg->ft->wUnLock(cReg); + + _SFCB_RETURN(st); } /* ---------------------------------------------------------------------------*/ |
From: Viktor M. <mih...@us...> - 2005-04-27 11:07:01
|
Update of /cvsroot/sblim/cmpi-base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32352 Modified Files: sblim-cmpi-base.spec.in Log Message: Changed buildroot to allow concurrent RPM builds of different packages. Index: sblim-cmpi-base.spec.in =================================================================== RCS file: /cvsroot/sblim/cmpi-base/sblim-cmpi-base.spec.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sblim-cmpi-base.spec.in 26 Apr 2005 16:39:40 -0000 1.4 +++ sblim-cmpi-base.spec.in 27 Apr 2005 11:06:27 -0000 1.5 @@ -4,7 +4,7 @@ # Package spec for @PACKAGE@ # -BuildRoot: /var/tmp/buildroot +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} Summary: Sample CMPI Provider Name: @PACKAGE_TARNAME@ |
From: Viktor M. <mih...@us...> - 2005-04-27 09:17:54
|
Update of /cvsroot/sblim/cmpi-base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4167 Modified Files: acinclude.m4 Log Message: Upgrade to current acinclude.m4. Index: acinclude.m4 =================================================================== RCS file: /cvsroot/sblim/cmpi-base/acinclude.m4,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- acinclude.m4 14 Apr 2005 15:25:58 -0000 1.6 +++ acinclude.m4 27 Apr 2005 09:17:46 -0000 1.7 @@ -27,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]) @@ -45,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" @@ -308,3 +314,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-27 09:13:55
|
Update of /cvsroot/sblim/cmpi-base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1456 Modified Files: provider-register.sh Log Message: Esthetical fix: remove one blank from the usage line. Index: provider-register.sh =================================================================== RCS file: /cvsroot/sblim/cmpi-base/provider-register.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- provider-register.sh 26 Apr 2005 16:39:39 -0000 1.3 +++ provider-register.sh 27 Apr 2005 09:13:45 -0000 1.4 @@ -419,7 +419,7 @@ function usage() { - echo "usage: $0 [-h] [-d] -t <cimserver> -r regfile ... -m mof ..." + echo "usage: $0 [-h] [-d] -t <cimserver> -r regfile ... -m mof ..." } function gb_getopt() |
From: Gareth S B. <bes...@us...> - 2005-04-27 03:10:52
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25615 Modified Files: Makefile.am Log Message: http://sourceforge.net/tracker/index.php?func=detail&aid=1186414&group_id=128809&atid=712784 Fix to change sfcb.cfg dir from (new) $(sysconfdir)/$(PACKAGE) to $(sysconfdir)/sfcb, since with the change in the package name from sfcb to sblim-sfcb broke this, resulting in the sfcb coming up but being unable to find the installed config file. Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile.am 26 Apr 2005 21:58:46 -0000 1.14 +++ Makefile.am 27 Apr 2005 03:10:39 -0000 1.15 @@ -29,7 +29,7 @@ AM_YFLAGS=-d -AM_CPPFLAGS=-DSFCB_CONFDIR=\"$(sysconfdir)/$(PACKAGE)\" \ +AM_CPPFLAGS=-DSFCB_CONFDIR=\"$(sysconfdir)/sfcb\" \ -DSFCB_STATEDIR=\"$(sfcbstatedir)\" SUBDIRS=. $(MOFC_DIR) |
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7477 Modified Files: Makefile.am args.c authorizationProvider.c cimXmlGen.c cimXmlOps.y cimXmlRequest.c classProvider.c control.c fileRepository.c genericlist.c httpAdapter.c mlog.c mlog.h msgqueue.c providerDrv.c providerMgr.c providerRegister.c queryOperation.c queryParser.y queryStatement.c result.c sfcBroker.c support.c trace.c trace.h Log Message: Added syslog support (mlog.c mlog.h from Viktor) Replaced most (f)printf and perror statements with mlogf statements Index: providerRegister.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerRegister.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- providerRegister.c 26 Apr 2005 14:11:21 -0000 1.6 +++ providerRegister.c 26 Apr 2005 21:58:47 -0000 1.7 @@ -22,6 +22,7 @@ #include "utilft.h" +#include "mlog.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -78,7 +79,7 @@ strcat(fin, "/providerRegister"); in = fopen(fin, "r"); if (in == NULL) - fprintf(stderr, "--- %s not found\n", fin); + mlogf(M_ERROR,M_SHOW, "--- %s not found\n", fin); else { @@ -94,7 +95,7 @@ stmt = strdup(fin); switch (cntlParseStmt(fin, &rv)) { case 0: - printf("--- registration statement not recognized: \n\t%d: %s\n", n,stmt); + mlogf(M_ERROR,M_SHOW,"--- registration statement not recognized: \n\t%d: %s\n", n,stmt); err = 1; break; case 1: @@ -132,7 +133,7 @@ info->unload =-1; } else { - printf("--- invalid unload specification: \n\t%d: %s\n", n, stmt); + mlogf(M_ERROR,M_SHOW,"--- invalid unload specification: \n\t%d: %s\n", n, stmt); err = 1; } } @@ -152,7 +153,7 @@ else if (strcmp(t, "class") == 0) info->type |= CLASS_PROVIDER; else { - printf("--- invalid type specification: \n\t%d: %s\n", n, stmt); + mlogf(M_ERROR,M_SHOW,"--- invalid type specification: \n\t%d: %s\n", n, stmt); err = 1; } } @@ -171,7 +172,7 @@ } } else { - printf("--- invalid registration statement: \n\t%d: %s\n", n, stmt); + mlogf(M_ERROR,M_SHOW,"--- invalid registration statement: \n\t%d: %s\n", n, stmt); err = 1; } break; @@ -186,23 +187,23 @@ } if (classProvInfoPtr==NULL) { - printf("--- Class provider definition not found - sfcbd will terminate\n"); + mlogf(M_ERROR,M_SHOW,"--- Class provider definition not found - sfcbd will terminate\n"); err=1; } if (defaultProvInfoPtr==NULL) - printf("--- Default provider definition not found - no instance repository available\n"); + mlogf(M_INFO,M_SHOW,"--- Default provider definition not found - no instance repository available\n"); if (interOpProvInfoPtr==NULL) { if (exFlags & 2 && interopFound==0) - printf("--- InterOp provider definition not found - no InterOp support available\n"); + mlogf(M_INFO,M_SHOW,"--- InterOp provider definition not found - no InterOp support available\n"); else if (interopFound) - printf("--- InterOp provider definition found but not started - no InterOp support available\n"); + mlogf(M_INFO,M_SHOW,"--- InterOp provider definition found but not started - no InterOp support available\n"); interOpProvInfoPtr=&forceNotFound; } if (err) { - printf("--- Broker terminated because of previous error(s)\n"); + mlogf(M_ERROR,M_SHOW,"--- Broker terminated because of previous error(s)\n"); exit(5); } if (stmt) free(stmt); Index: queryStatement.c =================================================================== RCS file: /cvsroot/sblim/sfcb/queryStatement.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- queryStatement.c 13 Mar 2005 23:47:16 -0000 1.3 +++ queryStatement.c 26 Apr 2005 21:58:47 -0000 1.4 @@ -25,6 +25,7 @@ #include <malloc.h> #include "queryOperation.h" +#include "mlog.h" extern int sfcQueryparse(QLControl*); extern CMPIBroker *Broker; @@ -61,12 +62,12 @@ void sfcQueryErr(char* s1, char* s2, char* s3) { - fprintf(stderr,"--- %s %s %s\n",s1,s2,s3); + mlogf(M_ERROR,M_SHOW,"--- %s %s %s\n",s1,s2,s3); } void sfcQueryError(char* s1) { - fprintf(stderr,"--- %s\n",s1); + mlogf(M_ERROR,M_SHOW,"--- %s\n",s1); } static char** ensureCharsListSpace(QLStatement *qs, char ***in, int *max, int nxt) Index: cimXmlOps.y =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlOps.y,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- cimXmlOps.y 25 Apr 2005 14:40:41 -0000 1.4 +++ cimXmlOps.y 26 Apr 2005 21:58:46 -0000 1.5 @@ -1929,7 +1929,7 @@ propertyArray : XTOK_PROPERTYARRAY ZTOK_PROPERTYARRAY { - printf("--- propertyArray\n"); + // printf("--- propertyArray\n"); } ; @@ -1958,7 +1958,7 @@ propertyArray : XTOK_PROPERTYARRAY ZTOK_PROPERTYARRAY { - printf("--- propertyArray\n"); + // printf("--- propertyArray\n"); } ; Index: genericlist.c =================================================================== RCS file: /cvsroot/sblim/sfcb/genericlist.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- genericlist.c 9 Mar 2005 12:25:11 -0000 1.1.1.1 +++ genericlist.c 26 Apr 2005 21:58:47 -0000 1.2 @@ -36,6 +36,7 @@ #include <stdio.h> #include <stdlib.h> #include "genericlist.h" +#include "mlog.h" #ifdef THINK_C #define malloc NewPtr @@ -146,7 +147,7 @@ Generic_list_element *element; if (!pointer) { - fprintf(stderr, "%s: NULL pointer passed 1\n", module); + mlogf(M_ERROR,M_SHOW, "%s: NULL pointer passed 1\n", module); return; exit(EXIT_FAILURE); } @@ -169,7 +170,7 @@ Generic_list_element *element; if (!pointer) { - fprintf(stderr, "%s: NULL pointer passed 2\n", module); + mlogf(M_ERROR,M_SHOW, "%s: NULL pointer passed 2\n", module); // abort(); return; exit(EXIT_FAILURE); @@ -194,7 +195,7 @@ if (list.info->lt) { if (!pointer) { - fprintf(stderr, "%s: NULL pointer passed\n", module); + mlogf(M_ERROR,M_SHOW, "%s: NULL pointer passed\n", module); exit(EXIT_FAILURE); } @@ -595,7 +596,7 @@ ptr = (void *) malloc(n); if (ptr == NULL) { - fprintf(stderr, "%s: error allocating memory\n", module); + mlogf(M_ERROR,M_SHOW, "%s: error allocating memory\n", module); exit(EXIT_FAILURE); } return ptr; Index: support.c =================================================================== RCS file: /cvsroot/sblim/sfcb/support.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- support.c 26 Apr 2005 14:11:21 -0000 1.5 +++ support.c 26 Apr 2005 21:58:47 -0000 1.6 @@ -970,6 +970,6 @@ { char *m=NULL; if (st->msg) m=(char*)st->msg->hdl; - printf("--- showStatus (%s): %d %s\n",msg,st->rc,m); + mlogf(M_INFO,M_SHOW,"--- showStatus (%s): %d %s\n",msg,st->rc,m); } Index: mlog.h =================================================================== RCS file: /cvsroot/sblim/sfcb/mlog.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mlog.h 26 Apr 2005 14:49:29 -0000 1.1 +++ mlog.h 26 Apr 2005 21:58:47 -0000 1.2 @@ -27,7 +27,7 @@ #define M_SHOW 1 #define M_QUIET 0 -void m_start_logging(const char *name); -void m_log(int priority, int errout, const char* fmt, ...); +void startLogging(const char *name); +void mlogf(int priority, int errout, const char* fmt, ...); #endif Index: trace.h =================================================================== RCS file: /cvsroot/sblim/sfcb/trace.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- trace.h 11 Apr 2005 23:13:42 -0000 1.2 +++ trace.h 26 Apr 2005 21:58:47 -0000 1.3 @@ -23,6 +23,8 @@ #ifndef _trace_h #define _trace_h +#include "mlog.h" + #ifdef SFCB_DEBUG #define _SFCB_TRACE(LEVEL,STR) \ if ((_sfcb_trace_mask & __traceMask) && (LEVEL<=_sfcb_debug) && (LEVEL>0) ) \ Index: control.c =================================================================== RCS file: /cvsroot/sblim/sfcb/control.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- control.c 11 Apr 2005 23:13:41 -0000 1.5 +++ control.c 26 Apr 2005 21:58:47 -0000 1.6 @@ -21,6 +21,7 @@ #include "utilft.h" +#include "mlog.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -93,11 +94,11 @@ strcat(fin, "/sfcb.cfg"); } - if (fin[0]=='/') printf("--- Using %s\n",fin); - else printf("--- Using ./%s\n",fin); + if (fin[0]=='/') mlogf(M_INFO,M_SHOW,"--- Using %s\n",fin); + else mlogf(M_INFO,M_SHOW,"--- Using ./%s\n",fin); in = fopen(fin, "r"); if (in == NULL) { - fprintf(stderr, "--- %s not found\n", fin); + mlogf(M_ERROR,M_SHOW, "--- %s not found\n", fin); return -2; } @@ -108,7 +109,7 @@ switch (cntlParseStmt(fin, &rv)) { case 0: case 1: - printf("--- control statement not recognized: \n\t%d: %s\n", n, stmt); + mlogf(M_ERROR,M_SHOW,"--- control statement not recognized: \n\t%d: %s\n", n, stmt); err = 1; break; case 2: @@ -118,7 +119,7 @@ goto ok; } } - printf("--- invalid control statement: \n\t%d: %s\n", n, stmt); + mlogf(M_ERROR,M_SHOW,"--- invalid control statement: \n\t%d: %s\n", n, stmt); err = 1; ok: break; @@ -135,7 +136,7 @@ } if (err) { - printf("--- Broker termintaed because of previous error(s)\n"); + mlogf(M_INFO,M_SHOW,"--- Broker terminated because of previous error(s)\n"); abort(); } Index: mlog.c =================================================================== RCS file: /cvsroot/sblim/sfcb/mlog.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mlog.c 26 Apr 2005 14:49:29 -0000 1.1 +++ mlog.c 26 Apr 2005 21:58:47 -0000 1.2 @@ -24,13 +24,13 @@ #include <stdarg.h> #include <stdio.h> -void m_start_logging(const char *name) +void startLogging(const char *name) { openlog(name,LOG_PID,LOG_DAEMON); setlogmask(LOG_UPTO(LOG_INFO)); } -void m_log(int priority, int errout, const char *fmt, ...) +void mlogf(int priority, int errout, const char *fmt, ...) { va_list ap; int priosysl; Index: cimXmlRequest.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlRequest.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- cimXmlRequest.c 26 Apr 2005 14:10:59 -0000 1.7 +++ cimXmlRequest.c 26 Apr 2005 21:58:47 -0000 1.8 @@ -1182,7 +1182,7 @@ fCls=qs->ft->getFromClassList(qs); if (fCls==NULL || *fCls==NULL) { - fprintf(stderr,"--- from clause\n"); + mlogf(M_ERROR,M_SHOW,"--- from clause missing\n"); abort(); } req->op.className = setCharsMsgSegment(*fCls); Index: queryParser.y =================================================================== RCS file: /cvsroot/sblim/sfcb/queryParser.y,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- queryParser.y 26 Apr 2005 14:11:21 -0000 1.4 +++ queryParser.y 26 Apr 2005 21:58:47 -0000 1.5 @@ -62,6 +62,7 @@ #include <stdio.h> #include "queryOperation.h" +#include "mlog.h" #define YYPARSE_PARAM parm #define YYLEX_PARAM parm @@ -368,7 +369,7 @@ : className '.' classPropertyNameList { if (QS->wql) { - printf("components ?\n"); + mlogf(M_ERROR,M_SHOW,"components ?\n"); // yyErr("Bad property-identifier-1: ",$1,"..."); // YYERROR; $$=QC->addPnClass(QC,QS,$1,0); Index: fileRepository.c =================================================================== RCS file: /cvsroot/sblim/sfcb/fileRepository.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- fileRepository.c 9 Mar 2005 12:25:11 -0000 1.1.1.1 +++ fileRepository.c 26 Apr 2005 21:58:47 -0000 1.2 @@ -28,7 +28,9 @@ #include <string.h> #include <ctype.h> #include <unistd.h> +#include <errno.h> #include "fileRepository.h" +#include "mlog.h" #define BASE "repository" @@ -354,8 +356,9 @@ if (indxLocate(bi,id)) { bi->fd=fopen(bi->fnd,"rb"); if (bi->fd==NULL) { - fprintf(stderr,"*** Repository error for %s \n",bi->fnd); - perror("Repository error: "); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"*** Repository error for %s\n",bi->fnd); + mlogf(M_ERROR,M_SHOW,"Repository error: %s\n",emsg); exit(5); } fseek(bi->fd,bi->bofs,SEEK_SET); Index: providerDrv.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- providerDrv.c 26 Apr 2005 14:11:21 -0000 1.8 +++ providerDrv.c 26 Apr 2005 21:58:47 -0000 1.9 @@ -150,7 +150,6 @@ for (i=provProcMax-1; i; i--) { if ((pp+i)->pid) { -// printf("killing 1 %d\n",(pp+i)->pid); kill((pp+i)->pid,SIGUSR1); return (pp+i)->pid; } @@ -159,14 +158,12 @@ if (done==0) { if (classProvInfoPtr && classProvInfoPtr->pid) { t=classProvInfoPtr->pid; - // printf("killing 2 %d\n",t); kill(classProvInfoPtr->pid,SIGUSR1); done=1; return t; } } -// printf("done\n"); return 0; } @@ -183,7 +180,7 @@ if (pInfo->methodMI) pInfo->methodMI->ft->cleanup(pInfo->methodMI, ctx); if (pInfo->indicationMI) pInfo->indicationMI->ft->cleanup(pInfo->indicationMI, ctx); } - printf("--- stopped %s %d\n",processName,getpid()); + mlogf(M_INFO,M_SHOW,"--- stopped %s %d\n",processName,getpid()); exit(0); } @@ -212,7 +209,7 @@ { int i; - printf("--- Max provider procs: %d\n",p); + mlogf(M_INFO,M_SHOW,"--- Max provider procs: %d\n",p); provProcMax=p; provProc=(ProviderProcess*)calloc(p,sizeof(*provProc)); for (i=0; i<p; i++) provProc[i].id=i; @@ -555,7 +552,7 @@ rvl=hdr->rvEnc.length; break; case CMPI_ref: - fprintf(stderr,"-#- not supporting refs\n"); + mlogf(M_ERROR,M_SHOW,"-#- not supporting refs\n"); abort(); default: ; } @@ -613,7 +610,7 @@ l += ol; break; default: - fprintf(stderr,"--- bad sendResponee request %d\n", hdr->object[i].type); + mlogf(M_ERROR,M_SHOW,"--- bad sendResponee request %d\n", hdr->object[i].type); *((char *) (void *) 0) = 0; _SFCB_ABORT(); } @@ -680,7 +677,6 @@ int i; if (n==1 && ms[0].data==NULL) return NULL; - printf("makePropertyList %d %s\n",n,(char*)ms[0].data); l=(char**)malloc(sizeof(char*)*(n+1)); for (i=0; i<n; i++) @@ -1443,7 +1439,6 @@ if (info->indicationMI==NULL) { CMPIStatus st; setStatus(&st,CMPI_RC_ERR_NOT_SUPPORTED,"Provider does not support indications"); - printf("Provider does not support indications %s\n",info->providerName); resp = errorResp(&st); _SFCB_RETURN(resp); } @@ -1544,7 +1539,7 @@ CMPIStatus rci = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; _SFCB_ENTER(TRACE_PROVIDERDRV, "enableIndications"); - fprintf(stderr,"--- enableIndications not yet supported\n"); + mlogf(M_ERROR,M_SHOW,"--- enableIndications not yet supported\n"); resp = errorResp(&rci); _SFCB_RETURN(resp); } @@ -1556,7 +1551,7 @@ CMPIStatus rci = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; _SFCB_ENTER(TRACE_PROVIDERDRV, ""); - fprintf(stderr,"--- disableIndications not yet supported\n"); + mlogf(M_ERROR,M_SHOW,"--- disableIndications not yet supported\n"); resp = errorResp(&rci); _SFCB_RETURN(resp); } @@ -1571,7 +1566,7 @@ CMPIStatus rci = { CMPI_RC_ERR_NOT_SUPPORTED, NULL }; _SFCB_ENTER(TRACE_PROVIDERDRV, "opNotSupported"); - fprintf(stderr,"--- opNotSupported\n"); + mlogf(M_ERROR,M_SHOW,"--- opNotSupported\n"); resp = errorResp(&rci); _SFCB_RETURN(resp); } @@ -1622,7 +1617,7 @@ info->library = dlopen(dlName, RTLD_NOW); if (info->library == NULL) { - fprintf(stderr,"*** dlopen error: %s\n",dlerror()); + mlogf(M_ERROR,M_SHOW,"*** dlopen error: %s\n",dlerror()); _SFCB_RETURN(-1); } @@ -1659,7 +1654,7 @@ char msg[740]; sprintf(msg, "*** Failed to load %s for %s\n", dlName, info->providerName); - fprintf(stderr,msg); + mlogf(M_ERROR,M_SHOW,msg); resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg); _SFCB_RETURN(resp); } @@ -1667,7 +1662,7 @@ char msg[740]; sprintf(msg, "*** Inconsistent provider registration for %s (2)\n", info->providerName); - fprintf(stderr,msg); + mlogf(M_ERROR,M_SHOW,msg); resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg); _SFCB_RETURN(resp); } @@ -1796,7 +1791,7 @@ if (pInfo && pInfo->library==NULL) { char dlName[512]; - fprintf(stderr,"--- Reloading provider\n"); + mlogf(M_INFO,M_SHOW,"--- Reloading provider\n"); doLoadProvider(pInfo,dlName); } @@ -1815,7 +1810,7 @@ char msg[1024]; snprintf(msg,1023, "*** Inconsistent provider registration for %s (2)\n", pInfo->providerName); - fprintf(stderr,msg); + mlogf(M_ERROR,M_SHOW,msg); _SFCB_TRACE(1, (msg)); resp = errorCharsResp(CMPI_RC_ERR_FAILED, msg); } @@ -1919,7 +1914,7 @@ rc = spRecvReq(&providerSockets.receive, &parms->requestor, (void **) &parms->req, &rl, &mqg); if (mqg.rdone) { - if (rc!=0) fprintf(stderr,"oops\n"); + if (rc!=0)mlogf(M_ERROR,M_SHOW,"oops\n"); _SFCB_TRACE(1, ("--- Got something %d-%p on %d-%lu", parms->req->operation,parms->req->provId, @@ -1940,7 +1935,6 @@ } } else { -// printf("-------- eintr ?\n"); } } _SFCB_EXIT(); Index: trace.c =================================================================== RCS file: /cvsroot/sblim/sfcb/trace.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- trace.c 25 Apr 2005 14:40:42 -0000 1.2 +++ trace.c 26 Apr 2005 21:58:47 -0000 1.3 @@ -98,7 +98,7 @@ err = getenv("SFCB_TRACE_FILE"); if (err != NULL) { if ((((ferr = fopen(err, "a")) == NULL) || fclose(ferr))) { - fprintf(stderr, "Couldn't create trace file\n"); + mlogf(M_ERROR,M_SHOW, "--- Couldn't create trace file\n"); return; } _SFCB_TRACE_FILE = strdup(err); @@ -132,7 +132,7 @@ if ((_SFCB_TRACE_FILE != NULL)) { if ((ferr = fopen(_SFCB_TRACE_FILE, "a")) == NULL) { - fprintf(stderr, "Couldn't open trace file"); + mlogf(M_ERROR,M_SHOW, "--- Couldn't open trace file"); return; } } @@ -165,7 +165,6 @@ extern void _sfcb_set_trace_mask(int n) { _sfcb_trace_mask = n; -// printf("mask: %x\n",n); } void _sfcb_trap(int tn) Index: sfcBroker.c =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcBroker.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- sfcBroker.c 26 Apr 2005 14:11:21 -0000 1.8 +++ sfcBroker.c 26 Apr 2005 21:58:47 -0000 1.9 @@ -145,7 +145,7 @@ if (adaptersStopped==0) { pthread_mutex_lock(&sdMtx); - if (sa==0) printf("--- Stopping adapters\n"); + if (sa==0) mlogf(M_INFO,M_SHOW,"--- Stopping adapters\n"); sa++; if (stopNextAdapter()) { rc=pthread_cond_timedwait(&sdCnd,&sdMtx,&waitTime); @@ -156,7 +156,7 @@ if (adaptersStopped) { pthread_mutex_lock(&sdMtx); - if (sp==0) printf("--- Stopping providers\n"); + if (sp==0) mlogf(M_INFO,M_SHOW,"--- Stopping providers\n"); sp++; if (stopNextProc()) { rc=pthread_cond_timedwait(&sdCnd,&sdMtx,&waitTime); @@ -168,9 +168,10 @@ } if (restartBroker) { - printf("---\n"); + char *emsg=strerror(errno); + mlogf(M_INFO,M_SHOW,"---\n"); execvp("sfcbd",restartArgv); - perror("--- execv for restart problem:"); + mlogf(M_ERROR,M_SHOW,"--- execv for restart problem: %s\n",emsg); abort(); } @@ -190,7 +191,7 @@ pthread_attr_t tattr; if (sfcBrokerPid==currentProc) { - fprintf(stderr, "--- Winding down %s\n", processName); + mlogf(M_INFO,M_SHOW, "--- Winding down %s\n", processName); pthread_attr_init(&tattr); pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); pthread_create(&t, &tattr, (void *(*)(void *))stopBroker,NULL); @@ -204,7 +205,7 @@ if (sfcBrokerPid==currentProc) { restartBroker=1; - fprintf(stderr, "--- Restarting %s\n", processName); + mlogf(M_INFO,M_SHOW, "--- Restarting %s\n", processName); pthread_attr_init(&tattr); pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); pthread_create(&t, &tattr, (void *(*)(void *))stopBroker,NULL); @@ -225,7 +226,7 @@ break; if ((int) pid < 0) { if (errno == EINTR || errno == EAGAIN) { - fprintf(stderr, "pid: %d continue \n", pid); + // mlogf(M_INFO,M_SHOW, "pid: %d continue \n", pid); continue; } if (errno != ECHILD) @@ -233,10 +234,10 @@ break; } else { -// printf("sigchild %d\n",pid); +// mlogf(M_INFO,M_SHOW,"sigchild %d\n",pid); if (testStartedAdapter(pid,&left)) { if (left==0) { - fprintf(stderr,"--- Adapters stopped\n"); + mlogf(M_INFO,M_SHOW,"--- Adapters stopped\n"); adaptersStopped=1; } pthread_attr_init(&tattr); @@ -245,7 +246,7 @@ } else if (testStartedProc(pid,&left)) { if (left==0) { - fprintf(stderr,"--- Providers stopped\n"); + mlogf(M_INFO,M_SHOW,"--- Providers stopped\n"); providersStopped=1; } pthread_attr_init(&tattr); @@ -260,7 +261,7 @@ static void handleSigterm(int sig) { if (!terminating) { - fprintf(stderr, "--- %s - %d exiting due to signal %d\n", processName, currentProc, sig); + mlogf(M_ERROR,M_SHOW, "--- %s - %d exiting due to signal %d\n", processName, currentProc, sig); dumpTiming(currentProc); } terminating=1; @@ -271,13 +272,13 @@ static void handleSigSegv(int sig) { - fprintf(stderr, "-#- %s - %d exiting due to a SIGSEGV signal\n", + mlogf(M_ERROR,M_SHOW, "-#- %s - %d exiting due to a SIGSEGV signal\n", processName, currentProc); } /* static void handleSigAbort(int sig) { - fprintf(stderr, "%s: exiting due to a SIGABRT signal - %d\n", processName, currentProc); + mlogf(M_INFO,M_SHOW, "%s: exiting due to a SIGABRT signal - %d\n", processName, currentProc); kill(0, SIGTERM); } */ @@ -288,7 +289,8 @@ pid= fork(); if (pid < 0) { - perror("httpd fork"); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW, "-#- http fork: %s",emsg); exit(2); } if (pid == 0) { @@ -327,8 +329,10 @@ restartArgc=argc; restartArgv=argv; - printf("--- %s V" sfcHttpDaemonVersion " started - %d\n", name, currentProc); - printf("--- (C) Copyright IBM Corp. 2004\n"); + startLogging("sfcb"); + + mlogf(M_INFO,M_SHOW,"--- %s V" sfcHttpDaemonVersion " started - %d\n", name, currentProc); + mlogf(M_INFO,M_SHOW,"--- (C) Copyright IBM Corp. 2004\n"); for (c = 0, i = 1; i < argc; i++) { if (strcmp(argv[i], "-d") == 0) @@ -355,7 +359,7 @@ else if (strcmp(argv[i], "-I") == 0) exFlags|=2; else { - printf("--- Bad parameter: %s\n", argv[i]); + mlogf(M_ERROR,M_SHOW,"--- Bad parameter: %s\n", argv[i]); exit(3); } } @@ -368,7 +372,7 @@ // SFCB_DEBUG #ifndef SFCB_DEBUG if (tmask) - printf("--- SCFB_DEBUG not configured. -tm %d ignored\n",tmask); + mlogf(M_ERROR,M_SHOW,"--- SCFB_DEBUG not configured. -tm %d ignored\n",tmask); #endif if ((pauseStr=getenv("SFCB_PAUSE_PROVIDER"))) { @@ -383,7 +387,7 @@ sslMode=enableHttps; sslOMode=sslMode & !enableHttp; #else - printf("--- SSL not configured\n"); + mlogf(M_INFO,M_SHOW,"--- SSL not configured\n"); enableHttps=0; sslMode=0; sslOMode=0; @@ -392,12 +396,12 @@ if (getControlBool("useChunking", &useChunking)) useChunking=0; if (useChunking==0) - printf("--- Chunking disabled\n"); + mlogf(M_INFO,M_SHOW,"--- Chunking disabled\n"); if (getControlBool("doBasicAuth", &doBa)) doBa=0; if (!doBa) - printf("--- User authentication disabled\n"); + mlogf(M_INFO,M_SHOW,"--- User authentication disabled\n"); if (getControlNum("httpProcs", &dSockets)) dSockets = 10; Index: args.c =================================================================== RCS file: /cvsroot/sblim/sfcb/args.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- args.c 9 Mar 2005 12:25:09 -0000 1.1.1.1 +++ args.c 26 Apr 2005 21:58:46 -0000 1.2 @@ -122,8 +122,8 @@ } else if (rv.type == CMPI_ref) { char *msg; - rv.value.ref = getObjectPath(ClObjectGetClString - (&ca->hdr, (ClString *) & rv.value.chars), &msg); + rv.value.ref = getObjectPath( + (char*)ClObjectGetClString(&ca->hdr, (ClString *) & rv.value.chars), &msg); } else if (rv.type & CMPI_ARRAY) { rv.value.array = Index: classProvider.c =================================================================== RCS file: /cvsroot/sblim/sfcb/classProvider.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- classProvider.c 25 Apr 2005 14:40:42 -0000 1.9 +++ classProvider.c 26 Apr 2005 21:58:47 -0000 1.10 @@ -181,7 +181,6 @@ in = fopen(fin, "r"); if (in == NULL) { - // fprintf(stderr, "--- %s not found\n", fin); cb->ht = UtilFactory->newHashTable(61, UtilHashTable_charKey | UtilHashTable_ignoreKeyCase); cb->it = UtilFactory->newHashTable(61, @@ -207,13 +206,13 @@ } if (vRec==0 && hdr.type!=HDR_Class) { - fprintf(stderr,"--- %s contains non-class record(s) - directory skipped\n",fin); + mlogf(M_ERROR,M_SHOW,"--- %s contains non-class record(s) - directory skipped\n",fin); return NULL; } buf = (char *) malloc(hdr.size); if (buf==NULL) { - fprintf(stderr,"--- %s contains record(s) that are too long - directory skipped\n",fin); + mlogf(M_ERROR,M_SHOW,"--- %s contains record(s) that are too long - directory skipped\n",fin); return NULL; } @@ -239,16 +238,16 @@ } } else { - fprintf(stderr,"--- %s contains invalid record(s) - directory skipped\n",fin); + mlogf(M_ERROR,M_SHOW,"--- %s contains invalid record(s) - directory skipped\n",fin); return NULL; } } if (cr->vr) { - printf("--- ClassProvider for %s (%d.%d) using %ld bytes\n", + mlogf(M_INFO,M_SHOW,"--- ClassProvider for %s (%d.%d) using %ld bytes\n", fname, cr->vr->version, cr->vr->level, total); } - else printf("--- ClassProvider for %s (no-version) using %ld bytes\n", fname, total); + else mlogf(M_INFO,M_SHOW,"--- ClassProvider for %s (no-version) using %ld bytes\n", fname, total); buildInheritanceTable(cr); @@ -399,7 +398,7 @@ } } else if (first) { - fprintf(stderr,"--- Repository %s not found\n",dn); + mlogf(M_ERROR,M_SHOW,"--- Repository %s not found\n",dn); } closedir(dir); return ns; @@ -946,7 +945,7 @@ } else { - fprintf(stderr,"--- ClassProvider: Invalid request %s\n", methodName); + mlogf(M_ERROR,M_SHOW,"--- ClassProvider: Invalid invokeMethod request %s\n", methodName); st.rc = CMPI_RC_ERR_METHOD_NOT_FOUND; } return st; Index: result.c =================================================================== RCS file: /cvsroot/sblim/sfcb/result.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- result.c 26 Apr 2005 14:11:21 -0000 1.2 +++ result.c 26 Apr 2005 21:58:47 -0000 1.3 @@ -26,6 +26,7 @@ #include "constClass.h" #include "queryOperation.h" #include "utilft.h" +#include "mlog.h" extern void native_array_reset_size(CMPIArray * array, CMPICount increment); extern MsgSegment setInstanceMsgSegment(CMPIInstance * ci); @@ -214,8 +215,7 @@ // NativeResult *r = (NativeResult*) result; if (type==CMPI_ref) { - fprintf(stderr, - "--- CMPIResult does not yet support returning references\n"); + mlogf(M_ERROR,M_SHOW,"--- CMPIResult does not yet support returning references\n"); abort(); } Index: providerMgr.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerMgr.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- providerMgr.c 26 Apr 2005 14:11:21 -0000 1.7 +++ providerMgr.c 26 Apr 2005 21:58:47 -0000 1.8 @@ -90,7 +90,7 @@ static void notSupported(int *requestor, OperationHdr * req) { - fprintf(stderr,"--- MSG_X_NOT_SUPPORTED\n"); + mlogf(M_ERROR,M_SHOW,"--- MSG_X_NOT_SUPPORTED\n"); spSendCtlResult(requestor, &sfcbSockets.send, MSG_X_NOT_SUPPORTED, 0, NULL); free(req); } @@ -98,13 +98,13 @@ /* static void handleSigterm(int sig) { - fprintf(stderr, "%s: exiting due to signal %d\n", "provider", sig); + mlogf(M_ERROR,M_SHOW, "%s: exiting due to signal %d\n", "provider", sig); exit(1); } static void handleSigSegv(int sig) { - fprintf(stderr, "()%d): exiting due to a SIGSEGV signal %d - %s(%d)\n", + mlogf(M_ERROR,M_SHOW, "()%d): exiting due to a SIGSEGV signal %d - %s(%d)\n", currentProc, sig, __FILE__, __LINE__); abort(); } @@ -747,7 +747,6 @@ free(req); } else { -// printf("-------- eintr ?\n"); } } else { @@ -888,7 +887,7 @@ l += ol; break; default: - fprintf(stderr,"--- bad invokeProvider request %d-%d\n", i,hdr->object[i].type); + mlogf(M_ERROR,M_SHOW,"--- bad invokeProvider request %d-%d\n", i,hdr->object[i].type); abort(); } } @@ -902,7 +901,7 @@ for (;;) { rc=spSendReq(&ctx->provA.socket, &resultSockets.send, buf, l); if (rc==-2) { - fprintf(stderr,"need to reload provider\n"); + mlogf(M_ERROR,M_SHOW,"--- need to reload provider ??\n"); asm("int $3"); // reloadProviderRequest(ctx); exit(3); Index: cimXmlGen.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlGen.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- cimXmlGen.c 26 Apr 2005 14:10:59 -0000 1.6 +++ cimXmlGen.c 26 Apr 2005 21:58:46 -0000 1.7 @@ -129,7 +129,7 @@ in=&ref->instanceName; break; default: - printf("%s(%d): unexpected reference type %d %x\n", __FILE__, __LINE__, + mlogf(M_ERROR,M_SHOW,"%s(%d): unexpected reference type %d %x\n", __FILE__, __LINE__, (int) type, (int) type); abort(); } @@ -193,7 +193,7 @@ case CMPI_instance: return "%"; } - printf("%s(%d): invalid data type %d %x\n", __FILE__, __LINE__, (int) type, + mlogf(M_ERROR,M_SHOW,"%s(%d): invalid data type %d %x\n", __FILE__, __LINE__, (int) type, (int) type); asm("int $3"); abort(); @@ -220,7 +220,7 @@ case CMPI_ref: return "*"; } - printf("%s(%d): invalid key data type %d %x\n", __FILE__, __LINE__, + mlogf(M_ERROR,M_SHOW,"%s(%d): invalid key data type %d %x\n", __FILE__, __LINE__, (int) type, (int) type); asm("int $3"); abort(); @@ -303,7 +303,7 @@ valp=getKeyValueTypePtr("ref", NULL, ref, &value, &t); break; default: - printf("%s(%d): invalid value %d-%s\n", __FILE__, __LINE__, (int) type, val); + mlogf(M_ERROR,M_SHOW,"%s(%d): invalid value %d-%s\n", __FILE__, __LINE__, (int) type, val); abort(); } return value; @@ -388,7 +388,7 @@ else sp = ""; } else { - printf("%s(%d): invalid value2xml %d-%x\n", __FILE__, __LINE__, + mlogf(M_ERROR,M_SHOW,"%s(%d): invalid value2xml %d-%x\n", __FILE__, __LINE__, (int) d.type, (int) d.type); abort(); } @@ -588,7 +588,7 @@ else if (pdata->type==CMPI_refA) { sb->ft->appendChars(sb, "<PARAMETER.REFARRAY NAME=\""); sb->ft->appendChars(sb, (char*)pname->hdl); - fprintf(stderr,"*** PARAMETER.REFARRAY not implemenetd\n"); + mlogf(M_ERROR,M_SHOW,"*** PARAMETER.REFARRAY not implemenetd\n"); abort(); etag="</PARAMETER.REFARRAY>\n"; } @@ -756,7 +756,7 @@ data = CMGetArgAt(args, i, &name, NULL); if (data.type & CMPI_ARRAY) { - fprintf(stderr,"-#- args2xml: arrays in CMPIArgs not yet supported\n"); + mlogf(M_ERROR,M_SHOW,"-#- args2xml: arrays in CMPIArgs not yet supported\n"); abort(); // data2xml(&data,args,name,"<PROPERTY.ARRAY NAME=\"", "</PROPERTY.ARRAY>\n", // sb, qsb, 1); @@ -764,7 +764,7 @@ else { type = dataType(data.type); if (*type == '*') { - fprintf(stderr,"-#- args2xml: references in CMPIArgs not yet supported\n"); + mlogf(M_ERROR,M_SHOW,"-#- args2xml: references in CMPIArgs not yet supported\n"); abort(); // data2xml(&data,args,name,"<PROPERTY.REFERENCE NAME=\"", // "</PROPERTY.REFERENCE>\n", sb, qsb, 1); Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 26 Apr 2005 17:17:39 -0000 1.13 +++ Makefile.am 26 Apr 2005 21:58:46 -0000 1.14 @@ -85,7 +85,8 @@ queryOperation.c \ queryStatement.c \ cimXmlGen.c \ - mrwlock.c + mrwlock.c \ + mlog.c libsfcBrokerCore_la_CFLAGS = @SFCB_CMPI_OS@ @SFCB_CMPI_PLATFORM@ @@ -148,7 +149,7 @@ constClass.h msgqueue.h providerRegister.h \ cimXmlParser.h native.h support.h cimXmlGen.h \ cimXmlRequest.h genericlist.h objectImpl.h trace.h \ - hashtable.h utilft.h \ + hashtable.h utilft.h mlog.h \ cmpidt.h cmpift.h cmpiftx.h cmpimacs.h cmpimacsx.h cmpios.h fileRepository.h \ selectexp.h queryOperation.h authorizationUtil.h authorizationEnum.c \ sfcVersion.h mrwlock.h Index: httpAdapter.c =================================================================== RCS file: /cvsroot/sblim/sfcb/httpAdapter.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- httpAdapter.c 25 Apr 2005 23:42:28 -0000 1.6 +++ httpAdapter.c 26 Apr 2005 21:58:47 -0000 1.7 @@ -104,17 +104,16 @@ { httpProcSemKey=ftok(".",'H'); httpWorkSemKey=ftok(".",'W'); - char emsg[256]; union semun sun; int i; - printf("--- Max Http procs: %d\n",p); + mlogf(M_INFO,M_SHOW,"--- Max Http procs: %d\n",p); if ((httpProcSem=semget(httpProcSemKey,1,0666))!=-1) semctl(httpProcSem,0,IPC_RMID,sun); if ((httpProcSem=semget(httpProcSemKey,1+p,IPC_CREAT | 0666))==-1) { - sprintf(emsg,"Http Proc semaphore create %d",currentProc); - perror(emsg); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"--- Http Proc semaphore create %d: %s\n",currentProc,emsg); abort(); } sun.val=p; @@ -128,8 +127,8 @@ semctl(httpWorkSem,0,IPC_RMID,sun); if ((httpWorkSem=semget(httpWorkSemKey,1,IPC_CREAT | 0666))==-1) { - sprintf(emsg,"Http ProcWork semaphore create %d",currentProc); - perror(emsg); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"--- Http ProcWork semaphore create %d: %s\n",currentProc,emsg); abort(); } sun.val=1; @@ -163,7 +162,7 @@ if (authenticate) err=0; } } - if (err) printf("--- Authentication exit %s not found\n",dlName); + if (err) mlogf(M_ERROR,M_SHOW,"--- Authentication exit %s not found\n",dlName); } *principle=strdup(auth); @@ -183,7 +182,7 @@ break; if ((int) pid < 0) { if (errno == EINTR || errno == EAGAIN) { - fprintf(stderr, "pid: %d continue \n", pid); + // fprintf(stderr, "pid: %d continue \n", pid); continue; } if (errno != ECHILD) @@ -752,7 +751,8 @@ else r = 0; if (r < 0) { - perror("fork handler"); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"--- fork handler: %s\n",emsg); exit(1); } @@ -859,13 +859,13 @@ else cp = name; name = cp; - if (sslMode) - printf("--- %s HTTPS Daemon V" sfcHttpDaemonVersion " started - %d - port %ld\n", name, currentProc,port); - else - printf("--- %s HTTP Daemon V" sfcHttpDaemonVersion " started - %d - port %ld\n", name, currentProc,port); + if (sslMode) mlogf(M_INFO,M_SHOW,"--- %s HTTPS Daemon V" sfcHttpDaemonVersion " started - %d - port %ld\n", + name, currentProc,port); + else mlogf(M_INFO,M_SHOW,"--- %s HTTP Daemon V" sfcHttpDaemonVersion " started - %d - port %ld\n", + name, currentProc,port); - if (doBa) printf("--- Using Basic Authentication\n"); + if (doBa) mlogf(M_INFO,M_SHOW,"--- Using Basic Authentication\n"); listenFd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); sin_len = sizeof(sin); @@ -881,15 +881,15 @@ if (bind(listenFd, (struct sockaddr *) &sin, sin_len) || listen(listenFd, 0)) { - printf("--- Cannot listen on port %ld\n", port); + mlogf(M_ERROR,M_SHOW,"--- Cannot listen on port %ld\n", port); kill(sfcbPid,3); -// exit(3); } if (!debug) { int rc = fork(); if (rc == -1) { - perror("fork daemon"); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"--- fork daemon: %s",emsg); exit(1); } else if (rc) @@ -919,6 +919,7 @@ #endif for (;;) { + char *emsg; listen(listenFd, 1); sz = sizeof(sin); if ((connFd = accept(listenFd, (__SOCKADDR_ARG) & sin, &sz))<0) { @@ -926,7 +927,8 @@ if (stopAccepting) break; continue; } - perror("accept error"); + emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"--- accept error %s\n",emsg); _SFCB_ABORT(); } _SFCB_TRACE(1, ("--- Processing http request")); @@ -938,7 +940,7 @@ // printf("--- %s draining %d\n",processName,running); for (;;) { if (running==0) { - printf("--- %s terminating %d\n",processName,getpid()); + mlogf(M_INFO,M_SHOW,"--- %s terminating %d\n",processName,getpid()); exit(0); } sleep(1); Index: queryOperation.c =================================================================== RCS file: /cvsroot/sblim/sfcb/queryOperation.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- queryOperation.c 26 Apr 2005 14:11:21 -0000 1.4 +++ queryOperation.c 26 Apr 2005 21:58:47 -0000 1.5 @@ -26,6 +26,7 @@ #include <stdlib.h> #include "queryOperation.h" +#include "mlog.h" extern CMPIArray *TrackedCMPIArray(CMPICount size, CMPIType type, CMPIStatus * rc); extern void native_array_increase_size(CMPIArray * array, CMPICount increment); @@ -212,15 +213,15 @@ break; case QL_PropertyName: case QL_Name: - fprintf(stderr,"### propCompare(): (QL_PropertyName QL_Name) got a problem\n"); + mlogf(M_ERROR,M_SHOW,"### propCompare(): (QL_PropertyName QL_Name) got a problem\n"); abort(); break; case QL_Invalid: - fprintf(stderr,"### propCompare(): got a problem\n"); + mlogf(M_ERROR,M_SHOW,"### propCompare(): got a problem\n"); abort(); break; case QL_NotFound: - fprintf(stderr,"### propCompare(): %s not found\n", + mlogf(M_ERROR,M_SHOW,"### propCompare(): %s not found\n", self->propertyName->part[0]); abort(); } @@ -268,7 +269,7 @@ static int nameCompare(QLOperand* self, QLOperand* op, QLPropertySource* src) { - printf(" nameCompare\n"); + mlogf(M_ERROR,M_SHOW,"--- nameCompare\n"); abort(); return -2; } Index: authorizationProvider.c =================================================================== RCS file: /cvsroot/sblim/sfcb/authorizationProvider.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- authorizationProvider.c 9 Mar 2005 12:25:09 -0000 1.1.1.1 +++ authorizationProvider.c 26 Apr 2005 21:58:46 -0000 1.2 @@ -460,7 +460,7 @@ CMPIContext * context, CMPIResult * results, CMPIObjectPath * reference, - char * methodname, + const char * methodname, CMPIArgs * argsin, CMPIArgs * argsout) { Index: msgqueue.c =================================================================== RCS file: /cvsroot/sblim/sfcb/msgqueue.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- msgqueue.c 26 Apr 2005 14:11:20 -0000 1.4 +++ msgqueue.c 26 Apr 2005 21:58:47 -0000 1.5 @@ -112,7 +112,6 @@ int initSem(int https, int shttps, int provs) { union semun sun; - char emsg[256]; int i; sfcbSemKey=ftok(".",'S'); @@ -121,8 +120,8 @@ semctl(sfcbSem,0,IPC_RMID,sun); if ((sfcbSem=semget(sfcbSemKey,4+(provs*3)+3,IPC_CREAT | IPC_EXCL | 0666))==-1) { - sprintf(emsg,"SFCB semaphore create %d",currentProc); - perror(emsg); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"SFCB semaphore create %d: %s\n",currentProc,emsg); abort(); } @@ -160,10 +159,8 @@ static int spHandleError(int *s, char *m) { _SFCB_ENTER(TRACE_MSGQUEUE, "handleError"); - char emsg[256]; - - sprintf(emsg, "%s %d %d-%d", m, *s, currentProc, errno); - perror(emsg); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"%s %d %d-%d %s\n", m, *s, currentProc, errno,emsg); _SFCB_ABORT(); return errno; } @@ -197,7 +194,8 @@ } if (n == 0) { - perror("Warning: fd is closed:"); + char *emsg=strerror(errno); + mlogf(M_ERROR,M_SHOW,"--- Warning: fd is closed: %s\n",emsg); break; } @@ -275,7 +273,7 @@ _SFCB_RETURN(spMsg.type.ctl.xtra); default: *data = NULL; - fprintf(stderr,"### %d ??? %ld-%d\n", currentProc, spMsg.type.type, + mlogf(M_ERROR,M_SHOW,"### %d ??? %ld-%d\n", currentProc, spMsg.type.type, spMsg.type.ctl.xtra); abort(); } @@ -481,10 +479,9 @@ int i,t=(provs*2)+https; //,shttps; sPairs=(ComSockets*)malloc(sizeof(ComSockets)*t); - fprintf(stderr,"--- initSocketPairs: %d\n",t); + mlogf(M_INFO,M_SHOW,"--- initSocketPairs: %d\n",t); for (i=0; i<t; i++) { socketpair(PF_LOCAL, SOCK_STREAM, 0, &sPairs[i].receive); - // fprintf(stderr,"--- initSocketPairs sock[%d]: %d\n",i,sPairs[i].receive); } ptBase=provs; htBase=ptBase+provs; |
From: Viktor M. <mih...@us...> - 2005-04-26 17:17:48
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12411 Modified Files: Makefile.am sfcb.spec.in sfcbrepos.sh.in Log Message: Bug 1187619: use -f option of getSchema.sh in Makefile.am. Bug 1186414: fixed RPM-related problems with package rename. Index: sfcb.spec.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcb.spec.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- sfcb.spec.in 19 Apr 2005 13:21:11 -0000 1.7 +++ sfcb.spec.in 26 Apr 2005 17:17:39 -0000 1.8 @@ -60,10 +60,10 @@ find $RPM_BUILD_ROOT/%{_datadir}/%{name} -type f | grep -v $RPM_BUILD_ROOT/%{_datadir}/%{name}/CIM >> _pkg_list sed s?$RPM_BUILD_ROOT??g _pkg_list > _pkg_list_2 mv -f _pkg_list_2 _pkg_list -echo "%config %{_sysconfdir}/%{name}" >> _pkg_list +echo "%config %{_sysconfdir}/sfcb" >> _pkg_list echo "%doc %{_datadir}/doc" >> _pkg_list -echo "%{_sysconfdir}/init.d/%{name}" >> _pkg_list -echo "%{_localstatedir}/lib/%{name}" >> _pkg_list +echo "%{_sysconfdir}/init.d/sfcb" >> _pkg_list +echo "%{_localstatedir}/lib/sfcb" >> _pkg_list echo "%{_bindir}/*" >> _pkg_list echo "%{_libdir}/*.so*" >> _pkg_list Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.am 25 Apr 2005 23:21:01 -0000 1.12 +++ Makefile.am 26 Apr 2005 17:17:39 -0000 1.13 @@ -21,7 +21,7 @@ # sfcbstatedir=$(localstatedir)/lib/sfcb -sfcbdocdir=$(datadir)/doc/sfcb-$(VERSION) +sfcbdocdir=$(datadir)/doc/$(PACKAGE)-$(VERSION) initdir=$(sysconfdir)/init.d BUILT_SOURCES=queryParser.c queryLexer.c authorizationParser.c \ @@ -29,7 +29,7 @@ AM_YFLAGS=-d -AM_CPPFLAGS=-DSFCB_CONFDIR=\"$(sysconfdir)/sfcb\" \ +AM_CPPFLAGS=-DSFCB_CONFDIR=\"$(sysconfdir)/$(PACKAGE)\" \ -DSFCB_STATEDIR=\"$(sfcbstatedir)\" SUBDIRS=. $(MOFC_DIR) @@ -221,7 +221,7 @@ install-cimschema: getSchema.sh test -d $(DESTDIR)$(pkgdatadir) || $(mkdir_p) $(DESTDIR)$(pkgdatadir) - sh getSchema.sh $(DESTDIR)$(pkgdatadir) + sh getSchema.sh -f $(DESTDIR)$(pkgdatadir) postinstall: install-cimschema test -f $(DESTDIR)$(sfcbstatedir)/registration/providerRegister || $(INSTALL_DATA) $(DESTDIR)$(sfcbstatedir)/stage/default.reg $(DESTDIR)$(sfcbstatedir)/registration/providerRegister Index: sfcbrepos.sh.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcbrepos.sh.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sfcbrepos.sh.in 20 Apr 2005 17:00:27 -0000 1.5 +++ sfcbrepos.sh.in 26 Apr 2005 17:17:39 -0000 1.6 @@ -42,7 +42,7 @@ echo -e "\t-f force repository creation" echo -e "\t-s specify staging directory [@localstatedir@/lib/sfcb/stage]" echo -e "\t-r specify repository directory [@localstatedir@/lib/sfcb/registration]" - echo -e "\t-c specify directory containing CIM Schema MOFs [@datadir@/sfcb/CIM]" + echo -e "\t-c specify directory containing CIM Schema MOFs [@datadir@/@PACKAGE@/CIM]" echo echo "Use to create sfcb provider registration and class repository." exit 0 @@ -75,7 +75,7 @@ if [ -z "$cimschemadir" ] then - cimschemadir=@datadir@/sfcb/CIM + cimschemadir=@datadir@/@PACKAGE@/CIM fi if [ -d $stagingdir ] && [ -f $stagingdir/default.reg ] && |
From: Viktor M. <mih...@us...> - 2005-04-26 16:49:04
|
Update of /cvsroot/sblim/cmpi-base/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31803/mof Removed Files: Linux_Base.sfcb.reg Linux_BaseIndication.sfcb.reg Linux_BaseIndicationReg.mof Linux_BaseRegistration.mof Log Message: Bug 1183788: removed legacy registration files. --- Linux_BaseIndicationReg.mof DELETED --- --- Linux_BaseRegistration.mof DELETED --- --- Linux_Base.sfcb.reg DELETED --- --- Linux_BaseIndication.sfcb.reg DELETED --- |
From: Viktor M. <mih...@us...> - 2005-04-26 16:39:51
|
Update of /cvsroot/sblim/cmpi-base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27294 Modified Files: Makefile.am provider-register.sh sblim-cmpi-base.spec.in Log Message: Bug 1183788: added comments to registration file syntax and made the multi-registration file syntax more Makefile-friendly. Index: sblim-cmpi-base.spec.in =================================================================== RCS file: /cvsroot/sblim/cmpi-base/sblim-cmpi-base.spec.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sblim-cmpi-base.spec.in 25 Apr 2005 17:07:27 -0000 1.3 +++ sblim-cmpi-base.spec.in 26 Apr 2005 16:39:40 -0000 1.4 @@ -85,14 +85,14 @@ %endif %{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \ - -r %{REGISTRATION} %{SCHEMA} > /dev/null + -r %{REGISTRATION} -m %{SCHEMA} > /dev/null /sbin/ldconfig %preun %{_datadir}/%{name}/provider-register.sh -d -t @CIMSERVER@ \ - -r %{REGISTRATION} %{SCHEMA} > /dev/null + -r %{REGISTRATION} -m %{SCHEMA} > /dev/null %postun /sbin/ldconfig Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/cmpi-base/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 25 Apr 2005 17:07:21 -0000 1.6 +++ Makefile.am 26 Apr 2005 16:39:39 -0000 1.7 @@ -165,10 +165,10 @@ # Register the provider(s) and class definition(s) to the current CIM server/CIMOM postinstall: - sh provider-register.sh -t @CIMSERVER@ -r $(REGISTRATIONS) $(SCHEMAS) + sh provider-register.sh -t @CIMSERVER@ -r $(REGISTRATIONS) -m $(SCHEMAS) preuninstall: - sh provider-register.sh -d -t @CIMSERVER@ -r $(REGISTRATIONS) $(SCHEMAS) + sh provider-register.sh -d -t @CIMSERVER@ -r $(REGISTRATIONS) -m $(SCHEMAS) dist-hook: test -d "$(distdir)" && rm -rf `find $(distdir) -type d -name CVS` Index: provider-register.sh =================================================================== RCS file: /cvsroot/sblim/cmpi-base/provider-register.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- provider-register.sh 25 Apr 2005 17:07:22 -0000 1.2 +++ provider-register.sh 26 Apr 2005 16:39:39 -0000 1.3 @@ -35,13 +35,13 @@ OUTFILE=$1 shift regfiles=$* - PROVIDERMODULES=`cat $regfiles 2> /dev/null | cut -d ' ' -f 4 | sort | uniq` + PROVIDERMODULES=`cat $regfiles 2> /dev/null | grep -v '^[[:space:]]*#.*' | cut -d ' ' -f 4 | sort | uniq` if test x"$PROVIDERMODULES" == x then echo Failed to read registration files return 1 fi - PROVIDERS=`cat $regfiles 2> /dev/null | cut -d ' ' -f 3-4 | sort | uniq` + PROVIDERS=`cat $regfiles 2> /dev/null | grep -v '^[[:space:]]*#.*' | cut -d ' ' -f 3-4 | sort | uniq` # produce ProviderModules echo > $OUTFILE @@ -79,8 +79,7 @@ #produce Capabilities for rf in $regfiles do - echo $rf - while read CLASSNAME NAMESPACE PROVIDERNAME PROVIDERMODULE CAPS + cat $rf | grep -v '^[[:space:]]*#.*' | while read CLASSNAME NAMESPACE PROVIDERNAME PROVIDERMODULE CAPS do numcap= for cap in $CAPS @@ -124,7 +123,7 @@ }; EOFC - done < $rf + done done } @@ -216,7 +215,7 @@ if ps -C cimserver > /dev/null 2>&1 then - PROVIDERMODULES=`cat $myregs 2> /dev/null | cut -d ' ' -f 4 | sort | uniq` + PROVIDERMODULES=`cat $myregs 2> /dev/null | grep -v '^[[:space:]]*#.*' | cut -d ' ' -f 4 | sort | uniq` echo $PROVIDERMODULES if test x"$PROVIDERMODULES" == x then @@ -240,7 +239,7 @@ echo "Error: wbemexec not found" >&2 return 1 fi - CLASSES=`cat $myregs 2> /dev/null | cut -d ' ' -f 1` + CLASSES=`cat $myregs 2> /dev/null | grep -v '^[[:space:]]*#.*' | cut -d ' ' -f 1` for cls in $CLASSES do echo Delete CIM Class $cls @@ -278,8 +277,7 @@ #produce sfcb registraion for rf in $regfiles do - echo $rf - while read CLASSNAME NAMESPACE PROVIDERNAME PROVIDERMODULE CAPS + cat $rf | grep -v '^[[:space:]]*#.*' | while read CLASSNAME NAMESPACE PROVIDERNAME PROVIDERMODULE CAPS do cat >> $OUTFILE <<EOFC [$CLASSNAME] @@ -289,7 +287,7 @@ namespace: $NAMESPACE # EOFC - done < $rf + done done } @@ -421,10 +419,44 @@ function usage() { - echo "usage: $0 [-h] [-d] -t <cimserver> -r regfile [-r regfile ...] mof ..." + echo "usage: $0 [-h] [-d] -t <cimserver> -r regfile ... -m mof ..." } -args=`getopt dht:r:s: $*` +function gb_getopt() +{ + rmode=0 + mmode=0 + options= + moffiles= + registrations= + while [ -n "$1" ] + do + case $1 in + -r) mmode=0; + rmode=1; + shift;; + -m) mmode=1; + rmode=0; + shift;; + -*) mmode=0; + rmode=0; + options="$options $1"; + shift;; + **) if [ $mmode == 1 ] + then moffiles="$moffiles $1" + elif [ $rmode == 1 ] + then registrations="$registrations -r $1" + else options="$options $1"; + fi; + shift;; + esac + done + echo $options $registrations $moffiles +} + + +prepargs=`gb_getopt $*` +args=`getopt dht:r: $prepargs` if [ $? != 0 ] then |
From: Viktor M. <mih...@us...> - 2005-04-26 16:39:51
|
Update of /cvsroot/sblim/cmpi-base/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27294/mof Modified Files: Linux_Base.registration Linux_BaseIndication.registration Log Message: Bug 1183788: added comments to registration file syntax and made the multi-registration file syntax more Makefile-friendly. Index: Linux_BaseIndication.registration =================================================================== RCS file: /cvsroot/sblim/cmpi-base/mof/Linux_BaseIndication.registration,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Linux_BaseIndication.registration 25 Apr 2005 17:07:28 -0000 1.1 +++ Linux_BaseIndication.registration 26 Apr 2005 16:39:40 -0000 1.2 @@ -1,3 +1,4 @@ +# Classname Namespace ProviderName ProviderModule ProviderTypes ... Linux_Processor root/cimv2 OSBase_ProcessorProvider cmpiOSBase_ProcessorProvider instance Linux_UnixProcess root/cimv2 OSBase_UnixProcessProvider cmpiOSBase_UnixProcessProvider instance Linux_ComputerSystem root/cimv2 OSBase_ComputerSystemProvider cmpiOSBase_ComputerSystemProvider instance Index: Linux_Base.registration =================================================================== RCS file: /cvsroot/sblim/cmpi-base/mof/Linux_Base.registration,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Linux_Base.registration 25 Apr 2005 17:07:28 -0000 1.1 +++ Linux_Base.registration 26 Apr 2005 16:39:40 -0000 1.2 @@ -1,3 +1,4 @@ +# Classname Namespace ProviderName ProviderModule ProviderTypes ... Linux_Processor root/cimv2 OSBase_ProcessorProvider cmpiOSBase_ProcessorProvider instance Linux_UnixProcess root/cimv2 OSBase_UnixProcessProvider cmpiOSBase_UnixProcessProvider instance Linux_ComputerSystem root/cimv2 OSBase_ComputerSystemProvider cmpiOSBase_ComputerSystemProvider instance |
From: Adrian S. <a3s...@us...> - 2005-04-26 14:49:42
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3333 Added Files: mlog.c mlog.h Log Message: Added logging code from gatherer - not yet exploited --- NEW FILE: mlog.h --- /* * $Id: mlog.h,v 1.1 2005/04/26 14:49:29 a3schuur Exp $ * * (C) Copyright IBM Corp. 2003, 2004 * * 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: Viktor Mihajlovski <mih...@de...m> * Contributors: * * Description: Logging * */ #ifndef MLOG_H #define MLOG_H #define M_DEBUG 1 #define M_INFO 2 #define M_ERROR 3 #define M_SHOW 1 #define M_QUIET 0 void m_start_logging(const char *name); void m_log(int priority, int errout, const char* fmt, ...); #endif --- NEW FILE: mlog.c --- /* * $Id: mlog.c,v 1.1 2005/04/26 14:49:29 a3schuur Exp $ * * (C) Copyright IBM Corp. 2003, 2004 * * 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: Viktor Mihajlovski <mih...@de...m> * Contributors: Michael Schuele <sch...@de...> * * Description: Metric Defintiona and Value data types. * */ const char *_mlog_id = "$Id: mlog.c,v 1.1 2005/04/26 14:49:29 a3schuur Exp $"; #include "mlog.h" #include <syslog.h> #include <stdarg.h> #include <stdio.h> void m_start_logging(const char *name) { openlog(name,LOG_PID,LOG_DAEMON); setlogmask(LOG_UPTO(LOG_INFO)); } void m_log(int priority, int errout, const char *fmt, ...) { va_list ap; int priosysl; char buf[4096]; switch (priority) { case M_DEBUG: priosysl=LOG_DEBUG; break; case M_INFO: priosysl=LOG_INFO; break; case M_ERROR: default: priosysl=LOG_ERR; break; } va_start(ap,fmt); vsnprintf(buf,4096,fmt,ap); syslog(priosysl,buf); if (errout) { vfprintf(stderr,fmt,ap); } va_end(ap); } |
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17647 Modified Files: brokerEnc.c cimXmlGen.c cimXmlRequest.c constClass.c indCIMXMLExport.c indCIMXMLHandler.c instance.c internalProvider.c interopProvider.c msgqueue.c objectImpl.c objectpath.c providerDrv.c providerMgr.c providerRegister.c queryOperation.c queryParser.y result.c selectexp.c sfcBasicAuthentication.c sfcBroker.c support.c value.c Log Message: Fixed [ 1185287 ] remove sfcb compile warnings Removed all warnings but two yyunput and messages from authorizationProvider. Index: providerRegister.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerRegister.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- providerRegister.c 12 Apr 2005 07:57:08 -0000 1.5 +++ providerRegister.c 26 Apr 2005 14:11:21 -0000 1.6 @@ -33,6 +33,8 @@ static ProviderInfo forceNotFound={"",FORCE_PROVIDER_NOTFOUND}; extern int exFlags; extern char * configfile; +extern int setupControl(char *fn); +extern int getControlChars(char *id, char **val); ProviderInfo *classProvInfoPtr = NULL; ProviderInfo *defaultProvInfoPtr = NULL; Index: objectpath.c =================================================================== RCS file: /cvsroot/sblim/sfcb/objectpath.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- objectpath.c 25 Apr 2005 14:40:42 -0000 1.3 +++ objectpath.c 26 Apr 2005 14:11:20 -0000 1.4 @@ -156,8 +156,8 @@ } else if (rv.type == CMPI_ref) { char *msg=""; - rv.value.ref = getObjectPath(ClObjectGetClString - (&cop->hdr, (ClString *) & rv.value.chars), &msg); + rv.value.ref = getObjectPath( + (char*)ClObjectGetClString(&cop->hdr, (ClString *) & rv.value.chars), &msg); } else if (rv.type & CMPI_ARRAY) { // should nor occcur rv.value.array = @@ -179,7 +179,7 @@ if (name) *name = native_new_CMPIString(n, NULL); - return rv; + return rv; } CMPIData __oft_getKey(CMPIObjectPath * op, const char *id, CMPIStatus * rc) Index: cimXmlGen.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlGen.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- cimXmlGen.c 25 Apr 2005 14:40:41 -0000 1.5 +++ cimXmlGen.c 26 Apr 2005 14:10:59 -0000 1.6 @@ -504,7 +504,7 @@ "<VALUE>TRUE</VALUE>\n</QUALIFIER>\n"); sb->ft->appendChars(sb, "<VALUE>"); sp = XMLEscape((char*)eo); - if (sp) freesp = 1; + if (sp) freesp = 1; sb->ft->appendChars(sb, "<![CDATA["); sb->ft->appendChars(sb, sp); sb->ft->appendChars(sb, "]]>"); Index: interopProvider.c =================================================================== RCS file: /cvsroot/sblim/sfcb/interopProvider.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- interopProvider.c 11 Apr 2005 23:13:41 -0000 1.5 +++ interopProvider.c 26 Apr 2005 14:11:20 -0000 1.6 @@ -779,6 +779,7 @@ if ((fi=getFilter(key))) { if (fi->useCount) setStatus(&st,CMPI_RC_ERR_FAILED,"Filter in use"); + else removeFilter(fi,key); } else setStatus(&st,CMPI_RC_ERR_NOT_FOUND,NULL); } @@ -818,7 +819,7 @@ CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, - char *methodName, + const char *methodName, CMPIArgs * in, CMPIArgs * out) { CMPIStatus st = { CMPI_RC_OK, NULL }; @@ -896,7 +897,7 @@ * Association MI Functions * ------------------------------------------------------------------ */ -CMPIStatus InteropProviderAssociationCleanup(CMPIInstanceMI * mi, +CMPIStatus InteropProviderAssociationCleanup(CMPIAssociationMI * mi, CMPIContext * ctx) { CMPIStatus st = { CMPI_RC_OK, NULL }; @@ -973,4 +974,4 @@ CMInstanceMIStub(InteropProvider, InteropProvider, _broker, CMNoHook); CMAssociationMIStub(InteropProvider, InteropProvider, _broker, CMNoHook); -CMMethodMIStub(InteropProvider, InteropProvider, _broker, CMNoHook); \ No newline at end of file +CMMethodMIStub(InteropProvider, InteropProvider, _broker, CMNoHook); Index: support.c =================================================================== RCS file: /cvsroot/sblim/sfcb/support.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- support.c 30 Mar 2005 11:38:13 -0000 1.4 +++ support.c 26 Apr 2005 14:11:21 -0000 1.5 @@ -370,12 +370,12 @@ if (mt==NULL) mt=__init_mt(); return mt; } - +/* static void memInit(int newProc) { __memInit(); } - +*/ /** Index: internalProvider.c =================================================================== RCS file: /cvsroot/sblim/sfcb/internalProvider.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- internalProvider.c 25 Apr 2005 15:16:47 -0000 1.3 +++ internalProvider.c 26 Apr 2005 14:11:19 -0000 1.4 @@ -20,7 +20,7 @@ * */ - + #include "cmpidt.h" #include "cmpift.h" @@ -61,14 +61,14 @@ return strcasecmp((char *) ((KeyIds *) arg1)->key->hdl, (char *) ((KeyIds *) arg2)->key->hdl); } - +/* static int cpy2lower(char *in, char *out) { int i = 0; while ((out[i] = tolower(in[i++])) != 0); return i - 1; } - +*/ static char copKey[8192]; static UtilStringBuffer *normalize_ObjectPath(CMPIObjectPath * cop) @@ -599,7 +599,6 @@ char *ns=(char*)CMGetNameSpace(cop,NULL)->hdl; CMPIStatus st = { CMPI_RC_OK, NULL }; CMPIUint32 newFlgs=FL_assocsOnly || CMPI_FLAG_DeepInheritance; - CMPIUint32 flgs=CMGetContextEntry(ctx,CMPIInvocationFlags,NULL).value.uint32; _SFCB_ENTER(TRACE_INTERNALPROVIDER, "getRefs"); @@ -712,7 +711,8 @@ CMPIString *tns=CMGetNameSpace(ref,NULL); if (tns==NULL || tns->hdl==NULL) CMSetNameSpace(ref,ns); UtilStringBuffer *an=NULL; - CMPIString *pn=CMObjectPathToString(ref,NULL); + // CMPIString *pn=CMObjectPathToString(ref,NULL); + pn=normalize_ObjectPath(ref); printf("ref::::: %s %s\n",(char*)tns->hdl,(char*)pn->hdl); if (objectPathEquals(pn,ref,&an,0)==0) { @@ -746,7 +746,7 @@ } } -CMPIStatus InternalProviderAssociationCleanup(CMPIInstanceMI * mi, CMPIContext * ctx) +CMPIStatus InternalProviderAssociationCleanup(CMPIAssociationMI * mi, CMPIContext * ctx) { CMPIStatus st = { CMPI_RC_OK, NULL }; _SFCB_ENTER(TRACE_INTERNALPROVIDER, "InternalProviderAssociationCleanup"); @@ -824,7 +824,7 @@ * Method MI Functions * ------------------------------------------------------------------ */ -CMPIStatus InternalProviderMethodCleanup(CMPIInstanceMI * mi, +CMPIStatus InternalProviderMethodCleanup(CMPIMethodMI * mi, CMPIContext * ctx) { CMPIStatus st = { CMPI_RC_OK, NULL }; @@ -835,7 +835,7 @@ CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, - char *methodName, + const char *methodName, CMPIArgs * in, CMPIArgs * out) { _SFCB_ENTER(TRACE_INTERNALPROVIDER, "InternalProviderInvokeMethod"); @@ -854,3 +854,4 @@ CMAssociationMIStub(InternalProvider, InternalProvider, _broker, CMNoHook); CMMethodMIStub(InternalProvider, InternalProvider, _broker, CMNoHook); + Index: objectImpl.c =================================================================== RCS file: /cvsroot/sblim/sfcb/objectImpl.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- objectImpl.c 25 Apr 2005 14:40:42 -0000 1.3 +++ objectImpl.c 26 Apr 2005 14:11:20 -0000 1.4 @@ -1954,13 +1954,9 @@ ClProperty *p; p = (ClProperty *) ClObjectGetClSection(&op->hdr, &op->properties); - if (id < 0 || id > op->properties.used) - return 1; - if (data) - *data = (p + id)->data; - if (name) -// *name = strdup(ClObjectGetClString(&op->hdr, &(p + id)->id)); - *name = ClObjectGetClString(&op->hdr, &(p + id)->id); + if (id < 0 || id > op->properties.used) return 1; + if (data) *data = (p + id)->data; + if (name) *name = (char*)ClObjectGetClString(&op->hdr, &(p + id)->id); if (data->type == CMPI_chars) { const char *str = ClObjectGetClString(&op->hdr, (ClString *) & data->value.chars); @@ -2216,7 +2212,7 @@ CMPIArgs *narg = CMClone(arg, NULL); s = getArgsSerializedSize(arg); } - + { CMPIObjectPath *cop = NewCMPIObjectPath("root", "myClass", NULL); CMPIInstance *inst = NewCMPIInstance(cop, NULL); Index: constClass.c =================================================================== RCS file: /cvsroot/sblim/sfcb/constClass.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- constClass.c 11 Apr 2005 23:13:41 -0000 1.3 +++ constClass.c 26 Apr 2005 14:11:19 -0000 1.4 @@ -138,8 +138,8 @@ } else if (rv.type == CMPI_ref) { char *msg; - rv.value.ref = getObjectPath(ClObjectGetClString(&cls->hdr, - (ClString *) & rv.value.chars), &msg); + rv.value.ref = getObjectPath( + (char*)ClObjectGetClString(&cls->hdr,(ClString *) & rv.value.chars), &msg); } if (rv.type & CMPI_ARRAY) { rv.value.array = @@ -338,4 +338,4 @@ c.hdl=cl; c.ft=&ift; return c; -} \ No newline at end of file +} Index: cimXmlRequest.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlRequest.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- cimXmlRequest.c 25 Apr 2005 14:40:42 -0000 1.6 +++ cimXmlRequest.c 26 Apr 2005 14:10:59 -0000 1.7 @@ -90,7 +90,7 @@ "The extrinsic Method could not be executed", "The specified extrinsic Method does not exist" }; - +/* static char *cimMsgId[] = { "", "CIM_ERR_FAILED", @@ -111,7 +111,7 @@ "CIM_ERR_METHOD_NOT_AVAILABLE", "CIM_ERR_METHOD_NOT_FOUND", }; - +*/ static char iResponseIntro1[] = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" "<CIM CIMVERSION=\"2.0\" DTDVERSION=\"1.1\">\n" @@ -221,7 +221,7 @@ else snprintf(msg, sizeof(msg), "<ERROR CODE=\"%d\"/>\n", rc); return strdup(msg); } - +/* static char *getErrorSegment(CMPIStatus rc) { if (rc.msg && rc.msg->hdl) { @@ -229,7 +229,7 @@ } return getErrSegment(rc.rc, NULL); } - +*/ char *getErrTrailer(int id, int rc, char *m) { char msg[1024]; Index: indCIMXMLExport.c =================================================================== RCS file: /cvsroot/sblim/sfcb/indCIMXMLExport.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- indCIMXMLExport.c 9 Mar 2005 12:25:12 -0000 1.1.1.1 +++ indCIMXMLExport.c 26 Apr 2005 14:11:19 -0000 1.2 @@ -314,16 +314,16 @@ } init(&cd); - if ((rc=genRequest(&cd,url,&msg))==0) { - if ((rc=addPayload(&cd,payload,&msg))==0) { - if ((rc=getResponse(&cd,&msg))==0) { + if ((rc=genRequest(&cd,url,msg))==0) { + if ((rc=addPayload(&cd,payload,msg))==0) { + if ((rc=getResponse(&cd,msg))==0) { *resp=strdup(cd.mResponse->ft->getCharPtr(cd.mResponse)); } } } // _SFCB_TRACE(1,("--- url: %s rc: %d %s",url,rc,msg)); - printf("--- url: %s rc: %d %s\n",url,rc,msg); + printf("--- url: %s rc: %d %s\n",url,rc,*msg); uninit(&cd); Index: queryParser.y =================================================================== RCS file: /cvsroot/sblim/sfcb/queryParser.y,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- queryParser.y 13 Mar 2005 23:47:16 -0000 1.3 +++ queryParser.y 26 Apr 2005 14:11:21 -0000 1.4 @@ -65,12 +65,16 @@ #define YYPARSE_PARAM parm #define YYLEX_PARAM parm -#define YYERROR_VERBOSE 1 +#define YYERROR_VERBOSE 1 extern int yylex(); extern void sfcQueryErr(char*,char*,char*); extern void yyError(char*); extern void yyerror(char*); +extern void sfcQueryError(char* s1); +extern char * qsStrDup(QLStatement *qs, char *str); +extern QLOperand* newNameQueryOperand(QLStatement *qs, char* val); + #define sfcQueryerror sfcQueryError #define yyErr sfcQueryErr Index: sfcBasicAuthentication.c =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcBasicAuthentication.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- sfcBasicAuthentication.c 9 Mar 2005 12:25:14 -0000 1.1.1.1 +++ sfcBasicAuthentication.c 26 Apr 2005 14:11:21 -0000 1.2 @@ -21,6 +21,7 @@ #include <stdio.h> +#include <string.h> extern int _sfcBasicAuthenticate(char *user, char *pw) { Index: instance.c =================================================================== RCS file: /cvsroot/sblim/sfcb/instance.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- instance.c 11 Apr 2005 23:13:41 -0000 1.3 +++ instance.c 26 Apr 2005 14:11:19 -0000 1.4 @@ -163,8 +163,8 @@ } else if (rv.type == CMPI_ref) { char *msg; - rv.value.ref = getObjectPath(ClObjectGetClString - (&inst->hdr, (ClString *) & rv.value.chars), &msg); + rv.value.ref = getObjectPath( + (char*)ClObjectGetClString(&inst->hdr, (ClString*)&rv.value.chars), &msg); } else if (rv.type & CMPI_ARRAY) { rv.value.array = @@ -240,7 +240,6 @@ CMPIStatus * rc) { static UtilHashTable *klt = NULL; - struct native_instance *i = (struct native_instance *) instance; int j, f = 0; CMPIStatus tmp; const char *cn = ClInstanceGetClassName((ClInstance *) instance->hdl); @@ -272,7 +271,6 @@ CMPIData d; CMPIContext *ctx; unsigned int e, m; - static int count=0; if (klt == NULL) klt = UtilFactory->newHashTable(61, UtilHashTable_charKey | UtilHashTable_ignoreKeyCase); Index: value.c =================================================================== RCS file: /cvsroot/sblim/sfcb/value.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- value.c 9 Mar 2005 12:25:14 -0000 1.1.1.1 +++ value.c 26 Apr 2005 14:11:21 -0000 1.2 @@ -88,7 +88,7 @@ case CMPI_class: cl=(CMPIConstClass*)val->inst; - v.inst = CMClone(cl, rc); + v.inst = (CMPIInstance*)CMClone(cl, rc); break; case CMPI_ref: Index: sfcBroker.c =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcBroker.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- sfcBroker.c 25 Apr 2005 23:32:42 -0000 1.7 +++ sfcBroker.c 26 Apr 2005 14:11:21 -0000 1.8 @@ -48,6 +48,8 @@ extern void initHttpProcCtl(int); extern void initProvProcCtl(int); extern void processTerminated(int pid); +extern int httpDaemon(int argc, char *argv[], int sslMode, int pid); +extern void processProviderMgrRequests(); extern int stopNextProc(); extern int testStartedProc(int pid, int *left); @@ -71,7 +73,7 @@ extern char * configfile; -static char * copyright = "(C) Copyright IBM Corp. 2005"; +char * copyright = "(C) Copyright IBM Corp. 2005"; void clean_up(int sd, const char *the_file) { @@ -272,15 +274,13 @@ fprintf(stderr, "-#- %s - %d exiting due to a SIGSEGV signal\n", processName, currentProc); } - +/* static void handleSigAbort(int sig) { fprintf(stderr, "%s: exiting due to a SIGABRT signal - %d\n", processName, currentProc); kill(0, SIGTERM); } - -extern int httpDaemon(int argc, char *argv[], int sslMode, int pid); -extern void processProviderMgrRequests(); +*/ int startHttpd(int argc, char *argv[], int sslMode) { Index: result.c =================================================================== RCS file: /cvsroot/sblim/sfcb/result.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- result.c 9 Mar 2005 12:25:14 -0000 1.1.1.1 +++ result.c 26 Apr 2005 14:11:21 -0000 1.2 @@ -147,8 +147,8 @@ pos=nr->dNext; nr->dNext+=length; - npos=nr->data+pos; - _SFCB_RETURN(npos); + npos=(int)(nr->data+pos); + _SFCB_RETURN((void*)npos); } /*****************************************************************************/ Index: providerMgr.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerMgr.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- providerMgr.c 25 Apr 2005 23:21:28 -0000 1.6 +++ providerMgr.c 26 Apr 2005 14:11:21 -0000 1.7 @@ -95,7 +95,7 @@ free(req); } - +/* static void handleSigterm(int sig) { fprintf(stderr, "%s: exiting due to signal %d\n", "provider", sig); @@ -108,7 +108,7 @@ currentProc, sig, __FILE__, __LINE__); abort(); } - +*/ /* ------------- Index: indCIMXMLHandler.c =================================================================== RCS file: /cvsroot/sblim/sfcb/indCIMXMLHandler.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- indCIMXMLHandler.c 9 Mar 2005 12:25:12 -0000 1.1.1.1 +++ indCIMXMLHandler.c 26 Apr 2005 14:11:19 -0000 1.2 @@ -224,7 +224,7 @@ CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, - char *methodName, + const char *methodName, CMPIArgs * in, CMPIArgs * out) { CMPIStatus st = { CMPI_RC_OK, NULL }; @@ -252,7 +252,7 @@ sprintf(strId,"%d",id++); xs=exportIndicationReq(ind,strId); sb=segments2stringBuffer(xs.segments); - exportIndication((char*)dest->hdl,sb->ft->getCharPtr(sb), &resp, &msg); + exportIndication((char*)dest->hdl,(char*)sb->ft->getCharPtr(sb), &resp, &msg); } else { Index: selectexp.c =================================================================== RCS file: /cvsroot/sblim/sfcb/selectexp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- selectexp.c 12 Mar 2005 00:43:00 -0000 1.2 +++ selectexp.c 26 Apr 2005 14:11:21 -0000 1.3 @@ -201,7 +201,7 @@ exp->exp = eFt; exp->qs=qs; - return exp; + return (CMPISelectExp*)exp; } Index: brokerEnc.c =================================================================== RCS file: /cvsroot/sblim/sfcb/brokerEnc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- brokerEnc.c 9 Mar 2005 12:25:08 -0000 1.1.1.1 +++ brokerEnc.c 26 Apr 2005 14:10:59 -0000 1.2 @@ -33,7 +33,7 @@ extern CMPIInstanceFT *CMPI_Instance_FT; extern CMPIString *__oft_toString(CMPIObjectPath * cop, CMPIStatus * rc); extern CMPIString *instance2String(CMPIInstance * inst, CMPIStatus * rc); -extern int verifyPropertyList(CMPIObjectPath * cop, char **list); +extern int verifyPropertyList(CMPIConstClass * cls, char **list); extern CMPISelectExp *TrackedCMPISelectExp(const char *queryString, const char *language, CMPIArray ** projection, CMPIStatus * rc); Index: queryOperation.c =================================================================== RCS file: /cvsroot/sblim/sfcb/queryOperation.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- queryOperation.c 13 Mar 2005 23:47:16 -0000 1.3 +++ queryOperation.c 26 Apr 2005 14:11:21 -0000 1.4 @@ -28,6 +28,7 @@ #include "queryOperation.h" extern CMPIArray *TrackedCMPIArray(CMPICount size, CMPIType type, CMPIStatus * rc); +extern void native_array_increase_size(CMPIArray * array, CMPICount increment); static char *types[]={ "-inv-", @@ -480,11 +481,6 @@ (op->rhon ? op->rhon->ft->evaluate(op->rhon,source) : 1)); } -static int andEvaluate(QLOperation *op, QLPropertySource* source) -{ - return op->ft->_evaluate(op,source); -} - static char *andToString(QLOperation *op) { return opnToChars(op,(op->flag.invert ? "QL_OR" : "QL_AND"),NULL); Index: providerDrv.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- providerDrv.c 25 Apr 2005 14:40:42 -0000 1.7 +++ providerDrv.c 26 Apr 2005 14:11:21 -0000 1.8 @@ -748,11 +748,8 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); - CMPIArray *r; - CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; - int i; ctx->ft->addEntry(ctx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32); ctx->ft->addEntry(ctx,CMPIPrincipal,(CMPIValue*)&req->principal.data,CMPI_chars); @@ -1418,7 +1415,7 @@ CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); CMPIFlags flgs=0; - int makeActive=0,mustPoll=0; + int makeActive=0; char *type; ctx->ft->addEntry(ctx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32); Index: msgqueue.c =================================================================== RCS file: /cvsroot/sblim/sfcb/msgqueue.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- msgqueue.c 13 Apr 2005 15:15:41 -0000 1.3 +++ msgqueue.c 26 Apr 2005 14:11:20 -0000 1.4 @@ -527,4 +527,4 @@ sp->send=0; } _SFCB_EXIT(); -} \ No newline at end of file +} |
From: Viktor M. <mih...@us...> - 2005-04-26 13:24:21
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25228 Modified Files: configure.ac getSchema.sh.pre.in Log Message: Bug 1187619: added -f option for getSchema.sh. Bug 1186414: changed package name to sblim-sfcb. Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/sfcb/configure.ac,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- configure.ac 20 Apr 2005 17:00:27 -0000 1.8 +++ configure.ac 26 Apr 2005 13:23:55 -0000 1.9 @@ -21,7 +21,7 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(Small Footprint CIM Broker, 0.8.7a, sc...@de..., sfcb) +AC_INIT(Small Footprint CIM Broker, 0.8.8, sc...@de..., sblim-sfcb) AC_CONFIG_SRCDIR([providerDrv.c]) AM_INIT_AUTOMAKE Index: getSchema.sh.pre.in =================================================================== RCS file: /cvsroot/sblim/sfcb/getSchema.sh.pre.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- getSchema.sh.pre.in 1 Apr 2005 15:19:29 -0000 1.4 +++ getSchema.sh.pre.in 26 Apr 2005 13:23:55 -0000 1.5 @@ -3,20 +3,56 @@ trap "rm -f /tmp/cimv290.zip" exit -if test $# == 1; then +function usage() +{ + echo usage: $1 [schemadir] >&2 +} + +args=`getopt f $*` + +if [ $? != 0 ] +then + usage $0 + exit 1 +fi + +set -- $args + +force=0 +while [ -n "$1" ] +do + case $1 in + -f) force=1 + shift;; + --) shift; + break;; + esac +done + +if [ $# == 1 ]; then sfcbdir=$1 -elif test $# == 0; then +elif [ $# == 0 ]; then sfcbdir=@datadir@/sfcb else - echo usage: $0 [schemadir] + usage $0 + exit 1 fi if [ -x /usr/bin/curl ] then - if [ ! -f $sfcbdir/CIM/CIM_Schema.mof ] + if [ ! -f $sfcbdir/CIM/CIM_Schema.mof ] || [ $force == 1 ] then echo "Fetching CIM Schema from DMTF homepage ..." - [ -d $sfcbdir/CIM ] || mkdir -p $sfcbdir/CIM + if [ -d $sfcbdir/CIM ] + then + rm -rf $sfcbdir/CIM + if [ $? != 0 ] + then + echo "Failed to delete schema directory $sfcbdir/CIM" >&2 + exit 1 + fi + fi + mkdir -p $sfcbdir/CIM if [ $? == 0 ]; then /usr/bin/curl -o /tmp/cimv290.zip \ http://www.dmtf.org/standards/cim/cim_schema_v29/CIM_V2.9.0Final-MOFs.zip && |
From: Adrian S. <a3s...@us...> - 2005-04-25 23:42:36
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9087 Modified Files: httpAdapter.c Log Message: Fixed [ 1185276 ] 2nd sfcbd fails to terminate and hangs shutting down httpAdapter now issuing kill(sfcbPid,3); Index: httpAdapter.c =================================================================== RCS file: /cvsroot/sblim/sfcb/httpAdapter.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- httpAdapter.c 13 Apr 2005 15:15:41 -0000 1.5 +++ httpAdapter.c 25 Apr 2005 23:42:28 -0000 1.6 @@ -882,8 +882,8 @@ if (bind(listenFd, (struct sockaddr *) &sin, sin_len) || listen(listenFd, 0)) { printf("--- Cannot listen on port %ld\n", port); - kill(sfcbPid,2); - exit(3); + kill(sfcbPid,3); +// exit(3); } if (!debug) { |
From: Adrian S. <a3s...@us...> - 2005-04-25 23:33:03
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3574 Modified Files: sfcBroker.c Log Message: Fixed 1184983 -tm and -c without a value Index: sfcBroker.c =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcBroker.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- sfcBroker.c 13 Apr 2005 15:15:42 -0000 1.6 +++ sfcBroker.c 25 Apr 2005 23:32:42 -0000 1.7 @@ -335,7 +335,7 @@ daemon(0,0); else if (strcmp(argv[i], "-v") == 0) exFlags |= 1; - else if (strcmp(argv[i], "-tm") == 0) { + else if (strcmp(argv[i], "-tm") == 0 && i<(argc-1)) { if (*argv[i+1]=='?') { fprintf(stdout,"--- -tm values:\n"); for (i=0; traceIds[i].id; i++) @@ -346,7 +346,7 @@ tmask = atoi(argv[++i]); } } - else if (strcmp(argv[i], "-c") == 0) { + else if (strcmp(argv[i], "-c") == 0 && i<(argc-1)) { configfile = strdup(argv[++i]); } else if (strcmp(argv[i], "-F") == 0); |
From: Adrian S. <a3s...@us...> - 2005-04-25 23:21:36
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30689 Modified Files: providerMgr.c Log Message: Fixed 1184962. Incorrect free() in providerMgr.c Index: providerMgr.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerMgr.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- providerMgr.c 13 Apr 2005 15:15:42 -0000 1.5 +++ providerMgr.c 25 Apr 2005 23:21:28 -0000 1.6 @@ -840,7 +840,7 @@ unsigned long size = ctx->bHdrSize; char *buf; BinRequestHdr *hdr = ctx->bHdr; - BinResponseHdr *resp; + BinResponseHdr *resp=NULL; int fromS; void *heapCtl=markHeap(); @@ -921,8 +921,8 @@ void *hc=markHeap(); if (resp) free(resp); + resp=NULL; spRecvResult(&resultSockets.receive, &fromS, (void**) &resp, &size); -// dump("result: ",resp,size); //asm("int $3"); for (i = 0; i < resp->count; i++) { resp->object[i].data=(void*)((int)resp->object[i].data+(char*)resp); } @@ -936,7 +936,8 @@ releaseHeap(hc); } while (resp->moreChunks); - if (resp) free(resp); +// if (resp) free(resp); +// resp=NULL; } else if ((ctx->noResp & 1)==0) { |
From: Gareth S B. <bes...@us...> - 2005-04-25 23:21:10
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30357 Modified Files: Makefile.am Log Message: http://sourceforge.net/tracker/index.php?func=detail&aid=1181627&group_id=128809&atid=712784 install new wbemcat script to {prefix}/bin Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.am 25 Apr 2005 22:14:25 -0000 1.11 +++ Makefile.am 25 Apr 2005 23:21:01 -0000 1.12 @@ -164,6 +164,8 @@ nodist_bin_SCRIPTS=sfcbrepos sfcbstage sfcbunstage +dist_bin_SCRIPTS=wbemcat + sfcbrepos: sfcbrepos.sh sed s?$$\{prefix\}?$(prefix)?g $< > $@ |
From: Gareth S B. <bes...@us...> - 2005-04-25 23:19:43
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28920 Added Files: wbemcat Log Message: http://sourceforge.net/tracker/index.php?func=detail&aid=1181627&group_id=128809&atid=712784 added wbemcat to sfcb base install existing wbemcat in regressionTests/scripts will be deprecated --- NEW FILE: wbemcat --- #!/usr/bin/perl # $Id: # ============================================================================ # wbemcat # # (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: Adrian Schuur, <sc...@de...> # Contributors: Dr. Gareth S. Bestor, <bes...@us...> # Last Updated: April 25, 2005 # Description: # Utility to send CIM-XML request file to a CIMOM and display # the response/results. Default CIMOM is localhost:5988. # If no input file is specified then get XML data from stdin. # ============================================================================ use strict; use Getopt::Long; # Defaults my $port = 5988; my $host = "localhost"; # Usage description sub usage { print "Usage: wbemcat [OPTION]... [FILE]\n"; print "Send FILE containing CIM-XML data to CIMOM and display returned data.\n"; print "If no input FILE specified then read the data from stdin.\n"; print "\nOptions:\n"; print " -h, --host=HOSTNAME\tName of host running the CIMOM. Default=$host\n"; print " -p, --port=PORT\tPort that the CIMOM is listening on. Default=$port\n"; print "\t-?, --help\tDisplay this help and exit\n"; die "\n"; } # Process command line options, if any GetOptions("host|h=s" => \$host, "port|p=i" => \$port, "help|?" => sub{usage}) || usage; my $file = @ARGV[0]; # Read all the XML data from the input file my @xml; if ($file) { open(XMLFILE,"<$file") || die "Cannot open $file: $!"; @xml = (<XMLFILE>); close(XMLFILE) || warn "Cannot close $file: $!"; } else { # If no input file specified then read XML data from stdin @xml = (<STDIN>); } # Calculate size of XML data my $size = 0; foreach $_ (@xml) { $size += length($_); } if ($size == 0) { die "No CIM-XML data"; } # Necessary preamble specifying the length of the CIM-XML data my @preamble = ("POST /cimom HTTP/1.1\n", "Host:\n", "Content-Type: application/xml; charset=\"utf-8\"\n". "Content-Length: ", $size, "\n\n\n"); # Pipe STDOUT to nc command # DEBUG: Comment out this line to see what data gets sent to the CIMOM open(STDOUT, "| nc $host $port") || die "Cannot fork nc command: $!"; # Send preamble and XML data to CIMOM via STDOUT pipe print @preamble; print @xml; close(STDOUT) || warn "Cannot close STDOUT"; |
From: Gareth S B. <bes...@us...> - 2005-04-25 22:14:52
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24394 Modified Files: Makefile.am Log Message: http://sourceforge.net/tracker/index.php?func=detail&aid=1181087&group_id=128809&atid=712784 added postinstall rule http://sourceforge.net/tracker/index.php?func=detail&aid=1181087&group_id=128809&atid=712784 mkdir ./registration/repository mkdir ./stage/mofs mkdir ./stage.regs copy default.reg to providerRegister is latter missing on install Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.am 20 Apr 2005 17:00:26 -0000 1.10 +++ Makefile.am 25 Apr 2005 22:14:25 -0000 1.11 @@ -193,8 +193,9 @@ install-data-local: sfcb.cfg test -d $(DESTDIR)$(sysconfdir)/sfcb || $(mkdir_p) $(DESTDIR)$(sysconfdir)/sfcb $(INSTALL_DATA) sfcb.cfg $(DESTDIR)$(sysconfdir)/sfcb - test -d $(DESTDIR)$(sfcbstatedir)/registration || $(mkdir_p) $(DESTDIR)$(sfcbstatedir)/registration - test -d $(DESTDIR)$(sfcbstatedir)/stage || $(mkdir_p) $(DESTDIR)$(sfcbstatedir)/stage + test -d $(DESTDIR)$(sfcbstatedir)/registration/repository || $(mkdir_p) $(DESTDIR)$(sfcbstatedir)/registration/repository + test -d $(DESTDIR)$(sfcbstatedir)/stage/mofs || $(mkdir_p) $(DESTDIR)$(sfcbstatedir)/stage/mofs + test -d $(DESTDIR)$(sfcbstatedir)/stage/regs || $(mkdir_p) $(DESTDIR)$(sfcbstatedir)/stage/regs $(INSTALL_DATA) $(srcdir)/default.reg $(DESTDIR)$(sfcbstatedir)/stage test -d $(DESTDIR)$(sfcbdocdir) || $(mkdir_p) $(DESTDIR)$(sfcbdocdir) $(INSTALL_DATA) $(srcdir)/README $(srcdir)/AUTHORS $(srcdir)/COPYING $(DESTDIR)$(sfcbdocdir) @@ -219,3 +220,7 @@ install-cimschema: getSchema.sh test -d $(DESTDIR)$(pkgdatadir) || $(mkdir_p) $(DESTDIR)$(pkgdatadir) sh getSchema.sh $(DESTDIR)$(pkgdatadir) + +postinstall: install-cimschema + test -f $(DESTDIR)$(sfcbstatedir)/registration/providerRegister || $(INSTALL_DATA) $(DESTDIR)$(sfcbstatedir)/stage/default.reg $(DESTDIR)$(sfcbstatedir)/registration/providerRegister + |
From: Viktor M. <mih...@us...> - 2005-04-25 17:07:54
|
Update of /cvsroot/sblim/cmpi-base/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10323/mof Modified Files: Linux_Base.sfcb.reg Added Files: Linux_Base.registration Linux_BaseIndication.registration Log Message: Bug 1183788: Added support for deinstallation/deregistration of providers. Both for Makefile and RPM installs. --- NEW FILE: Linux_BaseIndication.registration --- Linux_Processor root/cimv2 OSBase_ProcessorProvider cmpiOSBase_ProcessorProvider instance Linux_UnixProcess root/cimv2 OSBase_UnixProcessProvider cmpiOSBase_UnixProcessProvider instance Linux_ComputerSystem root/cimv2 OSBase_ComputerSystemProvider cmpiOSBase_ComputerSystemProvider instance Linux_OperatingSystem root/cimv2 OSBase_OperatingSystemProvider cmpiOSBase_OperatingSystemProvider instance indication Linux_OperatingSystemStatisticalData root/cimv2 OSBase_OperatingSystemStatisticalDataProvider cmpiOSBase_OperatingSystemStatisticalDataProvider instance Linux_BaseBoard root/cimv2 OSBase_BaseBoardProvider cmpiOSBase_BaseBoardProvider instance Linux_RunningOS root/cimv2 OSBase_RunningOSProvider cmpiOSBase_RunningOSProvider instance association Linux_OSProcess root/cimv2 OSBase_OSProcessProvider cmpiOSBase_OSProcessProvider instance association Linux_OperatingSystemStatistics root/cimv2 OSBase_OperatingSystemStatisticsProvider cmpiOSBase_OperatingSystemStatisticsProvider instance association Linux_CSProcessor root/cimv2 OSBase_CSProcessorProvider cmpiOSBase_CSProcessorProvider instance association Linux_CSBaseBoard root/cimv2 OSBase_CSBaseBoardProvider cmpiOSBase_CSBaseBoardProvider instance association Index: Linux_Base.sfcb.reg =================================================================== RCS file: /cvsroot/sblim/cmpi-base/mof/Linux_Base.sfcb.reg,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Linux_Base.sfcb.reg 20 Apr 2005 11:34:56 -0000 1.2 +++ Linux_Base.sfcb.reg 25 Apr 2005 17:07:28 -0000 1.3 @@ -61,6 +61,6 @@ # [Linux_CSBaseBoard] provider: OSBase_CSBaseBoardProvider - location: cmpiOSBase_CSBaseBoardProvider + location: cmpiOSBase_CSBaseBoardProvider type: instance association namespace: root/cimv2 --- NEW FILE: Linux_Base.registration --- Linux_Processor root/cimv2 OSBase_ProcessorProvider cmpiOSBase_ProcessorProvider instance Linux_UnixProcess root/cimv2 OSBase_UnixProcessProvider cmpiOSBase_UnixProcessProvider instance Linux_ComputerSystem root/cimv2 OSBase_ComputerSystemProvider cmpiOSBase_ComputerSystemProvider instance Linux_OperatingSystem root/cimv2 OSBase_OperatingSystemProvider cmpiOSBase_OperatingSystemProvider instance Linux_OperatingSystemStatisticalData root/cimv2 OSBase_OperatingSystemStatisticalDataProvider cmpiOSBase_OperatingSystemStatisticalDataProvider instance Linux_BaseBoard root/cimv2 OSBase_BaseBoardProvider cmpiOSBase_BaseBoardProvider instance Linux_RunningOS root/cimv2 OSBase_RunningOSProvider cmpiOSBase_RunningOSProvider instance association Linux_OSProcess root/cimv2 OSBase_OSProcessProvider cmpiOSBase_OSProcessProvider instance association Linux_OperatingSystemStatistics root/cimv2 OSBase_OperatingSystemStatisticsProvider cmpiOSBase_OperatingSystemStatisticsProvider instance association Linux_CSProcessor root/cimv2 OSBase_CSProcessorProvider cmpiOSBase_CSProcessorProvider instance association Linux_CSBaseBoard root/cimv2 OSBase_CSBaseBoardProvider cmpiOSBase_CSBaseBoardProvider instance association |
From: Viktor M. <mih...@us...> - 2005-04-25 17:07:37
|
Update of /cvsroot/sblim/cmpi-base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10323 Modified Files: Makefile.am provider-register.sh sblim-cmpi-base.spec.in Log Message: Bug 1183788: Added support for deinstallation/deregistration of providers. Both for Makefile and RPM installs. Index: sblim-cmpi-base.spec.in =================================================================== RCS file: /cvsroot/sblim/cmpi-base/sblim-cmpi-base.spec.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- sblim-cmpi-base.spec.in 13 Apr 2005 13:01:11 -0000 1.2 +++ sblim-cmpi-base.spec.in 25 Apr 2005 17:07:27 -0000 1.3 @@ -48,7 +48,7 @@ %build -%configure TESTSUITEDIR=%{_datadir}/sblim-testsuite +%configure TESTSUITEDIR=%{_datadir}/sblim-testsuite CIMSERVER=@CIMSERVER@ make %clean @@ -78,22 +78,22 @@ %if "@LINDHELP@" != "" %define SCHEMA %{_datadir}/%{name}/Linux_Base.mof %{_datadir}/%{name}/Linux_BaseIndication.mof -%define REGISTRATION_pegasus %{_datadir}/%{name}/Linux_BaseRegistration.mof %{_datadir}/%{name}/Linux_BaseIndicationReg.mof -%define REGISTRATION_sfcb %{_datadir}/%{name}/Linux_Base.sfcb.reg %{_datadir}/%{name}/Linux_BaseIndication.sfcb.reg +%define REGISTRATION %{_datadir}/%{name}/Linux_BaseIndication.registration %else %define SCHEMA %{_datadir}/%{name}/Linux_Base.mof -%define REGISTRATION_pegasus %{_datadir}/%{name}/Linux_BaseRegistration.mof -%define REGISTRATION_sfcb %{_datadir}/%{name}/Linux_Base.sfcb.reg +%define REGISTRATION %{_datadir}/%{name}/Linux_Base.registration %endif %{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \ - -s %{SCHEMA} > /dev/null - -%{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \ - -r %{REGISTRATION_@CIMSERVER@} > /dev/null + -r %{REGISTRATION} %{SCHEMA} > /dev/null /sbin/ldconfig +%preun + +%{_datadir}/%{name}/provider-register.sh -d -t @CIMSERVER@ \ + -r %{REGISTRATION} %{SCHEMA} > /dev/null + %postun /sbin/ldconfig Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/cmpi-base/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 20 Apr 2005 11:34:56 -0000 1.5 +++ Makefile.am 25 Apr 2005 17:07:21 -0000 1.6 @@ -152,22 +152,11 @@ # if NOEVENTS SCHEMAS=mof/Linux_Base.mof -REGISTRATIONS.pegasus=mof/Linux_BaseRegistration.mof -REGISTRATIONS.sfcb=mof/Linux_Base.sfcb.reg -REGISTRATIONS.openwbem= -REGISTRATIONS.sniacimom= +REGISTRATIONS=mof/Linux_Base.registration else SCHEMAS=mof/Linux_Base.mof mof/Linux_BaseIndication.mof -REGISTRATIONS.pegasus=mof/Linux_BaseRegistration.mof \ - mof/Linux_BaseIndicationReg.mof -REGISTRATIONS.sfcb=mof/Linux_Base.sfcb.reg mof/Linux_BaseIndication.sfcb.reg -REGISTRATIONS.openwbem= -REGISTRATIONS.sniacimom= +REGISTRATIONS=mof/Linux_BaseIndication.registration endif -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) @@ -176,10 +165,10 @@ # 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@) + sh provider-register.sh -t @CIMSERVER@ -r $(REGISTRATIONS) $(SCHEMAS) + +preuninstall: + sh provider-register.sh -d -t @CIMSERVER@ -r $(REGISTRATIONS) $(SCHEMAS) dist-hook: test -d "$(distdir)" && rm -rf `find $(distdir) -type d -name CVS` Index: provider-register.sh =================================================================== RCS file: /cvsroot/sblim/cmpi-base/provider-register.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- provider-register.sh 6 Apr 2005 16:29:47 -0000 1.1 +++ provider-register.sh 25 Apr 2005 17:07:22 -0000 1.2 @@ -12,68 +12,419 @@ # # Author: Viktor Mihajlovski <mih...@de...> # Contributors: -# Description: Script to install class definitions (MOFs) and registration data -# for a variety of supported CIMOMs +# Description: Script to install class definitions (MOFs) and +# registration data for a variety of supported CIMOMs # ================================================================== +function pegasus_path() +{ + for p in /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin \ + /opt/tog-pegasus/bin /opt/tog-pegasus/sbin + do + if test -x $p/$1 + then + echo $p/$1 + return 0 + fi + done + return 1 +} + +function pegasus_transform() +{ + OUTFILE=$1 + shift + regfiles=$* + PROVIDERMODULES=`cat $regfiles 2> /dev/null | cut -d ' ' -f 4 | sort | uniq` + if test x"$PROVIDERMODULES" == x + then + echo Failed to read registration files + return 1 + fi + PROVIDERS=`cat $regfiles 2> /dev/null | cut -d ' ' -f 3-4 | sort | uniq` + +# produce ProviderModules + echo > $OUTFILE + for pm in $PROVIDERMODULES + do + cat >> $OUTFILE <<EOFPM +instance of PG_ProviderModule +{ + Name = "$pm"; + Location = "$pm"; + Vendor = "SBLIM"; + Version = "2.0.0"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; +}; + +EOFPM + done + +# produce Providers + set -- $PROVIDERS + while test x$1 != x + do + cat >> $OUTFILE <<EOFP +instance of PG_Provider +{ + Name = "$1"; + ProviderModuleName = "$2"; +}; + +EOFP + shift 2 + done + +#produce Capabilities + for rf in $regfiles + do + echo $rf + while read CLASSNAME NAMESPACE PROVIDERNAME PROVIDERMODULE CAPS + do + numcap= + for cap in $CAPS + do + case $cap in + instance) + if test x$numcap == x + then numcap=2 + else numcap="$numcap, 2" + fi;; + association) + if test x$numcap == x + then numcap=3 + else numcap="$numcap, 3" + fi;; + indication) + if test x$numcap == x + then numcap=4 + else numcap="$numcap, 4" + fi;; + method) + if test x$numcap == x + then numcap=5 + else numcap="$numcap, 5" + fi;; + **) echo unknown provider type $cap + return 1;; + esac + done + cat >> $OUTFILE <<EOFC +instance of PG_ProviderCapabilities +{ + ProviderModuleName = "$PROVIDERMODULE"; + ProviderName = "$PROVIDERNAME"; + ClassName = "$CLASSNAME"; + ProviderType = { $numcap }; + Namespaces = {"$NAMESPACE"}; + SupportedProperties = NULL; + SupportedMethods = NULL; + CapabilityID = "1"; +}; + +EOFC + done < $rf + done +} + function pegasus_install() { if ps -C cimserver > /dev/null 2>&1 then - CIMMOF=cimmof + CIMMOF=`pegasus_path cimmof` + if test $? != 0 + then + echo "Error: cimmof not found" >&2 + return 1 + fi state=active else - CIMMOF=cimmofl + CIMMOF=`pegasus_path cimmofl` + if test $? != 0 + then + echo "Error: cimmof not found" >&2 + return 1 + fi state=inactive fi + + mymofs= + mregs= + mofmode=1 + while test x$1 != x + do + if test $1 == ":" + then + mofmode=0 + shift + continue + fi + if test $mofmode == 1 + then + mymofs="$mymofs $1" + else + myregs="$myregs $1" + fi + shift + done + + for _TEMPDIR in /var/tmp /tmp + do + if test -w $_TEMPDIR + then + _REGFILENAME=$_TEMPDIR/$$.mof + break + fi + done + - if test $1 == mofs - then - NAMESPACE=root/cimv2 - action="Installing Schemas" - else if test $1 == regs + trap "rm -f $_REGFILENAME" EXIT + + if pegasus_transform $_REGFILENAME $myregs then - NAMESPACE=root/PG_Interop - action="Registering Providers" + echo Registering providers with $state cimserver + $CIMMOF -n root/cimv2 $mymofs && + $CIMMOF -n root/PG_Interop $_REGFILENAME else - echo "Invalid install mode " $1 + echo "Failed to build pegasus registration MOF." return 1 fi +} + +function pegasus_uninstall() +{ + mymofs= + mregs= + mofmode=1 + while test x$1 != x + do + if test $1 == ":" + then + mofmode=0 + shift + continue + fi + if test $mofmode == 1 + then + mymofs="$mymofs $1" + else + myregs="$myregs $1" + fi + shift + done + + if ps -C cimserver > /dev/null 2>&1 + then + PROVIDERMODULES=`cat $myregs 2> /dev/null | cut -d ' ' -f 4 | sort | uniq` + echo $PROVIDERMODULES + if test x"$PROVIDERMODULES" == x + then + echo Failed to read registration files + return 1 + fi + CIMPROVIDER=`pegasus_path cimprovider` + if test $? != 0 + then + echo "Error: cimprovider not found" >&2 + return 1 + fi + for pm in $PROVIDERMODULES + do + $CIMPROVIDER -d -m $pm && + $CIMPROVIDER -r -m $pm + done + WBEMEXEC=`pegasus_path wbemexec` + if test $? != 0 + then + echo "Error: wbemexec not found" >&2 + return 1 + fi + CLASSES=`cat $myregs 2> /dev/null | cut -d ' ' -f 1` + for cls in $CLASSES + do + echo Delete CIM Class $cls + $WBEMEXEC > /dev/null <<EOFWX +<?xml version="1.0" encoding="utf-8" ?> +<CIM CIMVERSION="2.0" DTDVERSION="2.0"> + <MESSAGE ID="4711" PROTOCOLVERSION="1.0"> + <SIMPLEREQ> + <IMETHODCALL NAME="DeleteClass"> + <LOCALNAMESPACEPATH> + <NAMESPACE NAME="root"></NAMESPACE> + <NAMESPACE NAME="cimv2"></NAMESPACE> + </LOCALNAMESPACEPATH> + <IPARAMVALUE NAME="ClassName"> + <CLASSNAME NAME="$cls"/> + </IPARAMVALUE> + </IMETHODCALL> + </SIMPLEREQ> + </MESSAGE> +</CIM> +EOFWX + done + else + echo "Sorry, cimserver must be running to deregister the providers." + return 1 fi +} +function sfcb_transform() +{ + OUTFILE=$1 shift - echo $action with $state cimserver - $CIMMOF -n $NAMESPACE $* + regfiles=$* + +#produce sfcb registraion + for rf in $regfiles + do + echo $rf + while read CLASSNAME NAMESPACE PROVIDERNAME PROVIDERMODULE CAPS + do + cat >> $OUTFILE <<EOFC +[$CLASSNAME] + provider: $PROVIDERNAME + location: $PROVIDERMODULE + type: $CAPS + namespace: $NAMESPACE +# +EOFC + done < $rf + done } -function sfcb_install() +function sfcb_rebuild() { - if test $1 == mofs + if ps -C sfcbd > /dev/null 2>&1 then - action="Staging Schemas" - shift - params="$*" - else if test $1 == regs + # sfcb is running -- need to restart + for INITSCRIPT in /etc/init.d/sfcb /usr/local/etc/init.d/sfcb none + do + if test -x $INITSCRIPT + then + break; + fi + done + echo "Shutting down sfcb." + if test $INITSCRIPT == none + then + killall sfcbd + else + $INITSCRIPT stop + fi + t=0 + while ps -C sfcbd > /dev/null 2>&1 + do + sleep 1 + t=`expr $t + 1` + if test $t > 10 + then + echo "Timed out waiting for sfcb shutdown..." + echo "Please stop sfcb manually and rebuild the repository using sfcbrepos." + return 1 + fi + done + echo "Rebuilding repository." + sfcbrepos -f + if test $? != 0 + then + echo "Repository rebuild failed." + return 1 + fi + + if test $INITSCRIPT == none + then + echo "No init script found - you need to start sfcbd manually." + return 1 + else + echo "Restarting sfcb." + $INITSCRIPT start + fi + else + # Not running - rebuild repository + echo "Rebuilding repository." + sfcbrepos -f + fi +} + +function sfcb_install() +{ + mymofs= + mregs= + mofmode=1 + while test x$1 != x + do + if test $1 == ":" + then + mofmode=0 + shift + baseregname=`basename -$1 .registration` + continue + fi + if test $mofmode == 1 + then + mymofs="$mymofs $1" + else + myregs="$myregs $1" + fi + shift + done + + for _TEMPDIR in /var/tmp /tmp + do + if test -w $_TEMPDIR + then + _REGFILENAME=$_TEMPDIR/$baseregname.reg + break + fi + done + + trap "rm -f $_REGFILENAME" EXIT + + if sfcb_transform $_REGFILENAME $myregs then - action="Staging Provider Registration -- rebuild repository and restart sfcb!" - shift - params="-r $*" + echo "Staging provider registration." + sfcbstage -r $_REGFILENAME $mymofs + if test $? != 0 + then + echo "Failed to stage provider registration." + return 1 + fi + sfcb_rebuild else - echo "Invalid install mode " $1 + echo "Failed to build sfcb registration file." return 1 fi - fi +} + +function sfcb_uninstall() +{ + mymofs= + while test x$1 != x + do + if test $1 == ":" + then + shift + baseregname=`basename -$1 .registration` + break + fi + mymofs="$mymofs `basename $1`" + shift + done - echo $action - sfcbstage $params + # "Unstage" MOFs and the registration file + sfcbunstage -r $baseregname.reg $mymofs + + # Rebuild repository + sfcb_rebuild } function usage() { - echo "usage: $0 [-h] -t <cimserver> [ -s mof ... | -r regfile ... ]" + echo "usage: $0 [-h] [-d] -t <cimserver> -r regfile [-r regfile ...] mof ..." } -args=`getopt ht:r:s: $*` +args=`getopt dht:r:s: $*` if [ $? != 0 ] then @@ -89,11 +440,11 @@ -h) help=1; shift; break;; + -d) deregister=1; + shift;; -t) cimserver=$2; shift 2;; - -s) mofs=$2; - shift 2;; - -r) regs=$2; + -r) regs="$regs $2"; shift 2;; --) shift; break;; @@ -101,17 +452,18 @@ esac done +mofs=$* + if [ "$help" == "1" ] then usage echo -e "\t-h display help message" + echo -e "\t-d deregister provider and uninstall schema" 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 -e "\t-r specify registration file - this option can be multiply specified" 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. + echo Use this command to install schema mofs and register providers. + echo CIM Server Type is required as well as at least one registration file and one mof. exit 0 fi @@ -121,33 +473,28 @@ exit 1 fi -if test x"$mofs" == x && test x"$regs" == x +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 +if test x$deregister == 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 + case $cimserver in + pegasus) pegasus_install $mofs ":" $regs;; + sfcb) sfcb_install $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 +else + case $cimserver in + pegasus) pegasus_uninstall $mofs ":" $regs;; + sfcb) sfcb_uninstall $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 +fi |
From: Adrian S. <a3s...@us...> - 2005-04-25 15:16:55
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19093 Modified Files: internalProvider.c Log Message: bug 1184958 Fixed. Was not expecting NULL enumeration back in internalProvider Index: internalProvider.c =================================================================== RCS file: /cvsroot/sblim/sfcb/internalProvider.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- internalProvider.c 11 Apr 2005 21:19:00 -0000 1.2 +++ internalProvider.c 25 Apr 2005 15:16:47 -0000 1.3 @@ -618,12 +618,16 @@ CMAddContextEntry(ctx, CMPIInvocationFlags,&newFlgs,CMPI_uint32); CMPIEnumeration *enm=CBEnumInstanceNames(Broker,ctx,op,&st); - while (CMHasNext(enm,NULL)) { + if (enm) while (CMHasNext(enm,NULL)) { CMPIObjectPath *cop=CMGetNext(enm,NULL).value.ref; if (assocForName((char*)CMGetNameSpace(cop,NULL)->hdl,(char*)CMGetClassName(cop,NULL)->hdl, role,resultRole) != NULL) SafeInternalProviderAddEnumInstances(refs, NULL, ctx, cop, propertyList, &st, 1); } + else { + st.rc=CMPI_RC_OK; + _SFCB_RETURN(st); + } } |
From: Adrian S. <a3s...@us...> - 2005-04-25 14:40:51
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31466 Modified Files: cimXmlGen.c cimXmlOps.y cimXmlParser.c cimXmlParser.h cimXmlRequest.c classProvider.c objectImpl.c objectImpl.h objectpath.c providerDrv.c trace.c Log Message: Updated createClass support - classes can be dynamically added and will be appended to classSchema file bug 1181968 should be fixed now Index: cimXmlOps.y =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlOps.y,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cimXmlOps.y 11 Apr 2005 22:04:46 -0000 1.3 +++ cimXmlOps.y 25 Apr 2005 14:40:41 -0000 1.4 @@ -172,20 +172,14 @@ XtokNamedInstance xtokNamedInstance; XtokProperty xtokProperty; - XtokPropertyPart xtokPropertyPart; - XtokPropertyPartList xtokPropertyPartList; + XtokPropertyData xtokPropertyData; XtokMethod xtokMethod; - XtokMethodPart xtokMethodPart; - XtokMethodPartList xtokMethodPartList; - + XtokMethodData xtokMethodData; XtokQualifier xtokQualifier; XtokParamValue xtokParamValue; XtokParam xtokParam; -/* XtokParamPart xtokParamPart; - XtokParamPartList xtokParamPartList; -*/ XtokMethodCall xtokMethodCall; XtokGetClassParmsList xtokGetClassParmsList; @@ -223,7 +217,7 @@ XtokEnumInstanceNames xtokEnumInstanceNames; XtokEnumInstances xtokEnumInstances; - XtokEnumInstancesParmsList xtokEnumInstancesParmsList; + XtokEnumInstancesParmsList xtokEnumInstancesParmsList; XtokEnumInstancesParms xtokEnumInstancesParms; XtokExecQuery xtokExecQuery; @@ -399,7 +393,7 @@ %token <className> XTOK_IP_RESULTROLE %token <className> XTOK_IP_QUERY %token <className> XTOK_IP_QUERYLANG -%token <clasz> XTOK_IP_CLASS +%token <class> XTOK_IP_CLASS %token <xtokPropertyList> XTOK_IP_PROPERTYLIST %type <boolValue> boolValue @@ -420,13 +414,11 @@ %token <xtokProperty> XTOK_PROPERTYREFERENCE %token <intValue> ZTOK_PROPERTYREFERENCE -%type <xtokPropertyPart> propertyPart -%type <xtokPropertyPart> propertyReferencePart -%type <xtokPropertyPartList> propertyPartList -%type <xtokPropertyPartList> propertyReferencePartList +%type <xtokPropertyData> propertyData +%type <xtokProperty> property %token <xtokParam> XTOK_PARAM -%type <xtokParam> param +%type <xtokParam> parameter %token <intValue> ZTOK_PARAM %token <xtokParam> XTOK_PARAMARRAY %token <intValue> ZTOK_PARAMARRAY @@ -435,27 +427,20 @@ %token <xtokParam> XTOK_PARAMREFARRAY %token <intValue> ZTOK_PARAMREFARRAY -%token <xtokMethodPart> XTOK_METHODPART -%type <xtokMethodPart> methodPart -%token <intValue> ZTOK_METHODPART - -%token <xtokMethodPartList> XTOK_METHODPARTLIST -%type <xtokMethodPartList> methodPartList -%token <intValue> ZTOK_METHODPARTLIST - -%token <xtokMethod> XTOK_METHODDEF -//%type <xtokMethod> methodDef -%token <intValue> ZTOK_METHODDEF +%token <xtokMethod> XTOK_METHOD +%type <xtokMethod> method +%token <intValue> ZTOK_METHOD +%type <xtokMethodData> methodData %token <xtokClass> XTOK_CLASS %token <intValue> ZTOK_CLASS -%type <xtokClass> clasz -%type <xtokClassParts> classParts +%type <xtokClass> class +%type <xtokClassData> classData %token <xtokInstance> XTOK_INSTANCE %token <intValue> ZTOK_INSTANCE %type <xtokInstance> instance -%type <xtokInstanceParts> instanceParts +%type <xtokInstanceData> instanceData %type <xtokParamValue> paramValue %token <xtokParamValue> XTOK_PARAMVALUE @@ -990,7 +975,7 @@ ; createClassParm - : XTOK_IP_CLASS clasz ZTOK_IPARAMVALUE + : XTOK_IP_CLASS class ZTOK_IPARAMVALUE { $$.cls = $2; } @@ -1802,109 +1787,83 @@ * class */ - -clasz - : XTOK_CLASS ZTOK_CLASS - { - memset(&$$.properties,0,sizeof($$.properties)); - memset(&$$.qualifiers,0,sizeof($$.qualifiers)); - memset(&$$.methods,0,sizeof($$.methods)); - } - | XTOK_CLASS classPartsList ZTOK_CLASS - { - $$.properties=((ParserControl*)parm)->properties; - $$.qualifiers=((ParserControl*)parm)->qualifiers; - $$.methods=((ParserControl*)parm)->methods; - } -; - -classPartsList - : classParts - { - printf("classPartsList: \n"); - } - | classPartsList classParts +class + : XTOK_CLASS classData ZTOK_CLASS { - printf("classPartsList classParts: \n"); + if (((ParserControl*)parm)->Qs) + $$.qualifiers=((ParserControl*)parm)->qualifiers; + else memset(&$$.qualifiers,0,sizeof($$.qualifiers)); + if (((ParserControl*)parm)->Ps) + $$.properties=((ParserControl*)parm)->properties; + else memset(&$$.properties,0,sizeof($$.properties)); + if (((ParserControl*)parm)->Ms) + $$.methods=((ParserControl*)parm)->methods; + else memset(&$$.methods,0,sizeof($$.methods)); } ; - -classParts - : qualifier - { - printf("classParts qualifier: \n"); - addQualifier(&(((ParserControl*)parm)->qualifiers),&$1); - } - | XTOK_PROPERTY propertyPartList ZTOK_PROPERTY +classData + : /* empty */ {;} + | classData qualifier { - $1.value=$2.value; - $1.propType=typeProperty_Value; - addProperty(&(((ParserControl*)parm)->properties),&$1); + ((ParserControl*)parm)->Qs++; + addQualifier(&(((ParserControl*)parm)->qualifiers),&$2); } - | XTOK_PROPERTYREFERENCE propertyReferencePartList ZTOK_PROPERTYREFERENCE - { - $1.ref=$2.ref; - $1.propType=typeProperty_Reference; - addProperty(&(((ParserControl*)parm)->properties),&$1); - } - | XTOK_METHODDEF methodPartList - { - printf("classParts: method ?\n"); - addMethod(&(((ParserControl*)parm)->methods),&$1); - } -; - -methodPartList - : methodPart - { - printf("methodPartList: \n"); - if ($1.qPart==1) - addQualifier(&($$.qualifiers),&$1.qualifier); - else addParam(&($$.params), &$1.param); + | classData property { + ((ParserControl*)parm)->Ps++; + addProperty(&(((ParserControl*)parm)->properties),&$2); } - | methodPartList methodPart - { - printf("methodPartList methodPart: \n"); - if ($2.qPart==1) - addQualifier(&($$.qualifiers),&$2.qualifier); - else addParam(&($$.params), &$2.param); + | classData method { + ((ParserControl*)parm)->Ms++; + addMethod(&(((ParserControl*)parm)->methods),&$2); } ; -methodPart - : ZTOK_METHODDEF - { - printf("methodPart: ZTOK_METHODDEF\n"); - $$.qPart=-1; - } - | qualifier - { - printf("methodPart: qualifier\n"); - $$.qPart=1; - $$.qualifier=$1; - } - | XTOK_PARAM param +method + : XTOK_METHOD methodData ZTOK_METHOD { - $$.qPart=0; - $$.param=$1; - } + if (((ParserControl*)parm)->MQs) + $$.qualifiers=$2.qualifiers; + else memset(&$$.qualifiers,0,sizeof($$.qualifiers)); + if (((ParserControl*)parm)->MPs) + $$.params=$2.params; + else memset(&$$.params,0,sizeof($$.params)); + ((ParserControl*)parm)->MQs=0; + ((ParserControl*)parm)->MPs=0; + ((ParserControl*)parm)->MPQs=0; + } ; -param - : ZTOK_PARAM +methodData + : /* empty */ {;} + | methodData qualifier { - printf("param: ZTOK_PARAM\n"); - } - | qualifier + if (((ParserControl*)parm)->MQs==0) + memset(&$$.qualifiers,0,sizeof($$.qualifiers)); + ((ParserControl*)parm)->MQs++; + addQualifier(&($$.qualifiers),&$2); + } + | methodData XTOK_PARAM parameter ZTOK_PARAM { - printf("param: qualifier\n"); - addQualifier(&($$.qualifiers),&$1); - } - | param qualifier + if (((ParserControl*)parm)->MPs==0) + memset(&$$.params,0,sizeof($$.params)); + ((ParserControl*)parm)->MPs++; + if (((ParserControl*)parm)->MPQs) + $2.qualifiers=$3.qualifiers; + else memset(&$2.qualifiers,0,sizeof($2.qualifiers)); + addParam(&($$.params),&$2); + ((ParserControl*)parm)->MPQs=0; + } +; + +parameter + : /* empty */ {;} + | parameter qualifier { - printf("param qualifier: \n"); - addQualifier(&($$.qualifiers),&$2); + if (((ParserControl*)parm)->MPQs==0) + memset(&$$.qualifiers,0,sizeof($$.qualifiers)); + ((ParserControl*)parm)->MPQs++; + addQualifier(&($$.qualifiers),&$2); } ; @@ -1913,117 +1872,86 @@ * instance */ - instance - : XTOK_INSTANCE ZTOK_INSTANCE - { - memset(&$$.properties,0,sizeof($$.properties)); - memset(&$$.qualifiers,0,sizeof($$.qualifiers)); - } - | XTOK_INSTANCE instancePartsList ZTOK_INSTANCE + : XTOK_INSTANCE instanceData ZTOK_INSTANCE { - $$.properties=((ParserControl*)parm)->properties; - $$.qualifiers=((ParserControl*)parm)->qualifiers; + if (((ParserControl*)parm)->Qs) + $$.qualifiers=((ParserControl*)parm)->qualifiers; + else memset(&$$.qualifiers,0,sizeof($$.qualifiers)); + if (((ParserControl*)parm)->Ps) + $$.properties=((ParserControl*)parm)->properties; + else memset(&$$.properties,0,sizeof($$.properties)); } ; -instancePartsList - : instanceParts +instanceData + : /* empty */ {;} + | instanceData qualifier { + ((ParserControl*)parm)->Qs++; + addQualifier(&(((ParserControl*)parm)->qualifiers),&$2); } - | instancePartsList instanceParts + | instanceData property { + ((ParserControl*)parm)->Ps++; + addProperty(&(((ParserControl*)parm)->properties),&$2); } ; -instanceParts - : qualifier - { - addQualifier(&(((ParserControl*)parm)->qualifiers),&$1); - } - | XTOK_PROPERTY propertyPartList ZTOK_PROPERTY - { - $1.value=$2.value; - $1.propType=typeProperty_Value; - addProperty(&(((ParserControl*)parm)->properties),&$1); - } - | XTOK_PROPERTYREFERENCE propertyReferencePartList ZTOK_PROPERTYREFERENCE - { - $1.ref=$2.ref; - $1.propType=typeProperty_Reference; - addProperty(&(((ParserControl*)parm)->properties),&$1); - } -; - +/* + * property +*/ -propertyPartList - : propertyPart - { - if ($1.qPart) { - addQualifier(&($$.qualifiers),&$1.qualifier); - } - else { - $$.value=$1.value; - } - } - | propertyPartList propertyPart +property + : XTOK_PROPERTY propertyData ZTOK_PROPERTY { - if ($2.qPart) { - addQualifier(&($$.qualifiers),&$2.qualifier); - } - else { - $$.value=$1.value; // should this be $$.value=$2.value; - } - } + $$.val=$2; + } ; -propertyPart - : qualifier +propertyData + : propertyData qualifier { - $$.qPart=1; - $$.qualifier=$1; + addQualifier(&(((ParserControl*)parm)->qualifiers),&$2); } | value { +// printf("--- value: %s\n",$1.value); $$.value=$1.value; - $$.qPart=0; } -; - - -propertyReferencePartList - : propertyReferencePart + | valueReference { - if ($1.qPart) { - addQualifier(&($$.qualifiers),&$1.qualifier); - } - else { - $$.ref=$1.ref; - } + $$.ref=$1; } - | propertyReferencePartList propertyReferencePart +; + +propertyArray + : XTOK_PROPERTYARRAY ZTOK_PROPERTYARRAY { - if ($2.qPart) { - addQualifier(&($$.qualifiers),&$2.qualifier); - } - else { - $$.ref=$1.ref; // should this be $$.ref=$2.ref; ? - } + printf("--- propertyArray\n"); } ; -propertyReferencePart - : qualifier +propertyList + : XTOK_VALUEARRAY valueArray ZTOK_VALUEARRAY { - $$.qPart=1; - $$.qualifier=$1; - } - | valueReference + $2.values[$2.next]=NULL; + $$.list=$2; + } +; + + +/* + * qualifier +*/ + +qualifier + : XTOK_QUALIFIER value ZTOK_QUALIFIER { - $$.qPart=0; - $$.ref=$1; - } +// printf("--- qualifier %s: %s\n",$1.name,$2.value); + $$.value=$2.value; + } ; @@ -2042,12 +1970,7 @@ } ; -qualifier - : XTOK_QUALIFIER value ZTOK_QUALIFIER - { - $$.value=$2.value; - } -; + /* * localNameSpacePath Index: cimXmlRequest.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlRequest.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- cimXmlRequest.c 11 Apr 2005 23:13:41 -0000 1.5 +++ cimXmlRequest.c 25 Apr 2005 14:40:42 -0000 1.6 @@ -49,19 +49,6 @@ extern UtilStringBuffer *instanceToString(CMPIInstance * ci, char **props); extern const char *getErrorId(int c); extern const char *instGetClassName(CMPIInstance * ci); -extern int ClClassGetPropertyAt(ClClass * inst, int id, CMPIData * data, - char **name, unsigned long *quals); -extern int ClClassGetPropertyCount(ClClass * inst); -extern int ClClassGetQualifierCount(ClClass * cls); -extern int ClClassGetQualifierAt(ClClass * cls, int id, CMPIData * data, - char **name); -extern int ClInstanceGetPropertyCount(ClInstance * inst); -extern int ClInstanceGetPropertyAt(ClInstance * inst, int id, CMPIData * data, - char **name, unsigned long *quals); -extern int ClClassGetPropQualifierCount(ClClass * cls, int p); -extern int ClClassGetPropQualifierAt(ClClass * cls, int p, int id, - CMPIData * data, char **name); -extern const char *ClGetStringData(CMPIInstance * ci, int id); extern CMPIData opGetKeyCharsAt(CMPIObjectPath * cop, unsigned int index, const char **name, CMPIStatus * rc); @@ -80,7 +67,7 @@ extern CMPIStatus arraySetElementNotTrackedAt(CMPIArray * array, CMPICount index, CMPIValue * val, CMPIType type); extern QLStatement *parseQuery(int mode, char *query, char *lang, char *sns, int *rc); - +extern CMPIConstClass initConstClass(ClClass *cl); const char *opGetClassNameChars(CMPIObjectPath * cop); static char *cimMsg[] = { @@ -415,7 +402,7 @@ object=relocateSerializedConstClass(resp[i]->object[j].data); } // rc=CMSetArrayElementAt(ar, c, &object, binCtx->type); - rc=arraySetElementNotTrackedAt(ar,c, &object, binCtx->type); + rc=arraySetElementNotTrackedAt(ar,c, (CMPIValue*)&object, binCtx->type); } } @@ -564,18 +551,6 @@ _SFCB_RETURN(ctxErrResponse(hdr, &binCtx,0)); } -extern int ClClassAddQualifier(ClObjectHdr * hdr, ClSection * qlfs, - const char *id, CMPIData d); -extern int ClClassAddProperty(ClClass * cls, const char *id, CMPIData d); -extern void *ClObjectGetClSection(ClObjectHdr * hdr, ClSection * s); -extern int ClClassAddPropertyQualifier(ClObjectHdr * hdr, ClProperty * p, - const char *id, CMPIData d); -extern ClClass *ClClassNew(const char *cn, const char *pa); -extern ClClass *ClClassRebuildClass(ClClass * cls, void *area); -extern void ClClassFreeClass(ClClass * cls); -extern char *ClClassToString(ClClass * cls); -extern CMPIConstClass initConstClass(ClClass *cl); - static RespSegments createClass(CimXmlRequestContext * ctx, RequestHdr * hdr) { _SFCB_ENTER(TRACE_CIMXMLPROC, "createClass"); @@ -589,12 +564,15 @@ XtokProperty *p = NULL; XtokProperties *ps = NULL; - XtokQualifiers *qs = NULL; XtokQualifier *q = NULL; + XtokQualifiers *qs = NULL; + XtokMethod *m = NULL; + XtokMethods *ms = NULL; + XtokParam *r = NULL; + XtokParams *rs = NULL; XtokClass *c; CMPIData d; - - printf("--- createClass request\n"); + CMPIParameter pa; memset(&binCtx,0,sizeof(BinRequestContext)); XtokCreateClass *req = (XtokCreateClass *) hdr->cimRequest; @@ -602,7 +580,6 @@ path = NewCMPIObjectPath(req->op.nameSpace.data, req->op.className.data, NULL); cl = ClClassNew(req->op.className.data, req->superClass ? req->superClass : NULL); - cls=initConstClass(cl); c=&req->cls; qs=&c->qualifiers; @@ -618,11 +595,11 @@ ClProperty *prop; int propId; d.state=CMPI_goodValue; - d.value=str2CMPIValue(p->valueType,p->value,NULL); + d.value=str2CMPIValue(p->valueType,p->val.value,&p->val.ref); d.type=p->valueType; propId=ClClassAddProperty(cl, p->name, d); - qs=&p->qualifiers; + qs=&p->val.qualifiers; prop=((ClProperty*)ClObjectGetClSection(&cl->hdr,&cl->properties))+propId-1; for (q=qs->first; q; q=q->next) { d.state=CMPI_goodValue; @@ -631,6 +608,44 @@ ClClassAddPropertyQualifier(&cl->hdr, prop, q->name, d); } } + + ms=&c->methods; + for (m=ms->first; m; m=m->next) { + ClMethod *meth; + ClParameter *parm; + int methId,parmId; + + methId=ClClassAddMethod(cl, m->name, m->type); + meth=((ClMethod*)ClObjectGetClSection(&cl->hdr,&cl->methods))+methId-1; + + qs=&m->qualifiers; + for (q=qs->first; q; q=q->next) { + d.state=CMPI_goodValue; + d.value=str2CMPIValue(q->type,q->value,NULL); + d.type=q->type; + ClClassAddMethodQualifier(&cl->hdr, meth, q->name, d); + } + + rs=&m->params; + for (r=rs->first; r; r=r->next) { + pa.type=r->type; + pa.arraySize=(unsigned int)r->arraySize; + pa.refName=r->refClass; + parmId=ClClassAddMethParameter(&cl->hdr, meth, r->name, pa); + parm=((ClParameter*)ClObjectGetClSection(&cl->hdr,&meth->parameters))+methId-1; + + qs=&r->qualifiers; + for (q=qs->first; q; q=q->next) { + d.state=CMPI_goodValue; + d.value=str2CMPIValue(q->type,q->value,NULL); + d.type=q->type; + ClClassAddMethParamQualifier(&cl->hdr, parm, q->name, d); + } + } + } + + cl = ClClassRebuildClass(cl,NULL); + cls=initConstClass(cl); sreq.principal = setCharsMsgSegment(ctx->principal); sreq.path = setObjectPathMsgSegment(path); @@ -645,7 +660,6 @@ _SFCB_TRACE(1, ("--- Getting Provider context")); irc = getProviderContext(&binCtx, (OperationHdr *) req); - printf("--- Getting Provider context %d\n",irc); _SFCB_TRACE(1, ("--- Provider context gotten")); if (irc == MSG_X_PROVIDER) { @@ -916,7 +930,7 @@ inst = NewCMPIInstance(path, NULL); for (p = req->instance.properties.first; p; p = p->next) { - val = str2CMPIValue(p->valueType, p->value, &p->ref); + val = str2CMPIValue(p->valueType, p->val.value, &p->val.ref); CMSetProperty(inst, p->name, &val, p->valueType); } @@ -994,7 +1008,7 @@ inst = NewCMPIInstance(path, NULL); for (p = xci->properties.first; p; p = p->next) { - val = str2CMPIValue(p->valueType, p->value, &p->ref); + val = str2CMPIValue(p->valueType, p->val.value, &p->val.ref); CMSetProperty(inst, p->name, &val, p->valueType); } sreq->instance = setInstanceMsgSegment(inst); Index: trace.c =================================================================== RCS file: /cvsroot/sblim/sfcb/trace.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- trace.c 9 Mar 2005 12:25:14 -0000 1.1.1.1 +++ trace.c 25 Apr 2005 14:40:42 -0000 1.2 @@ -64,6 +64,8 @@ {"sockets", TRACE_SOCKETS}, {"memoryMgr", TRACE_MEMORYMGR}, {"msgQueue", TRACE_MSGQUEUE}, + {"msgQueue", TRACE_MSGQUEUE}, + {"xmlParsing", TRACE_XMLPARSING}, {NULL,0} }; Index: cimXmlGen.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlGen.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- cimXmlGen.c 13 Apr 2005 15:06:52 -0000 1.4 +++ cimXmlGen.c 25 Apr 2005 14:40:41 -0000 1.5 @@ -38,27 +38,12 @@ #include "queryOperation.h" extern const char *instGetClassName(CMPIInstance * ci); -extern int ClClassGetPropertyAt(ClClass * inst, int id, CMPIData * data, - char **name, unsigned long *quals); -extern int ClClassGetPropertyCount(ClClass * inst); -extern int ClClassGetQualifierCount(ClClass * cls); -extern int ClClassGetQualifierAt(ClClass * cls, int id, CMPIData * data, - char **name); -extern int ClInstanceGetPropertyCount(ClInstance * inst); -extern int ClInstanceGetPropertyAt(ClInstance * inst, int id, CMPIData * data, - char **name, unsigned long *quals); -extern int ClClassGetPropQualifierCount(ClClass * cls, int p); -extern int ClClassGetPropQualifierAt(ClClass * cls, int p, int id, - CMPIData * data, char **name); -extern const char *ClGetStringData(CMPIInstance * ci, int id); - extern CMPIData opGetKeyCharsAt(CMPIObjectPath * cop, unsigned int index, const char **name, CMPIStatus * rc); const char *opGetClassNameChars(CMPIObjectPath * cop); - char *XMLEscape(char *in) { int i, l; @@ -442,6 +427,21 @@ _SFCB_RETURN(0); } +static void method2xml(CMPIType type, CMPIString *name, char *bTag, char *eTag, + UtilStringBuffer * sb, UtilStringBuffer * qsb) +{ + _SFCB_ENTER(TRACE_CIMXMLPROC, "method2xml"); + sb->ft->appendChars(sb, bTag); + sb->ft->appendChars(sb, (char *) name->hdl); + sb->ft->appendChars(sb, "\" TYPE=\""); + sb->ft->appendChars(sb, dataType(type)); + sb->ft->appendChars(sb, "\">\n"); + if (qsb) sb->ft->appendChars(sb, (char *) qsb->hdl); + sb->ft->appendChars(sb, eTag); + + _SFCB_EXIT(); +} + static void data2xml(CMPIData * data, void *obj, CMPIString * name, char *bTag, char *eTag, UtilStringBuffer * sb, UtilStringBuffer * qsb, int inst, int param) { @@ -459,8 +459,7 @@ else sb->ft->appendChars(sb, "\" TYPE=\""); sb->ft->appendChars(sb, dataType(data->type)); sb->ft->appendChars(sb, "\">\n"); - if (qsb) - sb->ft->appendChars(sb, (char *) qsb->hdl); + if (qsb) sb->ft->appendChars(sb, (char *) qsb->hdl); if (data->state == 0) { sb->ft->appendChars(sb, "<VALUE.ARRAY>\n"); for (j = 0; j < ac; j++) { @@ -480,8 +479,7 @@ sb->ft->appendChars(sb, "\" REFERENCECLASS=\""); sb->ft->appendChars(sb, opGetClassNameChars(data->value.ref)); sb->ft->appendChars(sb, "\">\n"); - if (qsb) - sb->ft->appendChars(sb, (char *) qsb->hdl); + if (qsb) sb->ft->appendChars(sb, (char *) qsb->hdl); if (inst) { sb->ft->appendChars(sb, "<VALUE.REFERENCE>\n"); sb->ft->appendChars(sb, "<INSTANCEPATH>\n"); @@ -505,7 +503,7 @@ sb->ft->appendChars(sb,"<QUALIFIER NAME=\"EmbeddedObject\" TYPE=\"boolean\">\n" "<VALUE>TRUE</VALUE>\n</QUALIFIER>\n"); sb->ft->appendChars(sb, "<VALUE>"); - sp = XMLEscape(eo); + sp = XMLEscape((char*)eo); if (sp) freesp = 1; sb->ft->appendChars(sb, "<![CDATA["); sb->ft->appendChars(sb, sp); @@ -521,10 +519,8 @@ else sb->ft->appendChars(sb, "\" TYPE=\""); sb->ft->appendChars(sb, type); sb->ft->appendChars(sb, "\">\n"); - if (qsb) - sb->ft->appendChars(sb, (char *) qsb->hdl); - if (data->state == 0) - value2xml(*data, sb, 1); + if (qsb) sb->ft->appendChars(sb, (char *) qsb->hdl); + if (data->state == 0) value2xml(*data, sb, 1); sb->ft->appendChars(sb, eTag); } } @@ -560,13 +556,72 @@ "<VALUE>TRUE</VALUE>\n</QUALIFIER>\n"); } +static void param2xml(CMPIParameter *pdata, CMPIConstClass * cls, ClParameter *parm, CMPIString *pname, + UtilStringBuffer * sb, unsigned int flags) +{ + ClClass *cl = (ClClass *) cls->hdl; + int i, m; + CMPIData data; + CMPIString qname; + char *etag="</PARAMETER>\n"; + UtilStringBuffer *qsb = NULL; + + if (flags & FL_includeQualifiers) { + m = ClClassGetMethParamQualifierCount(cl,parm); + if (m) qsb = UtilFactory->newStrinBuffer(1024); + for (i = 0; i < m; i++) { + ClClassGetMethParamQualifierAt(cl, parm, i, &data, (char**)&qname.hdl); + data2xml(&data,cls,&qname,"<QUALIFIER NAME=\"","</QUALIFIER>\n",qsb,NULL,0,0); + } + } + + if (pdata->type==CMPI_ref) { + sb->ft->appendChars(sb, "<PARAMETER.REFERENCE NAME=\""); + sb->ft->appendChars(sb, (char*)pname->hdl); + if (pdata->refName) { + sb->ft->appendChars(sb, "\" REFERENCECLASS=\""); + sb->ft->appendChars(sb, pdata->refName); + } + sb->ft->appendChars(sb, "\"\n"); + etag="</PARAMETER.REFERENCE>\n"; + } + else if (pdata->type==CMPI_refA) { + sb->ft->appendChars(sb, "<PARAMETER.REFARRAY NAME=\""); + sb->ft->appendChars(sb, (char*)pname->hdl); + fprintf(stderr,"*** PARAMETER.REFARRAY not implemenetd\n"); + abort(); + etag="</PARAMETER.REFARRAY>\n"; + } + else { + if (pdata->type&CMPI_ARRAY) { + char size[128]; + sb->ft->appendChars(sb, "<PARAMETER.ARRAY NAME=\""); + sb->ft->appendChars(sb, (char*)pname->hdl); + sprintf(size,"\" ARRAYSIZE=\"%d\"",pdata->arraySize); + sb->ft->appendChars(sb, size); + etag="</PARAMETER.ARRAY>\n"; + } + else { + sb->ft->appendChars(sb, "<PARAMETER NAME=\""); + sb->ft->appendChars(sb, (char*)pname->hdl); + } + sb->ft->appendChars(sb, "\" TYPE=\""); + sb->ft->appendChars(sb, dataType(pdata->type)); + sb->ft->appendChars(sb, "\"\n"); + } + + if (qsb) sb->ft->appendChars(sb, (char *) qsb->hdl); + sb->ft->appendChars(sb, etag); +} + int cls2xml(CMPIConstClass * cls, UtilStringBuffer * sb, unsigned int flags) { ClClass *cl = (ClClass *) cls->hdl; - int i, q, m, qm; + int i, m, q, qm, p, pm; char *type, *superCls; CMPIString *name, *qname; - CMPIData data, qdata;static + CMPIData data, qdata; + CMPIType mtype; unsigned long quals; UtilStringBuffer *qsb = UtilFactory->newStrinBuffer(1024); @@ -608,6 +663,32 @@ } CMRelease(name); } + + for (i = 0, m = ClClassGetMethodCount(cl); i < m; i++) { + ClMethod *meth; + ClParameter *parm; + CMPIString name,mname; + qsb->ft->reset(qsb); + ClClassGetMethodAt(cl, i, &mtype, (char**)&mname.hdl, &quals); + meth=((ClMethod*)ClObjectGetClSection(&cl->hdr,&cl->methods))+i; + + if (flags & FL_includeQualifiers) { + for (q = 0, qm = ClClassGetMethQualifierCount(cl, i); q < qm; q++) { + ClClassGetMethQualifierAt(cl, meth, q, &qdata, (char**)&name.hdl); + data2xml(&qdata,cls,&name,"<QUALIFIER NAME=\"","</QUALIFIER>\n",qsb,NULL,0,0); + } + } + + for (p = 0, pm = ClClassGetMethParameterCount(cl, i); p < pm; p++) { + CMPIParameter pdata; + ClClassGetMethParameterAt(cl, meth, p, &pdata, (char**)&name.hdl); + parm=((ClParameter*)ClObjectGetClSection(&cl->hdr,&meth->parameters))+p; + param2xml(&pdata,cls,parm,&name,qsb,flags); + } + + method2xml(mtype,&mname,"<METHOD NAME=\"", "</METHOD>\n",sb, qsb); + } + sb->ft->appendChars(sb, "</CLASS>\n"); _SFCB_RETURN(0); Index: classProvider.c =================================================================== RCS file: /cvsroot/sblim/sfcb/classProvider.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- classProvider.c 12 Apr 2005 08:14:14 -0000 1.8 +++ classProvider.c 25 Apr 2005 14:40:42 -0000 1.9 @@ -56,11 +56,13 @@ struct _ClassRegister { void *hdl; Class_Register_FT *ft; + ClVersionRecord *vr; + int assocs,topAssocs; + char *fn; }; typedef struct _ClassRegister ClassRegister; typedef struct _ClassBase { - char *fn; UtilHashTable *ht; UtilHashTable *it; MRWLOCK mrwLock; @@ -83,27 +85,6 @@ static CMPIConstClass *getClass(ClassRegister * cr, const char *clsName); -extern ClClass *ClClassNew(const char *cn, const char *pa); -extern int ClClassAddQualifier(ClObjectHdr * hdr, ClSection * qlfs, - const char *id, CMPIData d); -extern int ClClassAddProperty(ClClass * cls, const char *id, CMPIData d); -extern void *ClObjectGetClSection(ClObjectHdr * hdr, ClSection * s); -extern int ClClassAddPropertyQualifier(ClObjectHdr * hdr, ClProperty * p, - const char *id, CMPIData d); -extern ClClass *ClClassRebuildClass(ClClass * cls, void *area); -extern void ClClassFreeClass(ClClass * cls); -extern char *ClClassToString(ClClass * cls); -extern CMPIConstClass initConstClass(ClClass *cl); -extern int ClClassGetQualifierAt(ClClass * cls, int id, CMPIData * data, char **name); -extern int ClClassGetQualifierCount(ClClass * cls); -extern int ClClassGetPropertyCount(ClClass * cls); -extern int ClClassGetPropertyAt(ClClass * cls, int id, CMPIData * data, char **name, - unsigned long *quals); -extern int ClClassGetPropQualifierCount(ClClass * cls, int id); -extern int ClClassGetPropQualifierAt(ClClass * cls, int id, int qid, CMPIData * data, - char **name); - -int assocs = 0, topAssocs = 0; typedef struct nameSpaces { int next,max,blen; @@ -142,7 +123,7 @@ static void release(ClassRegister * cr) { ClassBase *cb = (ClassBase *) cr->hdl; - free(cb->fn); + free(cr->fn); cb->ht->ft->release(cb->ht); free(cr); } @@ -187,9 +168,13 @@ char fin[1024]; long s, total=0; ClObjectHdr hdr; + ClVersionRecord *vrp=(ClVersionRecord*)&hdr; + int vRec=0,first=1; cr->hdl = cb; cr->ft = ClassRegisterFT; + cr->vr = NULL; + cr->assocs = cr->topAssocs = 0; strcpy(fin, fname); strcat(fin, "/classSchemas"); @@ -205,18 +190,23 @@ return cr; } - cb->fn = strdup(fin); + cr->fn = strdup(fin); cb->ht = UtilFactory->newHashTable(61, UtilHashTable_charKey | UtilHashTable_ignoreKeyCase); MRWInit(&cb->mrwLock); while ((s = fread(&hdr, 1, sizeof(hdr), in)) == sizeof(hdr)) { -// while ((s = fread(&size, 1, 4, in)) == 4) { CMPIConstClass *cc=NULL; char *buf=NULL; char *cn; - if (hdr.type!=HDR_Class) { + if (first) { + if (vrp->size==sizeof(ClVersionRecord) && vrp->type==HDR_Version && + strcmp(vrp->id,"sfcd-rep")==0) vRec=1; + first=0; + } + + if (vRec==0 && hdr.type!=HDR_Class) { fprintf(stderr,"--- %s contains non-class record(s) - directory skipped\n",fin); return NULL; } @@ -231,15 +221,21 @@ *((ClObjectHdr *) buf) = hdr; if (fread(buf + sizeof(hdr), 1, hdr.size - sizeof(hdr), in) == hdr.size - sizeof(hdr)) { + if (vRec) { + cr->vr=(ClVersionRecord*)buf; + continue; + } cc = NEW(CMPIConstClass); cc->hdl = buf; cc->ft = CMPIConstClassFT; cc->ft->relocate(cc); cn=(char*)cc->ft->getCharClassName(cc); - if (strncmp(cn,"DMY_",4)) { + if (strncmp(cn,"DMY_",4)!=0) { cb->ht->ft->put(cb->ht, cn, cc); - if (cc->ft->isAssociation(cc)) assocs++; - if (cc->ft->getCharSuperClassName(cc) == NULL) topAssocs++; + if (cc->ft->isAssociation(cc)) { + cr->assocs++; + if (cc->ft->getCharSuperClassName(cc) == NULL) cr->topAssocs++; + } } } else { @@ -248,27 +244,35 @@ } } - printf("--- ClassProvider for %s using %ld bytes\n", fname, total); + if (cr->vr) { + printf("--- ClassProvider for %s (%d.%d) using %ld bytes\n", + fname, cr->vr->version, cr->vr->level, total); + } + else printf("--- ClassProvider for %s (no-version) using %ld bytes\n", fname, total); buildInheritanceTable(cr); return cr; } -int cpyClass(ClClass *cl, CMPIConstClass *cc) +int cpyClass(ClClass *cl, CMPIConstClass *cc, unsigned char originId) { ClClass *ccl=(ClClass*)cc->hdl; CMPIData d; + CMPIParameter p; + CMPIType t; char *name; - int i,m,iq,mq,propId; + int i,m,iq,mq,ip,mp,propId,methId,parmId; unsigned long quals; ClProperty *prop; + ClMethod *meth; + ClParameter *parm; cl->quals |= ccl->quals; for (i=0,m=ClClassGetQualifierCount(ccl); i<m; i++) { ClClassGetQualifierAt(ccl,i,&d,&name); ClClassAddQualifier(&cl->hdr, &cl->qualifiers, name, d); - } + } for (i=0,m=ClClassGetPropertyCount(ccl); i<m; i++) { ClClassGetPropertyAt(ccl,i,&d,&name,&quals); @@ -280,6 +284,28 @@ ClClassAddPropertyQualifier(&cl->hdr, prop, name, d); } } + + for (i=0,m=ClClassGetMethodCount(ccl); i<m; i++) { + ClClassGetMethodAt(ccl,i,&t,&name,&quals); + methId=ClClassAddMethod(cl, name, t); + meth=((ClMethod*)ClObjectGetClSection(&cl->hdr,&cl->methods))+methId-1; + + for (iq=0,mq=ClClassGetMethQualifierCount(ccl,methId-1); iq<mq; iq++) { + ClClassGetMethQualifierAt(ccl, meth, iq, &d, &name); + ClClassAddMethodQualifier(&cl->hdr, meth, name, d); + } + + for (ip=0,mp=ClClassGetMethParameterCount(ccl,methId-1); ip<mp; ip++) { + ClClassGetMethParameterAt(ccl, meth, ip, &p, &name); + parmId=ClClassAddMethParameter(&cl->hdr, meth, name, p); + parm=((ClParameter*)ClObjectGetClSection(&cl->hdr,&meth->parameters))+parmId-1; + + for (iq=0,mq=ClClassGetMethParamQualifierCount(ccl,parm); iq<mq; iq++) { + ClClassGetMethParamQualifierAt(ccl, parm, iq, &d, &name); + ClClassAddMethParamQualifier(&cl->hdr, parm, name, d); + } + } + } return 0; } @@ -287,14 +313,16 @@ { CMPIStatus st = { CMPI_RC_OK, NULL }; CMPIConstClass *pcc=getClass(cr,p); + unsigned char originId=0; if (p) { char* np=(char*)cc->ft->getCharSuperClassName(pcc); + if (np) originId=ClClassAddGrandParent(cl,np); st=mergeParents(cr,cl,np,NULL); } - if (cc) cpyClass(cl,cc); - else cpyClass(cl,pcc); + if (cc) cpyClass(cl,cc,originId); + else cpyClass(cl,pcc,originId); return st; } @@ -305,21 +333,29 @@ UtilHashTable *it=cb->it; UtilList *ul; char *pn=p; - ClClass *mc; CMPIConstClass *cc=ccp; - + ClClass *mc; + FILE *rep; + if (p) { mc=ClClassNew(cn,p); - mergeParents(cr,mc,pn,cc); + mergeParents(cr,mc,pn,ccp); + ccp->hdl=mc; } - - cb->ht->ft->put(cb->ht, cn, cc); - if (cc->ft->isAssociation(cc)) assocs++; - if (p == NULL) topAssocs++; - - - - else { + cc=ccp->ft->clone(ccp,NULL); + mc=(ClClass*)cc->hdl; + + cb->ht->ft->put(cb->ht, strdup(cn), cc); + rep = fopen(cr->fn, "a"); + fwrite(mc,1,mc->hdr.size,rep); + fclose(rep); + + if (cc->ft->isAssociation(cc)) { + cr->assocs++; + if (p == NULL) cr->topAssocs++; + } + + if (p) { ul = it->ft->get(it, p); if (ul == NULL) { ul = UtilFactory->newList(); @@ -684,7 +720,7 @@ char *pn = (char*)cc->ft->getCharSuperClassName(cc); char *cn = (char*)cc->ft->getCharClassName(cc); - + cl = getClass(cReg,cn); if (cl) { st.rc = CMPI_RC_ERR_ALREADY_EXISTS; @@ -864,7 +900,7 @@ } else if (strcasecmp(methodName, "getassocs") == 0) { - ar = CMNewArray(_broker, topAssocs, CMPI_string, NULL); + ar = CMNewArray(_broker, cReg->topAssocs, CMPI_string, NULL); ClassBase *cb = (ClassBase *) (cReg + 1); UtilHashTable *ct = cb->ht; HashTableIterator *i; Index: objectImpl.h =================================================================== RCS file: /cvsroot/sblim/sfcb/objectImpl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- objectImpl.h 12 Mar 2005 00:43:00 -0000 1.2 +++ objectImpl.h 25 Apr 2005 14:40:42 -0000 1.3 @@ -30,6 +30,20 @@ #define MALLOCED(a) (((a) & 0xff000000)!=0xff000000) +#define ClCurrentVersion 1 +#define ClCurrentLevel 0 +#define ClTypeClassRep 1 + +typedef struct { + unsigned long size; // used to determine endianes + unsigned short type; + char id[10]; // "sfcb-rep\0" used to determine asci/ebcdic char encoding + unsigned short version; + unsigned short level; + unsigned short options; + unsigned short reserved[5]; +} ClVersionRecord; + typedef struct { char *str; int used, max; @@ -53,6 +67,7 @@ #define HDR_Instance 2 #define HDR_ObjectPath 3 #define HDR_Args 4 +#define HDR_Version 128 long strBufOffset; long arrayBufOffset; } ClObjectHdr; @@ -67,11 +82,13 @@ typedef struct { ClObjectHdr hdr; - unsigned long quals; + unsigned char quals; #define ClClass_Q_Abstract 1 #define ClClass_Q_Association 2 #define ClClass_Q_Indication 4 #define ClClass_Q_Deprecated 8 + unsigned char parents; + unsigned short reserved; ClString name; ClString parent; ClSection qualifiers; @@ -94,9 +111,11 @@ typedef struct { ClObjectHdr hdr; - unsigned long quals; + unsigned char quals; #define ClInst_Q_Association 2 #define ClInst_Q_Indication 4 + unsigned char parents; + unsigned short reserved; ClString className; ClString nameSpace; ClSection qualifiers; @@ -135,16 +154,110 @@ CMPIData data; unsigned short flags; #define ClProperty_EmbeddedObjectAsString 1 - unsigned short quals; +#define ClProperty_Deleted 2 + unsigned char quals; #define ClProperty_Q_Key 1 #define ClProperty_Q_Propagated 2 #define ClProperty_Q_Deprecated 4 #define ClProperty_Q_EmbeddedObject 8 + unsigned char originId; ClSection qualifiers; } ClProperty; -const char *ClObjectPathGetNameSpace(ClObjectPath * op); -const char *ClObjectPathGetClassName(ClObjectPath * op); +typedef struct { + ClString id; + CMPIType type; + unsigned short flags; + unsigned char quals; + unsigned char originId; + ClSection qualifiers; + ClSection parameters; +} ClMethod; + +typedef struct { + CMPIType type; + unsigned int arraySize; + char *refName; +} CMPIParameter; +typedef struct { + ClString id; + CMPIParameter parameter; + unsigned short quals; + ClSection qualifiers; +} ClParameter; + +/* objectImpl.c */ + +extern const char *ClObjectGetClString(ClObjectHdr *hdr, ClString *id); +extern const CMPIData *ClObjectGetClArray(ClObjectHdr *hdr, ClArray *id); +extern void *ClObjectGetClSection(ClObjectHdr *hdr, ClSection *s); +extern int ClClassAddQualifier(ClObjectHdr *hdr, ClSection *qlfs, const char *id, CMPIData d); +extern int ClClassAddPropertyQualifier(ClObjectHdr *hdr, ClProperty *p, const char *id, CMPIData d); +extern int ClClassAddMethodQualifier(ClObjectHdr *hdr, ClMethod *m, const char *id, CMPIData d); +extern int ClClassAddMethParamQualifier(ClObjectHdr *hdr, ClParameter *p,const char *id, CMPIData d); +extern int ClClassGetQualifierAt(ClClass *cls, int id, CMPIData *data, char **name); +extern int ClClassGetQualifierCount(ClClass *cls); +extern int ClClassGetMethParameterCount(ClClass * cls, int id); +extern int ClClassAddMethParameter(ClObjectHdr *hdr, ClMethod *m, const char *id, CMPIParameter cp); +extern int ClClassLocateMethod(ClObjectHdr *hdr, ClSection *mths, const char *id); +extern int ClClassGetMethQualifierCount(ClClass * cls, int id); +extern int ClClassGetMethParamQualifierCount(ClClass * cls, ClParameter *p); +extern int ClObjectLocateProperty(ClObjectHdr *hdr, ClSection *prps, const char *id); +extern void showClHdr(void *ihdr); +extern unsigned char ClClassAddGrandParent(ClClass *cls, char *gp); +extern ClClass *ClClassNew(const char *cn, const char *pa); +extern unsigned long ClSizeClass(ClClass *cls); +extern ClClass *ClClassRebuildClass(ClClass *cls, void *area); +extern void ClClassRelocateClass(ClClass *cls); +extern void ClClassFreeClass(ClClass *cls); +extern char *ClClassToString(ClClass *cls); +extern int ClClassAddProperty(ClClass *cls, const char *id, CMPIData d); +extern int ClClassGetPropertyCount(ClClass *cls); +extern int ClClassGetPropertyAt(ClClass *cls, int id, CMPIData *data, char **name, unsigned long *quals); +extern int ClClassGetPropQualifierCount(ClClass *cls, int id); +extern int ClClassGetPropQualifierAt(ClClass *cls, int id, int qid, CMPIData *data, char **name); +extern int ClClassAddMethod(ClClass *cls, const char *id, CMPIType t); +extern int ClClassGetMethodCount(ClClass *cls); +extern int ClClassGetMethodAt(ClClass *cls, int id, CMPIType *data, char **name, unsigned long *quals); +extern int ClClassGetMethQualifierAt(ClClass *cls, ClMethod *m, int qid, CMPIData *data, char **name); +extern int ClClassGetMethParameterAt(ClClass *cls, ClMethod *m, int pid, CMPIParameter *parm, char **name); +extern int ClClassGetMethParamQualifierAt(ClClass * cls, ClParameter *parm, int id, CMPIData *d, char **name); +extern int isInstance(CMPIInstance *ci); +extern ClInstance *ClInstanceNew(const char *ns, const char *cn); +extern unsigned long ClSizeInstance(ClInstance *inst); +extern ClInstance *ClInstanceRebuild(ClInstance *inst, void *area); +extern void ClInstanceRelocateInstance(ClInstance *inst); +extern void ClInstanceFree(ClInstance *inst); +extern char *ClInstanceToString(ClInstance *inst); +extern int ClInstanceGetPropertyCount(ClInstance *inst); +extern int ClInstanceGetPropertyAt(ClInstance *inst, int id, CMPIData *data, char **name, unsigned long *quals); +extern int ClInstanceAddProperty(ClInstance *inst, const char *id, CMPIData d); +extern const char *ClInstanceGetClassName(ClInstance *inst); +extern const char *ClInstanceGetNameSpace(ClInstance *inst); +extern const char *ClGetStringData(CMPIInstance *ci, int id); +extern ClObjectPath *ClObjectPathNew(const char *ns, const char *cn); +extern unsigned long ClSizeObjectPath(ClObjectPath *op); +extern ClObjectPath *ClObjectPathRebuild(ClObjectPath *op, void *area); +extern void ClObjectPathRelocateObjectPath(ClObjectPath *op); +extern void ClObjectPathFree(ClObjectPath *op); +extern char *ClObjectPathToString(ClObjectPath *op); +extern int ClObjectPathGetKeyCount(ClObjectPath *op); +extern int ClObjectPathGetKeyAt(ClObjectPath *op, int id, CMPIData *data, char **name); +extern int ClObjectPathAddKey(ClObjectPath *op, const char *id, CMPIData d); +extern void ClObjectPathSetHostName(ClObjectPath *op, const char *hn); +extern const char *ClObjectPathGetHostName(ClObjectPath *op); +extern void ClObjectPathSetNameSpace(ClObjectPath *op, const char *ns); +extern const char *ClObjectPathGetNameSpace(ClObjectPath *op); +extern void ClObjectPathSetClassName(ClObjectPath *op, const char *cn); +extern const char *ClObjectPathGetClassName(ClObjectPath *op); +extern ClArgs *ClArgsNew(void); +extern unsigned long ClSizeArgs(ClArgs *arg); +extern ClArgs *ClArgsRebuild(ClArgs *arg, void *area); +extern void ClArgsRelocateArgs(ClArgs *arg); +extern void ClArgsFree(ClArgs *arg); +extern int ClArgsGetArgCount(ClArgs *arg); +extern int ClArgsGetArgAt(ClArgs *arg, int id, CMPIData *data, char **name); +extern int ClArgsAddArg(ClArgs *arg, const char *id, CMPIData d); #endif Index: objectpath.c =================================================================== RCS file: /cvsroot/sblim/sfcb/objectpath.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- objectpath.c 21 Mar 2005 14:22:38 -0000 1.2 +++ objectpath.c 25 Apr 2005 14:40:42 -0000 1.3 @@ -31,23 +31,6 @@ #include "native.h" #include "msgqueue.h" -extern int ClObjectPathGetKeyAt(ClObjectPath * op, int id, CMPIData * data, - char **name, unsigned long *quals); -extern int ClObjectLocateProperty(ClObjectHdr * hdr, ClSection * prps, - const char *id); -extern int ClObjectPathGetKeyCount(ClObjectPath * op); -extern int ClObjectPathAddKey(ClObjectPath * op, const char *id, CMPIData d); -extern ClObjectPath *ClObjectPathNew(const char *ns, const char *cn); -extern ClObjectPath *ClObjectPathRebuild(ClObjectPath * op, void *area); -extern void ClObjectPathRelocateObjectPath(ClObjectPath *); -extern void ClObjectPathFree(ClObjectPath * op); -extern const char *ClObjectPathGetHostName(ClObjectPath * op); -extern const char *ClObjectPathGetNameSpace(ClObjectPath * op); -extern const char *ClObjectPathGetClassName(ClObjectPath * op); -extern void ClObjectPathSetHostName(ClObjectPath * op, const char *hn); -extern void ClObjectPathSetNameSpace(ClObjectPath * op, const char *ns); -extern void ClObjectPathSetClassName(ClObjectPath * op, const char *cn); -extern unsigned long ClSizeObjectPath(ClObjectPath * op); extern CMPIArray *native_make_CMPIArray(CMPIData * av, CMPIStatus * rc); extern CMPIObjectPath *interal_new_CMPIObjectPath(int mode, const char *, const char *, CMPIStatus *); @@ -161,18 +144,18 @@ ClObjectPath *cop = (ClObjectPath *) op->hdl; CMPIData rv = { 0, CMPI_notFound, {0} }; - if (ClObjectPathGetKeyAt(cop, i, &rv, name ? name : NULL, NULL)) { + if (ClObjectPathGetKeyAt(cop, i, &rv, name ? name : NULL)) { if (rc) CMSetStatus(rc, CMPI_RC_ERR_NOT_FOUND); return rv; } - + if (rv.type == CMPI_chars) { rv.value.string = native_new_CMPIString(rv.value.chars, NULL); rv.type = CMPI_string; } else if (rv.type == CMPI_ref) { - char *msg; + char *msg=""; rv.value.ref = getObjectPath(ClObjectGetClString (&cop->hdr, (ClString *) & rv.value.chars), &msg); } Index: cimXmlParser.h =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlParser.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cimXmlParser.h 11 Apr 2005 23:13:41 -0000 1.3 +++ cimXmlParser.h 25 Apr 2005 14:40:42 -0000 1.4 @@ -185,22 +185,32 @@ } XtokQualifiers; + +typedef struct xtokPropertyData { + union { + char *value; + XtokValueReference ref; + }; + XtokQualifiers qualifiers; +} XtokPropertyData; + typedef struct xtokProperty { struct xtokProperty *next; - XtokQualifiers qualifiers; + // XtokQualifiers qualifiers; char *name; char *classOrigin; char propagated; + char *referenceClass; CMPIType valueType; - union { + XtokPropertyData val; +/* union { struct { char *value; }; struct { XtokValueReference ref; - char *referenceClass; }; - }; + }; */ TypeProperty propType; } XtokProperty; @@ -208,30 +218,17 @@ XtokProperty *last, *first; // must be free'd } XtokProperties; -typedef struct xtokPropertyPartList { - union { - char *value; - XtokValueReference ref; - }; - int qPart; - XtokQualifiers qualifiers; -} XtokPropertyPartList; - -typedef struct xtokPropertyPart { - char *value; - int refValue; - XtokValueReference ref; - int qPart; - XtokQualifier qualifier; -} XtokPropertyPart; - - typedef struct xtokInstance { char *className; XtokProperties properties; XtokQualifiers qualifiers; } XtokInstance; +typedef struct xtokInstanceData { + XtokProperties properties; + XtokQualifiers qualifiers; +} XtokInstanceData; + typedef struct xtokNamedInstance { XtokInstanceName path; XtokInstance instance; @@ -277,6 +274,7 @@ typedef struct xtokMethod { struct xtokMethod *next; + XtokQualifiers qualifiers; XtokParams params; char *name; char *classOrigin; @@ -284,16 +282,10 @@ CMPIType type; } XtokMethod; -typedef struct xtokMethodPart { - XtokParam param; - int qPart; - XtokQualifier qualifier; -} XtokMethodPart; - -typedef struct xtokMethodPartList { +typedef struct xtokMethodData { XtokQualifiers qualifiers; XtokParams params; -} XtokMethodPartList; +} XtokMethodData; typedef struct xtokMethods { XtokMethod *last, *first; // must be free'd @@ -691,6 +683,7 @@ XtokQualifiers qualifiers; XtokMethods methods; XtokParamValues paramValues; + int Qs,Ps,Ms,MPs,MQs,MPQs; jmp_buf env; } ParserControl; Index: cimXmlParser.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlParser.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cimXmlParser.c 11 Apr 2005 23:13:41 -0000 1.2 +++ cimXmlParser.c 25 Apr 2005 14:40:42 -0000 1.3 @@ -1023,10 +1023,10 @@ memset(attr, 0, sizeof(attr)); if (tagEquals(parm->xmb, "METHOD")) { attr[1].attr = NULL; - if (attrsOk(parm->xmb, elm, attr, "METHOD", ZTOK_METHODDEF)) { + if (attrsOk(parm->xmb, elm, attr, "METHOD", ZTOK_METHOD)) { memset(&lvalp->xtokMethod, 0, sizeof(XtokMethod)); lvalp->xtokMethod.name = attr[0].attr; - lvalp->xtokMethod.type = (CMPIType) - 1; + lvalp->xtokMethod.type = CMPI_null; if (attr[1].attr) for (i = 0, m = sizeof(types) / sizeof(Types); i < m; i++) { if (strcasecmp(attr[1].attr, types[i].str) == 0) { @@ -1037,7 +1037,7 @@ lvalp->xtokMethod.classOrigin = attr[2].attr; if (attr[3].attr) lvalp->xtokMethod.propagated = !strcasecmp(attr[3].attr, "true"); - return XTOK_METHODDEF; + return XTOK_METHOD; } } return 0; @@ -1060,7 +1060,7 @@ memset(&lvalp->xtokParam, 0, sizeof(XtokParam)); lvalp->xtokParam.pType = ZTOK_PARAM; lvalp->xtokParam.name = attr[0].attr; - lvalp->xtokParam.type = (CMPIType) - 1; + lvalp->xtokParam.type = CMPI_null; if (attr[1].attr) for (i = 0, m = sizeof(types) / sizeof(Types); i < m; i++) { if (strcasecmp(attr[1].attr, types[i].str) == 0) { @@ -1092,11 +1092,12 @@ memset(&lvalp->xtokParam, 0, sizeof(XtokParam)); lvalp->xtokParam.pType = ZTOK_PARAMARRAY; lvalp->xtokParam.name = attr[0].attr; - lvalp->xtokParam.type = (CMPIType) - 1; + lvalp->xtokParam.type = CMPI_null; if (attr[1].attr) for (i = 0, m = sizeof(types) / sizeof(Types); i < m; i++) { if (strcasecmp(attr[1].attr, types[i].str) == 0) { lvalp->xtokParam.type = types[i].type; + lvalp->xtokParam.type |=CMPI_ARRAY; break; } } @@ -1124,6 +1125,7 @@ lvalp->xtokParam.pType = ZTOK_PARAMREF; lvalp->xtokParam.name = attr[0].attr; lvalp->xtokParam.refClass = attr[1].attr; + lvalp->xtokParam.type = CMPI_ref; return XTOK_PARAM; } } @@ -1149,6 +1151,7 @@ lvalp->xtokParam.name = attr[0].attr; lvalp->xtokParam.refClass = attr[1].attr; lvalp->xtokParam.arraySize = attr[2].attr; + lvalp->xtokParam.type = CMPI_refA; return XTOK_PARAM; } } @@ -1188,7 +1191,7 @@ {"PARAMETER.REFERENCE", procParamRef, ZTOK_PARAMREF}, {"PARAMETER.REFARRAY", procParamRefArray, ZTOK_PARAMREFARRAY}, {"PARAMETER", procParam, ZTOK_PARAM}, - {"METHOD", procMethod, ZTOK_METHODDEF}, + {"METHOD", procMethod, ZTOK_METHOD}, {"CLASS", procClass, ZTOK_CLASS}, {"?xml", procXml, ZTOK_XML}, }; @@ -1254,6 +1257,13 @@ control.paramValues.last = control.paramValues.first = NULL; control.properties.last = control.properties.first = NULL; control.qualifiers.last = control.qualifiers.first = NULL; + control.methods.last = control.methods.first = NULL; + control.Qs=0; + control.Ps=0; + control.Ms=0; + control.MPs=0; + control.MQs=0; + control.MPQs=0; if (setjmp(control.env)) { // printf("--- setjmp caught !!\n"); Index: objectImpl.c =================================================================== RCS file: /cvsroot/sblim/sfcb/objectImpl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- objectImpl.c 12 Mar 2005 00:43:00 -0000 1.2 +++ objectImpl.c 25 Apr 2005 14:40:42 -0000 1.3 @@ -108,8 +108,8 @@ { ClArrayBuf *buf; - if MALLOCED - (hdr->arrayBufOffset) buf = (ClArrayBuf *) hdr->arrayBufOffset; + if MALLOCED (hdr->arrayBufOffset) + buf = (ClArrayBuf *) hdr->arrayBufOffset; else buf = (ClArrayBuf *) ((char *) hdr + abs(hdr->arrayBufOffset)); return &(buf->buf[buf->index[id->id - 1]]); @@ -117,8 +117,8 @@ void *ClObjectGetClSection(ClObjectHdr * hdr, ClSection * s) { - if MALLOCED - (s->offset) return (void *) s->offset; + if MALLOCED(s->offset) + return (void *) s->offset; return (void *) ((char *) hdr + abs(s->offset)); } @@ -696,6 +696,7 @@ d.type = CMPI_chars; d.value.chars = (char *) addClString(hdr, (char *) d.value.string->hdl); } + q.data = d; return q; } @@ -742,6 +743,18 @@ return 0; } +int ClClassAddMethodQualifier(ClObjectHdr * hdr, ClMethod * m, + const char *id, CMPIData d) +{ + return ClClassAddQualifier(hdr, &m->qualifiers, id, d); +} + +int ClClassAddMethParamQualifier(ClObjectHdr * hdr, ClParameter * p, + const char *id, CMPIData d) +{ + return ClClassAddQualifier(hdr, &p->qualifiers, id, d); +} + static void freeQualifiers(ClObjectHdr * hdr, ClSection * s) { if MALLOCED @@ -791,17 +804,25 @@ return l; } +static int ClGetQualifierAt(ClClass * cls, ClQualifier *q, int id, CMPIData * data, char **name) +{ + if (data) *data = (q + id)->data; + if (data->type== CMPI_chars) { + const char *str = + ClObjectGetClString(&cls->hdr, (ClString *) & data->value.chars); + data->value.string = native_new_CMPIString(str, NULL); + data->type = CMPI_string; + } + if (name) *name = strdup(ClObjectGetClString(&cls->hdr, &(q + id)->id)); + return 0; +} + int ClClassGetQualifierAt(ClClass * cls, int id, CMPIData * data, char **name) { ClQualifier *q; q = (ClQualifier *) ClObjectGetClSection(&cls->hdr, &cls->qualifiers); - if (id < 0 || id > cls->qualifiers.used) - return 1; - if (data) - *data = (q + id)->data; - if (name) - *name = strdup(ClObjectGetClString(&cls->hdr, &(q + id)->id)); - return 0; + if (id < 0 || id > cls->qualifiers.used) return 1; + return ClGetQualifierAt(cls,q,id,data,name); } int ClClassGetQualifierCount(ClClass * cls) @@ -814,7 +835,266 @@ //------------------------------------------------------- //----- -//-- property support +//-- parameter support +//----- +//------------------------------------------------------- + +static int locateParameter(ClObjectHdr * hdr, ClSection * prms, const char *id) +{ + int i; + ClParameter *p; + + if MALLOCED(prms->offset) + p = (ClParameter *) prms->offset; + else p = (ClParameter *) (((char *) hdr) + abs(prms->offset)); + + for (i = 0; i > prms->used; i++) { + if (strcasecmp(id, ClObjectGetClString(hdr, &(p + i)->id)) == 0) + return i + 1; + } + return 0; +} + +int ClClassGetMethParamQualifierCount(ClClass * cls, ClParameter *p) +{ + return p->qualifiers.used; +} + +static int addClParameter(ClObjectHdr * hdr, ClSection * prms, ClParameter * np) +{ + int i; + ClParameter *p; + + if ((i = locateParameter(hdr, prms, ClObjectGetClString(hdr, &np->id))) == 0) { + p = (ClParameter *) ensureClSpace(hdr, prms, sizeof(*p), 4); + p = p + (prms->used++); + *p = *np; + return prms->used; + } + else return 0; +} + +static ClParameter makeClParameter(ClObjectHdr * hdr, const char *id, + CMPIParameter cp) +{ + ClParameter p; + + memset(&p,0,sizeof(p)); + p.id.id = addClString(hdr, id); + p.parameter = cp; + return p; +} + +int ClClassAddMethParameter(ClObjectHdr * hdr, ClMethod * m, + const char *id, CMPIParameter cp) +{ + ClParameter p; + + p = makeClParameter(hdr, id, cp); + return addClParameter(hdr, &m->parameters, &p); +} + +static long sizeParameters(ClObjectHdr * hdr, ClSection * s) +{ + int l; + long sz = s->used * sizeof(ClParameter); + ClParameter *p = (ClParameter *) ClObjectGetClSection(hdr, s); + + for (l = s->used; l > 0; l--, p++) { + if (p->qualifiers.used) + sz += sizeQualifiers(hdr, &p->qualifiers); + } + DEB(printf("--- sizeParameters: %lu-%p\n", sz, (void *) sz)); + return sz; +} + +static long copyParameters(int ofs, int max, char *to, ClSection * ts, + ClObjectHdr * from, ClSection * fs) +{ + ClParameter *fp = (ClParameter *) ClObjectGetClSection(from, fs); + ClParameter *tp = (ClParameter *) (to + ofs); + int i; + int l = ts->used * sizeof(ClParameter); + if (l == 0) + return 0; + ts->max = ts->used; + + memcpy(tp, fp, l); + ts->offset = -ofs; + + for (i = ts->used; i > 0; i--, fp++, tp++) { + if (tp->qualifiers.used) + l += copyQualifiers(ofs + l, max, to, &tp->qualifiers, from, + &fp->qualifiers); + } + + return l; +} + +static void freeParameters(ClObjectHdr * hdr, ClSection * s) +{ + ClParameter *p; + int i, l; + _SFCB_ENTER(TRACE_OBJECTIMPL, "freeParameters"); + + p = (ClParameter *) ClObjectGetClSection(hdr, s); + + if (p) for (i = 0, l = p->qualifiers.used; i < l; i++) + freeQualifiers(hdr, &p->qualifiers); + if MALLOCED(s->offset) free((void *) s->offset); + + _SFCB_EXIT(); +} + +//------------------------------------------------------- +//----- +//-- method support +//----- +//------------------------------------------------------- + +int ClClassLocateMethod(ClObjectHdr * hdr, ClSection * mths, const char *id) +{ + int i; + ClMethod *m; + + if MALLOCED + (mths->offset) m = (ClMethod *) mths->offset; + else + m = (ClMethod *) (((char *) hdr) + abs(mths->offset)); + + for (i = 0; i < mths->used; i++) { + if (strcasecmp(id, ClObjectGetClString(hdr, &(m + i)->id)) == 0) + return i + 1; + } + return 0; +} + +static int addClassMethodH(ClObjectHdr * hdr, ClSection * mths, + const char *id, CMPIType t) +{ + int i; + ClMethod *m; + + _SFCB_ENTER(TRACE_OBJECTIMPL, "addClassMethodH"); + + if ((i = ClClassLocateMethod(hdr, mths, id)) == 0) { + m = (ClMethod *) ensureClSpace(hdr, mths, sizeof(*m), 8); + m = m + (mths->used++); + clearClSection(&m->qualifiers); + m->id.id = addClString(hdr, id); + m->quals = 0; + m->originId=0; + m->type = t; + _SFCB_RETURN(mths->used); + } + + else { + if MALLOCED (mths->offset) m = (ClMethod *) mths->offset; + else m = (ClMethod *) ((char*)hdr + abs(mths->offset)); + (m + i - 1)->type = t; + _SFCB_RETURN(i); + } +} + +static long sizeMethods(ClObjectHdr * hdr, ClSection * s) +{ + int l; + long sz = s->used * sizeof(ClMethod); + ClMethod *m = (ClMethod *) ClObjectGetClSection(hdr, s); + + for (l = s->used; l > 0; l--, m++) { + if (m->qualifiers.used) + sz += sizeQualifiers(hdr, &m->qualifiers); + if (m->parameters.used) + sz += sizeParameters(hdr, &m->parameters); + } + DEB(printf("--- sizeMethods: %lu-%p\n", sz, (void *) sz)); + return sz; +} + +static long copyMethods(int ofs, int max, char *to, ClSection * ts, + ClObjectHdr... [truncated message content] |
From: Viktor M. <mih...@us...> - 2005-04-20 17:02:53
|
Update of /cvsroot/sblim/cmpi-samples/cmpi-fad In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15147 Modified Files: Makefile.am configure.ac provider-register.sh sblim-cmpi-fad.spec.in Log Message: Bug 1183788: Simplification of provider registration and support for deregistration. provider-register.sh heavily updated. Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/cmpi-samples/cmpi-fad/configure.ac,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configure.ac 19 Apr 2005 15:05:09 -0000 1.2 +++ configure.ac 20 Apr 2005 17:02:41 -0000 1.3 @@ -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.1, mih...@de..., sblim-cmpi-fad) +AC_INIT(CMPI Files And Directories, 0.4.0, 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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 19 Apr 2005 15:05:08 -0000 1.2 +++ Makefile.am 20 Apr 2005 17:02:38 -0000 1.3 @@ -64,7 +64,6 @@ # We must explicity add the RPM spec file to the distribution package EXTRA_DIST+=sblim-cmpi-fad.spec - # # Automake instructions for ./schema subdir # @@ -72,23 +71,17 @@ # LIST ALL PROVIDER CLASS DEFINITION FILES (MOFS) HERE MOFS=schema/CWS_FAD.mof -SCHEMAS=schema/CWS_FAD.PegasusReg.mof schema/CWS_FAD.sfcb.reg - -# LIST ALL THE CIMOM-SPECIFIC CLASS REGISTRATION DATA FILES HERE -REGISTRATIONS.pegasus=schema/CWS_FAD.PegasusReg.mof -REGISTRATIONS.sfcb=schema/CWS_FAD.sfcb.reg -REGISTRATIONS.openwbem= -REGISTRATIONS.sniacimom= +REGS=schema/CWS_FAD.registration # Register the provider(s) and class definition(s) to the current CIM server/CIMOM postinstall: - 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@) + sh provider-register.sh -t @CIMSERVER@ -r $(REGS) $(MOFS) + +preuninstall: + sh provider-register.sh -d -t @CIMSERVER@ -r $(REGS) $(MOFS) # We must explicity add all the schema files to the distribution package -pkgdata_DATA=$(MOFS) $(SCHEMAS) +pkgdata_DATA=$(MOFS) $(REGS) pkgdata_SCRIPTS=provider-register.sh EXTRA_DIST+=$(pkgdata_DATA) $(pkgdata_SCRIPTS) Index: provider-register.sh =================================================================== RCS file: /cvsroot/sblim/cmpi-samples/cmpi-fad/provider-register.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- provider-register.sh 5 Apr 2005 13:20:53 -0000 1.1.1.1 +++ provider-register.sh 20 Apr 2005 17:02:41 -0000 1.2 @@ -12,10 +12,108 @@ # # Author: Viktor Mihajlovski <mih...@de...> # Contributors: -# Description: Script to install class definitions (MOFs) and registration data -# for a variety of supported CIMOMs +# Description: Script to install class definitions (MOFs) and +# registration data for a variety of supported CIMOMs # ================================================================== +function pegasus_transform() +{ + OUTFILE=$1 + shift + regfiles=$* + PROVIDERMODULES=`cat $regfiles 2> /dev/null | cut -d ' ' -f 4 | sort | uniq` + if test x"$PROVIDERMODULES" == x + then + echo Failed to read registration files + return 1 + fi + PROVIDERS=`cat $regfiles 2> /dev/null | cut -d ' ' -f 3-4 | sort | uniq` + +# produce ProviderModules + echo > $OUTFILE + for pm in $PROVIDERMODULES + do + cat >> $OUTFILE <<EOFPM +instance of PG_ProviderModule +{ + Name = "$pm"; + Location = "$pm"; + Vendor = "SBLIM"; + Version = "2.0.0"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; +}; + +EOFPM + done + +# produce Providers + set -- $PROVIDERS + while test x$1 != x + do + cat >> $OUTFILE <<EOFP +instance of PG_Provider +{ + Name = "$1"; + ProviderModuleName = "$2"; +}; + +EOFP + shift 2 + done + +#produce Capabilities + for rf in $regfiles + do + echo $rf + while read CLASSNAME NAMESPACE PROVIDERNAME PROVIDERMODULE CAPS + do + numcap= + for cap in $CAPS + do + case $cap in + instance) + if test x$numcap == x + then numcap=2 + else numcap="$numcap, 2" + fi;; + association) + if test x$numcap == x + then numcap=3 + else numcap="$numcap, 3" + fi;; + indication) + if test x$numcap == x + then numcap=4 + else numcap="$numcap, 4" + fi;; + method) + if test x$numcap == x + then numcap=5 + else numcap="$numcap, 5" + fi;; + **) echo unknown provider type $cap + return 1;; + esac + done + cat >> $OUTFILE <<EOFC +instance of PG_ProviderCapabilities +{ + ProviderModuleName = "$PROVIDERMODULE"; + ProviderName = "$PROVIDERNAME"; + ClassName = "$CLASSNAME"; + ProviderType = { $numcap }; + Namespaces = {"$NAMESPACE"}; + SupportedProperties = NULL; + SupportedMethods = NULL; + CapabilityID = "1"; +}; + +EOFC + done < $rf + done +} + function pegasus_install() { if ps -C cimserver > /dev/null 2>&1 @@ -26,54 +124,254 @@ CIMMOF=cimmofl state=inactive fi + + mymofs= + mregs= + mofmode=1 + while test x$1 != x + do + if test $1 == ":" + then + mofmode=0 + shift + continue + fi + if test $mofmode == 1 + then + mymofs="$mymofs $1" + else + myregs="$myregs $1" + fi + shift + done + + for _TEMPDIR in /var/tmp /tmp + do + if test -w $_TEMPDIR + then + _REGFILENAME=$_TEMPDIR/$$.mof + break + fi + done + - if test $1 == mofs - then - NAMESPACE=root/cimv2 - action="Installing Schemas" - else if test $1 == regs + trap "rm -f $_REGFILENAME" EXIT + + if pegasus_transform $_REGFILENAME $myregs then - NAMESPACE=root/PG_Interop - action="Registering Providers" + echo Registering providers with $state cimserver + $CIMMOF -n root/cimv2 $mymofs && + $CIMMOF -n root/PG_Interop $_REGFILENAME else - echo "Invalid install mode " $1 + echo "Failed to build pegasus registration MOF." return 1 fi +} + +function pegasus_uninstall() +{ + mymofs= + mregs= + mofmode=1 + while test x$1 != x + do + if test $1 == ":" + then + mofmode=0 + shift + continue + fi + if test $mofmode == 1 + then + mymofs="$mymofs $1" + else + myregs="$myregs $1" + fi + shift + done + + if ps -C cimserver > /dev/null 2>&1 + then + PROVIDERMODULES=`cat $myregs 2> /dev/null | cut -d ' ' -f 4 | sort | uniq` + echo $PROVIDERMODULES + if test x"$PROVIDERMODULES" == x + then + echo Failed to read registration files + return 1 + fi + for pm in $PROVIDERMODULES + do + cimprovider -d -m $pm && + cimprovider -r -m $pm + done + CLASSES=`cat $myregs 2> /dev/null | cut -d ' ' -f 1` + echo $classes + for cls in $CLASSES + do + CLI dc $cls + done + else + echo "Sorry, cimserver must be running to deregister the providers." + return 1 fi +} +function sfcb_transform() +{ + OUTFILE=$1 shift - echo $action with $state cimserver - $CIMMOF -n $NAMESPACE $* + regfiles=$* + +#produce sfcb registraion + for rf in $regfiles + do + echo $rf + while read CLASSNAME NAMESPACE PROVIDERNAME PROVIDERMODULE CAPS + do + cat >> $OUTFILE <<EOFC +[$CLASSNAME] + provider: $PROVIDERNAME + location: $PROVIDERMODULE + type: $CAPS + namespace: $NAMESPACE +# +EOFC + done < $rf + done } -function sfcb_install() +function sfcb_rebuild() { - if test $1 == mofs + if ps -C sfcbd > /dev/null 2>&1 then - action="Staging Schemas" - shift - params="$*" - else if test $1 == regs + # sfcb is running -- need to restart + for INITSCRIPT in /etc/init.d/sfcb /usr/local/etc/init.d/sfcb none + do + if test -x $INITSCRIPT + then + break; + fi + done + echo "Shutting down sfcb." + if test $INITSCRIPT == none + then + killall sfcbd + else + $INITSCRIPT stop + fi + t=0 + while ps -C sfcbd > /dev/null 2>&1 + do + sleep 1 + t=`expr $t + 1` + if test $t > 10 + then + echo "Timed out waiting for sfcb shutdown..." + echo "Please stop sfcb manually and rebuild the repository using sfcbrepos." + return 1 + fi + done + echo "Rebuilding repository." + sfcbrepos -f + if test $? != 0 + then + echo "Repository rebuild failed." + return 1 + fi + + if test $INITSCRIPT == none + then + echo "No init script found - you need to start sfcbd manually." + return 1 + else + echo "Restarting sfcb." + $INITSCRIPT start + fi + else + # Not running - rebuild repository + echo "Rebuilding repository." + sfcbrepos -f + fi +} + +function sfcb_install() +{ + mymofs= + mregs= + mofmode=1 + while test x$1 != x + do + if test $1 == ":" + then + mofmode=0 + shift + baseregname=`basename -$1 .registration` + continue + fi + if test $mofmode == 1 + then + mymofs="$mymofs $1" + else + myregs="$myregs $1" + fi + shift + done + + for _TEMPDIR in /var/tmp /tmp + do + if test -w $_TEMPDIR + then + _REGFILENAME=$_TEMPDIR/$baseregname.reg + break + fi + done + + trap "rm -f $_REGFILENAME" EXIT + + if sfcb_transform $_REGFILENAME $myregs then - action="Staging Provider Registration -- rebuild repository and restart sfcb!" - shift - params="-r $*" + echo "Staging provider registration." + sfcbstage -r $_REGFILENAME $mymofs + if test $? != 0 + then + echo "Failed to stage provider registration." + return 1 + fi + sfcb_rebuild else - echo "Invalid install mode " $1 + echo "Failed to build sfcb registration file." return 1 fi - fi +} + +function sfcb_uninstall() +{ + mymofs= + while test x$1 != x + do + if test $1 == ":" + then + shift + baseregname=`basename -$1 .registration` + break + fi + mymofs="$mymofs `basename $1`" + shift + done - echo $action - sfcbstage $params + # "Unstage" MOFs and the registration file + sfcbunstage -r $baseregname.reg $mymofs + + # Rebuild repository + sfcb_rebuild } function usage() { - echo "usage: $0 [-h] -t <cimserver> [ -s mof ... | -r regfile ... ]" + echo "usage: $0 [-h] [-d] -t <cimserver> -r regfile [-r regfile ...] mof ..." } -args=`getopt ht:r:s: $*` +args=`getopt dht:r:s: $*` if [ $? != 0 ] then @@ -89,11 +387,11 @@ -h) help=1; shift; break;; + -d) deregister=1; + shift;; -t) cimserver=$2; shift 2;; - -s) mofs=$2; - shift 2;; - -r) regs=$2; + -r) regs="$regs $2"; shift 2;; --) shift; break;; @@ -101,17 +399,18 @@ esac done +mofs=$* + if [ "$help" == "1" ] then usage echo -e "\t-h display help message" + echo -e "\t-d deregister provider and uninstall schema" 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 -e "\t-r specify registration file - this option can be multiply specified" 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. + echo Use this command to install schema mofs and register providers. + echo CIM Server Type is required as well as at least one registration file and one mof. exit 0 fi @@ -121,33 +420,28 @@ exit 1 fi -if test x"$mofs" == x && test x"$regs" == x +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 +if test x$deregister == 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 + case $cimserver in + pegasus) pegasus_install $mofs ":" $regs;; + sfcb) sfcb_install $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 +else + case $cimserver in + pegasus) pegasus_uninstall $mofs ":" $regs;; + sfcb) sfcb_uninstall $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 +fi Index: sblim-cmpi-fad.spec.in =================================================================== RCS file: /cvsroot/sblim/cmpi-samples/cmpi-fad/sblim-cmpi-fad.spec.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- sblim-cmpi-fad.spec.in 5 Apr 2005 13:20:53 -0000 1.1.1.1 +++ sblim-cmpi-fad.spec.in 20 Apr 2005 17:02:41 -0000 1.2 @@ -62,19 +62,17 @@ # Register Schema and Provider - this is higly provider specific %{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \ - -s %{_datadir}/%{name}/CWS_FAD.mof > /dev/null + -r %{_datadir}/%{name}/CWS_FAD.registration \ + %{_datadir}/%{name}/CWS_FAD.mof > /dev/null -%if @CIMSERVER@ == pegasus -%{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \ - -r %{_datadir}/%{name}/CWS_FAD.PegasusReg.mof > /dev/null -%endif +/sbin/ldconfig -%if @CIMSERVER@ == sfcb -%{_datadir}/%{name}/provider-register.sh -t @CIMSERVER@ \ - -r %{_datadir}/%{name}/CWS_FAD.sfcb.reg > /dev/null -%endif +%preun +# Deregister Schema and Provider - this is higly provider specific -/sbin/ldconfig +%{_datadir}/%{name}/provider-register.sh -d -t @CIMSERVER@ \ + -r %{_datadir}/%{name}/CWS_FAD.registration \ + %{_datadir}/%{name}/CWS_FAD.mof > /dev/null %postun /sbin/ldconfig |
From: Viktor M. <mih...@us...> - 2005-04-20 17:02:49
|
Update of /cvsroot/sblim/cmpi-samples/cmpi-fad/schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15147/schema Added Files: CWS_FAD.registration Log Message: Bug 1183788: Simplification of provider registration and support for deregistration. provider-register.sh heavily updated. --- NEW FILE: CWS_FAD.registration --- CWS_Directory root/cimv2 CWS_DirectoryProvider CWS_Directory instance CWS_PlainFile root/cimv2 CWS_PlainFileProvider CWS_PlainFile instance method CWS_DirectoryContainsFile root/cimv2 CWS_DirectoryContainsFileProvider CWS_DirectoryContainsFile association |