Changeset 3390
- Timestamp:
- 02/24/10 09:32:23 (7 months ago)
- Files:
-
- openwsman/trunk/src/plugins/cim/sfcc-interface.c (modified) (42 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openwsman/trunk/src/plugins/cim/sfcc-interface.c
r3379 r3390 192 192 WSA_REFERENCE_PARAMETERS, 193 193 NULL); 194 _path_res_uri = cim_find_namespace_for_class(client, NULL, 195 (char *) classname->hdl); 194 _path_res_uri = cim_find_namespace_for_class(client, NULL, CMGetCharPtr(classname)); 196 195 ws_xml_add_child_format(refparam, XML_NS_WS_MAN, WSM_RESOURCE_URI, 197 196 "%s", _path_res_uri); … … 211 210 s = ws_xml_add_child(wsman_selector_set, XML_NS_WS_MAN, 212 211 WSM_SELECTOR, cv ); 213 ws_xml_add_node_attr(s, NULL, "Name", (char *) keyname->hdl);212 ws_xml_add_node_attr(s, NULL, "Name", CMGetCharPtr(keyname)); 214 213 if (cv) 215 214 u_free(cv); … … 217 216 CMRelease(keyname); 218 217 } 219 if ( namespace->hdl!= NULL) {218 if (CMGetCharPtr(namespace) != NULL) { 220 219 cimns = ws_xml_add_child(wsman_selector_set, 221 220 XML_NS_WS_MAN, WSM_SELECTOR, 222 (char *) namespace->hdl);221 CMGetCharPtr(namespace)); 223 222 ws_xml_add_node_attr(cimns, NULL, "Name", 224 223 CIM_NAMESPACE_SELECTOR); … … 684 683 class->ft->getPropertyAt(class, i, &propertyname, NULL); 685 684 data = class->ft->getPropertyQualifier(class, 686 (char *) propertyname-> 687 hdl, "Key", &rc); 685 CMGetCharPtr(propertyname), "Key", &rc); 688 686 if ((data.state != CMPI_nullValue) && (data.value.boolean)) { 689 687 ccount++; … … 767 765 opcount = CMGetKeyCount(objectpath, &rc); 768 766 debug("getKeyCount rc=%d, msg=%s", 769 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);767 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 770 768 771 769 … … 830 828 cleanup: 831 829 debug("getKey rc=%d, msg=%s", 832 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);830 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 833 831 return statusP->fault_code; 834 832 } … … 850 848 851 849 debug("getClass() rc=%d, msg=%s", 852 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: "<NULL>");850 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : "<NULL>"); 853 851 cim_to_wsman_status(rc, status); 854 852 if (op) … … 904 902 classname = objectpath->ft->getClassName(objectpath, NULL); 905 903 class_namespace = cim_find_namespace_for_class(client, enumInfo, 906 (char *) classname->hdl);904 CMGetCharPtr(classname)); 907 905 908 906 final_class = u_strdup(strrchr(class_namespace, '/') + 1); … … 935 933 _class->ft->getPropertyAt(_class, i, &propertyname, 936 934 NULL); 937 data = instance->ft->getProperty(instance, (char *) propertyname->hdl,935 data = instance->ft->getProperty(instance, CMGetCharPtr(propertyname), 938 936 NULL); 939 937 } else { … … 942 940 NULL); 943 941 } 944 if(propertystr && strcmp(propertystr, propertyname->hdl)) {942 if(propertystr && strcmp(propertystr, CMGetCharPtr(propertyname))) { 945 943 CMRelease(propertyname); 946 944 continue; 947 945 } 948 objectpath->ft->getKey(objectpath, (char *) propertyname->hdl, &is_key);949 property2xml(client, &data, (char *) propertyname->hdl, xmlr,946 objectpath->ft->getKey(objectpath, CMGetCharPtr(propertyname), &is_key); 947 property2xml(client, &data, CMGetCharPtr(propertyname), xmlr, 950 948 class_namespace, frag_type, is_key.rc); 951 949 CMRelease(propertyname); … … 1003 1001 &rc); 1004 1002 debug("enumInstanceNames rc=%d, msg=%s", rc.rc, 1005 (rc.msg) ? (char *) rc.msg->hdl: NULL);1003 (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 1006 1004 1007 1005 if (rc.rc != 0) { … … 1021 1019 CMPIObjectPath *op = CMClone(data.value.ref, NULL); 1022 1020 CMPIString *opstr = CMObjectPathToString(op, NULL); 1023 debug("objectpath: %s", (char *) opstr->hdl);1021 debug("objectpath: %s", CMGetCharPtr(opstr)); 1024 1022 if (cim_verify_keys(op, client->selectors, statusP) != 0) { 1025 1023 if (opstr) … … 1132 1130 1133 1131 debug("enumInstances() rc=%d, msg=%s", 1134 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);1132 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 1135 1133 1136 1134 if (rc.rc) { … … 1197 1195 1198 1196 if (enumInfo && (enumInfo->flags & WSMAN_ENUMINFO_POLY_NONE ) && 1199 (strcmp( (char *) classname->hdl, client->requested_class) != 0)) {1197 (strcmp(CMGetCharPtr(classname), client->requested_class) != 0)) { 1200 1198 retval = 0; 1201 1199 } … … 1235 1233 1236 1234 if (enumInfo && (enumInfo->flags & WSMAN_ENUMINFO_POLY_NONE) 1237 && (strcmp( (char *) classname->hdl, client->requested_class) != 0)) {1235 && (strcmp(CMGetCharPtr(classname), client->requested_class) != 0)) { 1238 1236 retval = 0; 1239 1237 } 1240 uri = cim_find_namespace_for_class(client, enumInfo, 1241 (char *) classname->hdl); 1238 uri = cim_find_namespace_for_class(client, enumInfo, CMGetCharPtr(classname)); 1242 1239 if (retval) { 1243 1240 cim_add_epr(client, itemsNode, uri, objectpath); … … 1269 1266 1270 1267 if (enumInfo && (enumInfo->flags & WSMAN_ENUMINFO_POLY_NONE) && 1271 (strcmp( (char *) classname->hdl, client->requested_class) != 0)) {1268 (strcmp(CMGetCharPtr(classname), client->requested_class) != 0)) { 1272 1269 retval = 0; 1273 1270 } 1274 uri = cim_find_namespace_for_class(client, enumInfo, 1275 (char *) classname->hdl); 1271 uri = cim_find_namespace_for_class(client, enumInfo, CMGetCharPtr(classname)); 1276 1272 1277 1273 if (retval) { … … 1318 1314 i, &propertyname, 1319 1315 NULL); 1320 debug("working on property: %s", (char *) propertyname->hdl);1316 debug("working on property: %s", CMGetCharPtr(propertyname) ); 1321 1317 if(fragment_flag == 0) { 1322 1318 child = ws_xml_get_child(resource, 0, resource_uri, 1323 (char *) propertyname->hdl);1319 CMGetCharPtr(propertyname)); 1324 1320 if (child) { 1325 1321 value = ws_xml_get_node_text(child); … … 1335 1331 if (value) { 1336 1332 xml2property(instance, &data, 1337 (char *) propertyname->hdl,1333 CMGetCharPtr(propertyname), 1338 1334 value); 1339 1335 } … … 1350 1346 } 1351 1347 else { 1352 if(strcmp(element, (char *) propertyname->hdl) == 0) {1348 if(strcmp(element, CMGetCharPtr(propertyname) ) == 0) { 1353 1349 debug("release %s", element); 1354 1350 CMRelease(propertyname); … … 1410 1406 1411 1407 numproperties = instance->ft->getPropertyCount(instance, NULL); 1412 r = ws_xml_get_child(body, 0, resourceUri, (char *) classname->hdl);1408 r = ws_xml_get_child(body, 0, resourceUri, CMGetCharPtr(classname)); 1413 1409 1414 1410 if (numproperties) { … … 1427 1423 if (value) { 1428 1424 xml2property(instance, &data, 1429 (char *) propertyname->hdl,1425 CMGetCharPtr(propertyname), 1430 1426 value); 1431 1427 } … … 1472 1468 CMPIString * cim_namespace = objectpath->ft->getNameSpace(objectpath, NULL); 1473 1469 char *str_namespace = client->cim_namespace; 1474 if (NULL != cim_namespace && NULL != cim_namespace->hdl) {1475 str_namespace = (char *)cim_namespace->hdl;1470 if (NULL != cim_namespace && NULL != CMGetCharPtr(cim_namespace)) { 1471 str_namespace = CMGetCharPtr(cim_namespace); 1476 1472 } 1477 1473 if (str_namespace != NULL) { … … 1507 1503 free(valuestr); 1508 1504 } 1509 ws_xml_add_node_attr(s, NULL, WSM_NAME, 1510 (char *) keyname->hdl); 1505 ws_xml_add_node_attr(s, NULL, WSM_NAME, CMGetCharPtr(keyname)); 1511 1506 1512 1507 … … 1733 1728 1734 1729 debug("invokeMethod(%s) rc=%d, msg=%s", 1735 client->method, rc.rc, (rc.msg) ? (char *) rc.msg->hdl: "<NULL>");1730 client->method, rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : "<NULL>"); 1736 1731 1737 1732 method_node = ws_xml_add_empty_child_format(body, … … 1754 1749 data = CMGetArgAt(argsout, i, &argname, NULL); 1755 1750 property2xml(client, &data, 1756 (char *) argname->hdl,1751 CMGetCharPtr(argname), 1757 1752 method_node, client->resource_uri, 0, 0); 1758 1753 CMRelease(argname); … … 1799 1794 } 1800 1795 debug("deleteInstance rc=%d, msg=%s", rc.rc, 1801 (rc.msg) ? (char *) rc.msg->hdl: NULL);1796 (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 1802 1797 } 1803 1798 … … 1841 1836 } 1842 1837 debug("getInstance rc=%d, msg=%s", rc.rc, 1843 (rc.msg) ? (char *) rc.msg->hdl: NULL);1838 (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 1844 1839 if (instance) 1845 1840 CMRelease(instance); … … 1907 1902 if (status->fault_code == 0 && instance ) { 1908 1903 CMPIString *opstr = CMObjectPathToString(objectpath, NULL); 1909 debug("objectpath: %s", (char *)opstr->hdl);1904 debug("objectpath: %s", CMGetCharPtr(opstr) ); 1910 1905 rc = cc->ft->setInstance(cc, objectpath, instance, 0, NULL); 1911 1906 debug("modifyInstance() rc=%d, msg=%s", rc.rc, 1912 (rc.msg) ? (char *) rc.msg-> hdl: NULL);1907 (rc.msg) ? (char *) CMGetCharPtr(rc.msg) : NULL); 1913 1908 if (rc.rc == CMPI_RC_ERR_FAILED) { 1914 1909 status->fault_code = … … 1994 1989 /* retrieve property type (in data) and name (in propertyname) */ 1995 1990 CMPIData data = class->ft->getPropertyAt(class, i, &propertyname, NULL); 1996 class->ft->getPropertyQualifier(class, (char *) propertyname->hdl, "KEY", &rc);1991 class->ft->getPropertyQualifier(class, CMGetCharPtr(propertyname), "KEY", &rc); 1997 1992 1998 1993 if (rc.rc == 0 … … 2000 1995 && !ws_xml_get_child(resource, 0, 2001 1996 resource_xsd ? resource_xsd : client->resource_uri, 2002 (char *) propertyname->hdl)) {1997 CMGetCharPtr(propertyname))) { 2003 1998 debug("WXF_INVALID_REPRESENTATION"); 2004 debug("No <%s:%s>", resource_xsd ? resource_xsd : client->resource_uri, (char *) propertyname->hdl);1999 debug("No <%s:%s>", resource_xsd ? resource_xsd : client->resource_uri, CMGetCharPtr(propertyname)); 2005 2000 status->fault_code = WXF_INVALID_REPRESENTATION; 2006 2001 status->fault_detail_code = WSMAN_DETAIL_MISSING_VALUES; … … 2009 2004 if(fragstr == NULL) { 2010 2005 child = ws_xml_get_child(resource, 0, 2011 resource_xsd ? resource_xsd : client->resource_uri, (char *)propertyname->hdl);2006 resource_xsd ? resource_xsd : client->resource_uri, CMGetCharPtr(propertyname)); 2012 2007 } 2013 2008 else { 2014 if(strcmp(element, (char *)propertyname->hdl)) {2009 if(strcmp(element, CMGetCharPtr(propertyname))) { 2015 2010 CMRelease(propertyname); 2016 2011 continue; … … 2021 2016 2022 2017 /* assemble objectpath, passing value with correct type */ 2023 xml2objectpath(objectpath, &data, (char *) propertyname->hdl, ws_xml_get_node_text(child));2024 2025 if(fragstr && strcmp(element, (char *)propertyname->hdl) == 0) {2018 xml2objectpath(objectpath, &data, CMGetCharPtr(propertyname), ws_xml_get_node_text(child)); 2019 2020 if(fragstr && strcmp(element, CMGetCharPtr(propertyname)) == 0) { 2026 2021 debug("fragstr, early break"); 2027 2022 CMRelease(propertyname); … … 2052 2047 objectpath_r = cc->ft->createInstance(cc, objectpath, instance, &rc); 2053 2048 debug("createInstance() rc=%d, msg=%s", rc.rc, 2054 (rc.msg) ? (char *) rc.msg->hdl: NULL);2049 (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2055 2050 if (objectpath_r) { 2056 2051 WsXmlNodeH epr = ws_xml_add_child(body, XML_NS_TRANSFER, … … 2106 2101 /* Print the results */ 2107 2102 debug("deleteInstance() rc=%d, msg=%s", 2108 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);2103 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2109 2104 cim_to_wsman_status(rc, status); 2110 2105 if (rc.msg) … … 2148 2143 /* Print the results */ 2149 2144 debug("getInstance() rc=%d, msg=%s", 2150 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);2145 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2151 2146 cim_to_wsman_status(rc, status); 2152 2147 if (rc.msg) … … 2264 2259 /* Print the results */ 2265 2260 debug("create CIM_IndicationFilter() rc=%d, msg=%s", 2266 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);2261 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2267 2262 if (rc.rc == CMPI_RC_ERR_FAILED) { 2268 2263 status->fault_code = WSA_ACTION_NOT_SUPPORTED; … … 2329 2324 /* Print the results */ 2330 2325 debug("create CIM_IndicationHandlerCIMXML() rc=%d, msg=%s", 2331 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);2326 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2332 2327 if (rc.rc == CMPI_RC_ERR_FAILED) { 2333 2328 status->fault_code = WSA_ACTION_NOT_SUPPORTED; … … 2393 2388 /* Print the results */ 2394 2389 debug("create CIM_IndicationSubscription() rc=%d, msg=%s", 2395 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);2390 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2396 2391 if (rc.rc == CMPI_RC_ERR_FAILED) { 2397 2392 status->fault_code = WSA_ACTION_NOT_SUPPORTED; … … 2453 2448 } 2454 2449 debug("cim_update_indication_subscription() rc=%d, msg=%s", 2455 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);2450 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2456 2451 if (rc.msg) 2457 2452 CMRelease(rc.msg); … … 2514 2509 } 2515 2510 debug("cim_delete_indication_subscription() rc=%d, msg=%s", 2516 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);2511 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2517 2512 if (rc.msg) 2518 2513 CMRelease(rc.msg); … … 2542 2537 break; 2543 2538 case CMPI_RC_ERR_FAILED: 2544 if (rc.msg && strcmp( (char *) rc.msg->hdl, "CURL error: 7") == 0)2539 if (rc.msg && strcmp(CMGetCharPtr(rc.msg), "CURL error: 7") == 0) 2545 2540 status->fault_code = WSA_DESTINATION_UNREACHABLE; 2546 2541 else … … 2638 2633 enumeration = cc->ft->enumInstanceNames(cc, objectpath, &rc); 2639 2634 debug("enumInstanceNames() rc=%d, msg=%s", 2640 rc.rc, (rc.msg) ? (char *) rc.msg->hdl: NULL);2635 rc.rc, (rc.msg) ? CMGetCharPtr(rc.msg) : NULL); 2641 2636 2642 2637 if (rc.rc) {