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: Michael Chase-S. <mc...@us...> - 2011-12-22 22:32:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via 2b708ad6d865aecb8ba8e8b68c0b6c4f915c8574 (commit) from 2fce38d848005a9ffe19c11be6784abac4b5f8a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2b708ad6d865aecb8ba8e8b68c0b6c4f915c8574 Author: Michael Chase-Salerno <br...@li...> Date: Thu Dec 22 17:29:52 2011 -0500 Initial code for sfcb-ps ----------------------------------------------------------------------- Summary of changes: diff --git a/extra/sfcb-ps b/extra/sfcb-ps new file mode 100755 index 0000000..eed0d57 --- /dev/null +++ b/extra/sfcb-ps @@ -0,0 +1,216 @@ +#!/bin/sh + +############################################################################## +# +# (C) Copyright IBM Corp. 2011 +# +# THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE 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 Eclipse Public License from +# http://www.opensource.org/licenses/eclipse-1.0.php +# +# Author: Mark Lanzo <ma...@us...> +# +# Description: Scan running SFCB processes, +# and figure out which ones are which, as best we can. +# +# This script is designed to run in embedded environments +# This means that a very limited subset of Unix commands and shell features +# are used, because we stick to things known to be available in a reduced +# shell environment. This does limit the capability somewhat. +# +############################################################################## + +N=${0##*/} + +warn () + { + echo 1>&2 "$N: $@" + } + +die () + { + warn "$@" + exit 1 + } + +help () + { +cat <<HELP +$N - Attempt to identify SFCB co-processes. + + This scans for all the SFCB server processes (ones whose name matches + "sbin/sfcbd"), and attempts to determine the specific role of each of + those processes. + + Caution: Determination is not always 100% accurate. In particular, + the Main process is determined by seeing if the process is also the + process group leader (its PID equals its PGID) - a condition which + is true if SFCB was started as a daemon (normal mode) but which may + not apply if SFCB was started in the foreground (developer mode). + +Usage: + $N [options] + +Options: + -raw Scan for sfcbd processes and print process ID info, but don't + otherwise attempt to classify the processes. + + -main Specify the main sfcb process ID when not running in daemon + mode. Experimental. + + +HELP + exit 0 + } + +check_arg () + { + if [ $# -lt 2 -o -z "$2" ] ; then + die "The '$1' option requires a value." + fi + } + +MAIN_PID=unknown +RAW_PS= + +while [ $# -gt 0 ] ; do + case "$1" in + -h | -help | --help | -usage | --usage) + help ;; + + # Experimental and currently undocumented option. May remove later. + -main) + check_arg "$@" ; shift + MAIN_PID="$1" + ;; + + -raw) + RAW_PS=true ;; + + -*) + die "Invalid option '$1'" + ;; + *) + die "Invalid parameter '$1'" + ;; + esac + + shift +done + +if [ -n "$RAW_PS" ] ; then + printf "%5s %5s %5s %-4s %s\n" PID PPID PGID STAT CMD + ps -e -o pid,ppid,pgid,stat,cmd | grep 'sbin[/]sfcb' + exit 0 +fi + +PS_INFO=$(ps -e -o pid,ppid,pgid,stat,cmd | grep 'sbin[/]sfcb') + +if [ -z "$PS_INFO" ] ; then + echo "No SFCB Processes found." + exit 0 +fi + +printf "%5s %5s %5s %-6s %s\n" PID PPID PGID STATE ROLE + +echo "$PS_INFO" | while read pid ppid pgid stat cmd ; do + # If we launched as a daemon, then the top level process is the process + # group leader, so it is easy to identify. + # + # If not launched as a daemon, we have to be told how to recognize + # the right one (with the -main option). + + if [ "$pid" = "$pgid" -o "$pid" = "$MAIN_PID" ] ; then + role="SFCB Main" + + # The HTTP Daemon process will be listening on either or both of + # ports 5988 (http) or 5989 (https). It spawns child processes + # to handle incoming requests. Its children will also have the + # ports open but we can distinguish them because they will not be + # direct children of the master process. + # + # Again, this requires that we be told who the master process is, + # if we weren't launched as a daemon. + + elif [ -n "`lsof -n -w -a -i :5988 -i :5989 -p $pid`" ] ; then + if [ "$ppid" = "$pgid" -o \ + "$ppid" = "$MAIN_PID" ] ; then + role="Http Daemon" + else + role="Http Request Handler" + fi + + # SFCB opens up a huge number of sockets (like 100+!) before launching any + # of its child processes, -except- that it launches it logger process + # prior to opening the sockets. So the logger has a more normal count + # of processes. Here, we make the guess that if it has less than 8 + # files open, it is the logger process (in fact it probably has about 4). + # Heuristics like this are bad, but I don't know any other way to reliably + # identify the logger process. + + else + open_fd=$(ls /proc/$pid/fd 2> /dev/null | wc -w) + + # If we get 0 from above, the process must have gone away, so + # don't bother reporting it. It was probably an HTTP request + # handler. + + if [ "$open_fd" -eq 0 ] ; then + continue + fi + + if [ "$open_fd" -lt 8 ] ; then + role="SFCB Logger" + else + role="" # Sentinel: try other classsifiers + fi + fi + + # Beyond this point, we can identify provider processes, but only by + # scanning the shared libraries they have loaded and looking for + # specific shared libraries which carry that provider's code. Which + # means knowing a priori the names of those specific libraries. + # + # In theory, we could parse the providerRegister file inside the + # registration directory and learn all the provider shared objects, + # and identify all provider processes based on this, but that is not + # an easy thing to do from a shell script. It also wouldn't give us + # unique names as multiple providers can be in a single library. + + if [ -z "$role" ] ; then + + # Cache contents of /proc/$pid/maps for efficiency, and also + # in case the process vanishes while we are poking around. + MAP=`cat /proc/$pid/maps 2>/dev/null` + + if [ -z "$MAP" ] ; then + role="" # Process vanished, probably was HTTP Request Handler + elif echo "$MAP" | grep -q 'libdctmi\.so' ; then + role="Instrumentation Provider (DCTMI)" + elif echo "$MAP" | grep -q 'IndCIMXMLHandler' ; then + role="IndCIMXMLHandler" + elif echo "$MAP" | grep -q 'InteropProvider' ; then + role="Interop Provider" + elif echo "$MAP" | grep -q 'sfcClassProvider' ; then + role="Class Provider" + elif echo "$MAP" | grep -q 'sfcProfileProvider' ; then + role="Profile Provider" + elif echo "$MAP" | grep -q 'sfcInternalProvider' ; then + role="SFCB Internal Provider" + elif echo "$MAP" | grep -q 'sfcInteropServerProvider' ; then + role="SFCB Interop Server Provider" + else + # Most likely it is another provider, but it could also + # be Main if we couldn't figure that out on our own. + role="Unknown" + fi + fi + + if [ -n "$role" ] ; then + printf "%5d %5d %5d %-6s %s\n" "$pid" "$ppid" "$pgid" "$stat" "$role" + fi +done + hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Dave B. <bla...@us...> - 2011-12-15 15:11:10
|
Update of /cvsroot/sblim/jsr48-client In directory vz-cvs-3.sog:/tmp/cvs-serv28216 Modified Files: Tag: CIM_CLIENT_2_1_11_M build.xml sblim-cim-client2.spec Log Message: 2.1.11 release work Index: sblim-cim-client2.spec =================================================================== RCS file: /cvsroot/sblim/jsr48-client/sblim-cim-client2.spec,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -u -d -r1.24 -r1.24.2.1 --- sblim-cim-client2.spec 15 Dec 2011 12:45:54 -0000 1.24 +++ sblim-cim-client2.spec 15 Dec 2011 15:11:08 -0000 1.24.2.1 @@ -1,7 +1,7 @@ %define name sblim-cim-client2 %define project_folder %{name}-%{version}-src %define archive_folder build -%define version HEAD +%define version 2.1.11 %define release 1jpp %define section free Index: build.xml =================================================================== RCS file: /cvsroot/sblim/jsr48-client/build.xml,v retrieving revision 1.45 retrieving revision 1.45.4.1 diff -u -d -r1.45 -r1.45.4.1 --- build.xml 15 Sep 2011 11:19:59 -0000 1.45 +++ build.xml 15 Dec 2011 15:11:08 -0000 1.45.4.1 @@ -36,7 +36,7 @@ <property name="Manifest.name" value="SBLIM CIM Client for Java" /> <property name="Manifest.title" value="SBLIM CIM Client for Java" /> <property name="Manifest.vendor" value="IBM Corporation 2005, 2011" /> - <property name="Manifest.version" value="HEAD" /> + <property name="Manifest.version" value="2.1.11" /> <property name="Directory.source.core" value="${basedir}/src" /> <property name="Directory.source.samples" value="${basedir}/smpl" /> |
From: Dave B. <bla...@us...> - 2011-12-15 12:45:57
|
Update of /cvsroot/sblim/jsr48-client In directory vz-cvs-3.sog:/tmp/cvs-serv9994 Modified Files: ChangeLog sblim-cim-client2.spec NEWS Log Message: 2.1.11 release work Index: sblim-cim-client2.spec =================================================================== RCS file: /cvsroot/sblim/jsr48-client/sblim-cim-client2.spec,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- sblim-cim-client2.spec 15 Sep 2011 11:19:59 -0000 1.23 +++ sblim-cim-client2.spec 15 Dec 2011 12:45:54 -0000 1.24 @@ -158,6 +158,15 @@ # ----------------------------------------------------------------------------- %changelog +* Thu Dec 15 2011 Dave Blaschke <bla...@us...> +- New release 2.1.11 + o 3459036 Linked list for RI queue not efficient for many LDs + o 3444912 Client delay during SSL handshake + o 3423064 Add UpdateExpiredPassword Header for Reqs from Java Client + o 3411944 createJavaObject exception with hex uint + o 3411879 TCK: CIM element value must match type + o 3410126 TCK: CIM element name cannot be null + * Thu Sep 15 2011 Dave Blaschke <bla...@us...> - New release 2.1.10 o 3409691 2.1.10 packaging issues: rpmbuild broken on Red Hat Index: NEWS =================================================================== RCS file: /cvsroot/sblim/jsr48-client/NEWS,v retrieving revision 1.245 retrieving revision 1.246 diff -u -d -r1.245 -r1.246 --- NEWS 15 Dec 2011 12:27:50 -0000 1.245 +++ NEWS 15 Dec 2011 12:45:54 -0000 1.246 @@ -1,4 +1,4 @@ -Changes in HEAD +Version 2.1.11 ================ 3459036 Linked list for RI queue not efficient for many LDs 3444912 Client delay during SSL handshake Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/jsr48-client/ChangeLog,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ChangeLog 15 Sep 2011 11:19:59 -0000 1.22 +++ ChangeLog 15 Dec 2011 12:45:54 -0000 1.23 @@ -1,3 +1,53 @@ +Release 2.1.11 +============== + +Thu Dec 15 06:27:49 CST 2011 blaschke-oss + + 3459036 Linked list for RI queue not efficient for many LDs + + WBEMConfigurationDefaults.java 1.27 + WBEMConfiguration.java 1.38 + CIMIndicationHandler.java 1.26 + WBEMConfigurationProperties.java 1.40 + sblim-cim-client2.properties 1.23 + NEWS 1.245 + +Tue Dec 13 10:10:00 CST 2011 blaschke-oss + + 3444912 Client delay during SSL handshake + + HttpClient.java 1.38 + NEWS 1.244 + +Mon Nov 07 06:05:49 CST 2011 blaschke-oss + + 3423064 Add UpdateExpiredPassword Header for Reqs from Java Client + + WBEMClientCIMXML.java 1.66 + NEWS 1.243 + +Mon Nov 07 05:58:30 CST 2011 blaschke-oss + + 3411944 createJavaObject exception with hex uint + + CIMXMLParserImpl.java 1.43 + NEWS 1.242 + +Mon Nov 07 05:54:54 CST 2011 blaschke-oss + + 3411879 TCK: CIM element value must match type + + CIMValuedElement.java 1.14 + CIMBuilder.java 1.19 + NEWS 1.241 + +Thu Oct 13 16:06:41 CDT 2011 blaschke-oss + + 3410126 TCK: CIM element name cannot be null + + CIMElement.java 1.14 + NEWS 1.240 + Release 2.1.10 ============== |
From: Dave B. <bla...@us...> - 2011-12-15 12:27:52
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem/indications In directory vz-cvs-3.sog:/tmp/cvs-serv9448/src/org/sblim/cimclient/internal/wbem/indications Modified Files: CIMIndicationHandler.java Log Message: 3459036 - Linked list for RI queue not efficient for many LDs Index: CIMIndicationHandler.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem/indications/CIMIndicationHandler.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- CIMIndicationHandler.java 6 Sep 2011 11:20:54 -0000 1.25 +++ CIMIndicationHandler.java 15 Dec 2011 12:27:50 -0000 1.26 @@ -36,6 +36,7 @@ * 3374206 2011-07-22 blaschke-oss NullPointerException caused by Indication * 3376657 2011-07-24 blaschke-oss Get reliable indication properties once * 3390724 2011-08-12 blaschke-oss Problem with Reliable Indication support in the Listener + * 3459036 2011-12-13 blaschke-oss Linked list for RI queue not efficient for many LDs */ package org.sblim.cimclient.internal.wbem.indications; @@ -44,6 +45,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.net.InetAddress; +import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedList; import java.util.Vector; @@ -83,11 +85,12 @@ public class CIMIndicationHandler extends HttpContentHandler { /** - * <code>IndicationServer</code> represents an entry in the linked list of - * servers handled by this <code>CIMIndicationHandler</code> instance. Each - * entry in the list will have a unique serverIP/destinationURL pair along - * with its own <code>ReliableIndicationHandler</code>. This is done to - * handle multiple contexts from the same server. + * <code>IndicationServer</code> represents an entry in the linked list or + * hash table of servers handled by this <code>CIMIndicationHandler</code> + * instance. Each entry in the list/table will have a unique + * serverIP/destinationURL pair along with its own + * <code>ReliableIndicationHandler</code>. This is done to handle multiple + * contexts from the same server. * * NOTE: Multiple contexts from the same server will not be handled * correctly if the user creates multiple @@ -105,15 +108,10 @@ private boolean iRISupported = false; - private InetAddress iInetAddress; - - private String iDestinationUrl; - private ReliableIndicationHandler iRIHandler; - public IndicationServer(InetAddress pInetAddress, String pDestinationUrl) { - this.iInetAddress = pInetAddress; - this.iDestinationUrl = pDestinationUrl; + public IndicationServer() { + // initialize() does the work } public void initialize(boolean pRISupported, ReliableIndicationHandler pRIHandler) { @@ -130,6 +128,31 @@ return this.iRISupported; } + public ReliableIndicationHandler getRIHandler() { + return this.iRIHandler; + } + } + + /** + * <code>ServerListEntry</code> represents a physical entry within the + * linked list. An <code>IndicationServer</code> instance is extracted from + * the linked list by proceeding through each entry in the linked list + * looking for the corresponding server IP and destination URL. + */ + private class ServerListEntry { + + private InetAddress iInetAddress; + + private String iDestinationUrl; + + private IndicationServer iIndicationServer; + + public ServerListEntry(InetAddress pInetAddress, String pDestinationUrl) { + this.iInetAddress = pInetAddress; + this.iDestinationUrl = pDestinationUrl; + this.iIndicationServer = new IndicationServer(); + } + public InetAddress getInetAddress() { return this.iInetAddress; } @@ -138,8 +161,48 @@ return this.iDestinationUrl; } - public ReliableIndicationHandler getRIHandler() { - return this.iRIHandler; + public IndicationServer getIndicationServer() { + return this.iIndicationServer; + } + } + + /** + * <code>ServerTableEntry</code> represents a physical key within the hash + * table while the corresponding <code>IndicationServer</code> is the value + * associated with the key. The hash table key is comprised of a server IP + * and destination URL. + */ + private class ServerTableEntry { + + private InetAddress iInetAddress; + + private String iDestinationUrl; + + public ServerTableEntry(InetAddress pInetAddress, String pDestinationUrl) { + this.iInetAddress = pInetAddress; + this.iDestinationUrl = pDestinationUrl; + } + + public InetAddress getInetAddress() { + return this.iInetAddress; + } + + public String getDestinationUrl() { + return this.iDestinationUrl; + } + + @Override + public boolean equals(Object pObj) { + if (!(pObj instanceof ServerTableEntry)) return false; + ServerTableEntry that = (ServerTableEntry) pObj; + if (this.iInetAddress.equals(that.getInetAddress()) + && this.iDestinationUrl.equalsIgnoreCase(that.getDestinationUrl())) return true; + return false; + } + + @Override + public int hashCode() { + return (this.iInetAddress.hashCode()) ^ (this.iDestinationUrl.hashCode()); } } @@ -153,7 +216,11 @@ private boolean iReliableIndicationsDisabled = true; - private LinkedList<IndicationServer> iServerList = new LinkedList<IndicationServer>(); + private int iHashtableCapacity = 0; // 0 -> linked list, >0 -> hash table + + private LinkedList<ServerListEntry> iServerList; + + private Hashtable<ServerTableEntry, IndicationServer> iServerTable; /** * Ctor. @@ -175,6 +242,29 @@ this.iSessionProperties = (pProperties != null) ? pProperties : WBEMConfiguration .getGlobalConfiguration(); this.iReliableIndicationsDisabled = !this.iSessionProperties.isReliableIndicationEnabled(); + + // Initialize reliable indication support + if (!this.iReliableIndicationsDisabled) { + this.iHashtableCapacity = this.iSessionProperties + .getReliableIndicationHashtableCapacity(); + + // Validate ReliableIndicationHashtableCapacity property + if (this.iHashtableCapacity < 0 || this.iHashtableCapacity > 25000) { + this.iLogger.trace(Level.FINE, "ReliableIndicationHashtableCapacity of " + + this.iHashtableCapacity + " outside range, using default value"); + + this.iHashtableCapacity = Integer.valueOf( + WBEMConfigurationDefaults.LISTENER_RELIABLE_INDICATION_HASHTABLE_CAPACITY) + .intValue(); + } + + if (this.iHashtableCapacity == 0) { + this.iServerList = new LinkedList<ServerListEntry>(); + } else { + this.iServerTable = new Hashtable<ServerTableEntry, IndicationServer>( + this.iHashtableCapacity); + } + } } @Override @@ -292,20 +382,50 @@ * Destination URL of indication. * @return <code>IndicationServer</code> with given address. */ - private IndicationServer getIndicationServer(InetAddress pInetAddress, String pDestinationUrl) { - IndicationServer server; - Iterator<IndicationServer> iterator = this.iServerList.iterator(); + private IndicationServer getIndicationServerFromList(InetAddress pInetAddress, + String pDestinationUrl) { + ServerListEntry entry; + Iterator<ServerListEntry> iterator = this.iServerList.iterator(); while (iterator.hasNext()) { - server = iterator.next(); - if (server.getInetAddress().equals(pInetAddress) - && server.getDestinationUrl().equalsIgnoreCase(pDestinationUrl)) return server; + entry = iterator.next(); + if (entry.getInetAddress().equals(pInetAddress) + && entry.getDestinationUrl().equalsIgnoreCase(pDestinationUrl)) return entry + .getIndicationServer(); } - server = new IndicationServer(pInetAddress, pDestinationUrl); - this.iServerList.add(server); + entry = new ServerListEntry(pInetAddress, pDestinationUrl); + this.iServerList.add(entry); this.iLogger.trace(Level.FINE, "Creating reliable indication handler for server IP " - + server.getInetAddress().toString() + ", destination URL " - + server.getDestinationUrl()); + + entry.getInetAddress().toString() + ", destination URL " + + entry.getDestinationUrl() + " in linked list"); + + return entry.getIndicationServer(); + } + + /** + * Returns the corresponding indication server if the server is already + * present in the hash table, otherwise adds the server to the hash table + * and returns the new entry. + * + * @param pInetAddress + * Address of indication server. + * @param pDestinationUrl + * Destination URL of indication. + * @return <code>IndicationServer</code> with given address. + */ + private IndicationServer getIndicationServerFromTable(InetAddress pInetAddress, + String pDestinationUrl) { + ServerTableEntry key; + IndicationServer server; + key = new ServerTableEntry(pInetAddress, pDestinationUrl); + server = this.iServerTable.get(key); + if (server == null) { + server = new IndicationServer(); + this.iServerTable.put(key, server); + this.iLogger.trace(Level.FINE, "Creating reliable indication handler for server IP " + + key.getInetAddress().toString() + ", destination URL " + + key.getDestinationUrl() + " in hash table"); + } return server; } @@ -325,9 +445,15 @@ */ private synchronized boolean deliverIndication(CIMInstance pIndication, String pId, InetAddress pInetAddress) { + IndicationServer server; + // Each serverIP/destinationURL pair needs its own // ReliableIndicationHandler in order to handle multiple contexts - IndicationServer server = getIndicationServer(pInetAddress, pId); + if (this.iHashtableCapacity == 0) { + server = getIndicationServerFromList(pInetAddress, pId); + } else { + server = getIndicationServerFromTable(pInetAddress, pId); + } // Nothing to do if reliable indications initialized but not supported, // go ahead and deliver @@ -374,7 +500,6 @@ attempts = Long.valueOf(WBEMConfigurationDefaults.LISTENER_DELIVERY_RETRY_ATTEMPTS) .longValue(); - } // Validate DeliveryRetryInterval property |
From: Dave B. <bla...@us...> - 2011-12-13 19:32:25
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/util In directory vz-cvs-3.sog:/tmp/cvs-serv6124/src/org/sblim/cimclient/internal/util Modified Files: Tag: Experimental WBEMConfiguration.java Log Message: 3459036 - Linked list for RI queue not efficient for many LDs Index: WBEMConfiguration.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/util/WBEMConfiguration.java,v retrieving revision 1.17.2.25 retrieving revision 1.17.2.26 diff -u -d -r1.17.2.25 -r1.17.2.26 --- WBEMConfiguration.java 13 Dec 2011 18:45:22 -0000 1.17.2.25 +++ WBEMConfiguration.java 13 Dec 2011 19:32:22 -0000 1.17.2.26 @@ -934,8 +934,8 @@ } /** - * Returns the default value to use for CIM_IndicationService - * DeliveryRetryAttempts + * Returns the initial capacity of the hash table used to handle reliable + * indications * * @return The default value */ |
From: Dave B. <bla...@us...> - 2011-12-13 18:45:24
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem/indications In directory vz-cvs-3.sog:/tmp/cvs-serv25801/src/org/sblim/cimclient/internal/wbem/indications Modified Files: Tag: Experimental CIMIndicationHandler.java Log Message: 3459036 - Linked list for RI queue not efficient for many LDs Index: CIMIndicationHandler.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem/indications/CIMIndicationHandler.java,v retrieving revision 1.10.2.17 retrieving revision 1.10.2.18 diff -u -d -r1.10.2.17 -r1.10.2.18 --- CIMIndicationHandler.java 12 Aug 2011 20:43:15 -0000 1.10.2.17 +++ CIMIndicationHandler.java 13 Dec 2011 18:45:22 -0000 1.10.2.18 @@ -36,6 +36,7 @@ * 3374206 2011-07-22 blaschke-oss NullPointerException caused by Indication * 3376657 2011-07-24 blaschke-oss Get reliable indication properties once * 3390724 2011-08-12 blaschke-oss Problem with Reliable Indication support in the Listener + * 3459036 2011-12-13 blaschke-oss Linked list for RI queue not efficient for many LDs */ package org.sblim.cimclient.internal.wbem.indications; @@ -44,6 +45,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.net.InetAddress; +import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedList; import java.util.Vector; @@ -83,11 +85,12 @@ public class CIMIndicationHandler extends HttpContentHandler { /** - * <code>IndicationServer</code> represents an entry in the linked list of - * servers handled by this <code>CIMIndicationHandler</code> instance. Each - * entry in the list will have a unique serverIP/destinationURL pair along - * with its own <code>ReliableIndicationHandler</code>. This is done to - * handle multiple contexts from the same server. + * <code>IndicationServer</code> represents an entry in the linked list or + * hash table of servers handled by this <code>CIMIndicationHandler</code> + * instance. Each entry in the list/table will have a unique + * serverIP/destinationURL pair along with its own + * <code>ReliableIndicationHandler</code>. This is done to handle multiple + * contexts from the same server. * * NOTE: Multiple contexts from the same server will not be handled * correctly if the user creates multiple @@ -105,15 +108,10 @@ private boolean iRISupported = false; - private InetAddress iInetAddress; - - private String iDestinationUrl; - private ReliableIndicationHandler iRIHandler; - public IndicationServer(InetAddress pInetAddress, String pDestinationUrl) { - this.iInetAddress = pInetAddress; - this.iDestinationUrl = pDestinationUrl; + public IndicationServer() { + // initialize() does the work } public void initialize(boolean pRISupported, ReliableIndicationHandler pRIHandler) { @@ -130,6 +128,31 @@ return this.iRISupported; } + public ReliableIndicationHandler getRIHandler() { + return this.iRIHandler; + } + } + + /** + * <code>ServerListEntry</code> represents a physical entry within the + * linked list. An <code>IndicationServer</code> instance is extracted from + * the linked list by proceeding through each entry in the linked list + * looking for the corresponding server IP and destination URL. + */ + private class ServerListEntry { + + private InetAddress iInetAddress; + + private String iDestinationUrl; + + private IndicationServer iIndicationServer; + + public ServerListEntry(InetAddress pInetAddress, String pDestinationUrl) { + this.iInetAddress = pInetAddress; + this.iDestinationUrl = pDestinationUrl; + this.iIndicationServer = new IndicationServer(); + } + public InetAddress getInetAddress() { return this.iInetAddress; } @@ -138,8 +161,48 @@ return this.iDestinationUrl; } - public ReliableIndicationHandler getRIHandler() { - return this.iRIHandler; + public IndicationServer getIndicationServer() { + return this.iIndicationServer; + } + } + + /** + * <code>ServerTableEntry</code> represents a physical key within the hash + * table while the corresponding <code>IndicationServer</code> is the value + * associated with the key. The hash table key is comprised of a server IP + * and destination URL. + */ + private class ServerTableEntry { + + private InetAddress iInetAddress; + + private String iDestinationUrl; + + public ServerTableEntry(InetAddress pInetAddress, String pDestinationUrl) { + this.iInetAddress = pInetAddress; + this.iDestinationUrl = pDestinationUrl; + } + + public InetAddress getInetAddress() { + return this.iInetAddress; + } + + public String getDestinationUrl() { + return this.iDestinationUrl; + } + + @Override + public boolean equals(Object pObj) { + if (!(pObj instanceof ServerTableEntry)) return false; + ServerTableEntry that = (ServerTableEntry) pObj; + if (this.iInetAddress.equals(that.getInetAddress()) + && this.iDestinationUrl.equalsIgnoreCase(that.getDestinationUrl())) return true; + return false; + } + + @Override + public int hashCode() { + return (this.iInetAddress.hashCode()) ^ (this.iDestinationUrl.hashCode()); } } @@ -153,7 +216,11 @@ private boolean iReliableIndicationsDisabled = true; - private LinkedList<IndicationServer> iServerList = new LinkedList<IndicationServer>(); + private int iHashtableCapacity = 0; // 0 -> linked list, >0 -> hash table + + private LinkedList<ServerListEntry> iServerList; + + private Hashtable<ServerTableEntry, IndicationServer> iServerTable; /** * Ctor. @@ -175,6 +242,29 @@ this.iSessionProperties = (pProperties != null) ? pProperties : WBEMConfiguration .getGlobalConfiguration(); this.iReliableIndicationsDisabled = !this.iSessionProperties.isReliableIndicationEnabled(); + + // Initialize reliable indication support + if (!this.iReliableIndicationsDisabled) { + this.iHashtableCapacity = this.iSessionProperties + .getReliableIndicationHashtableCapacity(); + + // Validate ReliableIndicationHashtableCapacity property + if (this.iHashtableCapacity < 0 || this.iHashtableCapacity > 25000) { + this.iLogger.trace(Level.FINE, "ReliableIndicationHashtableCapacity of " + + this.iHashtableCapacity + " outside range, using default value"); + + this.iHashtableCapacity = Integer.valueOf( + WBEMConfigurationDefaults.LISTENER_RELIABLE_INDICATION_HASHTABLE_CAPACITY) + .intValue(); + } + + if (this.iHashtableCapacity == 0) { + this.iServerList = new LinkedList<ServerListEntry>(); + } else { + this.iServerTable = new Hashtable<ServerTableEntry, IndicationServer>( + this.iHashtableCapacity); + } + } } @Override @@ -292,20 +382,50 @@ * Destination URL of indication. * @return <code>IndicationServer</code> with given address. */ - private IndicationServer getIndicationServer(InetAddress pInetAddress, String pDestinationUrl) { - IndicationServer server; - Iterator<IndicationServer> iterator = this.iServerList.iterator(); + private IndicationServer getIndicationServerFromList(InetAddress pInetAddress, + String pDestinationUrl) { + ServerListEntry entry; + Iterator<ServerListEntry> iterator = this.iServerList.iterator(); while (iterator.hasNext()) { - server = iterator.next(); - if (server.getInetAddress().equals(pInetAddress) - && server.getDestinationUrl().equalsIgnoreCase(pDestinationUrl)) return server; + entry = iterator.next(); + if (entry.getInetAddress().equals(pInetAddress) + && entry.getDestinationUrl().equalsIgnoreCase(pDestinationUrl)) return entry + .getIndicationServer(); } - server = new IndicationServer(pInetAddress, pDestinationUrl); - this.iServerList.add(server); + entry = new ServerListEntry(pInetAddress, pDestinationUrl); + this.iServerList.add(entry); this.iLogger.trace(Level.FINE, "Creating reliable indication handler for server IP " - + server.getInetAddress().toString() + ", destination URL " - + server.getDestinationUrl()); + + entry.getInetAddress().toString() + ", destination URL " + + entry.getDestinationUrl() + " in linked list"); + + return entry.getIndicationServer(); + } + + /** + * Returns the corresponding indication server if the server is already + * present in the hash table, otherwise adds the server to the hash table + * and returns the new entry. + * + * @param pInetAddress + * Address of indication server. + * @param pDestinationUrl + * Destination URL of indication. + * @return <code>IndicationServer</code> with given address. + */ + private IndicationServer getIndicationServerFromTable(InetAddress pInetAddress, + String pDestinationUrl) { + ServerTableEntry key; + IndicationServer server; + key = new ServerTableEntry(pInetAddress, pDestinationUrl); + server = this.iServerTable.get(key); + if (server == null) { + server = new IndicationServer(); + this.iServerTable.put(key, server); + this.iLogger.trace(Level.FINE, "Creating reliable indication handler for server IP " + + key.getInetAddress().toString() + ", destination URL " + + key.getDestinationUrl() + " in hash table"); + } return server; } @@ -325,11 +445,18 @@ */ private synchronized boolean deliverIndication(CIMInstance pIndication, String pId, InetAddress pInetAddress) { + IndicationServer server; + // Each serverIP/destinationURL pair needs its own // ReliableIndicationHandler in order to handle multiple contexts - IndicationServer server = getIndicationServer(pInetAddress, pId); + if (this.iHashtableCapacity == 0) { + server = getIndicationServerFromList(pInetAddress, pId); + } else { + server = getIndicationServerFromTable(pInetAddress, pId); + } - // Nothing to do if reliable indications initialized but not supported, + // Nothing to do if reliable indications initialized but not + // supported, // go ahead and deliver if (server.isInitialized() && !server.isRISupported()) return true; @@ -337,7 +464,8 @@ CIMProperty<?> seqCtxProp = pIndication.getProperty("SequenceContext"); CIMProperty<?> seqNumProp = pIndication.getProperty("SequenceNumber"); - // Initialize (if not yet done so) to check if indication is reliable + // Initialize (if not yet done so) to check if indication is + // reliable if (!server.isInitialized()) { // Initial indication does not contain reliable indication // properties, disable support and go ahead and deliver @@ -374,7 +502,6 @@ attempts = Long.valueOf(WBEMConfigurationDefaults.LISTENER_DELIVERY_RETRY_ATTEMPTS) .longValue(); - } // Validate DeliveryRetryInterval property @@ -413,7 +540,8 @@ } // Reliable indication support is enabled but indication does not - // contain both properties with non-null values, go ahead and deliver + // contain both properties with non-null values, go ahead and + // deliver if (seqCtxProp.getValue() == null || seqNumProp.getValue() == null) { this.iLogger.trace(Level.FINE, "Reliable indication support enabled but sequence property has null value:\n" |
From: Dave B. <bla...@us...> - 2011-12-13 16:10:03
|
Update of /cvsroot/sblim/jsr48-client In directory vz-cvs-3.sog:/tmp/cvs-serv5135 Modified Files: NEWS Log Message: 3444912 - Client delay during SSL handshake Index: NEWS =================================================================== RCS file: /cvsroot/sblim/jsr48-client/NEWS,v retrieving revision 1.243 retrieving revision 1.244 diff -u -d -r1.243 -r1.244 --- NEWS 7 Nov 2011 12:05:52 -0000 1.243 +++ NEWS 13 Dec 2011 16:10:00 -0000 1.244 @@ -1,5 +1,6 @@ Changes in HEAD ================ +3444912 Client delay during SSL handshake 3423064 Add UpdateExpiredPassword Header for Reqs from Java Client 3411944 createJavaObject exception with hex uint 3411879 TCK: CIM element value must match type |
From: Michael Chase-S. <mc...@us...> - 2011-12-11 19:13:11
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via 2fce38d848005a9ffe19c11be6784abac4b5f8a2 (commit) from c34efeec5b12fc2597f34dcbef08176d695e2449 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2fce38d848005a9ffe19c11be6784abac4b5f8a2 Author: Michael Chase-Salerno <br...@li...> Date: Sun Dec 11 14:12:22 2011 -0500 [ 3433733 ] CreationClassNames should be supplied test case issues ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 0b4adcc..6edf663 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-12-11 Michael Chase-Salerno <br...@li...> + + * test/xmltest/SAE* + [ 3433733 ] CreationClassNames should be supplied + test case issues + 2011-11-30 Narasimha Sharoff <nsh...@us...> * cimRequest.c, cimXmlGen.c, cimXmlGen.h, cimXmlOps.y diff --git a/test/xmltest/SAE_02_CI_LD.xml b/test/xmltest/SAE_02_CI_LD.xml index bb545bc..8cc4086 100644 --- a/test/xmltest/SAE_02_CI_LD.xml +++ b/test/xmltest/SAE_02_CI_LD.xml @@ -9,15 +9,9 @@ </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="NewInstance"> <INSTANCE CLASSNAME="CIM_ListenerDestinationCIMXML"> - <PROPERTY NAME="SystemCreationClassName" TYPE="string"> - <VALUE>CIM_ComputerSystem</VALUE> - </PROPERTY> <PROPERTY NAME="SystemName" TYPE="string"> <VALUE>localhost</VALUE> </PROPERTY> - <PROPERTY NAME="CreationClassName" TYPE="string"> - <VALUE>CIM_ListenerDestination</VALUE> - </PROPERTY> <PROPERTY NAME="Destination" TYPE="string"> <VALUE>CIM_ListenerDestination</VALUE> </PROPERTY> diff --git a/test/xmltest/SAE_04_DI_LD.xml b/test/xmltest/SAE_04_DI_LD.xml index 3475319..3d52a54 100644 --- a/test/xmltest/SAE_04_DI_LD.xml +++ b/test/xmltest/SAE_04_DI_LD.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <CIM CIMVERSION="2.0" DTDVERSION="2.0"> <MESSAGE ID="4711" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="DeleteInstance"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="interop"></NAMESPACE></LOCALNAMESPACEPATH> -<IPARAMVALUE NAME="InstanceName"><INSTANCENAME CLASSNAME="CIM_ListenerDestinationCIMXML"><KEYBINDING NAME="creationclassname"><KEYVALUE VALUETYPE="string">CIM_ListenerDestination</KEYVALUE></KEYBINDING><KEYBINDING NAME="name"><KEYVALUE VALUETYPE="string">TestSuite_SAE_LD</KEYVALUE></KEYBINDING><KEYBINDING NAME="systemcreationclassname"><KEYVALUE VALUETYPE="string">CIM_ComputerSystem</KEYVALUE></KEYBINDING><KEYBINDING NAME="systemname"><KEYVALUE VALUETYPE="string">localhost</KEYVALUE></KEYBINDING></INSTANCENAME></IPARAMVALUE> +<IPARAMVALUE NAME="InstanceName"><INSTANCENAME CLASSNAME="CIM_ListenerDestinationCIMXML"><KEYBINDING NAME="creationclassname"><KEYVALUE VALUETYPE="string">CIM_ListenerDestinationCIMXML</KEYVALUE></KEYBINDING><KEYBINDING NAME="name"><KEYVALUE VALUETYPE="string">TestSuite_SAE_LD</KEYVALUE></KEYBINDING><KEYBINDING NAME="systemcreationclassname"><KEYVALUE VALUETYPE="string">CIM_ComputerSystem</KEYVALUE></KEYBINDING><KEYBINDING NAME="systemname"><KEYVALUE VALUETYPE="string">localhost</KEYVALUE></KEYBINDING></INSTANCENAME></IPARAMVALUE> </IMETHODCALL></SIMPLEREQ> </MESSAGE></CIM> hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Michael Chase-S. <mc...@us...> - 2011-12-11 19:09:01
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv11705 Modified Files: ChangeLog Log Message: [ 3433733 ] CreationClassNames should be supplied test case issues Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcb/ChangeLog,v retrieving revision 1.702 retrieving revision 1.703 diff -u -d -r1.702 -r1.703 --- ChangeLog 30 Nov 2011 23:31:25 -0000 1.702 +++ ChangeLog 11 Dec 2011 19:08:58 -0000 1.703 @@ -1,7 +1,13 @@ +2011-12-11 Michael Chase-Salerno <br...@li...> + + * test/xmltest/SAE* + [ 3433733 ] CreationClassNames should be supplied + test case issues + 2011-11-30 Narasimha Sharoff <nsh...@us...> * cimXmlGen.c, cimXmlGen.h, cimXmlRequest.c, Makefile.am, - sqlStatement.c Added file - utilTypeCk.c + sqlStatement.c Added file - utilTypeCk.c [ 3446179 ] Add a feature to validate CMPI types 2011-11-23 Michael Chase-Salerno <br...@li...> |
From: Narasimha S. <nsh...@us...> - 2011-11-30 23:31:28
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv11795 Modified Files: ChangeLog Log Message: [3446179] Add a feature to validate CMPI types Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcb/ChangeLog,v retrieving revision 1.701 retrieving revision 1.702 diff -u -d -r1.701 -r1.702 --- ChangeLog 23 Nov 2011 18:22:16 -0000 1.701 +++ ChangeLog 30 Nov 2011 23:31:25 -0000 1.702 @@ -1,3 +1,9 @@ +2011-11-30 Narasimha Sharoff <nsh...@us...> + + * cimXmlGen.c, cimXmlGen.h, cimXmlRequest.c, Makefile.am, + sqlStatement.c Added file - utilTypeCk.c + [ 3446179 ] Add a feature to validate CMPI types + 2011-11-23 Michael Chase-Salerno <br...@li...> * interopProvider.c, indCIMXMLHandler.c, instance.c, instance.h: |
From: Narasimha S. <nsh...@us...> - 2011-11-30 23:29:09
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv11459 Modified Files: NEWS Log Message: nsharoff@nsharoff:~/1.3.12/sfcb$ patch -p1 < ../3446179-v1.3.14.patch patching file cimXmlGen.c patching file cimXmlGen.h patching file cimXmlRequest.c patching file Makefile.am patching file sqlStatement.c patching file utilTypeCk.c nsharoff@nsharoff:~/1.3.12/sfcb$ cvs -z3 -d:ext:nsh...@sb.../cvsroot/sfcb ci cimXmlGen.c nsh...@sb...'s password: Cannot access /cvsroot/sfcb/CVSROOT No such file or directory nsharoff@nsharoff:~/1.3.12/sfcb$ cvs -z3 -d:ext:nsh...@sb.../cvsroot/sblim ci cimXmlGen.c nsh...@sb...'s password: **** Access allowed: Personal Karma exceeds Environmental Karma. Checking in cimXmlGen.c; /cvsroot/sblim/sfcb/cimXmlGen.c,v <-- cimXmlGen.c new revision: 1.76; previous revision: 1.75 done Mailing sbl...@li...... Generating notification message... Generating notification message... done. nsharoff@nsharoff:~/1.3.12/sfcb$ cvs -z3 -d:ext:nsh...@sb.../cvsroot/sblim ci cimXmlGen.h nsh...@sb...'s password: **** Access allowed: Personal Karma exceeds Environmental Karma. Checking in cimXmlGen.h; /cvsroot/sblim/sfcb/cimXmlGen.h,v <-- cimXmlGen.h new revision: 1.10; previous revision: 1.9 done Mailing sbl...@li...... Generating notification message... Generating notification message... done. nsharoff@nsharoff:~/1.3.12/sfcb$ cvs -z3 -d:ext:nsh...@sb.../cvsroot/sblim ci cimXmlRequest.c nsh...@sb...'s password: **** Access allowed: Personal Karma exceeds Environmental Karma. Checking in cimXmlRequest.c; /cvsroot/sblim/sfcb/cimXmlRequest.c,v <-- cimXmlRequest.c new revision: 1.65; previous revision: 1.64 done Mailing sbl...@li...... Generating notification message... Generating notification message... done. nsharoff@nsharoff:~/1.3.12/sfcb$ cvs -z3 -d:ext:nsh...@sb.../cvsroot/sblim ci Makefile.am nsh...@sb...'s password: **** Access allowed: Personal Karma exceeds Environmental Karma. Checking in Makefile.am; /cvsroot/sblim/sfcb/Makefile.am,v <-- Makefile.am new revision: 1.114; previous revision: 1.113 done Mailing sbl...@li...... Generating notification message... Generating notification message... done. nsharoff@nsharoff:~/1.3.12/sfcb$ cvs -z3 -d:ext:nsh...@sb.../cvsroot/sblim ci sqlStatement. sqlStatement.c sqlStatement.h nsharoff@nsharoff:~/1.3.12/sfcb$ cvs -z3 -d:ext:nsh...@sb.../cvsroot/sblim ci sqlStatement.c [3446179] Add a feature to validate CMPI types Index: NEWS =================================================================== RCS file: /cvsroot/sblim/sfcb/NEWS,v retrieving revision 1.625 retrieving revision 1.626 diff -u -d -r1.625 -r1.626 --- NEWS 23 Nov 2011 18:22:16 -0000 1.625 +++ NEWS 30 Nov 2011 23:29:07 -0000 1.626 @@ -7,6 +7,7 @@ - 3367332 RHOST Support for PAM - 3435778 Preserve leading/trailing whitespace in values - 3433733 CreationClassNames should be supplied +- 3446179 Add a feature to validate CMPI types Bugs fixed: |
From: Narasimha S. <nsh...@us...> - 2011-11-30 23:26:41
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv11283 Added Files: utilTypeCk.c Log Message: Initial Version --- NEW FILE: utilTypeCk.c --- /* * utilTypeCk.c * * (C) Copyright IBM Corp. 2011 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE 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 Eclipse Public License from * http://www.opensource.org/licenses/eclipse-1.0.php * * Author: Narasimha Sharoff <nsh...@us...> * * Description: * * CIM type validation routines : return 1 on failure * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <errno.h> #include "cmpi/cmpidt.h" /* checks for unsigned integers uint8 - uint64 */ int invalid_uint(const char *v, const CMPIType type) { unsigned long long int a = 0L; int base = 0; /* allows decimal, octal, and hex values */ char *endptr = NULL; int rc = 0; if (strlen(v) == 0) return 1; errno = 0; a = strtoull(v, &endptr, base); if ((errno == ERANGE && (a == ULONG_MAX)) || (errno != 0 && a == 0)) return 1; if (endptr[0] != '\0') return 1; switch (type) { case CMPI_uint8: if ( a > UCHAR_MAX ) rc = 1; break; case CMPI_uint16: if ( a > USHRT_MAX ) rc = 1; break; case CMPI_uint32: if ( a > UINT_MAX ) rc = 1; break; case CMPI_uint64: if ( a > ULONG_MAX ) rc = 1; break; default: rc = 1; break; } return rc; } /* checks for integers int8 - int64 */ int invalid_int(const char *v, const CMPIType type) { long long int a = 0L; int base = 0; char *endptr = NULL; int rc = 0; if (strlen(v) == 0) return 1; errno = 0; a = strtoll(v, &endptr, base); if (endptr[0] != '\0') return 1; if ((errno == ERANGE && (a == LONG_MAX || a == LONG_MIN)) || (errno != 0 && a == 0)) return 1; switch (type) { case CMPI_sint8: if ( a > SCHAR_MAX || a < SCHAR_MIN ) rc = 1; break; case CMPI_sint16: if ( a > SHRT_MAX || a < SHRT_MIN ) rc = 1; break; case CMPI_sint32: if ( a > INT_MAX || a < INT_MIN ) rc = 1; break; case CMPI_sint64: if ( a > LONG_MAX || a < LONG_MIN ) rc = 1; break; default: rc = 1; break; } return rc; } /* checks for real32 and real64 */ int invalid_real(const char *v, const CMPIType type) { float a = 0; double d = 0; char *endptr = NULL; int rc = 0; if (strlen(v) == 0) return 1; errno = 0; switch (type) { case CMPI_real32: a = strtof(v, &endptr); if (endptr[0] != '\0') return 1; if ((a == 0) && (v == endptr)) return 1; if ((errno == ERANGE /*&& (a == HUGE_VALF || a == -HUGE_VALF)*/) || (errno != 0 && a == 0)) return 1; break; case CMPI_real64: d = strtod(v, &endptr); if (endptr[0] != '\0') return 1; if ((d == 0) && (v == endptr)) return 1; if ((errno == ERANGE /*&& (a == HUGE_VAL || a == -HUGE_VAL)*/) || (errno != 0 && d == 0)) {printf("Nsn\n");return 1;} break; default: rc = 1; break; } return rc; } /* case insensitive check for boolean "true" or "false" */ int invalid_boolean(const char *v, const CMPIType type) { if ((strcasecmp(v, "false") == 0) || (strcasecmp(v, "true") == 0)) return 0; return 1; } /* MODELINES */ /* DO NOT EDIT BELOW THIS COMMENT */ /* Modelines are added by 'make pretty' */ /* -*- Mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ /* vi:set ts=2 sts=2 sw=2 expandtab: */ |
From: Narasimha S. <nsh...@us...> - 2011-11-30 23:24:20
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv9932 Modified Files: sqlStatement.c Log Message: [3446179] Add a feature to validate CMPI types Index: sqlStatement.c =================================================================== RCS file: /cvsroot/sblim/sfcb/sqlStatement.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- sqlStatement.c 13 Apr 2010 22:56:07 -0000 1.7 +++ sqlStatement.c 30 Nov 2011 23:24:18 -0000 1.8 @@ -57,7 +57,7 @@ extern CMPIConstClass *getConstClass(const char *ns, const char *cn); extern CMPIConstClass initConstClass(ClClass *cl); extern MsgSegment setConstClassMsgSegment(CMPIConstClass * cl); -extern CMPIValue str2CMPIValue(CMPIType type, const char *val, XtokValueReference *ref); +extern CMPIValue str2CMPIValue(CMPIType type, const char *val, XtokValueReference *ref, CMPIStatus *status); extern MsgSegment setInstanceMsgSegment(CMPIInstance * ci); extern CMPIStatus arraySetElementNotTrackedAt(CMPIArray * array, CMPICount index, CMPIValue * val, CMPIType type); extern void closeProviderContext(BinRequestContext * ctx); @@ -2528,6 +2528,7 @@ int createInstance(const char * ns, const char * cn, UtilList * ins) { RequestHdr * hdr = NULL; + CMPIStatus rc = {CMPI_RC_OK, NULL}; XtokCreateInstance reqq; reqq.op.count = 2; @@ -2565,7 +2566,7 @@ for(el = (ExpressionLight*)ins->ft->getFirst(ins);el;el = (ExpressionLight*)ins->ft->getNext(ins)){ //printf(" %s %s \n", el->value,el->name); - val = str2CMPIValue(el->sqltype==CMPI_string?CMPI_chars:el->sqltype, el->value,NULL);//refernzen bis auf weiteres nicht unterstuetzt + val = str2CMPIValue(el->sqltype==CMPI_string?CMPI_chars:el->sqltype, el->value,NULL, &rc);//refernzen bis auf weiteres nicht unterstuetzt CMSetProperty(inst, el->name, &val, el->sqltype==CMPI_string?CMPI_chars:el->sqltype); } @@ -2630,6 +2631,7 @@ CreateClassReq sreq = BINREQ(OPS_CreateClass, 3); CMPIData d; + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(&binCtx,0,sizeof(BinRequestContext)); @@ -2643,7 +2645,7 @@ // qs=&c->qualifiers; // for (q=qs->first; q; q=q->next) { // d.state=CMPI_goodValue; -// d.value=str2CMPIValue(q->type,q->value,NULL); +// d.value=str2CMPIValue(q->type,q->value,NULL, &rc); // d.type=q->type; // ClClassAddQualifier(&cl->hdr, &cl->qualifiers, q->name, d); // } @@ -2656,7 +2658,7 @@ ClProperty *prop; int propId; d.state=CMPI_goodValue; - //d.value=//str2CMPIValue(col->colSQLType,NULL,NULL); + //d.value=//str2CMPIValue(col->colSQLType,NULL,NULL, &rc); d.type=col->colSQLType; propId = ClClassAddProperty(cl, col->colName, d, NULL); // (cl, p->name, // qs=&p->val.qualifiers; @@ -2667,7 +2669,7 @@ if(col->isKey==KEY){//bug im sfcb: d.value wird ignoriert und immer true reingeschrieben d.state=CMPI_goodValue; //printf("::: %d %s\n",col->isKey,col->isKey==KEY?"true":"false"); - d.value=str2CMPIValue(CMPI_boolean,col->isKey==KEY?"true":"false",NULL); + d.value=str2CMPIValue(CMPI_boolean,col->isKey==KEY?"true":"false",NULL, &rc); d.type=CMPI_boolean; ClClassAddPropertyQualifier(&cl->hdr, prop, "Key", d); } @@ -2836,6 +2838,7 @@ int deleteInstance(const char * ns, const char * cn, UtilList *al) { RequestHdr * hdr = NULL; + CMPIStatus rc = {CMPI_RC_OK, NULL}; XtokDeleteInstance reqq; reqq.op.count = 2; @@ -2870,7 +2873,7 @@ //valp = getKeyValueTypePtr(type2cmpiString(el->sqltype),el->value,NULL,&val,&type); //type ist char* !!!!! //hier muss ich den valp selber bauen. denn diese getKey... //arbeitet nur mit strings sauber siehe - //val = str2CMPIValue(el->value,el->sqltype,NULL); + //val = str2CMPIValue(el->value,el->sqltype,NULL, &rc); //printf("%s %s %d\n",el->name,el->value,el->sqltype); CMAddKey(path, el->name, string2cmpival(el->value,el->sqltype),el->sqltype); //printf("%s \n",el->value); @@ -2927,6 +2930,7 @@ CMPIObjectPath *path; CMPIInstance *inst; + CMPIStatus rc = {CMPI_RC_OK, NULL}; int irc, i, sreqSize=sizeof(ModifyInstanceReq)-sizeof(MsgSegment); @@ -2954,7 +2958,7 @@ for (el = (ExpressionLight*)kl->ft->getFirst(kl);el;el=(ExpressionLight*)kl->ft->getNext(kl)) { //printf("a\n"); //printf("key: %s %s %d\n",el->name,el->value,el->sqltype); - //val = str2CMPIValue(el->value,el->sqltype,NULL); + //val = str2CMPIValue(el->value,el->sqltype,NULL, &rc); //printf("b\n"); CMAddKey(path, el->name, string2cmpival(el->value,el->sqltype),el->sqltype); } |
From: Narasimha S. <nsh...@us...> - 2011-11-30 23:23:46
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv9853 Modified Files: Makefile.am Log Message: [3446179] Add a feature to validate CMPI types Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- Makefile.am 21 Sep 2011 14:50:20 -0000 1.113 +++ Makefile.am 30 Nov 2011 23:23:44 -0000 1.114 @@ -235,6 +235,7 @@ cimXmlGen.c \ mrwlock.c \ mlog.c \ + utilTypeCk.c \ $(JDBC_FILES) \ $(QUALREP_FILES) |
From: Narasimha S. <nsh...@us...> - 2011-11-30 23:23:19
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv9791 Modified Files: cimXmlRequest.c Log Message: [3446179] Add a feature to validate CMPI types Index: cimXmlRequest.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlRequest.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- cimXmlRequest.c 27 Sep 2011 15:06:48 -0000 1.64 +++ cimXmlRequest.c 30 Nov 2011 23:23:17 -0000 1.65 @@ -370,6 +370,29 @@ #endif /* ALLOW_UPDATE_EXPIRED_PW */ +/* bugzilla 75543 - feature: report type validation errors for str2CMPIValue */ +static RespSegments valErrResponse(RequestHdr * hdr, + BinRequestContext * ctx, int meth) +{ + char msg[256]; + CMPIrc err; + switch (ctx->rc) { + case CMPI_RC_ERR_INVALID_PARAMETER: + hdr->errMsg = strdup("Invalid parameter provided"); + err = CMPI_RC_ERR_INVALID_PARAMETER; + break; + default: + sprintf(msg, "Internal error - %d\n", ctx->rc); + hdr->errMsg = strdup(msg); + err = CMPI_RC_ERR_FAILED; + } + if (meth) return + methodErrResponse(hdr,getErrSegment(err,hdr->errMsg)); + return + iMethodErrResponse(hdr,getErrSegment(err,hdr->errMsg)); +} + + static RespSegments ctxErrResponse(RequestHdr * hdr, BinRequestContext * ctx, int meth) { @@ -796,6 +819,7 @@ XtokClass *c; CMPIData d; CMPIParameter pa; + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(&binCtx,0,sizeof(BinRequestContext)); XtokCreateClass *req = (XtokCreateClass *) hdr->cimRequest; @@ -813,7 +837,7 @@ d.value.uint64=0; } else { d.state=CMPI_goodValue; - d.value=str2CMPIValue(q->type,q->value,NULL,NULL); + d.value=str2CMPIValue(q->type,q->value,NULL,NULL, &rc); } d.type=q->type; ClClassAddQualifier(&cl->hdr, &cl->qualifiers, q->name, d); @@ -828,7 +852,7 @@ d.value.uint64=0; } else { d.state=CMPI_goodValue; - d.value=str2CMPIValue(p->valueType,p->val.val,&p->val.ref,req->op.nameSpace.data); + d.value=str2CMPIValue(p->valueType,p->val.val,&p->val.ref,req->op.nameSpace.data, &rc); } d.type=p->valueType; propId=ClClassAddProperty(cl, p->name, d, p->referenceClass); @@ -841,7 +865,7 @@ d.value.uint64=0; } else { d.state=CMPI_goodValue; - d.value=str2CMPIValue(q->type,q->value,NULL,NULL); + d.value=str2CMPIValue(q->type,q->value,NULL,NULL, &rc); } d.type=q->type; ClClassAddPropertyQualifier(&cl->hdr, prop, q->name, d); @@ -864,7 +888,7 @@ d.value.uint64=0; } else { d.state=CMPI_goodValue; - d.value=str2CMPIValue(q->type,q->value,NULL,NULL); + d.value=str2CMPIValue(q->type,q->value,NULL,NULL, &rc); } d.type=q->type; ClClassAddMethodQualifier(&cl->hdr, meth, q->name, d); @@ -885,7 +909,7 @@ d.value.uint64=0; } else { d.state=CMPI_goodValue; - d.value=str2CMPIValue(q->type,q->value,NULL,NULL); + d.value=str2CMPIValue(q->type,q->value,NULL,NULL, &rc); } d.type=q->type; ClClassAddMethParamQualifier(&cl->hdr, parm, q->name, d); @@ -1218,6 +1242,7 @@ BinResponseHdr *resp; CreateInstanceReq sreq = BINREQ(OPS_CreateInstance, 3); XtokProperty *p = NULL; + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(&binCtx,0,sizeof(BinRequestContext)); XtokCreateInstance *req = (XtokCreateInstance *) hdr->cimRequest; @@ -1228,7 +1253,7 @@ for (p = req->instance.properties.first; p; p = p->next) { if (p->val.val.value){ - val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref,req->op.nameSpace.data); + val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref,req->op.nameSpace.data, &rc); CMSetProperty(inst, p->name, &val, p->valueType); } } @@ -1294,6 +1319,7 @@ XtokInstance *xci; XtokInstanceName *xco; XtokProperty *p = NULL; + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(&binCtx,0,sizeof(BinRequestContext)); XtokModifyInstance *req = (XtokModifyInstance *) hdr->cimRequest; @@ -1323,7 +1349,11 @@ inst = TrackedCMPIInstance(path, NULL); for (p = xci->properties.first; p; p = p->next) { if (p->val.val.value) { - val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref,req->op.nameSpace.data); + val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref,req->op.nameSpace.data, &rc); + if (rc.rc != CMPI_RC_OK) { /* bugzilla 75543 */ + binCtx.rc = rc.rc; + _SFCB_RETURN(valErrResponse(hdr, &binCtx, 0)); + } CMSetProperty(inst, p->name, &val, p->valueType); } } @@ -2076,6 +2106,7 @@ InvokeMethodReq sreq = BINREQ(OPS_InvokeMethod, 5); CMPIArgs *in=TrackedCMPIArgs(NULL); XtokParamValue *p; + CMPIStatus st = {CMPI_RC_OK, NULL}; memset(&binCtx,0,sizeof(BinRequestContext)); XtokMethodCall *req = (XtokMethodCall *) hdr->cimRequest; @@ -2108,7 +2139,7 @@ } if (p->value.value) { - CMPIValue val = str2CMPIValue(p->type, p->value, &p->valueRef, req->op.nameSpace.data); + CMPIValue val = str2CMPIValue(p->type, p->value, &p->valueRef, req->op.nameSpace.data, &st); CMAddArg(in, p->name, &val, p->type); } } @@ -2262,6 +2293,7 @@ BinRequestContext binCtx; BinResponseHdr *resp; SetPropertyReq sreq = BINREQ(OPS_SetProperty, 3); + CMPIStatus st = {CMPI_RC_OK, NULL}; memset(&binCtx,0,sizeof(BinRequestContext)); XtokSetProperty *req = (XtokSetProperty *) hdr->cimRequest; @@ -2288,7 +2320,7 @@ t = req->newVal.type; } if (t != CMPI_null) { - val = str2CMPIValue(t, req->newVal.val, &req->newVal.ref, req->op.nameSpace.data); + val = str2CMPIValue(t, req->newVal.val, &req->newVal.ref, req->op.nameSpace.data, &st); CMSetProperty(inst, req->propertyName, &val, t); } else { @@ -2516,6 +2548,7 @@ BinRequestContext binCtx; BinResponseHdr *resp; SetQualifierReq sreq = BINREQ(OPS_SetQualifier, 3); + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(&binCtx,0,sizeof(BinRequestContext)); XtokSetQualifier *req = (XtokSetQualifier *) hdr->cimRequest; @@ -2552,7 +2585,7 @@ "ISARRAY attribute and default value conflict"))); d.value=str2CMPIValue(d.type, req->qualifierdeclaration.data.value, - (XtokValueReference *)&req->qualifierdeclaration.data.valueArray, NULL); + (XtokValueReference *)&req->qualifierdeclaration.data.valueArray, NULL, &rc); ClQualifierAddQualifier(&q->hdr, &q->qualifierData, req->qualifierdeclaration.name, d); } else { //no default value - rely on ISARRAY attr, check if it's set /*if(!req->qualifierdeclaration.isarrayIsSet) |
From: Narasimha S. <nsh...@us...> - 2011-11-30 23:22:50
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv9738 Modified Files: cimXmlGen.h Log Message: [3446179] Add a feature to validate CMPI types Index: cimXmlGen.h =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlGen.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- cimXmlGen.h 21 Dec 2007 16:04:48 -0000 1.9 +++ cimXmlGen.h 30 Nov 2011 23:22:48 -0000 1.10 @@ -38,7 +38,7 @@ extern CMPIValue *getKeyValueTypePtr(char *type, char *value, XtokValueReference *ref, CMPIValue * val, CMPIType * typ, char *scopingNS); -extern CMPIValue str2CMPIValue(CMPIType type, XtokValue val, XtokValueReference *ref, char *ns); +extern CMPIValue str2CMPIValue(CMPIType type, XtokValue val, XtokValueReference *ref, char *ns, CMPIStatus *status); extern int value2xml(CMPIData d, UtilStringBuffer * sb, int wv); extern int instanceName2xml(CMPIObjectPath * cop, UtilStringBuffer * sb); extern int cls2xml(CMPIConstClass * cls, UtilStringBuffer * sb, unsigned int flags); |
From: Narasimha S. <nsh...@us...> - 2011-11-30 23:22:32
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv9638 Modified Files: cimXmlGen.c Log Message: [3446179] Add a feature to validate CMPI types Index: cimXmlGen.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlGen.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- cimXmlGen.c 8 Nov 2011 04:59:13 -0000 1.75 +++ cimXmlGen.c 30 Nov 2011 23:22:29 -0000 1.76 @@ -314,6 +314,7 @@ CMPIValue val; memset(&val, 0, sizeof(CMPIValue)); CMPIObjectPath *path; + CMPIStatus rc = {CMPI_RC_OK, NULL}; if(value.type == typeValue_Instance) { CMPIInstance *inst; @@ -323,7 +324,7 @@ for (p = xtokInstance->properties.first; p; p = p->next) { if (p->val.val.value) { - val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref, NULL); + val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref, NULL, &rc); CMSetProperty(inst, p->name, &val, p->valueType); } } @@ -334,10 +335,12 @@ return val; } -CMPIValue str2CMPIValue(CMPIType type, XtokValue val, XtokValueReference *ref, char* ns) +/* bugzilla 75543 - feature: report type check errors via CMPIStatus */ +CMPIValue str2CMPIValue(CMPIType type, XtokValue val, XtokValueReference *ref, char* ns, CMPIStatus *status) { CMPIValue value; CMPIType t = 0; + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(&value, 0, sizeof(CMPIValue)); if (type==0) { @@ -365,7 +368,7 @@ value.array = TrackedCMPIArray(max,t,NULL); if (value.array != NULL) { for (i=0; i<max; i++) { - v = str2CMPIValue(t, arr->values[i], refarr->values+i,ns); + v = str2CMPIValue(t, arr->values[i], refarr->values+i,ns, &rc); CMSetArrayElementAt(value.array, i, &v, t); } return value; @@ -383,22 +386,30 @@ sscanf(val.value, "%lld", &value.sint64); break; case CMPI_uint64: - sscanf(val.value, "%llu", &value.uint64); + if (invalid_uint(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%llu", &value.uint64); break; case CMPI_sint32: sscanf(val.value, "%d", &value.sint32); break; case CMPI_uint32: - sscanf(val.value, "%u", &value.uint32); + if (invalid_uint(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%u", &value.uint32); break; case CMPI_sint16: sscanf(val.value, "%hd", &value.sint16); break; case CMPI_uint16: - sscanf(val.value, "%hu", &value.uint16); + if (invalid_uint(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%hu", &value.uint16); break; case CMPI_uint8: - sscanf(val.value, "%u", &value.uint32); + if (invalid_uint(val.value,type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%u", &value.uint32); value.uint8 = value.uint32; break; case CMPI_sint8: |
From: Narasimha S. <nsh...@us...> - 2011-11-30 19:15:57
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "sfcCommon - Common lib for SFCB/SFCC". The branch, master has been updated via ca919e97754be5d4317063b770b13b0525bba505 (commit) from 2ba2ee958defada760a90932a52f6284ee883cb5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ca919e97754be5d4317063b770b13b0525bba505 Author: Narasimha Sharoff <nsh...@us...> Date: Wed Nov 30 11:15:02 2011 -0800 [3446179] Add a feature to validate CMPI types ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index a110cca..0512902 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-11-30 Narasimha Sharoff <nsh...@us...> + + * Makefile.am, sfcUtil/utilTypeCk.c, + sfcUtil/libsfcUtil.Versions - added utilTypeCk.c + [3556179] Add a feature to validate CMPI types + 2011-05-09 Chris Buccella <buc...@li...> * Makefile.am, configure.ac, sfcUtil/utilFactory.c, diff --git a/NEWS b/NEWS index e3eba20..afbb5a9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +Changes in 1.0.1 +================ +New Features: +- 3446179 Add a feature to validate CMPI types + +Bugs fixed: + + Changes in 1.0.0 ================ hooks/post-receive -- sfcCommon - Common lib for SFCB/SFCC |
From: Narasimha S. <nsh...@us...> - 2011-11-30 19:08:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via c34efeec5b12fc2597f34dcbef08176d695e2449 (commit) from 908a8bf2bc81264c3d3950d00dbf2499db09bc7e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c34efeec5b12fc2597f34dcbef08176d695e2449 Author: Narasimha Sharoff <nsh...@us...> Date: Wed Nov 30 11:07:24 2011 -0800 [3446179] Add a feature to validate CMPI types ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index a1cdf03..0b4adcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-11-30 Narasimha Sharoff <nsh...@us...> + + * cimRequest.c, cimXmlGen.c, cimXmlGen.h, cimXmlOps.y + [ 3446179 ] Add a feature to validate CMPI types + 2011-11-23 Michael Chase-Salerno <br...@li...> * interopProvider.c, indCIMXMLHandler.c, instance.c, instance.h: diff --git a/NEWS b/NEWS index ccede82..71ca29a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ Changes in 1.4.3 Everything in 1.3.13 and 1.3.14, plus: +New features: +- 3441679 Add a feature to validate CMPI types Changes in 1.4.2 hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Narasimha S. <nsh...@us...> - 2011-11-30 18:54:28
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via 908a8bf2bc81264c3d3950d00dbf2499db09bc7e (commit) from d78ab371e7715e1520e226e28ad08891eb1ed414 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 908a8bf2bc81264c3d3950d00dbf2499db09bc7e Author: Narasimha Sharoff <nsh...@us...> Date: Wed Nov 30 10:52:33 2011 -0800 [3446179] Add a feature to validate CMPI types ----------------------------------------------------------------------- Summary of changes: diff --git a/cimRequest.c b/cimRequest.c index a1b7c7a..fddc810 100644 --- a/cimRequest.c +++ b/cimRequest.c @@ -348,6 +348,26 @@ DESCRIPTION=\"User Account Expired\">\n\ #endif /* ALLOW_UPDATE_EXPIRED_PW */ +/* feature-75543 : report type validation errors for str2CMPIValue */ +static RespSegments valErrResponse(RequestHdr * hdr, + BinRequestContext * ctx, int meth) +{ + char msg[256]; + CMPIrc err; + switch (ctx->rc) { + case CMPI_RC_ERR_INVALID_PARAMETER: + hdr->errMsg = strdup("Invalid parameter provided"); + err = CMPI_RC_ERR_INVALID_PARAMETER; + break; + default: + sprintf(msg, "Internal error - %d\n", ctx->rc); + hdr->errMsg = strdup(msg); + err = CMPI_RC_ERR_FAILED; + } + if (meth) return(methodErrResponse(hdr,getErrSegment(err,hdr->errMsg))); + else return(iMethodErrResponse(hdr,getErrSegment(err,hdr->errMsg))); +} + static RespSegments ctxErrResponse(RequestHdr * hdr, BinRequestContext * ctx, int meth) { @@ -983,9 +1003,17 @@ modifyInstance(CimRequestContext * ctx, RequestHdr * hdr) _SFCB_ENTER(TRACE_CIMXMLPROC, "modifyInstance"); int irc; BinResponseHdr *resp; + BinRequestContext *binCtx = hdr->binCtx; + + /* If CMPIType for a value is incorrect, return error #75543 */ + if (binCtx->rc != CMPI_RC_OK) { + _SFCB_TRACE(1, ("--- binCtx->rc returned: %d",hdr->binCtx->rc)); + if (hdr->binCtx->bHdr) free(hdr->binCtx->bHdr); + _SFCB_RETURN(valErrResponse(hdr, hdr->binCtx, 0)); + } + _SFCB_TRACE(1, ("--- Getting Provider context")); irc = getProviderContext(hdr->binCtx); - _SFCB_TRACE(1, ("--- Provider context gotten")); if (irc == MSG_X_PROVIDER) { RespSegments rs; diff --git a/cimXmlGen.c b/cimXmlGen.c index 428b368..e8db53f 100644 --- a/cimXmlGen.c +++ b/cimXmlGen.c @@ -324,6 +324,7 @@ makeFromEmbeddedObject(XtokValue value, char *ns) CMPIValue val; memset(&val, 0, sizeof(CMPIValue)); CMPIObjectPath *path; + CMPIStatus rc = {CMPI_RC_OK, NULL}; if (value.type == typeValue_Instance) { CMPIInstance *inst; @@ -333,7 +334,7 @@ makeFromEmbeddedObject(XtokValue value, char *ns) for (p = xtokInstance->properties.first; p; p = p->next) { if (p->val.val.value) { - val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref, NULL); + val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref, NULL, &rc); CMSetProperty(inst, p->name, &val, p->valueType); } } @@ -346,10 +347,11 @@ makeFromEmbeddedObject(XtokValue value, char *ns) CMPIValue str2CMPIValue(CMPIType type, XtokValue val, XtokValueReference * ref, - char *ns) + char *ns, CMPIStatus *status) { CMPIValue value; CMPIType t = 0; + CMPIStatus rc = {CMPI_RC_OK, NULL}; if (type == 0) { type = guessType(val.value); @@ -383,13 +385,14 @@ str2CMPIValue(CMPIType type, XtokValue val, XtokValueReference * ref, value.array = TrackedCMPIArray(max, t, NULL); if (value.array != NULL) { for (i = 0; i < max; i++) { - v = str2CMPIValue(t, arr->values[i], refarr->values + i, ns); + v = str2CMPIValue(t, arr->values[i], refarr->values + i, ns, &rc); CMSetArrayElementAt(value.array, i, &v, t); } return value; } } + /* Feature 75543 - set and return status->rc on failures */ switch (type) { case CMPI_char16: value.char16 = *val.value; @@ -398,41 +401,69 @@ str2CMPIValue(CMPIType type, XtokValue val, XtokValueReference * ref, value.string = sfcb_native_new_CMPIString(val.value, NULL, 0); break; case CMPI_sint64: - sscanf(val.value, "%lld", &value.sint64); + if (invalid_int(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%lld", &value.sint64); break; case CMPI_uint64: - sscanf(val.value, "%llu", &value.uint64); + if (invalid_uint(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%llu", &value.uint64); break; case CMPI_sint32: - sscanf(val.value, "%d", &value.sint32); + if (invalid_int(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%d", &value.sint32); break; case CMPI_uint32: - sscanf(val.value, "%u", &value.uint32); + if (invalid_uint(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%u", &value.uint32); break; case CMPI_sint16: - sscanf(val.value, "%hd", &value.sint16); + if (invalid_int(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%hd", &value.sint16); break; case CMPI_uint16: - sscanf(val.value, "%hu", &value.uint16); + if (invalid_uint(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%hu", &value.uint16); break; case CMPI_uint8: - sscanf(val.value, "%u", &value.uint32); - value.uint8 = value.uint32; + if (invalid_uint(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else { + sscanf(val.value, "%u", &value.uint32); + value.uint8 = value.uint32; + } break; case CMPI_sint8: - sscanf(val.value, "%d", &value.sint32); - value.sint8 = value.sint32; + if (invalid_int(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else { + sscanf(val.value, "%d", &value.sint32); + value.sint8 = value.sint32; + } break; case CMPI_boolean: - value.boolean = strcasecmp(val.value, "false"); - if (value.boolean) - value.boolean = 1; + if (invalid_boolean(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else { + value.boolean = strcasecmp(val.value, "false"); + if (value.boolean) + value.boolean = 1; + } break; case CMPI_real32: - sscanf(val.value, "%f", &value.real32); + if (invalid_real(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%f", &value.real32); break; case CMPI_real64: - sscanf(val.value, "%lf", &value.real64); + if (invalid_real(val.value, type)) + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + else sscanf(val.value, "%lf", &value.real64); break; case CMPI_dateTime: value.dateTime = diff --git a/cimXmlGen.h b/cimXmlGen.h index 9425393..dfc9edc 100644 --- a/cimXmlGen.h +++ b/cimXmlGen.h @@ -40,7 +40,7 @@ extern CMPIValue *getKeyValueTypePtr(char *type, char *value, CMPIValue * val, CMPIType *typ, char *scopingNS); extern CMPIValue str2CMPIValue(CMPIType type, XtokValue val, - XtokValueReference * ref, char *ns); + XtokValueReference * ref, char *ns, CMPIStatus *status); extern int value2xml(CMPIData d, UtilStringBuffer * sb, int wv); extern int instanceName2xml(CMPIObjectPath * cop, UtilStringBuffer * sb); @@ -63,6 +63,11 @@ extern void data2xml(CMPIData *data, void *obj, CMPIString *name, UtilStringBuffer * qsb, int inst, int param); CMPIType guessType(char *val); +extern int invalid_int(const char *v, const CMPIType type); +extern int invalid_uint(const char *v, const CMPIType type); +extern int invalid_real(const char *v, const CMPIType type); +extern int invalid_boolean(const char *v, const CMPIType type); + #endif /* MODELINES */ /* DO NOT EDIT BELOW THIS COMMENT */ diff --git a/cimXmlOps.y b/cimXmlOps.y index 4d79674..fbc3d31 100644 --- a/cimXmlOps.y +++ b/cimXmlOps.y @@ -35,6 +35,7 @@ #include "cmpidtx.h" #include "cimXmlGen.h" #include "cimXmlParser.h" +#include "cimXmlOps.h" #include "objectImpl.h" #include "constClass.h" #include "native.h" @@ -288,6 +289,7 @@ buildCreateInstanceRequest(void *parm) RequestHdr *hdr = &(((ParserControl *)parm)->reqHdr); BinRequestContext *binCtx = hdr->binCtx; + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(binCtx, 0, sizeof(BinRequestContext)); XtokCreateInstance *req = (XtokCreateInstance *) hdr->cimRequest; @@ -307,7 +309,7 @@ buildCreateInstanceRequest(void *parm) if (p->val.val.value) { val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref, - req->op.nameSpace.data); + req->op.nameSpace.data, &rc); CMSetProperty(inst, p->name, &val, p->valueType); } } @@ -527,6 +529,7 @@ buildCreateClassRequest(void *parm) XtokClass *c; CMPIData d; CMPIParameter pa; + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(binCtx, 0, sizeof(BinRequestContext)); XtokCreateClass *req = (XtokCreateClass *) hdr->cimRequest; @@ -547,7 +550,7 @@ buildCreateClassRequest(void *parm) d.value.uint64 = 0; } else { d.state = CMPI_goodValue; - d.value = str2CMPIValue(q->type, q->value, NULL, NULL); + d.value = str2CMPIValue(q->type, q->value, NULL, NULL, &rc); } d.type = q->type; ClClassAddQualifier(&cl->hdr, &cl->qualifiers, q->name, d); @@ -564,7 +567,7 @@ buildCreateClassRequest(void *parm) d.state = CMPI_goodValue; d.value = str2CMPIValue(p->valueType, p->val.val, &p->val.ref, - req->op.nameSpace.data); + req->op.nameSpace.data, &rc); } d.type = p->valueType; propId = ClClassAddProperty(cl, p->name, d, p->referenceClass); @@ -579,7 +582,7 @@ buildCreateClassRequest(void *parm) d.value.uint64 = 0; } else { d.state = CMPI_goodValue; - d.value = str2CMPIValue(q->type, q->value, NULL, NULL); + d.value = str2CMPIValue(q->type, q->value, NULL, NULL, &rc); } d.type = q->type; ClClassAddPropertyQualifier(&cl->hdr, prop, q->name, d); @@ -605,7 +608,7 @@ buildCreateClassRequest(void *parm) d.value.uint64 = 0; } else { d.state = CMPI_goodValue; - d.value = str2CMPIValue(q->type, q->value, NULL, NULL); + d.value = str2CMPIValue(q->type, q->value, NULL, NULL, &rc); } d.type = q->type; ClClassAddMethodQualifier(&cl->hdr, meth, q->name, d); @@ -628,7 +631,7 @@ buildCreateClassRequest(void *parm) d.value.uint64 = 0; } else { d.state = CMPI_goodValue; - d.value = str2CMPIValue(q->type, q->value, NULL, NULL); + d.value = str2CMPIValue(q->type, q->value, NULL, NULL, &rc); } d.type = q->type; ClClassAddMethParamQualifier(&cl->hdr, cl_parm, q->name, d); @@ -659,7 +662,7 @@ buildCreateClassRequest(void *parm) binCtx->pAs = NULL; } -static void +static int buildModifyInstanceRequest(void *parm) { CMPIObjectPath *path; @@ -676,6 +679,8 @@ buildModifyInstanceRequest(void *parm) XtokProperty *p = NULL; RequestHdr *hdr = &(((ParserControl *)parm)->reqHdr); BinRequestContext *binCtx = hdr->binCtx; + CMPIStatus rc = {CMPI_RC_OK, NULL}; + int err = 0; memset(binCtx, 0, sizeof(BinRequestContext)); XtokModifyInstance *req = (XtokModifyInstance *) hdr->cimRequest; @@ -712,7 +717,12 @@ buildModifyInstanceRequest(void *parm) if (p->val.val.value) { val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref, - req->op.nameSpace.data); + req->op.nameSpace.data, &rc); + if (rc.rc != CMPI_RC_OK) { /* bugzilla 75543 */ + binCtx->rc = rc.rc; + err = 1; + break; + } CMSetProperty(inst, p->name, &val, p->valueType); } } @@ -727,6 +737,7 @@ buildModifyInstanceRequest(void *parm) binCtx->bHdrSize = sreqSize; binCtx->chunkedMode = binCtx->xmlAs = binCtx->noResp = 0; binCtx->pAs = NULL; + return err; } static void @@ -1079,6 +1090,7 @@ buildSetPropertyRequest(void *parm) SetPropertyReq *sreq;// = BINREQ(OPS_SetProperty, 3); RequestHdr *hdr = &(((ParserControl *)parm)->reqHdr); BinRequestContext *binCtx = hdr->binCtx; + CMPIStatus st = {CMPI_RC_OK, NULL}; memset(binCtx, 0, sizeof(BinRequestContext)); XtokSetProperty *req = (XtokSetProperty *) hdr->cimRequest; @@ -1107,7 +1119,7 @@ buildSetPropertyRequest(void *parm) if (t != CMPI_null) { val = str2CMPIValue(t, req->newVal.val, &req->newVal.ref, - req->op.nameSpace.data); + req->op.nameSpace.data, &st); CMSetProperty(inst, req->propertyName, &val, t); } else { val.string = 0; @@ -1201,6 +1213,7 @@ buildSetQualifierRequest(void *parm) SetQualifierReq *sreq;// = BINREQ(OPS_SetQualifier, 3); RequestHdr *hdr = &(((ParserControl *)parm)->reqHdr); BinRequestContext *binCtx = hdr->binCtx; + CMPIStatus rc = {CMPI_RC_OK, NULL}; memset(binCtx, 0, sizeof(BinRequestContext)); XtokSetQualifier *req = (XtokSetQualifier *) hdr->cimRequest; @@ -1256,7 +1269,7 @@ buildSetQualifierRequest(void *parm) d.value = str2CMPIValue(d.type, req->qualifierdeclaration.data.value, (XtokValueReference *) & req->qualifierdeclaration.data.valueArray, - NULL); + NULL, &rc); ClQualifierAddQualifier(&q->hdr, &q->qualifierData, req->qualifierdeclaration.name, d); } else { // no default value - rely on ISARRAY @@ -1338,6 +1351,7 @@ buildInvokeMethodRequest(void *parm) XtokParamValue *p; RequestHdr *hdr = &(((ParserControl *)parm)->reqHdr); BinRequestContext *binCtx = hdr->binCtx; + CMPIStatus st = {CMPI_RC_OK, NULL}; memset(binCtx, 0, sizeof(BinRequestContext)); XtokMethodCall *req = (XtokMethodCall *) hdr->cimRequest; @@ -1385,7 +1399,7 @@ buildInvokeMethodRequest(void *parm) if (p->value.value) { CMPIValue val = str2CMPIValue(p->type, p->value, &p->valueRef, - req->op.nameSpace.data); + req->op.nameSpace.data, &st); CMAddArg(in, p->name, &val, p->type); } } @@ -2905,7 +2919,7 @@ modifyInstance $$.properties=0; setRequest(parm,&$$,sizeof(XtokModifyInstance),OPS_ModifyInstance); - buildModifyInstanceRequest(parm); + if (buildModifyInstanceRequest(parm)) yyerror("Invalid Parameter"); } | localNameSpacePath modifyInstanceParmsList { @@ -2919,7 +2933,7 @@ modifyInstance $$.properties=$2.properties; setRequest(parm,&$$,sizeof(XtokModifyInstance),OPS_ModifyInstance); - buildModifyInstanceRequest(parm); + if (buildModifyInstanceRequest(parm)) yyerror("Invalid Parameter"); } ; hooks/post-receive -- SFCB - Small Footprint CIM Broker |
From: Narasimha S. <nsh...@us...> - 2011-11-30 18:51:11
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "sfcCommon - Common lib for SFCB/SFCC". The branch, master has been updated via 2ba2ee958defada760a90932a52f6284ee883cb5 (commit) from 18eaba2dfca46f5d016b3a523481c5e840662933 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2ba2ee958defada760a90932a52f6284ee883cb5 Author: Narasimha Sharoff <nsh...@us...> Date: Wed Nov 30 10:49:32 2011 -0800 [3446179] Add a feature to validate CMPI types ----------------------------------------------------------------------- Summary of changes: diff --git a/Makefile.am b/Makefile.am index 03eb97e..7527bbe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -47,6 +47,7 @@ libsfcUtil_la_SOURCES = \ sfcUtil/utilFactory.c \ sfcUtil/utilHashtable.c \ sfcUtil/utilStringBuffer.c \ + sfcUtil/utilTypeCk.c \ sfcUtil/libsfcUtil.Versions libsfcUtil_la_LDFLAGS = -Wl,--version-script,$(srcdir)/sfcUtil/libsfcUtil.Versions diff --git a/sfcUtil/libsfcUtil.Versions b/sfcUtil/libsfcUtil.Versions index 4453052..5d9bfe5 100644 --- a/sfcUtil/libsfcUtil.Versions +++ b/sfcUtil/libsfcUtil.Versions @@ -3,6 +3,10 @@ SFCUTIL_1.0 { newHashTable; newHashTableDefault; newStringBuffer; + invalid_int; + invalid_uint; + invalid_real; + invalid_boolean; local: *; }; @@ -10,4 +14,4 @@ SFCUTIL_1.0 { SFCUTIL_1.1 { global: UtilFactory; -} SFCUTIL_1.0; \ No newline at end of file +} SFCUTIL_1.0; diff --git a/sfcUtil/utilTypeCk.c b/sfcUtil/utilTypeCk.c new file mode 100644 index 0000000..b8cfc1a --- /dev/null +++ b/sfcUtil/utilTypeCk.c @@ -0,0 +1,145 @@ +/* + * utilTypeCk.c + * + * (C) Copyright IBM Corp. 2011 + * + * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE 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 Eclipse Public License from + * http://www.opensource.org/licenses/eclipse-1.0.php + * + * Author: Narasimha Sharoff <nsh...@us...> + * + * Description: + * + * CIM type validation routines : return 1 on failure + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <limits.h> +#include <errno.h> +#include "cmpi/cmpidt.h" + +/* checks for unsigned integers uint8 - uint64 */ +int +invalid_uint(const char *v, const CMPIType type) +{ + unsigned long long int a = 0L; + int base = 0; /* allows decimal, octal, and hex values */ + char *endptr = NULL; + int rc = 0; + + if (strlen(v) == 0) return 1; + errno = 0; + a = strtoull(v, &endptr, base); + if ((errno == ERANGE && (a == ULONG_MAX)) + || (errno != 0 && a == 0)) return 1; + if (endptr[0] != '\0') return 1; + switch (type) { + case CMPI_uint8: + if ( a > UCHAR_MAX ) rc = 1; + break; + case CMPI_uint16: + if ( a > USHRT_MAX ) rc = 1; + break; + case CMPI_uint32: + if ( a > UINT_MAX ) rc = 1; + break; + case CMPI_uint64: + if ( a > ULONG_MAX ) rc = 1; + break; + default: + rc = 1; + break; + } + return rc; +} + +/* checks for integers int8 - int64 */ +int +invalid_int(const char *v, const CMPIType type) +{ + long long int a = 0L; + int base = 0; + char *endptr = NULL; + int rc = 0; + + if (strlen(v) == 0) return 1; + errno = 0; + a = strtoll(v, &endptr, base); + if (endptr[0] != '\0') return 1; + if ((errno == ERANGE && (a == LONG_MAX || a == LONG_MIN)) + || (errno != 0 && a == 0)) return 1; + switch (type) { + case CMPI_sint8: + if ( a > SCHAR_MAX || a < SCHAR_MIN ) rc = 1; + break; + case CMPI_sint16: + if ( a > SHRT_MAX || a < SHRT_MIN ) rc = 1; + break; + case CMPI_sint32: + if ( a > INT_MAX || a < INT_MIN ) rc = 1; + break; + case CMPI_sint64: + if ( a > LONG_MAX || a < LONG_MIN ) rc = 1; + break; + default: + rc = 1; + break; + } + return rc; +} + +/* checks for real32 and real64 */ +int +invalid_real(const char *v, const CMPIType type) +{ + float a = 0; + double d = 0; + char *endptr = NULL; + int rc = 0; + + if (strlen(v) == 0) return 1; + errno = 0; + switch (type) { + case CMPI_real32: + a = strtof(v, &endptr); + if (endptr[0] != '\0') return 1; + if ((a == 0) && (v == endptr)) return 1; + if ((errno == ERANGE /*&& (a == HUGE_VALF || a == -HUGE_VALF)*/) + || (errno != 0 && a == 0)) return 1; + break; + case CMPI_real64: + d = strtod(v, &endptr); + if (endptr[0] != '\0') return 1; + if ((d == 0) && (v == endptr)) return 1; + if ((errno == ERANGE /*&& (a == HUGE_VAL || a == -HUGE_VAL)*/) + || (errno != 0 && d == 0)) {printf("Nsn\n");return 1;} + break; + default: + rc = 1; + break; + } + return rc; +} + +/* case insensitive check for boolean "true" or "false" */ +int +invalid_boolean(const char *v, const CMPIType type) +{ + if ((strcasecmp(v, "false") == 0) || + (strcasecmp(v, "true") == 0)) return 0; + + return 1; +} + +/* MODELINES */ +/* DO NOT EDIT BELOW THIS COMMENT */ +/* Modelines are added by 'make pretty' */ +/* -*- Mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ +/* vi:set ts=2 sts=2 sw=2 expandtab: */ hooks/post-receive -- sfcCommon - Common lib for SFCB/SFCC |
From: Dave B. <bla...@us...> - 2011-11-29 14:30:14
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http In directory vz-cvs-3.sog:/tmp/cvs-serv16095/src/org/sblim/cimclient/internal/http Modified Files: Tag: Experimental HttpClient.java Log Message: 3444912 - Client delay during SSL handshake Index: HttpClient.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http/HttpClient.java,v retrieving revision 1.12.2.26 retrieving revision 1.12.2.27 diff -u -d -r1.12.2.26 -r1.12.2.27 --- HttpClient.java 8 Sep 2011 12:26:08 -0000 1.12.2.26 +++ HttpClient.java 29 Nov 2011 14:30:11 -0000 1.12.2.27 @@ -60,6 +60,7 @@ * 3235440 2011-03-22 blaschke-oss NullPointerException when socket factory returns null * 3323310 2011-06-20 blaschke-oss Need the ability to override certain Global Properties * 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues + * 3444912 2011-11-29 blaschke-oss Client delay during SSL handshake */ package org.sblim.cimclient.internal.http; @@ -90,6 +91,7 @@ import javax.net.ssl.HandshakeCompletedListener; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; import org.sblim.cimclient.internal.http.HttpHeader.HeaderEntry; import org.sblim.cimclient.internal.http.io.ASCIIPrintStream; @@ -992,9 +994,18 @@ } logger.trace(Level.FINER, "Creating new http for url " + this.iUrl.toString()); if (socketConnectWithTimeout) { - this.iSocket = factory.createSocket(); - if (this.iSocket != null) this.iSocket.connect(new InetSocketAddress(this.iUrl - .getHost(), this.iUrl.getPort()), timeout); + if (factory instanceof SSLSocketFactory) { + Socket sock = new Socket(); + sock.connect(new InetSocketAddress(this.iUrl.getHost(), this.iUrl.getPort()), + timeout); + this.iSocket = ((SSLSocketFactory) factory).createSocket(sock, this.iUrl + .getHost(), this.iUrl.getPort(), true); + + } else { + this.iSocket = factory.createSocket(); + if (this.iSocket != null) this.iSocket.connect(new InetSocketAddress(this.iUrl + .getHost(), this.iUrl.getPort()), timeout); + } } else { this.iSocket = factory.createSocket(this.iUrl.getHost(), this.iUrl.getPort()); } |
From: Tyrel D. <ty...@us...> - 2011-11-29 06:28:12
|
Update of /cvsroot/sblim/gather/plugin In directory vz-cvs-3.sog:/tmp/cvs-serv11567/plugin Modified Files: metricKvm.c metricVirt.c metricVirt.h repositoryKvm.c Log Message: Fixed 3444879: add VM Block IO Metrics Index: metricVirt.c =================================================================== RCS file: /cvsroot/sblim/gather/plugin/metricVirt.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- metricVirt.c 27 Oct 2011 16:33:10 -0000 1.15 +++ metricVirt.c 29 Nov 2011 06:28:09 -0000 1.16 @@ -1,7 +1,7 @@ /* * $Id$ * - * (C) Copyright IBM Corp. 2009, 2009 + * (C) Copyright IBM Corp. 2009, 2011 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -104,11 +104,122 @@ return tconn; } + +/* ---------------------------------------------------------------------------*/ +/* parseDomainXML */ +/* parse domain XML and collect block io stats */ +/* ---------------------------------------------------------------------------*/ +static struct vdisk_type *parseDomainXML(virDomainPtr domain) +{ + char *cur; + char *end; + char *temp; + virDomainBlockInfo blkinfo; + virDomainBlockStatsStruct blkstats; + struct vdisk_type *disk = NULL; + struct vdisk_type *head = NULL; + int parse = 0; + int type = 0; + + parse = 1; + cur = virDomainGetXMLDesc(domain, 0); + + while (parse) { + if ((cur = strstr(cur, "<disk"))) { + cur = strstr(cur, "type=\'"); + cur = cur + 6; + + switch (*cur) { + case 'f': + type = 0; + break; + case 'b': + type = 1; + break; + default: + continue; + } + + end = strstr(cur, "</disk"); + + temp = strstr(cur, "<source"); + if (temp > end) { + continue; + } + + cur = temp; + + if (type) { + cur = strstr(cur, "dev=\'"); + cur = cur + 5; + } else { + cur = strstr(cur, "file=\'"); + cur = cur + 6; + } + + end = strstr(cur, "\'"); + + if (!disk) { + disk = malloc(sizeof(struct vdisk_type)); + disk->next = NULL; + head = disk; + } else { + disk->next = malloc(sizeof(struct vdisk_type)); + disk = disk->next; + disk->next = NULL; + } + + disk->source = malloc(end - cur + 1); + disk->source = strncpy(disk->source, cur, end - cur); + disk->source[end - cur] = 0; + + cur = strstr(cur, "<target"); + cur = strstr(cur, "dev=\'"); + cur = cur + 5; + + end = strstr(cur, "\'"); + + disk->target = malloc(end - cur + 1); + disk->target = strncpy(disk->target, cur, end - cur); + disk->target[end - cur] = 0; + + virDomainGetBlockInfo(domain, disk->source, &blkinfo, 0); + disk->capacity = blkinfo.capacity; + virDomainBlockStats(domain, disk->target, &blkstats, + sizeof(virDomainBlockStatsStruct)); + + /* Convert to Kilobytes */ + disk->read = blkstats.rd_bytes / 1024; + disk->write = blkstats.wr_bytes / 1024; + } else { + parse = 0; + } + } + + return head; +} + +static void freeBlkIOData(int domains) +{ + struct vdisk_type * cur, * head; + int i; + + for (i = 0; i < domains; i++) { + head = domain_statistics.blkio[i]; + + while (head) { + cur = head; + head = cur->next; + free(cur); + } + } +} + + /* ---------------------------------------------------------------------------*/ /* collectDomainSchedStats */ /* get scheduler statistics for a given domain */ /* ---------------------------------------------------------------------------*/ - static void collectDomainSchedStats(int cnt) { FILE * fd = NULL; @@ -276,7 +387,11 @@ virConnectClose(conn); return VIRT_NOUPD; } else { - node_statistics.num_active_domains = 0; // reset number of domains + /* free previous running domain vdisk data */ + freeBlkIOData(node_statistics.num_active_domains); + + /* reset domain numbers */ + node_statistics.num_active_domains = 0; node_statistics.num_inactive_domains = 0; node_statistics.total_domains = 0; last_time_sampled = time(NULL); @@ -338,6 +453,7 @@ domain_statistics.state[cnt] = dinfo.state; collectDomainSchedStats(cnt); + domain_statistics.blkio[cnt] = parseDomainXML(domain); #ifdef DEBUG fprintf(stderr, "--- %s(%i) : %s (%d)\n\t claimed %lu max %lu\n\t time %f cpus %hu\n", @@ -898,3 +1014,79 @@ return -1; } + +int virtMetricRetrVirtualBlockIOStats(int mid, MetricReturner mret) +{ + MetricValue *mv = NULL; + struct vdisk_type * disk; + char values[25*3+4]; + char * resource; + +#ifdef DEBUG + fprintf(stderr, + "--- %s(%i) : Retrieving VirtualBlockIOStats\n", + __FILE__, __LINE__); +#endif + + if (collectDomainStats() == VIRT_FAIL) + return -1; + + if (mret == NULL) { +#ifdef DEBUG + fprintf(stderr, + "--- %s(%i) : Returner pointer is NULL\n", + __FILE__, __LINE__); +#endif + } else { +#ifdef DEBUG + fprintf(stderr, + "--- %s(%i) : Sampling for VirtualBlockIOStats\n", + __FILE__, __LINE__); +#endif + + int i; + +#ifdef DEBUG + fprintf(stderr, + "--- %s(%i) : num_active_domains %d\n", + __FILE__, __LINE__, node_statistics.num_active_domains); +#endif + + for (i = 0; i < node_statistics.total_domains; i++) { + + disk = domain_statistics.blkio[i]; + + while (disk) { + + memset(values,0,sizeof(values)); + sprintf(values,"%lld:%lld:%lld:", disk->read, disk->write, disk->capacity); + + resource = malloc(strlen(domain_statistics.domain_name[i]) + + strlen(disk->source) + strlen(disk->target) + 3); + sprintf(resource,"%s:%s:%s", domain_statistics.domain_name[i], disk->source, disk->target); + + mv = calloc(1, sizeof(MetricValue) + + (strlen(values) + 1) + + (strlen(resource) + 1)); + + if (mv) { + mv->mvId = mid; + mv->mvTimeStamp = time(NULL); + mv->mvDataType = MD_STRING; + mv->mvDataLength = strlen(values) + 1; + mv->mvData = (char *) mv + sizeof(MetricValue); + strcpy(mv->mvData, values); + mv->mvResource = (char *) mv + sizeof(MetricValue) + (strlen(values) + 1); + strcpy(mv->mvResource, resource); + mret(mv); + } + + disk = disk->next; + } + } + + return 1; + } + + return -1; +} Index: repositoryKvm.c =================================================================== RCS file: /cvsroot/sblim/gather/plugin/repositoryKvm.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- repositoryKvm.c 11 May 2011 01:42:58 -0000 1.8 +++ repositoryKvm.c 29 Nov 2011 06:28:09 -0000 1.9 @@ -1,7 +1,7 @@ /* * $Id$ * - * (C) Copyright IBM Corp. 2009 + * (C) Copyright IBM Corp. 2009, 2011 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -50,7 +50,7 @@ /* ---------------------------------------------------------------------------*/ -static MetricCalculationDefinition metricCalcDef[17]; +static MetricCalculationDefinition metricCalcDef[21]; // metric _Internal_CPUTime static MetricCalculator metricCalcCPUTime; @@ -94,9 +94,16 @@ // metric WaitSum // static MetricCalculator metricCalcWaitSum +// metric VirtualBlockIOStats +static MetricCalculator metricCalcVirtualBlockIOStats; +static MetricCalculator metricCalcBlockRead; +static MetricCalculator metricCalcBlockWrite; +static MetricCalculator metricCalcBlockCapacity; + /* unit definitions */ static char *muKiloBytes = "Kilobytes"; +static char *muBytes = "Bytes"; static char *muPercent = "Percent"; static char *muMicroSeconds = "MicroSeconds"; static char *muMilliSeconds = "MilliSeconds"; @@ -105,6 +112,12 @@ /* ---------------------------------------------------------------------------*/ +enum indices { BLK_READ, BLK_WRITE, BLK_CAP }; +static unsigned long long kvm_getData(char * data, char index); + + +/* ---------------------------------------------------------------------------*/ + int _DefinedRepositoryMetrics(MetricRegisterId * mr, const char *pluginname, size_t * mcnum, @@ -328,8 +341,57 @@ metricCalcDef[16].mcDataType = MD_UINT64; metricCalcDef[16].mcCalc = metricCalcSchedulerStats; metricCalcDef[16].mcUnits = muMicroSeconds; + + metricCalcDef[17].mcVersion = MD_VERSION; + metricCalcDef[17].mcName = "_VirtualBlockIOStats"; + metricCalcDef[17].mcId = mr(pluginname, metricCalcDef[17].mcName); + metricCalcDef[17].mcMetricType = + MD_PERIODIC | MD_RETRIEVED | MD_POINT; + metricCalcDef[17].mcIsContinuous = MD_FALSE; + metricCalcDef[17].mcCalculable = MD_NONCALCULABLE; + metricCalcDef[17].mcDataType = MD_STRING; + metricCalcDef[17].mcCalc = metricCalcVirtualBlockIOStats; + metricCalcDef[17].mcUnits = muNA; + + metricCalcDef[18].mcVersion = MD_VERSION; + metricCalcDef[18].mcName = "BlockRead"; + metricCalcDef[18].mcId = mr(pluginname, metricCalcDef[18].mcName); + metricCalcDef[18].mcMetricType = + MD_PERIODIC | MD_CALCULATED | MD_INTERVAL; + metricCalcDef[18].mcChangeType = MD_GAUGE; + metricCalcDef[18].mcIsContinuous = MD_TRUE; + metricCalcDef[18].mcCalculable = MD_SUMMABLE; + metricCalcDef[18].mcDataType = MD_UINT64; + metricCalcDef[18].mcAliasId=metricCalcDef[17].mcId; + metricCalcDef[18].mcCalc = metricCalcBlockRead; + metricCalcDef[18].mcUnits = muKiloBytes; + + metricCalcDef[19].mcVersion = MD_VERSION; + metricCalcDef[19].mcName = "BlockWrite"; + metricCalcDef[19].mcId = mr(pluginname, metricCalcDef[19].mcName); + metricCalcDef[19].mcMetricType = + MD_PERIODIC | MD_CALCULATED | MD_INTERVAL; + metricCalcDef[19].mcChangeType = MD_GAUGE; + metricCalcDef[19].mcIsContinuous = MD_TRUE; + metricCalcDef[19].mcCalculable = MD_SUMMABLE; + metricCalcDef[19].mcDataType = MD_UINT64; + metricCalcDef[19].mcAliasId=metricCalcDef[17].mcId; + metricCalcDef[19].mcCalc = metricCalcBlockWrite; + metricCalcDef[19].mcUnits = muKiloBytes; + + metricCalcDef[20].mcVersion=MD_VERSION; + metricCalcDef[20].mcName="BlockCapacity"; + metricCalcDef[20].mcId=mr(pluginname,metricCalcDef[20].mcName); + metricCalcDef[20].mcMetricType=MD_PERIODIC|MD_CALCULATED|MD_POINT; + metricCalcDef[20].mcChangeType=MD_GAUGE; + metricCalcDef[20].mcIsContinuous=MD_TRUE; + metricCalcDef[20].mcCalculable=MD_NONSUMMABLE; + metricCalcDef[20].mcDataType=MD_UINT64; + metricCalcDef[20].mcAliasId=metricCalcDef[17].mcId; + metricCalcDef[20].mcCalc=metricCalcBlockCapacity; + metricCalcDef[20].mcUnits=muBytes; - *mcnum = 17; + *mcnum = 21; *mc = metricCalcDef; return 0; } @@ -692,5 +754,144 @@ } /* ---------------------------------------------------------------------------*/ +/* Virtual Block IO Stats */ +/* ---------------------------------------------------------------------------*/ + +size_t metricCalcVirtualBlockIOStats( MetricValue *mv, + int mnum, + void *v, + size_t vlen ) { + +#ifdef DEBUG + fprintf(stderr,"--- %s(%i) : Calculate VirtualBlockIOStats\n", + __FILE__,__LINE__); +#endif + /* plain copy */ + if (mv && (vlen>=mv->mvDataLength) && (mnum==1) ) { + memcpy(v,mv->mvData,mv->mvDataLength); + return mv->mvDataLength; + } + return -1; +} + +/* ---------------------------------------------------------------------------*/ +/* BlockRead */ +/* ---------------------------------------------------------------------------*/ + +size_t metricCalcBlockRead( MetricValue *mv, + int mnum, + void *v, + size_t vlen ) +{ + unsigned long long br = 0; + unsigned long long b1 = 0; + unsigned long long b2 = 0; + +#ifdef DEBUG + fprintf(stderr,"--- %s(%i) : Calculate BlockRead\n", + __FILE__,__LINE__); +#endif + if ( mv && (vlen>=sizeof(unsigned long long)) && (mnum>=1) ) { + + b1 = kvm_getData(mv[0].mvData, BLK_READ); + if( mnum > 1 ) { + b2 = kvm_getData(mv[mnum-1].mvData, BLK_READ); + br = b1-b2; + } + else { br = b1; } + + memcpy(v,&br,sizeof(unsigned long long)); + return sizeof(unsigned long long); + } + return -1; +} + +/* ---------------------------------------------------------------------------*/ +/* BlockWrite */ +/* ---------------------------------------------------------------------------*/ + +size_t metricCalcBlockWrite( MetricValue *mv, + int mnum, + void *v, + size_t vlen ) +{ + unsigned long long br = 0; + unsigned long long b1 = 0; + unsigned long long b2 = 0; + +#ifdef DEBUG + fprintf(stderr,"--- %s(%i) : Calculate BlockWrite\n", + __FILE__,__LINE__); +#endif + if ( mv && (vlen>=sizeof(unsigned long long)) && (mnum>=1) ) { + + b1 = kvm_getData(mv[0].mvData, BLK_WRITE); + if( mnum > 1 ) { + b2 = kvm_getData(mv[mnum-1].mvData, BLK_WRITE); + br = b1-b2; + } + else { br = b1; } + + memcpy(v,&br,sizeof(unsigned long long)); + return sizeof(unsigned long long); + } + return -1; +} + +/* ---------------------------------------------------------------------------*/ +/* BlockCapacity */ +/* ---------------------------------------------------------------------------*/ + +size_t metricCalcBlockCapacity( MetricValue *mv, + int mnum, + void *v, + size_t vlen ) +{ + unsigned long long ct = 0; + +#ifdef DEBUG + fprintf(stderr,"--- %s(%i) : Calculate BlockCapacity\n", + __FILE__,__LINE__); +#endif + if ( mv && (vlen>=sizeof(unsigned long long)) && (mnum>=1) ) { + + ct = kvm_getData(mv[0].mvData, BLK_CAP); + + memcpy(v,&ct,sizeof(unsigned long long)); + return sizeof(unsigned long long); + } + return -1; +} + +/* ---------------------------------------------------------------------------*/ +/* tool function on internal raw metrics */ +/* ---------------------------------------------------------------------------*/ + +unsigned long long kvm_getData(char * data, char index) +{ + char * hlp = NULL; + char * end = NULL; + char bytes[128]; + unsigned long long val = 0; + int i = 0; + + hlp = data; + if ((end = strchr(hlp, ':')) != NULL) { + for (i = 0; i < index; i++) { + hlp = ++end; + if ((end = strchr(hlp, ':')) == NULL) { + return val; + } + } + + memset(bytes, 0, sizeof(bytes)); + strncpy(bytes, hlp, strlen(hlp) - strlen(end)); + val = strtoll(bytes, (char**) NULL, 10); + } + + return val; +} + +/* ---------------------------------------------------------------------------*/ /* end of repositoryKvm.c */ /* ---------------------------------------------------------------------------*/ Index: metricVirt.h =================================================================== RCS file: /cvsroot/sblim/gather/plugin/metricVirt.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- metricVirt.h 7 Oct 2011 00:08:52 -0000 1.7 +++ metricVirt.h 29 Nov 2011 06:28:09 -0000 1.8 @@ -1,7 +1,7 @@ /* * $Id$ * - * (C) Copyright IBM Corp. 2009 + * (C) Copyright IBM Corp. 2009, 2011 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -33,6 +33,15 @@ #define VIRT_NOUPD 1 #define VIRT_FAIL -1 +struct vdisk_type { + char * source; + char * target; + unsigned long long read; + unsigned long long write; + unsigned long long capacity; + struct vdisk_type * next; +}; + struct node_statistics_type { int num_active_domains; int num_inactive_domains; @@ -51,6 +60,7 @@ unsigned char state[MAX_DOMAINS]; unsigned long long cpu_used[MAX_DOMAINS]; unsigned long long cpu_ready[MAX_DOMAINS]; + struct vdisk_type * blkio[MAX_DOMAINS]; } domain_statistics; int testHypervisor(int type); @@ -63,5 +73,6 @@ MetricRetriever virtMetricRetrVirtualSystemState; MetricRetriever virtMetricRetrCPUUsedTimeCounter; MetricRetriever virtMetricRetrCPUReadyTimeCounter; +MetricRetriever virtMetricRetrVirtualBlockIOStats; #endif Index: metricKvm.c =================================================================== RCS file: /cvsroot/sblim/gather/plugin/metricKvm.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- metricKvm.c 12 May 2011 00:46:29 -0000 1.6 +++ metricKvm.c 29 Nov 2011 06:28:09 -0000 1.7 @@ -1,7 +1,8 @@ /* * $Id$ * - * (C) Copyright IBM Corp. 2009 + * (C) Copyright IBM Corp. 2009, 2011 + * * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -45,7 +46,7 @@ #include <ctype.h> /* --- metric callback retrievers to be exported --- */ -static MetricDefinition metricDef[10]; +static MetricDefinition metricDef[11]; /* --- required plugin functions --- */ int _DefinedMetrics(MetricRegisterId * mr, @@ -156,8 +157,16 @@ metricDef[9].mdSampleInterval = 60; metricDef[9].mproc = virtMetricRetrCPUReadyTimeCounter; metricDef[9].mdeal = free; + + metricDef[10].mdVersion = MD_VERSION; + metricDef[10].mdName = "_VirtualBlockIOStats"; + metricDef[10].mdReposPluginName = "librepositoryKvm.so"; + metricDef[10].mdId = mr(pluginname, metricDef[10].mdName); + metricDef[10].mdSampleInterval = 60; + metricDef[10].mproc = virtMetricRetrVirtualBlockIOStats; + metricDef[10].mdeal = free; - *mdnum = 10; + *mdnum = 11; } else { *mdnum = 0; } |
From: Tyrel D. <ty...@us...> - 2011-11-29 06:28:11
|
Update of /cvsroot/sblim/gather In directory vz-cvs-3.sog:/tmp/cvs-serv11567 Modified Files: NEWS Log Message: Fixed 3444879: add VM Block IO Metrics Index: NEWS =================================================================== RCS file: /cvsroot/sblim/gather/NEWS,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- NEWS 17 Nov 2011 01:06:35 -0000 1.115 +++ NEWS 29 Nov 2011 06:28:09 -0000 1.116 @@ -14,6 +14,7 @@ Features added: - 3438074 add packet drop metrics to IPProtocolEP - 3439075 add Host Block IO metrics +- 3444879 add VM Block IO Metrics Changes in Version 2.2.3 ======================== |
From: Michael Chase-S. <mc...@us...> - 2011-11-23 20:56:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via d78ab371e7715e1520e226e28ad08891eb1ed414 (commit) via 66e6dde5b68669f78b19044b68bb7fc846d49802 (commit) from 10b508a77d4e2e0eb8a140962b1b77fdbc3db7a0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d78ab371e7715e1520e226e28ad08891eb1ed414 Author: Michael Chase-Salerno <br...@li...> Date: Wed Nov 23 15:55:58 2011 -0500 [ 3433733 ] CreationClassNames should be supplied commit 66e6dde5b68669f78b19044b68bb7fc846d49802 Author: Michael Chase-Salerno <br...@li...> Date: Wed Nov 23 15:54:04 2011 -0500 3433733 CreationClassNames should be supplied ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 63c1d5e..a1cdf03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-11-23 Michael Chase-Salerno <br...@li...> + + * interopProvider.c, indCIMXMLHandler.c, instance.c, instance.h: + [ 3433733 ] CreationClassNames should be supplied + 2011-11-22 Michael Chase-Salerno <br...@li...> * cimXmlParser.c, control.c, httpAdapter.c, sfcb.cfg.pre.in: diff --git a/indCIMXMLHandler.c b/indCIMXMLHandler.c index 8a06833..08d7daa 100644 --- a/indCIMXMLHandler.c +++ b/indCIMXMLHandler.c @@ -359,20 +359,7 @@ IndCIMXMLHandlerCreateInstance(CMPIInstanceMI * mi, CMPIObjectPath* copLocal = CMClone(cop, NULL); memLinkObjectPath(copLocal); - CMPIString *ccn = ciLocal->ft->getProperty(ciLocal, "creationclassname", - &st).value.string; - if (CMIsNullObject(ccn)) { - setStatus(&st, CMPI_RC_ERR_FAILED, - "CreationClassName property not found"); - _SFCB_RETURN(st); - } - CMPIString *sccn = ciLocal->ft->getProperty(ciLocal, "systemcreationclassname", - &st).value.string; - if (CMIsNullObject(sccn)) { - setStatus(&st, CMPI_RC_ERR_FAILED, - "SystemCreationClassName property not found"); - _SFCB_RETURN(st); - } + setCCN(copLocal,ciLocal,"CIM_ComputerSystem"); CMPIString *sysname=ciLocal->ft->getProperty(ciLocal,"SystemName",&st).value.string; if (sysname == NULL || sysname->hdl == NULL) { diff --git a/instance.c b/instance.c index 2ec61ed..a7a7748 100644 --- a/instance.c +++ b/instance.c @@ -1068,6 +1068,23 @@ instFillDefaultProperties(struct native_instance *inst, } #endif +/* + Set the CreationClassName and SystemCreationClassName + According to DSP1001, these need not be specified by the client + and should be ignored if provided. +*/ +void +setCCN(CMPIObjectPath * cop, + CMPIInstance *ci, + const char * sccn) +{ + CMPIString* ccn = CMGetClassName(cop, NULL); + CMAddKey(cop, "creationclassname", CMGetCharPtr(ccn), CMPI_chars); + CMSetProperty(ci,"creationclassname", CMGetCharPtr(ccn), CMPI_chars); + CMAddKey(cop, "systemcreationclassname", sccn, CMPI_chars); + CMSetProperty(ci,"systemcreationclassname", sccn, CMPI_chars); +} + /****************************************************************************/ /* MODELINES */ /* DO NOT EDIT BELOW THIS COMMENT */ diff --git a/instance.h b/instance.h index 1e56118..286b83d 100644 --- a/instance.h +++ b/instance.h @@ -25,6 +25,7 @@ int instanceCompare(CMPIInstance *inst1, CMPIInstance *inst2); const char *instGetClassName(CMPIInstance *ci); const char *instGetNameSpace(CMPIInstance *ci); CMPIStatus filterFlagProperty(CMPIInstance* ci, const char* id); +void setCCN(CMPIObjectPath * cop, CMPIInstance *ci, const char * sccn); #endif /* MODELINES */ diff --git a/interopProvider.c b/interopProvider.c index 1b2b0c9..8a16c82 100644 --- a/interopProvider.c +++ b/interopProvider.c @@ -950,22 +950,7 @@ InteropProviderCreateInstance(CMPIInstanceMI * mi, st = processSubscription(_broker, ctx, ciLocal, copLocal); } else if (isa(nss, cns, "cim_indicationfilter")) { - CMPIString *ccn = ciLocal->ft->getProperty(ciLocal, "creationclassname", - &st).value.string; - if (CMIsNullObject(ccn)) { - setStatus(&st, CMPI_RC_ERR_FAILED, - "CreationClassName property not found"); - _SFCB_RETURN(st); - } - CMPIString *sccn = ciLocal->ft->getProperty(ciLocal, "systemcreationclassname", - &st).value.string; - if (CMIsNullObject(sccn)) { - setStatus(&st, CMPI_RC_ERR_FAILED, - "SystemCreationClassName property not found"); - _SFCB_RETURN(st); - } - - + setCCN(copLocal,ciLocal,"CIM_ComputerSystem"); QLStatement *qs = NULL; int rc, i, diff --git a/test/TestProviders/tests/IndTest1CreateFilter.xml b/test/TestProviders/tests/IndTest1CreateFilter.xml index d994517..d8273d9 100644 --- a/test/TestProviders/tests/IndTest1CreateFilter.xml +++ b/test/TestProviders/tests/IndTest1CreateFilter.xml @@ -9,15 +9,16 @@ </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="NewInstance"> <INSTANCE CLASSNAME="CIM_IndicationFilter"> - <PROPERTY NAME="SystemCreationClassName" TYPE="string"> - <VALUE>CIM_ComputerSystem</VALUE> - </PROPERTY> <PROPERTY NAME="SystemName" TYPE="string"> <VALUE>localhost.localdomain</VALUE> </PROPERTY> + <PROPERTY NAME="SystemCreationClassName" TYPE="string"> + <VALUE>CIM_ComputerSystem</VALUE> + </PROPERTY> <PROPERTY NAME="CreationClassName" TYPE="string"> <VALUE>CIM_IndicationFilter</VALUE> </PROPERTY> + <PROPERTY NAME="Name" TYPE="string"> <VALUE>Test_Indication_Filter_</VALUE> </PROPERTY> diff --git a/test/TestProviders/tests/IndTest2CreateHandler.xml b/test/TestProviders/tests/IndTest2CreateHandler.xml index 0fc1df7..a67dedd 100644 --- a/test/TestProviders/tests/IndTest2CreateHandler.xml +++ b/test/TestProviders/tests/IndTest2CreateHandler.xml @@ -9,15 +9,9 @@ </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="NewInstance"> <INSTANCE CLASSNAME="CIM_IndicationHandlerCIMXML"> - <PROPERTY NAME="SystemCreationClassName" TYPE="string"> - <VALUE>CIM_ComputerSystem</VALUE> - </PROPERTY> <PROPERTY NAME="SystemName" TYPE="string"> <VALUE>localhost.localdomain</VALUE> </PROPERTY> - <PROPERTY NAME="CreationClassName" TYPE="string"> - <VALUE>CIM_IndicationHandlerCIMXML</VALUE> - </PROPERTY> <PROPERTY NAME="Name" TYPE="string"> <VALUE>Test_Indication_Handler_</VALUE> </PROPERTY> hooks/post-receive -- SFCB - Small Footprint CIM Broker |