diff --git a/zhcp/.cproject b/zhcp/.cproject deleted file mode 100644 index 0cb66c3..0000000 --- a/zhcp/.cproject +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/zhcp/.project b/zhcp/.project deleted file mode 100644 index faa366b..0000000 --- a/zhcp/.project +++ /dev/null @@ -1,77 +0,0 @@ - - - zHCP - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.core.cnature - - diff --git a/zhcp/BUILD/Makefile b/zhcp/BUILD/Makefile deleted file mode 100644 index f4e46d2..0000000 --- a/zhcp/BUILD/Makefile +++ /dev/null @@ -1,801 +0,0 @@ -DEBUG = -g -CFLAGS = -fPIC -LIB_DIR = $(RPM_BUILD_ROOT)/opt/zhcp/lib -BIN_DIR = $(RPM_BUILD_ROOT)/opt/zhcp/bin -LD_DIR = $(RPM_BUILD_ROOT)/etc/ld.so.conf.d -RA_SRC_DIR = resource_access/src/ -RA_INCLUDE_DIR = resource_access/include/ -VMAPILIB = libvmapi.so - -#----------------------------------------------------------------------- -# Headers -#----------------------------------------------------------------------- -COMMON_HEADERS = $(RA_INCLUDE_DIR)smPublic.h $(RA_INCLUDE_DIR)smTraceAndError.h $(RA_INCLUDE_DIR)smapiTableParser.h $(RA_INCLUDE_DIR)smSocket.h - -#----------------------------------------------------------------------- -# Objects for library -#----------------------------------------------------------------------- -OBJECTS = smSocket.o smMemoryGroup.o smapiUtilities.o \ - smapiTableParser.o \ - vmapiAsynchronousNotificationDisableDm.o \ - vmapiAsynchronousNotificationEnableDm.o \ - vmapiAsynchronousNotificationQueryDm.o \ - vmapiAuthorizationListAdd.o \ - vmapiAuthorizationListQuery.o \ - vmapiAuthorizationListRemove.o \ - vmapiCheckAuthentication.o \ - vmapiDirectoryManagerLocalTagDefineDm.o \ - vmapiDirectoryManagerLocalTagDeleteDm.o \ - vmapiDirectoryManagerLocalTagQueryDm.o \ - vmapiDirectoryManagerLocalTagSetDm.o \ - vmapiDirectoryManagerSearchDm.o \ - vmapiDirectoryManagerTaskCancelDm.o \ - vmapiImageActivate.o \ - vmapiImageActiveConfigurationQuery.o \ - vmapiImageCpuDefine.o \ - vmapiImageCpuDefineDm.o \ - vmapiImageCpuDelete.o \ - vmapiImageCpuDeleteDm.o \ - vmapiImageCpuQuery.o \ - vmapiImageCpuQueryDm.o \ - vmapiImageCpuSetMaximumDm.o \ - vmapiImageCreateDm.o \ - vmapiImageDeactivate.o \ - vmapiImageDeleteDm.o \ - vmapiImageDeviceDedicate.o \ - vmapiImageDeviceDedicateDm.o \ - vmapiImageDeviceReset.o \ - vmapiImageDeviceUndedicate.o \ - vmapiImageDeviceUndedicateDm.o \ - vmapiImageDiskCopy.o \ - vmapiImageDiskCopyDm.o \ - vmapiImageDiskCreate.o \ - vmapiImageDiskCreateDm.o \ - vmapiImageDiskDelete.o \ - vmapiImageDiskDeleteDm.o \ - vmapiImageDiskShare.o \ - vmapiImageDiskShareDm.o \ - vmapiImageDiskUnshare.o \ - vmapiImageDiskUnshareDm.o \ - vmapiImageIplDeleteDm.o \ - vmapiImageIplDeviceQuery.o \ - vmapiImageIplQueryDm.o \ - vmapiImageIplSetDm.o \ - vmapiImageLockDm.o \ - vmapiImageNameQueryDm.o \ - vmapiImagePasswordSetDm.o \ - vmapiImageQueryActivateTime.o \ - vmapiImageQueryDm.o \ - vmapiImageRecycle.o \ - vmapiImageReplaceDm.o \ - vmapiImageScsiCharacteristicsDefineDm.o \ - vmapiImageScsiCharacteristicsQueryDm.o \ - vmapiImageStatusQuery.o \ - vmapiImageUnlockDm.o \ - vmapiImageVolumeAdd.o \ - vmapiImageVolumeDelete.o \ - vmapiImageVolumeSpaceDefineDm.o \ - vmapiImageVolumeSpaceQueryDm.o \ - vmapiImageVolumeSpaceRemoveDm.o \ - vmapiNameListAdd.o \ - vmapiNameListDestroy.o \ - vmapiNameListQuery.o \ - vmapiNameListRemove.o \ - vmapiProfileCreateDm.o \ - vmapiProfileDeleteDm.o \ - vmapiProfileQueryDm.o \ - vmapiProfileReplaceDm.o \ - vmapiPrototypeCreateDm.o \ - vmapiPrototypeDeleteDm.o \ - vmapiPrototypeNameQueryDm.o \ - vmapiPrototypeQueryDm.o \ - vmapiPrototypeReplaceDm.o \ - vmapiQueryApiFunctionalLevel.o \ - vmapiQueryAsynchronousOperationDm.o \ - vmapiQueryDirectoryManagerLevelDm.o \ - vmapiSharedMemoryAccessAddDm.o \ - vmapiSharedMemoryAccessQueryDm.o \ - vmapiSharedMemoryAccessRemoveDm.o \ - vmapiSharedMemoryCreate.o \ - vmapiSharedMemoryDelete.o \ - vmapiSharedMemoryQuery.o \ - vmapiSharedMemoryReplace.o \ - vmapiStaticImageChangesActivateDm.o \ - vmapiStaticImageChangesDeactivateDm.o \ - vmapiStaticImageChangesImmediateDm.o \ - vmapiSystemInfoQuery.o \ - vmapiSystemIoQuery.o \ - vmapiVirtualChannelConnectionCreate.o \ - vmapiVirtualChannelConnectionCreateDm.o \ - vmapiVirtualChannelConnectionDelete.o \ - vmapiVirtualChannelConnectionDeleteDm.o \ - vmapiVirtualNetworkAdapterConnectLan.o \ - vmapiVirtualNetworkAdapterConnectLanDm.o \ - vmapiVirtualNetworkAdapterConnectVswitch.o \ - vmapiVirtualNetworkAdapterConnectVswitchDm.o \ - vmapiVirtualNetworkAdapterCreate.o \ - vmapiVirtualNetworkAdapterCreateDm.o \ - vmapiVirtualNetworkAdapterDelete.o \ - vmapiVirtualNetworkAdapterDeleteDm.o \ - vmapiVirtualNetworkAdapterDisconnect.o \ - vmapiVirtualNetworkAdapterDisconnectDm.o \ - vmapiVirtualNetworkAdapterQuery.o \ - vmapiVirtualNetworkLanAccess.o \ - vmapiVirtualNetworkLanAccessQuery.o \ - vmapiVirtualNetworkLanCreate.o \ - vmapiVirtualNetworkLanDelete.o \ - vmapiVirtualNetworkLanQuery.o \ - vmapiVirtualNetworkQueryOsa.o \ - vmapiVirtualNetworkVswitchCreate.o \ - vmapiVirtualNetworkVswitchDelete.o \ - vmapiVirtualNetworkVswitchQuery.o \ - vmapiVirtualNetworkVswitchSet.o \ - vmapiVmrmConfigurationQuery.o \ - vmapiVmrmConfigurationUpdate.o \ - vmapiVmrmMeasurementQuery.o -.PHONY: all install post clean - -#----------------------------------------------------------------------- -# All -#----------------------------------------------------------------------- -all: $(VMAPILIB) \ - wrapperutils.o \ - add3390 \ - add3390active \ - add9336 \ - addvdisk \ - addprocessor \ - addnic \ - connectnic2guestlan \ - connectnic2vswitch \ - createvs \ - deleteipl \ - deletevs \ - dedicatedevice \ - disconnectnic \ - getuserentrynames \ - getuserentry \ - getipl \ - getuserprofile \ - getdiskpool \ - getdiskpoolnames \ - queryvolumes \ - removemdisk \ - removenic \ - removeprocessor \ - replacevs \ - setipl \ - setpassword \ - startvs \ - stopvs \ - undedicatedevice - -#----------------------------------------------------------------------- -# Resource access .o files -#----------------------------------------------------------------------- -smSocket.o : $(RA_SRC_DIR)smSocket.c $(RA_INCLUDE_DIR)smSocket.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)smSocket.c - -smMemoryGroup.o : $(RA_SRC_DIR)smMemoryGroup.c $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)smMemoryGroup.c - -smapiUtilities.o : $(RA_SRC_DIR)smapiUtilities.c $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)smapiUtilities.c - -smapiTableParser.o : $(RA_SRC_DIR)smapiTableParser.c $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)smapiTableParser.c - -vmapiAsynchronousNotificationDisableDm.o : $(RA_SRC_DIR)vmapiAsynchronousNotificationDisableDm.c $(RA_INCLUDE_DIR)vmapiAsynchronous.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAsynchronousNotificationDisableDm.c - -vmapiAsynchronousNotificationEnableDm.o : $(RA_SRC_DIR)vmapiAsynchronousNotificationEnableDm.c $(RA_INCLUDE_DIR)vmapiAsynchronous.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAsynchronousNotificationEnableDm.c - -vmapiAsynchronousNotificationQueryDm.o : $(RA_SRC_DIR)vmapiAsynchronousNotificationQueryDm.c $(RA_INCLUDE_DIR)vmapiAsynchronous.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAsynchronousNotificationQueryDm.c - -vmapiAuthorizationListAdd.o : $(RA_SRC_DIR)vmapiAuthorizationListAdd.c $(RA_INCLUDE_DIR)vmapiAuthorization.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAuthorizationListAdd.c - -vmapiAuthorizationListQuery.o : $(RA_SRC_DIR)vmapiAuthorizationListQuery.c $(RA_INCLUDE_DIR)vmapiAuthorization.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAuthorizationListQuery.c - -vmapiAuthorizationListRemove.o : $(RA_SRC_DIR)vmapiAuthorizationListRemove.c $(RA_INCLUDE_DIR)vmapiAuthorization.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAuthorizationListRemove.c - -vmapiCheckAuthentication.o : $(RA_SRC_DIR)vmapiCheckAuthentication.c $(RA_INCLUDE_DIR)vmapiCheckAuthentication.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiCheckAuthentication.c - -vmapiDirectoryManagerLocalTagDefineDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagDefineDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagDefineDm.c - -vmapiDirectoryManagerLocalTagDeleteDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagDeleteDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagDeleteDm.c - -vmapiDirectoryManagerLocalTagQueryDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagQueryDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagQueryDm.c - -vmapiDirectoryManagerLocalTagSetDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagSetDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagSetDm.c - -vmapiDirectoryManagerSearchDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerSearchDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerSearchDm.c - -vmapiDirectoryManagerTaskCancelDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerTaskCancelDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerTaskCancelDm.c - -vmapiImageActivate.o : $(RA_SRC_DIR)vmapiImageActivate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageActivate.c - -vmapiImageActiveConfigurationQuery.o : $(RA_SRC_DIR)vmapiImageActiveConfigurationQuery.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageActiveConfigurationQuery.c - -vmapiImageCpuDefine.o : $(RA_SRC_DIR)vmapiImageCpuDefine.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuDefine.c - -vmapiImageCpuDefineDm.o : $(RA_SRC_DIR)vmapiImageCpuDefineDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuDefineDm.c - -vmapiImageCpuDelete.o : $(RA_SRC_DIR)vmapiImageCpuDelete.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuDelete.c - -vmapiImageCpuDeleteDm.o : $(RA_SRC_DIR)vmapiImageCpuDeleteDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuDeleteDm.c - -vmapiImageCpuQuery.o : $(RA_SRC_DIR)vmapiImageCpuQuery.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuQuery.c - -vmapiImageCpuQueryDm.o : $(RA_SRC_DIR)vmapiImageCpuQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuQueryDm.c - -vmapiImageCpuSetMaximumDm.o : $(RA_SRC_DIR)vmapiImageCpuSetMaximumDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuSetMaximumDm.c - -vmapiImageCreateDm.o : $(RA_SRC_DIR)vmapiImageCreateDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCreateDm.c - -vmapiImageDeactivate.o : $(RA_SRC_DIR)vmapiImageDeactivate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeactivate.c - -vmapiImageDeleteDm.o : $(RA_SRC_DIR)vmapiImageDeleteDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeleteDm.c - -vmapiImageDeviceDedicate.o : $(RA_SRC_DIR)vmapiImageDeviceDedicate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceDedicate.c - -vmapiImageDeviceDedicateDm.o : $(RA_SRC_DIR)vmapiImageDeviceDedicateDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceDedicateDm.c - -vmapiImageDeviceReset.o : $(RA_SRC_DIR)vmapiImageDeviceReset.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceReset.c - -vmapiImageDeviceUndedicate.o : $(RA_SRC_DIR)vmapiImageDeviceUndedicate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceUndedicate.c - -vmapiImageDeviceUndedicateDm.o : $(RA_SRC_DIR)vmapiImageDeviceUndedicateDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceUndedicateDm.c - -vmapiImageDiskCopy.o : $(RA_SRC_DIR)vmapiImageDiskCopy.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskCopy.c - -vmapiImageDiskCopyDm.o : $(RA_SRC_DIR)vmapiImageDiskCopyDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskCopyDm.c - -vmapiImageDiskCreate.o : $(RA_SRC_DIR)vmapiImageDiskCreate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskCreate.c - -vmapiImageDiskCreateDm.o : $(RA_SRC_DIR)vmapiImageDiskCreateDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskCreateDm.c - -vmapiImageDiskDelete.o : $(RA_SRC_DIR)vmapiImageDiskDelete.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskDelete.c - -vmapiImageDiskDeleteDm.o : $(RA_SRC_DIR)vmapiImageDiskDeleteDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskDeleteDm.c - -vmapiImageDiskShare.o : $(RA_SRC_DIR)vmapiImageDiskShare.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskShare.c - -vmapiImageDiskShareDm.o : $(RA_SRC_DIR)vmapiImageDiskShareDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskShareDm.c - -vmapiImageDiskUnshare.o : $(RA_SRC_DIR)vmapiImageDiskUnshare.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskUnshare.c - -vmapiImageDiskUnshareDm.o : $(RA_SRC_DIR)vmapiImageDiskUnshareDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskUnshareDm.c - -vmapiImageIplDeleteDm.o : $(RA_SRC_DIR)vmapiImageIplDeleteDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageIplDeleteDm.c - -vmapiImageIplDeviceQuery.o : $(RA_SRC_DIR)vmapiImageIplDeviceQuery.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageIplDeviceQuery.c - -vmapiImageIplQueryDm.o : $(RA_SRC_DIR)vmapiImageIplQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageIplQueryDm.c - -vmapiImageIplSetDm.o : $(RA_SRC_DIR)vmapiImageIplSetDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageIplSetDm.c - -vmapiImageLockDm.o : $(RA_SRC_DIR)vmapiImageLockDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageLockDm.c - -vmapiImageNameQueryDm.o : $(RA_SRC_DIR)vmapiImageNameQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageNameQueryDm.c - -vmapiImagePasswordSetDm.o : $(RA_SRC_DIR)vmapiImagePasswordSetDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImagePasswordSetDm.c - -vmapiImageQueryActivateTime.o : $(RA_SRC_DIR)vmapiImageQueryActivateTime.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageQueryActivateTime.c - -vmapiImageQueryDm.o : $(RA_SRC_DIR)vmapiImageQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageQueryDm.c - -vmapiImageRecycle.o : $(RA_SRC_DIR)vmapiImageRecycle.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageRecycle.c - -vmapiImageReplaceDm.o : $(RA_SRC_DIR)vmapiImageReplaceDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageReplaceDm.c - -vmapiImageScsiCharacteristicsDefineDm.o : $(RA_SRC_DIR)vmapiImageScsiCharacteristicsDefineDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageScsiCharacteristicsDefineDm.c - -vmapiImageScsiCharacteristicsQueryDm.o : $(RA_SRC_DIR)vmapiImageScsiCharacteristicsQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageScsiCharacteristicsQueryDm.c - -vmapiImageStatusQuery.o : $(RA_SRC_DIR)vmapiImageStatusQuery.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageStatusQuery.c - -vmapiImageUnlockDm.o : $(RA_SRC_DIR)vmapiImageUnlockDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageUnlockDm.c - -vmapiImageVolumeAdd.o : $(RA_SRC_DIR)vmapiImageVolumeAdd.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeAdd.c - -vmapiImageVolumeDelete.o : $(RA_SRC_DIR)vmapiImageVolumeDelete.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeDelete.c - -vmapiImageVolumeSpaceDefineDm.o : $(RA_SRC_DIR)vmapiImageVolumeSpaceDefineDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeSpaceDefineDm.c - -vmapiImageVolumeSpaceQueryDm.o : $(RA_SRC_DIR)vmapiImageVolumeSpaceQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeSpaceQueryDm.c - -vmapiImageVolumeSpaceRemoveDm.o : $(RA_SRC_DIR)vmapiImageVolumeSpaceRemoveDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeSpaceRemoveDm.c - -vmapiNameListAdd.o : $(RA_SRC_DIR)vmapiNameListAdd.c $(RA_INCLUDE_DIR)vmapiName.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiNameListAdd.c - -vmapiNameListDestroy.o : $(RA_SRC_DIR)vmapiNameListDestroy.c $(RA_INCLUDE_DIR)vmapiName.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiNameListDestroy.c - -vmapiNameListQuery.o : $(RA_SRC_DIR)vmapiNameListQuery.c $(RA_INCLUDE_DIR)vmapiName.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiNameListQuery.c - -vmapiNameListRemove.o : $(RA_SRC_DIR)vmapiNameListRemove.c $(RA_INCLUDE_DIR)vmapiName.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiNameListRemove.c - -vmapiProfileCreateDm.o : $(RA_SRC_DIR)vmapiProfileCreateDm.c $(RA_INCLUDE_DIR)vmapiProfile.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiProfileCreateDm.c - -vmapiProfileDeleteDm.o : $(RA_SRC_DIR)vmapiProfileDeleteDm.c $(RA_INCLUDE_DIR)vmapiProfile.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiProfileDeleteDm.c - -vmapiProfileQueryDm.o : $(RA_SRC_DIR)vmapiProfileQueryDm.c $(RA_INCLUDE_DIR)vmapiProfile.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiProfileQueryDm.c - -vmapiProfileReplaceDm.o : $(RA_SRC_DIR)vmapiProfileReplaceDm.c $(RA_INCLUDE_DIR)vmapiProfile.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiProfileReplaceDm.c - -vmapiPrototypeCreateDm.o : $(RA_SRC_DIR)vmapiPrototypeCreateDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeCreateDm.c - -vmapiPrototypeDeleteDm.o : $(RA_SRC_DIR)vmapiPrototypeDeleteDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeDeleteDm.c - -vmapiPrototypeNameQueryDm.o : $(RA_SRC_DIR)vmapiPrototypeNameQueryDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeNameQueryDm.c - -vmapiPrototypeQueryDm.o : $(RA_SRC_DIR)vmapiPrototypeQueryDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeQueryDm.c - -vmapiPrototypeReplaceDm.o : $(RA_SRC_DIR)vmapiPrototypeReplaceDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeReplaceDm.c - -vmapiQueryApiFunctionalLevel.o : $(RA_SRC_DIR)vmapiQueryApiFunctionalLevel.c $(RA_INCLUDE_DIR)vmapiQuery.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiQueryApiFunctionalLevel.c - -vmapiQueryAsynchronousOperationDm.o : $(RA_SRC_DIR)vmapiQueryAsynchronousOperationDm.c $(RA_INCLUDE_DIR)vmapiQuery.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiQueryAsynchronousOperationDm.c - -vmapiQueryDirectoryManagerLevelDm.o : $(RA_SRC_DIR)vmapiQueryDirectoryManagerLevelDm.c $(RA_INCLUDE_DIR)vmapiQuery.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiQueryDirectoryManagerLevelDm.c - -vmapiSharedMemoryAccessAddDm.o : $(RA_SRC_DIR)vmapiSharedMemoryAccessAddDm.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryAccessAddDm.c - -vmapiSharedMemoryAccessQueryDm.o : $(RA_SRC_DIR)vmapiSharedMemoryAccessQueryDm.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryAccessQueryDm.c - -vmapiSharedMemoryAccessRemoveDm.o : $(RA_SRC_DIR)vmapiSharedMemoryAccessRemoveDm.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryAccessRemoveDm.c - -vmapiSharedMemoryCreate.o : $(RA_SRC_DIR)vmapiSharedMemoryCreate.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryCreate.c - -vmapiSharedMemoryDelete.o : $(RA_SRC_DIR)vmapiSharedMemoryDelete.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryDelete.c - -vmapiSharedMemoryQuery.o : $(RA_SRC_DIR)vmapiSharedMemoryQuery.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryQuery.c - -vmapiSharedMemoryReplace.o : $(RA_SRC_DIR)vmapiSharedMemoryReplace.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryReplace.c - -vmapiStaticImageChangesActivateDm.o : $(RA_SRC_DIR)vmapiStaticImageChangesActivateDm.c $(RA_INCLUDE_DIR)vmapiStatic.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiStaticImageChangesActivateDm.c - -vmapiStaticImageChangesDeactivateDm.o : $(RA_SRC_DIR)vmapiStaticImageChangesDeactivateDm.c $(RA_INCLUDE_DIR)vmapiStatic.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiStaticImageChangesDeactivateDm.c - -vmapiStaticImageChangesImmediateDm.o : $(RA_SRC_DIR)vmapiStaticImageChangesImmediateDm.c $(RA_INCLUDE_DIR)vmapiStatic.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiStaticImageChangesImmediateDm.c - -vmapiSystemInfoQuery.o : $(RA_SRC_DIR)vmapiSystemInfoQuery.c $(RA_INCLUDE_DIR)vmapiSystem.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSystemInfoQuery.c - -vmapiSystemIoQuery.o : $(RA_SRC_DIR)vmapiSystemIoQuery.c $(RA_INCLUDE_DIR)vmapiSystem.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSystemIoQuery.c - -vmapiVirtualChannelConnectionCreate.o : $(RA_SRC_DIR)vmapiVirtualChannelConnectionCreate.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualChannelConnectionCreate.c - -vmapiVirtualChannelConnectionCreateDm.o : $(RA_SRC_DIR)vmapiVirtualChannelConnectionCreateDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualChannelConnectionCreateDm.c - -vmapiVirtualChannelConnectionDelete.o : $(RA_SRC_DIR)vmapiVirtualChannelConnectionDelete.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualChannelConnectionDelete.c - -vmapiVirtualChannelConnectionDeleteDm.o : $(RA_SRC_DIR)vmapiVirtualChannelConnectionDeleteDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualChannelConnectionDeleteDm.c - -vmapiVirtualNetworkAdapterConnectLan.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectLan.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectLan.c - -vmapiVirtualNetworkAdapterConnectLanDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectLanDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectLanDm.c - -vmapiVirtualNetworkAdapterConnectVswitch.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectVswitch.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectVswitch.c - -vmapiVirtualNetworkAdapterConnectVswitchDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectVswitchDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectVswitchDm.c - -vmapiVirtualNetworkAdapterCreate.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterCreate.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterCreate.c - -vmapiVirtualNetworkAdapterCreateDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterCreateDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterCreateDm.c - -vmapiVirtualNetworkAdapterDelete.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDelete.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDelete.c - -vmapiVirtualNetworkAdapterDeleteDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDeleteDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDeleteDm.c - -vmapiVirtualNetworkAdapterDisconnect.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDisconnect.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDisconnect.c - -vmapiVirtualNetworkAdapterDisconnectDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDisconnectDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDisconnectDm.c - -vmapiVirtualNetworkAdapterQuery.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterQuery.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterQuery.c - -vmapiVirtualNetworkLanAccess.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanAccess.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanAccess.c - -vmapiVirtualNetworkLanAccessQuery.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanAccessQuery.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanAccessQuery.c - -vmapiVirtualNetworkLanCreate.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanCreate.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanCreate.c - -vmapiVirtualNetworkLanDelete.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanDelete.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanDelete.c - -vmapiVirtualNetworkLanQuery.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanQuery.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanQuery.c - -vmapiVirtualNetworkQueryOsa.o : $(RA_SRC_DIR)vmapiVirtualNetworkQueryOsa.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkQueryOsa.c - -vmapiVirtualNetworkVswitchCreate.o : $(RA_SRC_DIR)vmapiVirtualNetworkVswitchCreate.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkVswitchCreate.c - -vmapiVirtualNetworkVswitchDelete.o : $(RA_SRC_DIR)vmapiVirtualNetworkVswitchDelete.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkVswitchDelete.c - -vmapiVirtualNetworkVswitchQuery.o : $(RA_SRC_DIR)vmapiVirtualNetworkVswitchQuery.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkVswitchQuery.c - -vmapiVirtualNetworkVswitchSet.o : $(RA_SRC_DIR)vmapiVirtualNetworkVswitchSet.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkVswitchSet.c - -vmapiVmrmConfigurationQuery.o : $(RA_SRC_DIR)vmapiVmrmConfigurationQuery.c $(RA_INCLUDE_DIR)vmapiVMRM.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVmrmConfigurationQuery.c - -vmapiVmrmConfigurationUpdate.o : $(RA_SRC_DIR)vmapiVmrmConfigurationUpdate.c $(RA_INCLUDE_DIR)vmapiVMRM.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVmrmConfigurationUpdate.c - -vmapiVmrmMeasurementQuery.o : $(RA_SRC_DIR)vmapiVmrmMeasurementQuery.c $(RA_INCLUDE_DIR)vmapiVMRM.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVmrmMeasurementQuery.c - -#----------------------------------------------------------------------- -# Resource access libraries -#----------------------------------------------------------------------- -$(VMAPILIB) : $(OBJECTS) - gcc -Wl,-d -shared -pthread -ldl -o $(VMAPILIB) $(OBJECTS) - -#----------------------------------------------------------------------- -# Resource access executables -#----------------------------------------------------------------------- -wrapperutils.o : $(RA_SRC_DIR)wrapperutils.c $(RA_INCLUDE_DIR)smPublic.h $(RA_INCLUDE_DIR)vmapiImage.h - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)wrapperutils.c - -add3390 : add3390.o $(VMAPILIB) - gcc -o add3390 -L./ -lvmapi wrapperutils.o add3390.o - -add3390.o : $(RA_SRC_DIR)add3390.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)add3390.c - -add3390active : add3390active.o $(VMAPILIB) - gcc -o add3390active -L./ -lvmapi wrapperutils.o add3390active.o - -add3390active.o : $(RA_SRC_DIR)add3390active.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)add3390active.c - -add9336 : add9336.o $(VMAPILIB) - gcc -o add9336 -L./ -lvmapi wrapperutils.o add9336.o - -add9336.o : $(RA_SRC_DIR)add9336.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)add9336.c - -addvdisk : addvdisk.o $(VMAPILIB) - gcc -o addvdisk -L./ -lvmapi wrapperutils.o addvdisk.o - -addvdisk.o : $(RA_SRC_DIR)addvdisk.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)addvdisk.c - -addprocessor : addprocessor.o $(VMAPILIB) - gcc -o addprocessor -L./ -lvmapi wrapperutils.o addprocessor.o - -addprocessor.o : $(RA_SRC_DIR)addprocessor.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)addprocessor.c - -addnic : addnic.o $(VMAPILIB) - gcc -o addnic -L./ -lvmapi wrapperutils.o addnic.o - -addnic.o : $(RA_SRC_DIR)addnic.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)addnic.c - -connectnic2guestlan : connectnic2guestlan.o $(VMAPILIB) - gcc -o connectnic2guestlan -L./ -lvmapi wrapperutils.o connectnic2guestlan.o - -connectnic2guestlan.o : $(RA_SRC_DIR)connectnic2guestlan.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)connectnic2guestlan.c - -connectnic2vswitch : connectnic2vswitch.o $(VMAPILIB) - gcc -o connectnic2vswitch -L./ -lvmapi wrapperutils.o connectnic2vswitch.o - -connectnic2vswitch.o : $(RA_SRC_DIR)connectnic2vswitch.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)connectnic2vswitch.c - -createvs : createvs.o $(VMAPILIB) - gcc -o createvs -L./ -lvmapi wrapperutils.o createvs.o - -createvs.o : $(RA_SRC_DIR)createvs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)createvs.c - -deletevs : deletevs.o $(VMAPILIB) - gcc -o deletevs -L./ -lvmapi wrapperutils.o deletevs.o - -deletevs.o : $(RA_SRC_DIR)deletevs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)deletevs.c - -dedicatedevice : dedicatedevice.o $(VMAPILIB) - gcc -o dedicatedevice -L./ -lvmapi wrapperutils.o dedicatedevice.o - -dedicatedevice.o : $(RA_SRC_DIR)dedicatedevice.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)dedicatedevice.c - -deleteipl : deleteipl.o $(VMAPILIB) - gcc -o deleteipl -L./ -lvmapi wrapperutils.o deleteipl.o - -deleteipl.o : $(RA_SRC_DIR)deleteipl.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)deleteipl.c - -disconnectnic : disconnectnic.o $(VMAPILIB) - gcc -o disconnectnic -L./ -lvmapi wrapperutils.o disconnectnic.o - -disconnectnic.o : $(RA_SRC_DIR)disconnectnic.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)disconnectnic.c - -getuserentrynames : getuserentrynames.o $(VMAPILIB) - gcc -o getuserentrynames -L./ -lvmapi wrapperutils.o getuserentrynames.o - -getuserentrynames.o : $(RA_SRC_DIR)getuserentrynames.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getuserentrynames.c - -getuserentry : getuserentry.o $(VMAPILIB) - gcc -o getuserentry -L./ -lvmapi wrapperutils.o getuserentry.o - -getuserentry.o : $(RA_SRC_DIR)getuserentry.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getuserentry.c - -getipl : getipl.o $(VMAPILIB) - gcc -o getipl -L./ -lvmapi wrapperutils.o getipl.o - -getipl.o : $(RA_SRC_DIR)getipl.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getipl.c - -getuserprofile : getuserprofile.o $(VMAPILIB) - gcc -o getuserprofile -L./ -lvmapi wrapperutils.o getuserprofile.o - -getuserprofile.o : $(RA_SRC_DIR)getuserprofile.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getuserprofile.c - -getdiskpool : getdiskpool.o $(VMAPILIB) - gcc -o getdiskpool -L./ -lvmapi wrapperutils.o getdiskpool.o - -getdiskpool.o : $(RA_SRC_DIR)getdiskpool.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getdiskpool.c - -getdiskpoolnames : getdiskpoolnames.o $(VMAPILIB) - gcc -o getdiskpoolnames -L./ -lvmapi wrapperutils.o getdiskpoolnames.o - -getdiskpoolnames.o : $(RA_SRC_DIR)getdiskpoolnames.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getdiskpoolnames.c - -queryvolumes : queryvolumes.o $(VMAPILIB) - gcc -o queryvolumes -L./ -lvmapi wrapperutils.o queryvolumes.o - -queryvolumes.o : $(RA_SRC_DIR)queryvolumes.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)queryvolumes.c - -removemdisk : removemdisk.o $(VMAPILIB) - gcc -o removemdisk -L./ -lvmapi wrapperutils.o removemdisk.o - -removemdisk.o : $(RA_SRC_DIR)removemdisk.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)removemdisk.c - -removenic : removenic.o $(VMAPILIB) - gcc -o removenic -L./ -lvmapi wrapperutils.o removenic.o - -removenic.o : $(RA_SRC_DIR)removenic.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)removenic.c - -removeprocessor : removeprocessor.o $(VMAPILIB) - gcc -o removeprocessor -L./ -lvmapi wrapperutils.o removeprocessor.o - -removeprocessor.o : $(RA_SRC_DIR)removeprocessor.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)removeprocessor.c - -replacevs : replacevs.o $(VMAPILIB) - gcc -o replacevs -L./ -lvmapi wrapperutils.o replacevs.o - -replacevs.o : $(RA_SRC_DIR)replacevs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)replacevs.c - -setipl : setipl.o $(VMAPILIB) - gcc -o setipl -L./ -lvmapi wrapperutils.o setipl.o - -setipl.o : $(RA_SRC_DIR)setipl.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)setipl.c - -setpassword : setpassword.o $(VMAPILIB) - gcc -o setpassword -L./ -lvmapi wrapperutils.o setpassword.o - -setpassword.o : $(RA_SRC_DIR)setpassword.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)setpassword.c - -startvs : startvs.o $(VMAPILIB) - gcc -o startvs -L./ -lvmapi wrapperutils.o startvs.o - -startvs.o : $(RA_SRC_DIR)startvs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)startvs.c - -stopvs : stopvs.o $(VMAPILIB) - gcc -o stopvs -L./ -lvmapi wrapperutils.o stopvs.o - -stopvs.o : $(RA_SRC_DIR)stopvs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)stopvs.c - -undedicatedevice : undedicatedevice.o $(VMAPILIB) - gcc -o undedicatedevice -L./ -lvmapi wrapperutils.o undedicatedevice.o - -undedicatedevice.o : $(RA_SRC_DIR)undedicatedevice.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)undedicatedevice.c - -#----------------------------------------------------------------------- -# Install -#----------------------------------------------------------------------- -install: - mkdir -p $(LIB_DIR) - install $(VMAPILIB) $(LIB_DIR) - mkdir -p $(BIN_DIR) - install stopvs $(BIN_DIR) - install add3390 $(BIN_DIR) - install add3390active $(BIN_DIR) - install add9336 $(BIN_DIR) - install addvdisk $(BIN_DIR) - install addprocessor $(BIN_DIR) - install addnic $(BIN_DIR) - install connectnic2guestlan $(BIN_DIR) - install connectnic2vswitch $(BIN_DIR) - install createvs $(BIN_DIR) - install deletevs $(BIN_DIR) - install dedicatedevice $(BIN_DIR) - install deleteipl $(BIN_DIR) - install disconnectnic $(BIN_DIR) - install getuserentrynames $(BIN_DIR) - install getuserentry $(BIN_DIR) - install getipl $(BIN_DIR) - install getuserprofile $(BIN_DIR) - install getdiskpool $(BIN_DIR) - install getdiskpoolnames $(BIN_DIR) - install queryvolumes $(BIN_DIR) - install removemdisk $(BIN_DIR) - install removenic $(BIN_DIR) - install removeprocessor $(BIN_DIR) - install replacevs $(BIN_DIR) - install setipl $(BIN_DIR) - install setpassword $(BIN_DIR) - install startvs $(BIN_DIR) - install stopvs $(BIN_DIR) - install undedicatedevice $(BIN_DIR) - mkdir -p $(LD_DIR) - install -m 644 config/zhcp.conf $(LD_DIR) - -#----------------------------------------------------------------------- -# Post -#----------------------------------------------------------------------- -post: - ldconfig - -#----------------------------------------------------------------------- -# Clean -#----------------------------------------------------------------------- -clean: - rm -f *.o *.so $(VMAPILIB) - rm add3390 - rm add3390active - rm add9336 - rm addvdisk - rm addprocessor - rm addnic - rm connectnic2guestlan - rm connectnic2vswitch - rm createvs - rm deleteipl - rm deletevs - rm dedicatedevice - rm disconnectnic - rm getuserentrynames - rm getuserentry - rm getipl - rm getuserprofile - rm getdiskpool - rm getdiskpoolnames - rm queryvolumes - rm removemdisk - rm removenic - rm removeprocessor - rm replacevs - rm setipl - rm setpassword - rm startvs - rm stopvs - rm undedicatedevice diff --git a/zhcp/BUILD/config/zhcp.conf b/zhcp/BUILD/config/zhcp.conf deleted file mode 100644 index a623f4f..0000000 --- a/zhcp/BUILD/config/zhcp.conf +++ /dev/null @@ -1 +0,0 @@ -/opt/zhcp/lib diff --git a/zhcp/BUILD/resource_access/include/smPublic.h b/zhcp/BUILD/resource_access/include/smPublic.h deleted file mode 100644 index 5ab3fcf..0000000 --- a/zhcp/BUILD/resource_access/include/smPublic.h +++ /dev/null @@ -1,381 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _SM_PUBLIC_H -#define _SM_PUBLIC_H - -#include -#include -#include -#include -#include - -#define BUFLEN 256 -#define MAXCACHENAMELEN 8+1+8 -#define CACHEENTRYLEN BUFLEN+MAXCACHENAMELEN -#define PATHLENGTH 512 -#define LENGTH_OF_USERID_LENGTH_FIELD 4 -#define ALL_SCAN_FILES "*.scan" -#define PORT_FILENAME "vmbkend.UDP" - -// Data structure to character based information -typedef struct _Record { - struct _Record* nextP; - char data[1]; -} Record; - -// Data structure to keep lists of records -typedef struct _List { - Record* firstP; - Record* currentP; - int size; -} List; - -enum Times { - ConnectRetryLimit = 10, // # trials for connect - SEND_RETRY_LIMIT = 8, // # times to retry send to SMAPI - Delay = 10, // Delay in loop checking for pending workunits - MaxWaitCycleN = 10, // Max number of wait cycles for pending ops - SleepInterval = 15, // Interval in seconds to sleep on repetitive operations - Socket_Timeout = 240, // Max timeout for socket operations - Socket_Indication_Timeout = 500, // Max timeout for indication socket operations - ImageSetRange = 4096, // # image disks in an image set - LINESIZE = 512 -// # bytes to use for a message/log line -}; - -// Resource layer specific function call return codes for internal/unexpected errors -// Look in the internal context for other specific return and reason codes -// listed below -// -// NOTE Parser return codes are using -4000 to -4010 see smapiTableParser.h for details. -#define MEMORY_ERROR -999 -#define INVALID_DATA -2 -#define PROCESSING_ERROR -3 - -// These are from smSocket.c functions -#define SOCKET_OBTAIN_ERROR -100 -#define SOCKET_CONNECT_REFUSED_ERROR -101 -#define SOCKET_CONNECT_TRYAGAIN_ERROR -102 -#define SOCKET_TIMEOUT_ERROR -103 -#define SOCKET_READ_ERROR -104 -#define SOCKET_READ_RETRYABLE_ERROR -105 -#define SOCKET_WRITE_ERROR -106 -#define SOCKET_WRITE_RETRYABLE_ERROR -107 -#define SOCKET_PROCESSING_ERROR -108 -#define CUSTOM_DEFINED_SOCKET_RETRY 100 - -// Return and reason codes -enum ReturnCodes { - RcWarning = 4, RcContext = -1, // Context related errors - RcSession = -2, // Session related errors - RcFunction = -3, // Errors invoking functions - RcRuntime = -4, // General runtime errors - RcIucv = -5, // Error caused by IUCV, reason code is IUCV return value - RcCp = -6, // CP command invocation errors - RcCpint = -7, // CPint invocation - RcNoMemory = -8 -// Out of memory and no context yet -}; - -enum GeneralReasonCodes { - RsInternalBufferTooSmall = 10000, RsNoMemory = 10001, - RsSemaphoreNotCreated = 10011, RsSemaphoreNotObtained = 10012, - RsSemaphoreNotReleased = 10013, RsSocketAddrIdFileNotOpened = 10014, - RsUnableToOpenLog = 10100, RsSocketTimeout = 10110, RsUnexpected = 10200 -}; - -enum ContextReasonCodes { - RsNoHostname = 1, RsNoHostId = 2, RsNoServerAssociation = 3, - RsNoUserid = 4, RsInvalidVmapiServerVersion = 5, RsInvalidServerName = 6 -}; - -enum SessionReasonCodes { - RsUnableToReadSessionContext = 1, RsUnableToWriteSessionContext = 2 -}; - -enum FunctionReasonCodes { - RsFunctionNotSpecified = 1, RsFunctionUnknown = 2, - RsFunctionNotImplemented = 3, RsInvalidNumberOfArguments = 4, - RsFunctionNotSupported = 5, RsInvalidArgument = 24 -}; - -enum RuntimeReasonCodes { - RsUnableToOpenLog22 = 1 -}; - -typedef struct _smMemoryGroupContext { - int arraySize; - int lastChunk; - void ** chunks; -} smMemoryGroupContext; - -#define CACHE_PATH_DEFAULT "/var/opt/ibm/zvmmap/.vmapi/" -#define CACHE_SEMAPHORE_DIRECTORY ".vmapi/" -#define CACHE_SEMAPHORE_FILENAME "vmapi.sem" -#define CACHE_DIRECTORY ".cache/" -#define CACHE_DIRECTORY_FOR_USER "cache/" -#define CACHE_FILE_EXTENSION_FOR_USER ".cache" -#define CACHE_INSTANCEID_FILE_EXTENSION_FOR_USER ".id" - -// A macro to free memory and zero out the pointer too -#define FREE_MEMORY(_mempointer_) \ - if (_mempointer_) \ - { \ - free(_mempointer_); \ - _mempointer_ = NULL; \ - } - -#define TO_STRING2(_data_) \ - #_data_ -#define TO_STRING(_data_) \ - TO_STRING2(_data_) - -/** - * Before calling the resource layer the caller needs to create and zero out - * a VmApiInternalContext and set the following fields: - * - * smMemoryGroupContext structure pointed to by the memContext field. That - * memory structure should also be zeroed out. - * - * --- Trace info --- - * Set a trace flags structure pointer using the global external name: - * extern struct _smtrace externSmapiTraceFlags; - * - * Ex: - * vmapiContext.smTraceDetails = (struct _smTrace *)&externSmapiTraceFlags; - * - * That structure can be zero'ed out for no tracing or flags set to trace - * a specific area. See smTraceAndError.h for constants. - * - * Note: The first socket init call will call readTraceFile and look for a - * file (TRACE_LEVELS_FILE) to read and set trace levels if any are found. - */ -#define FIRST_FAILURE_MESSAGE_MAX_LEN 250 -typedef struct _VmApiInternalContext { - char serverName[256]; - int pendingWorkunits[10]; - struct _smTrace * smTraceDetails; // Trace and error flags, locations, etc - char userid[9]; // Used for context creation default userID - char IucvUserid[9]; // SMAPI machine UserID. If this field is null, default is VSMREQIU - char useridForAsynchNotification[9]; // This is usually the Linux ID, can be any ID in SMAPI auth file - smMemoryGroupContext * memContext; - char vmapiServerVersion[4]; - int maxServerRpcVersion; - int contextCreatedFlag; // Set to 1 if context has been created - char strFirstFailureMsg[FIRST_FAILURE_MESSAGE_MAX_LEN + 1]; - int firstFailureCaptured; // 0: False - int rc; - int reason; - int printOffset; - int execDepth; - int isBackend; - int checkBackendFlag; - key_t semKey; - int semId; - FILE* logFileP; - FILE* contextFileP; - List inputStream; - List outputStream; - List errorStream; - char path[PATHLENGTH]; // Context path in ZVMMAP_VAR or defaulted - char name[256]; - char emsg[LINESIZE]; - char hostid[20]; - char password[9]; - int instanceId; - char tag[256]; - int resolveHostName; // To be moved to persistant later -} VmApiInternalContext; - -typedef struct _Abbreviation { - char* nameP; - int minimum; -} Abbreviation; - -// Internal data structure to keep minidisk data -typedef struct _Minidisk { - struct _Minidisk* nextP; - int address; - char type[8]; - int location; - int extent; - char volser[8]; - char mode[4]; - int processFlag; -} Minidisk; - -// Internal data structure to keep dedicate data -typedef struct _Dedicate { - struct _Dedicate* nextP; - int vnum; - int rnum; -} Dedicate; - -/** - * Macro: break_if_error(FUNC, CODE, SOCK) - * - * Purpose: After a socket function, this macro will display a msg using - * perror if the function FUNC fails with code CODE. Additionally, - * if the value of the socket SOCK is not -1, the socket will be - * closed. Finally, do the 'break' part, to break out of the - * current loop. - * - * Inputs: FUNC - String to be displayed along with with perror - * CODE - The return code to be tested for failure (< 0) - * SOCK - The socket descriptor to be close if not equal to -1 - */ -#ifndef break_if_error -#define break_if_error(FUNC,CODE,SOCK) { \ - if (CODE < 0) { \ - perror(#FUNC "() failed"); \ - if (SOCK != -1) { \ - close(SOCK); \ - SOCK = -1; \ - } \ - break; }} -#endif - -/** - * Macro: continue_if_error(FUNC, CODE, SOCK) - * - * Purpose: After a socket function, this macro will display a msg using - * perror if the function FUNC fails with code CODE. Additionally, - * if the value of the socket SOCK is not -1, the socket will be - * closed. Finally, do the 'continue' part, to iterate the - * current loop. - * - * Inputs: FUNC - String to be displayed along with with perror - * CODE - The return code to be tested for failure (< 0) - * SOCK - The socket descriptor to be close if not equal to -1 - * - */ -#ifndef continue_if_error -#define continue_if_error(FUNC,CODE,SOCK) { \ - if (CODE < 0) { \ - perror(#FUNC "() failed"); \ - if (SOCK != -1) { \ - close(SOCK); \ - SOCK = -1; \ - } \ - continue; }} -#endif - -/** - * Macro: exit_if_error(FUNC, CODE, SOCK) - * - * Purpose: After a socket function, this macro will display a msg using - * perror if the function FUNC fails with code CODE. Additionally, - * if the value of the socket SOCK is not -1, the socket will be - * closed. Finally, cause the 'return' to happen. - * - * Inputs: FUNC - String to be displayed along with with perror - * CODE - The return code to be tested for failure (< 0) - * SOCK - The socket descriptor to be close if not equal to -1 - */ -#ifndef exit_if_error -#define exit_if_error(FUNC,CODE,SOCK) { \ - if (CODE < 0) { \ - perror(#FUNC "() failed"); \ - if (SOCK != -1) { \ - close(SOCK); \ - SOCK = -1; \ - } \ - return; }} -#endif - -// Macros to retrieve or default argument -#define ARG(x) getArg(x,anArgc,anArgvPP,"") -#define ARG_DEFAULT(x,aDefaultP) getArg(x,anArgc,anArgvPP,aDefaultP) - -// Utility functions -int checkAbbreviation(const char* aStringP, - const Abbreviation* anAbbreviationListP, int anAbbreviationN); - -int checkBoolean(const char* aStringP); - -int checkPrefixCommand(const char* aCommandP); - -int initializeThreadSemaphores(struct _VmApiInternalContext* vmapiContextP, - const char* aContextNameP, int aCreateFlag); - -int createDirectories(const char* aFilenameP); - -void dumpArea(struct _VmApiInternalContext* vmapiContextP, void * pstor, - int len); - -Dedicate* getDedicates(); -Minidisk* getMinidisks(); - -int isOSA(struct _VmApiInternalContext* vmapiContextP, char* rdev); - -void listAppendLine(struct _VmApiInternalContext* vmapiContextP, List* aListP, - const char* aLineP); - -void listAppendRecord(List* aListP, Record* aRecordP); - -void listDeleteCurrent(List* aListP); - -Record* -listDequeueRecord(List* aListP); - -const char* -listNextLine(List* aListP); - -const Record* -listNextRecord(List* aListP); - -void listFree(List* aListP); - -void listReset(List* aListP); - -void readTraceFile(struct _VmApiInternalContext* vmapiContextP); - -void * -smMemoryGroupAlloc(struct _VmApiInternalContext* vmapiContextP, size_t size); - -int smMemoryGroupFreeAll(struct _VmApiInternalContext* vmapiContextP); - -int smMemoryGroupInitialize(struct _VmApiInternalContext* vmapiContextP); - -void * -smMemoryGroupRealloc(struct _VmApiInternalContext* vmapiContextP, void * chunk, - size_t size); - -int smMemoryGroupTerminate(struct _VmApiInternalContext* vmapiContextP); - -char* -strip(char* aLineP, char anOption, char aChar); - -void sysinfo(struct _VmApiInternalContext* vmapiContextP, int anArgc, - const char**anArgvPP); - -int testDigit(char aChar); - -const char* -vmApiMessageText(struct _VmApiInternalContext* vmapiContextP); - -int vmbkendCacheEntryInvalidate(struct _VmApiInternalContext* vmapiContextP, - char *pathP, char *useridP); - -int vmbkendCheck(struct _VmApiInternalContext* vmapiContextP); - -void vmbkendGetCachePath(struct _VmApiInternalContext* vmapiContextP, - char *pathP); - -void *vmbkendMain(void* vmapiContextP); - -int vmbkendRemoveCachedScanFiles(struct _VmApiInternalContext* vmapiContextP, - char *pathP); - -void vmbkendRemoveEntireCache(struct _VmApiInternalContext* vmapiContextP, - char *cachePathP); - -void waitForPendingWorkunits(struct _VmApiInternalContext* vmapiContextP, - int waitIntervalInSeconds); - -int cacheFileValid(struct _VmApiInternalContext* vmapiContextP, - const char* cFName); - -#include "smTraceAndError.h" - -#endif diff --git a/zhcp/BUILD/resource_access/include/smSocket.h b/zhcp/BUILD/resource_access/include/smSocket.h deleted file mode 100644 index 0d1ba7b..0000000 --- a/zhcp/BUILD/resource_access/include/smSocket.h +++ /dev/null @@ -1,16 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _SMSOCKET_H -#define _SMSOCKET_H -#include "smPublic.h" - -int smSocketInitialize(struct _VmApiInternalContext* vmapiContextP, - int * sockId); -int smSocketWrite(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * data, int dataLen); -int smSocketRead(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * buff, int len); -int smSocketReadLoop(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * buff, int len); -int smSocketTerminate(struct _VmApiInternalContext* vmapiContextP, int sockId); -#endif diff --git a/zhcp/BUILD/resource_access/include/smTraceAndError.h b/zhcp/BUILD/resource_access/include/smTraceAndError.h deleted file mode 100644 index 8faf779..0000000 --- a/zhcp/BUILD/resource_access/include/smTraceAndError.h +++ /dev/null @@ -1,137 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _SM_TRACE_H -#define _SM_TRACE_H -#include -#include -#include "smPublic.h" - -// Trace levels are to be powers of 2 to allow combinations of tracing -#define TRACE_LEVELS_FILE "vmmaptracing" -#define TRACE_LEVELS_FILE_DIRECTORY "/etc/opt/ibm/zvmmap/.cimvm/" - -// Make sure the level information matches the index in the TRACE_LEVELS and TRACE_FLAG_VALUES array below -#define TRACELEVEL_OFF 0 -#define TRACELEVEL_FLOW 1 -#define TRACELEVEL_PARAMETERS 2 -#define TRACELEVEL_DETAILS 4 -#define TRACELEVEL_BUFFER_OUT 256 // Unit test socket layer -#define TRACELEVEL_BUFFER_IN 512 // Unit test socket layer -#define TRACELEVEL_ALL 0x8FFFFFFF - -// Keywords for the trace file -#define TRACE_LEVELS_COUNT 7 -static const char * TRACE_LEVELS[TRACE_LEVELS_COUNT] = { "off", "flow", - "parms", "details", "buffout", "buffin", "all" }; - -static const unsigned int TRACE_FLAG_VALUES[TRACE_LEVELS_COUNT] = { 0, - TRACELEVEL_FLOW, TRACELEVEL_PARAMETERS, TRACELEVEL_DETAILS, - TRACELEVEL_BUFFER_OUT, TRACELEVEL_BUFFER_IN, TRACELEVEL_ALL }; - -// Trace areas index into trace array -#define TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD 0 -#define TRACEAREA_CIM_OPERATION_LAYER 1 -#define TRACEAREA_RESOURCE_LAYER 2 -#define TRACEAREA_RESOURCE_LAYER_SOCKET 3 -#define TRACEAREA_RESOURCE_LAYER_PARSER 4 -#define TRACEAREA_BACKGROUND_VMEVENT_NOTIFICATION_THREAD 5 -#define TRACEAREA_NAME_VALUE_PARSER 6 -#define TRACEAREA_CACHE 7 -#define TRACEAREA_SMAPI_ONLY 8 - -// Keywords for the trace areas -#define TRACE_AREAS_COUNT 9 -static const char * TRACE_KEYWORDS[TRACE_AREAS_COUNT] = { "directorychanges", - "cimop", "resourcelayer", "socket", "parser", "vmeventchanges", - "namevalueparser", "cache", "smapionly" }; - -typedef struct _smTrace { - unsigned int traceFlags[TRACE_AREAS_COUNT]; // A separate trace int for each area - int traceLock; - int traceFileRead; // 0 = trace file needs to be checked with "readTraceFile(" - unsigned int traceOutputLocation; // 0 = syslog - FILE * traceFilePointer; // 0 = no file open -} smTrace; - -/** - * Trace functions and constants for a line of data or a block of storage - */ - -// errorLog will save the return and reason code in the context and then -// call errorLine. -void errorLog(struct _VmApiInternalContext* vmapiContextP, - const char * functionName, const char * lineNumber, int aRc, - int aReason, const char* aLineP); - -// errorLine will call Logline with the "error" flag and then -// call listAppendLine to add a record to the context error stream -void errorLine(struct _VmApiInternalContext* vmapiContextP, const char* aLineP); - -// These severity contants get remapped to syslog constants in LogLine -#define LOGLINE_DEBUG 'D' -#define LOGLINE_ERR 'E' -#define LOGLINE_INFO 'I' -#define LOGLINE_NOTICE 'N' -#define LOGLINE_WARNING 'W' -#define LOGLINE_EXCEPTION 'X' - -// LogLine will add a timestamp and then write the data to the syslog. -void logLine(struct _VmApiInternalContext* vmapiContextP, char aSeverity, - const char* aLineP); - -void outputLine(struct _VmApiInternalContext* vmapiContextP, - const char* aLineP, int aLogFlag); - -// This macro can be used to test for a trace type being on before -// calling logLine. See logline description below. Follow the logLine -// call with the TRACE_END or TRACE_END_DEBUG to close out the braces -// logline with the LOGLINE_DEBUG will replace the old codes use of debugline. -#define TRACE_START(_context_ , _tracearea_, _tracelevel_) \ - if(((_context_)->smTraceDetails->traceFlags[_tracearea_])&_tracelevel_ ) \ - { - -#define TRACE_END } - -#define TRACE_END_DEBUG(_context_, _linedata_) \ - logLine(_context_, LOGLINE_DEBUG, _linedata_); \ - } - -// This macro can be used to trace entry into a function, -// the function name is supplied by the compiler -#define TRACE_ENTRY_FLOW(_context_ , _tracearea_) \ - TRACE_START(_context_, _tracearea_, TRACELEVEL_FLOW); \ - char _line_[LINESIZE]; \ - sprintf(_line_, \ - "%s function ENTRY (at line %d in %s) \n", \ - __func__, __LINE__, __FILE__); \ - logLine(_context_ ,LOGLINE_DEBUG, _line_); \ - } - -// This macro can be used to trace exit from a function, -// the function name is supplied by the compiler -// The context is expected to be a pointer -#define TRACE_EXIT_FLOW(_context_ , _tracearea_) \ - TRACE_START(_context_, _tracearea_, TRACELEVEL_FLOW); \ - char _line_[LINESIZE]; \ - sprintf(_line_, \ - "%s function EXIT. RC: %d RS: %d (at line %d in %s) \n", \ - __func__, \ - _context_->rc, \ - _context_->reason, __LINE__, __FILE__); \ - logLine(_context_ ,LOGLINE_DEBUG, _line_); \ - } - -// This macro can be used to trace exit from a CIM function where you specify the return code, -// the function name is supplied by the compiler -// The context is expected to be a pointer -#define TRACE_EXIT_CIM_FLOW(_context_ , _tracearea_ , _rc_) \ - TRACE_START(_context_, _tracearea_, TRACELEVEL_FLOW); \ - char _line_[LINESIZE]; \ - sprintf(_line_, \ - "%s function EXIT. RC: %d (at line %d in %s) \n", \ - __func__, \ - _rc_, __LINE__, __FILE__); \ - logLine(_context_ ,LOGLINE_DEBUG, _line_); \ - } - -#endif diff --git a/zhcp/BUILD/resource_access/include/smapiTableParser.h b/zhcp/BUILD/resource_access/include/smapiTableParser.h deleted file mode 100644 index e5b77ea..0000000 --- a/zhcp/BUILD/resource_access/include/smapiTableParser.h +++ /dev/null @@ -1,213 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_PARSER_ROUTINE_H -#define _VMAPI_PARSER_ROUTINE_H - -#include -#include -#include -#include "smPublic.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// This structure typedef is used for the common information returned by -// the SMAPI -typedef struct _commonOutputFields { - int requestId; - int returnCode; - int reasonCode; -} commonOutputFields; - -// This structure is used to handle unknown number of zero terminated data -// returned by the SMAPI. Array notation can be used to subscript the strings. -typedef struct _vmApiCStringInfo { - char * vmapiString; -} vmApiCStringInfo; - -/** - * Parser table general layout: - * Columns are: Type, min, max, output structure unique index number, nesting level, - * offset in output structure (or size of output structure) - * - * Min and max only apply to string length items, and arrays - * - * NOTE: - * Each type has the following requirements: - * - * APITYPE_BASE_STRUCT_LEN Column 4 must be STRUCT_INDX_0, column 6 is size of structure - * APITYPE_INTn Column 4 must have the structure index, column 6 contains the offset to store this value into - * APITYPE_STRING_LEN Column 2 must have the minimum string length, column 3 must have the maximum length or -1 if no max - * Column 4 must have the structure index, column 6 contains the offset to store this string into - * If a single zero terminated string is returned in the buffer; then use - * APITYPE_C_STR_PTR Column 2 must have the minimum string length, column 3 must have the maximum length or -1 if no max - * Column 4 must have the structure index, column 6 contains the offset to store this string into - * - * APITYPE_CHARBUF_LEN Column 2 must have the minimum charaters length, column 3 must have the maximum length or -1 if no max - * Column 4 must have the structure index, column 6 contains the offset to store this charater buffer pointer into - * APITYPE_CHARBUF_COUNT Column 4 must have the structure index, column 6 contains the offset to store the count into - * (CHARBUF_LEN must have a ..COUNT as the next table entry) - * - * APITYPE_ARRAY_LEN Column 4 must have the structure index, column 6 contains the offset to - * store the pointer to first array element at. - * APITYPE_ARRAY_STRUCT_COUNT Column 4 must have the structure index, column 6 contains the offset to store the count into - * APITYPE_STRUCT_LEN or APITYPE_NOBUFFER_STRUCT_LEN - * Column 5 must have the size of the output structure - * (ARRAY must have STRUCT following; STRUCT_COUNT must have a ..LEN as the next table entry) - * APITYPE_NOBUFFER_STRUCT_LEN is used when the SMAPI buffer does not have a structure size - * after the array size in the returned data. (The data is an array of strings vs array of structures) - * - * When the SMAPI buffer has many zero terminated strings as output: (use the next 4 types in that order) - * The vmApiCStringInfo structure can be used to hold each string. - * APITYPE_C_STR_ARRAY_PTR Column 4 must have the parent structure index, column 6 contains - * the offset to store the pointer to first string in the array at. - * APITYPE_C_STR_ARRAY_COUNT Column 4 must have the structure index which hold the count field, column 6 contains the offset to store the count into - * APITYPE_C_STR_STRUCT_LEN Column 5 must have the size of the output structure (vmApiCStringInfo) - * APITYPE_C_STR_PTR Column 5 must have the offset in the C string structure of the char * - * - * APITYPE_END_OF_TABLE Must be used to end the table - * - * Note: use CHARBUF for strings that can contain nulls (CHARNA in zVM API data types) - * - * Ex: - * static tableLayout Imalge_Activate_Layout = - * { - * {APITYPE_BASE_STRUCT_LEN, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,sizeof(VmApiImageActivateOutput) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,common.requestId) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,common.returnCode)}, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,common.reasonCode)}, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,activated) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,notActivated) }, - * - * {APITYPE_ARRAY_LEN, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,failList) }, - * {APITYPE_ARRAY_STRUCT_COUNT,4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,failingArrayCount)}, - * {APITYPE_STRUCT_LEN, 4,4,STRUCT_INDX_1,NEST_LEVEL_1,sizeof(VmApiImageFailing) }, - * {APITYPE_STRING_LEN, 1,8,STRUCT_INDX_1,NEST_LEVEL_1,offsetof(VmApiImageFailing,imageName) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_1,NEST_LEVEL_1,offsetof(VmApiImageFailing,returnCode) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_1,NEST_LEVEL_1,offsetof(VmApiImageFailing,reasonCode) }, - * {APITYPE_END_OF_TABLE,0,0,0,0} - * }; - */ -#define APITYPE_END_OF_TABLE 0 -#define APITYPE_INT1 1 -#define APITYPE_INT4 2 -#define APITYPE_INT8 3 - -#define APITYPE_STRING_LEN 20 -#define APITYPE_ARRAY_LEN 21 -#define APITYPE_ARRAY_STRUCT_COUNT 22 -#define APITYPE_STRUCT_LEN 23 -#define APITYPE_NOBUFFER_STRUCT_LEN 24 -#define APITYPE_CHARBUF_LEN 25 -#define APITYPE_CHARBUF_COUNT 26 -#define APITYPE_C_STR_ARRAY_PTR 30 -#define APITYPE_C_STR_ARRAY_COUNT 31 -#define APITYPE_C_STR_STRUCT_LEN 32 -#define APITYPE_C_STR_PTR 33 -#define APITYPE_BASE_STRUCT_LEN 98 - -#define STRUCT_INDX_0 0 -#define STRUCT_INDX_1 1 -#define STRUCT_INDX_2 2 -#define STRUCT_INDX_3 3 -#define STRUCT_INDX_4 4 -#define STRUCT_INDX_5 5 -#define STRUCT_INDX_6 6 -#define STRUCT_INDX_7 7 -#define STRUCT_INDX_8 8 -#define STRUCT_INDX_9 9 -#define STRUCT_INDX_10 10 - -#define NEST_LEVEL_0 0 -#define NEST_LEVEL_1 1 -#define NEST_LEVEL_2 2 -#define NEST_LEVEL_3 3 - -#define MAX_STRUCT_ARRAYS 10 - -#define COL_1_TYPE 0 -#define COL_2_MINSIZE 1 -#define COL_3_MAXSIZE 2 -#define COL_4_STRUCT_INDEX 3 -#define COL_5_NEST_LEVEL 4 -#define COL_6_SIZE_OR_OFFSET 5 - -enum tableParserModes { - scan, populate -}; - -typedef int tableLayout[][6]; - -/** - * Input/output structure for use by smapiTableParser parseBufferWithTable() - * - * - smapiBufferCursor must be set to the start of the SMAPI data - * - dataBufferSize must be set to the total size of the SMAPI data - * - byteCount is used by parseBufferWithTable as a work variable - * - outStringByteCount will be set in "scan" mode to the number of bytes needed for all the - * strings found in the SMAPI data - * - outStructCount array will be set in "scan" mode to the number of structures found at each - * level - * - outStructSizes array will be set in "scan" mode to the size of 1 structure - * - inStructAddrs array must be set in "populate" mode to the starting address of the first - * structure at each level - * - inStringCursor must be set in "populate" mode to the start of the storage block for use in - * string allocation. - */ -typedef struct _tableParserParms { - char * smapiBufferCursor; // Input for SCAN and POPULATE. Initially set to output buffer. - int dataBufferSize; // Input for SCAN and POPULATE, size of SMAPI output buffer - int byteCount; // Bytes processed from SMAPI returned data buffer - int outStringByteCount; // Output parm from SCAN - int outStructCount[MAX_STRUCT_ARRAYS]; // Output parm from SCAN - int outStructSizes[MAX_STRUCT_ARRAYS]; // Output parm from SCAN - void * inStructAddrs[MAX_STRUCT_ARRAYS];// Input parm for POPULATE - char * inStringCursor; // Input string block pointer for POPULATE -} tableParserParms; - -#define PARSER_ERROR_INVALID_TABLE -4002 -#define PARSER_ERROR_INVALID_STRING_SIZE -4003 - -#define ntohll(x) (((unsigned long long)(ntohl((int)((x << 32) >> 32))) << 32) | (unsigned int)ntohl(((int)(x >> 32)))) -#define htonll(x) ntohll(x) - -#define PUT_INT(_inInt_,_outBuf_) \ - ({ int _int; \ - _int = htonl(_inInt_) ; \ - memcpy(_outBuf_, &_int, 4); \ - _outBuf_ += 4; \ - }) - -#define GET_INT(_outInt_,_inBuf_) \ - ({ int _int; \ - memcpy(&_int, _inBuf_, 4); \ - _outInt_ = ntohl(_int) ; \ - _inBuf_ += 4; \ - }) - -#define PUT_64INT(_in64Int_,_outBuf_) \ - ({ long long _64int; \ - _64int = htonll(_in64Int_) ; \ - memcpy(_outBuf_, &_64int, 8); \ - _outBuf_ += 8; \ - }) - -#define GET_64INT(_out64Int_,_inBuf_) \ - ({ long long _64int; \ - memcpy(&_64int, _inBuf_, 8); \ - _out64Int_ = ntohll(_64int) ; \ - _inBuf_ += 8; \ - }) - -int parseBufferWithTable(struct _VmApiInternalContext* vmapiContextP, - enum tableParserModes mode, tableLayout table, tableParserParms *parms); - -int getAndParseSmapiBuffer(struct _VmApiInternalContext* vmapiContextP, - char * * inputBufferPointerPointer, int inputBufferSize, - tableLayout parserTable, char * parserTableName, char * * outData); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiAsynchronous.h b/zhcp/BUILD/resource_access/include/vmapiAsynchronous.h deleted file mode 100644 index 937c6b4..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiAsynchronous.h +++ /dev/null @@ -1,129 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_ASYNCHRONOUS_H -#define _VMAPI_ASYNCHRONOUS_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Asynchronous_Notification_Disable_DM -typedef commonOutputFields vmApiAsynchronousNotificationDisableDmOutput; - -// Parser table for Asynchronous_Notification_Disable_DM -static tableLayout Asynchronous_Notification_Disable_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAsynchronousNotificationDisableDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationDisableDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationDisableDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationDisableDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAsynchronous_Notification_Disable_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char communication_type, int port_number, - char * ip_address, char encoding, int subscriber_data_length, - char * subscriber_data, - vmApiAsynchronousNotificationDisableDmOutput ** outData); - -// Asynchronous_Notification_Enable_DM -typedef commonOutputFields vmApiAsynchronousNotificationEnableDmOutput; - -// Parser table for Asynchronous_Notification_Enable_DM -static tableLayout Asynchronous_Notification_Enable_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAsynchronousNotificationEnableDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationEnableDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationEnableDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationEnableDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAsynchronous_Notification_Enable_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char subscription_type, char communication_type, - int port_number, char * ip_address, char encoding, - int subscriber_data_length, char * subscriber_data, - vmApiAsynchronousNotificationEnableDmOutput ** outData); - -// Asynchronous_Notification_Query_DM -typedef struct _vmApiNotification { // Common structure used by Asynchronous_Notification_Query - char * userid; - char subscriptionType; - char communicationType; - int portNumber; - char * ipAddress; - char encoding; - int subscriberDataLength; - char * subscriberData; -} vmApiNotification; - -typedef struct _vmApiAsynchronousNotificationQueryDmOutput { - commonOutputFields common; - int notificationCount; - vmApiNotification * notificationList; -} vmApiAsynchronousNotificationQueryDmOutput; - -// Parser table for Asynchronous_Notification_Query_DM -static tableLayout - Asynchronous_Notification_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAsynchronousNotificationQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationQueryDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationQueryDmOutput, - common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiAsynchronousNotificationQueryDmOutput, - notificationList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationQueryDmOutput, - notificationCount) }, { APITYPE_STRUCT_LEN, 4, - 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiNotification) }, { APITYPE_STRING_LEN, 4, - 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiNotification, userid) }, { APITYPE_INT1, - 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiNotification, subscriptionType) }, { - APITYPE_INT1, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiNotification, communicationType) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiNotification, portNumber) }, { - APITYPE_STRING_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiNotification, ipAddress) }, { - APITYPE_INT1, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiNotification, encoding) }, { - APITYPE_CHARBUF_LEN, 0, 64, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiNotification, - subscriberData) }, { APITYPE_CHARBUF_COUNT, 0, - 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiNotification, subscriberDataLength) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAsynchronous_Notification_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char communication_type, int port_number, - char * ip_address, char encoding, int subscriber_data_length, - char * subscriber_data, - vmApiAsynchronousNotificationQueryDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiAuthorization.h b/zhcp/BUILD/resource_access/include/vmapiAuthorization.h deleted file mode 100644 index 9ed6bcc..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiAuthorization.h +++ /dev/null @@ -1,106 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_AUTHORIZATION_H -#define _VMAPI_AUTHORIZATION_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Authorization_List_Add -typedef commonOutputFields vmApiAuthorizationListAddOutput; - -// Parser table for Authorization_List_Add -static tableLayout Authorization_List_Add_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAuthorizationListAddOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiAuthorizationListAddOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiAuthorizationListAddOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListAddOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAuthorization_List_Add(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListAddOutput ** outData); - -// Authorization_List_Query -typedef struct _vmApiAuthorizationRecord { // Common structure used by Authorization_List_Query - char * requestingUserid; - char requestingListIndicator; - char * forUserid; - char forListIndicator; - char * functionName; - char functionListIndicator; -} vmApiAuthorizationRecord; - -typedef struct _vmApiAuthorizationListQueryOutput { - commonOutputFields common; - int authorizationRecordCount; - vmApiAuthorizationRecord * authorizationRecordList; -} vmApiAuthorizationListQueryOutput; - -// Parser table for Authorization_List_Query -static tableLayout Authorization_List_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAuthorizationListQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListQueryOutput, authorizationRecordList) }, - { APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiAuthorizationListQueryOutput, - authorizationRecordCount) }, { APITYPE_STRUCT_LEN, 4, - 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiAuthorizationRecord) }, { APITYPE_STRING_LEN, 1, - 64, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiAuthorizationRecord, requestingUserid) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiAuthorizationRecord, requestingListIndicator) }, { - APITYPE_STRING_LEN, 1, 64, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiAuthorizationRecord, forUserid) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiAuthorizationRecord, forListIndicator) }, { - APITYPE_STRING_LEN, 1, 64, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiAuthorizationRecord, functionName) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiAuthorizationRecord, functionListIndicator) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAuthorization_List_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListQueryOutput ** outData); - -// Authorization_List_Remove -typedef commonOutputFields vmApiAuthorizationListRemoveOutput; - -// Parser table for Authorization_List_Remove -static tableLayout Authorization_List_Remove_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAuthorizationListRemoveOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListRemoveOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListRemoveOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListRemoveOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAuthorization_List_Remove(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListRemoveOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiCheckAuthentication.h b/zhcp/BUILD/resource_access/include/vmapiCheckAuthentication.h deleted file mode 100644 index 09c6439..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiCheckAuthentication.h +++ /dev/null @@ -1,34 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_CHECK_AUTHENTICATION_H -#define _VMAPI_CHECK_AUTHENTICATION_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Check_Authentication -typedef commonOutputFields vmApiCheckAuthenticationOutput; - -// Parser table for Check_Authentication -static tableLayout Check_Authentication_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiCheckAuthenticationOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiCheckAuthenticationOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiCheckAuthenticationOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiCheckAuthenticationOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smCheck_Authentication(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - vmApiCheckAuthenticationOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiDirectoryManager.h b/zhcp/BUILD/resource_access/include/vmapiDirectoryManager.h deleted file mode 100644 index 791153c..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiDirectoryManager.h +++ /dev/null @@ -1,172 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_DIRECTORY_MANAGER_H -#define _VMAPI_DIRECTORY_MANAGER_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Directory_Manager_Local_Tag_Define_DM -typedef commonOutputFields vmApiDirectoryManagerLocalTagDefineDmOutput; - -// Parser table for Directory_Manager_Local_Tag_Define_DM -static tableLayout Directory_Manager_Local_Tag_Define_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerLocalTagDefineDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDefineDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDefineDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDefineDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smDirectory_Manager_Local_Tag_Define_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, int tag_ordinal, char createOrChange, - vmApiDirectoryManagerLocalTagDefineDmOutput ** outData); - -// Directory_Manager_Local_Tag_Delete_DM -typedef commonOutputFields vmApiDirectoryManagerLocalTagDeleteDmOutput; - -// Parser table for Directory_Manager_Local_Tag_Delete_DM -static tableLayout Directory_Manager_Local_Tag_Delete_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerLocalTagDeleteDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDeleteDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int - smDirectory_Manager_Local_Tag_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, - vmApiDirectoryManagerLocalTagDeleteDmOutput ** outData); - -// Directory_Manager_Local_Tag_Query_DM -typedef struct _vmApiDirectoryManagerLocalTagQueryDmOutput { - commonOutputFields common; - int tagValueLength; - char * tagValue; -} vmApiDirectoryManagerLocalTagQueryDmOutput; - -// Parser table for Directory_Manager_Local_Tag_Query_DM -static tableLayout - Directory_Manager_Local_Tag_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerLocalTagQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagQueryDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagQueryDmOutput, - common.reasonCode) }, - { APITYPE_CHARBUF_LEN, 1, 240, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiDirectoryManagerLocalTagQueryDmOutput, - tagValue) }, { APITYPE_CHARBUF_COUNT, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagQueryDmOutput, - tagValueLength) }, { APITYPE_END_OF_TABLE, 0, - 0, 0, 0 } }; -int smDirectory_Manager_Local_Tag_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, vmApiDirectoryManagerLocalTagQueryDmOutput ** outData); - -// Directory_Manager_Local_Tag_Set_DM -typedef commonOutputFields vmApiDirectoryManagerLocalTagSetDmOutput; - -// Parser table for Directory_Manager_Local_Tag_Set_DM -static tableLayout Directory_Manager_Local_Tag_Set_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerLocalTagSetDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagSetDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagSetDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagSetDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smDirectory_Manager_Local_Tag_Set_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, int tag_value_length, char * tag_value, - vmApiDirectoryManagerLocalTagSetDmOutput ** outData); - -// Directory_Manager_Search_DM -typedef struct _vmApiDirectoryManagerStatement { // Common structure used by Directory_Manager_Search - char * targetId; - int statementLength; - char * statement; -} vmApiDirectoryManagerStatement; - -typedef struct _vmApiDirectoryManagerSearchDmOutput { - commonOutputFields common; - int statementCount; - vmApiDirectoryManagerStatement * statementList; -} vmApiDirectoryManagerSearchDmOutput; - -// Parser table for Directory_Manager_Search_DM -static tableLayout Directory_Manager_Search_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerSearchDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerSearchDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerSearchDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerSearchDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerSearchDmOutput, statementList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiDirectoryManagerSearchDmOutput, statementCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiDirectoryManagerStatement) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiDirectoryManagerStatement, - targetId) }, { APITYPE_CHARBUF_LEN, 1, 72, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiDirectoryManagerStatement, statement) }, { - APITYPE_CHARBUF_COUNT, 0, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiDirectoryManagerStatement, statementLength) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smDirectory_Manager_Search_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int search_pattern_length, - char * search_pattern, vmApiDirectoryManagerSearchDmOutput ** outData); - -// Directory_Manager_Task_Cancel_DM -typedef commonOutputFields vmApiDirectoryManagerTaskCancelDmOutput; - -// Parser table for Directory_Manager_Task_Cancel_DM -static tableLayout Directory_Manager_Task_Cancel_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerTaskCancelDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerTaskCancelDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerTaskCancelDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerTaskCancelDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smDirectory_Manager_Task_Cancel_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - int operation_id, vmApiDirectoryManagerTaskCancelDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiImage.h b/zhcp/BUILD/resource_access/include/vmapiImage.h deleted file mode 100644 index 0d4fef5..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiImage.h +++ /dev/null @@ -1,1252 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_IMAGE_H -#define _VMAPI_IMAGE_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Image_Activate -typedef struct _vmApiImageFailing { // Common structure for Image_Activate, Image_Deactivate, Image_Recycle - char * imageName; - int returnCode; - int reasonCode; -} vmApiImageFailing; - -typedef struct _vmApiImageActivate { - commonOutputFields common; - int activated; - int notActivated; - int failingArrayCount; - vmApiImageFailing * failList; -} vmApiImageActivateOutput; - -int smImage_Activate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageActivateOutput ** outData); - -// Parser table for Image_Activate -static tableLayout Image_Activate_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageActivateOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActivateOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageActivateOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageActivateOutput, common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActivateOutput, activated) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageActivateOutput, - notActivated) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActivateOutput, failList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageActivateOutput, failingArrayCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageFailing) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageFailing, - imageName) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiImageFailing, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Image_Active_Configuration_Query -typedef struct _vmApiImageCpuInfo // This struct is shared with Image CPU query also -{ - int cpuNumber; // Or address - char * cpuId; - char cpuBase; // Only supplied for Image_CPU_Query - char cpuStatus; - char cpuType; // Only supplied for Image_CPU_Query -} vmApiImageCpuInfo; - -typedef struct _vmApiImageDeviceInfo { - char deviceType; - char * deviceAddress; -} vmApiImageDeviceInfo; - -typedef struct _vmApiImageActiveConfigurationQuery { - commonOutputFields common; - int memorySize; - char memoryUnit; - char shareType; - char * shareValue; - int numberOfCpus; - int cpuInfoCount; - vmApiImageCpuInfo * cpuList; - int deviceCount; - vmApiImageDeviceInfo * deviceList; -} vmApiImageActiveConfigurationQueryOutput; - -int smImage_Active_Configuration_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageActiveConfigurationQueryOutput ** outData); - -// Parser table for Image_Active_Configuration_Query -static tableLayout - Image_Active_Configuration_Query_Layout = { - { APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageActiveConfigurationQueryOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - common.requestId) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - common.returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, memorySize) }, - { APITYPE_INT1, 1, 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, memoryUnit) }, - { APITYPE_INT1, 1, 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, shareType) }, - { APITYPE_STRING_LEN, 1, 5, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageActiveConfigurationQueryOutput, - shareValue) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - numberOfCpus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageActiveConfigurationQueryOutput, - cpuList) }, { APITYPE_ARRAY_STRUCT_COUNT, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - cpuInfoCount) }, - { APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageCpuInfo) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageCpuInfo, cpuNumber) }, { - APITYPE_STRING_LEN, 1, 16, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiImageCpuInfo, cpuId) }, { APITYPE_INT1, - 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageCpuInfo, cpuStatus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageActiveConfigurationQueryOutput, - deviceList) }, { APITYPE_ARRAY_STRUCT_COUNT, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - deviceCount) }, { APITYPE_STRUCT_LEN, 4, 4, - STRUCT_INDX_2, NEST_LEVEL_1, - sizeof(vmApiImageDeviceInfo) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_2, NEST_LEVEL_1, offsetof( - vmApiImageDeviceInfo, deviceType) }, { - APITYPE_STRING_LEN, 4, 16, STRUCT_INDX_2, NEST_LEVEL_1, - offsetof(vmApiImageDeviceInfo, deviceAddress) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Image_CPU_Define -typedef commonOutputFields vmApiImageCpuDefineOutput; - -// Parser table for Image_CPU_Define -static tableLayout Image_CPU_Define_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuDefineOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDefineOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuDefineOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuDefineOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Define(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, char cpuType, - vmApiImageCpuDefineOutput ** outData); - -// Image_CPU_Define_DM -typedef commonOutputFields vmApiImageCpuDefineDmOutput; - -// Parser table for Image_CPU_Define_DM -static tableLayout Image_CPU_Define_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuDefineDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDefineDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDefineDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDefineDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Define_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, char baseCpu, char * cpuId, - char dedicateCpu, char cryptoCpu, - vmApiImageCpuDefineDmOutput ** outData); - -// Image_CPU_Delete -typedef commonOutputFields vmApiImageCpuDeleteOutput; - -// Parser table for Image_CPU_Delete -static tableLayout Image_CPU_Delete_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuDeleteOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDeleteOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuDeleteOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuDeleteOutput ** outData); - -// Image_CPU_Delete_DM -typedef commonOutputFields vmApiImageCpuDeleteDmOutput; - -// Parser table for Image_CPU_Delete_DM -static tableLayout Image_CPU_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuDeleteDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDeleteDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuDeleteDmOutput ** outData); - -// Image_CPU_Query -typedef struct _vmApiImageCpuQuery { - commonOutputFields common; - int numberOfCpus; - int cpuInfoCount; - vmApiImageCpuInfo * cpuList; -} vmApiImageCpuQueryOutput; - -int smImage_CPU_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageCpuQueryOutput ** outData); - -// Parser table for Image_CPU_Query -static tableLayout Image_CPU_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuQueryOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuQueryOutput, common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryOutput, numberOfCpus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryOutput, cpuList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageCpuQueryOutput, cpuInfoCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageCpuInfo) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageCpuInfo, - cpuNumber) }, - { APITYPE_STRING_LEN, 1, 16, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageCpuInfo, cpuId) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageCpuInfo, - cpuBase) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiImageCpuInfo, cpuStatus) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageCpuInfo, cpuType) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Image_CPU_Query_DM -typedef struct _vmApiImageCpuQueryDm { - commonOutputFields common; - char * cpuAddress; - char baseCpu; - char * cpuId; - char cpuDedicate; - char cpuCrypto; -} vmApiImageCpuQueryDmOutput; - -int smImage_CPU_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuQueryDmOutput ** outData); - -// Parser table for Image_CPU_Query_DM -static tableLayout Image_CPU_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, common.reasonCode) }, { - APITYPE_STRING_LEN, 1, 2, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, cpuAddress) }, { APITYPE_INT1, 1, - 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuQueryDmOutput, - baseCpu) }, { APITYPE_STRING_LEN, 0, 6, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuQueryDmOutput, cpuId) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, cpuDedicate) }, { APITYPE_INT1, 1, - 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuQueryDmOutput, - cpuCrypto) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Image_CPU_Set_Maximum_DM -typedef commonOutputFields vmApiImageCpuSetMaximumDmOutput; - -// Parser table for Image_CPU_Set_Maximum_DM -static tableLayout Image_CPU_Set_Maximum_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageCpuSetMaximumDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuSetMaximumDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuSetMaximumDmOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuSetMaximumDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Set_Maximum_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int maxCpus, - vmApiImageCpuSetMaximumDmOutput ** outData); - -// Image_Create_DM -typedef struct _vmApiImageRecord { // Common structure used by Image_Create_Dm and Image_Query_DM and Image_Replace_DM - int imageRecordLength; - char * imageRecord; -} vmApiImageRecord; - -typedef struct _vmApiImageCreateDm { - commonOutputFields common; - int operationId; -} vmApiImageCreateDmOutput; - -// Parser table for Image_Create_DM -static tableLayout Image_Create_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCreateDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCreateDmOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCreateDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCreateDmOutput, common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCreateDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int - smImage_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * prototypeName, - int initialPasswordLength, char * initialPassword, - char * initialAccountNumber, int imageRecordCount, - vmApiImageRecord * imageRecordList, - vmApiImageCreateDmOutput ** outData); - -// Image_Deactivate -typedef struct _vmApiImageDeactivate { - commonOutputFields common; - int deactivated; - int notDeactivated; - int failingArrayCount; - vmApiImageFailing * failList; // Reuse structure from Image_Activate -} vmApiImageDeactivateOutput; - -// Parser table for Image_Deactivate -static tableLayout Image_Deactivate_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDeactivateOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, deactivated) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeactivateOutput, - notDeactivated) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, failList) }, { APITYPE_ARRAY_STRUCT_COUNT, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeactivateOutput, - failingArrayCount) }, { APITYPE_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiImageFailing) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, imageName) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageFailing, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, reasonCode) }, { APITYPE_END_OF_TABLE, 0, 0, - 0, 0 } }; - -int smImage_Deactivate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * forceTimeLength, - vmApiImageDeactivateOutput ** outData); - -// Image_Delete_DM -typedef struct _vmApiImageDeleteDm { - commonOutputFields common; - int operationId; -} vmApiImageDeleteDmOutput; - -// Parser table for Image_Delete_DM -static tableLayout Image_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDeleteDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeleteDmOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeleteDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDeleteDmOutput, common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeleteDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char dataSecurityErase, - vmApiImageDeleteDmOutput ** outData); - -// Image_Device_Dedicate -typedef commonOutputFields vmApiImageDeviceDedicateOutput; - -// Parser table for Image_Device_Dedicate -static tableLayout Image_Device_Dedicate_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDeviceDedicateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeviceDedicateOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDeviceDedicateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceDedicateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smImage_Device_Dedicate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - char * realDeviceNumber, char readonly, - vmApiImageDeviceDedicateOutput ** outData); - -// Image_Device_Dedicate_DM -typedef commonOutputFields vmApiImageDeviceDedicateDmOutput; - -// Parser table for Image_Device_Dedicate_DM -static tableLayout Image_Device_Dedicate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDeviceDedicateDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeviceDedicateDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDeviceDedicateDmOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceDedicateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Device_Dedicate_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - char * realDeviceNumber, char readonly, - vmApiImageDeviceDedicateDmOutput ** outData); - -// Image_Device_Reset -typedef commonOutputFields vmApiImageDeviceResetOutput; - -// Parser table for Image_Device_Reset -static tableLayout Image_Device_Reset_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDeviceResetOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceResetOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceResetOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceResetOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Device_Reset(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceResetOutput ** outData); - -// Image_Device_Undedicate -typedef commonOutputFields vmApiImageDeviceUndedicateOutput; - -// Parser table for Image_Device_Undedicate -static tableLayout Image_Device_Undedicate_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDeviceUndedicateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeviceUndedicateOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDeviceUndedicateOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceUndedicateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Device_Undedicate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceUndedicateOutput ** outData); - -// Image_Device_Undedicate_DM -typedef commonOutputFields vmApiImageDeviceUndedicateDmOutput; - -// Parser table for Image_Device_Undedicate_DM -static tableLayout Image_Device_Undedicate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDeviceUndedicateDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceUndedicateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceUndedicateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceUndedicateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Device_Undedicate_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceUndedicateDmOutput ** outData); - -// Image_Disk_Copy -typedef commonOutputFields vmApiImageDiskCopyOutput; - -// Parser table for Image_Disk_Copy -static tableLayout Image_Disk_Copy_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskCopyOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskCopyOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskCopyOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Copy(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskCopyOutput ** outData); - -// Image_Disk_Copy_DM -typedef struct _vmApiImageDiskCopyDm { - commonOutputFields common; - int operationId; -} vmApiImageDiskCopyDmOutput; - -// Parser table for Image_Disk_Copy_DM -static tableLayout Image_Disk_Copy_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskCopyDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyDmOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Copy_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * sourceImageName, char * sourceImageDiskNumber, - char * imageDiskAllocationType, char * allocationAreaName, - char * imageDiskMode, char * readPassword, char * writePassword, - char * multiPassword, vmApiImageDiskCopyDmOutput ** outData); - -// Image_Disk_Create -typedef commonOutputFields vmApiImageDiskCreateOutput; - -// Parser table for Image_Disk_Create -static tableLayout Image_Disk_Create_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskCreateOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskCreateOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, char * imageDiskMode, - vmApiImageDiskCreateOutput ** outData); - -// Image_Disk_Create_DM -typedef struct _vmApiImageDiskCreateDm { - commonOutputFields common; - int operationId; -} vmApiImageDiskCreateDmOutput; - -// Parser table for Image_Disk_Create_DM -static tableLayout Image_Disk_Create_DM_Layout = { - { APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDiskCreateDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateDmOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * imageDiskDeviceType, char * imageDiskAllocationType, - char * allocationAreaNameOrVolser, char allocationUnitSize, - int imageDiskSize, char * imageDiskMode, char imageDiskFormatting, - char * imageDiskLabel, char * readPassword, char * writePassword, - char * multiPassword, vmApiImageDiskCreateDmOutput ** outData); - -// Image_Disk_Delete -typedef commonOutputFields vmApiImageDiskDeleteOutput; - -// Parser table for Image_Disk_Delete -static tableLayout Image_Disk_Delete_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskDeleteOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskDeleteOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskDeleteOutput ** outData); - -// Image_Disk_Delete_DM -typedef struct _vmApiImageDiskDeleteDm { - commonOutputFields common; - int operationId; -} vmApiImageDiskDeleteDmOutput; - -// Parser table for Image_Disk_Delete_DM -static tableLayout Image_Disk_Delete_DM_Layout = { - { APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDiskDeleteDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteDmOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char dataSecurityErase, vmApiImageDiskDeleteDmOutput ** outData); - -// Image_Disk_Share -typedef commonOutputFields vmApiImageDiskShareOutput; - -// Parser table for Image_Disk_Share -static tableLayout Image_Disk_Share_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskShareOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskShareOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskShareOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskShareOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Share(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - char * readWriteMode, char * optionalPassword, - vmApiImageDiskShareOutput ** outData); - -// Image_Disk_Share_DM -typedef commonOutputFields vmApiImageDiskShareDmOutput; - -// Parser table for Image_Disk_Share_DM -static tableLayout Image_Disk_Share_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskShareDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskShareDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskShareDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskShareDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Share_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - char * readWriteMode, char * optionalPassword, - vmApiImageDiskShareDmOutput ** outData); - -// Image_Disk_Unshare -typedef commonOutputFields vmApiImageDiskUnshareOutput; - -// Parser table for Image_Disk_Unshare -static tableLayout Image_Disk_Unshare_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskUnshareOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskUnshareOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskUnshareOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskUnshareOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Unshare(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskUnshareOutput ** outData); - -// Image_Disk_Unshare_DM -typedef commonOutputFields vmApiImageDiskUnshareDmOutput; - -// Parser table for Image_Disk_Unshare_DM -static tableLayout Image_Disk_Unshare_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDiskUnshareDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskUnshareDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskUnshareDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskUnshareDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Unshare_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - vmApiImageDiskUnshareDmOutput ** outData); - -// Image_IPL_Delete_DM -typedef commonOutputFields vmApiImageIplDeleteDmOutput; - -// Parser table for IMAGE_IPL_Delete_DM -static tableLayout Image_IPL_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageIplDeleteDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplDeleteDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_IPL_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageIplDeleteDmOutput ** outData); - -// Image_IPL_Device_Query -typedef struct _vmApiImageIplDeviceQueryOutput { - commonOutputFields common; - char * iplDevice; -} vmApiImageIplDeviceQueryOutput; - -// Parser table for Image_IPL_Device_Query -static tableLayout Image_IPL_Device_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageIplDeviceQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageIplDeviceQueryOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageIplDeviceQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageIplDeviceQueryOutput, - common.reasonCode) }, { APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageIplDeviceQueryOutput, iplDevice) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_IPL_Device_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, vmApiImageIplDeviceQueryOutput ** outData); - -// Image_IPL_Query_DM -typedef struct _vmApiImageIplQueryDm { - commonOutputFields common; - char * savedSystem; - char * loadParameter; - char * parameters; -} vmApiImageIplQueryDmOutput; - -// Parser table for Image_IPL_Query_DM -static tableLayout Image_IPL_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageIplQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, common.reasonCode) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, savedSystem) }, { - APITYPE_STRING_LEN, 0, 10, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, loadParameter) }, { - APITYPE_STRING_LEN, 0, 64, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, parameters) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_IPL_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageIplQueryDmOutput ** outData); - -// Image_IPL_Set_DM -typedef commonOutputFields vmApiImageIplSetDmOutput; - -// Parser table for Image_IPL_Set_DM -static tableLayout Image_IPL_Set_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageIplSetDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplSetDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageIplSetDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageIplSetDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_IPL_Set_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * savedSystem, char * loadParameter, - char * parameterString, vmApiImageIplSetDmOutput ** outData); - -// Image_Lock_DM -typedef commonOutputFields vmApiImageLockDmOutput; - -// Parser table for Image_Lock_DM -static tableLayout Image_Lock_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageLockDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageLockDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageLockDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageLockDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Lock_DM(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * deviceAddress, vmApiImageLockDmOutput ** outData); - -// Image_Name_Query_DM -typedef struct _vmApiImageName { // Common structure used by Image_Status_Query - char * imageName; -} vmApiImageName; - -typedef struct _vmApiImageNameQueryDm { - commonOutputFields common; - int nameCount; - vmApiImageName * nameList; -} vmApiImageNameQueryDmOutput; - -// Parser table for Image_Name_Query_DM -static tableLayout Image_Name_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageNameQueryDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageNameQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageNameQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageNameQueryDmOutput, common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageNameQueryDmOutput, nameList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageNameQueryDmOutput, nameCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageName) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiImageName, imageName) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smImage_Name_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageNameQueryDmOutput ** outData); - -// Image_Password_Set_DM -typedef commonOutputFields vmApiImagePasswordSetDmOutput; - -// Parser table for Image_Password_Set_DM -static tableLayout Image_Password_Set_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImagePasswordSetDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImagePasswordSetDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImagePasswordSetDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImagePasswordSetDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Password_Set_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int imagePasswordLength, char * imagePassword, - vmApiImagePasswordSetDmOutput ** outData); - -// Image_Query_Activate_Time -typedef struct _vmApiImageQueryActivateTime { - commonOutputFields common; - char * imageName; - char * activationDate; - char * activationTime; -} vmApiImageQueryActivateTimeOutput; - -// Parser table for Image_Query_Activate_Time -static tableLayout Image_Query_Activate_Time_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageQueryActivateTimeOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, common.reasonCode) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, imageName) }, { - APITYPE_STRING_LEN, 8, 10, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, activationDate) }, { - APITYPE_STRING_LEN, 8, 8, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, activationTime) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Query_Activate_Time(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char dateFormat, - vmApiImageQueryActivateTimeOutput ** outData); - -// Image_Query_DM -typedef struct _vmApiImageQueryDm { - commonOutputFields common; - int imageRecordCount; - vmApiImageRecord * imageRecordList; -} vmApiImageQueryDmOutput; - -// Parser table for Image_Activate -static tableLayout Image_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryDmOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageQueryDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryDmOutput, imageRecordList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageQueryDmOutput, imageRecordCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageRecord) }, { APITYPE_CHARBUF_LEN, 1, 80, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageRecord, imageRecord) }, - { APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageRecord, imageRecordLength) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smImage_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageQueryDmOutput ** outData, - bool readFromCache); - -// Image_Recycle -typedef struct _vmApiImageRecycle { - commonOutputFields common; - int recycled; - int notRecycled; - int failingArrayCount; - vmApiImageFailing * failList; -} vmApiImageRecycleOutput; - -// Parser table for Image_Recycle -static tableLayout Image_Recycle_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageRecycleOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageRecycleOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageRecycleOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageRecycleOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageRecycleOutput, recycled) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageRecycleOutput, - notRecycled) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageRecycleOutput, failList) }, { APITYPE_ARRAY_STRUCT_COUNT, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageRecycleOutput, - failingArrayCount) }, { APITYPE_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiImageFailing) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, imageName) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageFailing, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, reasonCode) }, { APITYPE_END_OF_TABLE, 0, 0, - 0, 0 } }; - -int smImage_Recycle(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageRecycleOutput ** outData); - -// Image_Replace_DM -typedef commonOutputFields vmApiImageReplaceDmOutput; - -// Parser table for Image_Replace_DM -static tableLayout Image_Replace_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageReplaceDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageReplaceDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageReplaceDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageReplaceDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int imageRecordArrayCount, - vmApiImageRecord * imageRecordList, - vmApiImageReplaceDmOutput ** outData); - -// Image_SCSI_Characteristics_Define_DM -typedef commonOutputFields vmApiImageScsiCharacteristicsDefineDmOutput; - -// Parser table for Image_SCSI_Characteristics_Define_DM -static tableLayout Image_SCSI_Characteristics_Define_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageScsiCharacteristicsDefineDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsDefineDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsDefineDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsDefineDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_SCSI_Characteristics_Define_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * bootProgram, char * brLba, char * lun, char * portName, - char scpDatatype, int scpDataLength, char * scpData, - vmApiImageScsiCharacteristicsDefineDmOutput ** outData); - -// Image_SCSI_Characteristics_Query_DM -typedef struct _vmApiImageScsiCharacteristicsQueryDm { - commonOutputFields common; - char * bootProgramNumber; - char * br_LBA; - char * lun; - char * port; - char * scpData; - int scpDataLength; -} vmApiImageScsiCharacteristicsQueryDmOutput; - -// Parser table for Image_SCSI_Characteristics_Query_DM -static tableLayout - Image_SCSI_Characteristics_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageScsiCharacteristicsQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - common.reasonCode) }, { APITYPE_STRING_LEN, 0, 6, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - bootProgramNumber) }, { APITYPE_STRING_LEN, 0, 16, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, br_LBA) }, - { APITYPE_STRING_LEN, 0, 16, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageScsiCharacteristicsQueryDmOutput, - lun) }, { APITYPE_STRING_LEN, 0, 16, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - port) }, { APITYPE_CHARBUF_LEN, 0, 4102, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - scpData) }, { APITYPE_CHARBUF_COUNT, 0, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - scpDataLength) }, { APITYPE_END_OF_TABLE, 0, 0, - 0, 0 } }; - -int smImage_SCSI_Characteristics_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageScsiCharacteristicsQueryDmOutput ** outData); - -// Image_Status_Query -typedef struct _vmApiImageStatusQuery { - commonOutputFields common; - int imageNameCount; - vmApiImageName * imageNameList; // common structure with Image_Name_Query_DM -} vmApiImageStatusQueryOutput; - -// Parser table for Image_Status_Query -static tableLayout Image_Status_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageStatusQueryOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageStatusQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageStatusQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageStatusQueryOutput, common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageStatusQueryOutput, imageNameList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageStatusQueryOutput, imageNameCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageName) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiImageName, imageName) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smImage_Status_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageStatusQueryOutput ** outData); - -// Image_Unlock_DM -typedef commonOutputFields vmApiImageUnlockDmOutput; - -// Parser table for Image_Unlock_DM -static tableLayout Image_Unlock_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageUnlockDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageUnlockDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageUnlockDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageUnlockDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Unlock_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * deviceAddress, - vmApiImageUnlockDmOutput ** outData); - -// Image_Volume_Add -typedef commonOutputFields vmApiImageVolumeAddOutput; - -// Parser table for Image_Volume_Add -static tableLayout Image_Volume_Add_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageVolumeAddOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeAddOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageVolumeAddOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageVolumeAddOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Volume_Add(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumer, - char * imageVolumeLabel, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, - vmApiImageVolumeAddOutput ** outData); - -// Image_Volumne_Delete -typedef commonOutputFields vmApiImageVolumeDeleteOutput; - -// Parser table for Image_Volume_Delete -static tableLayout Image_Volume_Delete_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageVolumeDeleteOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeDeleteOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Volume_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumer, - char * imageVolumeLabel, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, - vmApiImageVolumeDeleteOutput ** outData); - -// Image_Volume_Space_Define_DM -typedef commonOutputFields vmApiImageVolumeSpaceDefineDmOutput; - -// Parser table for Image_Volume_Space_Define_DM -static tableLayout Image_Volume_Space_Define_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageVolumeSpaceDefineDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceDefineDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceDefineDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceDefineDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Volume_Space_Define_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char functionType, char * regionName, - char * imageVolumeId, int startCyl, int regionSize, char * groupName, - char deviceType, vmApiImageVolumeSpaceDefineDmOutput ** outData); - -// Image_Volume_Space_Query_DM -typedef struct _vmApiImageVolumeSpaceQueryDm { - commonOutputFields common; - int recordCount; - vmApiImageRecord * recordList; // Common structure with Image_Query_DM -} vmApiImageVolumeSpaceQueryDmOutput; - -// Parser table for Image_Volumn_Space_Query_DM -static tableLayout Image_Volume_Space_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageVolumeSpaceQueryDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceQueryDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceQueryDmOutput, recordList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageVolumeSpaceQueryDmOutput, recordCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageRecord) }, { APITYPE_CHARBUF_LEN, 1, -1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageRecord, imageRecord) }, - { APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageRecord, imageRecordLength) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smImage_Volume_Space_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char queryType, char entryType, - char * entryNames, vmApiImageVolumeSpaceQueryDmOutput ** outData); - -// Image_Volume_Space_Remove_DM -typedef commonOutputFields vmApiImageVolumeSpaceRemoveDmOutput; - -// Parser table for Image_Volume_Space_Remove_DM -static tableLayout Image_Volume_Space_Remove_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageVolumeSpaceRemoveDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceRemoveDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceRemoveDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceRemoveDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Volume_Space_Remove_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char functionType, char * regionName, - char * imageVolumeId, char * groupName, - vmApiImageVolumeSpaceRemoveDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiName.h b/zhcp/BUILD/resource_access/include/vmapiName.h deleted file mode 100644 index 77a4ea5..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiName.h +++ /dev/null @@ -1,102 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_NAME_H -#define _VMAPI_NAME_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Name_List_Add -typedef commonOutputFields vmApiNameListAddOutput; - -int smName_List_Add(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * name, vmApiNameListAddOutput ** outData); - -// Parser table for Name_List_Add -static tableLayout Name_List_Add_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiNameListAddOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListAddOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListAddOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiNameListAddOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Name_List_Destroy -typedef commonOutputFields vmApiNameListDestroyOutput; - -int smName_List_Destroy(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiNameListDestroyOutput ** outData); - -// Parser table for Name_List_Destroy -static tableLayout Name_List_Destroy_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiNameListDestroyOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListDestroyOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListDestroyOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiNameListDestroyOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Name_List_Query -typedef struct _vmApiNameList { // Common structure for Name_List_Query, - char * imageName; -} vmApiNameList; - -typedef struct _vmApiNameListQuery { - commonOutputFields common; - int nameArrayCount; - vmApiNameList * nameList; -} vmApiNameListQueryOutput; - -int smName_List_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiNameListQueryOutput ** outData); - -// Parser table for Name_List_Query -static tableLayout Name_List_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiNameListQueryOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListQueryOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiNameListQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListQueryOutput, nameList) }, { APITYPE_ARRAY_STRUCT_COUNT, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListQueryOutput, - nameArrayCount) }, { APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiNameList) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiNameList, imageName) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Name_List_Remove -typedef commonOutputFields vmApiNameListRemoveOutput; - -int smName_List_Remove(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * name, - vmApiNameListRemoveOutput ** outData); - -// Parser table for Name_List_Remove -static tableLayout Name_List_Remove_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiNameListRemoveOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListRemoveOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListRemoveOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiNameListRemoveOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiProfile.h b/zhcp/BUILD/resource_access/include/vmapiProfile.h deleted file mode 100644 index f8e442f..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiProfile.h +++ /dev/null @@ -1,111 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_PROFILE_H -#define _VMAPI_PROFILE_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Profile_Create_DM -// Common structure to hold one profile record (used on profile_query output, input for Create and Replace) -typedef struct _vmApiProfileRecord { - int profileRecordLength; - char * recordData; -} vmApiProfileRecord; - -typedef commonOutputFields vmApiProfileCreateDmOutput; - -// Parser table for Profile_Create_DM -static tableLayout Profile_Create_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiProfileCreateDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileCreateDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiProfileCreateDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiProfileCreateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smProfile_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int profileRecordCount, - vmApiProfileRecord * profileRecordList, - vmApiProfileCreateDmOutput ** outData); - -// Profile_Delete_DM -typedef commonOutputFields vmApiProfileDeleteDmOutput; - -// Parser table for Profile_Delete_DM -static tableLayout Profile_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiProfileDeleteDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileDeleteDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiProfileDeleteDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiProfileDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smProfile_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiProfileDeleteDmOutput ** outData); - -// Profile_Query_DM -typedef struct _vmApiProfileQueryDmOutput { - commonOutputFields common; - int profileRecordCount; - vmApiProfileRecord * profileRecordList; -} vmApiProfileQueryDmOutput; - -// Parser table for Profile_Query_DM -static tableLayout Profile_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiProfileQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileQueryDmOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiProfileQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiProfileQueryDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileQueryDmOutput, profileRecordList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiProfileQueryDmOutput, profileRecordCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiProfileRecord) }, - { APITYPE_CHARBUF_LEN, 0, 80, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiProfileRecord, recordData) }, { APITYPE_CHARBUF_COUNT, 0, - 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiProfileRecord, - profileRecordLength) }, { APITYPE_END_OF_TABLE, 0, 0, - 0, 0 } }; - -int smProfile_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiProfileQueryDmOutput ** outData); - -// Profile_Replace_DM -typedef commonOutputFields vmApiProfileReplaceDmOutput; - -// Parser table for Profile_Replace_DM -static tableLayout Profile_Replace_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiProfileReplaceDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileReplaceDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileReplaceDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileReplaceDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smProfile_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int profileRecordCount, - vmApiProfileRecord * profileRecordList, - vmApiProfileReplaceDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiPrototype.h b/zhcp/BUILD/resource_access/include/vmapiPrototype.h deleted file mode 100644 index 33a9378..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiPrototype.h +++ /dev/null @@ -1,148 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_PROTOTYPE_H -#define _VMAPI_PROTOTYPE_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Prototype_Create_DM -typedef struct _vmApiPrototypeRecordList { // Common structure for Prototype_Query_DM, create, replace - char * recordName; - int recordNameLength; -} vmApiPrototypeRecordList; - -typedef commonOutputFields vmApiPrototypeCreateDmOutput; - -int smPrototype_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int recordArrayCount, - vmApiPrototypeRecordList * recordArrayData, - vmApiPrototypeCreateDmOutput ** outData); - -// Parser table for Prototype_Create_DM -static tableLayout Prototype_Create_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiPrototypeCreateDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeCreateDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeCreateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeCreateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Prototype_Delete_DM -typedef commonOutputFields vmApiPrototypeDeleteDmOutput; - -int smPrototype_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeDeleteDmOutput ** outData); - -// Parser table for Prototype_Delete_DM -static tableLayout Prototype_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiPrototypeDeleteDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeDeleteDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Prototype_Name_Query_DM -typedef struct _vmApiPrototypeNameList { // Common structure for Prototype_Name_Query_DM, - char * name; -} vmApiPrototypeNameList; - -typedef struct _vmApiPrototypeNameQueryDm { - commonOutputFields common; - int nameArrayCount; - vmApiPrototypeNameList * nameList; -} vmApiPrototypeNameQueryDmOutput; - -int smPrototype_Name_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeNameQueryDmOutput ** outData); - -// Parser table for Prototype_Name_Query_DM -static tableLayout Prototype_Name_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiPrototypeNameQueryDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiPrototypeNameQueryDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiPrototypeNameQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiPrototypeNameQueryDmOutput, - common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeNameQueryDmOutput, nameList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiPrototypeNameQueryDmOutput, nameArrayCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiPrototypeNameList) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiPrototypeNameList, name) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Prototype_Query_DM -typedef struct _vmApiPrototypeQueryDm { - commonOutputFields common; - int recordArrayCount; - vmApiPrototypeRecordList * recordList; -} vmApiPrototypeQueryDmOutput; - -int smPrototype_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeQueryDmOutput ** outData); - -// Parser table for Prototype_Query_DM -static tableLayout Prototype_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiPrototypeQueryDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeQueryDmOutput, common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeQueryDmOutput, recordList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiPrototypeQueryDmOutput, recordArrayCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiPrototypeRecordList) }, { APITYPE_CHARBUF_LEN, 1, - 72, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiPrototypeRecordList, recordName) }, { - APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiPrototypeRecordList, recordNameLength) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Prototype_Replace_DM -typedef commonOutputFields vmApiPrototypeReplaceDmOutput; - -int smPrototype_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int recordArrayCount, - vmApiPrototypeRecordList * recordArrayData, - vmApiPrototypeReplaceDmOutput ** outData); - -// Parser table for Prototype_Replace_DM -static tableLayout Prototype_Replace_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiPrototypeReplaceDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiPrototypeReplaceDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiPrototypeReplaceDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeReplaceDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiQuery.h b/zhcp/BUILD/resource_access/include/vmapiQuery.h deleted file mode 100644 index a7f7fe4..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiQuery.h +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_QUERY_H -#define _VMAPI_QUERY_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Query_API_Functional_Level -typedef commonOutputFields vmApiQueryApiFunctionalLevelOutput; - -int smQuery_API_Functional_Level(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiQueryApiFunctionalLevelOutput ** outData); - -// Parser table for Query_API_Functional_Level -static tableLayout Query_API_Functional_Level_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiQueryApiFunctionalLevelOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryApiFunctionalLevelOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryApiFunctionalLevelOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryApiFunctionalLevelOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Query_Asychronous_Operation_DM -typedef commonOutputFields vmApiQueryAsynchronousOperationDmOutput; - -int smQuery_Asychronous_Operation_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - int operationId, vmApiQueryAsynchronousOperationDmOutput ** outData); - -// Parser table for Query_Asychronous_Operation_DM -static tableLayout Query_Asynchronous_Operation_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiQueryAsynchronousOperationDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryAsynchronousOperationDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryAsynchronousOperationDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryAsynchronousOperationDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Query_Directory_Manager_Level_DM -typedef struct _vmApiQueryDirectoryManagerLevelDm { - commonOutputFields common; - char * directoryManagerLevel; - int directoryManagerLevelLength; -} vmApiQueryDirectoryManagerLevelDmOutput; - -// Parser table for Query_Directory_Manager_Level_DM -static tableLayout - Query_Directory_Manager_Level_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiQueryDirectoryManagerLevelDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - common.reasonCode) }, { APITYPE_CHARBUF_LEN, 1, 100, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - directoryManagerLevel) }, { APITYPE_CHARBUF_COUNT, 1, - 100, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - directoryManagerLevelLength) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smQuery_Directory_Manager_Level_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiQueryDirectoryManagerLevelDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiShared.h b/zhcp/BUILD/resource_access/include/vmapiShared.h deleted file mode 100644 index 767ea0f..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiShared.h +++ /dev/null @@ -1,214 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_SHARED_H -#define _VMAPI_SHARED_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Shared_Memory_Access_Add_DM -typedef commonOutputFields vmApiSharedMemoryAccessAddDmOutput; - -// Parser table for Shared_Memory_Access_Add_DM -static tableLayout Shared_Memory_Access_Add_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryAccessAddDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessAddDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessAddDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessAddDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smShared_Memory_Access_Add_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryAccessAddDmOutput ** outData); - -// Shared_Memory_Access_Query_DM -typedef struct _vmApiSharedMemorySegmentName { // Common structure used by Shared_Memory_Access_Query - char * memorySegmentName; -} vmApiSharedMemorySegmentName; - -typedef struct _vmApiSharedMemoryAccessQueryDm { - commonOutputFields common; - int memorySegmentNameCount; - vmApiSharedMemorySegmentName * memorySegmentNameList; -} vmApiSharedMemoryAccessQueryDmOutput; - -// Parser table for Shared_Memory_Access_Query_DM -static tableLayout Shared_Memory_Access_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryAccessQueryDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessQueryDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessQueryDmOutput, memorySegmentNameList) }, - { APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSharedMemoryAccessQueryDmOutput, - memorySegmentNameCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiSharedMemorySegmentName) }, { APITYPE_STRING_LEN, - 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiSharedMemorySegmentName, memorySegmentName) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smShared_Memory_Access_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * memorySegmentName, - vmApiSharedMemoryAccessQueryDmOutput ** outData); - -// Shared_Memory_Access_Remove_DM -typedef commonOutputFields vmApiSharedMemoryAccessRemoveDmOutput; - -// Parser table for Shared_Memory_Access_Remove_DM -static tableLayout Shared_Memory_Access_Remove_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryAccessRemoveDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessRemoveDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessRemoveDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessRemoveDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smShared_Memory_Access_Remove_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * memorySegmentName, - vmApiSharedMemoryAccessRemoveDmOutput ** outData); - -// Shared_Memory_Create -typedef commonOutputFields vmApiSharedMemoryCreateOutput; - -// Parser table for Shared_Memory_Create -static tableLayout Shared_Memory_Create_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryCreateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSharedMemoryCreateOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiSharedMemoryCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int - smShared_Memory_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - unsigned long long beginPage, unsigned long long endPage, - char pageAccessDescriptor, char memoryAttributes, - char * memoryAccessIdentifier, - vmApiSharedMemoryCreateOutput ** outData); - -// Shared_Memory_Delete -typedef commonOutputFields vmApiSharedMemoryDeleteOutput; - -// Parser table for Shared_Memory_Delete -static tableLayout Shared_Memory_Delete_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryDeleteOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSharedMemoryDeleteOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiSharedMemoryDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smShared_Memory_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryDeleteOutput ** outData); - -// Shared_Memory_Query -typedef struct _vmApiSharedPageRangeInfo { - unsigned long long beginPage; - unsigned long long endPage; - char pageAccessDescriptor; -} vmApiSharedPageRangeInfo; - -typedef struct _vmApiSharedMemorySegmentInfo { - char * memorySegmentName; - char memorySegmentStatus; - int pageRangeCount; - vmApiSharedPageRangeInfo * pageRangeList; -} vmApiSharedMemorySegmentInfo; - -typedef struct _vmApiSharedMemoryQueryOutput { - commonOutputFields common; - int memorySegmentCount; - vmApiSharedMemorySegmentInfo * memorySegmentInfoList; -} vmApiSharedMemoryQueryOutput; - -// Parser table for Shared_Memory_Query -static tableLayout Shared_Memory_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiSharedMemoryQueryOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryQueryOutput, common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryQueryOutput, memorySegmentInfoList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSharedMemoryQueryOutput, memorySegmentCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiSharedMemorySegmentInfo) }, { APITYPE_STRING_LEN, - 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiSharedMemorySegmentInfo, memorySegmentName) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiSharedMemorySegmentInfo, memorySegmentStatus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiSharedMemorySegmentInfo, pageRangeList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiSharedMemorySegmentInfo, pageRangeCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_2, NEST_LEVEL_2, - sizeof(vmApiSharedPageRangeInfo) }, { APITYPE_INT8, 8, 8, - STRUCT_INDX_2, NEST_LEVEL_2, offsetof(vmApiSharedPageRangeInfo, - beginPage) }, { APITYPE_INT8, 8, 8, STRUCT_INDX_2, - NEST_LEVEL_2, offsetof(vmApiSharedPageRangeInfo, endPage) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_2, NEST_LEVEL_2, offsetof( - vmApiSharedPageRangeInfo, pageAccessDescriptor) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smShared_Memory_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryQueryOutput ** outData); - -// Shared_Memory_Replace -typedef commonOutputFields vmApiSharedMemoryReplaceOutput; - -// Parser table for Shared_Memory_Replace -static tableLayout Shared_Memory_Replace_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryReplaceOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSharedMemoryReplaceOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiSharedMemoryReplaceOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryReplaceOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smShared_Memory_Replace(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - char * memoryAccessIdentifier, - vmApiSharedMemoryReplaceOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiStatic.h b/zhcp/BUILD/resource_access/include/vmapiStatic.h deleted file mode 100644 index b26ef4f..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiStatic.h +++ /dev/null @@ -1,74 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_STATIC_H -#define _VMAPI_STATIC_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Static_Image_Changes_Activate_DM -typedef commonOutputFields vmApiStaticImageChangesActivateDmOutput; - -// Parser table for Static_Image_Changes_Activate_DM -static tableLayout Static_Image_Changes_Activate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiStaticImageChangesActivateDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesActivateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesActivateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesActivateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smStatic_Image_Changes_Activate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesActivateDmOutput ** outData); - -// Static_Image_Changes_Deactivate_DM -typedef commonOutputFields vmApiStaticImageChangesDeactivateDmOutput; - -// Parser table for Static_Image_Changes_Deactivate_DM -static tableLayout Static_Image_Changes_Deactivate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiStaticImageChangesDeactivateDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesDeactivateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesDeactivateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesDeactivateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smStatic_Image_Changes_Deactivate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesDeactivateDmOutput ** outData); - -// Static_Image_Changes_Immediate_DM -typedef commonOutputFields vmApiStaticImageChangesImmediateDmOutput; - -// Parser table for Static_Image_Changes_Immediate_DM -static tableLayout Static_Image_Changes_Immediate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiStaticImageChangesImmediateDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesImmediateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesImmediateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesImmediateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smStatic_Image_Changes_Immediate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesImmediateDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiSystem.h b/zhcp/BUILD/resource_access/include/vmapiSystem.h deleted file mode 100644 index 0b550c7..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiSystem.h +++ /dev/null @@ -1,115 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_SYSTEM_H -#define _VMAPI_SYSTEM_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// IPaddr_Get -// This is here because it is VM related vs userid related -typedef struct _vmApiIPAddr_GetOutput { - commonOutputFields common; - int ipCount; - vmApiCStringInfo * ipList; // should only be one item in the list -} vmApiIPaddrGetOutput; - -// Parser table for IPaddr_Get -static tableLayout IPaddr_Get_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiIPaddrGetOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiIPaddrGetOutput, common.requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiIPaddrGetOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiIPaddrGetOutput, common.reasonCode) }, - -{ APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiIPaddrGetOutput, ipList) }, { APITYPE_C_STR_ARRAY_COUNT, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiIPaddrGetOutput, ipCount) }, - { APITYPE_C_STR_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiCStringInfo) }, { APITYPE_C_STR_PTR, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiCStringInfo, - vmapiString) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smIPaddr_Get(struct _VmApiInternalContext* vmapiContextP, - vmApiIPaddrGetOutput ** outData); - -// System_Info_Query -typedef struct _vmApiSystemInfoQueryOutput { - commonOutputFields common; - char * timezone; - char * time; - char * vmVersion; - char * cpGenTime; - char * cpIplTime; - char * realStorageSize; -} vmApiSystemInfoQueryOutput; - -// Parser table for Virtual_Network_Query_OSA -static tableLayout System_Info_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiSystemInfoQueryOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, common.reasonCode) }, - -{ APITYPE_C_STR_PTR, 4, 43, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, timezone) }, - { APITYPE_C_STR_PTR, 4, 43, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, time) }, { APITYPE_C_STR_PTR, 4, - 80, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, vmVersion) }, { - APITYPE_C_STR_PTR, 4, 43, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSystemInfoQueryOutput, cpGenTime) }, { - APITYPE_C_STR_PTR, 4, 43, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSystemInfoQueryOutput, cpIplTime) }, { - APITYPE_C_STR_PTR, 4, 80, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSystemInfoQueryOutput, realStorageSize) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smSystem_Info_Query(struct _VmApiInternalContext* vmapiContextP, - vmApiSystemInfoQueryOutput ** outData); - -// System_IO_Query -typedef struct _vmApiSystemIoQueryOutput { - commonOutputFields common; - int chipidCount; - vmApiCStringInfo * chipidList; -} vmApiSystemIoQueryOutput; - -// Parser table for Virtual_Network_Query_OSA -static tableLayout System_IO_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiSystemIoQueryOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemIoQueryOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSystemIoQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiSystemIoQueryOutput, common.reasonCode) }, - -{ APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemIoQueryOutput, chipidList) }, { APITYPE_C_STR_ARRAY_COUNT, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSystemIoQueryOutput, - chipidCount) }, { APITYPE_C_STR_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiCStringInfo) }, { - APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiCStringInfo, vmapiString) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smSystem_IO_Query(struct _VmApiInternalContext* vmapiContextP, - char * realDeviceAddress, vmApiSystemIoQueryOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiVMRM.h b/zhcp/BUILD/resource_access/include/vmapiVMRM.h deleted file mode 100644 index eaa3b6e..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiVMRM.h +++ /dev/null @@ -1,137 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_VMRM_H -#define _VMAPI_VMRM_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// VMRM_Configuration_Query -typedef struct _vmApiVmrmConfigurationQuery { - commonOutputFields common; - char * configurationFile; - int configurationFileLength; -} vmApiVmrmConfigurationQueryOutput; - -// Parser table for VMRM_Configuration_Query -static tableLayout VMRM_Configuration_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVmrmConfigurationQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, common.reasonCode) }, { - APITYPE_CHARBUF_LEN, 1, -1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, configurationFile) }, { - APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, configurationFileLength) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVMRM_Configuration_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * configurationFileName, - char * configurationFileType, char * configurationDirName, - vmApiVmrmConfigurationQueryOutput ** outData); - -// VMRM_Configuration_Update -typedef struct _vmApiVmrmConfigurationLogRecordInfo { - char * logRecord; - int logRecordLength; -} vmApiVmrmConfigurationLogRecordInfo; - -typedef struct _vmApiVmrmConfigurationUpdateOutput { - commonOutputFields common; - int logRecordCount; - vmApiVmrmConfigurationLogRecordInfo * logRecordInfoList; -} vmApiVmrmConfigurationUpdateOutput; - -// Parser table for VMRM_Configuration_Update -static tableLayout VMRM_Configuration_Update_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVmrmConfigurationUpdateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationUpdateOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationUpdateOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationUpdateOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationUpdateOutput, logRecordInfoList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVmrmConfigurationUpdateOutput, logRecordCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVmrmConfigurationLogRecordInfo) }, { APITYPE_CHARBUF_LEN, - 1, -1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVmrmConfigurationLogRecordInfo, logRecord) }, { - APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVmrmConfigurationLogRecordInfo, logRecordLength) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVMRM_Configuration_Update(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * configurationFileName, - char * configurationFileType, char * configurationDirName, - char syncheckOnly, int updateFileLength, char * updateFile, - vmApiVmrmConfigurationUpdateOutput ** outData); - -// VMRM_Measurement_Query -typedef struct _vmApiVmrmMeasurementQueryWorkloadInfo { - char * workloadRecord; - int workloadRecordLength; -} vmApiVmrmMeasurementQueryWorkloadInfo; - -typedef struct _vmApiVmrmMeasurementQueryOutput { - commonOutputFields common; - char * queryTimestamp; - char * fileName; - char * fileTimestamp; - int workloadCount; - vmApiVmrmMeasurementQueryWorkloadInfo * workloadInfoList; -} vmApiVmrmMeasurementQueryOutput; - -// Parser table for VMRM_Measurement_Query -static tableLayout VMRM_Measurement_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVmrmMeasurementQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, - common.reasonCode) }, { APITYPE_STRING_LEN, 1, 17, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, - queryTimestamp) }, { APITYPE_STRING_LEN, 1, 20, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, fileName) }, { - APITYPE_STRING_LEN, 1, 17, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmMeasurementQueryOutput, fileTimestamp) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmMeasurementQueryOutput, workloadInfoList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVmrmMeasurementQueryOutput, workloadCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVmrmMeasurementQueryWorkloadInfo) }, { APITYPE_CHARBUF_LEN, - 1, 35, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVmrmMeasurementQueryWorkloadInfo, workloadRecord) }, { - APITYPE_CHARBUF_COUNT, 1, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVmrmMeasurementQueryWorkloadInfo, workloadRecordLength) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVMRM_Measurement_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiVmrmMeasurementQueryOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/vmapiVirtual.h b/zhcp/BUILD/resource_access/include/vmapiVirtual.h deleted file mode 100644 index 1739b36..0000000 --- a/zhcp/BUILD/resource_access/include/vmapiVirtual.h +++ /dev/null @@ -1,782 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_VIRTUAL_H -#define _VMAPI_VIRTUAL_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Virtual_Channel_Connection_Create -typedef commonOutputFields vmApiVirtualChannelConnectionCreateOutput; - -// Parser table for Virtual_Channel_Connection_Create -static tableLayout Virtual_Channel_Connection_Create_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualChannelConnectionCreateOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Channel_Connection_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * coupledImageName, - char * coupledImageDeviceNumber, - vmApiVirtualChannelConnectionCreateOutput ** outData); - -// Virtual_Channel_Connection_Create_DM -typedef commonOutputFields vmApiVirtualChannelConnectionCreateDmOutput; - -// Parser table for Virtual_Channel_Connection_Create_DM -static tableLayout Virtual_Channel_Connection_Create_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualChannelConnectionCreateDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Channel_Connection_Create_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * coupledImageName, - vmApiVirtualChannelConnectionCreateDmOutput ** outData); - -// Virtual_Channel_Connection_Delete -typedef commonOutputFields vmApiVirtualChannelConnectionDeleteOutput; - -// Parser table for Virtual_Memory_Access_Add_DM -static tableLayout Virtual_Channel_Connection_Delete_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualChannelConnectionDeleteOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Channel_Connection_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualChannelConnectionDeleteOutput ** outData); - -// Virtual_Channel_Connection_Delete_DM -typedef commonOutputFields vmApiVirtualChannelConnectionDeleteDmOutput; - -// Parser table for Virtual_Channel_Connection_Delete_DM -static tableLayout Virtual_Channel_Connection_Delete_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualChannelConnectionDeleteDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Channel_Connection_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualChannelConnectionDeleteDmOutput ** outData); - -// Virtual_Network_Adapter_Connect_LAN -typedef commonOutputFields vmApiVirtualNetworkAdapterConnectLanOutput; - -// Parser table for Virtual_Network_Adapter_Connect_LAN -static tableLayout Virtual_Network_Adapter_Connect_LAN_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterConnectLanOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Connect_LAN( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * lanName, char * lanOwner, - vmApiVirtualNetworkAdapterConnectLanOutput ** outData); - -// Virtual_Network_Adapter_Connect_LAN_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterConnectLanDmOutput; - -// Parser table for Virtual_Network_Adapter_Connect_LAN_DM -static tableLayout Virtual_Network_Adapter_Connect_LAN_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterConnectLanDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Connect_LAN_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * lanName, char * lanOwner, - vmApiVirtualNetworkAdapterConnectLanDmOutput ** outData); - -// Virtual_Network_Adapter_Connect_Vswitch -typedef commonOutputFields vmApiVirtualNetworkAdapterConnectVswitchOutput; - -// Parser table for Virtual_Network_Adapter_Connect_Vswitch -static tableLayout Virtual_Network_Adapter_Connect_Vswitch_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterConnectVswitchOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchOutput, reasonCode) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Connect_Vswitch( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * switchName, - vmApiVirtualNetworkAdapterConnectVswitchOutput ** outData); - -// Virtual_Network_Adapter_Connect_Vswitch_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterConnectVswitchDmOutput; - -// Parser table for Virtual_Network_Adapter_Connect_Vswitch_DM -static tableLayout - Virtual_Network_Adapter_Connect_Vswitch_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterConnectVswitchDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchDmOutput, - reasonCode) }, { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Connect_Vswitch_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * switchName, - vmApiVirtualNetworkAdapterConnectVswitchDmOutput ** outData); - -// Virtual_Network_Adapter_Create -typedef commonOutputFields vmApiVirtualNetworkAdapterCreateOutput; - -// Parser table for Virtual_Network_Adapter_Create -static tableLayout Virtual_Network_Adapter_Create_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterCreateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int - smVirtual_Network_Adapter_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char adapterType, - int networkAdapterDevices, char * channelPathId, - vmApiVirtualNetworkAdapterCreateOutput ** outData); - -// Virtual_Network_Adapter_Create_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterCreateDmOutput; - -// Parser table for Virtual_Network_Adapter_Create_DM -static tableLayout Virtual_Network_Adapter_Create_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterCreateDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Create_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char adapterType, int networkAdapterDevices, - char * channelPathId, char * macId, - vmApiVirtualNetworkAdapterCreateDmOutput ** outData); - -// Virtual_Network_Adapter_Delete -typedef commonOutputFields vmApiVirtualNetworkAdapterDeleteOutput; - -// Parser table for Virtual_Network_Adapter_Delete -static tableLayout Virtual_Network_Adapter_Delete_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterDeleteOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDeleteOutput ** outData); - -// Virtual_Network_Adapter_Delete_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterDeleteDmOutput; - -// Parser table for Virtual_Network_Adapter_Delete_DM -static tableLayout Virtual_Network_Adapter_Delete_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterDeleteDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDeleteDmOutput ** outData); - -// Virtual_Network_Adapter_Disconnect -typedef commonOutputFields vmApiVirtualNetworkAdapterDisconnectOutput; - -// Parser table for Virtual_Network_Adapter_Disconnect -static tableLayout Virtual_Network_Adapter_Disconnect_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterDisconnectOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Disconnect( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDisconnectOutput ** outData); - -// Virtual_Network_Adapter_Disconnect_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterDisconnectDmOutput; - -// Parser table for Virtual_Network_Adapter_Disconnect_DM -static tableLayout Virtual_Network_Adapter_Disconnect_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterDisconnectDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Disconnect_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDisconnectDmOutput ** outData); - -// Virtual_Network_Adapter_Query -typedef struct _vmApiVirtualNetworkAdapter { - char * imageDeviceNumber; - char adapterType; - int networkAdapterDevices; - char adapterStatus; - char * lanOwner; - char * lanName; -} vmApiVirtualNetworkAdapter; - -typedef struct _vmApiVirtualNetworkAdapterQueryOutput { - commonOutputFields common; - int adapterArrayCount; - vmApiVirtualNetworkAdapter * adapterList; -} vmApiVirtualNetworkAdapterQueryOutput; - -int smVirtual_Network_Adapter_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterQueryOutput ** outData); - -// Parser table for Virtual_Network_Adapter_Query -static tableLayout Virtual_Network_Adapter_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterQueryOutput, adapterList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVirtualNetworkAdapterQueryOutput, adapterArrayCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVirtualNetworkAdapter) }, { APITYPE_STRING_LEN, 1, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVirtualNetworkAdapter, - imageDeviceNumber) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVirtualNetworkAdapter, adapterType) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkAdapter, networkAdapterDevices) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkAdapter, adapterStatus) }, { - APITYPE_STRING_LEN, 0, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkAdapter, lanOwner) }, { APITYPE_STRING_LEN, - 0, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVirtualNetworkAdapter, - lanName) }, { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Virtual_Network_LAN_Access -typedef commonOutputFields vmApiVirtualNetworkLanAccessOutput; - -// Parser table for Virtual_Network_LAN_Access -static tableLayout Virtual_Network_LAN_Access_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanAccessOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_LAN_Access(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - char * accessOption, char * accessGrantName, char * promiscuity, - vmApiVirtualNetworkLanAccessOutput ** outData); - -// Virtual_Network_LAN_Access_Query -typedef struct _vmApiVirtualNetworkLanAccessQueryOutput { - commonOutputFields common; - int lanAccessCount; - vmApiCStringInfo * lanAccessList; -} vmApiVirtualNetworkLanAccessQueryOutput; - -// Parser table for Virtual_Network_LANAccess_Query -static tableLayout Virtual_Network_LAN_Access_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanAccessQueryOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessQueryOutput, common.returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessQueryOutput, common.reasonCode) }, - - { APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessQueryOutput, lanAccessList) }, { - APITYPE_C_STR_ARRAY_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVirtualNetworkLanAccessQueryOutput, - lanAccessCount) }, { APITYPE_C_STR_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiCStringInfo) }, { - APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiCStringInfo, vmapiString) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_LAN_Access_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * lanName, char * lanOwner, - vmApiVirtualNetworkLanAccessQueryOutput ** outData); - -// Virtual_Network_LAN_Create -typedef commonOutputFields vmApiVirtualNetworkLanCreateOutput; - -// Parser table for Virtual_Network_LAN_Create -static tableLayout Virtual_Network_LAN_Create_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanCreateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanCreateOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_LAN_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, char lanType,//1,2,3,4 - char transportType, vmApiVirtualNetworkLanCreateOutput ** outData); - -// Virtual_Network_LAN_Delete -typedef commonOutputFields vmApiVirtualNetworkLanDeleteOutput; - -// Parser table for Virtual_Network_LAN_Delete -static tableLayout Virtual_Network_LAN_Delete_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanDeleteOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanDeleteOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_LAN_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - vmApiVirtualNetworkLanDeleteOutput ** outData); - -// Virtual_Network_LAN_Query -typedef struct _vmApiVirtualNetworkConnectedAdapterInfo { // Common structure with Virtual Network Vswitch Query - char * adapterOwner; - char * imageDeviceNumber; -} vmApiVirtualNetworkConnectedAdapterInfo; - -typedef struct _vmApiVirtualNetworkLanInfo { - char * lanName; - char * lanOwner; - char lanType; - int connectedAdapterCount; - vmApiVirtualNetworkConnectedAdapterInfo * connectedAdapterList; -} vmApiVirtualNetworkLanInfo; - -typedef struct _vmApiVirtualNetworkLanQueryOutput { - commonOutputFields common; - int lanCount; - vmApiVirtualNetworkLanInfo * lanList; -} vmApiVirtualNetworkLanQueryOutput; - -// Parser table for Virtual_Network_LAN_Query -static tableLayout Virtual_Network_LAN_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanQueryOutput, lanList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVirtualNetworkLanQueryOutput, lanCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVirtualNetworkLanInfo) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVirtualNetworkLanInfo, - lanName) }, { APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVirtualNetworkLanInfo, lanOwner) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkLanInfo, lanType) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkLanInfo, connectedAdapterList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiVirtualNetworkLanInfo, connectedAdapterCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_2, NEST_LEVEL_2, - sizeof(vmApiVirtualNetworkConnectedAdapterInfo) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_2, NEST_LEVEL_2, offsetof( - vmApiVirtualNetworkConnectedAdapterInfo, adapterOwner) }, { - APITYPE_STRING_LEN, 1, 4, STRUCT_INDX_2, NEST_LEVEL_2, offsetof( - vmApiVirtualNetworkConnectedAdapterInfo, imageDeviceNumber) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_LAN_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - vmApiVirtualNetworkLanQueryOutput ** outData); - -// Virtual_Network_Query_LAN -typedef struct _vmApiVirtualNetworkQueryLanOutput { - commonOutputFields common; - int lanCount; - vmApiCStringInfo * lanList; -} vmApiVirtualNetworkQueryLanOutput; - -// Parser table for Virtual_Network_Query_LAN -static tableLayout Virtual_Network_Query_LAN_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkQueryLanOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, common.reasonCode) }, - -{ APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, lanList) }, { - APITYPE_C_STR_ARRAY_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, lanCount) }, { - APITYPE_C_STR_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiCStringInfo) }, { APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiCStringInfo, vmapiString) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_Query_LAN(struct _VmApiInternalContext* vmapiContextP, - vmApiVirtualNetworkQueryLanOutput ** outData); - -// Virtual_Network_Query_OSA -typedef struct _vmApiVirtualNetworkQueryOsaOutput { - commonOutputFields common; - int osaCount; - vmApiCStringInfo * osaList; -} vmApiVirtualNetworkQueryOsaOutput; - -// Parser table for Virtual_Network_Query_OSA -static tableLayout Virtual_Network_Query_OSA_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkQueryOsaOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, common.reasonCode) }, - -{ APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, osaList) }, { - APITYPE_C_STR_ARRAY_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, osaCount) }, { - APITYPE_C_STR_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiCStringInfo) }, { APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiCStringInfo, vmapiString) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_Query_OSA(struct _VmApiInternalContext* vmapiContextP, - vmApiVirtualNetworkQueryOsaOutput ** outData); - -// Virtual_Network_Vswitch_Create -typedef commonOutputFields vmApiVirtualNetworkVswitchCreateOutput; - -// Parser table for Virtual_Network_Vswitch_Create -static tableLayout Virtual_Network_Vswitch_Create_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkVswitchCreateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchCreateOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Vswitch_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, char * realDeviceAddress, char * portName, - char * controllerName, char connectionValue, int queueMemoryLimit, - char routingValue, char transportType, int vlanId, char portType, - char updateSystemConfigIndicator, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, char gvrpValue, - int nativeVlanId, vmApiVirtualNetworkVswitchCreateOutput ** outData); - -// Virtual_Network_Vswitch_Delete -typedef commonOutputFields vmApiVirtualNetworkVswitchDeleteOutput; - -// Parser table for Virtual_Network_Vswitch_Delete -static tableLayout Virtual_Network_Vswitch_Delete_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkVswitchDeleteOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchDeleteOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Vswitch_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, char updateSystemConfigIndicator, - char * systemConfigName, char * systemConfigType, char * parmDiskOwner, - char * parmDiskNumber, char * parmDiskPassword, - char * altSystemConfigName, char * altSystemConfigType, - char * altParmDiskOwner, char * altParmDiskNumber, - char * altParmDiskPassword, - vmApiVirtualNetworkVswitchDeleteOutput ** outData); - -// Virtual_Network_Vswitch_Query -typedef struct _vmApiConnectedAdapterInfo { - int userVlanId; -} vmApiVlanInfo; - -typedef struct _vmApiAuthorizedUserInfo { - char * grantUserid; - int vlanCount; - vmApiVlanInfo * vlanList; -} vmApiAuthorizedUserInfo; - -typedef struct _vmApiRealDeviceInfo { - int realDeviceAddress; - char * controllerName; - char * portName; - char deviceStatus; - char deviceErrorStatus; -} vmApiRealDeviceInfo; - -typedef struct _vmApiVswitchInfo { - char * switchName; - char transportType; - char portType; - int queueMemoryLimit; - char routingValue; - int vlanId; - int nativeVlanId; - unsigned long long macId; - char grvpRequestAttribute; - char grvpEnabledAttribute; - char switchStatus; - int realDeviceCount; - vmApiRealDeviceInfo * realDeviceList; - int authorizedUserCount; - vmApiAuthorizedUserInfo * authorizedUserList; - int connectedAdapterCount; - vmApiVirtualNetworkConnectedAdapterInfo * connectedAdapterList; // Shares common structure with Virtual network lan query -} vmApiVswitchInfo; - -typedef struct _vmApiVirtualNetworkVswitchQueryOutput { - commonOutputFields common; - int vswitchCount; - vmApiVswitchInfo * vswitchList; -} vmApiVirtualNetworkVswitchQueryOutput; - -// Parser table for Virtual_Network_Vswitch_Query -static tableLayout Virtual_Network_Vswitch_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkVswitchQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchQueryOutput, vswitchList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVirtualNetworkVswitchQueryOutput, vswitchCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVswitchInfo) }, { APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVswitchInfo, switchName) }, { APITYPE_INT1, - 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - transportType) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVswitchInfo, portType) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - queueMemoryLimit) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVswitchInfo, routingValue) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, vlanId) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, nativeVlanId) }, - { APITYPE_INT8, 8, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, macId) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - grvpRequestAttribute) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - grvpEnabledAttribute) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - switchStatus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, realDeviceList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiVswitchInfo, realDeviceCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_2, NEST_LEVEL_2, - sizeof(vmApiRealDeviceInfo) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_2, NEST_LEVEL_2, offsetof(vmApiRealDeviceInfo, - realDeviceAddress) }, { APITYPE_STRING_LEN, 0, 71, - STRUCT_INDX_2, NEST_LEVEL_2, offsetof(vmApiRealDeviceInfo, - controllerName) }, { APITYPE_STRING_LEN, 0, 16, - STRUCT_INDX_2, NEST_LEVEL_2, offsetof(vmApiRealDeviceInfo, - portName) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_2, - NEST_LEVEL_2, offsetof(vmApiRealDeviceInfo, deviceStatus) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_2, NEST_LEVEL_2, offsetof( - vmApiRealDeviceInfo, deviceErrorStatus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, authorizedUserList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiVswitchInfo, authorizedUserCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_3, NEST_LEVEL_2, - sizeof(vmApiAuthorizedUserInfo) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_3, NEST_LEVEL_2, offsetof(vmApiAuthorizedUserInfo, - grantUserid) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_3, NEST_LEVEL_2, offsetof( - vmApiAuthorizedUserInfo, vlanList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_3, NEST_LEVEL_2, - offsetof(vmApiAuthorizedUserInfo, vlanCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_4, NEST_LEVEL_3, - sizeof(vmApiVlanInfo) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_4, - NEST_LEVEL_3, offsetof(vmApiVlanInfo, userVlanId) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, connectedAdapterList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiVswitchInfo, connectedAdapterCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_5, NEST_LEVEL_2, - sizeof(vmApiVirtualNetworkConnectedAdapterInfo) }, - { APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_5, NEST_LEVEL_2, offsetof( - vmApiVirtualNetworkConnectedAdapterInfo, adapterOwner) }, { - APITYPE_STRING_LEN, 1, 4, STRUCT_INDX_5, NEST_LEVEL_2, - offsetof(vmApiVirtualNetworkConnectedAdapterInfo, - imageDeviceNumber) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_Vswitch_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, vmApiVirtualNetworkVswitchQueryOutput ** outData); - -// Virtual_Network_Vswitch_Set -typedef commonOutputFields vmApiVirtualNetworkVswitchSetOutput; - -// Parser table for Virtual_Network_Vswitch_Set -static tableLayout Virtual_Network_Vswitch_Set_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkVswitchSetOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchSetOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchSetOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchSetOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Vswitch_Set(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * switchName, char * grantUserid, - char * userVlanId, char * revokeUserid, char * realDeviceAddress, - char * portName, char * controllerName, char connectionValue, - int queueMemoryLimit, char routingValue, char portType, - char updateSystemConfigIndicator, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, char gvrpValue, - char * macId, vmApiVirtualNetworkVswitchSetOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/BUILD/resource_access/include/wrapperutils.h b/zhcp/BUILD/resource_access/include/wrapperutils.h deleted file mode 100644 index 9dd7dbf..0000000 --- a/zhcp/BUILD/resource_access/include/wrapperutils.h +++ /dev/null @@ -1,19 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include -#include "vmapiImage.h" -#include "vmapiVirtual.h" -#include "smPublic.h" -#include "vmapiSystem.h" -#include "vmapiAsynchronous.h" -#include "vmapiAuthorization.h" -#include "vmapiCheckAuthentication.h" -#include "vmapiDirectoryManager.h" -#include "vmapiProfile.h" - -void releaseContext(VmApiInternalContext* context); -void initializeContext(VmApiInternalContext* context); -int isImageNameInvalid(char* imageName); -int isDevNumberInvalid(char* devNumber); -void trim(char * s); diff --git a/zhcp/BUILD/resource_access/src/add3390.c b/zhcp/BUILD/resource_access/src/add3390.c deleted file mode 100644 index 0612d2d..0000000 --- a/zhcp/BUILD/resource_access/src/add3390.c +++ /dev/null @@ -1,99 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a 3390 (ECKD) disk to a virtual image's directory entry. - * - * @param $1: The name of the guest to which a disk is to be added - * @param $2: The name of the disk pool from which a disk is to be allocated - * @param $3: The virtual device address for the newly-allocated volume - * @param $4: The mode under which the disk is to be linked by the user - * @param $5: The size of the new disk, in cylinders - * @param $6: The read password - * @param $7: The write password - * @param $8: The multi password - * - * @return 0 If the disk was added successfully - * 1 If given invalid parameters - * 2 If disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC < 6 || argC > 9) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* pool = argV[2]; - char* vdev = argV[3]; - int size = atoi(argV[4]); - char* mode = argV[5]; - - // Read password - char* readPw = ""; - if (argC > 7 && argV[6]) - readPw = argV[6]; - - // Write password - char* writePw = ""; - if (argC > 8 && argV[7]) - writePw = argV[7]; - - // Mutli password - // In order to link to a disk, a multi password must be specified - char* multiPw = ""; - if (argC > 9 && argV[8]) - multiPw = argV[8]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Adding disk %s to %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskCreateDmOutput* output; - - int rc = smImage_Disk_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, "3390", "AUTOG", pool, 1, // Cylinders - size, mode, 1, "", // Do not format disk. Do not give disk a label. - readPw, writePw, multiPw, // Read, write, and multi passwords. - &output); - - if (rc || (output->common.returnCode && output->common.returnCode != 408 - && output->common.returnCode != 592) - || (output->common.reasonCode && output->common.reasonCode != 4 - && output->common.reasonCode != 0)) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/add3390active.c b/zhcp/BUILD/resource_access/src/add3390active.c deleted file mode 100644 index fdb4388..0000000 --- a/zhcp/BUILD/resource_access/src/add3390active.c +++ /dev/null @@ -1,71 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a 3390 (ECKD) disk that is defined in a virtual image's directory - * entry to that virtual image's active configuration - * - * @param $1: The name of the guest to which a disk is to be added - * @param $2: The virtual device address for the newly-allocated volume - * @param $3: The mode under which the disk is to be linked by the user - * - * @return 0 If the disk was added successfully - * 1 If given invalid parameters - * 2 If disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC != 4) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - char* mode = argV[3]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Adding disk %s to %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskCreateOutput * output; - - int rc = smImage_Disk_Create(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, mode, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, - output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/add9336.c b/zhcp/BUILD/resource_access/src/add9336.c deleted file mode 100644 index 8cb91ca..0000000 --- a/zhcp/BUILD/resource_access/src/add9336.c +++ /dev/null @@ -1,116 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a 9336 (FBA) disk to a virtual image's directory entry. - * - * @param $1: The name of the guest to which a disk is to be added - * @param $2: The name of the disk pool from which a disk is to be allocated - * @param $3: The virtual device address for the newly-allocated volume - * @param $4: The mode under which the disk is to be linked by the user - * @param $5: Block size (512, 1024, 2048, or 4096) - * @param $6: The size of the new disk, in blocks - * @param $7: The read password - * @param $8: The write password - * @param $9: The multi password - * - * @return 0 If the disk was added successfully - * 1 If given invalid parameters - * 2 If disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC < 7 || argC > 10) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* pool = argV[2]; - char* vdev = argV[3]; - char* mode = argV[4]; - int blocksize = atoi(argV[5]); - int size = atoi(argV[6]); - - // Read password - char* readPw = ""; - if (argC > 8 && argV[7]) - readPw = argV[7]; - - // Write password - char* writePw = ""; - if (argC > 9 && argV[8]) - writePw = argV[8]; - - // Mutli password - // In order to link to a disk, a multi password must be specified - char* multiPw = ""; - if (argC > 10 && argV[9]) - multiPw = argV[9]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - int unit; - switch (blocksize) { - case 512: - unit = 2; - break; - case 1024: - unit = 3; - break; - case 2048: - unit = 4; - break; - case 4096: - unit = 5; - break; - default: - printf("Error: Block size must be 512, 1024, 2048, or 4096\n"); - return 1; - } - - printf("Adding disk %s to %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskCreateDmOutput* output; - - int rc = smImage_Disk_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, "9336", "AUTOG", pool, unit, size, mode, 1, "", // Do not format disk. Do not give disk a label. - readPw, writePw, multiPw, // Read, write, and multi passwords. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/addnic.c b/zhcp/BUILD/resource_access/src/addnic.c deleted file mode 100644 index 5697ba5..0000000 --- a/zhcp/BUILD/resource_access/src/addnic.c +++ /dev/null @@ -1,85 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Adds a network adapter to a virtual image's directory entry. - * - * @param $1: The z/VM guest for which a NIC is being allocated - * @param $2: The virtual device address of the NIC being allocated - * @param $3: The type of NIC which is to be allocated - * @param $4: The number of VDEV channels associated with this NIC - * - * @return 0 If the NIC was added successfully - * 1 If given invalid parameters - * 2 If the NIC definition failed - */ -int main(int argC, char * argV[]) { - - if (argC != 5) { - printf("Error: Wrong number of parameters"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - char* type = argV[3]; - int devcount = atoi(argV[4]); - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - int typecode; - if (!strcmp(type, "HiperSockets")) { - typecode = 1; - } else if (!strcmp(type, "QDIO")) { - typecode = 2; - } else { - printf("Error: NIC type must be HiperSockets or QDIO\n"); - return 1; - } - - printf("Adding NIC %s to %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterCreateDmOutput* output; - - int rc = smVirtual_Network_Adapter_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, address, typecode, devcount, "", // Only relevant for a second-level z/OS. - "", // The MAC identifier. - &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/addprocessor.c b/zhcp/BUILD/resource_access/src/addprocessor.c deleted file mode 100644 index fb6e5f3..0000000 --- a/zhcp/BUILD/resource_access/src/addprocessor.c +++ /dev/null @@ -1,67 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a non-dedicated processor to a virtual image's directory entry. - * - * @param $1: The z/VM guest to which a processor is to be added - * @param $2: The virtual device address for the processor being added - * - * @return 0 If the processor was created - * 1 If given invalid parameters - * 2 If the processor definition failed - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; // Hexedecimal string, 00-3F - - printf("Adding processor %s to %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageCpuDefineDmOutput* output; - - int rc = smImage_CPU_Define_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, address, 0, // Base CPU status unspecified. - "", // The processor identification number. - 1, // Not a dedicated processor. - 0, // Do not specify a cryptographic facility. - &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/addvdisk.c b/zhcp/BUILD/resource_access/src/addvdisk.c deleted file mode 100644 index 72feb27..0000000 --- a/zhcp/BUILD/resource_access/src/addvdisk.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a v-disk to a virtual image’s directory entry. - * - * @param $1: The name of the guest to which a disk is to be added - * @param $2: The virtual device address for the newly-allocated volume - * @param $3: The size of the new disk, in 512-byte blocks - * - * @return 0 If the disk was added successfully - * 1 If given invalid parameters - * 2 If disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC != 4) { - printf("Error: Wrong number of parameters\n"); - return -1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - int size = atoi(argV[3]); - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Adding V-Disk %s to %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskCreateDmOutput* output; - - int rc = smImage_Disk_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, "FB-512", // Required for V-Disk devices. - "V-DISK", "NONE", // No disk pool (value is ignored). - 2, // Allocation unit is BLK0512. - size, "W", // Writable. - 0, "", // Formatting unspecified, no label. - "", "", "", // Read, write, and multi passwords. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/connectnic2guestlan.c b/zhcp/BUILD/resource_access/src/connectnic2guestlan.c deleted file mode 100644 index 58d25e6..0000000 --- a/zhcp/BUILD/resource_access/src/connectnic2guestlan.c +++ /dev/null @@ -1,72 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Connect network adapter to a GuestLAN. - * - * @param $1: The user for which a NIC is being connected - * @param $2: The virtual device address of the NIC being connected - * @param $3: The name of the LAN to which the NIC is to be connected - * @param $4: The virtual image owning the GuestLAN segment to be connected - * - * @return 0 If the NIC was added successfully - * 1 If given invalid parameters - * 2 If the NIC could not be connected to the VSwitch - */ -int main(int argC, char * argV[]) { - - if (argC != 5) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - char* lan = argV[3]; - char* owner = argV[4]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image) || isImageNameInvalid(owner)) - return 1; - - printf("Connecting NIC %s to GuestLan %s on %s... ", address, lan, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterConnectVswitchDmOutput* output; - - int rc = smVirtual_Network_Adapter_Connect_LAN_DM(&context, "", 0, "", - image, address, lan, owner, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/connectnic2vswitch.c b/zhcp/BUILD/resource_access/src/connectnic2vswitch.c deleted file mode 100644 index b9d04a8..0000000 --- a/zhcp/BUILD/resource_access/src/connectnic2vswitch.c +++ /dev/null @@ -1,71 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Connect network adapter to a VSwitch. - * - * @param $1: The user for which a NIC is being connected - * @param $2: The virtual device address of the NIC being connected - * @param $3: The name of the VSwitch to which the NIC is to be connected - * - * @return 0 If the NIC was added successfully - * 1 If given invalid parameters - * 2 If the NIC could not be connected to the VSwitch - */ -int main(int argC, char * argV[]) { - - if (argC != 4) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - char* vswitch = argV[3]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Connecting NIC %s to VSwitch %s on %s... ", address, vswitch, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterConnectVswitchDmOutput* output; - - int rc = smVirtual_Network_Adapter_Connect_Vswitch_DM(&context, "", 0, "", - image, address, vswitch, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/createvs.c b/zhcp/BUILD/resource_access/src/createvs.c deleted file mode 100644 index ec371ae..0000000 --- a/zhcp/BUILD/resource_access/src/createvs.c +++ /dev/null @@ -1,231 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Creates a z/VM guest with the specified name. - * - * @param $1: The name of the guest which is to be created - * - * @return 0 If the virtual image now exists - * 1 If given invalid parameters - * 2 If image creation failed - */ -int main(int argC, char * argV[]) { - - // Should be only 1 or 2 arguments - if (argC < 2 || argC > 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Get image name - char * imageName = argV[1]; - - // Check if image name is between 1 and 8 characters - if (isImageNameInvalid(imageName)) - return 1; - - printf("Creating user directory entry for %s... ", imageName); - - // Create DirMaint directory entry - int rc; - if (argC == 3) { - rc = createUsingFile(imageName, argV[2]); - } - // If no user directory entry is given, create a NOLOG userID - else { - rc = createNoLog(imageName); - } - - return rc; -} - -/** - * Creates a z/VM guest with the specified name using a directory entry file. - * - * @param $1: The name of the guest which is to be created - * @param $2: The directory entry in a file - * - * @return 0 If the virtual image now exists - * 1 If given invalid parameters - * 2 If image creation failed - */ -int createUsingFile(char * imageName, char * file) { - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageCreateDmOutput * output; - - int rc; - FILE * userProfile; - - // Open file for user directory entry - userProfile = fopen(file, "r"); - if (userProfile == NULL) - printf(" Error: Failed to open %s\n", file); - else { - // Read in user directory entry - int recordCount = 0, i = 0; - char line[100], buffer[30][100]; - char * ptr; - while (!feof(userProfile)) { - // Read in 100 characters - fgets(line, 100, userProfile); - - // Delete new line - ptr = strstr(line, "\n"); - if (ptr != NULL) { - strncpy(ptr, "\0", 1); - } - - // Copy line into buffer - strcpy(buffer[i], line); - i++; - - if (!feof(userProfile)) - recordCount++; - } - - // Check USER line for correct virtual server name - ptr = strstr(buffer[0], imageName); - char newLine[100]; - // If the virtual server name is NOT in the USER line - if (ptr == NULL) { - // Insert virtual server name into the USER line - ptr = strtok(buffer[0], " "); - - int i = 0; - while (ptr != NULL) { - if (i == 1) { - strcat(newLine, imageName); - } else { - strcat(newLine, ptr); - } - strcat(newLine, " "); - ptr = strtok(NULL, " "); - i++; - } - - strcpy(buffer[0], newLine); - } - - // Create image record - vmApiImageRecord record[recordCount]; - // Copy buffer contents into image record - for (i = 0; i < recordCount; i++) { - record[i].imageRecordLength = strlen(buffer[i]); - record[i].imageRecord = buffer[i]; - } - - // Close user directory entry - fclose(userProfile); - - rc = smImage_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - imageName, // Image name. - "", // The prototype to use for creating the image. - 0, "", // Initial password length, initial password. - "", recordCount, // Initial account number, image record array length - &record, // Image record. - &output); - } - - if (rc || (output->common.returnCode && output->common.returnCode != 400 - && output->common.returnCode != 592) - || (output->common.reasonCode && output->common.reasonCode != 8 - && output->common.reasonCode != 0)) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } - - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; -} - -/** - * Creates a z/VM guest with the specified name with NOLOG. - * - * @param $1: The name of the guest which is to be created - * - * @return 0 If the virtual image now exists - * 1 If given invalid parameters - * 2 If image creation failed - */ -int createNoLog(char * imageName) { - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageCreateDmOutput * output; - - int rc; - char userLine[19] = "USER "; - strcat(userLine, imageName); - strcat(userLine, " NOLOG"); - - vmApiImageRecord record; - record.imageRecordLength = 19; // Length of image_record - record.imageRecord = userLine; // The user or profile entry - - rc = smImage_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - imageName, // Image name. - "", // The prototype to use for creating the image. - 0, "", // Initial password length, initial password. - "", 1, // Initial account number, image record array length - &record, // Image record. - &output); - - if (rc || (output->common.returnCode && output->common.returnCode != 400 - && output->common.returnCode != 592) - || (output->common.reasonCode && output->common.reasonCode != 8 - && output->common.reasonCode != 0)) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/dedicatedevice.c b/zhcp/BUILD/resource_access/src/dedicatedevice.c deleted file mode 100644 index b202796..0000000 --- a/zhcp/BUILD/resource_access/src/dedicatedevice.c +++ /dev/null @@ -1,80 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a dedicated device to a virtual image's directory entry. - * - * @param $1: The name of the guest to which a device is to be added - * @param $2: The virtual device address to be assigned to the device - * @param $3: The device's real address - * - * @return 0 If the dedicated device was added successfully - * 1 If given invalid parameters - * 2 If device dedication failed - */ -int main(int argC, char* argV[]) { - - if (argC != 5) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - char* rdev = argV[3]; - char* mode = argV[4]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - int readonly; - if (strcmp(mode, "RW") == 0 || strcmp(mode, "rw") == 0) { - readonly = 0; - } else if (strcmp(mode, "RO") == 0 || !strcmp(mode, "ro") == 0) { - readonly = 1; - } else { - printf("Error: Mode must be in RW or RO\n"); - return 1; - } - - printf("Adding device %s as %s to %s... ", rdev, vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDeviceDedicateDmOutput* output; - - int rc = smImage_Device_Dedicate_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, rdev, readonly, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/deleteipl.c b/zhcp/BUILD/resource_access/src/deleteipl.c deleted file mode 100644 index 5b4062b..0000000 --- a/zhcp/BUILD/resource_access/src/deleteipl.c +++ /dev/null @@ -1,65 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Deletes the IPL statement for the z/VM guest with the specified name. - * - * @param $1: The name of the guest from which the IPL statement is to be removed - * - * @return 0 If the no IPL statement exists upon completion - * 1 If given invalid parameters - * 2 If IPL statement removal failed - */ -int main(int argC, char * argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Removing IPL statement on %s... ", image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageIplDeleteDmOutput* output; - - int rc = smImage_IPL_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/deletevs.c b/zhcp/BUILD/resource_access/src/deletevs.c deleted file mode 100644 index 8f703db..0000000 --- a/zhcp/BUILD/resource_access/src/deletevs.c +++ /dev/null @@ -1,72 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Deletes the specified z/VM virtual server. - * - * @param $1: The name of the virtual server which is to be deleted - * - * @return 0 If the image is not present in the directory upon completion - * 1 If given invalid parameters - * 2 If image deletion failed - */ -int main(int argC, char* argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - // Get the virtual server name - char* imageName = argV[1]; - // Check if the virtual server name is between 1 and 8 characters - if (isImageNameInvalid(imageName)) - return 1; - - printf("Deleting virtual server %s... ", imageName); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDeleteDmOutput* output; - - // Delete z/VM virtual server - int rc = smImage_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - imageName, // Image name. - 1, // Do not erase data from disks being released. - &output); - - if (rc || (output->common.returnCode && output->common.returnCode != 400 - && output->common.returnCode != 592) - || (output->common.reasonCode && output->common.reasonCode != 4 - && output->common.reasonCode != 0)) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} - diff --git a/zhcp/BUILD/resource_access/src/disconnectnic.c b/zhcp/BUILD/resource_access/src/disconnectnic.c deleted file mode 100644 index b698f9c..0000000 --- a/zhcp/BUILD/resource_access/src/disconnectnic.c +++ /dev/null @@ -1,69 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Disconnect network adapter. - * - * @param $1: The user for which a NIC is being disconnected - * @param $2: The virtual device address of the NIC being disconnected - * - * @return 0 If the NIC was successfully disconnected - * 1 If given invalid parameters - * 2 If the NIC could not be disconnected - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Disconnecting NIC %s on %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterDisconnectDmOutput* output; - - int rc = smVirtual_Network_Adapter_Disconnect_DM(&context, "", 0, "", - image, address, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/getdiskpool.c b/zhcp/BUILD/resource_access/src/getdiskpool.c deleted file mode 100644 index 9a4262d..0000000 --- a/zhcp/BUILD/resource_access/src/getdiskpool.c +++ /dev/null @@ -1,100 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Get the free and used space in a given disk pool. - * - * @param $1: The name of the guest to get the disk pool from - * @param $2: The name of the disk pool - * @param $2: Free or used space in the disk pool - * - * @return 0 If the disk pool was successfully printed - * 1 If given invalid parameters - * 2 If the disk pool could not be retrieved - */ -int main(int argC, char * argV[]) { - if (argC != 4) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char * image = argV[1]; - char * pool = argV[2]; - char * spaceStr = argV[3]; - - // Get the disk space - int space; - if (strcmp(spaceStr, "free") == 0) { - space = 2; - } else if (strcmp(spaceStr, "used") == 0) { - space = 3; - } else { - printf("Error: Disk pool space must be free or used\n"); - return 1; - } - - VmApiInternalContext context; - vmApiImageRecord * record; - char temp[1024]; - char * token; - char diskStr[256]; - int i; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageVolumeSpaceQueryDmOutput * output; - - // Get disk pool used space - int rc = smImage_Volume_Space_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, space, // Used space - 3, // Query group - pool, &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - record = output->recordList; - for (i = 0; i < output->recordCount; i++) { - strncpy(temp, record->imageRecord, record->imageRecordLength); - - token = strtok_r(temp, " ", &context); // VolId - strcpy(diskStr, token); - strcat(diskStr, " "); - token = strtok_r(NULL, " ", &context); // Device type - strcat(diskStr, token); - strcat(diskStr, " "); - token = strtok_r(NULL, " ", &context); // Start address - strcat(diskStr, token); - strcat(diskStr, " "); - token = strtok_r(NULL, " ", &context); // Size - strcat(diskStr, token); - - printf("%s\n", diskStr); - record++; - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/getdiskpoolnames.c b/zhcp/BUILD/resource_access/src/getdiskpoolnames.c deleted file mode 100644 index ad957c4..0000000 --- a/zhcp/BUILD/resource_access/src/getdiskpoolnames.c +++ /dev/null @@ -1,73 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Get a list of defined disk pools. - * - * @param $1: The name of the guest to get a list of disk pools for - * - * @return 0 If the disk pools were successfully printed - * 1 If given invalid parameters - * 2 If the disk pools could not be retrieved - */ -int main(int argC, char * argV[]) { - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - - VmApiInternalContext context; - vmApiImageRecord * record; - char * poolName; - int i; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageVolumeSpaceQueryDmOutput * output; - - int rc = smImage_Volume_Space_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, 1, // Query definition - 3, // Query group - "*", // All areas - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - record = output->recordList; - for (i = 0; i < output->recordCount; i++) { - // Get disk pool name from each record - poolName = strtok_r(record->imageRecord, " ", &context); - if (poolName) { - printf("%s\n", poolName); - } - record++; - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/getipl.c b/zhcp/BUILD/resource_access/src/getipl.c deleted file mode 100644 index e7d91c3..0000000 --- a/zhcp/BUILD/resource_access/src/getipl.c +++ /dev/null @@ -1,63 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Prints out the specified DirMaint profile entry. - * - * @param $1: The name of the profile which is to be listed - * - * @return 0 If the IPL entry was successfully printed - * 1 If given invalid parameters - * 2 If the IPL entry could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageIplQueryDmOutput* output; - - int rc = smImage_IPL_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("IPL target: %s\n" - "LoadParms: %s\n" - "Parameters: %s\n", output->savedSystem, output->loadParameter, - output->parameters); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/getuserentry.c b/zhcp/BUILD/resource_access/src/getuserentry.c deleted file mode 100644 index ca185dd..0000000 --- a/zhcp/BUILD/resource_access/src/getuserentry.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Prints out the specified DirMaint directory entry. - * - * @param $1: The name of the z/VM guest which is to be listed - * - * @return 0 If the image record was successfully printed - * 1 If given invalid parameters - * 2 If the image could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Image name - char * image = argV[1]; - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageQueryDmOutput * output; - - // Query DirMaint directory entry - int rc = smImage_Query_DM(&context, "", 0, "", image, &output, false); - - // Handle return code and reason code - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return code: %d\n", rc) : printf(" Return code: %d\n" - " Reason code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - // Print out DirMaint directory entry - int recCount = output->imageRecordCount; - int recLen = output->imageRecordList[0].imageRecordLength - 8; - - // Line to print - char line[recLen], chs[4]; - - if (recCount > 0) { - int i; - int token = 0; - - // Loop through image record and print out directory entry - for (i = 0; i < recCount; i++) { - memset(line, 0, recLen); - memcpy(line, output->imageRecordList[i].imageRecord, recLen); - - // Print lines that are not comment - trim(line); - - // Copy first 4 characters - strncpy(chs, line, 4); - - // If first 4 characters does not have * (comment) - if (!strstr(chs, "*")) { - // Print directory entry line - printf("%s\n", line); - } - } - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/getuserentrynames.c b/zhcp/BUILD/resource_access/src/getuserentrynames.c deleted file mode 100644 index 473a2c5..0000000 --- a/zhcp/BUILD/resource_access/src/getuserentrynames.c +++ /dev/null @@ -1,62 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "wrapperutils.h" - -/** - * Prints out a list of defined image names on a z/VM system. - * - * @return 0 If the list of image names was successfully printed - * 1 If given invalid parameters - * 2 If the image name list could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC > 1) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageNameQueryDmOutput* output; - - int rc = smImage_Name_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - "NA", // Doesn't matter what image name we use. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - int i; - int n = output->nameCount; - for (i = 0; i < n; i++) { - printf("%s\n", output->nameList[i]); - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/getuserprofile.c b/zhcp/BUILD/resource_access/src/getuserprofile.c deleted file mode 100644 index 0bedf31..0000000 --- a/zhcp/BUILD/resource_access/src/getuserprofile.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Prints out the specified profile. - * - * @param $1: The name of the profile which is to be listed - * - * @return 0 If the profile was successfully printed - * 1 If given invalid parameters - * 2 If the profile could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Image name - char * profile = argV[1]; - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiProfileQueryDmOutput * output; - - // Query DirMaint profile - int rc = smProfile_Query_DM(&context, "", // Authorizing user - 0, // Password length - "", // Password - profile,// Profile name - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return code: %d\n", rc) : printf(" Return code: %d\n" - " Reason code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - // Print out DirMaint directory entry - int i; - int recCount = output->profileRecordCount; - int recLen = 72; - - // Line to print - char line[recLen], chs[4]; - - if (recCount > 0) { - // Loop through image record and print out directory entry - for (i = 0; i < recCount; i++) { - memset(line, 0, recLen); - memcpy(line, output->profileRecordList[i].recordData, recLen); - - // Print lines that are not comment - trim(line); - - // Copy first 4 characters - strncpy(chs, line, 4); - - // If first 4 characters does not have * (comment) - if (!strstr(chs, "*")) { - printf("%s\n", line); - } - } // End of for - } - } // End of else - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; -} diff --git a/zhcp/BUILD/resource_access/src/queryvolumes.c b/zhcp/BUILD/resource_access/src/queryvolumes.c deleted file mode 100644 index 37d262f..0000000 --- a/zhcp/BUILD/resource_access/src/queryvolumes.c +++ /dev/null @@ -1,93 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Prints out information about disk spaces on a z/VM system. - * - * @param $1: The type of query to run - * @param $2: The type of space to query - * - * @return 0 If the virtual image was created - * 1 If given invalid parameters - * 2 If the image name list could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* queryType = argV[1]; - char* entryType = argV[2]; - - int iQueryType; - if (!strcmp(queryType, "definition")) { - iQueryType = 1; - } else if (!strcmp(queryType, "free")) { - iQueryType = 2; - } else if (!strcmp(queryType, "used")) { - iQueryType = 3; - } else { - return 1; - } - - int iEntryType; - if (!strcmp(entryType, "volume")) { - iEntryType = 1; - } else if (!strcmp(entryType, "region")) { - iEntryType = 2; - } else if (!strcmp(entryType, "group")) { - iEntryType = 3; - } else { - return 1; - } - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageVolumeSpaceQueryDmOutput* output; - - int rc = smImage_Volume_Space_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - "NA", // Doesn't matter what image name we use. - iQueryType, iEntryType, "*", // List all spaces of specified type. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - int i, l; - int n = output->recordCount; - int p = 0; - for (i = 0; i < n; i++) { - l = output->recordList[i].imageRecordLength; - printf("%.*s\n", l, output->recordList[0].imageRecord + p); - p = p + l; - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/removemdisk.c b/zhcp/BUILD/resource_access/src/removemdisk.c deleted file mode 100644 index 1cd8114..0000000 --- a/zhcp/BUILD/resource_access/src/removemdisk.c +++ /dev/null @@ -1,69 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Removes a disk from a virtual image's directory entry - * - * @param $1: The name of the guest from which a disk is to be removed - * @param $2: The virtual device address of the volume which is to be removed - * - * @return 0 If the disk is not in the image's directory entry upon completion - * 1 If given invalid parameters - * 2 If the disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image) || isDevNumberInvalid(vdev)) - return 1; - - printf("Removing disk %s on %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskDeleteDmOutput* output; - - int rc = smImage_Disk_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, 0, // Use default setting for whether to erase data. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/removenic.c b/zhcp/BUILD/resource_access/src/removenic.c deleted file mode 100644 index d57e6d0..0000000 --- a/zhcp/BUILD/resource_access/src/removenic.c +++ /dev/null @@ -1,68 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Removes a network adapter from a virtual image's directory entry. - * - * @param $1: The z/VM guest from which the NIC is to be removed - * @param $2: The virtual device address of the NIC which is to be removed - * - * @return 0 If the NIC was removed successfully - * 1 If given invalid parameters - * 2 If the NIC removal failed - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - - if (isImageNameInvalid(image)) - return 1; - - printf("Removing NIC %s on %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterDeleteDmOutput* output; - - int rc = smVirtual_Network_Adapter_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, address, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/removeprocessor.c b/zhcp/BUILD/resource_access/src/removeprocessor.c deleted file mode 100644 index 980556d..0000000 --- a/zhcp/BUILD/resource_access/src/removeprocessor.c +++ /dev/null @@ -1,64 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Removes a processor to a virtual image's directory entry. - * - * @param $1: The name of the guest to which a processor is to be removed - * @param $2: The virtual address of the processor which is to be removed - * - * @return 0 If the processor was successfully removed - * 1 If given invalid parameters - * 2 If the specified processor remains after attempted removal - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; // Hexedecimal string, 00-3F - - printf("Removing processor %s on %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageCpuDeleteDmOutput* output; - - int rc = smImage_CPU_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, address, &output); - - if (rc || (output->returnCode && output->returnCode != 520 - || (output->reasonCode && output->reasonCode != 30))) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/replacevs.c b/zhcp/BUILD/resource_access/src/replacevs.c deleted file mode 100644 index d716b36..0000000 --- a/zhcp/BUILD/resource_access/src/replacevs.c +++ /dev/null @@ -1,202 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Replace specified user directory entry. - * - * @param $1: Name of the z/VM guest to replace the directory entry - * @param $2: Text file containing the new directory entry - * - * @return 0 If directory entry was successfully replaced - * 1 If given invalid parameters - * 2 If directory entry replace failed - */ -int main(int argC, char* argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Get user name - char* image = argV[1]; - char* file = argV[2]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - // Lock user directory entry - int rc = lockImage(image, &context); - - FILE * userDirEntry; - - // Open file for user directory entry - userDirEntry = fopen(file, "r"); - if (userDirEntry == NULL) - printf("Error: Failed to open %s\n", file); - else { - // Read in user directory entry - int recordCount = 0; - int i = 0; - char line[100], buffer[30][100]; - char * ptr; - while (!feof(userDirEntry)) { - // Read in 100 characters - fgets(line, 100, userDirEntry); - - // Delete new line - ptr = strstr(line, "\n"); - if (ptr != NULL) { - strncpy(ptr, "\0", 1); - } - - // Copy line into buffer - strcpy(buffer[i], line); - i++; - - if (!feof(userDirEntry)) - recordCount++; - } - - // Close user directory entry - fclose(userDirEntry); - - // Create image record - vmApiImageRecord record[recordCount]; - - // Copy buffer contents into image record - for (i = 0; i < recordCount; i++) { - record[i].imageRecordLength = strlen(buffer[i]); - record[i].imageRecord = buffer[i]; - } - - // Replace user directory entry - rc = replaceImage(image, &context, &record, recordCount); - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return rc; -} - -/** - * Lock specified user directory entry. - * - * @param $1: Name of the z/VM guest directory entry to lock - * - * @return 0 If directory entry was successfully locked - * 1 If given invalid parameters - * 2 If directory entry lock failed - */ -int lockImage(char * image, VmApiInternalContext context) { - printf("Locking %s... ", image); - - vmApiImageLockDmOutput * lockOutput; - int rc = smImage_Lock_DM(&context, "", // Authorizing user - 0, // Password length - "", // Password - image, // Image name - "", // Device virtual address - &lockOutput); - - if (rc || (lockOutput->returnCode && lockOutput->returnCode != 400 - || (lockOutput->reasonCode && lockOutput->reasonCode != 12))) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", lockOutput->returnCode, - lockOutput->reasonCode); - - return 2; - } else { - printf("Done\n"); - return 0; - } -} - -/** - * Unlock specified user directory entry. - * - * @param $1: Name of the z/VM guest directory entry to unlock - * - * @return 0 If directory entry was successfully unlocked - * 1 If given invalid parameters - * 2 If directory entry unlock failed - */ -int unlockImage(char * image, VmApiInternalContext context) { - printf("Unlocking %s... ", image); - - vmApiImageUnlockDmOutput * unlockOutput; - int rc = smImage_Unlock_DM(&context, "", // Authorizing user - 0, // Password length - "", // Password - image, // Image name - "", // Device virtual address - &unlockOutput); - - if (rc || unlockOutput->returnCode || unlockOutput->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", unlockOutput->returnCode, - unlockOutput->reasonCode); - - return 2; - } else { - printf("Done\n"); - return 0; - } -} - -/** - * Replace specified user directory entry. - * - * @param $1: Name of the z/VM guest to replace the directory entry - * - * @return 0 If directory entry was successfully unlocked - * 1 If given invalid parameters - * 2 If directory entry unlock failed - */ -int replaceImage(char * image, VmApiInternalContext context, - vmApiImageRecord * record, int recordCount) { - printf("Replacing directory entry of %s... ", image); - - vmApiImageReplaceDmOutput* replaceOutput; - int rc = smImage_Replace_DM(&context, "", // Authorizing user - 0, // Password length - "", // Password - image, // Image name - recordCount, // Record count - record, // Record array - &replaceOutput); - - if (rc || replaceOutput->returnCode || replaceOutput->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", replaceOutput->returnCode, - replaceOutput->reasonCode); - - // Unlock user directory entry - rc = unlockImage(image, context); - return 2; - } else { - printf("Done\n"); - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/setipl.c b/zhcp/BUILD/resource_access/src/setipl.c deleted file mode 100644 index 97008ad..0000000 --- a/zhcp/BUILD/resource_access/src/setipl.c +++ /dev/null @@ -1,71 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Sets the IPL statement for the z/VM guest with the specified name. - * - * @param $1: The name of the guest for which the IPL statement is to be set. - * @param $2: The new IPL statement's IPL target string. - * @param $3: The new IPL statement's load parameter string. - * @param $4: The new IPL statement's parameter string. - * - * @return 0 If the virtual image now exists - * 1 If given invalid parameters - * 2 If image creation failed - */ -int main(int argC, char * argV[]) { - - if (argC != 5) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* ipltarget = argV[2]; - char* loadparms = argV[3]; - char* parms = argV[4]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Setting IPL statement on %s... ", image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageIplSetDmOutput* output; - - int rc = smImage_IPL_Set_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, ipltarget, loadparms, parms, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/setpassword.c b/zhcp/BUILD/resource_access/src/setpassword.c deleted file mode 100644 index 6bbf67c..0000000 --- a/zhcp/BUILD/resource_access/src/setpassword.c +++ /dev/null @@ -1,67 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Sets the password for the z/VM guest with the specified name. - * - * @param $1: The name of the guest for which a password is to be set - * @param $2: The guest's new password - * - * @eeturn 0 If the password was set - * 1 If given invalid parameters - * 2 If setting the password failed - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* password = argV[2]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Setting password for %s... ", image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImagePasswordSetDmOutput* output; - - int rc = smImage_Password_Set_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, strlen(password), password, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/smMemoryGroup.c b/zhcp/BUILD/resource_access/src/smMemoryGroup.c deleted file mode 100644 index 338b4bf..0000000 --- a/zhcp/BUILD/resource_access/src/smMemoryGroup.c +++ /dev/null @@ -1,140 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "smPublic.h" - -int quantum = 64; - -int smMemoryGroupInitialize(struct _VmApiInternalContext* vmapiContextP) { - smMemoryGroupContext * context = vmapiContextP->memContext; - // Set up a tracking array with no allocated chunks yet - context->arraySize = quantum; - context->chunks = (void **) malloc(context->arraySize * sizeof(void *)); - if (context->chunks == 0) { - errorLine(vmapiContextP, "smMemoryGroupInitialize: out of memory"); - return MEMORY_ERROR; - } - context->lastChunk = -1; - - // Return successfully - return 0; -} - -void * smMemoryGroupAlloc(struct _VmApiInternalContext* vmapiContextP, - size_t size) { - int rc; - smMemoryGroupContext * context = vmapiContextP->memContext; - - // Check that memory structure is initialized, if not then call to init. - if (context->arraySize < quantum || context->chunks == 0) { - rc = smMemoryGroupInitialize(vmapiContextP); - if (rc != 0) - return 0; // Return of 0 is error in this case - } - // Increment to the next unused entry in the tracking array - context->lastChunk = context->lastChunk + 1; - - // If we're past the end of the array, enlarge it by the quantum - if (context->lastChunk == context->arraySize) { - context->arraySize = context->arraySize + quantum; - void ** reallocated = (void **) realloc(context->chunks, - context->arraySize * sizeof(void *)); - if (NULL == reallocated) { - errorLine(vmapiContextP, "smMemory realloc: out of memory"); - return NULL; - } else { - context->chunks = reallocated; - } - } - - // Obtain the memory and record it in the tracking array - context->chunks[context->lastChunk] = malloc(size); - - // clear out the memory chunk if obtained - if (context->chunks[context->lastChunk]) { - memset(context->chunks[context->lastChunk], 0, size); - } - - // Return the pointer - return context->chunks[context->lastChunk]; -} - -void * smMemoryGroupRealloc(struct _VmApiInternalContext* vmapiContextP, - void * chunk, size_t size) { - smMemoryGroupContext * context = vmapiContextP->memContext; - // Variables - int i; - int rc; - void * newChunk; - - // Check that memory structure is initialized, if not then call to init - if (context->arraySize < quantum || context->chunks == 0) { - rc = smMemoryGroupInitialize(vmapiContextP); - if (rc != 0) - return 0; // Return of 0 is error in this case - } - - // Find this chunk in the tracking array and reallocate it - newChunk = NULL; - for (i = 0; (i <= context->lastChunk) && (newChunk == NULL); i++) { - if (context->chunks[i] == chunk) { - char *reallocated = realloc(context->chunks[i], size); - if (NULL == reallocated) { - errorLine(vmapiContextP, - "smMemory group realloc: out of memory"); - return NULL; - } else { - context->chunks[i] = reallocated; - } - newChunk = context->chunks[i]; - } - } - - // Return the new pointer - return newChunk; - -} - -int smMemoryGroupFreeAll(struct _VmApiInternalContext* vmapiContextP) { - smMemoryGroupContext * context = vmapiContextP->memContext; - // Variables - int i; - - // Check that memory structure is initialized, if not then just return - if (context->arraySize < quantum || context->chunks == 0) { - return 0; - } - - // Free all the memory recorded in the tracking array - for (i = 0; i <= context->lastChunk; i++) { - if (context->chunks[i]) - FREE_MEMORY(context->chunks[i]); - } - - // Reset the tracking array to empty - if (context->arraySize != quantum) { - context->arraySize = quantum; - context->chunks = (void **) realloc(context->chunks, context->arraySize - * sizeof(void *)); - } - context->lastChunk = -1; - - // Return successfully - return 0; - -} - -int smMemoryGroupTerminate(struct _VmApiInternalContext* vmapiContextP) { - smMemoryGroupContext * context = vmapiContextP->memContext; - - // Check that memory structure is initialized, if not then just return - if (context->arraySize < quantum || context->chunks == 0) { - return 0; - } - - // Free the tracking array - FREE_MEMORY(context->chunks); - - // Return successfully - return 0; -} diff --git a/zhcp/BUILD/resource_access/src/smSocket.c b/zhcp/BUILD/resource_access/src/smSocket.c deleted file mode 100644 index 6544274..0000000 --- a/zhcp/BUILD/resource_access/src/smSocket.c +++ /dev/null @@ -1,659 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef AF_IUCV -#define AF_IUCV 32 -#endif - -#ifndef PF_IUCV -#define PF_IUCV AF_IUCV -#endif - -struct sockaddr_iucv { - sa_family_t siucv_family; - unsigned short siucv_port; - unsigned int siucv_addr; - char siucv_nodeid[8]; - char siucv_userid[8]; - char siucv_name[8]; -}; - -// This macro is used to check return values on close -// and do one retry if the close had an EINTR error -#define CHECK_SOCKET_CLOSE(_SOCKETID_) \ -if (retValue)\ -{\ - saveCloseErrno = errno;\ - sprintf(line, "close() error on socket %d return value %d errno %d\n", _SOCKETID_,retValue, saveCloseErrno);\ - errorLog(vmapiContextP,\ - __func__,\ - TO_STRING(__LINE__),\ - RcIucv,\ - retValue,\ - line);\ - if (EINTR == saveCloseErrno)\ - {\ - retValue = close(_SOCKETID_);\ - if (retValue)\ - {\ - saveCloseErrno = errno;\ - sprintf(line, "retried close() error on socket %d return value %d errno %d\n", _SOCKETID_,retValue, saveCloseErrno);\ - errorLog(vmapiContextP,\ - __func__,\ - TO_STRING(__LINE__),\ - RcIucv,\ - retValue,\ - line);\ - }\ - }\ -} - -static const char* default_IUCV_server = "VSMREQIU"; -static const char* IUCV_programName = "DMSRSRQU"; - -int smSocketInitialize(struct _VmApiInternalContext* vmapiContextP, - int * sockId) { - -#define RETRY_CONNECTION_LIMIT 10 - const int SLEEP_TIMES[RETRY_CONNECTION_LIMIT] = { 0, 0, 1, 1, 2, 2, 8, 8, - 16, 32 }; - int retValue; - char line[LINESIZE]; - int length; - int retryConnection; - int saveErrno, saveCloseErrno; - struct sockaddr_iucv serverSockAddr; - struct timeval timeoutValue; - - // If the trace file has not been read yet, do it - if (!(vmapiContextP->smTraceDetails->traceFileRead)) { - readTraceFile(vmapiContextP); - } - - // Place holders for context and background starting - if (1 != vmapiContextP->contextCreatedFlag) { - retValue = initializeThreadSemaphores(vmapiContextP, "", 1); // Create context using no name to override current context name - if (retValue) { - sprintf( - line, - "smSocketInitialize(): context reserve() returned error: %d\n", - retValue); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, line); - return PROCESSING_ERROR; - } - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "smSocketInitialize: initializeThreadSemaphores completed successfully.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - // If the backend is not marked as running, check it - if (!vmapiContextP->checkBackendFlag) { - retValue = vmbkendCheck(vmapiContextP); - if (retValue) - return retValue; // If any error return - } - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - // Get a local socket - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "smSocketInitialize: trying to obtain local socket.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - *sockId = socket(PF_IUCV, SOCK_STREAM, IPPROTO_IP); - if (*sockId == -1) { - sprintf(line, "smSocketInitialize(): socket() returned errno: %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, *sockId, - line); - return SOCKET_OBTAIN_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "smSocketInitialize: local socket id %d obtained. Now trying connect loop. \n", - *sockId); - TRACE_END_DEBUG(vmapiContextP, line); - - // Initialize the server IUCV socket structure - memset(&serverSockAddr, 0, sizeof(serverSockAddr)); - serverSockAddr.siucv_family = AF_IUCV; - serverSockAddr.siucv_port = 0; - serverSockAddr.siucv_addr = 0; - memset(&serverSockAddr.siucv_nodeid, ' ', - sizeof(serverSockAddr.siucv_nodeid)); - memset(&serverSockAddr.siucv_userid, ' ', - sizeof(serverSockAddr.siucv_userid)); - memset(&serverSockAddr.siucv_name, ' ', sizeof(serverSockAddr.siucv_name)); - - timeoutValue.tv_usec = 0; - timeoutValue.tv_sec = 60; // Changed to 60 now that AF IUCV and CMS are working better - retValue = setsockopt(*sockId, SOL_SOCKET, SO_SNDTIMEO, - (struct timeval *) &timeoutValue, sizeof(struct timeval)); - if (retValue < 0) { - sprintf(line, "setsockopt(): connect timeout returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - retValue = close(*sockId); - CHECK_SOCKET_CLOSE(*sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Do we have an IUCV userID or just use the default? - // Do not copy in the null terminator on strings - length = strlen(vmapiContextP->IucvUserid); - if (length <= 0 || length > 8) { - memcpy(&serverSockAddr.siucv_userid, default_IUCV_server, strlen( - default_IUCV_server)); - } else { - memcpy(&serverSockAddr.siucv_userid, &vmapiContextP->IucvUserid, - strlen(vmapiContextP->IucvUserid)); - } - - // Add in the iucv program name constant - memcpy(&serverSockAddr.siucv_name[0], IUCV_programName, strlen( - IUCV_programName)); - - // Try to connect to the IUCV server - for (retryConnection = 1;; retryConnection++) { - retValue = connect(*sockId, (struct sockaddr *) &serverSockAddr, - sizeof(serverSockAddr)); - if (retValue != 0) { - saveErrno = errno; - sprintf(line, "connect() of socket %d returned %d errno %d\n", - *sockId, retValue, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - retValue, line); - // If we have exceeded the retry limit, then shutdown, close and return with error - if (retryConnection >= RETRY_CONNECTION_LIMIT) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "smSocketInitialize: connect retry limit exceeded.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - retValue = close(*sockId); - CHECK_SOCKET_CLOSE(*sockId); - switch (saveErrno) { - case ECONNREFUSED: - return SOCKET_CONNECT_REFUSED_ERROR; - case EAGAIN: - return SOCKET_CONNECT_TRYAGAIN_ERROR; - default: - return SOCKET_PROCESSING_ERROR; - } - } - - // Is this an errno that we can retry? If so continue the loop - switch (saveErrno) { - case ECONNREFUSED: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "====>>ECONNREFUSED, going to close and retry connect.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - case EAGAIN: - if (saveErrno == EAGAIN) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "====>>EAGAIN, going to close and retry connect.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - } - // Close the current socket - // Get a new one, and retry the connect - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "====>>closing the socket before retry.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - retValue = close(*sockId); - CHECK_SOCKET_CLOSE(*sockId) - ; - - // Delay for a while to give SMAPI some time to restart - if (SLEEP_TIMES[retryConnection] > 0) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "+++++++++ Sleeping for %d seconds\n", - SLEEP_TIMES[retryConnection]); - TRACE_END_DEBUG(vmapiContextP, line); - sleep(SLEEP_TIMES[retryConnection]); - } - - *sockId = socket(PF_IUCV, SOCK_STREAM, IPPROTO_IP); - if (*sockId == -1) { - sprintf( - line, - "smSocketInitialize(): socket() returned errno: %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcIucv, *sockId, line); - return SOCKET_OBTAIN_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "smSocketInitialize: retry obtained new local socket id %d. Now retrying connect.\n", - *sockId); - TRACE_END_DEBUG(vmapiContextP, line); - // Reset the return and reason codes in the context - vmapiContextP->rc = 0; - vmapiContextP->reason = 0; - - continue; // Try to connect again - - default: - break; // Shutdown the socket and return with error if errno is not listed - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "====>>closing the socket \n"); - TRACE_END_DEBUG(vmapiContextP, line); - - retValue = close(*sockId); - CHECK_SOCKET_CLOSE(*sockId); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "====>>return from closing the socket \n"); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - return SOCKET_PROCESSING_ERROR; - } else - break; // Got a good connection, leave loop - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "smSocketInitialize: Socket connect completed successfully.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - return 0; -} - -int smSocketWrite(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * data, int dataLen) { - - int retValue; - char line[LINESIZE]; - struct timeval timeoutValue; - int onValue = 1; - int saveErrno, saveCloseErrno; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_BUFFER_OUT); - dumpArea(vmapiContextP, data, dataLen); - TRACE_END; - - // Set the send socket timeout value - timeoutValue.tv_usec = 0; - timeoutValue.tv_sec = Socket_Timeout; - retValue = setsockopt(sockId, SOL_SOCKET, SO_SNDTIMEO, - (struct timeval *) &timeoutValue, sizeof(struct timeval)); - if (retValue < 0) { - sprintf(line, "setsockopt(): send timeout returned errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Set the reuse socket address value - onValue = 1; - retValue = setsockopt(sockId, SOL_SOCKET, SO_REUSEADDR, (int *) &onValue, - sizeof(int)); - if (retValue < 0) { - sprintf(line, "setsockopt(): reuse addr returned errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Write the data to the socket - while (dataLen > 0) { - retValue = send(sockId, (void *) data, dataLen, 0); - if (retValue < 0) { - saveErrno = errno; - // Log a special message and set the return and reason code if a timeout - if (errno == EAGAIN) { - sprintf(line, "smSocketWrite(): timeout errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsSocketTimeout, line); - } else { - sprintf(line, "smSocketWrite(): send() returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - errno, line); - } - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - if (saveErrno == EAGAIN) - return SOCKET_TIMEOUT_ERROR; - if (saveErrno == ENOTCONN) - return SOCKET_WRITE_RETRYABLE_ERROR; - return SOCKET_WRITE_ERROR; - } - data = data + retValue; - dataLen = dataLen - retValue; - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - return 0; -} - -int smSocketRead(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * buff, int len) { - - int retValue; - int lenRead; - int retryNoData; - char line[LINESIZE]; - retryNoData = 0; - struct timeval timeoutValue; - unsigned long ulTimeoutSeconds; - long ulTimeoutSecondsRequested = 0; - char * ptrTimeOutValue; - int onValue = 1; - void * buffPtr; - int buffLength; - int saveErrno, saveCloseErrno; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - buffPtr = (void *) buff; - buffLength = len; - ulTimeoutSeconds = Socket_Timeout; - - // Obtain read timeout environment variable - ptrTimeOutValue = getenv("ZVMMAP_READ_TIMEOUT_SECONDS"); - if (ptrTimeOutValue) { - ulTimeoutSecondsRequested = atol(ptrTimeOutValue); - if (ulTimeoutSecondsRequested > 0) { - ulTimeoutSeconds = ulTimeoutSecondsRequested; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "Socket read timeout set from enviromentVariable. %lu seconds.\n", - ulTimeoutSeconds); - TRACE_END_DEBUG(vmapiContextP, line); - } - } - - // Set the read socket timeout value - timeoutValue.tv_usec = 0; - timeoutValue.tv_sec = ulTimeoutSeconds; - retValue = setsockopt(sockId, SOL_SOCKET, SO_RCVTIMEO, - (struct timeval *) &timeoutValue, sizeof(struct timeval)); - if (retValue < 0) { - sprintf(line, "setsockopt(): receive timeout returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Set the reuse socket address value - onValue = 1; - retValue = setsockopt(sockId, SOL_SOCKET, SO_REUSEADDR, (int *) &onValue, - sizeof(int)); - if (retValue < 0) { - sprintf(line, "setsockopt(): reuse addr returned errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - /* Read the data from the socket */ - lenRead = 0; - while (lenRead < len) { - retValue = recv(sockId, buffPtr, buffLength, 0); - if (retValue < 0) { - saveErrno = errno; - // Log a special message and set the return and reason code if a timeout - if (errno == EAGAIN) { - sprintf(line, "smSocketRead(): timeout errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsSocketTimeout, line); - } else { - sprintf(line, "smSocketRead(): recv() returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - errno, line); - } - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - if (saveErrno == EAGAIN) - return SOCKET_TIMEOUT_ERROR; - if (saveErrno == ENOTCONN) - return SOCKET_READ_RETRYABLE_ERROR; - return SOCKET_READ_ERROR; - } - - // No data returned? - // Retry 10 times if we haven't received any data - if (retValue == 0) { - retryNoData++; - if (retryNoData > 10 && lenRead == 0) { - sprintf(line, - "smSocketRead(): recv() returned no data after 10 retries.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsUnexpected, line); - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_READ_ERROR; - } - } - lenRead += retValue; - buffPtr += retValue; - buffLength -= retValue; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_BUFFER_IN); - dumpArea(vmapiContextP, buff, lenRead); - TRACE_END; - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "smSocketRead(): read %d bytes of data \n", lenRead); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - return 0; -} - -int smSocketReadLoop(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * buff, int len) { - - int retValue; - int lenRead; - int retryNoData; - char line[LINESIZE]; - retryNoData = 0; - struct timeval timeoutValue; - unsigned long ulTimeoutSeconds; - long ulTimeoutSecondsRequested = 0; - char * ptrTimeOutValue; - void * buffPtr; - int buffLength; - int saveErrno, saveCloseErrno; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "--> Inside smSocketReadLoop:.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - buffPtr = (void *) buff; - buffLength = len; - - ulTimeoutSeconds = Socket_Indication_Timeout; - - // Obtain read timeout environment variable - ptrTimeOutValue = getenv("ZVMMAP_READ_INDICATION_TIMEOUT_SECONDS"); - if (ptrTimeOutValue) { - ulTimeoutSecondsRequested = atol(ptrTimeOutValue); - if (ulTimeoutSecondsRequested > 0) { - ulTimeoutSeconds = ulTimeoutSecondsRequested; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "Socket read indication timeout set from enviromentVariable. %lu seconds.\n", - ulTimeoutSeconds); - TRACE_END_DEBUG(vmapiContextP, line); - } - } - - // Set the read socket timeout value - timeoutValue.tv_usec = 0; - timeoutValue.tv_sec = ulTimeoutSeconds; - retValue = setsockopt(sockId, SOL_SOCKET, SO_RCVTIMEO, - (struct timeval *) &timeoutValue, sizeof(struct timeval)); - if (retValue < 0) { - sprintf(line, "setsockopt(): receive timeout returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Read the data from the socket - lenRead = 0; - while (lenRead < len) { - retValue = recv(sockId, buffPtr, buffLength, 0); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "--> return value of recv inside socketReadLoop = %d \n", - retValue); - TRACE_END_DEBUG(vmapiContextP, line); - - if (retValue < 0) { - saveErrno = errno; - // Log a special message and set the return and reason code if a timeout - if (errno == EAGAIN) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "--> Errno inside socketReadLoop = %d for recv() return value = %d \n", - errno, retValue); - TRACE_END_DEBUG(vmapiContextP, line); - - return CUSTOM_DEFINED_SOCKET_RETRY; - - } else { - sprintf(line, "smSocketRead(): recv() returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - errno, line); - } - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - if (saveErrno == EAGAIN) - return SOCKET_TIMEOUT_ERROR; - if (saveErrno == ENOTCONN) - return SOCKET_READ_RETRYABLE_ERROR; - return SOCKET_READ_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "smSocketRead(): retValue %d \n", retValue); - TRACE_END_DEBUG(vmapiContextP, line); - - // No data returned? - //Retry 100 times if we haven't received any data - if (retValue == 0) { - retryNoData++; - if (retryNoData > 100 && lenRead == 0) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "--> Errno inside socketReadLoop = %d for recv() return value = %d \n", - errno, retValue); - TRACE_END_DEBUG(vmapiContextP, line); - - return CUSTOM_DEFINED_SOCKET_RETRY; - } - } - lenRead += retValue; - buffPtr += retValue; - buffLength -= retValue; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_BUFFER_IN); - dumpArea(vmapiContextP, buff, lenRead); - TRACE_END; - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "smSocketRead(): read %d bytes of data \n", lenRead); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - return 0; -} - -int smSocketTerminate(struct _VmApiInternalContext* vmapiContextP, int sockId) { - int retValue; - char line[LINESIZE]; - int saveCloseErrno; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - retValue = close(sockId); - if (retValue != 0) { - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - return 0; -} diff --git a/zhcp/BUILD/resource_access/src/smapiTableParser.c b/zhcp/BUILD/resource_access/src/smapiTableParser.c deleted file mode 100644 index 1d8b02a..0000000 --- a/zhcp/BUILD/resource_access/src/smapiTableParser.c +++ /dev/null @@ -1,929 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smapiTableParser.h" -#include -#include -#include -#include "smPublic.h" -#include "smSocket.h" - -// Internal function to handle imbedded arrays in smapi output -static int handleArrays(struct _VmApiInternalContext* vmapiContextP, - enum tableParserModes mode, int * tableStartingIndex, - tableLayout table, tableParserParms * parms); - -int parseBufferWithTable(struct _VmApiInternalContext* vmapiContextP, - enum tableParserModes mode, tableLayout table, tableParserParms *parms) { - int temp, dataType, i, rc, iSize, reachedByteCount; - int cStringArrayPtrOffset, cStringArrayPtrIndex; - int cStringCounterFieldOffset, cStringCounterFieldIndex; - int cStringStructIndex, cStringStructSize; - int cStringFieldIndex, cStringFieldOffset, cStringCurrentStructCount; - char line[LINESIZE]; - - reachedByteCount = 0; // Set this if we are at the end of the data - - // If this is a SCAN mode; clear out the output fields - if (mode == scan) { - parms->outStringByteCount = 0; - for (i = 0; i < MAX_STRUCT_ARRAYS; i++) { - parms->outStructCount[i] = 0; - parms->outStructSizes[i] = 0; - } - } - - parms->byteCount = 0; - - // First entry in the table must be the base structure size - if (table[0][COL_1_TYPE] != APITYPE_BASE_STRUCT_LEN) { - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - - // If this is scan mode, fill in the output array size for top level structure - if (mode == scan) { - parms->outStructSizes[0] = table[0][COL_6_SIZE_OR_OFFSET]; - parms->outStructCount[0] = 1; - } - - for (i = 1; (table[i][COL_1_TYPE] != APITYPE_END_OF_TABLE) - && (parms->byteCount < parms->dataBufferSize); i++) { - dataType = table[i][COL_1_TYPE]; - switch (dataType) { - case APITYPE_INT1: - if (mode == populate) { - memcpy((parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET]), - parms->smapiBufferCursor, 1); - } - parms->smapiBufferCursor += 1; - parms->byteCount += 1; - break; - - case APITYPE_INT4: - if (mode == populate) { - GET_INT(*((int *) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])), - parms->smapiBufferCursor); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "int 4 found Value %d stored at %p(+%d) \n", - *((int *) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])), - parms->inStructAddrs[0], table[i][COL_6_SIZE_OR_OFFSET]); - TRACE_END_DEBUG(vmapiContextP, line); - - } else - parms->smapiBufferCursor += 4; - parms->byteCount += 4; - break; - - case APITYPE_INT8: - if (mode == populate) { - GET_64INT(*((long long*) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])), - parms->smapiBufferCursor); - } else - parms->smapiBufferCursor += 8; - parms->byteCount += 8; - break; - - case APITYPE_STRING_LEN: - case APITYPE_CHARBUF_LEN: - case APITYPE_C_STR_PTR: - if (APITYPE_C_STR_PTR == dataType) { - temp = strlen(parms->smapiBufferCursor); - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "C string found of length %d <%s>\n", temp, - parms->smapiBufferCursor); - TRACE_END_DEBUG(vmapiContextP, line); - parms->byteCount += (temp + 1); - } else { - GET_INT(temp, parms->smapiBufferCursor); - parms->byteCount += 4; - parms->byteCount += temp; - } - // If the string size is incorrect, display error and return. - if (temp < table[i][COL_2_MINSIZE]) // Check for less than min first - { - sprintf( - line, - "String size found: %d (@ %p), not in correct range %d-%d \n", - temp, (parms->smapiBufferCursor - 4), - table[i][COL_2_MINSIZE], table[i][COL_3_MAXSIZE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, line); - return PARSER_ERROR_INVALID_STRING_SIZE; - } - // If max is not -1, then check for max - if (-1 != table[i][COL_3_MAXSIZE] && temp > table[i][COL_3_MAXSIZE]) { - sprintf( - line, - "String size found: %d (@ %p), not in correct range %d-%d \n", - temp, (parms->smapiBufferCursor - 4), - table[i][COL_2_MINSIZE], table[i][COL_3_MAXSIZE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, line); - return PARSER_ERROR_INVALID_STRING_SIZE; - } - // If scan update the string byte count - if (mode == scan) { - if (temp > 0) { - parms->outStringByteCount += (temp + 1); - } - if (APITYPE_CHARBUF_LEN == dataType) // Skip past the buf count row in table - { - i++; - (parms->outStringByteCount)--; // Don't need null terminator for char buf - } - } else { // If populate then set the char * in struct; copy the string/charbuf into the buffer - if (temp > 0) { - *((char **) ((parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET]))) - = parms->inStringCursor; - - // If this ia a null terminated string just just strcpy, else use memcpy - if (APITYPE_C_STR_PTR == dataType) { - strcpy(parms->inStringCursor, parms->smapiBufferCursor); - parms->inStringCursor += temp + 1; - } else { - // copy the string/charbuf into the string buffer and add zero terminator if a string - memcpy(parms->inStringCursor, parms->smapiBufferCursor, - temp); - parms->inStringCursor += temp; - if (APITYPE_STRING_LEN == dataType) { - *(parms->inStringCursor) = '\0'; - parms->inStringCursor++; - } else // Char buffer, so no need to add null terminator, but must update count field - { - i++; - *((int*) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])) = temp; - } - } - } else { - *((char**) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])) = NULL; - if (APITYPE_CHARBUF_LEN == dataType) // Set char buf count to 0 - { - i++; - *((int*) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])) = 0; - } - } - } - if (APITYPE_C_STR_PTR == dataType) { - temp++; // Add on a byte for zero terminator - } - parms->smapiBufferCursor += temp; - break; - - case APITYPE_ARRAY_LEN: - // Call a subroutine to handle this - if (0 != (rc = handleArrays(vmapiContextP, mode, &i, table, parms))) - return rc; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "** Finished handling an array in parseBufferwithTable. Buffer pointer %p \n", - parms->smapiBufferCursor); - TRACE_END_DEBUG(vmapiContextP, line); - - break; - - // If null terminated strings are in the base structure, we need to - // find them all until we use up the buffer. They must be the last - // type of data in the stream. - // For scan mode we need to add up all the string lengths (adding in a byte - // for the null terminator) until the buffer is empty. - // The static table will have the APITYPE_C_STR_ARRAY_PTR, then APITYPE_C_STR_ARRAY_COUNT, - // APITYPE_C_STR_STRUCT_LEN, APITYPE_C_STR_PTR in that order. - case APITYPE_C_STR_ARRAY_PTR: - - cStringArrayPtrOffset = table[i][COL_6_SIZE_OR_OFFSET]; // Get the offset where the array ptr will be stored - cStringArrayPtrIndex = table[i][COL_4_STRUCT_INDEX];// Get the index of this field (should be 0 for this level) - - i++; // Get next table value; which must be the counter info - if (APITYPE_C_STR_ARRAY_COUNT != table[i][COL_1_TYPE]) { - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - cStringCounterFieldOffset = table[i][COL_6_SIZE_OR_OFFSET]; - cStringCounterFieldIndex = table[i][COL_4_STRUCT_INDEX]; - - i++; // Get next table value; which must be the c array structure size info - if (APITYPE_C_STR_STRUCT_LEN != table[i][COL_1_TYPE]) { - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - cStringStructSize = table[i][COL_6_SIZE_OR_OFFSET]; - cStringStructIndex = table[i][COL_4_STRUCT_INDEX]; - - i++; // Get next table value; which must be the char * offset in the structure - if (APITYPE_C_STR_PTR != table[i][COL_1_TYPE]) { - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - cStringFieldIndex = table[i][COL_4_STRUCT_INDEX]; - cStringFieldOffset = table[i][COL_6_SIZE_OR_OFFSET]; - - cStringCurrentStructCount = 0; // Used in populate - - // Look through the rest of the buffer. - while (parms->byteCount < parms->dataBufferSize) { - iSize = strlen(parms->smapiBufferCursor) + 1; - // If this is scan, then increment the c string structure count, - // add the output size of the string + byte for zero terminator, and - // move buffer pointer past the string. Increment our count of data bytes - // processed also. - if (mode == scan) { - parms->outStringByteCount += iSize; - parms->smapiBufferCursor += iSize; - parms->outStructCount[cStringStructIndex]++;// Structures hold the char * - - // If the size of the char * structure has not been filled in, do that now - if (0 == parms->outStructSizes[cStringStructIndex]) { - parms->outStructSizes[cStringStructIndex] - = cStringStructSize; - } - } - // If populate, copy the string to the storage area, - // store the pointer to the string in the correct array structure, - // then move to next string. - else { - // If this is the first string/structure, then set the structure pointer to to the - // starting address. The array notation will handle the rest of the addresses. - if (0 == cStringCurrentStructCount) { - *(char **) (parms->inStructAddrs[cStringArrayPtrIndex] - + cStringArrayPtrOffset) - = parms->inStructAddrs[cStringStructIndex]; - - // Copy the struct count from the scan (input to this populate) into the - // count field - *((int *) (parms->inStructAddrs[cStringCounterFieldIndex] - + cStringCounterFieldOffset)) - = parms->outStructCount[cStringStructIndex]; - } - - // Copy the string into the string buffer - strcpy(parms->inStringCursor, parms->smapiBufferCursor); - - // Set the char * pointer in the c structure of char *'s - memcpy((parms->inStructAddrs[cStringStructIndex] - + (cStringCurrentStructCount * cStringStructSize) - + cStringFieldOffset), &(parms->inStringCursor), - sizeof(char *)); - - // Advance to next string storage location and structure counter - parms->inStringCursor += iSize; - parms->smapiBufferCursor += iSize; - - cStringCurrentStructCount++; - } - parms->byteCount += iSize; - }// End while buffer has data - - break; - - case APITYPE_ARRAY_STRUCT_COUNT: // Should not get here, subroutine should be handling this - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - break; - - default: // Error - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - break; - }// End switch on table type - - if (parms->byteCount >= parms->dataBufferSize) { - reachedByteCount = 1; - break; // End of for loop (Will we always get here vs find the last entry in the table?) - } - }// For loop until end of table - return 0; -} - -/** - * Routine for doing all processing when an array is found. - * Can be recursively called if nested arrays - */ -static int handleArrays(struct _VmApiInternalContext* vmapiContextP, - enum tableParserModes mode, int * tableStartingIndex, - tableLayout table, tableParserParms *parms) { - // At our calling the table index should be at the arrayLen field, and next field should be - // struct len details. - int arrayByteMax, arrayByteCount, arrayPointerOffset, arrayPointerIndex, j, - dataType; - int dataBuffStructSize, outStructSize, structIndex, structByteCount; - int tableIndex, tableMaxIndex, temp, rc, arrayNestLevel; - int structCounter, structCounterField, structCounterIndex; - int noBufferStructLen; // set to 1 if SMAPI array doesn't have an inner structure length - char * structStorage; - char line[LINESIZE]; - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, - "** Array found. Starting table index is %d buffer pointer %p \n", - *tableStartingIndex, parms->smapiBufferCursor); - TRACE_END_DEBUG(vmapiContextP, line); - - arrayByteCount = 0; - tableMaxIndex = 0; // Used to find end of table entries for this structure - structCounter = 0; // Used for populate of structure (an address multiplier) - - GET_INT(arrayByteMax, parms->smapiBufferCursor);// Actual size of SMAPI array data - - arrayPointerOffset = table[*tableStartingIndex][COL_6_SIZE_OR_OFFSET]; - arrayPointerIndex = table[*tableStartingIndex][COL_4_STRUCT_INDEX]; - arrayNestLevel = table[*tableStartingIndex][COL_5_NEST_LEVEL]; - (*tableStartingIndex)++; // Position at the struct len in this table (or struct count) - - // If the struct count field was specified, then make a note of that for populate step - if (APITYPE_ARRAY_STRUCT_COUNT == table[*tableStartingIndex][COL_1_TYPE]) { - if (mode == populate) { - structCounterField - = table[*tableStartingIndex][COL_6_SIZE_OR_OFFSET]; - structCounterIndex = table[*tableStartingIndex][COL_4_STRUCT_INDEX]; - } else { - structCounterField = 0; - structCounterIndex = 0; - } - (*tableStartingIndex)++; // Position at the struct length APITYPE_STRUCT_LEN - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "SMAPI buffer array found: %d bytes \n", arrayByteMax); - TRACE_END_DEBUG(vmapiContextP, line); - - structIndex = table[*tableStartingIndex][COL_4_STRUCT_INDEX]; - outStructSize = table[*tableStartingIndex][COL_6_SIZE_OR_OFFSET]; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Output struct size is %d \n", outStructSize); - TRACE_END_DEBUG(vmapiContextP, line); - - // Figure out where is the ending index of the structure. This will be used in case the - // array is empty or the size of the structure is larger than we expect. (The actual - // structure could be bigger if the next release of SMAPI adds more fields at the end.) - tableMaxIndex = *tableStartingIndex; - while (arrayNestLevel < table[tableMaxIndex + 1][COL_5_NEST_LEVEL] - && APITYPE_END_OF_TABLE != table[tableMaxIndex + 1][COL_1_TYPE]) { - tableMaxIndex++; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Structure's table max index is %d \n", tableMaxIndex); - TRACE_END_DEBUG(vmapiContextP, line); - - // Find each structure until we reach array max - while (arrayByteCount < arrayByteMax) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Loop to scan buffer for structure data. \n"); - TRACE_END_DEBUG(vmapiContextP, line); - noBufferStructLen = 0; - tableIndex = *tableStartingIndex; - // Start at the field past the array in the table - // next table field should be the array structure size or if no nested inner structure - // the NOBUFFER keyword - if ((APITYPE_STRUCT_LEN != table[tableIndex][COL_1_TYPE]) - && (APITYPE_NOBUFFER_STRUCT_LEN - != table[tableIndex][COL_1_TYPE])) { - printf("table index %d column1 type: %d \n", tableIndex, - table[tableIndex][COL_1_TYPE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - structByteCount = 0; - - GET_INT(dataBuffStructSize, parms->smapiBufferCursor); - // If the SMAPI buffer does not contain a nested structure size, then set - // the data pointer back to make the "implied" structure. - if (APITYPE_NOBUFFER_STRUCT_LEN == table[tableIndex][COL_1_TYPE]) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - " There is no inner structure length, so this length %d is first item, back up to re-read it later. \n", - dataBuffStructSize); - TRACE_END_DEBUG(vmapiContextP, line); - parms->smapiBufferCursor -= 4; - noBufferStructLen = 1; // set flag so that correct count at bottom of loop is done - } - - if (mode == scan) { - parms->outStructCount[structIndex]++; - // If the size of the structure has not been filled in, do that now - if (0 == parms->outStructSizes[structIndex]) { - parms->outStructSizes[structIndex] - = table[tableIndex][COL_6_SIZE_OR_OFFSET]; - } - } else { // If populate and structCounterField specified, then fill it in - if (0 == structCounter) { - *(char **) (parms->inStructAddrs[arrayPointerIndex] - + arrayPointerOffset) - = parms->inStructAddrs[structIndex]; - } - if (structCounterField) { - *((int *) (parms->inStructAddrs[structCounterIndex] - + structCounterField)) - = parms->outStructCount[structIndex]; - } - } - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - if (noBufferStructLen == 1) { - sprintf( - line, - " table index %d implied Array struct index %d first data item size %d\n", - tableIndex, structIndex, dataBuffStructSize); - } else { - sprintf(line, - " table index %d Array struct index %d data size %d\n", - tableIndex, structIndex, dataBuffStructSize); - } - TRACE_END_DEBUG(vmapiContextP, line); - if (dataBuffStructSize == 0) - continue; // Probably rare? - - - tableIndex++; - // Loop until reaching the end of the table or if an imbedded structure size, - // When the data has been all read. - while ((noBufferStructLen == 0 - && (structByteCount < dataBuffStructSize)) - || (noBufferStructLen && (tableIndex <= tableMaxIndex))) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - " noBufferStructLen %d structByteCount %d table index %d \n", - noBufferStructLen, structByteCount, tableIndex); - TRACE_END_DEBUG(vmapiContextP, line); - - // If we are at the end of this table, then adjust the byte count and leave - // this loop. This would happen if there is more data than we expect. (A newer - // version of SMAPI may of added more fields at the end. - if (tableIndex > tableMaxIndex) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - " Reached the end of the table. Unexpected condition. Table index %d \n", - tableIndex); - TRACE_END_DEBUG(vmapiContextP, line); - structByteCount = dataBuffStructSize; - break; - } - - dataType = table[tableIndex][0]; - switch (dataType) { - case APITYPE_INT1: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Int1 found.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - if (mode == populate) { - memcpy((parms->inStructAddrs[structIndex] + (structCounter - * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET]), - parms->smapiBufferCursor, 1); - } - parms->smapiBufferCursor += 1; - structByteCount += 1; - break; - - case APITYPE_INT4: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Int4 found.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - if (mode == populate) { - GET_INT(*((int*) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])), - parms->smapiBufferCursor); - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "int 4 found Value %d stored at %p(+%d) \n", - *((int *) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])), - parms->inStructAddrs[structIndex], - table[tableIndex][COL_6_SIZE_OR_OFFSET]); - TRACE_END_DEBUG(vmapiContextP, line); - } else - parms->smapiBufferCursor += 4; - - structByteCount += 4; - break; - - case APITYPE_INT8: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Int8 found.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - if (mode == populate) { - GET_64INT(*((long long*) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])), - parms->smapiBufferCursor); - } else - parms->smapiBufferCursor += 8; - structByteCount += 8; - break; - - case APITYPE_STRING_LEN: - case APITYPE_CHARBUF_LEN: - case APITYPE_C_STR_PTR: - if (APITYPE_C_STR_PTR == dataType) { - temp = strlen(parms->smapiBufferCursor); - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " C string found. Length %d\n", temp); - TRACE_END_DEBUG(vmapiContextP, line); - } else { - GET_INT(temp, parms->smapiBufferCursor); - structByteCount += 4; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - if (dataType == APITYPE_CHARBUF_LEN) { - sprintf(line, " Charbuf with length %d found.\n", temp); - } else { - sprintf(line, " String with length %d found.\n", temp); - } - TRACE_END_DEBUG(vmapiContextP, line); - } - - // If the string size is incorrect, display error and return. - if (temp < table[tableIndex][COL_2_MINSIZE]) // Check for less than min first - { - sprintf( - line, - "String size found: %d (@ %p), not in correct range %d-%d \n", - temp, (parms->smapiBufferCursor - 4), - table[tableIndex][COL_2_MINSIZE], - table[tableIndex][COL_3_MAXSIZE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, line); - return PARSER_ERROR_INVALID_STRING_SIZE; - } - // If max is not -1, then check for max - if (-1 != table[tableIndex][COL_3_MAXSIZE] && temp - > table[tableIndex][COL_3_MAXSIZE]) { - sprintf( - line, - "String size found: %d (@ %p), not in correct range %d-%d \n", - temp, (parms->smapiBufferCursor - 4), - table[tableIndex][COL_2_MINSIZE], - table[tableIndex][COL_3_MAXSIZE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, line); - return PARSER_ERROR_INVALID_STRING_SIZE; - } - - // If scan update the string byte count - if (mode == scan) { - if (temp > 0) { - parms->outStringByteCount += (temp + 1); - } - if (dataType == APITYPE_CHARBUF_LEN) { - tableIndex++; // Position at the char buf count in the table - } - } else { // If populate then set the char * in struct; copy the string into the buffer - if (temp > 0) { - *((char **) ((parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET]))) - = parms->inStringCursor; - - // If this ia a null terminated string just just strcpy, else use memcpy - if (APITYPE_C_STR_PTR == dataType) { - strcpy(parms->inStringCursor, - parms->smapiBufferCursor); - parms->inStringCursor += temp + 1; - } else { - // Copy the string into the string buffer and add zero terminator - TRACE_START(vmapiContextP, - TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "Memcopying string data from %p into %p for length %d \n", - parms->smapiBufferCursor, - parms->inStringCursor, temp); - TRACE_END_DEBUG(vmapiContextP, line); - memcpy(parms->inStringCursor, - parms->smapiBufferCursor, temp); - parms->inStringCursor += temp; - - if (APITYPE_STRING_LEN == dataType) { - *parms->inStringCursor = '\0'; - parms->inStringCursor++; - TRACE_START(vmapiContextP, - TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "String found Value '%s' next avail struct pointer %p \n", - *((char**) (parms->inStructAddrs[structIndex] - + (structCounter - * outStructSize) - + +table[tableIndex][COL_6_SIZE_OR_OFFSET])), - parms->inStringCursor); - TRACE_END_DEBUG(vmapiContextP, line); - } else // Char buffer, so no need to add null terminator, but must update count field - { - tableIndex++; // Position at the char buf count in the table - *((int*) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])) - = temp; - TRACE_START(vmapiContextP, - TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "Charbuf count at table index %d updated \n", - tableIndex); - TRACE_END_DEBUG(vmapiContextP, line); - } - } - } else { - *((char**) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])) - = NULL; - } - } - if (APITYPE_C_STR_PTR == dataType) { - temp++; // Add on a byte for zero terminator - } - parms->smapiBufferCursor += temp; - structByteCount += temp; - break; - - case APITYPE_ARRAY_LEN: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Array found.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - // Call a subroutine to handle this - if (0 != (rc = handleArrays(vmapiContextP, mode, &tableIndex, - table, parms))) - return rc; - - break; - - case APITYPE_ARRAY_STRUCT_COUNT: // Should not get here, subroutine should be handling this - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - break; - - default: // Error - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - break; - } - tableIndex++; - } - structCounter++; - - if (noBufferStructLen) { - arrayByteCount += structByteCount; - } else { - arrayByteCount += structByteCount + 4; // Add in struct len field also - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " current arrayByteCount subtotal is %d \n", - arrayByteCount); - TRACE_END_DEBUG(vmapiContextP, line); - } - *tableStartingIndex = tableMaxIndex; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "table starting Index on return is %d \n", - *tableStartingIndex); - TRACE_END_DEBUG(vmapiContextP, line); - return 0; -} - -/** - * This helper function will handle connecting and reading of the SMAPI buffer data. - */ -int getAndParseSmapiBuffer( - struct _VmApiInternalContext* vmapiContextP, - char * * inputPp, // input buffer pointer pointer - int inputSize, tableLayout parserTable, char * parserTableName, - char * * outData //Output pointer for base structure -) { - int sockDesc; - tableParserParms parserParms; - int requestId; - int tempSize; - int * pReturnCode; - int * pReasonCode; - int rc, i, j; - char line[BUFLEN]; - char * smapiOutputP = 0; - rc = 0; - const int SLEEP_TIMES[SEND_RETRY_LIMIT] = { 0, 8, 16, 16 }; - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "Table being parsed: <%s> \n", parserTableName); - TRACE_END_DEBUG(vmapiContextP, line); - - // Initialize our socket - if (0 != (rc = smSocketInitialize(vmapiContextP, &sockDesc))) { - FREE_MEMORY(*inputPp); - return rc; - } - TRACE_START(vmapiContextP, TRACEAREA_SMAPI_ONLY, TRACELEVEL_DETAILS); - sprintf(line, "Socket write starting for <%s> \n", parserTableName); - TRACE_END_DEBUG(vmapiContextP, line); - - // Retry the send if the error detected is ok to retry - for (j = 0;; j++) { - if (0 != (rc = smSocketWrite(vmapiContextP, sockDesc, *inputPp, - inputSize))) { - if (rc == SOCKET_WRITE_RETRYABLE_ERROR) { - if (j < SEND_RETRY_LIMIT) { - // Delay for a while to give SMAPI some time to restart - if (SLEEP_TIMES[j] > 0) { - sleep(SLEEP_TIMES[j]); - } - continue; - } - // Change the internal return code to general write one - rc = SOCKET_WRITE_ERROR; - } - FREE_MEMORY(*inputPp); - TRACE_START(vmapiContextP, TRACEAREA_SMAPI_ONLY, TRACELEVEL_DETAILS); - sprintf( - line, - "Socket write for <%s> did not complete after %d retries \n", - parserTableName, SEND_RETRY_LIMIT); - TRACE_END_DEBUG(vmapiContextP, line); - return rc; - } - break; - } - - FREE_MEMORY(*inputPp); - - // Get the request id - if (0 - != (rc = smSocketRead(vmapiContextP, sockDesc, (char*) &requestId, - 4))) { - sprintf(line, "Socket %d receive of the requestId failed\n", sockDesc); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsUnexpected, line); - return rc; - } - - // Read in the output length - if (0 - != (rc = smSocketRead(vmapiContextP, sockDesc, (char *) &tempSize, - 4))) { - sprintf(line, "Socket %d receive of the buffer length failed\n", - sockDesc); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsUnexpected, line); - return rc; - } - tempSize = ntohl(tempSize); - - // Read in the rest of the output buffer - if (tempSize >= (3* 4 )) // Must have at least 3 more ints - { - if (0 == (smapiOutputP = malloc(tempSize))) { - sprintf(line, "Insufficiant memory (request=%d bytes)\n", tempSize); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsNoMemory, line); - return MEMORY_ERROR; - } - - if (0 != (rc = smSocketRead(vmapiContextP, sockDesc, smapiOutputP, - tempSize))) { - FREE_MEMORY(smapiOutputP); - return rc; - } - - if (0 != (rc = smSocketTerminate(vmapiContextP, sockDesc))) { - FREE_MEMORY(smapiOutputP); - return rc; - } - - TRACE_START(vmapiContextP, TRACEAREA_SMAPI_ONLY, TRACELEVEL_DETAILS); - pReturnCode = (int *) (smapiOutputP + 4); - pReasonCode = (int *) (smapiOutputP + 8); - sprintf(line, "SMAPI return code %d reason code %d \n", *pReturnCode, - *pReasonCode); - TRACE_END_DEBUG(vmapiContextP, line); - - // Scan the SMAPI output data to get sizes of structures and strings. - // A non zero return code indicates errors. - parserParms.smapiBufferCursor = smapiOutputP; - parserParms.dataBufferSize = tempSize; - - rc = parseBufferWithTable(vmapiContextP, scan, parserTable, - &parserParms); - if (rc != 0) { - // If we have an error because of invalid string size, dump out the - // buffer to help with diagnosis. Limit the dump to 5000 characters - if (rc == PARSER_ERROR_INVALID_STRING_SIZE) { - if (tempSize > 5000) { - dumpArea(vmapiContextP, smapiOutputP, 5000); - } else { - dumpArea(vmapiContextP, smapiOutputP, tempSize); - } - - } - FREE_MEMORY(smapiOutputP); - return rc; - } - - // We can add up all the storage or get each structure independently, do independent for now - for (i = 0; i < MAX_STRUCT_ARRAYS; i++) { - if (parserParms.outStructSizes[i] == 0 - || parserParms.outStructCount[i] == 0) - continue; - parserParms.inStructAddrs[i] = smMemoryGroupAlloc(vmapiContextP, - parserParms.outStructSizes[i] - * parserParms.outStructCount[i]); - if (parserParms.inStructAddrs[i] == 0) { - FREE_MEMORY(smapiOutputP); - sprintf(line, "Insufficiant memory (request=%d bytes)\n", - parserParms.outStructSizes[i] - * parserParms.outStructCount[i]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, line); - return MEMORY_ERROR; - } - } - - // If any string data, just get one chunk of storage for that - if (parserParms.outStringByteCount > 0) { - parserParms.inStringCursor = smMemoryGroupAlloc(vmapiContextP, - parserParms.outStringByteCount); - if (parserParms.inStringCursor == 0) { - FREE_MEMORY(smapiOutputP); - sprintf(line, "Insufficiant memory (request=%d bytes)\n", - parserParms.outStringByteCount); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, line); - return MEMORY_ERROR; - } - } - - // Set the output pointer to the level 0 structure's storage - *outData = parserParms.inStructAddrs[0]; - - parserParms.smapiBufferCursor = smapiOutputP; // reset the output cursor pointer - - rc = parseBufferWithTable(vmapiContextP, populate, parserTable, - &parserParms); - if (rc != 0) { - FREE_MEMORY(smapiOutputP); - return rc; - } - - } else { - sprintf(line, "Insufficiant memory (request=%d bytes)/n", - parserParms.outStringByteCount); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, line); - return INVALID_DATA; // Not enough data returned - } - FREE_MEMORY(smapiOutputP); - return 0; -} diff --git a/zhcp/BUILD/resource_access/src/smapiUtilities.c b/zhcp/BUILD/resource_access/src/smapiUtilities.c deleted file mode 100644 index 5dca5fa..0000000 --- a/zhcp/BUILD/resource_access/src/smapiUtilities.c +++ /dev/null @@ -1,2265 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smPublic.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vmapiSystem.h" -#include "vmapiAsynchronous.h" -#include "vmapiQuery.h" -#include "smapiTableParser.h" -#include "smSocket.h" - -#define VMAPILIB "libvmapi.so" - -int vmbkendSockaddrFileInfo(struct _VmApiInternalContext* vmapiContextP, - int readOrWrite, struct sockaddr_in *saddr); - -// Externally visible storage for trace -smTrace externSmapiTraceFlags = { 0 }; - -// Semaphore locking fields for trace and the backend -enum SemaphoreIndex { - ContextSemaphoreIndex = 0, TraceSemaphoreIndex = 1, - BackendSemaphoreIndex = 2, NumberOfSemaphores -}; - -// ------------ Context ones ------------ -static struct sembuf contextSemaphoreReserve[] = { ContextSemaphoreIndex, -1, - SEM_UNDO }; -static const int contextSemaphoreReserveN = sizeof(contextSemaphoreReserve) - / sizeof(contextSemaphoreReserve[0]); - -static struct sembuf contextSemaphoreRelease[] = { ContextSemaphoreIndex, 1, - SEM_UNDO }; -static const int contextSemaphoreReleaseN = sizeof(contextSemaphoreRelease) - / sizeof(contextSemaphoreRelease[0]); - -// ------------ Trace ones ------------ -static struct sembuf traceSemaphoreReserve[] = { TraceSemaphoreIndex, -1, - SEM_UNDO }; -static const int traceSemaphoreReserveN = sizeof(traceSemaphoreReserve) - / sizeof(traceSemaphoreReserve[0]); - -static struct sembuf traceSemaphoreRelease[] = { TraceSemaphoreIndex, 1, - SEM_UNDO }; -static const int traceSemaphoreReleaseN = sizeof(traceSemaphoreRelease) - / sizeof(traceSemaphoreRelease[0]); - -// ------------ VMbackend ones ------------ -static struct sembuf backendSemaphoreReserve[] = { BackendSemaphoreIndex, -1, - SEM_UNDO }; -static const int backendSemaphoreReserveN = sizeof(backendSemaphoreReserve) - / sizeof(backendSemaphoreReserve[0]); - -static struct sembuf backendSemaphoreRelease[] = { BackendSemaphoreIndex, 1, - SEM_UNDO }; -static const int backendSemaphoreReleaseN = sizeof(backendSemaphoreRelease) - / sizeof(backendSemaphoreRelease[0]); - -pthread_mutex_t mutex; -pthread_cond_t thread_initialized_cv; - -int checkAbbreviation(const char* aStringP, - const Abbreviation* anAbbreviationListP, int anAbbreviationN) { - - int x; - int checkL; - int stringL; - - int isAbbreviation = 0; - if (aStringP == 0) - return 0; - - stringL = strlen(aStringP); - - for (x = 0; x < anAbbreviationN; ++x) { - checkL = anAbbreviationListP[x].minimum; - if (checkL > stringL) - continue; - if (0 == strncasecmp(aStringP, anAbbreviationListP[x].nameP, checkL)) { - isAbbreviation = 1; - break; - } - } - - return isAbbreviation; - -} - -int checkBoolean(const char* aStringP) { - - const Abbreviation booleanTrues[] = { { "TRUE", 1 }, { "YES", 1 }, - { "1", 1 } }; - - return checkAbbreviation(aStringP, booleanTrues, (sizeof(booleanTrues) - / sizeof(booleanTrues[0]))); - -} - -int checkPrefixCommand(const char* aCommandP) { - - const Abbreviation prefixCommands[] = { { "REQUEST", 3 }, { "TOSYS", 5 }, { - "TONODE", 6 }, { "ASUSER", 2 }, { "BYUSER", 2 }, { "FORUSER", 3 }, - { "PRESET", 6 }, { "MULTIUSER", 5 }, { "ATNODE", 6 }, - { "ATSYS", 5 } }; - - return checkAbbreviation(aCommandP, prefixCommands, (sizeof(prefixCommands) - / sizeof(prefixCommands[0]))); - -} - -const char* -contextGetMessageFilename(struct _VmApiInternalContext* vmapiContextP, - char* aBufferP, int aBufferS) { - - char line[LINESIZE]; - int len = 0; - const char* msgName = "messages"; - const char* msgSuffixName = ".eng"; // Language-dependent - char* pathP = 0; - int pathL = 0; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Obtain VMAPI environment variable - memset(aBufferP, 0, aBufferS); - pathP = getenv("VMAPI"); - - if (pathP) { - pathL = strlen(pathP); - len = pathL + 12; // Adjust once we know NLS file structure - if (len > aBufferS) { - sprintf( - line, - "contextGetMessageFilename: Insufficient path buffer size; needed %d, have %d.", - len, (aBufferS - 1)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcContext, - RsInternalBufferTooSmall, line); - } - strncpy(aBufferP, pathP, pathL); - if (aBufferP[pathL - 1] == '/') { - strcat(aBufferP, ".cimvm/"); - } else { - strcat(aBufferP, "/.cimvm/"); - } - } else { - strcpy(aBufferP, "/root/.cimvm/"); - } - - strcat(aBufferP, msgName); // Adjust when we know real NLS stuff - strcat(aBufferP, msgSuffixName); - - return aBufferP; - -} - -int createDirectories(const char* aFilenameP) { - - int filenameL = strlen(aFilenameP); - char filename[LINESIZE]; - int rc; - char* sP = 0; - char* eP = 0; - - if (filenameL >= (sizeof(filename) - 1)) - return 0; - - memset(filename, 0, sizeof(filename)); - strcpy(filename, aFilenameP); - - sP = filename; - eP = filename + sizeof(filename) - 1; - while ((sP < eP) && (sP = strchr(sP + 1, '/'))) { - *sP = '\0'; - mkdir(filename, S_IRWXU); - *sP = '/'; - } - - return 0; - -} - -int initializeThreadSemaphores(struct _VmApiInternalContext* vmapiContextP, - const char* aContextNameP, int aCreateFlag) { - char pathAndFile[PATHLENGTH + strlen(CACHE_SEMAPHORE_FILENAME)]; - FILE* idFileP = 0; - int len = 0; - char line[LINESIZE]; - const char* logFilenameP = 0; - union semun { - int val; - struct semid_ds* buf; - ushort* array; - } semArgument; - int semInitRequired = 0; - int pathLength = 0; - char* pathPtr = 0; - int rc = 0; - int savedSize = 0; - - memset(vmapiContextP->path, 0, sizeof(vmapiContextP->path)); // Clear out path string - memset(pathAndFile, 0, sizeof(pathAndFile)); - - // Save the name passed in; into the context if specified - if (strlen(aContextNameP) > 0) { - strncpy(vmapiContextP->name, aContextNameP, sizeof(vmapiContextP->name) - - 1); - } - - // Obtain VMAPI environment variable - pathPtr = getenv("ZVMMAP_VAR"); - if (pathPtr) { // ZVMMAP_VAR is defined - pathLength = strlen(pathPtr); - len = pathLength + strlen(CACHE_SEMAPHORE_DIRECTORY); - if (len > sizeof(pathAndFile)) { - sprintf( - line, - "contextReserve: Insufficient path buffer size; needed %d, have %d.", - len, sizeof(pathAndFile) - 1); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcContext, - RsInternalBufferTooSmall, line); - return PROCESSING_ERROR; - } - strncpy(vmapiContextP->path, pathPtr, sizeof(vmapiContextP->path) - - (strlen(CACHE_SEMAPHORE_DIRECTORY) + 2)); - len = strlen(vmapiContextP->path); - if (vmapiContextP->path[len - 1] == '/') { - strcat(vmapiContextP->path, CACHE_SEMAPHORE_DIRECTORY); // Add on .vmapi/ directory - } else { - strcat(vmapiContextP->path, "/"); - strcat(vmapiContextP->path, CACHE_SEMAPHORE_DIRECTORY); - } - } else { // ZVMMAP_VAR is undefined, set default - strcpy(vmapiContextP->path, CACHE_PATH_DEFAULT); - } - - // Create or obtain semaphore set - strcpy(pathAndFile, vmapiContextP->path); - strcat(pathAndFile, CACHE_SEMAPHORE_FILENAME); - createDirectories(pathAndFile); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "initializeThreadSemaphores: Semaphore file name is %s \n", - pathAndFile); - TRACE_END_DEBUG(vmapiContextP, line); - - // Try to open or create a file that can be used for semaphore handle - FILE* semFileP = fopen(pathAndFile, "r"); - if (!semFileP) { - semFileP = fopen(pathAndFile, "w"); - } - if (semFileP) { - fclose(semFileP); - } - - vmapiContextP->semKey = ftok(pathAndFile, 'V'); - vmapiContextP->semId = semget(vmapiContextP->semKey, 2, 0600); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "initializeThreadSemaphores: semKey = %d \n", - vmapiContextP->semKey); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "initializeThreadSemaphores: semId = %d \n", - vmapiContextP->semId); - TRACE_END_DEBUG(vmapiContextP, line); - - if ((0 > vmapiContextP->semId) && (ENOENT == errno)) { - semInitRequired = 1; - vmapiContextP->semId = semget(vmapiContextP->semKey, - NumberOfSemaphores, 0600 | IPC_CREAT); - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "initializeThreadSemaphores: semInitRequired = %d \n", - semInitRequired); - TRACE_END_DEBUG(vmapiContextP, line); - - if (0 > vmapiContextP->semId) { - sprintf( - line, - "contextReserve: Unable to create semaphore array identified by %s; errno=%d text: %s", - pathAndFile, errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotCreated, line); - return PROCESSING_ERROR; - } - - if (semInitRequired) { - semArgument.val = 1; - rc = semctl(vmapiContextP->semId, TraceSemaphoreIndex, SETVAL, - semArgument); - if (0 > rc) { - sprintf(line, - "Unable to initialize Trace semaphore; errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotCreated, line); - return PROCESSING_ERROR; - } - - rc = semctl(vmapiContextP->semId, BackendSemaphoreIndex, SETVAL, - semArgument); - if (0 > rc) { - sprintf( - line, - "Unable to initialize Backend semaphore; errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotCreated, line); - return PROCESSING_ERROR; - } - rc = semctl(vmapiContextP->semId, ContextSemaphoreIndex, SETVAL, - semArgument); - if (0 > rc) { - sprintf( - line, - "Unable to initialize context semaphore; errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotCreated, line); - return PROCESSING_ERROR; - } - } - - // Obtain the Context semaphore before manipulating context related stuff - rc = semop(vmapiContextP->semId, contextSemaphoreReserve, - contextSemaphoreReserveN); - if (rc < 0) { - sprintf(line, - "contextReserve: semop (decrement) failed; errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotObtained, line); - return PROCESSING_ERROR; - } - - // Create or obtain context for the name passed in - strcpy(pathAndFile, vmapiContextP->path); - strcat(pathAndFile, CACHE_DIRECTORY); - createDirectories(pathAndFile); - - // Release the Context semaphore after manipulating context related stuff - rc = semop(vmapiContextP->semId, contextSemaphoreRelease, - contextSemaphoreReleaseN); - if (rc < 0) { - sprintf(line, - "contextReserve: semop (increment) failed, errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotReleased, line); - return PROCESSING_ERROR; - } - vmapiContextP->contextCreatedFlag = 1; // Set flag to indicate context set up - return 0; -} - -/** - * Unit test code - */ -void dumpArea(struct _VmApiInternalContext* vmapiContextP, void * pstor, - int len) { - unsigned int offset, i, j, k; - char trans[17]; - char line[LINESIZE]; - char phrase[80]; - unsigned char storByte; - int transAvail; - offset = 0; - transAvail = 0; - for (k = 0; k < sizeof(trans); k++) { - trans[k] = '\0'; - } - - storByte = *((char *) pstor); - sprintf(line, "=== dump of area %p for length %d ", pstor, len); - for (i = 0; i < len; i++) { - j = i % 16; - if (j == 0) { - if (transAvail) { - sprintf(phrase, " %s", trans); - strcat(line, phrase); - for (k = 0; k < sizeof(trans); k++) { - trans[k] = '\0'; - } - transAvail = 0; - } - strcat(line, "\n"); - logLine(vmapiContextP, LOGLINE_DEBUG, line); - sprintf(line, "%6d %14p ", offset, (pstor + offset)); - offset += 16; - } else if (0 == (k = i % 4)) { - strcat(line, " "); - } - storByte = *((char*) (pstor + i)); - if (isprint(storByte)) { - trans[j] = storByte; - } else { - trans[j] = '.'; - } - transAvail = 1; - - sprintf(phrase, "%02X", storByte); - strcat(line, phrase); - - } - if (transAvail) { - for (k = j + 1; k < 16; k++) { - if (0 == k % 4) { - strcat(line, " "); - } - strcat(line, " "); - } - sprintf(phrase, " %s", trans); - strcat(line, phrase); - } - strcat(line, "\n"); - logLine(vmapiContextP, LOGLINE_DEBUG, line); -} - -void errorLog(struct _VmApiInternalContext* vmapiContextP, - const char * functionName, const char * lineNumber, int aRc, - int aReason, const char* aLineP) { - - char line[LINESIZE]; - - sprintf(line, "%s:%s %s", functionName, lineNumber, aLineP); - - vmapiContextP->rc = aRc; - vmapiContextP->reason = aReason; - errorLine(vmapiContextP, line); - -} - -void errorLine(struct _VmApiInternalContext* vmapiContextP, const char* aLineP) { - int lineL = strlen(aLineP); - - logLine(vmapiContextP, 'E', aLineP); - - // If this is the first error for this context, save it - if (!vmapiContextP->firstFailureCaptured) { - strncpy(vmapiContextP->strFirstFailureMsg, aLineP, - FIRST_FAILURE_MESSAGE_MAX_LEN); - vmapiContextP->strFirstFailureMsg[FIRST_FAILURE_MESSAGE_MAX_LEN] = '\0'; - vmapiContextP->firstFailureCaptured = 1; // 1:true - } - -} - -char* -getArg(int anIndex, int anArgc, const char** anArgvPP, const char* aDefaultP) { - - int x = anIndex; - - if (x > (anArgc - 1)) - return (char*) aDefaultP; - - return (char*) (anArgvPP[x] ? anArgvPP[x] : aDefaultP); - -} - -Dedicate* -getDedicates(struct _VmApiInternalContext* vmapiContextP) { - - char* itemP = 0; - Record* recordP = 0; - - char* lastP = 0; - char line[LINESIZE]; - char tokenLine[LINESIZE]; - - Dedicate* currentDedicateP = 0; - Dedicate* dedicatesP = 0; - Dedicate* newDedicateP = 0; - - recordP = vmapiContextP->outputStream.currentP; - - while (recordP) { - - strncpy(tokenLine, recordP->data, sizeof(tokenLine)); - - itemP = strtok_r(tokenLine, " ", &lastP); - - if (itemP && (0 == strcmp(itemP, "DEDICATE"))) { - - newDedicateP = calloc(1, sizeof(Dedicate)); - if (newDedicateP == 0) { - while (dedicatesP != 0) { - currentDedicateP = dedicatesP->nextP; - free(dedicatesP); - dedicatesP = currentDedicateP; - } - sprintf(line, "%s: Insufficiant memory (request=%d bytes)", - "getDedicates", sizeof(Dedicate)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, line); - return 0; - } - - if (currentDedicateP == 0) { - dedicatesP = newDedicateP; - currentDedicateP = newDedicateP; - } else { - currentDedicateP->nextP = newDedicateP; - currentDedicateP = newDedicateP; - } - newDedicateP->nextP = 0; - - itemP = strtok_r(0, " ", &lastP); - if (itemP) { - sscanf(itemP, "%x", &(newDedicateP->vnum)); - itemP = strtok_r(0, " ", &lastP); - } - - if (itemP) { - sscanf(itemP, "%x", &(newDedicateP->rnum)); - itemP = strtok_r(0, " ", &lastP); - } - - } - - recordP = recordP->nextP; - - } - - return dedicatesP; - -} - -Minidisk* -getMinidisks(struct _VmApiInternalContext* vmapiContextP) { - - char* itemP; - Record* recordP = 0; - - char* lastP = 0; - char line[LINESIZE]; - char tokenLine[LINESIZE]; - - Minidisk* currentMinidiskP = 0; - Minidisk* minidisksP = 0; - Minidisk* newMinidiskP = 0; - - recordP = vmapiContextP->outputStream.firstP; - - while (recordP) { - - strncpy(tokenLine, recordP->data, sizeof(tokenLine)); - itemP = strtok_r(tokenLine, " ", &lastP); - - if (itemP && (0 == strcmp(itemP, "MDISK"))) { - - newMinidiskP = calloc(1, sizeof(Minidisk)); - if (newMinidiskP == 0) { - while (minidisksP != 0) { - currentMinidiskP = minidisksP->nextP; - free(minidisksP); - minidisksP = currentMinidiskP; - } - sprintf(line, "%s: Insufficiant memory (request=%d bytes)", - "getMinidisks", sizeof(Minidisk)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, line); - return 0; - } - - if (currentMinidiskP == 0) { - minidisksP = newMinidiskP; - currentMinidiskP = newMinidiskP; - } else { - currentMinidiskP->nextP = newMinidiskP; - currentMinidiskP = newMinidiskP; - } - - newMinidiskP->nextP = 0; - itemP = strtok_r(0, " ", &lastP); - if (itemP) { - sscanf(itemP, "%x", &(newMinidiskP->address)); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - strncpy(newMinidiskP->type, itemP, sizeof(newMinidiskP->type)); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - sscanf(itemP, "%d", &newMinidiskP->location); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - sscanf(itemP, "%d", &newMinidiskP->extent); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - strncpy(newMinidiskP->volser, itemP, - sizeof(newMinidiskP->volser)); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - strncpy(newMinidiskP->mode, itemP, sizeof(newMinidiskP->mode)); - } - - } - - recordP = recordP->nextP; - - } - - return minidisksP; - -} - -/** - * Return 1 If a real device number is of an OSA type - * 0 Otherwise (or on failure to check) - */ -int isOSA(struct _VmApiInternalContext* vmapiContextP, char* rdev) { - smMemoryGroupContext localMemoryGroup; - smMemoryGroupContext * saveMemoryGroup; - vmApiSystemIoQueryOutput * ptrCommandOutput; - char *tokptr; - char *delim = " "; - char *tok; - int osaFound = 0; - int x; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - - smMemoryGroupInitialize(vmapiContextP); - - if (smSystem_IO_Query(vmapiContextP, rdev, &ptrCommandOutput)) { - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - return osaFound; - } - - // Loop through all the output found looking for "OSA", "OSD", or "IQDC" - // Output string will be "chpid string" or just "chpid" - for (x = 0; x < ptrCommandOutput->chipidCount; x++) { - // Get the chipid id first - tok = strtok_r(ptrCommandOutput->chipidList->vmapiString, delim, - &tokptr); - // See if there is data for this chipid - if (tok = strtok_r(NULL, delim, &tokptr)) { - if (!strcmp(tok, "OSA") || !strcmp(tok, "OSD") || !strcmp(tok, - "IQDC")) { - osaFound = 1; - } - } - } - - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - - return osaFound; - -} - -/** - * Append data to a list - */ -void listAppendLine(struct _VmApiInternalContext* vmapiContextP, List* aListP, - const char* aLineP) { - - int lineL = strlen(aLineP); - - Record* newRecordP = smMemoryGroupAlloc(vmapiContextP, sizeof(Record) - + lineL + 1); - if (newRecordP == 0) - return; - - strncpy(newRecordP->data, aLineP, lineL); - - listAppendRecord(aListP, newRecordP); - -} - -/** - * Append data to a list - */ -void listAppendRecord(List* aListP, Record* aRecordP) { - - if (aListP->firstP == 0) { - aListP->firstP = aRecordP; - } else { - if (aListP->currentP == 0) { - aListP->currentP = aListP->firstP; - while (aListP->currentP->nextP) { - aListP->currentP = aListP->currentP->nextP; - } - } - aListP->currentP->nextP = aRecordP; - } - aListP->currentP = aRecordP; - ++(aListP->size); - aRecordP->nextP = 0; - -} - -/** - * Delete the current record from the list - */ -void listDeleteCurrent(List* aListP) { - - Record* currentP = 0; - Record* prevP = 0; - - if (aListP == 0) - return; - - if (aListP->firstP == 0) - return; - - // Current not set yet ? - if (aListP->currentP == 0) - return; - - currentP = aListP->currentP; - if (aListP->firstP == aListP->currentP) { - aListP->currentP = aListP->firstP->nextP; - aListP->firstP = aListP->firstP->nextP; - } else { - // Find the record before aListP->currentP - prevP = aListP->firstP; - while (prevP && (prevP->nextP != currentP)) { - prevP = prevP->nextP; - } - // Remove recordP from list - if (prevP) { - prevP->nextP = currentP->nextP; - } - } - - free(currentP); - --(aListP->size); - -} - -/** - * Dequeue a line from the front of the list - */ -Record* -listDequeueRecord(List* aListP) { - - Record* recordP = 0; - - if (aListP == 0) - return 0; - - if (aListP->firstP == 0) - return 0; - - recordP = aListP->firstP; - - if (recordP == aListP->currentP) { - aListP->currentP = recordP->nextP; - } - - aListP->firstP = recordP->nextP; - - --(aListP->size); - - return recordP; - -} - -/** - * Free all records from a list - */ -void listFree(List* aListP) { - - Record* recordP = aListP->firstP; - Record* nextP = 0; - - while (recordP) { - nextP = recordP->nextP; - free(recordP); - recordP = nextP; - } - - aListP->firstP = 0; - aListP->currentP = 0; - aListP->size = 0; - -} - -/** - * Return Append data to a list - */ -const char* -listNextLine(List* aListP) { - - const Record* recordP = listNextRecord(aListP); - if (recordP == 0) - return 0; - return recordP->data; - -} - -/** - * Return Append data to a list - */ -const Record* -listNextRecord(List* aListP) { - - if (aListP == 0) - return 0; - - if (aListP->currentP == 0) { - // This causes a wrap around after the 0 record was returned once, - // that is, after "end of list" was returned once. - aListP->currentP = aListP->firstP; - } else { - aListP->currentP = aListP->currentP->nextP; - } - - return aListP->currentP; - -} - -/** - * Free all records from a list - */ -void listReset(List* aListP) { - - if (aListP == 0) - return; - - aListP->currentP = 0; - -} - -void logLine(struct _VmApiInternalContext* vmapiContextP, char aSeverity, - const char* aLineP) { - - int blankN = 0; - const char* blanks = " "; - char line[LINESIZE]; - const char* prefix = "+ "; - int prefixL = 0; - int syslogSeverity = LOG_INFO; - struct tm *tP; - struct tm tm; - time_t timeValue; - pid_t pidTrace; - pthread_t myThread; - int temp; - - pidTrace = getpid(); - myThread = pthread_self(); - - switch (aSeverity) { - case 'D': - syslogSeverity = LOG_DEBUG; - break; - case 'E': - syslogSeverity = LOG_ERR; - break; - case 'I': - syslogSeverity = LOG_INFO; - break; - case 'N': - syslogSeverity = LOG_NOTICE; - break; - case 'W': - syslogSeverity = LOG_WARNING; - break; - case 'X': - syslogSeverity = LOG_ERR; - break; - default: - syslogSeverity = LOG_INFO; - break; - } - - if (vmapiContextP->printOffset <= 0) { - sprintf(line, "%d.%lu ", pidTrace, myThread); // add process id and blank - temp = strlen(line); - strncpy(line + temp, aLineP, LINESIZE - temp); - } else { - prefixL = 2 * vmapiContextP->printOffset; - if (prefixL > 10) - prefixL = 10; - snprintf(line, LINESIZE, "%*.s%s\n", prefixL, prefix, aLineP); - } - - openlog(NULL, 0, LOG_LOCAL7); - syslog(syslogSeverity, "%s", line); - closelog(); -} - -void outputLine(struct _VmApiInternalContext* vmapiContextP, - const char* aLineP, int aLogFlag) { - - if (aLogFlag) - logLine(vmapiContextP, ' ', aLineP); - listAppendLine(vmapiContextP, &vmapiContextP->outputStream, aLineP); - -} - -/** - * This function will read the trace file if found and set all the - * trace flags to what is in the file. If a flag is not set in the file - * then that trace is left as it was in the trace structure. - * If the trace file is not found, then this function only sets the - * flag in the context to indicate that this function has been called. - */ -void readTraceFile(struct _VmApiInternalContext* vmapiContextP) { - char pathAndFile[PATHLENGTH + strlen(TRACE_LEVELS_FILE)]; - char* pathP = 0; - int pathLength = 0; - unsigned int newTraceFlags[TRACE_AREAS_COUNT]; - unsigned int newTraceFlagFound[TRACE_AREAS_COUNT]; - char lineData[LINESIZE]; - int lineDataLength; - char line[BUFLEN]; - FILE* traceFileP = 0; - int keywordIndex; - int traceSettingIndex; - int x; - int rc; - char * targetPtr; - - // Init new trace flags array - for (x = 0; x < TRACE_AREAS_COUNT; x++) { - newTraceFlags[x] = 0; - newTraceFlagFound[x] = 0; - } - - // Get the path and file name string for the trace command input - // Default it to the root .cimvm dir - memset(pathAndFile, 0, sizeof(pathAndFile)); - strcpy(pathAndFile, TRACE_LEVELS_FILE_DIRECTORY); // initialize to default path - strcat(pathAndFile, TRACE_LEVELS_FILE); // add on file name - - pathP = getenv("VMAPI"); // Is there a VMAPI environment variable set? - if (pathP) { - pathLength = strlen(pathP) + sizeof(TRACE_LEVELS_FILE) + 1; - if (pathLength > sizeof(pathAndFile)) { - sprintf( - line, - "readTraceFile: Insufficient path buffer size; needed %d, have %d.", - pathLength, sizeof(pathAndFile)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcContext, - RsInternalBufferTooSmall, line); - return; - } - strncpy(pathAndFile, pathP, pathLength); - if (pathAndFile[pathLength - 1] == '/') { - strcat(pathAndFile, TRACE_LEVELS_FILE); - } else { - strcat(pathAndFile, "/"); - strcat(pathAndFile, TRACE_LEVELS_FILE); - } - } - - // Now open the file and figure out the trace flags to set/reset - traceFileP = fopen(pathAndFile, "r"); - if (traceFileP) { - // Look for keywords and comments in the trace command file - while (fgets(lineData, sizeof(lineData), traceFileP)) { - lineDataLength = strlen(lineData); - - // Ignore all 0 length input - if (0 == lineDataLength) { - continue; - } - - // Ignore comment lines - begin with '#' - if (0 != strncmp(lineData, "#", 1)) { - // Try to find a keyword match - keywordIndex = -1; - for (x = 0; x < TRACE_AREAS_COUNT; x++) { - if (0 == strncmp(lineData, TRACE_KEYWORDS[x], strlen( - TRACE_KEYWORDS[x]))) { - keywordIndex = x; - break; - } - } - // If no keyword found, log an error - if (keywordIndex == -1) { - sprintf(line, - "readTraceFile: Unknown keyword on line: <%s> \n", - lineData); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsFunctionUnknown, line); - return; - } - - targetPtr = strstr(lineData, "="); // Find the = sign - if (0 == targetPtr) { - sprintf(line, "readTraceFile: Missing = on line: <%s> \n", - lineData); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsFunctionUnknown, line); - return; - } - - // Look for a trace settings value - traceSettingIndex = -1; - for (x = 0; x < TRACE_LEVELS_COUNT; x++) { - if (0 != strstr(targetPtr, TRACE_LEVELS[x])) { - traceSettingIndex = x; - break; - } - } - - // If no trace setting keyword found, log an error - if (traceSettingIndex == -1) { - sprintf( - line, - "readTraceFile: Unknown trace setting on line: <%s> \n", - lineData); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsFunctionUnknown, line); - return; - } - - // Now set or reset the bits in the new trace flags variable - if (TRACELEVEL_OFF == traceSettingIndex) // if the trace is to be turned off - { - newTraceFlags[keywordIndex] = 0; - newTraceFlagFound[keywordIndex] = 1; - } else { - newTraceFlags[keywordIndex] - |= TRACE_FLAG_VALUES[traceSettingIndex]; - newTraceFlagFound[keywordIndex] = 1; - } - } - } - - // Set the trace flags pointed to from the context - // If there was a keyword found otherwise skip setting it - for (x = 0; x < TRACE_AREAS_COUNT; x++) { - if (newTraceFlagFound[x]) { - vmapiContextP->smTraceDetails->traceFlags[x] = newTraceFlags[x]; - } - } - - fclose(traceFileP); - - } - vmapiContextP->smTraceDetails->traceFileRead = 1; // Set flag that said we read/tried to read trace settings - return; -} - -char* -strip(char* aLineP, char anOption, char aChar) { - - char* lineP = aLineP; - char* lastP = 0; - int lineL = 0; - int x; - - if (lineP == 0) - return lineP; - - // Strip leading chars - if ((anOption == 'L') || (anOption == 'B')) { - - lineL = strlen(lineP); - if (lineL > 0) { - for (x = 0; x < lineL; ++x, ++lineP) { - if (*lineP != aChar) - break; - } - } - - } - - // Strip trailing chars - if ((anOption == 'T') || (anOption == 'B')) { - - lineL = strlen(lineP); - if (lineL > 0) { - lastP = lineP + lineL - 1; - for (x = lineL; x > 0; --x, --lastP) { - if (*lastP != aChar) - break; - *lastP = 0; - } - } - - } - - return lineP; -} - -void sysinfo(struct _VmApiInternalContext* vmapiContextP, int anArgc, - const char** anArgvPP) { - - char buffer[LINESIZE]; - char* bufferP = 0; - int len = 0; - - FILE* sysinfoP = fopen("/proc/sysinfo", "r"); - if (sysinfoP) { - rewind(sysinfoP); - while (bufferP = fgets(buffer, sizeof(buffer), sysinfoP)) { - len = strlen(bufferP); - if ((len > 0) && (bufferP[len - 1] == '\n')) { - bufferP[len - 1] = 0; - } - outputLine(vmapiContextP, bufferP, 0); - } - fclose(sysinfoP); - } - -} - -int testDigit(char aChar) { - - static char digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; - int x; - for (x = 0; x < (sizeof(digits) / sizeof(digits[0])); ++x) { - if (aChar == digits[x]) - return 1; - } - - return 0; - -} - -const char* -vmApiMessageText(VmApiInternalContext* contextP) { - const char* noCtxMsgP = "(No message available - VmApi context missing)"; - const char* noMsgP = "(No message available for return/reason code pair)"; - - char emsg[LINESIZE]; - int rc = 0; - int rs = 0; - int x = 0; - - const char* msgFilenameP = 0; - FILE* msgFileP = 0; - char completeMatch[20]; - char rcMatch[20]; - char* msgP = 0; - char* targetP = 0; - char* rcP = 0; - char* rsP = 0; - char rcS[6]; - char rsS[6]; - - if (contextP == 0) - return noCtxMsgP; - - strcpy(contextP->emsg, noMsgP); // Default - - char filename[sizeof(contextP->path) + 15]; // Adjust once NLS filenames settled - - // Message text comes from the translatable message file - char resultLine[LINESIZE]; - int resultLineL = 0; - msgFilenameP = contextGetMessageFilename(contextP, filename, - sizeof(filename)); - if (msgFilenameP) { - msgFileP = fopen(msgFilenameP, "r"); - if (msgFileP) { - // Look for matching 'VMAPI rc reason' in message file - while (fgets(resultLine, sizeof(resultLine), msgFileP)) { - resultLineL = strlen(resultLine); - if (0 != strncmp(resultLine, "#", 1)) { // Ignore comment lines - begin with '#' - if (0 == strncmp(resultLine, "VMAPI", 5)) { // Only if component is VMAPI //strip off second word (rc) and third word (reason) - targetP = strstr(resultLine, " "); // First blank - if (targetP) { - rcP = targetP + 1; - while (rcP && (*rcP != ' ')) - ++rcP; // First blank after rc - strncpy(rcS, targetP + 1, ((rcP) - (targetP + 1) - + 1)); - rc = atoi(rcS); - rsP = rcP + 1; // Skip blank - while (rsP && (*rsP != ' ')) - ++rsP; // First blank after rs - strncpy(rsS, rcP + 1, ((rsP) - (rcP + 1) + 1)); - rs = atoi(rsS); - - if ((rc == contextP->rc) - && (rs == contextP->reason)) { - - strcpy(contextP->emsg, resultLine); - break; - } - - // If no specific reason code matches, use return-code-only - // message. This requires that the rs=0 message for a specific - // return code be placed as the last message for that return - // code in the message file. - if ((rc == contextP->rc) && (rs == 0)) { - strcpy(contextP->emsg, resultLine); - break; - } - } - } - } - - } - // If message file can't be opened or msg isn't in file - return - // with the defaule message set above - } - - } - fclose(msgFileP); - return contextP->emsg; -} - -/** - * Procedure: vmbkendcacheEntryInvalidate - * - * Purpose: Mark the specified cache entry as invalid. - * - * Input: pointer to cache path - * name of the user ID to invalidate - * Output: - * 0 : invalidate performed successfully. - * 1 : invalidate unsuccessful because stat indicated ENOENT - * 2 : invalidate unsuccessful because stat got some other error - * 3 : invalidated by removing cache entry due to fopen failure. - * 4 : the fopen failed and the remove failed also. - * - * Operation: - * . Generate the name of the cache file based on the inputs - * . If the cache file can be opened, write 'Invalid' status to beginning - * . Else try to remove the file - */ -int vmbkendCacheEntryInvalidate(struct _VmApiInternalContext* vmapiContextP, - char *pathP, char *useridP) { - - char cacheEntry[CACHEENTRYLEN]; - char status[] = "INVALID"; - FILE* cFP; - int rc; - int exitrc; - struct stat statBuf; - char line[LINESIZE]; - int scaffold = 0; // If scaffolding wanted: No (0) Yes (1) - - int cacheFileFd; - struct flock fl; - - exitrc = 0; // Initialize to success - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - sprintf(cacheEntry, "%s%.8s.direct", pathP, useridP); - - // If the cache file doesn't exist, nothing to do - rc = stat(cacheEntry, &statBuf); - if (rc == -1) { - // Can't continue but check the reason for the stat failing. - if (errno == ENOENT) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendCacheEntryInvalidate: cache file (%s) does not exist.\n", - cacheEntry); - TRACE_END_DEBUG(vmapiContextP, line); - - return 1; - } else { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendCacheEntryInvalidate: stat() on (%s) got errno (0x%x)\n", - cacheEntry, errno); - TRACE_END_DEBUG(vmapiContextP, line); - - return 2; - } - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendCacheEntryInvalidate: About to invalidate cache entry (%s)\n", - cacheEntry); - TRACE_END_DEBUG(vmapiContextP, line); - - rc = remove(cacheEntry); - if (rc == -1) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendCacheEntryInvalidate: remove error on (%s), errno (0x%x)\n", - cacheEntry, errno); - TRACE_END_DEBUG(vmapiContextP, line); - - exitrc = 4; - } else { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendCacheEntryInvalidate: removed cache file (%s)\n", - cacheEntry); - TRACE_END_DEBUG(vmapiContextP, line); - - exitrc = 3; - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return exitrc; -} - -int vmbkendCheck(struct _VmApiInternalContext* vmapiContextP) { - - pid_t pid1, pid2, ppid; - int rc, status; - char buf[LINESIZE + LINESIZE]; - char line[LINESIZE]; - - pthread_t thread; - pthread_attr_t attr; - - rc = 0; - - int backendSemaphoreValue = 0; - void *vmapiPtr = NULL; - - // Check if backend already running and return in this case - backendSemaphoreValue = semctl(vmapiContextP->semId, BackendSemaphoreIndex, - GETVAL, 0); - - if (1 != backendSemaphoreValue) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendCheck: Backend apparently running; passing backend start \n"); - TRACE_END_DEBUG(vmapiContextP, line); - vmapiContextP->checkBackendFlag = 1; // Mark the backend as running - return rc; // Backend running - } - - // If vmbkend daemon not started, start it - // Create a pthread and call the vmbkendMain - vmapiPtr = (void*) dlopen(VMAPILIB, RTLD_NOW); // Load the library - - if (vmapiPtr == NULL) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendCheck: Loading library failed %s .\n", dlerror()); - TRACE_END_DEBUG(vmapiContextP, line); - } - - pthread_attr_init(&attr); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendCheck: Creating a pthread \n"); - TRACE_END_DEBUG(vmapiContextP, line); - - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - pthread_mutex_lock(&mutex); - rc = pthread_create(&thread, &attr, vmbkendMain, (void *) vmapiContextP); - - pthread_cond_wait(&thread_initialized_cv, &mutex); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendCheck: pthread created with rc = %d \n", rc); - TRACE_END_DEBUG(vmapiContextP, line); - - return 0; -} - -/** - * Procedure: vmbkendgetCachePath - * - * Purpose: Return the path to the $VMAPI/.vmapi/cache directory, where - * $VMAPI is the VMAPI environment variable. If VMAPI is not - * defined, the current working directory '.' is used. - * - * An example of the directory returned is as follows (note the - * slash at the end): - * - * /foo/bar/.vmapi/cache/ - * - * Input: pointer to string for where to put the cache path - * Output: none - * - * Operation: - * . Get VMAPI environment variable - * . Pull together the cache directory using the VMAPI value. - * - */ -void vmbkendGetCachePath(struct _VmApiInternalContext* vmapiContextP, - char *pathP) { - - char *getenvP = 0; - char line[LINESIZE]; - int retValue; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Obtain path to $VMAPI/.vmapi/cache - // If no (context) path string call to initialize things. - if (1 != vmapiContextP->contextCreatedFlag) { - retValue = initializeThreadSemaphores(vmapiContextP, "", 1); // Create context using no name to override current context name - if (retValue) { - sprintf( - line, - "vmbkendGetCachePath(): context reserve() returned error: %d\n", - retValue); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, line); - return; - } - } - strcpy(pathP, vmapiContextP->path); - - strcat(pathP, CACHE_DIRECTORY); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendGetCachePath: The cache path is (%s)\n", pathP); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return; - -} - -void *vmbkendMain(void *context) { - - int argIndex; - int serverSock; - struct sockaddr_in serverSockaddr; - struct sockaddr_in serverSockaddr1; - struct sockaddr_in clientSockaddr; - struct sockaddr_in notificationSocketInfo; - struct sockaddr_in previousSockaddr; - - int socklen; - int rc; - int clientLen; - char readBuffer[BUFLEN]; - char userID[BUFLEN]; - unsigned int useridLength; - int bytesRead; - struct sembuf operations[1]; - - char cmd[BUFLEN]; - unsigned int cmdLength; - char subData[BUFLEN]; - unsigned int subDataLength; - struct in_addr inaddr; - int x; - - int clientSock; - int totalRead; - - char hostid[20]; - unsigned char *ipP = 0; - char path[BUFLEN + 1]; - char cachePath[BUFLEN + 1]; - char userListPath[BUFLEN + 1]; - - time_t ltime; - char line[LINESIZE + LINESIZE]; - pid_t pid; - - char ourIpAddr[20]; - unsigned int ourPort; - smMemoryGroupContext localMemoryGroup; - smMemoryGroupContext * saveMemoryGroup; - vmApiAsynchronousNotificationEnableDmOutput * ptrEnableOutputData; - vmApiAsynchronousNotificationDisableDmOutput * ptrDisableOutputData; - - VmApiInternalContext *vmapiContextP; - - VmApiInternalContext vmapiContext; - smMemoryGroupContext memContext; - extern struct _smTrace externSmapiTraceFlags; - int smrc; - pthread_mutex_lock(&mutex); - - // Expand the macro for time being - memset(&vmapiContext, 0, sizeof(*(&vmapiContext))); - memset(&memContext, 0, sizeof(*(&memContext))); - (&vmapiContext)->memContext = &memContext; - (&vmapiContext)->smTraceDetails - = (struct _smTrace *) &externSmapiTraceFlags; - smrc = smMemoryGroupInitialize(&vmapiContext); - - if (0 == smrc) { - readTraceFile(&vmapiContext); - } else { - logLine(&vmapiContext, 'E', "Unexpected smMemoryGroupInitializeError!"); - } - - vmapiContextP = &vmapiContext; - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "Inside back end thread \n"); - TRACE_END_DEBUG(vmapiContextP, line); - - if (1 != vmapiContextP->contextCreatedFlag) { - rc = initializeThreadSemaphores(vmapiContextP, "", 1); // create context using no name to override current context name - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "Inside back end thread retValue = %d \n", rc); - TRACE_END_DEBUG(vmapiContextP, line); - } - - // Indicate this is the backend - vmapiContextP->isBackend = 1; - - // Obtain the Backend semaphore to before manipulating context related stuff - operations[0].sem_num = BackendSemaphoreIndex; - operations[0].sem_op = -1; - operations[0].sem_flg = SEM_UNDO; - rc = semop(vmapiContextP->semId, operations, sizeof(operations) - / sizeof(operations[0])); - if (rc < 0) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendMain: semop (decrement) failed, errno=%d text: %s", - errno, strerror(errno)); - TRACE_END_DEBUG(vmapiContextP, line); - } - - // OK: ready to go - time(<ime); - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Entry to --> at %s", ctime(<ime)); - TRACE_END_DEBUG(vmapiContextP, line); - - // Build path to the cache directory. - memset(path, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - - // Call routine to remove the cache. - vmbkendRemoveEntireCache(vmapiContextP, cachePath); - - // Do the necessary socket server setup - serverSock = socket(AF_INET, SOCK_DGRAM, 0); - exit_if_error(Socket, serverSock, serverSock); - - memset(&serverSockaddr, 0, sizeof serverSockaddr); - - // Read and use any previous port number that may have - // been set by a previous run of vmbkend. If no previous - // run or error, the value zero is returned. - vmbkendSockaddrFileInfo(vmapiContextP, 0, &previousSockaddr); - serverSockaddr.sin_port = previousSockaddr.sin_port; - serverSockaddr.sin_family = AF_INET; - serverSockaddr.sin_addr.s_addr = htonl(INADDR_ANY); - - rc = bind(serverSock, (struct sockaddr *) &serverSockaddr, - sizeof serverSockaddr); - - if (-1 == rc) { // Bind failure - if (0 == serverSockaddr.sin_port) { - // The bind for an ephemeral port failed. - exit_if_error(Bind, rc, serverSock); - } else { - // We used a previous port and this failed, - // Retry the bind for any ephemeral port. - memset(&serverSockaddr, 0, sizeof serverSockaddr); - serverSockaddr.sin_port = 0; - serverSockaddr.sin_addr.s_addr = htonl(INADDR_ANY); - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - TRACE_END_DEBUG(vmapiContextP, - "vmbkendMain: Retrying bind for sin_port <0>\n"); - rc = bind(serverSock, (struct sockaddr *) &serverSockaddr, - sizeof serverSockaddr); - - exit_if_error(Bind, rc, serverSock); - } - } - - memset(&serverSockaddr1, 0, sizeof serverSockaddr1); - socklen = sizeof serverSockaddr1; - - rc - = getsockname(serverSock, (struct sockaddr *) &serverSockaddr1, - &socklen); - exit_if_error(Getsockname, rc, serverSock); - - // Show the IP address for our system - get_myaddress(¬ificationSocketInfo); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - // Show what port number we are listening on - sprintf(line, "vmbkendMain: Listening on %s:%u", inet_ntoa( - notificationSocketInfo.sin_addr), (unsigned) ntohs( - serverSockaddr1.sin_port)); - TRACE_END_DEBUG(vmapiContextP, line); - - // Set port for notification - notificationSocketInfo.sin_port = serverSockaddr1.sin_port; - - // If we used different information from a previous run - // then: - // - write new info to the file PORT_FILENAME - // - unregister old info with the directory manager. - if ((previousSockaddr.sin_port != notificationSocketInfo.sin_port) - || (previousSockaddr.sin_addr.s_addr - != notificationSocketInfo.sin_addr.s_addr)) { - - // Write new info to PORT_FILENAME - vmbkendSockaddrFileInfo(vmapiContextP, 1, ¬ificationSocketInfo); - - // If previous registration, unregister it - if (0 != previousSockaddr.sin_port) { - sprintf(ourIpAddr, "%s", inet_ntoa(previousSockaddr.sin_addr)); - ourPort = previousSockaddr.sin_port; - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - smMemoryGroupInitialize(vmapiContextP); - - rc = smAsynchronous_Notification_Disable_DM(vmapiContextP, "", // IUCV userID and password not needed - 0, // Password length - "", // Password - "ALL", // Target identifier - 1, // Entity_type directory - 2, // UDP communication_type, - ourPort, // Port_number, - ourIpAddr, // IP_address string, - 1, // ASCII encoding, - 0, // Subscriber_data_length, - "", // Subscriber_data, - &ptrDisableOutputData); - if (0 != rc || 0 != ptrDisableOutputData->returnCode) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendMain: call to asynch unregister got rc1 %d rc2 %d \n", - rc, ptrDisableOutputData->returnCode); - TRACE_END_DEBUG(vmapiContextP, line); - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - close(serverSock); - pthread_exit(NULL); - } - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - } - } // Used different port number - - // Call asynchronous notify RPC to register with the - // directory manager. - sprintf(ourIpAddr, "%s", inet_ntoa(notificationSocketInfo.sin_addr)); - ourPort = notificationSocketInfo.sin_port; - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - smMemoryGroupInitialize(vmapiContextP); - - rc = smAsynchronous_Notification_Enable_DM(vmapiContextP, "", // IUCV userID and password not needed - 0, // Password length - "", // Password - "ALL", // Target identifier - 1, // Entity_type directory - 1, // Include subscription type - 2, // UDP subscription_type - ourPort, // Port_number - ourIpAddr, // IP_address - 1, // ASCII encoding - 0, // Subscriber_data_length - "", // Subscriber_data - &ptrEnableOutputData); - if (0 == rc && 0 != ptrEnableOutputData->returnCode) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendMain: call to asynch register got rc1 %d rc2 %d and rs %d\n", - rc, ptrEnableOutputData->returnCode, - ptrEnableOutputData->reasonCode); - TRACE_END_DEBUG(vmapiContextP, line); - - // If Subscription exists... Do not do anything. - if (!ptrEnableOutputData->returnCode == 428) { - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - close(serverSock); - pthread_exit(NULL); - } - } else if (0 != rc) { - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - close(serverSock); - pthread_exit(NULL); - - } - - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - - // Wait for and handle incoming requests from the - // directory manager. - pthread_cond_signal(&thread_initialized_cv); - pthread_mutex_unlock(&mutex); - for (;;) { - time(<ime); - - // UDP - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: About to receive on %s", ctime(<ime)); - TRACE_END_DEBUG(vmapiContextP, line); - - memset(readBuffer, 0, sizeof readBuffer); - memset(&clientSockaddr, 0, sizeof clientSockaddr); - clientLen = sizeof clientSockaddr; - bytesRead = 0; - useridLength = 0; - - bytesRead = recvfrom(serverSock, readBuffer, sizeof(readBuffer), 0, - (struct sockaddr *) &clientSockaddr, &clientLen); - - if (bytesRead == -1) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: recvfrom got errno %d\n", errno); - TRACE_END_DEBUG(vmapiContextP, line); - break; - } - continue_if_error(Recvfrom, bytesRead, bytesRead); - - strcpy(path, cachePath); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Read %d bytes from %s at time: %s\n", - bytesRead, inet_ntoa(clientSockaddr.sin_addr), ctime(<ime)); - TRACE_END_DEBUG(vmapiContextP, line); - - // If the message is too small, this is an error, go get - // the next message. - if (bytesRead <= LENGTH_OF_USERID_LENGTH_FIELD) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Message is too short"); - TRACE_END_DEBUG(vmapiContextP, line); - continue; - } - - // Pull out the user ID length - useridLength = *(int *) &readBuffer; - useridLength = ntohl(useridLength); - - // Get the user ID - memset(userID, 0, sizeof userID); - strncpy(userID, readBuffer + 4, useridLength); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendMain: User ID length is >%d< and User ID is >%s<\n", - useridLength, userID); - TRACE_END_DEBUG(vmapiContextP, line); - - // Get the command length - cmdLength = *(int *) (readBuffer + 4 + useridLength); - cmdLength = ntohl(cmdLength); - - // Get the command - memset(cmd, 0, sizeof cmd); - strncpy(cmd, readBuffer + 4 + useridLength + 4, cmdLength); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Command is >%s<\n", cmd); - TRACE_END_DEBUG(vmapiContextP, line); - - if (strcasecmp(cmd, "add") == 0 || strcasecmp(cmd, "purge") == 0) { - strcpy(userListPath, cachePath); - strcat(userListPath, "users.list"); - rc = remove(userListPath); - if (rc == -1) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendMain: remove error on (%s), errno (0x%x)\n", - userListPath, errno); - TRACE_END_DEBUG(vmapiContextP, line); - } - } - - // Get the subscriber data length - subDataLength - = *(int *) (readBuffer + 4 + useridLength + 4 + cmdLength); - subDataLength = ntohl(subDataLength); - - // Invalidate the cache entry - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Invalidating cache for user ID (%s)\n", - userID); - TRACE_END_DEBUG(vmapiContextP, line); - - for (x = 0; x < useridLength; ++x) { - userID[x] = tolower(userID[x]); - } - - vmbkendCacheEntryInvalidate(vmapiContextP, path, userID); - - // Clear out the .scan files - } - - // Call asynchronous notify RPC to unregister with the - // directory manager. - sprintf(ourIpAddr, "%s", inet_ntoa(notificationSocketInfo.sin_addr)); - ourPort = notificationSocketInfo.sin_port; - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - smMemoryGroupInitialize(vmapiContextP); - - rc = smAsynchronous_Notification_Disable_DM(vmapiContextP, "", // IUCV userID and password not needed - 0, // Password length - "", // password - "ALL", // Target identifier - 1, // Entity_type directory - 2, // UDP communication_type, - ourPort, // Port_number, - ourIpAddr, // IP_address, - 1, // ASCII encoding, - 0, // Subscriber_data_length, - "", // Subscriber_data, - &ptrDisableOutputData); - if (0 != rc || 0 != ptrDisableOutputData->returnCode) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendMain: call to asynch unregister got rc1 %d rc2 %d \n", - rc, ptrDisableOutputData->returnCode); - TRACE_END_DEBUG(vmapiContextP, line); - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - close(serverSock); - pthread_exit(NULL); - } - - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - - // Close the server socket - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - TRACE_END_DEBUG(vmapiContextP, - "vmbkendMain: About to close() server socket\n"); - rc = close(serverSock); - exit_if_error(Close, rc, rc); - pthread_exit(NULL); -} - -/** - * Procedure: vmbkendremoveCachedScanFiles - * - * Purpose: Remove the ***.scan files. - * - * Input: pointer to cache path - * Output: none - * - * Operation: - * . Build the rm command from the input path - * . Issue the rm command via system() - */ -int vmbkendRemoveCachedScanFiles(struct _VmApiInternalContext* vmapiContextP, - char *pathP) { - - char command[300]; - char line[LINESIZE]; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build the remove command - sprintf(command, "rm -f %s%s", pathP, ALL_SCAN_FILES); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendRemoveCachedScanFiles: About to issue: system(%s)\n", - command); - TRACE_END_DEBUG(vmapiContextP, line); - - if (system(command)) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendRemoveCachedScanFiles: Error removing scan files, errno 0x%X: reason(%s)\n", - errno, strerror(errno)); - TRACE_END_DEBUG(vmapiContextP, line); - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - return 0; - -} - -/** - * Procedure: vmbkendremoveEntireCache - * - * Purpose: Remove all cache entries from the cache directory. - * - * Input: pointer to the cache directory - * Output: none - * - * Operation: - * . Build rm command from input cache directory - * . Issue the rm command via system() - */ -void vmbkendRemoveEntireCache(struct _VmApiInternalContext* vmapiContextP, - char *cachePathP) { - - char command[300]; - char line[LINESIZE]; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build the remove command - sprintf(command, "rm -rf %s*", cachePathP); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendRemoveEntireCache: About to issue: system(%s)\n", - command); - TRACE_END_DEBUG(vmapiContextP, line); - - if (system(command)) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendRemoveEntireCache: Error removing file, errno 0x%X: reason(%s)\n", - errno, strerror(errno)); - TRACE_END_DEBUG(vmapiContextP, line); - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return; -} - -/** - * Procedure: vmbkendSockaddrFileInfo - * - * Purpose: Save new or retrieve previous bind information to or from - * the file defined by $VMAPI/PORT_FILENAME. - * - * Input: int readOrWrite : 0 = read it; 1 = write it - * sockaddr_in saddr: If readOrWrite is read, then on input this is - * is the address of where to store the retrieved bind info. - * If readOrWrite is write, then on input this is the address of - * the sockaddr_in containing the bind info to save. - * - * Output: rc = 0 ; success; if read then saddr contains the read value. - * if write, then the file is updated. - * rc = -1 ; failure; if read, saddr value returned is zeroes. - * if write, saddr is unchanged. - * - * Operation: - * . Get the path to the file $VMAPI/.vmapi/PORT_FILENAME - * . Open the file read or write based on the value of readOrWrite input - * . If error, - * - if read, set saddr to zeroes - * - return -1 - * . If read then read the info - * Else write the info - * . Close the file. - */ -int vmbkendSockaddrFileInfo(struct _VmApiInternalContext* vmapiContextP, - int readOrWrite, struct sockaddr_in *saddr) { - - FILE *fileP = (FILE *) NULL; - char fName[BUFLEN + 1]; - char *getenvP = 0; - int rc = 0; - char line[LINESIZE]; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - strcpy(fName, vmapiContextP->path); - strcat(fName, PORT_FILENAME); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendSockaddrFileInfo: PORT_FILENAME %s \n", fName); - TRACE_END_DEBUG(vmapiContextP, line); - - errno = 0; - if (0 == readOrWrite) { // Read - // If error reading record, return saddr value of zeroes - memset(saddr, 0, sizeof(struct sockaddr_in)); - fileP = fopen(fName, "r"); - } else { - fileP = fopen(fName, "w"); - } - - if (fileP == (FILE *) NULL) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendSockaddrFileInfo: Errno %d opening %s for %s()\n", - errno, fName, (readOrWrite == 0 ? "read" : "write")); - TRACE_END_DEBUG(vmapiContextP, line); - - rc = -1; - goto exit_error2; - } - - if (readOrWrite == 0) { // read - if (EOF == fscanf(fileP, "%x:%hu", &(saddr->sin_addr.s_addr), - &(saddr->sin_port))) { - // If error reading record, return saddr value of zeroes - memset(saddr, 0, sizeof(struct sockaddr_in)); - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendSockaddrFileInfo: Errno %d reading file %s\n", - errno, fName); - TRACE_END_DEBUG(vmapiContextP, line); - - rc = -1; - goto exit_error1; - } - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendSockaddrFileInfo: Read %x:%hu\n", - saddr->sin_addr.s_addr, saddr->sin_port); - TRACE_END_DEBUG(vmapiContextP, line); - - } else { // Write - if (-1 == fprintf(fileP, "%x:%hu", saddr->sin_addr.s_addr, - saddr->sin_port)) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendSockaddrFileInfo: Errno %d writing %x:%hu to %s\n", - errno, saddr->sin_addr.s_addr, saddr->sin_port, fName); - TRACE_END_DEBUG(vmapiContextP, line); - - rc = -1; - goto exit_error1; - } - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendSockaddrFileInfo: Wrote %x:%hu\n", - saddr->sin_addr.s_addr, saddr->sin_port); - TRACE_END_DEBUG(vmapiContextP, line); - } - - exit_error1: if (EOF == fclose(fileP)) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendSockaddrFileInfo: Errno %d closing file %s()\n", - errno, fName); - TRACE_END_DEBUG(vmapiContextP, line); - } - exit_error2: TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - return (rc); -} - -void waitForPendingWorkunits(struct _VmApiInternalContext* vmapiContextP, - int waitIntervalInSeconds) // 0 = wait forever -{ - - int argN = 2; - const char* args[2]; - char line[LINESIZE]; - int maxRc = 0; - int maxReason = 0; - int x = 0; - int workunitsPending = 1; - int workunitId; - int duration; - int interval; - int rc; - time_t startTime; - - smMemoryGroupContext localMemoryGroup; - smMemoryGroupContext * saveMemoryGroup; - vmApiQueryAsynchronousOperationDmOutput * ptrQueryAsynchOutputData; - - // Duration == 0 is assumed as infinite duration - duration = waitIntervalInSeconds; - time(&startTime); - - while (workunitsPending && duration >= 0) { - - workunitsPending = 0; - - for (x = 0; (x < (sizeof(vmapiContextP->pendingWorkunits) - / sizeof(vmapiContextP->pendingWorkunits[0]))); ++x) { - - if (vmapiContextP->pendingWorkunits[x] == 0) - continue; - - workunitId = vmapiContextP->pendingWorkunits[x]; - - vmapiContextP->rc = 0; - vmapiContextP->reason = 0; - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - - smMemoryGroupInitialize(vmapiContextP); - if (0 != (rc = smQuery_Asychronous_Operation_DM(vmapiContextP, - "", // Userid is not required for IUCV - 0, // Length 0; no password of IUCV - "", // No password - vmapiContextP->useridForAsynchNotification, workunitId, - &ptrQueryAsynchOutputData))) { - } - - vmapiContextP->rc = ptrQueryAsynchOutputData->returnCode; - vmapiContextP->reason = ptrQueryAsynchOutputData->reasonCode; - - // Since the only result data we care about is the return and reason codes, we can - // free any working memory now. - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - - // check for finished operation - if ((vmapiContextP->rc == 0) && (vmapiContextP->reason == 100)) { - vmapiContextP->pendingWorkunits[x] = 0; - continue; - } - - // Check for ongoing operation - if ((vmapiContextP->rc == 0) && (vmapiContextP->reason == 104)) { - workunitsPending = 1; // At least this one - continue; - } - - // Check for failed operation - if ((vmapiContextP->rc == 0) && (vmapiContextP->reason == 108)) { - vmapiContextP->rc = 200; // Set failed image operation error code - vmapiContextP->reason = 0; - } - - // Here when an error occurred - // The workunit is assumed to be either finished or failed, - // that is it is not assumed to be ongoing any more. - if ((vmapiContextP->rc == maxRc) && (vmapiContextP->reason - > maxReason)) { - maxReason = vmapiContextP->reason; - } else if (vmapiContextP->rc > maxRc) { - maxRc = vmapiContextP->rc; - maxReason = vmapiContextP->reason; - } - - } - - interval = SleepInterval; - if ((duration > 0) && (interval > duration)) - interval = duration; - - if (workunitsPending && (interval > 0)) { - - sleep(interval); - - } - - if (duration > 0) { - duration -= interval; - // Since == 0 is assumed to be indefinite set -1 in this case - if (duration == 0) - duration = -1; - } - - } - - // Quickfix to overcome problems on tmcc system - sleep(5); - - vmapiContextP->rc = maxRc; - vmapiContextP->reason = maxReason; - -} - -/** - * A valid cache file has good time interval and no "INVALID" PAS0304 - * file is closed for stat to work - */ -int cacheFileValid(struct _VmApiInternalContext* vmapiContextP, - const char* cFNameP) { - - int defaultTimeLimit = 5000; // Seconds = approx 1.5 hours - int timeLimit = 0; - struct stat statbuf; - time_t currentTime; - double fileAgeSeconds = 0; - time_t fileTime = 0; - unsigned int x = 0; - - if (getenv("EPP_CACHE_TIMELIMIT")) { - timeLimit = atoi(getenv("EPP_CACHE_TIMELIMIT")); - } else { - timeLimit = defaultTimeLimit; - } - - if (-1 == time(¤tTime)) - return 0; // Current time failed - - if (-1 == stat(cFNameP, &statbuf)) - return 0; // Stat failed - - fileTime = statbuf.st_mtime; - - fileAgeSeconds = difftime(currentTime, fileTime); - - if ((fileAgeSeconds < 0) || (fileAgeSeconds > timeLimit)) - return 0; - - return 1; -} diff --git a/zhcp/BUILD/resource_access/src/startvs.c b/zhcp/BUILD/resource_access/src/startvs.c deleted file mode 100644 index 73a3cc9..0000000 --- a/zhcp/BUILD/resource_access/src/startvs.c +++ /dev/null @@ -1,73 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Logs on the specified virtual server. - * - * @param $1: The name of the guest which is to be logged on - * - * @return 0 If the image is powered on upon completion - * 1 If given invalid parameters - * 2 If power-on failed - */ -int main(int argC, char* argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Get the virtual server name - char* imageName = argV[1]; - // Check if the virtual server name is between 1 and 8 characters - if (isImageNameInvalid(imageName)) - return 1; - - printf("Starting %s... ", imageName); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageActivateOutput* output; - - // Log on virtual server - int rc = smImage_Activate(&context, "", 0, "", // Authorizing user, password length, password. - imageName, // Image name. - &output); - - int rtnCode = output->common.returnCode; - int rsnCode = output->common.reasonCode; - - // If return code = 200 and reason code = 8, virtual server is logged on - if (rc || (output->common.returnCode && output->common.returnCode != 200 - || (output->common.reasonCode && output->common.reasonCode != 8))) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/stopvs.c b/zhcp/BUILD/resource_access/src/stopvs.c deleted file mode 100644 index a28d9f5..0000000 --- a/zhcp/BUILD/resource_access/src/stopvs.c +++ /dev/null @@ -1,69 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Log off the specified virtual server. - * - * @param $1: The z/VM guest ID of the virtual server which is to be stopped - * - * @return 0 If the image is powered off upon completion - * 1 If given invalid parameters - * 2 If power-off failed - */ -int main(int argC, char* argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Get the virtual server name - char* imageName = argV[1]; - // Check if the virtual server name is between 1 and 8 characters - if (isImageNameInvalid(imageName)) - return 1; - - printf("Stopping %s... ", imageName); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDeactivateOutput* output; - - // Log off virtual server - int rc = smImage_Deactivate(&context, "", 0, "", // Authorizing user, password length, password. - imageName, "IMMED", // Immediate deactivation. - &output); - - if (rc || (output->common.returnCode && output->common.returnCode != 200 - || (output->common.reasonCode && output->common.reasonCode != 12))) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/undedicatedevice.c b/zhcp/BUILD/resource_access/src/undedicatedevice.c deleted file mode 100644 index 82683b6..0000000 --- a/zhcp/BUILD/resource_access/src/undedicatedevice.c +++ /dev/null @@ -1,66 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Removes a dedicated device from a virtual image's directory entry. - * - * @param $1: The name of the guest from which a device is to be removed - * @param $2: The virtual device address assigned to the device - * - * @return 0 If the dedicated device was removed successfully - * 1 If given invalid parameters - * 2 If device undedication failed. - */ -int main(int argC, char* argV[]) { - - if (argC != 6) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - - if (isImageNameInvalid(image)) - return 1; - - printf("Removing device %s on %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDeviceUndedicateDmOutput* output; - - int rc = smImage_Device_Undedicate_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/BUILD/resource_access/src/virtualImage.h b/zhcp/BUILD/resource_access/src/virtualImage.h deleted file mode 100644 index 48b5416..0000000 --- a/zhcp/BUILD/resource_access/src/virtualImage.h +++ /dev/null @@ -1,70 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "smPublic.h" -#include "vmapiSystem.h" -#include "vmapiImage.h" -#include "vmapiVirtual.h" -#include "smPublic.h" -#include "vmapiAsynchronous.h" -#include "vmapiAuthorization.h" -#include "vmapiCheckAuthentication.h" -#include "vmapiDirectoryManager.h" -#include "vmapiName.h" -#include "vmapiProfile.h" -#include "vmapiPrototype.h" - -/* Check if Smapi is up and running - *****************************************************************************************/ -int checkSmapi(VmApiInternalContext vmapiContext); - -/* Use Profile_Create_DM to create a profile directory entry to be included in - * the definition of a virtual image in the directory. - *****************************************************************************************/ -int createProfile(VmApiInternalContext vmapiContext); - -/* Use Prototype_Create_DM to create a new virtual image prototype - *****************************************************************************************/ -int createProto(VmApiInternalContext vmapiContext); - -/* Use Image_Create_DM to define a new virtual image in the directory - *****************************************************************************************/ -int createImage(VmApiInternalContext vmapiContext, char * argV); - -/* Use Prototype_Name_Query_DM to obtain a list of names of defined prototypes - *****************************************************************************************/ -int queryProto(VmApiInternalContext vmapiContext, char * argV); - -/* Use Profile_Query_DM to query a profile directory entry - *****************************************************************************************/ -int queryProfile(VmApiInternalContext vmapiContext, char * argV); - -/* Use Image_Query_DM to obtain a virtual image’s directory entry - *****************************************************************************************/ -int queryImage(VmApiInternalContext vmapiContext, char * argV); - -/* Use Profile_Delete_DM to delete a profile directory entry - *****************************************************************************************/ -int deleteProfile(VmApiInternalContext vmapiContext, char * argV); - -/* Use Prototype_Delete_DM to delete an image prototype - *****************************************************************************************/ -int deleteProto(VmApiInternalContext vmapiContext, char * argV); - -/* Use Image_Delete_DM to delete a virtual image's definition from the directory - *****************************************************************************************/ -int deleteImage(VmApiInternalContext vmapiContext, char * argV); - -/* Use Image_Disk_Create_DM to add a disk to a virtual image’s directory entry - *****************************************************************************************/ -int addDisk(VmApiInternalContext vmapiContext, char * argV); - -/* Use Image_Query_DM to obtain a virtual image’s directory entry - *****************************************************************************************/ -void getImage(VmApiInternalContext vmapiContext, - vmApiImageRecord imageRecord[], char * argV); - -/* Internal function to display error text to console - *****************************************************************************************/ -static void displayErrorText(int errorCode); - diff --git a/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationDisableDm.c b/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationDisableDm.c deleted file mode 100644 index fae3fa1..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationDisableDm.c +++ /dev/null @@ -1,105 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAsynchronous.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Asynchronous_Notification_Disable_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAsynchronousNotificationDisableDmOutput - -/** - * Asynchronous_Notification_Disable_DM SMAPI interface - */ -int smAsynchronous_Notification_Disable_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char communication_type, int port_number, - char * ip_address, char encoding, int subscriber_data_length, - char * subscriber_data, - vmApiAsynchronousNotificationDisableDmOutput ** outData) { - const char * const functionName = "Asynchronous_Notification_Disable_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - // The input buffer size of the VMAPI socket call is calculated by adding up all the - // field lengths and data (see System management application programming manual for details) - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 + 1 + 4 + 4 - + strlen(ip_address) + 1 + 4 + subscriber_data_length; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = entity_type; // Entity_type int1 - cursor++; - - *cursor = communication_type; // Communication_type int1 - cursor++; - - PUT_INT(port_number, cursor); // Port_number int4 - - tempSize = strlen(ip_address); // IP_address 7..15 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, ip_address, tempSize); - cursor += tempSize; - - *cursor = encoding; // Encoding - cursor++; - - tempSize = subscriber_data_length; // Subscriber_data 0..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, subscriber_data, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationEnableDm.c b/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationEnableDm.c deleted file mode 100644 index ecc62af..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationEnableDm.c +++ /dev/null @@ -1,106 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAsynchronous.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Asynchronous_Notification_Enable_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAsynchronousNotificationEnableDmOutput - -/** - * Asynchronous_Notification_Enable_DM SMAPI interface - */ -int smAsynchronous_Notification_Enable_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char subscription_type, char communication_type, - int port_number, char * ip_address, char encoding, - int subscriber_data_length, char * subscriber_data, - vmApiAsynchronousNotificationEnableDmOutput ** outData) { - const char * const functionName = "Asynchronous_Notification_Enable_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 + 1 + 1 + 4 + 4 - + strlen(ip_address) + 1 + 4 + subscriber_data_length; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = entity_type; // Entity_type int1 - cursor++; - - *cursor = subscription_type; // Subscription_type int1 - cursor++; - - *cursor = communication_type; // Communication_type int1 - cursor++; - - PUT_INT(port_number, cursor); // Port_number int4 - - tempSize = strlen(ip_address); // IP_address 7..15 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, ip_address, tempSize); - cursor += tempSize; - - *cursor = encoding; // Encoding - cursor++; - - tempSize = subscriber_data_length; // Subscriber_data 0..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, subscriber_data, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationQueryDm.c deleted file mode 100644 index c148a76..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiAsynchronousNotificationQueryDm.c +++ /dev/null @@ -1,105 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAsynchronous.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Asynchronous_Notification_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAsynchronousNotificationQueryDmOutput - -/** - * Asynchronous_Notification_Query_DM SMAPI interface - */ -int smAsynchronous_Notification_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char communication_type, int port_number, - char * ip_address, char encoding, int subscriber_data_length, - char * subscriber_data, - vmApiAsynchronousNotificationQueryDmOutput ** outData) { - const char * const functionName = "Asynchronous_Notification_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 + 1 + 4 + 4 - + strlen(ip_address) + 1 /* Encoding */+ 4 + subscriber_data_length; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - tempSize = strlen(functionName); - - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = entity_type; // Entity_type int1 - cursor++; - - *cursor = communication_type; // Communication_type int1 - cursor++; - - PUT_INT(port_number, cursor); // Port_number int4 - - tempSize = strlen(ip_address); // IP_address 7..15 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, ip_address, tempSize); - cursor += tempSize; - - *cursor = encoding; // Encoding - cursor++; - - tempSize = subscriber_data_length; // Subscriber_data 0..64 chars - PUT_INT(tempSize, cursor); - - if (tempSize > 0) { - memcpy(cursor, subscriber_data, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiAuthorizationListAdd.c b/zhcp/BUILD/resource_access/src/vmapiAuthorizationListAdd.c deleted file mode 100644 index d22c0fd..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiAuthorizationListAdd.c +++ /dev/null @@ -1,88 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAuthorization.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Authorization_List_Add_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAuthorizationListAddOutput - -/** - * Authorization_List_Add SMAPI interface - */ -int smAuthorization_List_Add(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListAddOutput ** outData) { - const char * const functionName = "Authorization_List_Add"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + strlen(for_id) + 4 + strlen(function_id); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(for_id); // For_id 1..8 or 1..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, for_id, tempSize); - cursor += tempSize; - - tempSize = strlen(function_id); // Function_id 1..64 OR 1..* chars - PUT_INT(tempSize, cursor); - memcpy(cursor, function_id, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiAuthorizationListQuery.c b/zhcp/BUILD/resource_access/src/vmapiAuthorizationListQuery.c deleted file mode 100644 index 0e493e4..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiAuthorizationListQuery.c +++ /dev/null @@ -1,88 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAuthorization.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Authorization_List_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAuthorizationListQueryOutput - -/** - * Authorization_List_Query SMAPI interface - */ -int smAuthorization_List_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListQueryOutput ** outData) { - const char * const functionName = "Authorization_List_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + strlen(for_id) + 4 + strlen(function_id); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(for_id); // For_id 0..8 or 0..64 or 1 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, for_id, tempSize); - cursor += tempSize; - - tempSize = strlen(function_id); // Function_id 0..64 OR 1 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, function_id, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiAuthorizationListRemove.c b/zhcp/BUILD/resource_access/src/vmapiAuthorizationListRemove.c deleted file mode 100644 index 64a3415..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiAuthorizationListRemove.c +++ /dev/null @@ -1,88 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAuthorization.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Authorization_List_Remove_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAuthorizationListRemoveOutput - -/** - * Authorization_List_Remove SMAPI interface - */ -int smAuthorization_List_Remove(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListRemoveOutput ** outData) { - const char * const functionName = "Authorization_List_Remove"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + strlen(for_id) + 4 + strlen(function_id); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(for_id); // For_id 1..8 or 1..64 or 1 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, for_id, tempSize); - cursor += tempSize; - - tempSize = strlen(function_id); // Function_id 1..64 OR 1 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, function_id, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiCheckAuthentication.c b/zhcp/BUILD/resource_access/src/vmapiCheckAuthentication.c deleted file mode 100644 index 1c3132d..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiCheckAuthentication.c +++ /dev/null @@ -1,71 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiCheckAuthentication.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Check_Authentication_Layout -#define OUTPUT_STRUCTURE_NAME vmApiCheckAuthenticationOutput - -/** - * Check_Authentication_DM SMAPI interface - */ -int smCheck_Authentication(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - vmApiCheckAuthenticationOutput ** outData) { - const char * const functionName = "Check_Authentication"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagDefineDm.c b/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagDefineDm.c deleted file mode 100644 index e262981..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagDefineDm.c +++ /dev/null @@ -1,89 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Local_Tag_Define_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerLocalTagDefineDmOutput - -/** - * Directory_Manager_Local_Tag_Define_DM SMAPI interface - */ -int smDirectory_Manager_Local_Tag_Define_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, int tag_ordinal, char createOrChange, - vmApiDirectoryManagerLocalTagDefineDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Local_Tag_Define_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - tag_name) + 4 + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(tag_name); // Tag_name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_name, tempSize); - cursor += tempSize; - - PUT_INT(tag_ordinal, cursor); - - *cursor = createOrChange; // Create or change request - *cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagDeleteDm.c deleted file mode 100644 index 394561c..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagDeleteDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Local_Tag_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerLocalTagDeleteDmOutput - -/** - * Directory_Manager_Local_Tag_Delete_DM SMAPI interface - */ -int smDirectory_Manager_Local_Tag_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, vmApiDirectoryManagerLocalTagDeleteDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Local_Tag_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - tag_name); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(tag_name); // Tag_name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_name, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagQueryDm.c deleted file mode 100644 index 2a9f18b..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagQueryDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Local_Tag_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerLocalTagQueryDmOutput - -/** - * Directory_Manager_Local_Tag_Query_DM SMAPI interface - */ -int smDirectory_Manager_Local_Tag_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, vmApiDirectoryManagerLocalTagQueryDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Local_Tag_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - tag_name); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(tag_name); // Tag_name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_name, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagSetDm.c b/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagSetDm.c deleted file mode 100644 index 18d20fb..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerLocalTagSetDm.c +++ /dev/null @@ -1,89 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Local_Tag_Set_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerLocalTagSetDmOutput - -/** - * Directory_Manager_Local_Tag_Set_DM SMAPI interface - */ -int smDirectory_Manager_Local_Tag_Set_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, int tag_value_length, char * tag_value, - vmApiDirectoryManagerLocalTagSetDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Local_Tag_Set_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - tag_name) + 4 + tag_value_length; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(tag_name); // Tag_name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_name, tempSize); - cursor += tempSize; - - tempSize = tag_value_length; // Tag_value 1..240 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_value, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerSearchDm.c b/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerSearchDm.c deleted file mode 100644 index fbf9bab..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerSearchDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Search_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerSearchDmOutput - -/** - * Directory_Manager_Search_DM SMAPI interface - */ -int smDirectory_Manager_Search_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int search_pattern_length, - char * search_pattern, vmApiDirectoryManagerSearchDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Search_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + search_pattern_length; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = search_pattern_length; // Search_pattern 1..72 charNA - PUT_INT(tempSize, cursor); - memcpy(cursor, search_pattern, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerTaskCancelDm.c b/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerTaskCancelDm.c deleted file mode 100644 index cc1f6b8..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiDirectoryManagerTaskCancelDm.c +++ /dev/null @@ -1,80 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Task_Cancel_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerTaskCancelDmOutput - -/** - * Directory_Manager_Task_Cancel_DM SMAPI interface - */ -int smDirectory_Manager_Task_Cancel_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - int operation_id, vmApiDirectoryManagerTaskCancelDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Task_Cancel_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - PUT_INT(operation_id, cursor); - cursor += 4; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiIPaddrGet.c b/zhcp/BUILD/resource_access/src/vmapiIPaddrGet.c deleted file mode 100644 index 84ac556..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiIPaddrGet.c +++ /dev/null @@ -1,57 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiSystem.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME IPaddr_Get_Layout -#define OUTPUT_STRUCTURE_NAME vmApiIPaddrGetOutput - -/** - * Virtual_Network_Query_OSA SMAPI interface - */ -int smIPaddr_Get(struct _VmApiInternalContext* vmapiContextP, - vmApiIPaddrGetOutput ** outData) { - const char * const functionName = "IPaddr_Get"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageActivate.c b/zhcp/BUILD/resource_access/src/vmapiImageActivate.c deleted file mode 100644 index a94498f..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageActivate.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Activate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageActivateOutput - -/** - * Image_Activate SMAPI interface - */ -int smImage_Activate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageActivateOutput ** outData) { - const char * const functionName = "Image_Activate"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 or 1..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageActiveConfigurationQuery.c b/zhcp/BUILD/resource_access/src/vmapiImageActiveConfigurationQuery.c deleted file mode 100644 index 7561e1e..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageActiveConfigurationQuery.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Active_Configuration_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageActiveConfigurationQueryOutput - -/** - * Image_Active Configiration Query SMAPI interface - */ -int smImage_Active_Configuration_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageActiveConfigurationQueryOutput ** outData) { - const char * const functionName = "Image_Active_Configuration_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (userid) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageCpuDefine.c b/zhcp/BUILD/resource_access/src/vmapiImageCpuDefine.c deleted file mode 100644 index 5bd08bf..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageCpuDefine.c +++ /dev/null @@ -1,87 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Define_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuDefineOutput - -/** - * Image_CPU_Define SMAPI interface - */ -int smImage_CPU_Define(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, char cpuType, - vmApiImageCpuDefineOutput ** outData) { - const char * const functionName = "Image_CPU_Define"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress) + 1; /* CPU type */ - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - *cursor = cpuType; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageCpuDefineDm.c b/zhcp/BUILD/resource_access/src/vmapiImageCpuDefineDm.c deleted file mode 100644 index e293d50..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageCpuDefineDm.c +++ /dev/null @@ -1,102 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Define_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuDefineDmOutput - -/** - * Image_CPU_Define_DM SMAPI interface - */ -int smImage_CPU_Define_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, char baseCpu, char * cpuId, - char dedicateCpu, char cryptoCpu, - vmApiImageCpuDefineDmOutput ** outData) { - const char * const functionName = "Image_CPU_Define_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress) + 1 /* Base CPU */+ 4 + strlen(cpuId) + 1 - /* Dedicate CPU */+ 1; /* Crypto */ - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - *cursor = baseCpu; - cursor++; - - tempSize = strlen(cpuId); // CPU ID 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, cpuId, tempSize); - cursor += tempSize; - } - - *cursor = dedicateCpu; - cursor++; - - *cursor = cryptoCpu; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageCpuDelete.c b/zhcp/BUILD/resource_access/src/vmapiImageCpuDelete.c deleted file mode 100644 index 7931c0f..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageCpuDelete.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuDeleteOutput - -/** - * Image_CPU_Delete SMAPI interface - */ -int smImage_CPU_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuDeleteOutput ** outData) { - const char * const functionName = "Image_CPU_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageCpuDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiImageCpuDeleteDm.c deleted file mode 100644 index 5f499b5..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageCpuDeleteDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuDeleteDmOutput - -/** - * Image_CPU_Delete_DM SMAPI interface - */ -int smImage_CPU_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuDeleteDmOutput ** outData) { - const char * const functionName = "Image_CPU_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageCpuQuery.c b/zhcp/BUILD/resource_access/src/vmapiImageCpuQuery.c deleted file mode 100644 index 90c6067..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageCpuQuery.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuQueryOutput - -/** - * Image_CPU_Query SMAPI interface - */ -int smImage_CPU_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageCpuQueryOutput ** outData) { - const char * const functionName = "Image_CPU_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageCpuQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiImageCpuQueryDm.c deleted file mode 100644 index d53e93b..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageCpuQueryDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuQueryDmOutput - -/** - * Image_CPU_Query_DM SMAPI interface - */ -int smImage_CPU_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuQueryDmOutput ** outData) { - const char * const functionName = "Image_CPU_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageCpuSetMaximumDm.c b/zhcp/BUILD/resource_access/src/vmapiImageCpuSetMaximumDm.c deleted file mode 100644 index e2b3995..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageCpuSetMaximumDm.c +++ /dev/null @@ -1,80 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Set_Maximum_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuSetMaximumDmOutput - -/** - * Image_CPU_Set_Maximum_DM SMAPI interface - */ -int smImage_CPU_Set_Maximum_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int maxCpus, - vmApiImageCpuSetMaximumDmOutput ** outData) { - const char * const functionName = "Image_CPU_Set_Maximum_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* Max CPUs */; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - PUT_INT(maxCpus, cursor); - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageCreateDm.c b/zhcp/BUILD/resource_access/src/vmapiImageCreateDm.c deleted file mode 100644 index 3064b28..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageCreateDm.c +++ /dev/null @@ -1,122 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCreateDmOutput - -/** - * Image_Create_DM SMAPI interface - */ -int smImage_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * prototypeName, - int initialPasswordLength, char * initialPassword, - char * initialAccountNumber, int imageRecordCount, - vmApiImageRecord * imageRecordList, vmApiImageCreateDmOutput ** outData) { - const char * const functionName = "Image_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - prototypeName) + 4 + initialPasswordLength + 4 + strlen( - initialAccountNumber) + 4; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int imageRecordTotal = 0; - for (i = 0; i < imageRecordCount; i++) { - inputSize += 4; // Record length integer - inputSize += imageRecordList[i].imageRecordLength; // Data length - - imageRecordTotal += 4; - imageRecordTotal += imageRecordList[i].imageRecordLength; - } - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize + 4))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (image name) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(prototypeName); // Prototype name 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, prototypeName, tempSize); - cursor += tempSize; - } - - tempSize = initialPasswordLength; // Initial password 0..200 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, initialPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(initialAccountNumber); // Initial account number 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, initialAccountNumber, tempSize); - cursor += tempSize; - } - - // Add in the length of images array then the data if available - PUT_INT(imageRecordTotal, cursor); - if (imageRecordTotal > 0) { - for (i = 0; i < imageRecordCount; i++) { - tempSize = imageRecordList[i].imageRecordLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, imageRecordList[i].imageRecord, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDeactivate.c b/zhcp/BUILD/resource_access/src/vmapiImageDeactivate.c deleted file mode 100644 index ac0f4e9..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDeactivate.c +++ /dev/null @@ -1,86 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Deactivate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeactivateOutput - -/** - * Image_Deactivate SMAPI interface - */ -int smImage_Deactivate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * forceTime, - vmApiImageDeactivateOutput ** outData) { - const char * const functionName = "Image_Deactivate"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - forceTime); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 or 1..64 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(forceTime); // Force time 0..12 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, forceTime, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiImageDeleteDm.c deleted file mode 100644 index b60a58a..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDeleteDm.c +++ /dev/null @@ -1,82 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeleteDmOutput - -/** - * Image_Delete_DM SMAPI interface - */ -int smImage_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char dataSecurityErase, - vmApiImageDeleteDmOutput ** outData) { - const char * const functionName = "Image_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1; - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Data security erase byte - *cursor = dataSecurityErase; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDeviceDedicate.c b/zhcp/BUILD/resource_access/src/vmapiImageDeviceDedicate.c deleted file mode 100644 index d79cdec..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDeviceDedicate.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Dedicate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceDedicateOutput - -/** - * Image_Device_Dedicate SMAPI interface - */ -int smImage_Device_Dedicate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - char * realDeviceNumber, char readonly, - vmApiImageDeviceDedicateOutput ** outData) { - const char * const functionName = "Image_Device_Dedicate"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(realDeviceNumber) + 1; // For readonly char - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(realDeviceNumber); // Real device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, realDeviceNumber, tempSize); - cursor += tempSize; - - // Readonly byte - *cursor = readonly; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDeviceDedicateDm.c b/zhcp/BUILD/resource_access/src/vmapiImageDeviceDedicateDm.c deleted file mode 100644 index e16b105..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDeviceDedicateDm.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Dedicate_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceDedicateDmOutput - -/** - * Image_Device_Dedicate SMAPI interface - */ -int smImage_Device_Dedicate_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - char * realDeviceNumber, char readonly, - vmApiImageDeviceDedicateDmOutput ** outData) { - const char * const functionName = "Image_Device_Dedicate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(realDeviceNumber) + 1; // For readonly char - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(realDeviceNumber); // Real device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, realDeviceNumber, tempSize); - cursor += tempSize; - - // Readonly byte - *cursor = readonly; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDeviceReset.c b/zhcp/BUILD/resource_access/src/vmapiImageDeviceReset.c deleted file mode 100644 index b23345a..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDeviceReset.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Reset_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceResetOutput - -/** - * Image_Device_Dedicate SMAPI interface - */ -int smImage_Device_Reset(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceResetOutput ** outData) { - const char * const functionName = "Image_Device_Reset"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDeviceUndedicate.c b/zhcp/BUILD/resource_access/src/vmapiImageDeviceUndedicate.c deleted file mode 100644 index acb863a..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDeviceUndedicate.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Undedicate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceUndedicateOutput - -/** - * Image_Device_Dedicate SMAPI interface - */ -int smImage_Device_Undedicate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceUndedicateOutput ** outData) { - const char * const functionName = "Image_Device_Undedicate"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDeviceUndedicateDm.c b/zhcp/BUILD/resource_access/src/vmapiImageDeviceUndedicateDm.c deleted file mode 100644 index 198564d..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDeviceUndedicateDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Undedicate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceUndedicateOutput - -/** - * Image_Device_Undedicate_DM SMAPI interface - */ -int smImage_Device_Undedicate_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceUndedicateDmOutput ** outData) { - const char * const functionName = "Image_Device_Undedicate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskCopy.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskCopy.c deleted file mode 100644 index f3e65bb..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskCopy.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Copy_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskCopyOutput - -/** - * Image_Device_Undedicate_DM SMAPI interface - */ -int smImage_Disk_Copy(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskCopyOutput ** outData) { - const char * const functionName = "Image_Disk_Copy"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskCopyDm.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskCopyDm.c deleted file mode 100644 index 2c2805d..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskCopyDm.c +++ /dev/null @@ -1,144 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Copy_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskCopyDmOutput - -/** - * Image_Disk_Copy_DM - */ -int smImage_Disk_Copy_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * sourceImageName, char * sourceImageDiskNumber, - char * imageDiskAllocationType, char * allocationAreaName, - char * imageDiskMode, char * readPassword, char * writePassword, - char * multiPassword, vmApiImageDiskCopyDmOutput ** outData) { - const char * const functionName = "Image_Disk_Copy_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(sourceImageName) + 4 + strlen( - sourceImageDiskNumber) + 4 + strlen(imageDiskAllocationType) + 4 - + strlen(allocationAreaName) + 4 + strlen(imageDiskMode) + 4 - + strlen(readPassword) + 4 + strlen(writePassword) + 4 + strlen( - multiPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(sourceImageName); // Image name 1..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, sourceImageName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(sourceImageDiskNumber); // Source image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, sourceImageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskAllocationType); // Image allocation type 0..10 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageDiskAllocationType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(allocationAreaName); // Allocation area name 0..10 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, allocationAreaName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(imageDiskMode); // Image disk mode 0..5 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageDiskMode, tempSize); - cursor += tempSize; - } - - tempSize = strlen(readPassword); // Read password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, readPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(writePassword); // Write password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, writePassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(multiPassword); // Multi password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, multiPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskCreate.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskCreate.c deleted file mode 100644 index 8522ff4..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskCreate.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskCreateOutput - -/** - * Image_Disk_Create SMAPI interface - */ -int smImage_Disk_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, char * imageDiskMode, - vmApiImageDiskCreateOutput ** outData) { - const char * const functionName = "Image_Disk_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(imageDiskMode); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskMode); // Image disk mode 0..5 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageDiskMode, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskCreateDm.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskCreateDm.c deleted file mode 100644 index c7ce7a6..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskCreateDm.c +++ /dev/null @@ -1,150 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskCreateDmOutput - -/** - * Image_Disk_Create_DM SMAPI interface - */ -int smImage_Disk_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * imageDiskDeviceType, char * imageDiskAllocationType, - char * allocationAreaNameOrVolser, char allocationUnitSize, - int imageDiskSize, char * imageDiskMode, char imageDiskFormatting, - char * imageDiskLabel, char * readPassword, char * writePassword, - char * multiPassword, vmApiImageDiskCreateDmOutput ** outData) { - const char * const functionName = "Image_Disk_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(imageDiskDeviceType) + 4 + strlen( - imageDiskAllocationType) + 4 + strlen(allocationAreaNameOrVolser) - + 1 + /* allocationUnitSize */4 /* imageDiskSize */+ 4 + strlen( - imageDiskMode) + 1 /* imageDiskFormatting */+ 4 + strlen( - imageDiskLabel) + 4 + strlen(readPassword) + 4 + strlen( - writePassword) + 4 + strlen(multiPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskDeviceType); // Image disk device type 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskDeviceType, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskAllocationType); // Image disk allocation type 1..10 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskAllocationType, tempSize); - cursor += tempSize; - - tempSize = strlen(allocationAreaNameOrVolser); // Allocation area name or volser 0..8, 0..6 or 0..4 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, allocationAreaNameOrVolser, tempSize); - cursor += tempSize; - } - - *cursor = allocationUnitSize; // Allocation Unit size - cursor++; - - PUT_INT(imageDiskSize, cursor); // Image disk size - - tempSize = strlen(imageDiskMode); // Image disk mode 1..5 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskMode, tempSize); - cursor += tempSize; - - *cursor = imageDiskFormatting; // Image disk formatting - cursor++; - - tempSize = strlen(imageDiskLabel); // Image disk label 0..6 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageDiskLabel, tempSize); - cursor += tempSize; - } - - tempSize = strlen(readPassword); // Read password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, readPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(writePassword); // Write password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, writePassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(multiPassword); // Multi password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, multiPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskDelete.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskDelete.c deleted file mode 100644 index 7d2f260..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskDelete.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskDeleteOutput - -/** - * Image_Disk_Delete SMAPI interface - */ -int smImage_Disk_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskDeleteOutput ** outData) { - const char * const functionName = "Image_Disk_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskDeleteDm.c deleted file mode 100644 index f8a4558..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskDeleteDm.c +++ /dev/null @@ -1,86 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskDeleteDmOutput - -/** - * Image_Disk_Delete SMAPI interface - */ -int smImage_Disk_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char dataSecurityErase, vmApiImageDiskDeleteDmOutput ** outData) { - const char * const functionName = "Image_Disk_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 1 /* dataSecurityErase */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - *cursor = dataSecurityErase; // Data security erase byte - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskShare.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskShare.c deleted file mode 100644 index 273ff39..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskShare.c +++ /dev/null @@ -1,111 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Share_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskShareOutput - -/** - * Image_Disk_Share SMAPI interface - */ -int smImage_Disk_Share(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - char * readWriteMode, char * optionalPassword, - vmApiImageDiskShareOutput ** outData) { - const char * const functionName = "Image_Disk_Share"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(targetImageName) + 4 + strlen( - targetImageDiskNumber) + 4 + strlen(readWriteMode) + 4 + strlen( - optionalPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageName); // Target image name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageName, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageDiskNumber); // Target image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(readWriteMode); // Read write mode 0-4 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, readWriteMode, tempSize); - cursor += tempSize; - } - - tempSize = strlen(optionalPassword); // Optional password to share the disk 0-8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, optionalPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskShareDm.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskShareDm.c deleted file mode 100644 index 7fc9fe3..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskShareDm.c +++ /dev/null @@ -1,111 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Share_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskShareDmOutput - -/** - * Image_Disk_Share_DM SMAPI interface - */ -int smImage_Disk_Share_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - char * readWriteMode, char * optionalPassword, - vmApiImageDiskShareDmOutput ** outData) { - const char * const functionName = "Image_Disk_Share_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(targetImageName) + 4 + strlen( - targetImageDiskNumber) + 4 + strlen(readWriteMode) + 4 + strlen( - optionalPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageName); // Target image name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageName, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageDiskNumber); // Target image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(readWriteMode); // Read write mode 0-4 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, readWriteMode, tempSize); - cursor += tempSize; - } - - tempSize = strlen(optionalPassword); // Optional password to share the disk 0-8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, optionalPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskUnshare.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskUnshare.c deleted file mode 100644 index 6fd5b66..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskUnshare.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Unshare_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskUnshareOutput - -/** - * Image_Disk_Unshare SMAPI interface - */ -int smImage_Disk_Unshare(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskUnshareOutput ** outData) { - const char * const functionName = "Image_Disk_Unshare"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageDiskUnshareDm.c b/zhcp/BUILD/resource_access/src/vmapiImageDiskUnshareDm.c deleted file mode 100644 index 01a663a..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageDiskUnshareDm.c +++ /dev/null @@ -1,95 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Unshare_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskUnshareDmOutput - -/** - * Image_Disk_Unshare_DM SMAPI interface - */ -int smImage_Disk_Unshare_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - vmApiImageDiskUnshareDmOutput ** outData) { - const char * const functionName = "Image_Disk_Unshare_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(targetImageName) + 4 + strlen( - targetImageDiskNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageName); // Target image name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageName, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageDiskNumber); // Target image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageDiskNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageIplDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiImageIplDeleteDm.c deleted file mode 100644 index b01b79e..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageIplDeleteDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_IPL_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageIplDeleteDmOutput - -/** - * Image_IPL_Delete_DM SMAPI interface - */ -int smImage_IPL_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageIplDeleteDmOutput ** outData) { - const char * const functionName = "Image_IPL_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageIplDeviceQuery.c b/zhcp/BUILD/resource_access/src/vmapiImageIplDeviceQuery.c deleted file mode 100644 index f9aebb0..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageIplDeviceQuery.c +++ /dev/null @@ -1,62 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_IPL_Device_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageIplDeviceQueryOutput - -/** - * Image_IPL_Device_Query SMAPI interface - */ -int smImage_IPL_Device_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, vmApiImageIplDeviceQueryOutput ** outData) { - const char * const functionName = "Image_IPL_Device_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1 /* Null term */+ strlen( - userid) + 1 /* Null term */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - tempSize = strlen(userid); - strcpy(cursor, userid); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageIplQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiImageIplQueryDm.c deleted file mode 100644 index 94cc311..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageIplQueryDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_IPL_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageIplQueryDmOutput - -/** - * Image_IPL_Query_DM SMAPI interface - */ -int smImage_IPL_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageIplQueryDmOutput ** outData) { - const char * const functionName = "Image_IPL_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageIplSetDm.c b/zhcp/BUILD/resource_access/src/vmapiImageIplSetDm.c deleted file mode 100644 index 1666064..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageIplSetDm.c +++ /dev/null @@ -1,98 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_IPL_Set_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageIplSetDmOutput - -/** - * Image_IPL_Set_DM SMAPI interface - */ -int smImage_IPL_Set_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * savedSystem, char * loadParameter, - char * parameterString, vmApiImageIplSetDmOutput ** outData) { - const char * const functionName = "Image_IPL_Set_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - savedSystem) + 4 + strlen(loadParameter) + 4 + strlen( - parameterString); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(savedSystem); // Saved system 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, savedSystem, tempSize); - cursor += tempSize; - - tempSize = strlen(loadParameter); // Load parameter 0..10 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, loadParameter, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parameterString); // Parameter string 0..64 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parameterString, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageLockDm.c b/zhcp/BUILD/resource_access/src/vmapiImageLockDm.c deleted file mode 100644 index a732419..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageLockDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Lock_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageLockDmOutput - -/** - * Image_Lock_DM SMAPI interface - */ -int smImage_Lock_DM(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * deviceAddress, vmApiImageLockDmOutput ** outData) { - const char * const functionName = "Image_Lock_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - deviceAddress); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(deviceAddress); // Device address 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, deviceAddress, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageNameQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiImageNameQueryDm.c deleted file mode 100644 index 0c2861b..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageNameQueryDm.c +++ /dev/null @@ -1,411 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Name_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageNameQueryDmOutput - -/** - * Image_Name_Query_DM SMAPI interface - */ -int smImage_Name_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageNameQueryDmOutput ** outData) { - const char * const functionName = "Image_Name_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc = 0; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - int i; - int temp; - char *imageName; - vmApiImageName *nameList; - - FILE* cacheFileP = 0; - char resultLine[10]; - int resultLineL = 0; - char cachePath[BUFLEN + 1]; - int cacheFileFD; - struct flock fl; - int recordCount = 0; - char traceLine[LINESIZE + 100]; - int dataReadFromCache = 0; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - // Read from the cache file, if exists. - - memset(cachePath, 0, sizeof(cachePath)); - strcpy(cachePath, "/var/opt/ibm/zvmmap/.vmapi/.cache/"); - strcat(cachePath, "users.list"); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file to look for: <%.*s> \n", LINESIZE, cachePath); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cachePath) { - if (cacheFileValid(vmapiContextP, cachePath)) { - cacheFileP = fopen(cachePath, "r"); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file pointer opened for read: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileP != NULL) { - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while reading, so no one else is writing into it - fl.l_type = F_RDLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - // Try to get the lock, if the file is in use by some other process, fetch the information from directory - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file read lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - *outData = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiImageNameQueryDmOutput)); - nameList = smMemoryGroupAlloc(vmapiContextP, - sizeof(nameList)); - - if (nameList == 0 || *outData == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, traceLine); - return MEMORY_ERROR; - } - - while (fgets(resultLine, sizeof(resultLine), cacheFileP)) { - resultLineL = strlen(resultLine); - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Found the user <%s> in Cache \n", - resultLine); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - recordCount++; - if (resultLineL > 0) { - if (resultLine[resultLineL - 1] == '\n') { - --resultLineL; - resultLine[resultLineL] = 0; - } - } - imageName = smMemoryGroupAlloc(vmapiContextP, - resultLineL); - if (imageName == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, - traceLine); - return MEMORY_ERROR; - } - - strcpy(imageName, resultLine); - dataReadFromCache = 1; - - if (recordCount > 1) { - nameList = smMemoryGroupRealloc(vmapiContextP, - (void *) nameList, recordCount - * sizeof(nameList)); - if (nameList == 0) { - sprintf( - traceLine, - "***Error trying to obtain realloc memory for cache records of size %d.\n", - recordCount * sizeof(nameList)); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), RcRuntime, - RsNoMemory, traceLine); - return MEMORY_ERROR; - } - } - nameList[recordCount - 1].imageName = imageName; - } - - (*outData) -> nameList = nameList; - (*outData) -> nameCount = recordCount; - (*outData) -> common.returnCode - = (*outData) -> common.reasonCode = 0; - - // Unlock the file - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file read lock to be unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - sprintf(traceLine, - "***Error trying to unlock cache file read lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file read lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If cache data used return to caller - if (dataReadFromCache) { - return rc; - } - - } - } - // Cache file is invalid/missing/(out of date) remove it - else { - if (remove(cachePath)) { - // If the error is anything but the file is not found - if (ENOENT != errno) { - sprintf( - traceLine, - "***Error removing out of date cache file <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file not found.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } else { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file erased, too old.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } - } - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - - if (0 == rc) { - if ((0 == (*outData)->common.returnCode) && (0 - == (*outData)->common.reasonCode)) { - // Write the cache file - // Build path to the cache directory - memset(cachePath, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - strcat(cachePath, "users.list"); - - if (cachePath) { - createDirectories(cachePath); - cacheFileP = fopen(cachePath, "w"); - if (NULL == cacheFileP) { - sprintf( - traceLine, - "***Error trying to open cache file for write. errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file pointer opened for WRITE: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileP != NULL) { - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while writing, so no one else is using it - fl.l_type = F_WRLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file WRITE lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - temp = (*outData)->nameCount; - - if (temp > 0) { - for (i = 0; i < temp; i++) { - memset(resultLine, 0, 9); - memcpy( - resultLine, - (*outData)->nameList[i].imageName, - strlen( - (*outData)->nameList[i].imageName) - + 1); - strcat(resultLine, "\n"); - fprintf(cacheFileP, "%s", resultLine); - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf( - traceLine, - "Adding user id <%s> in Cache \n", - resultLine); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - rc = fflush(cacheFileP); - if (EOF == rc) { - // Can't write to file, try to remove file - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - cacheFileP = 0; - if (remove(cachePath)) { - sprintf( - traceLine, - "***Error removing cache file after write error <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - return rc; // Continue processing even if cache file was removed - } - } - } - - // Unlock the file - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock cache file WRITE lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file write lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - } - } - - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImagePasswordSetDm.c b/zhcp/BUILD/resource_access/src/vmapiImagePasswordSetDm.c deleted file mode 100644 index cf5ff58..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImagePasswordSetDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Password_Set_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImagePasswordSetDmOutput - -/** - * Image_Password_Set_DM SMAPI interface - */ -int smImage_Password_Set_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int imagePasswordLength, char * imagePassword, - vmApiImagePasswordSetDmOutput ** outData) { - const char * const functionName = "Image_Password_Set_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + imagePasswordLength; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = imagePasswordLength; // Image password 1..200 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imagePassword, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageQueryActivateTime.c b/zhcp/BUILD/resource_access/src/vmapiImageQueryActivateTime.c deleted file mode 100644 index 39f7be2..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageQueryActivateTime.c +++ /dev/null @@ -1,80 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Query_Activate_Time_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageQueryActivateTimeOutput - -/** - * Image_Query_Activate_Time SMAPI interface - */ -int smImage_Query_Activate_Time(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char dateFormat, - vmApiImageQueryActivateTimeOutput ** outData) { - const char * const functionName = "Image_Query_Activate_Time"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 /* Data format char */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = dateFormat; // Date format character - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiImageQueryDm.c deleted file mode 100644 index 8e38172..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageQueryDm.c +++ /dev/null @@ -1,563 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include "smPublic.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageQueryDmOutput - -extern void vmbkendGetCachePath(struct _VmApiInternalContext* vmapiContextP, - char *pathP); - -void hidePassword(char *directoryRecord); - -/** - * Image_Query_DM SMAPI interface - */ -int smImage_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageQueryDmOutput ** outData, - bool readFromCache) { - - char cachePath[BUFLEN + 1]; - char userID[10]; - FILE* cacheFileP = 0; - char resultLine[256]; - int resultLineL = 0; - const char* cP = 0; - - const char * const functionName = "Image_Query_DM"; - int tempSize; - char * cursor; - int rc = 0; - char traceLine[LINESIZE + 100]; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - int i; - int temp; - - char * tempTargetIdentifier = targetIdentifier; - - vmApiImageRecord *recordList; - char *imageRecord; - int imageRecordLen; - - int recordCount = 0; - int dataReadFromCache = 0; - - int cacheFileFD; - struct flock fl; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - memset(cachePath, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - memset(userID, 0, sizeof(userID)); - - i = 0; - for (; *tempTargetIdentifier != '\0'; tempTargetIdentifier++) { - userID[i++] = tolower(*tempTargetIdentifier); - } - - tempTargetIdentifier = targetIdentifier; - - userID[i--] = '\0'; - strcat(cachePath, userID); - strcat(cachePath, ".direct"); - - if (cachePath && readFromCache) { - - if (cacheFileValid(vmapiContextP, cachePath)) { - cacheFileP = fopen(cachePath, "r"); - if (cacheFileP) { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file pointer opened for read: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while reading, so no one else is writing into it - fl.l_type = F_RDLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - // Try to get the lock, if the file is in use by some other process, fetch the information from directory - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file read lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - recordList = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiImageRecord)); - *outData = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiImageQueryDmOutput)); - if (recordList == 0 || *outData == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, traceLine); - return MEMORY_ERROR; - } - while (fgets(resultLine, sizeof(resultLine), cacheFileP)) { - resultLineL = strlen(resultLine); - recordCount++; - if (resultLineL > 0) { - if (resultLine[resultLineL - 1] == '\n') { - --resultLineL; - resultLine[resultLineL] = 0; - } - } - imageRecordLen = resultLineL; - imageRecord = smMemoryGroupAlloc(vmapiContextP, - imageRecordLen); - if (imageRecord == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, - traceLine); - return MEMORY_ERROR; - } - strcpy(imageRecord, resultLine); - dataReadFromCache = 1; - - if (recordCount > 1) { - recordList = smMemoryGroupRealloc( - vmapiContextP, (void *) recordList, - recordCount * sizeof(vmApiImageRecord)); - if (recordList == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), RcRuntime, - RsNoMemory, traceLine); - return MEMORY_ERROR; - } - } - recordList[recordCount - 1].imageRecord - = imageRecord; - recordList[recordCount - 1].imageRecordLength - = imageRecordLen; - - } - - (*outData) -> imageRecordList = recordList; - (*outData) -> imageRecordCount = recordCount; - (*outData) -> common.returnCode - = (*outData) -> common.reasonCode = 0; - // Unlock the file. - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file read lock to be unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock cache file read lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file read lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - // Else if not able to get lock, continue with call - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If cache data used return to caller - if (dataReadFromCache) { - return rc; - } - } - } - // Cache file is invalid/missing/(out of date) remove it - else { - if (remove(cachePath)) { - // If the error is anything but the file is not found - if (ENOENT != errno) { - sprintf( - traceLine, - "***Error removing out of date cache file <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file not found.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } else { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file erased, too old.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } - } - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - - // Do the caching of the image. - if ((0 == rc) && readFromCache) // Do not store if the call was for getting data with password - { - if ((0 == (*outData)->common.returnCode) && (0 - == (*outData)->common.reasonCode)) { - // Write the cache file - // Build path to the cache directory. - memset(cachePath, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - memset(userID, 0, sizeof(userID)); - - i = 0; - for (; *tempTargetIdentifier != '\0'; tempTargetIdentifier++) { - userID[i++] = tolower(*tempTargetIdentifier); - } - userID[i--] = '\0'; - strcat(cachePath, userID); - strcat(cachePath, ".direct"); - - if (cachePath) { - cacheFileP = 0; - createDirectories(cachePath); - cacheFileP = fopen(cachePath, "w"); - if (NULL == cacheFileP) { - sprintf( - traceLine, - "***Error trying to open cache file for write. errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file pointer opened for WRITE: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If the file opened for write then add cache information - if (cacheFileP != NULL) { - - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while writing, so no one else is using it - fl.l_type = F_WRLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file WRITE lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - temp = (*outData)->imageRecordCount; - - if (temp > 0) { - for (i = 0; i < temp; i++) { - memset(resultLine, 0, sizeof(resultLine)); - memcpy( - resultLine, - (*outData)->imageRecordList[i].imageRecord, - (*outData)->imageRecordList[i].imageRecordLength); - resultLineL = strlen(resultLine); - if (resultLineL > 71) { - resultLine[71] = 0; - resultLineL = 71; - } - strip(resultLine, 'T', ' '); - cP = &resultLine[0]; - while (cP && (*cP == ' ')) - ++cP; - - hidePassword(resultLine); - strcat(resultLine, "\n"); - fprintf(cacheFileP, "%s", resultLine); - rc = fflush(cacheFileP); - if (EOF == rc) { - // Can't write to file, try to remove file - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - cacheFileP = 0; - if (remove(cachePath)) { - sprintf( - traceLine, - "***Error removing cache file after write error <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - return rc; // Continue processing even if cache file was removed - } - } - } - - // Unlock the file - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock cache file WRITE lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file write lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - } - } - - return rc; -} - -/** - * This function removes the password field of USER and MDISK statements. - */ -void hidePassword(char *directoryRecord) { - char tempBuffer[100]; - char * savePtr; - int length = strlen(directoryRecord); - - char replacedString[100]; - char * token; - memcpy(tempBuffer, directoryRecord, length); - tempBuffer[length] = '\0'; - token = strtok_r(tempBuffer, " ", &savePtr); - - if (token != NULL) { - if (0 == strncasecmp(token, "USER", strlen(token))) { - strcpy(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); // This is userID - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, "XXXXX"); // This is password - strcat(replacedString, " "); - - while (token != NULL) { - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - strcat(replacedString, token); // This is userID - strcat(replacedString, " "); - } - } - - strcpy(directoryRecord, replacedString); - } else if (strncasecmp(token, "MDISK", strlen(token)) == 0) { - strcpy(replacedString, token); - strcat(replacedString, " "); - - // MDISK Address(VDEV) Value - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - - // MDISK Dev Type Value - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - // DEVICE Number Value - if (strncasecmp(token, "DEVNO", strlen(token)) == 0) { - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - } - // V_DISK Value in Blocks - else if (strncasecmp(token, "V-DISK", strlen(token)) == 0) { - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - } - // T-DISK Value in Cylinders or Blocks - else if (strncasecmp(token, "T-DISK", strlen(token)) == 0) { - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - } else { - // CYL or BLK Start - strcat(replacedString, token); - strcat(replacedString, " "); - - //CYL or BLK End - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - - // Volume Serial Number - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - } - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - // Access Mode - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - strcat(replacedString, "XXXXX"); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - strcat(replacedString, "XXXXX"); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - strcat(replacedString, "XXXXX"); - strcat(replacedString, " "); - - } - } - } - strcpy(directoryRecord, replacedString); - } - } - } - } -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageRecycle.c b/zhcp/BUILD/resource_access/src/vmapiImageRecycle.c deleted file mode 100644 index 267d31f..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageRecycle.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Recycle_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageRecycleOutput - -/** - * Image_Recycle SMAPI interface - */ -int smImage_Recycle(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageRecycleOutput ** outData) { - const char * const functionName = "Image_Recyle"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageReplaceDm.c b/zhcp/BUILD/resource_access/src/vmapiImageReplaceDm.c deleted file mode 100644 index 9c41772..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageReplaceDm.c +++ /dev/null @@ -1,95 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Replace_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageReplaceDmOutput - -/** - * Image_Replace_DM SMAPI interface - */ -int smImage_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int imageRecordArrayCount, - vmApiImageRecord * imageRecordList, - vmApiImageReplaceDmOutput ** outData) { - const char * const functionName = "Image_Replace_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* imageRecordArrayLength */; /* Need to add in actual array data size */ - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i, totalArraySize; - - totalArraySize = 0; - for (i = 0; i < imageRecordArrayCount; i++) { - totalArraySize += imageRecordList[i].imageRecordLength + 4; - inputSize += imageRecordList[i].imageRecordLength + 4; - } - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of image record array then the data if available - PUT_INT(totalArraySize, cursor); - - if (totalArraySize > 0) { - for (i = 0; i < imageRecordArrayCount; i++) { - tempSize = imageRecordList[i].imageRecordLength; - PUT_INT(tempSize, cursor); - memcpy(cursor, imageRecordList[i].imageRecord, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageScsiCharacteristicsDefineDm.c b/zhcp/BUILD/resource_access/src/vmapiImageScsiCharacteristicsDefineDm.c deleted file mode 100644 index 467ea00..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageScsiCharacteristicsDefineDm.c +++ /dev/null @@ -1,118 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_SCSI_Characteristics_Define_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageScsiCharacteristicsDefineDmOutput - -/** - * Image_SCSI_Characteristics_Define_DM SMAPI interface - */ -int smImage_SCSI_Characteristics_Define_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * bootProgram, char * brLba, char * lun, char * portName, - char scpDatatype, int scpDataLength, char * scpData, - vmApiImageScsiCharacteristicsDefineDmOutput ** outData) { - const char * const functionName = "Image_SCSI_Characteristics_Define_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - bootProgram) + 4 + strlen(brLba) + 4 + strlen(lun) + 4 + strlen( - portName) + 1 /* SCP data type*/+ 4 + scpDataLength; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(bootProgram); // Boot program 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, bootProgram, tempSize); - cursor += tempSize; - } - - tempSize = strlen(brLba); // BR LBA 0..16 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, brLba, tempSize); - cursor += tempSize; - } - - tempSize = strlen(lun); // LUN 0..16 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, lun, tempSize); - cursor += tempSize; - } - - tempSize = strlen(portName); // Port name 0..16 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, portName, tempSize); - cursor += tempSize; - } - - *cursor = scpDatatype; // Char 1 - - tempSize = scpDataLength; // SCP data 0..4096 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, scpData, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageScsiCharacteristicsQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiImageScsiCharacteristicsQueryDm.c deleted file mode 100644 index a8c7d68..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageScsiCharacteristicsQueryDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_SCSI_Characteristics_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageScsiCharacteristicsQueryDmOutput - -/** - * Image_SCSI_Characteristics_Query_DM SMAPI interface - */ -int smImage_SCSI_Characteristics_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageScsiCharacteristicsQueryDmOutput ** outData) { - const char * const functionName = "Image_SCSI_Characteristics_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageStatusQuery.c b/zhcp/BUILD/resource_access/src/vmapiImageStatusQuery.c deleted file mode 100644 index 79ae875..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageStatusQuery.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Status_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageStatusQueryOutput - -/** - * Image_Status_Query SMAPI interface - */ -int smImage_Status_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageStatusQueryOutput ** outData) { - const char * const functionName = "Image_Status_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageUnlockDm.c b/zhcp/BUILD/resource_access/src/vmapiImageUnlockDm.c deleted file mode 100644 index 63fa36f..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageUnlockDm.c +++ /dev/null @@ -1,85 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Unlock_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageUnlockDmOutput - -/** - * Image_Unlock_DM SMAPI interface - */ -int smImage_Unlock_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * deviceAddress, - vmApiImageUnlockDmOutput ** outData) { - const char * const functionName = "Image_Unlock_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - deviceAddress); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(deviceAddress); // Device address 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, deviceAddress, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageVolumeAdd.c b/zhcp/BUILD/resource_access/src/vmapiImageVolumeAdd.c deleted file mode 100644 index 64687f1..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageVolumeAdd.c +++ /dev/null @@ -1,150 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Add_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeAddOutput - -/** - * Image_Volume_Add SMAPI interface - */ -int smImage_Volume_Add(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumer, - char * imageVolumeLabel, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, - vmApiImageVolumeAddOutput ** outData) { - const char * const functionName = "Image_Volume_Add"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumer) + 4 + strlen(imageVolumeLabel) + 4 + strlen( - systemConfigName) + 4 + strlen(systemConfigType) + 4 + strlen( - parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumer); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumer, tempSize); - cursor += tempSize; - - tempSize = strlen(imageVolumeLabel); // Image volume label 1..6 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageVolumeLabel, tempSize); - cursor += tempSize; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageVolumeDelete.c b/zhcp/BUILD/resource_access/src/vmapiImageVolumeDelete.c deleted file mode 100644 index c69c70a..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageVolumeDelete.c +++ /dev/null @@ -1,150 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeDeleteOutput - -/** - * Image_Volume_Delete SMAPI interface - */ -int smImage_Volume_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumer, - char * imageVolumeLabel, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, - vmApiImageVolumeAddOutput ** outData) { - const char * const functionName = "Image_Volume_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + strlen(password) + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumer) + 4 + strlen(imageVolumeLabel) + 4 + strlen( - systemConfigName) + 4 + strlen(systemConfigType) + 4 + strlen( - parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = strlen(password); // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumer); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumer, tempSize); - cursor += tempSize; - - tempSize = strlen(imageVolumeLabel); // Image volume label 1..6 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageVolumeLabel, tempSize); - cursor += tempSize; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceDefineDm.c b/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceDefineDm.c deleted file mode 100644 index 369558c..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceDefineDm.c +++ /dev/null @@ -1,112 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Space_Define_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeSpaceDefineDmOutput - -/** - * Image_Volume_Space_Define_DM SMAPI interface - */ -int smImage_Volume_Space_Define_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char functionType, char * regionName, - char * imageVolumeId, int startCyl, int regionSize, char * groupName, - char deviceType, vmApiImageVolumeSpaceDefineDmOutput ** outData) { - const char * const functionName = "Image_Volume_Space_Define_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 - /* Function type */ + 4 + strlen(regionName) + 4 + strlen( - imageVolumeId) + 4 /* Start cyl */+ 4 /* Region size */+ 4 + strlen( - groupName) + 1 /* DeviceType */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = functionType; // Function type - cursor++; - - tempSize = strlen(regionName); // Region name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, regionName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(imageVolumeId); // Image volume id 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageVolumeId, tempSize); - cursor += tempSize; - } - - PUT_INT(startCyl, cursor); // Start cylinder - - PUT_INT(regionSize, cursor); // Region size - - tempSize = strlen(groupName); // Group name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, groupName, tempSize); - cursor += tempSize; - } - - *cursor = deviceType; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceQueryDm.c deleted file mode 100644 index 44fcb3e..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceQueryDm.c +++ /dev/null @@ -1,91 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Space_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeSpaceQueryDmOutput - -/** - * Image_Volume_Space_Query_DM SMAPI interface - */ -int smImage_Volume_Space_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char queryType, char entryType, - char * entryNames, vmApiImageVolumeSpaceQueryDmOutput ** outData) { - const char * const functionName = "Image_Volume_Space_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 - /* Query type */+ 1 /* Entry type */+ 4 + strlen(entryNames); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = queryType; // Query type - cursor++; - - *cursor = entryType; // Entry type - cursor++; - - tempSize = strlen(entryNames); // Entry names 0..255 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, entryNames, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceRemoveDm.c b/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceRemoveDm.c deleted file mode 100644 index 5375442..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiImageVolumeSpaceRemoveDm.c +++ /dev/null @@ -1,104 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Space_Remove_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeSpaceRemoveDmOutput - -/** - * Image_Volume_Space_Remove_DM SMAPI interface - */ -int smImage_Volume_Space_Remove_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char functionType, char * regionName, - char * imageVolumeId, char * groupName, - vmApiImageVolumeSpaceRemoveDmOutput ** outData) { - const char * const functionName = "Image_Volume_Space_Remove_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 - /* Function type */+ 4 + strlen(regionName) + 4 + strlen(imageVolumeId) + 4 - + strlen(groupName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = functionType; // Function type - cursor++; - - tempSize = strlen(regionName); // Region name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, regionName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(imageVolumeId); // Image volume id 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageVolumeId, tempSize); - cursor += tempSize; - } - - tempSize = strlen(groupName); // Group name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, groupName, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiNameListAdd.c b/zhcp/BUILD/resource_access/src/vmapiNameListAdd.c deleted file mode 100644 index f5bdce2..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiNameListAdd.c +++ /dev/null @@ -1,81 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiName.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Name_List_Add_Layout -#define OUTPUT_STRUCTURE_NAME vmApiNameListAddOutput - -/** - * Name_List_Add SMAPI interface - */ -int smName_List_Add(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * name, vmApiNameListAddOutput ** outData) { - const char * const functionName = "Name_List_Add"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen(name); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(name); // Name 1..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, name, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiNameListDestroy.c b/zhcp/BUILD/resource_access/src/vmapiNameListDestroy.c deleted file mode 100644 index 20861ef..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiNameListDestroy.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiName.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Name_List_Destroy_Layout -#define OUTPUT_STRUCTURE_NAME vmApiNameListDestroyOutput - -/** - * Name_List_Destroy SMAPI interface - */ -int smName_List_Destroy(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiNameListDestroyOutput ** outData) { - const char * const functionName = "Name_List_Destroy"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiNameListQuery.c b/zhcp/BUILD/resource_access/src/vmapiNameListQuery.c deleted file mode 100644 index b678023..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiNameListQuery.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiName.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Name_List_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiNameListQueryOutput - -/** - * Name_List_Query SMAPI interface - */ -int smName_List_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiNameListQueryOutput ** outData) { - const char * const functionName = "Name_List_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiNameListRemove.c b/zhcp/BUILD/resource_access/src/vmapiNameListRemove.c deleted file mode 100644 index 3384d96..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiNameListRemove.c +++ /dev/null @@ -1,82 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiName.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Name_List_Remove_Layout -#define OUTPUT_STRUCTURE_NAME vmApiNameListRemoveOutput - -/** - * Name_List_Remove SMAPI interface - */ -int smName_List_Remove(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * name, - vmApiNameListRemoveOutput ** outData) { - const char * const functionName = "Name_List_Remove"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen(name); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(name); // Name 1..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, name, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiProfileCreateDm.c b/zhcp/BUILD/resource_access/src/vmapiProfileCreateDm.c deleted file mode 100644 index ed0c639..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiProfileCreateDm.c +++ /dev/null @@ -1,98 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiProfile.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Profile_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiProfileCreateDmOutput - -/** - * Profile_Create_DM SMAPI interface - */ -int smProfile_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int profileRecordCount, - vmApiProfileRecord * profileRecordList, - vmApiProfileCreateDmOutput ** outData) { - const char * const functionName = "Profile_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* For profile record array length */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int profileRecordTotal = 0; - for (i = 0; i < profileRecordCount; i++) { - inputSize += 4; // Record length integer - inputSize += profileRecordList[i].profileRecordLength; // Data length - - profileRecordTotal += 4; - profileRecordTotal += profileRecordList[i].profileRecordLength; - } - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize + 4))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (image name) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of profile record array then the data if available - PUT_INT(profileRecordTotal, cursor); - if (profileRecordTotal > 0) { - for (i = 0; i < profileRecordCount; i++) { - tempSize = profileRecordList[i].profileRecordLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, profileRecordList[i].recordData, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiProfileDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiProfileDeleteDm.c deleted file mode 100644 index 44d9e96..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiProfileDeleteDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiProfile.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Profile_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiProfileDeleteDmOutput - -/** - * Profile_Delete_DM SMAPI interface - */ -int smProfile_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiProfileDeleteDmOutput ** outData) { - const char * const functionName = "Profile_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiProfileQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiProfileQueryDm.c deleted file mode 100644 index 62d14d0..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiProfileQueryDm.c +++ /dev/null @@ -1,427 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiProfile.h" -#include "smapiTableParser.h" -#include "smPublic.h" -#include -#include -#include -#include -#include -#include - -#define PARSER_TABLE_NAME Profile_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiProfileQueryDmOutput - -/** - * Profile_Query_DM SMAPI interface - */ -int smProfile_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiProfileQueryDmOutput ** outData) { - const char * const functionName = "Profile_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - // Cache variables - char path[BUFLEN + 1]; - char cachePath[BUFLEN + 1]; - char profileID[10]; - FILE* cacheFileP = 0; - char resultLine[256]; - int resultLineL = 0; - const char* cP = 0; - char * tempTargetIdentifier; - char traceLine[LINESIZE + 100]; - vmApiProfileRecord *recordList; - char *profileRecord; - int profileRecordLen; - int recordCount = 0; - int dataReadFromCache = 0; - int cacheFileFD; - struct flock fl; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - int i; - rc = 0; - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Check if any cache data for this profile - memset(cachePath, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - memset(profileID, 0, sizeof(profileID)); - - // Force profile id name to lowercase and save it in profileID - tempTargetIdentifier = targetIdentifier; - i = 0; - for (; *tempTargetIdentifier != '\0'; tempTargetIdentifier++) { - profileID[i++] = tolower(*tempTargetIdentifier); - } - profileID[i--] = '\0'; - strcat(cachePath, profileID); - strcat(cachePath, ".direct"); - - if (cacheFileValid(vmapiContextP, cachePath)) { - cacheFileP = fopen(cachePath, "r"); - if (cacheFileP) { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file(%s) pointer opened for read: %p \n", - profileID, cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while reading, so no one else is writing into it - fl.l_type = F_RDLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - // Try to get the lock, if the file is in use by some other process, fetch the information from directory - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file read lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - recordList = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiProfileRecord)); - *outData = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiProfileQueryDmOutput)); - if (recordList == 0 || *outData == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return MEMORY_ERROR; - } - while (fgets(resultLine, sizeof(resultLine), cacheFileP)) { - resultLineL = strlen(resultLine); - recordCount++; - if (resultLineL > 0) { - if (resultLine[resultLineL - 1] == '\n') { - --resultLineL; - resultLine[resultLineL] = 0; - } - } - profileRecordLen = resultLineL; - profileRecord = smMemoryGroupAlloc(vmapiContextP, - profileRecordLen); - if (profileRecord == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return MEMORY_ERROR; - } - strcpy(profileRecord, resultLine); - dataReadFromCache = 1; - - if (recordCount > 1) { - recordList = smMemoryGroupRealloc(vmapiContextP, - (void *) recordList, recordCount - * sizeof(vmApiProfileRecord)); - if (recordList == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, - traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return MEMORY_ERROR; - } - } - recordList[recordCount - 1].recordData = profileRecord; - recordList[recordCount - 1].profileRecordLength - = profileRecordLen; - - } - - (*outData) -> profileRecordList = recordList; - (*outData) -> profileRecordCount = recordCount; - (*outData) -> common.returnCode - = (*outData) -> common.reasonCode = 0; - - // Unlock the file. - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file read lock to be unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock cache file read lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file read lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - // Else if not able to get lock, continue with call - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close profile cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Profile cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If cache data used return to caller - if (dataReadFromCache) { - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return rc; - } - } - } - // Cache file is invalid/missing/(out of date) remove it - else { - if (remove(cachePath)) { - if (ENOENT != errno) // If the error is anything but the file is not found - { - sprintf( - traceLine, - "***Error removing out of date profile cache file <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Profile cache file not found.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } else { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Profile cache file erased, too old.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - - // Do the caching of the image. - if (0 == rc) { - if ((0 == (*outData)->common.returnCode) && (0 - == (*outData)->common.reasonCode)) { - // Write the cache file - { - cacheFileP = 0; - createDirectories(cachePath); - cacheFileP = fopen(cachePath, "w"); - if (NULL == cacheFileP) { - sprintf( - traceLine, - "***Error trying to open profile cache file (%s) for write. errno %d\n", - profileID, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file pointer opened for WRITE: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If the file opened for write then add cache information - if (cacheFileP != NULL) { - - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf( - traceLine, - "Profile cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while writing, so no one else is using it - fl.l_type = F_WRLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file WRITE lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - tempSize = (*outData)->profileRecordCount; - - if (tempSize > 0) { - for (i = 0; i < tempSize; i++) { - memset(resultLine, 0, sizeof(resultLine)); - memcpy( - resultLine, - (*outData)->profileRecordList[i].recordData, - (*outData)->profileRecordList[i].profileRecordLength); - resultLineL = strlen(resultLine); - if (resultLineL > 71) { - resultLine[71] = 0; - resultLineL = 71; - } - strip(resultLine, 'T', ' '); - cP = &resultLine[0]; - while (cP && (*cP == ' ')) - ++cP; - - // Ignore DIRMAINT control lines - strcat(resultLine, "\n"); - fprintf(cacheFileP, "%s", resultLine); - rc = fflush(cacheFileP); - if (EOF == rc) { - - // Can't write to file, try to remove file - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close profile cache file.\n"); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - cacheFileP = 0; - if (remove(cachePath)) { - sprintf( - traceLine, - "***Error removing profil cache file after write error <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - return rc; // Continue processing even if cache file was removed - } - } - } - - // Unlock the file. - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock profile cache file WRITE lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file write lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close profile cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Profile cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - } - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiProfileReplaceDm.c b/zhcp/BUILD/resource_access/src/vmapiProfileReplaceDm.c deleted file mode 100644 index cc49777..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiProfileReplaceDm.c +++ /dev/null @@ -1,99 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiProfile.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Profile_Replace_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiProfileReplaceDmOutput - -/** - * Profile_Replace_DM SMAPI interface - */ -int smProfile_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int profileRecordCount, - vmApiProfileRecord * profileRecordList, - vmApiProfileReplaceDmOutput ** outData) { - const char * const functionName = "Profile_Replace_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* For profile record array length */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int profileRecordTotal = 0; - - for (i = 0; i < profileRecordCount; i++) { - inputSize += 4; // Record length integer - inputSize += profileRecordList[i].profileRecordLength; // Data length - - profileRecordTotal += 4; - profileRecordTotal += profileRecordList[i].profileRecordLength; - } - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of profile record array then the data if available - PUT_INT(profileRecordTotal, cursor); - if (profileRecordTotal > 0) { - for (i = 0; i < profileRecordCount; i++) { - tempSize = profileRecordList[i].profileRecordLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, profileRecordList[i].recordData, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiPrototypeCreateDm.c b/zhcp/BUILD/resource_access/src/vmapiPrototypeCreateDm.c deleted file mode 100644 index 535efea..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiPrototypeCreateDm.c +++ /dev/null @@ -1,99 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeCreateDmOutput - -/** - * Prototype_Create_DM SMAPI interface - */ -int smPrototype_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int recordArrayCount, - vmApiPrototypeRecordList * recordArrayData, - vmApiPrototypeCreateDmOutput ** outData) { - const char * const functionName = "Prototype_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* recordArraySize */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int recordTotal = 0; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - for (i = 0; i < recordArrayCount; i++) { - inputSize += 4; // Record length integer - inputSize += recordArrayData[i].recordNameLength; // Data length - - recordTotal += 4; - recordTotal += recordArrayData[i].recordNameLength; - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize + 4))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (image name) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of record array then the data if available - PUT_INT(recordTotal, cursor); - if (recordTotal > 0) { - for (i = 0; i < recordArrayCount; i++) { - tempSize = recordArrayData[i].recordNameLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, recordArrayData[i].recordName, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiPrototypeDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiPrototypeDeleteDm.c deleted file mode 100644 index 68c75dc..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiPrototypeDeleteDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeDeleteDmOutput - -/** - * Prototype_Delete_DM SMAPI interface - */ -int smPrototype_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeDeleteDmOutput ** outData) { - const char * const functionName = "Prototype_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiPrototypeNameQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiPrototypeNameQueryDm.c deleted file mode 100644 index f9959ea..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiPrototypeNameQueryDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Name_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeNameQueryDmOutput - -/** - * Prototype_Name_Query_DM SMAPI interface - */ -int smPrototype_Name_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeNameQueryDmOutput ** outData) { - const char * const functionName = "Prototype_Name_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiPrototypeQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiPrototypeQueryDm.c deleted file mode 100644 index 93f3b2b..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiPrototypeQueryDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeQueryDmOutput - -/** - * Prototype_Query_DM SMAPI interface - */ -int smPrototype_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeQueryDmOutput ** outData) { - const char * const functionName = "Prototype_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiPrototypeReplaceDm.c b/zhcp/BUILD/resource_access/src/vmapiPrototypeReplaceDm.c deleted file mode 100644 index 046e345..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiPrototypeReplaceDm.c +++ /dev/null @@ -1,99 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Replace_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeReplaceDmOutput - -/** - * Prototype_Replace_DM SMAPI interface - */ -int smPrototype_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int recordArrayCount, - vmApiPrototypeRecordList * recordArrayData, - vmApiPrototypeReplaceDmOutput ** outData) { - const char * const functionName = "Prototype_Replace_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /*record array length */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int recordTotal = 0; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - for (i = 0; i < recordArrayCount; i++) { - inputSize += 4; // Record length integer - inputSize += recordArrayData[i].recordNameLength; // Data length - - recordTotal += 4; - recordTotal += recordArrayData[i].recordNameLength; - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize + 4))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (image name) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of record array then the data if available - PUT_INT(recordTotal, cursor); - if (recordTotal > 0) { - for (i = 0; i < recordArrayCount; i++) { - tempSize = recordArrayData[i].recordNameLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, recordArrayData[i].recordName, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiQueryApiFunctionalLevel.c b/zhcp/BUILD/resource_access/src/vmapiQueryApiFunctionalLevel.c deleted file mode 100644 index d10b031..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiQueryApiFunctionalLevel.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiQuery.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Query_API_Functional_Level_Layout -#define OUTPUT_STRUCTURE_NAME vmApiQueryApiFunctionalLevelOutput - -/** - * Query_API_Functional_Level SMAPI interface - */ -int smQuery_API_Functional_Level(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiQueryApiFunctionalLevelOutput ** outData) { - const char * const functionName = "Query_API_Functional_Level"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiQueryAsynchronousOperationDm.c b/zhcp/BUILD/resource_access/src/vmapiQueryAsynchronousOperationDm.c deleted file mode 100644 index e97546e..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiQueryAsynchronousOperationDm.c +++ /dev/null @@ -1,79 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiQuery.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Query_Asynchronous_Operation_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiQueryAsynchronousOperationDmOutput - -/** - * Query_Asynchronous_Operation_DM SMAPI interface - */ -int smQuery_Asychronous_Operation_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - int operationId, vmApiQueryAsynchronousOperationDmOutput ** outData) { - const char * const functionName = "Query_Asynchronous_Operation_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /*operationId*/; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - PUT_INT(operationId, cursor); // Operation ID - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiQueryDirectoryManagerLevelDm.c b/zhcp/BUILD/resource_access/src/vmapiQueryDirectoryManagerLevelDm.c deleted file mode 100644 index c956ed0..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiQueryDirectoryManagerLevelDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiQuery.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Query_Directory_Manager_Level_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiQueryDirectoryManagerLevelDmOutput - -/** - * Query_Directory_Manager_Level_DM SMAPI interface - */ -int smQuery_Directory_Manager_Level_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiQueryDirectoryManagerLevelDmOutput ** outData) { - const char * const functionName = "Query_Directory_Manager_Level_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessAddDm.c b/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessAddDm.c deleted file mode 100644 index 675ea2f..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessAddDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Access_Add_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryAccessAddDmOutput - -/** - * Shared_Memory_Access_Add_DM SMAPI interface - */ -int smShared_Memory_Access_Add_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryAccessAddDmOutput ** outData) { - const char * const functionName = "Shared_Memory_Access_Add_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessQueryDm.c b/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessQueryDm.c deleted file mode 100644 index 8136016..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessQueryDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Access_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryAccessQueryDmOutput - -/** - * Shared_Memory_Access_Query_DM SMAPI interface - */ -int smShared_Memory_Access_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * memorySegmentName, - vmApiSharedMemoryAccessQueryDmOutput ** outData) { - const char * const functionName = "Shared_Memory_Access_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessRemoveDm.c b/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessRemoveDm.c deleted file mode 100644 index e7ff5f9..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryAccessRemoveDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Access_Remove_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryAccessRemoveDmOutput - -/** - * Shared_Memory_Access_Remove_DM SMAPI interface - */ -int smShared_Memory_Access_Remove_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * memorySegmentName, - vmApiSharedMemoryAccessRemoveDmOutput ** outData) { - const char * const functionName = "Shared_Memory_Access_Remove_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryCreate.c b/zhcp/BUILD/resource_access/src/vmapiSharedMemoryCreate.c deleted file mode 100644 index fd92348..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryCreate.c +++ /dev/null @@ -1,104 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryCreateOutput - -/** - * Shared_Memory_Create SMAPI interface - */ -int smShared_Memory_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - unsigned long long beginPage, unsigned long long endPage, - char pageAccessDescriptor, char memoryAttributes, - char * memoryAccessIdentifier, vmApiSharedMemoryCreateOutput ** outData) { - const char * const functionName = "Shared_Memory_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName) + 8 + 8 /* begin page, end page */+ 1 - /* page access descriptor */+ 1/* memory attribute */+ 4 + strlen( - memoryAccessIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - PUT_64INT(beginPage, cursor); // Begin page - - PUT_64INT(endPage, cursor); // End page - - *cursor = pageAccessDescriptor; // Page access descriptor - cursor++; - - *cursor = memoryAttributes; // Memory attributes - cursor++; - - tempSize = strlen(memoryAccessIdentifier); // Memory access identifier 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, memoryAccessIdentifier, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryDelete.c b/zhcp/BUILD/resource_access/src/vmapiSharedMemoryDelete.c deleted file mode 100644 index fd9d462..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryDelete.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryDeleteOutput - -/** - * Shared_Memory_Delete SMAPI interface - */ -int smShared_Memory_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryDeleteOutput ** outData) { - const char * const functionName = "Shared_Memory_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryQuery.c b/zhcp/BUILD/resource_access/src/vmapiSharedMemoryQuery.c deleted file mode 100644 index 77e6a0a..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryQuery.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryQueryOutput - -/** - * Shared_Memory_Query SMAPI interface - */ -int smShared_Memory_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryQueryOutput ** outData) { - const char * const functionName = "Shared_Memory_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryReplace.c b/zhcp/BUILD/resource_access/src/vmapiSharedMemoryReplace.c deleted file mode 100644 index 22aa527..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSharedMemoryReplace.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Replace_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryReplaceOutput - -/** - * Shared_Memory_Replace SMAPI interface - */ -int smShared_Memory_Replace(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - char * memoryAccessIdentifier, - vmApiSharedMemoryReplaceOutput ** outData) { - const char * const functionName = "Shared_Memory_Replace"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName) + 4 + strlen(memoryAccessIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - tempSize = strlen(memoryAccessIdentifier); // MemoryAccessIdentifier 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, memoryAccessIdentifier, tempSize); - cursor += tempSize; - } - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesActivateDm.c b/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesActivateDm.c deleted file mode 100644 index 2b70a93..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesActivateDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiStatic.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Static_Image_Changes_Activate_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiStaticImageChangesActivateDmOutput - -/** - * Static_Image_Changes_Activate_DM SMAPI interface - */ -int smStatic_Image_Changes_Activate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesActivateDmOutput ** outData) { - const char * const functionName = "Static_Image_Changes_Activate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesDeactivateDm.c b/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesDeactivateDm.c deleted file mode 100644 index 8d0a663..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesDeactivateDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiStatic.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Static_Image_Changes_Deactivate_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiStaticImageChangesDeactivateDmOutput - -/** - * Static_Image_Changes_Deactivate_DM SMAPI interface - */ -int smStatic_Image_Changes_Deactivate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesDeactivateDmOutput ** outData) { - const char * const functionName = "Static_Image_Changes_Deactivate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesImmediateDm.c b/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesImmediateDm.c deleted file mode 100644 index 8b4b39f..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiStaticImageChangesImmediateDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiStatic.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Static_Image_Changes_Immediate_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiStaticImageChangesImmediateDmOutput - -/** - * Static_Image_Changes_Immediate_DM SMAPI interface - */ -int smStatic_Image_Changes_Immediate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesImmediateDmOutput ** outData) { - const char * const functionName = "Static_Image_Changes_Immediate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSystemInfoQuery.c b/zhcp/BUILD/resource_access/src/vmapiSystemInfoQuery.c deleted file mode 100644 index 500a549..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSystemInfoQuery.c +++ /dev/null @@ -1,57 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiSystem.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME System_Info_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSystemInfoQueryOutput - -/** - * System_Info_Query SMAPI interface - */ -int smSystem_Info_Query(struct _VmApiInternalContext* vmapiContextP, - vmApiSystemInfoQueryOutput ** outData) { - const char * const functionName = "System_Info_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1 /* null term */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiSystemIoQuery.c b/zhcp/BUILD/resource_access/src/vmapiSystemIoQuery.c deleted file mode 100644 index e69a12f..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiSystemIoQuery.c +++ /dev/null @@ -1,62 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiSystem.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME System_IO_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSystemIoQueryOutput - -/** - * System_IO_Query SMAPI interface - */ -int smSystem_IO_Query(struct _VmApiInternalContext* vmapiContextP, - char * realDeviceAddress, vmApiSystemIoQueryOutput ** outData) { - const char * const functionName = "System_IO_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1 /* null term */+ strlen( - realDeviceAddress) + 1 /* null term */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - tempSize = strlen(realDeviceAddress); - strcpy(cursor, realDeviceAddress); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionCreate.c b/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionCreate.c deleted file mode 100644 index 8d13733..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionCreate.c +++ /dev/null @@ -1,96 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Channel_Connection_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualChannelConnectionCreateOutput - -/** - * Virtual_Channel_Connection_Create SMAPI interface - */ -int smVirtual_Channel_Connection_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * coupledImageName, - char * coupledImageDeviceNumber, - vmApiVirtualChannelConnectionCreateOutput ** outData) { - const char * const functionName = "Virtual_Channel_Connection_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(coupledImageName) + 4 + strlen( - coupledImageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(coupledImageName); // Coupled image name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, coupledImageName, tempSize); - cursor += tempSize; - - tempSize = strlen(coupledImageDeviceNumber); // Coupled image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, coupledImageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionCreateDm.c b/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionCreateDm.c deleted file mode 100644 index a9689e0..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionCreateDm.c +++ /dev/null @@ -1,91 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Channel_Connection_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualChannelConnectionCreateDmOutput - -/** - * Virtual_Channel_Connection_Create_DM SMAPI interface - */ -int smVirtual_Channel_Connection_Create_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * coupledImageName, - vmApiVirtualChannelConnectionCreateDmOutput ** outData) { - const char * const functionName = "Virtual_Channel_Connection_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(coupledImageName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(coupledImageName); // Coupled image name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, coupledImageName, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionDelete.c b/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionDelete.c deleted file mode 100644 index 4567541..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionDelete.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Channel_Connection_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualChannelConnectionDeleteOutput - -/** - * Virtual_Channel_Connection_Delete SMAPI interface - */ -int smVirtual_Channel_Connection_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualChannelConnectionDeleteOutput ** outData) { - const char * const functionName = "Virtual_Channel_Connection_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionDeleteDm.c deleted file mode 100644 index dbf7887..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualChannelConnectionDeleteDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Channel_Connection_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualChannelConnectionDeleteDmOutput - -/** - * Virtual_Channel_Connection_Delete_DM SMAPI interface - */ -int smVirtual_Channel_Connection_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualChannelConnectionDeleteDmOutput ** outData) { - const char * const functionName = "Virtual_Channel_Connection_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectLan.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectLan.c deleted file mode 100644 index a3e725d..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectLan.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Connect_LAN_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterConnectLanOutput - -/** - * Virtual_Network_Adapter_Connect_Lan SMAPI interface - */ -int smVirtual_Network_Adapter_Connect_LAN( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * lanName, char * lanOwner, - vmApiVirtualNetworkAdapterConnectLanOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Connect_LAN"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(lanName) + 4 + strlen(lanOwner); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Iinteger table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectLanDm.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectLanDm.c deleted file mode 100644 index 1ff996d..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectLanDm.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Connect_LAN_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterConnectLanDmOutput - -/** - * Virtual_Network_Adapter_Connect_Lan_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Connect_LAN_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * lanName, char * lanOwner, - vmApiVirtualNetworkAdapterConnectLanDmOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Connect_LAN_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(lanName) + 4 + strlen(lanOwner); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitch.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitch.c deleted file mode 100644 index b79a8c7..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitch.c +++ /dev/null @@ -1,89 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Connect_Vswitch_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterConnectVswitchOutput - -/** - * Virtual_Network_Adapter_Connect_Vswitch SMAPI interface - */ -int smVirtual_Network_Adapter_Connect_Vswitch( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * switchName, - vmApiVirtualNetworkAdapterConnectVswitchOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Connect_Vswitch"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(switchName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitchDm.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitchDm.c deleted file mode 100644 index be3adc6..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitchDm.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Connect_Vswitch_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterConnectVswitchDmOutput - -/** - * Virtual_Network_Adapter_Connect_Vswitch_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Connect_Vswitch_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * switchName, - vmApiVirtualNetworkAdapterConnectVswitchDmOutput ** outData) { - const char * const functionName = - "Virtual_Network_Adapter_Connect_Vswitch_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(switchName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterCreate.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterCreate.c deleted file mode 100644 index f10ff78..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterCreate.c +++ /dev/null @@ -1,97 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterCreateOutput - -/** - * Virtual_Network_Adapter_Create SMAPI interface - */ -int smVirtual_Network_Adapter_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char adapterType, int networkAdapterDevices, - char * channelPathId, vmApiVirtualNetworkAdapterCreateOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 1 /* adapterType */+ 4 - /* networking adapter devices */+ 4 + strlen(channelPathId); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - *cursor = adapterType; // Adapter type byte - cursor++; - - PUT_INT(networkAdapterDevices, cursor); // Network adapter devices - - tempSize = strlen(channelPathId); // Channel path id 0..2 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, channelPathId, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterCreateDm.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterCreateDm.c deleted file mode 100644 index 6bf68e5..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterCreateDm.c +++ /dev/null @@ -1,106 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterCreateDmOutput - -/** - * Virtual_Network_Adapter_Create_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Create_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char adapterType, int networkAdapterDevices, - char * channelPathId, char * macId, - vmApiVirtualNetworkAdapterCreateDmOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 1 /* adapterType */ + 4 - /* networking adapter devices */ + 4 + strlen(channelPathId) + 4 - + strlen(macId); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - *cursor = adapterType; // Adapter type byte - cursor++; - - PUT_INT(networkAdapterDevices, cursor); // Network adapter devices - - tempSize = strlen(channelPathId); // Channel path ID 0..2 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, channelPathId, tempSize); - cursor += tempSize; - } - - tempSize = strlen(macId); // Mac ID 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, macId, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDelete.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDelete.c deleted file mode 100644 index 03bdf94..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDelete.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterDeleteOutput - -/** - * Virtual_Network_Adapter_Delete_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDeleteOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDeleteDm.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDeleteDm.c deleted file mode 100644 index fb8730a..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDeleteDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterDeleteDmOutput - -/** - * Virtual_Network_Adapter_Delete_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDeleteDmOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDisconnect.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDisconnect.c deleted file mode 100644 index f20b1b4..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDisconnect.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Disconnect_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterDisconnectOutput - -/** - * Virtual_Network_Adapter_Disconnect SMAPI interface - */ -int smVirtual_Network_Adapter_Disconnect( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDisconnectOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Disconnect"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDisconnectDm.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDisconnectDm.c deleted file mode 100644 index e8dcb64..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterDisconnectDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Disconnect_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterDisconnectDmOutput - -/** - * Virtual_Network_Adapter_Disconnect_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Disconnect_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDisconnectDmOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Disconnect_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterQuery.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterQuery.c deleted file mode 100644 index b246352..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkAdapterQuery.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterQueryOutput - -/** - * Virtual_Network_Adapter_Query SMAPI interface - */ -int smVirtual_Network_Adapter_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterQueryOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanAccess.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanAccess.c deleted file mode 100644 index 82a92ab..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanAccess.c +++ /dev/null @@ -1,100 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Access_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanAccessOutput - -/** - * Virtual_Network_LAN_Access SMAPI interface - */ -int smVirtual_Network_LAN_Access(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - char * accessOption, char * accessGrantName, char * promiscuity, - vmApiVirtualNetworkLanAccessOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Access"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + strlen(lanName) - + 1 + strlen(lanOwner) + 1 + strlen(accessOption) + 1 + strlen( - accessGrantName) + 1 + strlen(promiscuity) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - strcpy(cursor, lanName); - cursor += tempSize + 1; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - strcpy(cursor, lanOwner); - cursor += tempSize + 1; - - tempSize = strlen(accessOption); // Access option GRANT or REVOKE - strcpy(cursor, accessOption); - cursor += tempSize + 1; - - tempSize = strlen(accessGrantName); // Access grant user 1..8 chars - strcpy(cursor, accessGrantName); - cursor += tempSize + 1; - - tempSize = strlen(promiscuity); // Promiscuous or nonpromiscuous - strcpy(cursor, promiscuity); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanAccessQuery.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanAccessQuery.c deleted file mode 100644 index ad2c37e..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanAccessQuery.c +++ /dev/null @@ -1,87 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Access_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanAccessQueryOutput - -/** - * Virtual_Network_LAN_Access_Query SMAPI interface - */ -int smVirtual_Network_LAN_Access_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * lanName, char * lanOwner, - vmApiVirtualNetworkLanAccessQueryOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Access_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + strlen(lanName) - + 1 + strlen(lanOwner) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - strcpy(cursor, lanName); - cursor += tempSize + 1; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - strcpy(cursor, lanOwner); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanCreate.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanCreate.c deleted file mode 100644 index 0bed79c..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanCreate.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanCreateOutput - -/** - * Virtual_Network_Lan_Create SMAPI interface - */ -int smVirtual_Network_LAN_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, char lanType, - char transportType, vmApiVirtualNetworkLanCreateOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - lanName) + 4 + strlen(lanOwner) + 1 /* lanType */+ 1 /* transportType */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - *cursor = lanType; // Lan type byte - cursor++; - - *cursor = transportType; // Transport type byte - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanDelete.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanDelete.c deleted file mode 100644 index d596102..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanDelete.c +++ /dev/null @@ -1,89 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanDeleteOutput - -/** - * Virtual_Network_Lan_Delete SMAPI interface - */ -int smVirtual_Network_LAN_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - vmApiVirtualNetworkLanDeleteOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - lanName) + 4 + strlen(lanOwner); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; - -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanQuery.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanQuery.c deleted file mode 100644 index 5e804a5..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkLanQuery.c +++ /dev/null @@ -1,88 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanQueryOutput - -/** - * Virtual_Network_Lan_Query SMAPI interface - */ -int smVirtual_Network_LAN_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - vmApiVirtualNetworkLanQueryOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - lanName) + 4 + strlen(lanOwner); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkQueryLan.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkQueryLan.c deleted file mode 100644 index a41810e..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkQueryLan.c +++ /dev/null @@ -1,57 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Query_LAN_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkQueryLanOutput - -/** - * Virtual_Network_Query_LAN SMAPI interface - */ -int smVirtual_Network_Query_LAN(struct _VmApiInternalContext* vmapiContextP, - vmApiVirtualNetworkQueryLanOutput ** outData) { - const char * const functionName = "Virtual_Network_Query_LAN"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkQueryOsa.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkQueryOsa.c deleted file mode 100644 index 1119786..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkQueryOsa.c +++ /dev/null @@ -1,57 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Query_OSA_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkQueryOsaOutput - -/** - * Virtual_Network_Query_OSA SMAPI interface - */ -int smVirtual_Network_Query_OSA(struct _VmApiInternalContext* vmapiContextP, - vmApiVirtualNetworkQueryOsaOutput ** outData) { - const char * const functionName = "Virtual_Network_Query_OSA"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchCreate.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchCreate.c deleted file mode 100644 index 60e536d..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchCreate.c +++ /dev/null @@ -1,216 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Vswitch_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkVswitchCreateOutput - -/** - * Virtual_Network_Vswitch_Create SMAPI interface - */ -int smVirtual_Network_Vswitch_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, char * realDeviceAddress, char * portName, - char * controllerName, char connectionValue, int queueMemoryLimit, - char routingValue, char transportType, int vlanId, char portType, - char updateSystemConfigIndicator, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, char gvrpValue, - int nativeVlanId, vmApiVirtualNetworkVswitchCreateOutput ** outData) { - const char * const functionName = "Virtual_Network_Vswitch_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - switchName) + 4 + strlen(realDeviceAddress) + 4 + strlen(portName) - + 4 + strlen(controllerName) + 1 /* connectionValue */+ 4 - /* queueMemoryLimit */+ 1 /* routingValue */+ 1 /* transportType */+ 4 - /* vlanId */+ 1 /* porttype */+ 1 /* updateSystemConfigIndicator */+ 4 - + strlen(systemConfigName) + 4 + strlen(systemConfigType) + 4 - + strlen(parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword) + 1 - /* gvrpValue */+ 4 /* nativeVlanId */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - tempSize = strlen(realDeviceAddress); // Real device address 0..14 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, realDeviceAddress, tempSize); - cursor += tempSize; - } - - tempSize = strlen(portName); // Port name 0..26 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, portName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(controllerName); // Controller name 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, controllerName, tempSize); - cursor += tempSize; - } - - *cursor = connectionValue; // Connection value byte - cursor++; - - PUT_INT(queueMemoryLimit, cursor); // Queue memory limit - - *cursor = routingValue; // Routing value byte - cursor++; - - *cursor = transportType; // Transport type byte - cursor++; - - PUT_INT(vlanId, cursor); // Vlan id - - *cursor = portType; // Port type byte - cursor++; - - *cursor = updateSystemConfigIndicator; // Update system config indicator byte - cursor++; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - } - - *cursor = gvrpValue; - cursor++; - - PUT_INT(nativeVlanId, cursor); // Native vlan id - - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchDelete.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchDelete.c deleted file mode 100644 index cf72eec..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchDelete.c +++ /dev/null @@ -1,167 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Vswitch_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkVswitchDeleteOutput - -/** - * Virtual_Network_Vswitch_Delete SMAPI interface - */ -int smVirtual_Network_Vswitch_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, char updateSystemConfigIndicator, - char * systemConfigName, char * systemConfigType, char * parmDiskOwner, - char * parmDiskNumber, char * parmDiskPassword, - char * altSystemConfigName, char * altSystemConfigType, - char * altParmDiskOwner, char * altParmDiskNumber, - char * altParmDiskPassword, - vmApiVirtualNetworkVswitchDeleteOutput ** outData) { - const char * const functionName = "Virtual_Network_Vswitch_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - switchName) + 1 /* updateSystemConfigIndicator */+ 4 + strlen( - systemConfigName) + 4 + strlen(systemConfigType) + 4 + strlen( - parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - *cursor = updateSystemConfigIndicator; // Update system config indicator byte - cursor++; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchQuery.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchQuery.c deleted file mode 100644 index fd66593..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchQuery.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Vswitch_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkVswitchQueryOutput - -/** - * Virtual_Network_Vswitch_Query SMAPI interface - */ -int smVirtual_Network_Vswitch_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, vmApiVirtualNetworkVswitchQueryOutput ** outData) { - const char * const functionName = "Virtual_Network_Vswitch_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - switchName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchSet.c b/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchSet.c deleted file mode 100644 index ab1839c..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVirtualNetworkVswitchSet.c +++ /dev/null @@ -1,237 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Vswitch_Set_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkVswitchSetOutput - -/** - * Virtual_Network_Vswitch_Set SMAPI interface - */ -int smVirtual_Network_Vswitch_Set(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * switchName, char * grantUserid, - char * userVlanId, char * revokeUserid, char * realDeviceAddress, - char * portName, char * controllerName, char connectionValue, - int queueMemoryLimit, char routingValue, char portType, - char updateSystemConfigIndicator, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, char gvrpValue, - char * macId, vmApiVirtualNetworkVswitchSetOutput ** outData) { - const char * const functionName = "Virtual_Network_Vswitch_Set"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - switchName) + 4 + strlen(grantUserid) + 4 + strlen(userVlanId) + 4 - + strlen(revokeUserid) + 4 + strlen(realDeviceAddress) + 4 - + strlen(portName) + 4 + strlen(controllerName) + 1 - /* connectionValue */+ 4 /* queueMemoryLimit */+ 1 /* routingValue */+ 1 - /* porttype */+ 1 /* updateSystemConfigIndicator */+ 4 + strlen( - systemConfigName) + 4 + strlen(systemConfigType) + 4 + strlen( - parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword) + 1 - /* gvrpValue */+ 4 /* macId */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - //Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - tempSize = strlen(grantUserid); // Grant userid 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, grantUserid, tempSize); - cursor += tempSize; - } - - tempSize = strlen(userVlanId); // User vlan id 0..19 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userVlanId, tempSize); - cursor += tempSize; - } - - tempSize = strlen(revokeUserid); // Revoke userid 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, revokeUserid, tempSize); - cursor += tempSize; - } - - tempSize = strlen(realDeviceAddress); // Real device address 0..14 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, realDeviceAddress, tempSize); - cursor += tempSize; - } - - tempSize = strlen(portName); // Port name 0..26 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, portName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(controllerName); // Controller name 0..71 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, controllerName, tempSize); - cursor += tempSize; - } - - *cursor = connectionValue; // Connection value byte - cursor++; - - PUT_INT(queueMemoryLimit, cursor); // Queue memory limit - - *cursor = routingValue; // Routing value byte - cursor++; - - *cursor = portType; // Port type byte - cursor++; - - *cursor = updateSystemConfigIndicator; // Update system config indicator byte - cursor++; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - } - - *cursor = gvrpValue; - cursor++; - - tempSize = strlen(macId); // MAC id 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, macId, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVmrmConfigurationQuery.c b/zhcp/BUILD/resource_access/src/vmapiVmrmConfigurationQuery.c deleted file mode 100644 index c7bc7d6..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVmrmConfigurationQuery.c +++ /dev/null @@ -1,95 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVMRM.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME VMRM_Configuration_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVmrmConfigurationQueryOutput - -/** - * VMRM_Configuration_Query SMAPI interface - */ -int smVMRM_Configuration_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * configurationFileName, - char * configurationFileType, char * configurationDirName, - vmApiVmrmConfigurationQueryOutput ** outData) { - const char * const functionName = "VMRM_Configuration_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor;// Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - configurationFileName) + 4 + strlen(configurationFileType) + 4 - + strlen(configurationDirName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationFileName); // Configuration file name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationFileName, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationFileType); // Configuration file type 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationFileType, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationDirName); // Configuration SFS directory name 1..153 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationDirName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVmrmConfigurationUpdate.c b/zhcp/BUILD/resource_access/src/vmapiVmrmConfigurationUpdate.c deleted file mode 100644 index dd6517b..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVmrmConfigurationUpdate.c +++ /dev/null @@ -1,104 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVMRM.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME VMRM_Configuration_Update_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVmrmConfigurationUpdateOutput - -/** - * VMRM_Configuration_Update SMAPI interface - */ -int smVMRM_Configuration_Update(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * configurationFileName, - char * configurationFileType, char * configurationDirName, - char syncheckOnly, int updateFileLength, char * updateFile, - vmApiVmrmConfigurationUpdateOutput ** outData) { - const char * const functionName = "VMRM_Configuration_Update"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - configurationFileName) + 4 + strlen(configurationFileType) + 4 - + strlen(configurationDirName) + 1 + 4 + updateFileLength; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationFileName); // Configuration file name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationFileName, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationFileType); // Configuration file type 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationFileType, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationDirName); // Configuration SFS directory name 1..153 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationDirName, tempSize); - cursor += tempSize; - - *cursor = syncheckOnly; - cursor++; - - tempSize = updateFileLength; // Update file 1..* - PUT_INT(tempSize, cursor); - memcpy(cursor, updateFile, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/vmapiVmrmMeasurementQuery.c b/zhcp/BUILD/resource_access/src/vmapiVmrmMeasurementQuery.c deleted file mode 100644 index fb6787b..0000000 --- a/zhcp/BUILD/resource_access/src/vmapiVmrmMeasurementQuery.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVMRM.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME VMRM_Measurement_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVmrmMeasurementQueryOutput - -/** - * VMRM_Measurement_Query SMAPI interface - */ -int smVMRM_Measurement_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiVmrmMeasurementQueryOutput ** outData) { - const char * const functionName = "VMRM_Measurement_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - //Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, - TO_STRING(PARSER_TABLE_NAME), - (char * *) outData); - return rc; -} diff --git a/zhcp/BUILD/resource_access/src/wrapperutils.c b/zhcp/BUILD/resource_access/src/wrapperutils.c deleted file mode 100644 index b1793b0..0000000 --- a/zhcp/BUILD/resource_access/src/wrapperutils.c +++ /dev/null @@ -1,102 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * @see wrapperutils.h: releaseContext - */ -void releaseContext(VmApiInternalContext* context) { - smMemoryGroupFreeAll(context); - smMemoryGroupTerminate(context); -} - -/** - * @see wrapperutils.h getContext - */ -void initializeContext(VmApiInternalContext* context) { - - extern struct _smTrace externSmapiTraceFlags; - - smMemoryGroupContext memContext; - - memset(context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - - context->smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context->memContext = &memContext; - - smMemoryGroupInitialize(context); -} - -/** - * Check if image name is between 1 and 8 characters - */ -int isImageNameInvalid(char* imageName) { - - if (strlen(imageName) < 1 || strlen(imageName) > 8) { - printf(" User ID must be between 1 and 8 characters in length.\n" - "Operation Failed\n"); - return 1; - } else { - return 0; - } -} - -/** - * Check if device addresses are specified as 4-digit hexadecimal numbers - */ -int isDevNumberInvalid(char* devNumber) { - - if ((strlen(devNumber) == 4) && ((devNumber[0] > 47 && devNumber[0] < 58) - || (devNumber[0] > 65 && devNumber[0] < 71) || (devNumber[0] > 97 - && devNumber[0] < 103)) - && ((devNumber[1] > 47 && devNumber[1] < 58) || (devNumber[1] > 65 - && devNumber[1] < 71) || (devNumber[1] > 97 && devNumber[1] - < 103)) && ((devNumber[2] > 47 && devNumber[2] < 58) - || (devNumber[2] > 65 && devNumber[2] < 71) || (devNumber[2] > 97 - && devNumber[2] < 103)) - && ((devNumber[3] > 47 && devNumber[3] < 58) || (devNumber[3] > 65 - && devNumber[3] < 71) || (devNumber[3] > 97 && devNumber[3] - < 103))) { - return 0; - } else { - printf( - " Device addresses must be specified as 4-digit hexadecimal numbers.\n" - "Operation Failed\n"); - return 1; - } -} - -/** - * Trim a specified string - */ -void trim(char * s) { - // Length of specified string - int len = strlen(s); - int end = len - 1; - int start = 0; - int i = 0; - - // Find non-blank space from left - while ((start < len) && (s[start] <= ' ')) { - start++; - } - - // Find non-blank space from right - while ((start < end) && (s[end] <= ' ')) { - end--; - } - - if (start > end) { - memset(s, '\0', len); - return; - } - - for (i = 0; (i + start) <= end; i++) { - s[i] = s[start + i]; - } - - // Trim string - memset((s + i), '\0', len - i); -} diff --git a/zhcp/RPMS/s390x/zhcp-1-1.s390x.rpm b/zhcp/RPMS/s390x/zhcp-1-1.s390x.rpm deleted file mode 100644 index da10f45..0000000 Binary files a/zhcp/RPMS/s390x/zhcp-1-1.s390x.rpm and /dev/null differ diff --git a/zhcp/SOURCES/zhcp-build.tar.gz b/zhcp/SOURCES/zhcp-build.tar.gz deleted file mode 100644 index be24e0e..0000000 Binary files a/zhcp/SOURCES/zhcp-build.tar.gz and /dev/null differ diff --git a/zhcp/SPECS/zhcp.spec b/zhcp/SPECS/zhcp.spec deleted file mode 100644 index ea9acc9..0000000 --- a/zhcp/SPECS/zhcp.spec +++ /dev/null @@ -1,30 +0,0 @@ -%define name zhcp - -Summary: zhcp -Name: %{name} -Version: 1 -Release: 1 -Source: zhcp-build.tar.gz -Vendor: IBM -License: Licensed materials - Property of IBM -Group: System/tools -Prefix: %{_prefix} - -%description - -%prep -cd /opt/zhcpbuild/SOURCES/ -tar -zxvf zhcp-build.tar.gz -C /opt/zhcpbuild/BUILD/ --strip 1 - -%build -make - -%install -make install -make post -make clean - -%files -%defattr(-,root,root,755) -/opt/zhcp/* - diff --git a/zhcp/SRPMS/zhcp-1-1.src.rpm b/zhcp/SRPMS/zhcp-1-1.src.rpm deleted file mode 100644 index c4bdfbe..0000000 Binary files a/zhcp/SRPMS/zhcp-1-1.src.rpm and /dev/null differ diff --git a/zhcp/buildrpm.sh b/zhcp/buildrpm.sh deleted file mode 100644 index 15f64c1..0000000 --- a/zhcp/buildrpm.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - - -#-------------------------------------------------------------------------- -# Get oriented -#-------------------------------------------------------------------------- -BUILD=$PWD - -#-------------------------------------------------------------------------- -# Prepare environment -#-------------------------------------------------------------------------- -rm -rf $BUILD/variable 2>/dev/null -mkdir -p $BUILD/variable 2>/dev/null - -echo "%_topdir $BUILD" > $BUILD/variable/.rpmmacros -cp $BUILD/variable/.rpmmacros $HOME 2>/dev/null - -#--------------------------------------------------------------------------- -# Create tar file of zVM MAP agent code -#--------------------------------------------------------------------------- -cd $BUILD/ 2>/dev/null - -rm -rf $BUILD/BUILD 2>/dev/null -rm -rf $BUILD/RPMS 2>/dev/null -rm -rf $BUILD/SOURCES 2>/dev/null -rm -rf $BUILD/SPECS 2>/dev/null -rm -rf $BUILD/SRPMS 2>/dev/null - -mkdir -p $BUILD/BUILD 2>/dev/null -mkdir -p $BUILD/RPMS 2>/dev/null -mkdir -p $BUILD/SOURCES 2>/dev/null -mkdir -p $BUILD/SPECS 2>/dev/null -mkdir -p $BUILD/SRPMS 2>/dev/null - -#--------------------------------------------------------------------------- -# Copy source and build files into input directories -#--------------------------------------------------------------------------- -tar -zcvf $BUILD/zhcp-build.tar.gz zhcp-build 2>/dev/null -mv $BUILD/zhcp-build.tar.gz $BUILD/SOURCES -cp $BUILD/zhcp.spec $BUILD/SPECS 2>/dev/null - -#--------------------------------------------------------------------------- -# Build the RPM -#--------------------------------------------------------------------------- -rpmbuild -ba -v $BUILD/SPECS/zhcp.spec > $BUILD/rpmbuild.log 2>&1 - diff --git a/zhcp/variable/.rpmmacros b/zhcp/variable/.rpmmacros deleted file mode 100644 index 453e7dd..0000000 --- a/zhcp/variable/.rpmmacros +++ /dev/null @@ -1 +0,0 @@ -%_topdir /opt/zhcpbuild diff --git a/zhcp/zhcp-build/Makefile b/zhcp/zhcp-build/Makefile deleted file mode 100644 index f4e46d2..0000000 --- a/zhcp/zhcp-build/Makefile +++ /dev/null @@ -1,801 +0,0 @@ -DEBUG = -g -CFLAGS = -fPIC -LIB_DIR = $(RPM_BUILD_ROOT)/opt/zhcp/lib -BIN_DIR = $(RPM_BUILD_ROOT)/opt/zhcp/bin -LD_DIR = $(RPM_BUILD_ROOT)/etc/ld.so.conf.d -RA_SRC_DIR = resource_access/src/ -RA_INCLUDE_DIR = resource_access/include/ -VMAPILIB = libvmapi.so - -#----------------------------------------------------------------------- -# Headers -#----------------------------------------------------------------------- -COMMON_HEADERS = $(RA_INCLUDE_DIR)smPublic.h $(RA_INCLUDE_DIR)smTraceAndError.h $(RA_INCLUDE_DIR)smapiTableParser.h $(RA_INCLUDE_DIR)smSocket.h - -#----------------------------------------------------------------------- -# Objects for library -#----------------------------------------------------------------------- -OBJECTS = smSocket.o smMemoryGroup.o smapiUtilities.o \ - smapiTableParser.o \ - vmapiAsynchronousNotificationDisableDm.o \ - vmapiAsynchronousNotificationEnableDm.o \ - vmapiAsynchronousNotificationQueryDm.o \ - vmapiAuthorizationListAdd.o \ - vmapiAuthorizationListQuery.o \ - vmapiAuthorizationListRemove.o \ - vmapiCheckAuthentication.o \ - vmapiDirectoryManagerLocalTagDefineDm.o \ - vmapiDirectoryManagerLocalTagDeleteDm.o \ - vmapiDirectoryManagerLocalTagQueryDm.o \ - vmapiDirectoryManagerLocalTagSetDm.o \ - vmapiDirectoryManagerSearchDm.o \ - vmapiDirectoryManagerTaskCancelDm.o \ - vmapiImageActivate.o \ - vmapiImageActiveConfigurationQuery.o \ - vmapiImageCpuDefine.o \ - vmapiImageCpuDefineDm.o \ - vmapiImageCpuDelete.o \ - vmapiImageCpuDeleteDm.o \ - vmapiImageCpuQuery.o \ - vmapiImageCpuQueryDm.o \ - vmapiImageCpuSetMaximumDm.o \ - vmapiImageCreateDm.o \ - vmapiImageDeactivate.o \ - vmapiImageDeleteDm.o \ - vmapiImageDeviceDedicate.o \ - vmapiImageDeviceDedicateDm.o \ - vmapiImageDeviceReset.o \ - vmapiImageDeviceUndedicate.o \ - vmapiImageDeviceUndedicateDm.o \ - vmapiImageDiskCopy.o \ - vmapiImageDiskCopyDm.o \ - vmapiImageDiskCreate.o \ - vmapiImageDiskCreateDm.o \ - vmapiImageDiskDelete.o \ - vmapiImageDiskDeleteDm.o \ - vmapiImageDiskShare.o \ - vmapiImageDiskShareDm.o \ - vmapiImageDiskUnshare.o \ - vmapiImageDiskUnshareDm.o \ - vmapiImageIplDeleteDm.o \ - vmapiImageIplDeviceQuery.o \ - vmapiImageIplQueryDm.o \ - vmapiImageIplSetDm.o \ - vmapiImageLockDm.o \ - vmapiImageNameQueryDm.o \ - vmapiImagePasswordSetDm.o \ - vmapiImageQueryActivateTime.o \ - vmapiImageQueryDm.o \ - vmapiImageRecycle.o \ - vmapiImageReplaceDm.o \ - vmapiImageScsiCharacteristicsDefineDm.o \ - vmapiImageScsiCharacteristicsQueryDm.o \ - vmapiImageStatusQuery.o \ - vmapiImageUnlockDm.o \ - vmapiImageVolumeAdd.o \ - vmapiImageVolumeDelete.o \ - vmapiImageVolumeSpaceDefineDm.o \ - vmapiImageVolumeSpaceQueryDm.o \ - vmapiImageVolumeSpaceRemoveDm.o \ - vmapiNameListAdd.o \ - vmapiNameListDestroy.o \ - vmapiNameListQuery.o \ - vmapiNameListRemove.o \ - vmapiProfileCreateDm.o \ - vmapiProfileDeleteDm.o \ - vmapiProfileQueryDm.o \ - vmapiProfileReplaceDm.o \ - vmapiPrototypeCreateDm.o \ - vmapiPrototypeDeleteDm.o \ - vmapiPrototypeNameQueryDm.o \ - vmapiPrototypeQueryDm.o \ - vmapiPrototypeReplaceDm.o \ - vmapiQueryApiFunctionalLevel.o \ - vmapiQueryAsynchronousOperationDm.o \ - vmapiQueryDirectoryManagerLevelDm.o \ - vmapiSharedMemoryAccessAddDm.o \ - vmapiSharedMemoryAccessQueryDm.o \ - vmapiSharedMemoryAccessRemoveDm.o \ - vmapiSharedMemoryCreate.o \ - vmapiSharedMemoryDelete.o \ - vmapiSharedMemoryQuery.o \ - vmapiSharedMemoryReplace.o \ - vmapiStaticImageChangesActivateDm.o \ - vmapiStaticImageChangesDeactivateDm.o \ - vmapiStaticImageChangesImmediateDm.o \ - vmapiSystemInfoQuery.o \ - vmapiSystemIoQuery.o \ - vmapiVirtualChannelConnectionCreate.o \ - vmapiVirtualChannelConnectionCreateDm.o \ - vmapiVirtualChannelConnectionDelete.o \ - vmapiVirtualChannelConnectionDeleteDm.o \ - vmapiVirtualNetworkAdapterConnectLan.o \ - vmapiVirtualNetworkAdapterConnectLanDm.o \ - vmapiVirtualNetworkAdapterConnectVswitch.o \ - vmapiVirtualNetworkAdapterConnectVswitchDm.o \ - vmapiVirtualNetworkAdapterCreate.o \ - vmapiVirtualNetworkAdapterCreateDm.o \ - vmapiVirtualNetworkAdapterDelete.o \ - vmapiVirtualNetworkAdapterDeleteDm.o \ - vmapiVirtualNetworkAdapterDisconnect.o \ - vmapiVirtualNetworkAdapterDisconnectDm.o \ - vmapiVirtualNetworkAdapterQuery.o \ - vmapiVirtualNetworkLanAccess.o \ - vmapiVirtualNetworkLanAccessQuery.o \ - vmapiVirtualNetworkLanCreate.o \ - vmapiVirtualNetworkLanDelete.o \ - vmapiVirtualNetworkLanQuery.o \ - vmapiVirtualNetworkQueryOsa.o \ - vmapiVirtualNetworkVswitchCreate.o \ - vmapiVirtualNetworkVswitchDelete.o \ - vmapiVirtualNetworkVswitchQuery.o \ - vmapiVirtualNetworkVswitchSet.o \ - vmapiVmrmConfigurationQuery.o \ - vmapiVmrmConfigurationUpdate.o \ - vmapiVmrmMeasurementQuery.o -.PHONY: all install post clean - -#----------------------------------------------------------------------- -# All -#----------------------------------------------------------------------- -all: $(VMAPILIB) \ - wrapperutils.o \ - add3390 \ - add3390active \ - add9336 \ - addvdisk \ - addprocessor \ - addnic \ - connectnic2guestlan \ - connectnic2vswitch \ - createvs \ - deleteipl \ - deletevs \ - dedicatedevice \ - disconnectnic \ - getuserentrynames \ - getuserentry \ - getipl \ - getuserprofile \ - getdiskpool \ - getdiskpoolnames \ - queryvolumes \ - removemdisk \ - removenic \ - removeprocessor \ - replacevs \ - setipl \ - setpassword \ - startvs \ - stopvs \ - undedicatedevice - -#----------------------------------------------------------------------- -# Resource access .o files -#----------------------------------------------------------------------- -smSocket.o : $(RA_SRC_DIR)smSocket.c $(RA_INCLUDE_DIR)smSocket.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)smSocket.c - -smMemoryGroup.o : $(RA_SRC_DIR)smMemoryGroup.c $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)smMemoryGroup.c - -smapiUtilities.o : $(RA_SRC_DIR)smapiUtilities.c $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)smapiUtilities.c - -smapiTableParser.o : $(RA_SRC_DIR)smapiTableParser.c $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)smapiTableParser.c - -vmapiAsynchronousNotificationDisableDm.o : $(RA_SRC_DIR)vmapiAsynchronousNotificationDisableDm.c $(RA_INCLUDE_DIR)vmapiAsynchronous.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAsynchronousNotificationDisableDm.c - -vmapiAsynchronousNotificationEnableDm.o : $(RA_SRC_DIR)vmapiAsynchronousNotificationEnableDm.c $(RA_INCLUDE_DIR)vmapiAsynchronous.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAsynchronousNotificationEnableDm.c - -vmapiAsynchronousNotificationQueryDm.o : $(RA_SRC_DIR)vmapiAsynchronousNotificationQueryDm.c $(RA_INCLUDE_DIR)vmapiAsynchronous.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAsynchronousNotificationQueryDm.c - -vmapiAuthorizationListAdd.o : $(RA_SRC_DIR)vmapiAuthorizationListAdd.c $(RA_INCLUDE_DIR)vmapiAuthorization.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAuthorizationListAdd.c - -vmapiAuthorizationListQuery.o : $(RA_SRC_DIR)vmapiAuthorizationListQuery.c $(RA_INCLUDE_DIR)vmapiAuthorization.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAuthorizationListQuery.c - -vmapiAuthorizationListRemove.o : $(RA_SRC_DIR)vmapiAuthorizationListRemove.c $(RA_INCLUDE_DIR)vmapiAuthorization.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiAuthorizationListRemove.c - -vmapiCheckAuthentication.o : $(RA_SRC_DIR)vmapiCheckAuthentication.c $(RA_INCLUDE_DIR)vmapiCheckAuthentication.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiCheckAuthentication.c - -vmapiDirectoryManagerLocalTagDefineDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagDefineDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagDefineDm.c - -vmapiDirectoryManagerLocalTagDeleteDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagDeleteDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagDeleteDm.c - -vmapiDirectoryManagerLocalTagQueryDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagQueryDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagQueryDm.c - -vmapiDirectoryManagerLocalTagSetDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagSetDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerLocalTagSetDm.c - -vmapiDirectoryManagerSearchDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerSearchDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerSearchDm.c - -vmapiDirectoryManagerTaskCancelDm.o : $(RA_SRC_DIR)vmapiDirectoryManagerTaskCancelDm.c $(RA_INCLUDE_DIR)vmapiDirectoryManager.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiDirectoryManagerTaskCancelDm.c - -vmapiImageActivate.o : $(RA_SRC_DIR)vmapiImageActivate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageActivate.c - -vmapiImageActiveConfigurationQuery.o : $(RA_SRC_DIR)vmapiImageActiveConfigurationQuery.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageActiveConfigurationQuery.c - -vmapiImageCpuDefine.o : $(RA_SRC_DIR)vmapiImageCpuDefine.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuDefine.c - -vmapiImageCpuDefineDm.o : $(RA_SRC_DIR)vmapiImageCpuDefineDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuDefineDm.c - -vmapiImageCpuDelete.o : $(RA_SRC_DIR)vmapiImageCpuDelete.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuDelete.c - -vmapiImageCpuDeleteDm.o : $(RA_SRC_DIR)vmapiImageCpuDeleteDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuDeleteDm.c - -vmapiImageCpuQuery.o : $(RA_SRC_DIR)vmapiImageCpuQuery.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuQuery.c - -vmapiImageCpuQueryDm.o : $(RA_SRC_DIR)vmapiImageCpuQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuQueryDm.c - -vmapiImageCpuSetMaximumDm.o : $(RA_SRC_DIR)vmapiImageCpuSetMaximumDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCpuSetMaximumDm.c - -vmapiImageCreateDm.o : $(RA_SRC_DIR)vmapiImageCreateDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageCreateDm.c - -vmapiImageDeactivate.o : $(RA_SRC_DIR)vmapiImageDeactivate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeactivate.c - -vmapiImageDeleteDm.o : $(RA_SRC_DIR)vmapiImageDeleteDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeleteDm.c - -vmapiImageDeviceDedicate.o : $(RA_SRC_DIR)vmapiImageDeviceDedicate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceDedicate.c - -vmapiImageDeviceDedicateDm.o : $(RA_SRC_DIR)vmapiImageDeviceDedicateDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceDedicateDm.c - -vmapiImageDeviceReset.o : $(RA_SRC_DIR)vmapiImageDeviceReset.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceReset.c - -vmapiImageDeviceUndedicate.o : $(RA_SRC_DIR)vmapiImageDeviceUndedicate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceUndedicate.c - -vmapiImageDeviceUndedicateDm.o : $(RA_SRC_DIR)vmapiImageDeviceUndedicateDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDeviceUndedicateDm.c - -vmapiImageDiskCopy.o : $(RA_SRC_DIR)vmapiImageDiskCopy.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskCopy.c - -vmapiImageDiskCopyDm.o : $(RA_SRC_DIR)vmapiImageDiskCopyDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskCopyDm.c - -vmapiImageDiskCreate.o : $(RA_SRC_DIR)vmapiImageDiskCreate.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskCreate.c - -vmapiImageDiskCreateDm.o : $(RA_SRC_DIR)vmapiImageDiskCreateDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskCreateDm.c - -vmapiImageDiskDelete.o : $(RA_SRC_DIR)vmapiImageDiskDelete.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskDelete.c - -vmapiImageDiskDeleteDm.o : $(RA_SRC_DIR)vmapiImageDiskDeleteDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskDeleteDm.c - -vmapiImageDiskShare.o : $(RA_SRC_DIR)vmapiImageDiskShare.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskShare.c - -vmapiImageDiskShareDm.o : $(RA_SRC_DIR)vmapiImageDiskShareDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskShareDm.c - -vmapiImageDiskUnshare.o : $(RA_SRC_DIR)vmapiImageDiskUnshare.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskUnshare.c - -vmapiImageDiskUnshareDm.o : $(RA_SRC_DIR)vmapiImageDiskUnshareDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageDiskUnshareDm.c - -vmapiImageIplDeleteDm.o : $(RA_SRC_DIR)vmapiImageIplDeleteDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageIplDeleteDm.c - -vmapiImageIplDeviceQuery.o : $(RA_SRC_DIR)vmapiImageIplDeviceQuery.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageIplDeviceQuery.c - -vmapiImageIplQueryDm.o : $(RA_SRC_DIR)vmapiImageIplQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageIplQueryDm.c - -vmapiImageIplSetDm.o : $(RA_SRC_DIR)vmapiImageIplSetDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageIplSetDm.c - -vmapiImageLockDm.o : $(RA_SRC_DIR)vmapiImageLockDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageLockDm.c - -vmapiImageNameQueryDm.o : $(RA_SRC_DIR)vmapiImageNameQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageNameQueryDm.c - -vmapiImagePasswordSetDm.o : $(RA_SRC_DIR)vmapiImagePasswordSetDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImagePasswordSetDm.c - -vmapiImageQueryActivateTime.o : $(RA_SRC_DIR)vmapiImageQueryActivateTime.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageQueryActivateTime.c - -vmapiImageQueryDm.o : $(RA_SRC_DIR)vmapiImageQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageQueryDm.c - -vmapiImageRecycle.o : $(RA_SRC_DIR)vmapiImageRecycle.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageRecycle.c - -vmapiImageReplaceDm.o : $(RA_SRC_DIR)vmapiImageReplaceDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageReplaceDm.c - -vmapiImageScsiCharacteristicsDefineDm.o : $(RA_SRC_DIR)vmapiImageScsiCharacteristicsDefineDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageScsiCharacteristicsDefineDm.c - -vmapiImageScsiCharacteristicsQueryDm.o : $(RA_SRC_DIR)vmapiImageScsiCharacteristicsQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageScsiCharacteristicsQueryDm.c - -vmapiImageStatusQuery.o : $(RA_SRC_DIR)vmapiImageStatusQuery.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageStatusQuery.c - -vmapiImageUnlockDm.o : $(RA_SRC_DIR)vmapiImageUnlockDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageUnlockDm.c - -vmapiImageVolumeAdd.o : $(RA_SRC_DIR)vmapiImageVolumeAdd.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeAdd.c - -vmapiImageVolumeDelete.o : $(RA_SRC_DIR)vmapiImageVolumeDelete.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeDelete.c - -vmapiImageVolumeSpaceDefineDm.o : $(RA_SRC_DIR)vmapiImageVolumeSpaceDefineDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeSpaceDefineDm.c - -vmapiImageVolumeSpaceQueryDm.o : $(RA_SRC_DIR)vmapiImageVolumeSpaceQueryDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeSpaceQueryDm.c - -vmapiImageVolumeSpaceRemoveDm.o : $(RA_SRC_DIR)vmapiImageVolumeSpaceRemoveDm.c $(RA_INCLUDE_DIR)vmapiImage.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiImageVolumeSpaceRemoveDm.c - -vmapiNameListAdd.o : $(RA_SRC_DIR)vmapiNameListAdd.c $(RA_INCLUDE_DIR)vmapiName.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiNameListAdd.c - -vmapiNameListDestroy.o : $(RA_SRC_DIR)vmapiNameListDestroy.c $(RA_INCLUDE_DIR)vmapiName.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiNameListDestroy.c - -vmapiNameListQuery.o : $(RA_SRC_DIR)vmapiNameListQuery.c $(RA_INCLUDE_DIR)vmapiName.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiNameListQuery.c - -vmapiNameListRemove.o : $(RA_SRC_DIR)vmapiNameListRemove.c $(RA_INCLUDE_DIR)vmapiName.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiNameListRemove.c - -vmapiProfileCreateDm.o : $(RA_SRC_DIR)vmapiProfileCreateDm.c $(RA_INCLUDE_DIR)vmapiProfile.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiProfileCreateDm.c - -vmapiProfileDeleteDm.o : $(RA_SRC_DIR)vmapiProfileDeleteDm.c $(RA_INCLUDE_DIR)vmapiProfile.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiProfileDeleteDm.c - -vmapiProfileQueryDm.o : $(RA_SRC_DIR)vmapiProfileQueryDm.c $(RA_INCLUDE_DIR)vmapiProfile.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiProfileQueryDm.c - -vmapiProfileReplaceDm.o : $(RA_SRC_DIR)vmapiProfileReplaceDm.c $(RA_INCLUDE_DIR)vmapiProfile.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiProfileReplaceDm.c - -vmapiPrototypeCreateDm.o : $(RA_SRC_DIR)vmapiPrototypeCreateDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeCreateDm.c - -vmapiPrototypeDeleteDm.o : $(RA_SRC_DIR)vmapiPrototypeDeleteDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeDeleteDm.c - -vmapiPrototypeNameQueryDm.o : $(RA_SRC_DIR)vmapiPrototypeNameQueryDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeNameQueryDm.c - -vmapiPrototypeQueryDm.o : $(RA_SRC_DIR)vmapiPrototypeQueryDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeQueryDm.c - -vmapiPrototypeReplaceDm.o : $(RA_SRC_DIR)vmapiPrototypeReplaceDm.c $(RA_INCLUDE_DIR)vmapiPrototype.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiPrototypeReplaceDm.c - -vmapiQueryApiFunctionalLevel.o : $(RA_SRC_DIR)vmapiQueryApiFunctionalLevel.c $(RA_INCLUDE_DIR)vmapiQuery.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiQueryApiFunctionalLevel.c - -vmapiQueryAsynchronousOperationDm.o : $(RA_SRC_DIR)vmapiQueryAsynchronousOperationDm.c $(RA_INCLUDE_DIR)vmapiQuery.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiQueryAsynchronousOperationDm.c - -vmapiQueryDirectoryManagerLevelDm.o : $(RA_SRC_DIR)vmapiQueryDirectoryManagerLevelDm.c $(RA_INCLUDE_DIR)vmapiQuery.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiQueryDirectoryManagerLevelDm.c - -vmapiSharedMemoryAccessAddDm.o : $(RA_SRC_DIR)vmapiSharedMemoryAccessAddDm.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryAccessAddDm.c - -vmapiSharedMemoryAccessQueryDm.o : $(RA_SRC_DIR)vmapiSharedMemoryAccessQueryDm.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryAccessQueryDm.c - -vmapiSharedMemoryAccessRemoveDm.o : $(RA_SRC_DIR)vmapiSharedMemoryAccessRemoveDm.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryAccessRemoveDm.c - -vmapiSharedMemoryCreate.o : $(RA_SRC_DIR)vmapiSharedMemoryCreate.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryCreate.c - -vmapiSharedMemoryDelete.o : $(RA_SRC_DIR)vmapiSharedMemoryDelete.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryDelete.c - -vmapiSharedMemoryQuery.o : $(RA_SRC_DIR)vmapiSharedMemoryQuery.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryQuery.c - -vmapiSharedMemoryReplace.o : $(RA_SRC_DIR)vmapiSharedMemoryReplace.c $(RA_INCLUDE_DIR)vmapiShared.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSharedMemoryReplace.c - -vmapiStaticImageChangesActivateDm.o : $(RA_SRC_DIR)vmapiStaticImageChangesActivateDm.c $(RA_INCLUDE_DIR)vmapiStatic.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiStaticImageChangesActivateDm.c - -vmapiStaticImageChangesDeactivateDm.o : $(RA_SRC_DIR)vmapiStaticImageChangesDeactivateDm.c $(RA_INCLUDE_DIR)vmapiStatic.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiStaticImageChangesDeactivateDm.c - -vmapiStaticImageChangesImmediateDm.o : $(RA_SRC_DIR)vmapiStaticImageChangesImmediateDm.c $(RA_INCLUDE_DIR)vmapiStatic.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiStaticImageChangesImmediateDm.c - -vmapiSystemInfoQuery.o : $(RA_SRC_DIR)vmapiSystemInfoQuery.c $(RA_INCLUDE_DIR)vmapiSystem.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSystemInfoQuery.c - -vmapiSystemIoQuery.o : $(RA_SRC_DIR)vmapiSystemIoQuery.c $(RA_INCLUDE_DIR)vmapiSystem.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiSystemIoQuery.c - -vmapiVirtualChannelConnectionCreate.o : $(RA_SRC_DIR)vmapiVirtualChannelConnectionCreate.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualChannelConnectionCreate.c - -vmapiVirtualChannelConnectionCreateDm.o : $(RA_SRC_DIR)vmapiVirtualChannelConnectionCreateDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualChannelConnectionCreateDm.c - -vmapiVirtualChannelConnectionDelete.o : $(RA_SRC_DIR)vmapiVirtualChannelConnectionDelete.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualChannelConnectionDelete.c - -vmapiVirtualChannelConnectionDeleteDm.o : $(RA_SRC_DIR)vmapiVirtualChannelConnectionDeleteDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualChannelConnectionDeleteDm.c - -vmapiVirtualNetworkAdapterConnectLan.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectLan.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectLan.c - -vmapiVirtualNetworkAdapterConnectLanDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectLanDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectLanDm.c - -vmapiVirtualNetworkAdapterConnectVswitch.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectVswitch.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectVswitch.c - -vmapiVirtualNetworkAdapterConnectVswitchDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectVswitchDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterConnectVswitchDm.c - -vmapiVirtualNetworkAdapterCreate.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterCreate.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterCreate.c - -vmapiVirtualNetworkAdapterCreateDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterCreateDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterCreateDm.c - -vmapiVirtualNetworkAdapterDelete.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDelete.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDelete.c - -vmapiVirtualNetworkAdapterDeleteDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDeleteDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDeleteDm.c - -vmapiVirtualNetworkAdapterDisconnect.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDisconnect.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDisconnect.c - -vmapiVirtualNetworkAdapterDisconnectDm.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDisconnectDm.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterDisconnectDm.c - -vmapiVirtualNetworkAdapterQuery.o : $(RA_SRC_DIR)vmapiVirtualNetworkAdapterQuery.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkAdapterQuery.c - -vmapiVirtualNetworkLanAccess.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanAccess.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanAccess.c - -vmapiVirtualNetworkLanAccessQuery.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanAccessQuery.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanAccessQuery.c - -vmapiVirtualNetworkLanCreate.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanCreate.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanCreate.c - -vmapiVirtualNetworkLanDelete.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanDelete.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanDelete.c - -vmapiVirtualNetworkLanQuery.o : $(RA_SRC_DIR)vmapiVirtualNetworkLanQuery.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkLanQuery.c - -vmapiVirtualNetworkQueryOsa.o : $(RA_SRC_DIR)vmapiVirtualNetworkQueryOsa.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkQueryOsa.c - -vmapiVirtualNetworkVswitchCreate.o : $(RA_SRC_DIR)vmapiVirtualNetworkVswitchCreate.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkVswitchCreate.c - -vmapiVirtualNetworkVswitchDelete.o : $(RA_SRC_DIR)vmapiVirtualNetworkVswitchDelete.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkVswitchDelete.c - -vmapiVirtualNetworkVswitchQuery.o : $(RA_SRC_DIR)vmapiVirtualNetworkVswitchQuery.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkVswitchQuery.c - -vmapiVirtualNetworkVswitchSet.o : $(RA_SRC_DIR)vmapiVirtualNetworkVswitchSet.c $(RA_INCLUDE_DIR)vmapiVirtual.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVirtualNetworkVswitchSet.c - -vmapiVmrmConfigurationQuery.o : $(RA_SRC_DIR)vmapiVmrmConfigurationQuery.c $(RA_INCLUDE_DIR)vmapiVMRM.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVmrmConfigurationQuery.c - -vmapiVmrmConfigurationUpdate.o : $(RA_SRC_DIR)vmapiVmrmConfigurationUpdate.c $(RA_INCLUDE_DIR)vmapiVMRM.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVmrmConfigurationUpdate.c - -vmapiVmrmMeasurementQuery.o : $(RA_SRC_DIR)vmapiVmrmMeasurementQuery.c $(RA_INCLUDE_DIR)vmapiVMRM.h $(COMMON_HEADERS) - gcc -c $(CFLAGS) $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)vmapiVmrmMeasurementQuery.c - -#----------------------------------------------------------------------- -# Resource access libraries -#----------------------------------------------------------------------- -$(VMAPILIB) : $(OBJECTS) - gcc -Wl,-d -shared -pthread -ldl -o $(VMAPILIB) $(OBJECTS) - -#----------------------------------------------------------------------- -# Resource access executables -#----------------------------------------------------------------------- -wrapperutils.o : $(RA_SRC_DIR)wrapperutils.c $(RA_INCLUDE_DIR)smPublic.h $(RA_INCLUDE_DIR)vmapiImage.h - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)wrapperutils.c - -add3390 : add3390.o $(VMAPILIB) - gcc -o add3390 -L./ -lvmapi wrapperutils.o add3390.o - -add3390.o : $(RA_SRC_DIR)add3390.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)add3390.c - -add3390active : add3390active.o $(VMAPILIB) - gcc -o add3390active -L./ -lvmapi wrapperutils.o add3390active.o - -add3390active.o : $(RA_SRC_DIR)add3390active.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)add3390active.c - -add9336 : add9336.o $(VMAPILIB) - gcc -o add9336 -L./ -lvmapi wrapperutils.o add9336.o - -add9336.o : $(RA_SRC_DIR)add9336.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)add9336.c - -addvdisk : addvdisk.o $(VMAPILIB) - gcc -o addvdisk -L./ -lvmapi wrapperutils.o addvdisk.o - -addvdisk.o : $(RA_SRC_DIR)addvdisk.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)addvdisk.c - -addprocessor : addprocessor.o $(VMAPILIB) - gcc -o addprocessor -L./ -lvmapi wrapperutils.o addprocessor.o - -addprocessor.o : $(RA_SRC_DIR)addprocessor.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)addprocessor.c - -addnic : addnic.o $(VMAPILIB) - gcc -o addnic -L./ -lvmapi wrapperutils.o addnic.o - -addnic.o : $(RA_SRC_DIR)addnic.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)addnic.c - -connectnic2guestlan : connectnic2guestlan.o $(VMAPILIB) - gcc -o connectnic2guestlan -L./ -lvmapi wrapperutils.o connectnic2guestlan.o - -connectnic2guestlan.o : $(RA_SRC_DIR)connectnic2guestlan.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)connectnic2guestlan.c - -connectnic2vswitch : connectnic2vswitch.o $(VMAPILIB) - gcc -o connectnic2vswitch -L./ -lvmapi wrapperutils.o connectnic2vswitch.o - -connectnic2vswitch.o : $(RA_SRC_DIR)connectnic2vswitch.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)connectnic2vswitch.c - -createvs : createvs.o $(VMAPILIB) - gcc -o createvs -L./ -lvmapi wrapperutils.o createvs.o - -createvs.o : $(RA_SRC_DIR)createvs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)createvs.c - -deletevs : deletevs.o $(VMAPILIB) - gcc -o deletevs -L./ -lvmapi wrapperutils.o deletevs.o - -deletevs.o : $(RA_SRC_DIR)deletevs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)deletevs.c - -dedicatedevice : dedicatedevice.o $(VMAPILIB) - gcc -o dedicatedevice -L./ -lvmapi wrapperutils.o dedicatedevice.o - -dedicatedevice.o : $(RA_SRC_DIR)dedicatedevice.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)dedicatedevice.c - -deleteipl : deleteipl.o $(VMAPILIB) - gcc -o deleteipl -L./ -lvmapi wrapperutils.o deleteipl.o - -deleteipl.o : $(RA_SRC_DIR)deleteipl.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)deleteipl.c - -disconnectnic : disconnectnic.o $(VMAPILIB) - gcc -o disconnectnic -L./ -lvmapi wrapperutils.o disconnectnic.o - -disconnectnic.o : $(RA_SRC_DIR)disconnectnic.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)disconnectnic.c - -getuserentrynames : getuserentrynames.o $(VMAPILIB) - gcc -o getuserentrynames -L./ -lvmapi wrapperutils.o getuserentrynames.o - -getuserentrynames.o : $(RA_SRC_DIR)getuserentrynames.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getuserentrynames.c - -getuserentry : getuserentry.o $(VMAPILIB) - gcc -o getuserentry -L./ -lvmapi wrapperutils.o getuserentry.o - -getuserentry.o : $(RA_SRC_DIR)getuserentry.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getuserentry.c - -getipl : getipl.o $(VMAPILIB) - gcc -o getipl -L./ -lvmapi wrapperutils.o getipl.o - -getipl.o : $(RA_SRC_DIR)getipl.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getipl.c - -getuserprofile : getuserprofile.o $(VMAPILIB) - gcc -o getuserprofile -L./ -lvmapi wrapperutils.o getuserprofile.o - -getuserprofile.o : $(RA_SRC_DIR)getuserprofile.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getuserprofile.c - -getdiskpool : getdiskpool.o $(VMAPILIB) - gcc -o getdiskpool -L./ -lvmapi wrapperutils.o getdiskpool.o - -getdiskpool.o : $(RA_SRC_DIR)getdiskpool.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getdiskpool.c - -getdiskpoolnames : getdiskpoolnames.o $(VMAPILIB) - gcc -o getdiskpoolnames -L./ -lvmapi wrapperutils.o getdiskpoolnames.o - -getdiskpoolnames.o : $(RA_SRC_DIR)getdiskpoolnames.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)getdiskpoolnames.c - -queryvolumes : queryvolumes.o $(VMAPILIB) - gcc -o queryvolumes -L./ -lvmapi wrapperutils.o queryvolumes.o - -queryvolumes.o : $(RA_SRC_DIR)queryvolumes.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)queryvolumes.c - -removemdisk : removemdisk.o $(VMAPILIB) - gcc -o removemdisk -L./ -lvmapi wrapperutils.o removemdisk.o - -removemdisk.o : $(RA_SRC_DIR)removemdisk.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)removemdisk.c - -removenic : removenic.o $(VMAPILIB) - gcc -o removenic -L./ -lvmapi wrapperutils.o removenic.o - -removenic.o : $(RA_SRC_DIR)removenic.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)removenic.c - -removeprocessor : removeprocessor.o $(VMAPILIB) - gcc -o removeprocessor -L./ -lvmapi wrapperutils.o removeprocessor.o - -removeprocessor.o : $(RA_SRC_DIR)removeprocessor.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)removeprocessor.c - -replacevs : replacevs.o $(VMAPILIB) - gcc -o replacevs -L./ -lvmapi wrapperutils.o replacevs.o - -replacevs.o : $(RA_SRC_DIR)replacevs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)replacevs.c - -setipl : setipl.o $(VMAPILIB) - gcc -o setipl -L./ -lvmapi wrapperutils.o setipl.o - -setipl.o : $(RA_SRC_DIR)setipl.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)setipl.c - -setpassword : setpassword.o $(VMAPILIB) - gcc -o setpassword -L./ -lvmapi wrapperutils.o setpassword.o - -setpassword.o : $(RA_SRC_DIR)setpassword.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)setpassword.c - -startvs : startvs.o $(VMAPILIB) - gcc -o startvs -L./ -lvmapi wrapperutils.o startvs.o - -startvs.o : $(RA_SRC_DIR)startvs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)startvs.c - -stopvs : stopvs.o $(VMAPILIB) - gcc -o stopvs -L./ -lvmapi wrapperutils.o stopvs.o - -stopvs.o : $(RA_SRC_DIR)stopvs.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)stopvs.c - -undedicatedevice : undedicatedevice.o $(VMAPILIB) - gcc -o undedicatedevice -L./ -lvmapi wrapperutils.o undedicatedevice.o - -undedicatedevice.o : $(RA_SRC_DIR)undedicatedevice.c - gcc -c $(DEBUG) -I$(RA_INCLUDE_DIR) $(RA_SRC_DIR)undedicatedevice.c - -#----------------------------------------------------------------------- -# Install -#----------------------------------------------------------------------- -install: - mkdir -p $(LIB_DIR) - install $(VMAPILIB) $(LIB_DIR) - mkdir -p $(BIN_DIR) - install stopvs $(BIN_DIR) - install add3390 $(BIN_DIR) - install add3390active $(BIN_DIR) - install add9336 $(BIN_DIR) - install addvdisk $(BIN_DIR) - install addprocessor $(BIN_DIR) - install addnic $(BIN_DIR) - install connectnic2guestlan $(BIN_DIR) - install connectnic2vswitch $(BIN_DIR) - install createvs $(BIN_DIR) - install deletevs $(BIN_DIR) - install dedicatedevice $(BIN_DIR) - install deleteipl $(BIN_DIR) - install disconnectnic $(BIN_DIR) - install getuserentrynames $(BIN_DIR) - install getuserentry $(BIN_DIR) - install getipl $(BIN_DIR) - install getuserprofile $(BIN_DIR) - install getdiskpool $(BIN_DIR) - install getdiskpoolnames $(BIN_DIR) - install queryvolumes $(BIN_DIR) - install removemdisk $(BIN_DIR) - install removenic $(BIN_DIR) - install removeprocessor $(BIN_DIR) - install replacevs $(BIN_DIR) - install setipl $(BIN_DIR) - install setpassword $(BIN_DIR) - install startvs $(BIN_DIR) - install stopvs $(BIN_DIR) - install undedicatedevice $(BIN_DIR) - mkdir -p $(LD_DIR) - install -m 644 config/zhcp.conf $(LD_DIR) - -#----------------------------------------------------------------------- -# Post -#----------------------------------------------------------------------- -post: - ldconfig - -#----------------------------------------------------------------------- -# Clean -#----------------------------------------------------------------------- -clean: - rm -f *.o *.so $(VMAPILIB) - rm add3390 - rm add3390active - rm add9336 - rm addvdisk - rm addprocessor - rm addnic - rm connectnic2guestlan - rm connectnic2vswitch - rm createvs - rm deleteipl - rm deletevs - rm dedicatedevice - rm disconnectnic - rm getuserentrynames - rm getuserentry - rm getipl - rm getuserprofile - rm getdiskpool - rm getdiskpoolnames - rm queryvolumes - rm removemdisk - rm removenic - rm removeprocessor - rm replacevs - rm setipl - rm setpassword - rm startvs - rm stopvs - rm undedicatedevice diff --git a/zhcp/zhcp-build/config/zhcp.conf b/zhcp/zhcp-build/config/zhcp.conf deleted file mode 100644 index a623f4f..0000000 --- a/zhcp/zhcp-build/config/zhcp.conf +++ /dev/null @@ -1 +0,0 @@ -/opt/zhcp/lib diff --git a/zhcp/zhcp-build/resource_access/include/smPublic.h b/zhcp/zhcp-build/resource_access/include/smPublic.h deleted file mode 100644 index 5ab3fcf..0000000 --- a/zhcp/zhcp-build/resource_access/include/smPublic.h +++ /dev/null @@ -1,381 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _SM_PUBLIC_H -#define _SM_PUBLIC_H - -#include -#include -#include -#include -#include - -#define BUFLEN 256 -#define MAXCACHENAMELEN 8+1+8 -#define CACHEENTRYLEN BUFLEN+MAXCACHENAMELEN -#define PATHLENGTH 512 -#define LENGTH_OF_USERID_LENGTH_FIELD 4 -#define ALL_SCAN_FILES "*.scan" -#define PORT_FILENAME "vmbkend.UDP" - -// Data structure to character based information -typedef struct _Record { - struct _Record* nextP; - char data[1]; -} Record; - -// Data structure to keep lists of records -typedef struct _List { - Record* firstP; - Record* currentP; - int size; -} List; - -enum Times { - ConnectRetryLimit = 10, // # trials for connect - SEND_RETRY_LIMIT = 8, // # times to retry send to SMAPI - Delay = 10, // Delay in loop checking for pending workunits - MaxWaitCycleN = 10, // Max number of wait cycles for pending ops - SleepInterval = 15, // Interval in seconds to sleep on repetitive operations - Socket_Timeout = 240, // Max timeout for socket operations - Socket_Indication_Timeout = 500, // Max timeout for indication socket operations - ImageSetRange = 4096, // # image disks in an image set - LINESIZE = 512 -// # bytes to use for a message/log line -}; - -// Resource layer specific function call return codes for internal/unexpected errors -// Look in the internal context for other specific return and reason codes -// listed below -// -// NOTE Parser return codes are using -4000 to -4010 see smapiTableParser.h for details. -#define MEMORY_ERROR -999 -#define INVALID_DATA -2 -#define PROCESSING_ERROR -3 - -// These are from smSocket.c functions -#define SOCKET_OBTAIN_ERROR -100 -#define SOCKET_CONNECT_REFUSED_ERROR -101 -#define SOCKET_CONNECT_TRYAGAIN_ERROR -102 -#define SOCKET_TIMEOUT_ERROR -103 -#define SOCKET_READ_ERROR -104 -#define SOCKET_READ_RETRYABLE_ERROR -105 -#define SOCKET_WRITE_ERROR -106 -#define SOCKET_WRITE_RETRYABLE_ERROR -107 -#define SOCKET_PROCESSING_ERROR -108 -#define CUSTOM_DEFINED_SOCKET_RETRY 100 - -// Return and reason codes -enum ReturnCodes { - RcWarning = 4, RcContext = -1, // Context related errors - RcSession = -2, // Session related errors - RcFunction = -3, // Errors invoking functions - RcRuntime = -4, // General runtime errors - RcIucv = -5, // Error caused by IUCV, reason code is IUCV return value - RcCp = -6, // CP command invocation errors - RcCpint = -7, // CPint invocation - RcNoMemory = -8 -// Out of memory and no context yet -}; - -enum GeneralReasonCodes { - RsInternalBufferTooSmall = 10000, RsNoMemory = 10001, - RsSemaphoreNotCreated = 10011, RsSemaphoreNotObtained = 10012, - RsSemaphoreNotReleased = 10013, RsSocketAddrIdFileNotOpened = 10014, - RsUnableToOpenLog = 10100, RsSocketTimeout = 10110, RsUnexpected = 10200 -}; - -enum ContextReasonCodes { - RsNoHostname = 1, RsNoHostId = 2, RsNoServerAssociation = 3, - RsNoUserid = 4, RsInvalidVmapiServerVersion = 5, RsInvalidServerName = 6 -}; - -enum SessionReasonCodes { - RsUnableToReadSessionContext = 1, RsUnableToWriteSessionContext = 2 -}; - -enum FunctionReasonCodes { - RsFunctionNotSpecified = 1, RsFunctionUnknown = 2, - RsFunctionNotImplemented = 3, RsInvalidNumberOfArguments = 4, - RsFunctionNotSupported = 5, RsInvalidArgument = 24 -}; - -enum RuntimeReasonCodes { - RsUnableToOpenLog22 = 1 -}; - -typedef struct _smMemoryGroupContext { - int arraySize; - int lastChunk; - void ** chunks; -} smMemoryGroupContext; - -#define CACHE_PATH_DEFAULT "/var/opt/ibm/zvmmap/.vmapi/" -#define CACHE_SEMAPHORE_DIRECTORY ".vmapi/" -#define CACHE_SEMAPHORE_FILENAME "vmapi.sem" -#define CACHE_DIRECTORY ".cache/" -#define CACHE_DIRECTORY_FOR_USER "cache/" -#define CACHE_FILE_EXTENSION_FOR_USER ".cache" -#define CACHE_INSTANCEID_FILE_EXTENSION_FOR_USER ".id" - -// A macro to free memory and zero out the pointer too -#define FREE_MEMORY(_mempointer_) \ - if (_mempointer_) \ - { \ - free(_mempointer_); \ - _mempointer_ = NULL; \ - } - -#define TO_STRING2(_data_) \ - #_data_ -#define TO_STRING(_data_) \ - TO_STRING2(_data_) - -/** - * Before calling the resource layer the caller needs to create and zero out - * a VmApiInternalContext and set the following fields: - * - * smMemoryGroupContext structure pointed to by the memContext field. That - * memory structure should also be zeroed out. - * - * --- Trace info --- - * Set a trace flags structure pointer using the global external name: - * extern struct _smtrace externSmapiTraceFlags; - * - * Ex: - * vmapiContext.smTraceDetails = (struct _smTrace *)&externSmapiTraceFlags; - * - * That structure can be zero'ed out for no tracing or flags set to trace - * a specific area. See smTraceAndError.h for constants. - * - * Note: The first socket init call will call readTraceFile and look for a - * file (TRACE_LEVELS_FILE) to read and set trace levels if any are found. - */ -#define FIRST_FAILURE_MESSAGE_MAX_LEN 250 -typedef struct _VmApiInternalContext { - char serverName[256]; - int pendingWorkunits[10]; - struct _smTrace * smTraceDetails; // Trace and error flags, locations, etc - char userid[9]; // Used for context creation default userID - char IucvUserid[9]; // SMAPI machine UserID. If this field is null, default is VSMREQIU - char useridForAsynchNotification[9]; // This is usually the Linux ID, can be any ID in SMAPI auth file - smMemoryGroupContext * memContext; - char vmapiServerVersion[4]; - int maxServerRpcVersion; - int contextCreatedFlag; // Set to 1 if context has been created - char strFirstFailureMsg[FIRST_FAILURE_MESSAGE_MAX_LEN + 1]; - int firstFailureCaptured; // 0: False - int rc; - int reason; - int printOffset; - int execDepth; - int isBackend; - int checkBackendFlag; - key_t semKey; - int semId; - FILE* logFileP; - FILE* contextFileP; - List inputStream; - List outputStream; - List errorStream; - char path[PATHLENGTH]; // Context path in ZVMMAP_VAR or defaulted - char name[256]; - char emsg[LINESIZE]; - char hostid[20]; - char password[9]; - int instanceId; - char tag[256]; - int resolveHostName; // To be moved to persistant later -} VmApiInternalContext; - -typedef struct _Abbreviation { - char* nameP; - int minimum; -} Abbreviation; - -// Internal data structure to keep minidisk data -typedef struct _Minidisk { - struct _Minidisk* nextP; - int address; - char type[8]; - int location; - int extent; - char volser[8]; - char mode[4]; - int processFlag; -} Minidisk; - -// Internal data structure to keep dedicate data -typedef struct _Dedicate { - struct _Dedicate* nextP; - int vnum; - int rnum; -} Dedicate; - -/** - * Macro: break_if_error(FUNC, CODE, SOCK) - * - * Purpose: After a socket function, this macro will display a msg using - * perror if the function FUNC fails with code CODE. Additionally, - * if the value of the socket SOCK is not -1, the socket will be - * closed. Finally, do the 'break' part, to break out of the - * current loop. - * - * Inputs: FUNC - String to be displayed along with with perror - * CODE - The return code to be tested for failure (< 0) - * SOCK - The socket descriptor to be close if not equal to -1 - */ -#ifndef break_if_error -#define break_if_error(FUNC,CODE,SOCK) { \ - if (CODE < 0) { \ - perror(#FUNC "() failed"); \ - if (SOCK != -1) { \ - close(SOCK); \ - SOCK = -1; \ - } \ - break; }} -#endif - -/** - * Macro: continue_if_error(FUNC, CODE, SOCK) - * - * Purpose: After a socket function, this macro will display a msg using - * perror if the function FUNC fails with code CODE. Additionally, - * if the value of the socket SOCK is not -1, the socket will be - * closed. Finally, do the 'continue' part, to iterate the - * current loop. - * - * Inputs: FUNC - String to be displayed along with with perror - * CODE - The return code to be tested for failure (< 0) - * SOCK - The socket descriptor to be close if not equal to -1 - * - */ -#ifndef continue_if_error -#define continue_if_error(FUNC,CODE,SOCK) { \ - if (CODE < 0) { \ - perror(#FUNC "() failed"); \ - if (SOCK != -1) { \ - close(SOCK); \ - SOCK = -1; \ - } \ - continue; }} -#endif - -/** - * Macro: exit_if_error(FUNC, CODE, SOCK) - * - * Purpose: After a socket function, this macro will display a msg using - * perror if the function FUNC fails with code CODE. Additionally, - * if the value of the socket SOCK is not -1, the socket will be - * closed. Finally, cause the 'return' to happen. - * - * Inputs: FUNC - String to be displayed along with with perror - * CODE - The return code to be tested for failure (< 0) - * SOCK - The socket descriptor to be close if not equal to -1 - */ -#ifndef exit_if_error -#define exit_if_error(FUNC,CODE,SOCK) { \ - if (CODE < 0) { \ - perror(#FUNC "() failed"); \ - if (SOCK != -1) { \ - close(SOCK); \ - SOCK = -1; \ - } \ - return; }} -#endif - -// Macros to retrieve or default argument -#define ARG(x) getArg(x,anArgc,anArgvPP,"") -#define ARG_DEFAULT(x,aDefaultP) getArg(x,anArgc,anArgvPP,aDefaultP) - -// Utility functions -int checkAbbreviation(const char* aStringP, - const Abbreviation* anAbbreviationListP, int anAbbreviationN); - -int checkBoolean(const char* aStringP); - -int checkPrefixCommand(const char* aCommandP); - -int initializeThreadSemaphores(struct _VmApiInternalContext* vmapiContextP, - const char* aContextNameP, int aCreateFlag); - -int createDirectories(const char* aFilenameP); - -void dumpArea(struct _VmApiInternalContext* vmapiContextP, void * pstor, - int len); - -Dedicate* getDedicates(); -Minidisk* getMinidisks(); - -int isOSA(struct _VmApiInternalContext* vmapiContextP, char* rdev); - -void listAppendLine(struct _VmApiInternalContext* vmapiContextP, List* aListP, - const char* aLineP); - -void listAppendRecord(List* aListP, Record* aRecordP); - -void listDeleteCurrent(List* aListP); - -Record* -listDequeueRecord(List* aListP); - -const char* -listNextLine(List* aListP); - -const Record* -listNextRecord(List* aListP); - -void listFree(List* aListP); - -void listReset(List* aListP); - -void readTraceFile(struct _VmApiInternalContext* vmapiContextP); - -void * -smMemoryGroupAlloc(struct _VmApiInternalContext* vmapiContextP, size_t size); - -int smMemoryGroupFreeAll(struct _VmApiInternalContext* vmapiContextP); - -int smMemoryGroupInitialize(struct _VmApiInternalContext* vmapiContextP); - -void * -smMemoryGroupRealloc(struct _VmApiInternalContext* vmapiContextP, void * chunk, - size_t size); - -int smMemoryGroupTerminate(struct _VmApiInternalContext* vmapiContextP); - -char* -strip(char* aLineP, char anOption, char aChar); - -void sysinfo(struct _VmApiInternalContext* vmapiContextP, int anArgc, - const char**anArgvPP); - -int testDigit(char aChar); - -const char* -vmApiMessageText(struct _VmApiInternalContext* vmapiContextP); - -int vmbkendCacheEntryInvalidate(struct _VmApiInternalContext* vmapiContextP, - char *pathP, char *useridP); - -int vmbkendCheck(struct _VmApiInternalContext* vmapiContextP); - -void vmbkendGetCachePath(struct _VmApiInternalContext* vmapiContextP, - char *pathP); - -void *vmbkendMain(void* vmapiContextP); - -int vmbkendRemoveCachedScanFiles(struct _VmApiInternalContext* vmapiContextP, - char *pathP); - -void vmbkendRemoveEntireCache(struct _VmApiInternalContext* vmapiContextP, - char *cachePathP); - -void waitForPendingWorkunits(struct _VmApiInternalContext* vmapiContextP, - int waitIntervalInSeconds); - -int cacheFileValid(struct _VmApiInternalContext* vmapiContextP, - const char* cFName); - -#include "smTraceAndError.h" - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/smSocket.h b/zhcp/zhcp-build/resource_access/include/smSocket.h deleted file mode 100644 index 0d1ba7b..0000000 --- a/zhcp/zhcp-build/resource_access/include/smSocket.h +++ /dev/null @@ -1,16 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _SMSOCKET_H -#define _SMSOCKET_H -#include "smPublic.h" - -int smSocketInitialize(struct _VmApiInternalContext* vmapiContextP, - int * sockId); -int smSocketWrite(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * data, int dataLen); -int smSocketRead(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * buff, int len); -int smSocketReadLoop(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * buff, int len); -int smSocketTerminate(struct _VmApiInternalContext* vmapiContextP, int sockId); -#endif diff --git a/zhcp/zhcp-build/resource_access/include/smTraceAndError.h b/zhcp/zhcp-build/resource_access/include/smTraceAndError.h deleted file mode 100644 index 8faf779..0000000 --- a/zhcp/zhcp-build/resource_access/include/smTraceAndError.h +++ /dev/null @@ -1,137 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _SM_TRACE_H -#define _SM_TRACE_H -#include -#include -#include "smPublic.h" - -// Trace levels are to be powers of 2 to allow combinations of tracing -#define TRACE_LEVELS_FILE "vmmaptracing" -#define TRACE_LEVELS_FILE_DIRECTORY "/etc/opt/ibm/zvmmap/.cimvm/" - -// Make sure the level information matches the index in the TRACE_LEVELS and TRACE_FLAG_VALUES array below -#define TRACELEVEL_OFF 0 -#define TRACELEVEL_FLOW 1 -#define TRACELEVEL_PARAMETERS 2 -#define TRACELEVEL_DETAILS 4 -#define TRACELEVEL_BUFFER_OUT 256 // Unit test socket layer -#define TRACELEVEL_BUFFER_IN 512 // Unit test socket layer -#define TRACELEVEL_ALL 0x8FFFFFFF - -// Keywords for the trace file -#define TRACE_LEVELS_COUNT 7 -static const char * TRACE_LEVELS[TRACE_LEVELS_COUNT] = { "off", "flow", - "parms", "details", "buffout", "buffin", "all" }; - -static const unsigned int TRACE_FLAG_VALUES[TRACE_LEVELS_COUNT] = { 0, - TRACELEVEL_FLOW, TRACELEVEL_PARAMETERS, TRACELEVEL_DETAILS, - TRACELEVEL_BUFFER_OUT, TRACELEVEL_BUFFER_IN, TRACELEVEL_ALL }; - -// Trace areas index into trace array -#define TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD 0 -#define TRACEAREA_CIM_OPERATION_LAYER 1 -#define TRACEAREA_RESOURCE_LAYER 2 -#define TRACEAREA_RESOURCE_LAYER_SOCKET 3 -#define TRACEAREA_RESOURCE_LAYER_PARSER 4 -#define TRACEAREA_BACKGROUND_VMEVENT_NOTIFICATION_THREAD 5 -#define TRACEAREA_NAME_VALUE_PARSER 6 -#define TRACEAREA_CACHE 7 -#define TRACEAREA_SMAPI_ONLY 8 - -// Keywords for the trace areas -#define TRACE_AREAS_COUNT 9 -static const char * TRACE_KEYWORDS[TRACE_AREAS_COUNT] = { "directorychanges", - "cimop", "resourcelayer", "socket", "parser", "vmeventchanges", - "namevalueparser", "cache", "smapionly" }; - -typedef struct _smTrace { - unsigned int traceFlags[TRACE_AREAS_COUNT]; // A separate trace int for each area - int traceLock; - int traceFileRead; // 0 = trace file needs to be checked with "readTraceFile(" - unsigned int traceOutputLocation; // 0 = syslog - FILE * traceFilePointer; // 0 = no file open -} smTrace; - -/** - * Trace functions and constants for a line of data or a block of storage - */ - -// errorLog will save the return and reason code in the context and then -// call errorLine. -void errorLog(struct _VmApiInternalContext* vmapiContextP, - const char * functionName, const char * lineNumber, int aRc, - int aReason, const char* aLineP); - -// errorLine will call Logline with the "error" flag and then -// call listAppendLine to add a record to the context error stream -void errorLine(struct _VmApiInternalContext* vmapiContextP, const char* aLineP); - -// These severity contants get remapped to syslog constants in LogLine -#define LOGLINE_DEBUG 'D' -#define LOGLINE_ERR 'E' -#define LOGLINE_INFO 'I' -#define LOGLINE_NOTICE 'N' -#define LOGLINE_WARNING 'W' -#define LOGLINE_EXCEPTION 'X' - -// LogLine will add a timestamp and then write the data to the syslog. -void logLine(struct _VmApiInternalContext* vmapiContextP, char aSeverity, - const char* aLineP); - -void outputLine(struct _VmApiInternalContext* vmapiContextP, - const char* aLineP, int aLogFlag); - -// This macro can be used to test for a trace type being on before -// calling logLine. See logline description below. Follow the logLine -// call with the TRACE_END or TRACE_END_DEBUG to close out the braces -// logline with the LOGLINE_DEBUG will replace the old codes use of debugline. -#define TRACE_START(_context_ , _tracearea_, _tracelevel_) \ - if(((_context_)->smTraceDetails->traceFlags[_tracearea_])&_tracelevel_ ) \ - { - -#define TRACE_END } - -#define TRACE_END_DEBUG(_context_, _linedata_) \ - logLine(_context_, LOGLINE_DEBUG, _linedata_); \ - } - -// This macro can be used to trace entry into a function, -// the function name is supplied by the compiler -#define TRACE_ENTRY_FLOW(_context_ , _tracearea_) \ - TRACE_START(_context_, _tracearea_, TRACELEVEL_FLOW); \ - char _line_[LINESIZE]; \ - sprintf(_line_, \ - "%s function ENTRY (at line %d in %s) \n", \ - __func__, __LINE__, __FILE__); \ - logLine(_context_ ,LOGLINE_DEBUG, _line_); \ - } - -// This macro can be used to trace exit from a function, -// the function name is supplied by the compiler -// The context is expected to be a pointer -#define TRACE_EXIT_FLOW(_context_ , _tracearea_) \ - TRACE_START(_context_, _tracearea_, TRACELEVEL_FLOW); \ - char _line_[LINESIZE]; \ - sprintf(_line_, \ - "%s function EXIT. RC: %d RS: %d (at line %d in %s) \n", \ - __func__, \ - _context_->rc, \ - _context_->reason, __LINE__, __FILE__); \ - logLine(_context_ ,LOGLINE_DEBUG, _line_); \ - } - -// This macro can be used to trace exit from a CIM function where you specify the return code, -// the function name is supplied by the compiler -// The context is expected to be a pointer -#define TRACE_EXIT_CIM_FLOW(_context_ , _tracearea_ , _rc_) \ - TRACE_START(_context_, _tracearea_, TRACELEVEL_FLOW); \ - char _line_[LINESIZE]; \ - sprintf(_line_, \ - "%s function EXIT. RC: %d (at line %d in %s) \n", \ - __func__, \ - _rc_, __LINE__, __FILE__); \ - logLine(_context_ ,LOGLINE_DEBUG, _line_); \ - } - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/smapiTableParser.h b/zhcp/zhcp-build/resource_access/include/smapiTableParser.h deleted file mode 100644 index e5b77ea..0000000 --- a/zhcp/zhcp-build/resource_access/include/smapiTableParser.h +++ /dev/null @@ -1,213 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_PARSER_ROUTINE_H -#define _VMAPI_PARSER_ROUTINE_H - -#include -#include -#include -#include "smPublic.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// This structure typedef is used for the common information returned by -// the SMAPI -typedef struct _commonOutputFields { - int requestId; - int returnCode; - int reasonCode; -} commonOutputFields; - -// This structure is used to handle unknown number of zero terminated data -// returned by the SMAPI. Array notation can be used to subscript the strings. -typedef struct _vmApiCStringInfo { - char * vmapiString; -} vmApiCStringInfo; - -/** - * Parser table general layout: - * Columns are: Type, min, max, output structure unique index number, nesting level, - * offset in output structure (or size of output structure) - * - * Min and max only apply to string length items, and arrays - * - * NOTE: - * Each type has the following requirements: - * - * APITYPE_BASE_STRUCT_LEN Column 4 must be STRUCT_INDX_0, column 6 is size of structure - * APITYPE_INTn Column 4 must have the structure index, column 6 contains the offset to store this value into - * APITYPE_STRING_LEN Column 2 must have the minimum string length, column 3 must have the maximum length or -1 if no max - * Column 4 must have the structure index, column 6 contains the offset to store this string into - * If a single zero terminated string is returned in the buffer; then use - * APITYPE_C_STR_PTR Column 2 must have the minimum string length, column 3 must have the maximum length or -1 if no max - * Column 4 must have the structure index, column 6 contains the offset to store this string into - * - * APITYPE_CHARBUF_LEN Column 2 must have the minimum charaters length, column 3 must have the maximum length or -1 if no max - * Column 4 must have the structure index, column 6 contains the offset to store this charater buffer pointer into - * APITYPE_CHARBUF_COUNT Column 4 must have the structure index, column 6 contains the offset to store the count into - * (CHARBUF_LEN must have a ..COUNT as the next table entry) - * - * APITYPE_ARRAY_LEN Column 4 must have the structure index, column 6 contains the offset to - * store the pointer to first array element at. - * APITYPE_ARRAY_STRUCT_COUNT Column 4 must have the structure index, column 6 contains the offset to store the count into - * APITYPE_STRUCT_LEN or APITYPE_NOBUFFER_STRUCT_LEN - * Column 5 must have the size of the output structure - * (ARRAY must have STRUCT following; STRUCT_COUNT must have a ..LEN as the next table entry) - * APITYPE_NOBUFFER_STRUCT_LEN is used when the SMAPI buffer does not have a structure size - * after the array size in the returned data. (The data is an array of strings vs array of structures) - * - * When the SMAPI buffer has many zero terminated strings as output: (use the next 4 types in that order) - * The vmApiCStringInfo structure can be used to hold each string. - * APITYPE_C_STR_ARRAY_PTR Column 4 must have the parent structure index, column 6 contains - * the offset to store the pointer to first string in the array at. - * APITYPE_C_STR_ARRAY_COUNT Column 4 must have the structure index which hold the count field, column 6 contains the offset to store the count into - * APITYPE_C_STR_STRUCT_LEN Column 5 must have the size of the output structure (vmApiCStringInfo) - * APITYPE_C_STR_PTR Column 5 must have the offset in the C string structure of the char * - * - * APITYPE_END_OF_TABLE Must be used to end the table - * - * Note: use CHARBUF for strings that can contain nulls (CHARNA in zVM API data types) - * - * Ex: - * static tableLayout Imalge_Activate_Layout = - * { - * {APITYPE_BASE_STRUCT_LEN, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,sizeof(VmApiImageActivateOutput) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,common.requestId) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,common.returnCode)}, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,common.reasonCode)}, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,activated) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,notActivated) }, - * - * {APITYPE_ARRAY_LEN, 4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,failList) }, - * {APITYPE_ARRAY_STRUCT_COUNT,4,4,STRUCT_INDX_0,NEST_LEVEL_0,offsetof(VmApiImageActivateOutput,failingArrayCount)}, - * {APITYPE_STRUCT_LEN, 4,4,STRUCT_INDX_1,NEST_LEVEL_1,sizeof(VmApiImageFailing) }, - * {APITYPE_STRING_LEN, 1,8,STRUCT_INDX_1,NEST_LEVEL_1,offsetof(VmApiImageFailing,imageName) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_1,NEST_LEVEL_1,offsetof(VmApiImageFailing,returnCode) }, - * {APITYPE_INT4, 4,4,STRUCT_INDX_1,NEST_LEVEL_1,offsetof(VmApiImageFailing,reasonCode) }, - * {APITYPE_END_OF_TABLE,0,0,0,0} - * }; - */ -#define APITYPE_END_OF_TABLE 0 -#define APITYPE_INT1 1 -#define APITYPE_INT4 2 -#define APITYPE_INT8 3 - -#define APITYPE_STRING_LEN 20 -#define APITYPE_ARRAY_LEN 21 -#define APITYPE_ARRAY_STRUCT_COUNT 22 -#define APITYPE_STRUCT_LEN 23 -#define APITYPE_NOBUFFER_STRUCT_LEN 24 -#define APITYPE_CHARBUF_LEN 25 -#define APITYPE_CHARBUF_COUNT 26 -#define APITYPE_C_STR_ARRAY_PTR 30 -#define APITYPE_C_STR_ARRAY_COUNT 31 -#define APITYPE_C_STR_STRUCT_LEN 32 -#define APITYPE_C_STR_PTR 33 -#define APITYPE_BASE_STRUCT_LEN 98 - -#define STRUCT_INDX_0 0 -#define STRUCT_INDX_1 1 -#define STRUCT_INDX_2 2 -#define STRUCT_INDX_3 3 -#define STRUCT_INDX_4 4 -#define STRUCT_INDX_5 5 -#define STRUCT_INDX_6 6 -#define STRUCT_INDX_7 7 -#define STRUCT_INDX_8 8 -#define STRUCT_INDX_9 9 -#define STRUCT_INDX_10 10 - -#define NEST_LEVEL_0 0 -#define NEST_LEVEL_1 1 -#define NEST_LEVEL_2 2 -#define NEST_LEVEL_3 3 - -#define MAX_STRUCT_ARRAYS 10 - -#define COL_1_TYPE 0 -#define COL_2_MINSIZE 1 -#define COL_3_MAXSIZE 2 -#define COL_4_STRUCT_INDEX 3 -#define COL_5_NEST_LEVEL 4 -#define COL_6_SIZE_OR_OFFSET 5 - -enum tableParserModes { - scan, populate -}; - -typedef int tableLayout[][6]; - -/** - * Input/output structure for use by smapiTableParser parseBufferWithTable() - * - * - smapiBufferCursor must be set to the start of the SMAPI data - * - dataBufferSize must be set to the total size of the SMAPI data - * - byteCount is used by parseBufferWithTable as a work variable - * - outStringByteCount will be set in "scan" mode to the number of bytes needed for all the - * strings found in the SMAPI data - * - outStructCount array will be set in "scan" mode to the number of structures found at each - * level - * - outStructSizes array will be set in "scan" mode to the size of 1 structure - * - inStructAddrs array must be set in "populate" mode to the starting address of the first - * structure at each level - * - inStringCursor must be set in "populate" mode to the start of the storage block for use in - * string allocation. - */ -typedef struct _tableParserParms { - char * smapiBufferCursor; // Input for SCAN and POPULATE. Initially set to output buffer. - int dataBufferSize; // Input for SCAN and POPULATE, size of SMAPI output buffer - int byteCount; // Bytes processed from SMAPI returned data buffer - int outStringByteCount; // Output parm from SCAN - int outStructCount[MAX_STRUCT_ARRAYS]; // Output parm from SCAN - int outStructSizes[MAX_STRUCT_ARRAYS]; // Output parm from SCAN - void * inStructAddrs[MAX_STRUCT_ARRAYS];// Input parm for POPULATE - char * inStringCursor; // Input string block pointer for POPULATE -} tableParserParms; - -#define PARSER_ERROR_INVALID_TABLE -4002 -#define PARSER_ERROR_INVALID_STRING_SIZE -4003 - -#define ntohll(x) (((unsigned long long)(ntohl((int)((x << 32) >> 32))) << 32) | (unsigned int)ntohl(((int)(x >> 32)))) -#define htonll(x) ntohll(x) - -#define PUT_INT(_inInt_,_outBuf_) \ - ({ int _int; \ - _int = htonl(_inInt_) ; \ - memcpy(_outBuf_, &_int, 4); \ - _outBuf_ += 4; \ - }) - -#define GET_INT(_outInt_,_inBuf_) \ - ({ int _int; \ - memcpy(&_int, _inBuf_, 4); \ - _outInt_ = ntohl(_int) ; \ - _inBuf_ += 4; \ - }) - -#define PUT_64INT(_in64Int_,_outBuf_) \ - ({ long long _64int; \ - _64int = htonll(_in64Int_) ; \ - memcpy(_outBuf_, &_64int, 8); \ - _outBuf_ += 8; \ - }) - -#define GET_64INT(_out64Int_,_inBuf_) \ - ({ long long _64int; \ - memcpy(&_64int, _inBuf_, 8); \ - _out64Int_ = ntohll(_64int) ; \ - _inBuf_ += 8; \ - }) - -int parseBufferWithTable(struct _VmApiInternalContext* vmapiContextP, - enum tableParserModes mode, tableLayout table, tableParserParms *parms); - -int getAndParseSmapiBuffer(struct _VmApiInternalContext* vmapiContextP, - char * * inputBufferPointerPointer, int inputBufferSize, - tableLayout parserTable, char * parserTableName, char * * outData); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiAsynchronous.h b/zhcp/zhcp-build/resource_access/include/vmapiAsynchronous.h deleted file mode 100644 index 937c6b4..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiAsynchronous.h +++ /dev/null @@ -1,129 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_ASYNCHRONOUS_H -#define _VMAPI_ASYNCHRONOUS_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Asynchronous_Notification_Disable_DM -typedef commonOutputFields vmApiAsynchronousNotificationDisableDmOutput; - -// Parser table for Asynchronous_Notification_Disable_DM -static tableLayout Asynchronous_Notification_Disable_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAsynchronousNotificationDisableDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationDisableDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationDisableDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationDisableDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAsynchronous_Notification_Disable_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char communication_type, int port_number, - char * ip_address, char encoding, int subscriber_data_length, - char * subscriber_data, - vmApiAsynchronousNotificationDisableDmOutput ** outData); - -// Asynchronous_Notification_Enable_DM -typedef commonOutputFields vmApiAsynchronousNotificationEnableDmOutput; - -// Parser table for Asynchronous_Notification_Enable_DM -static tableLayout Asynchronous_Notification_Enable_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAsynchronousNotificationEnableDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationEnableDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationEnableDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationEnableDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAsynchronous_Notification_Enable_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char subscription_type, char communication_type, - int port_number, char * ip_address, char encoding, - int subscriber_data_length, char * subscriber_data, - vmApiAsynchronousNotificationEnableDmOutput ** outData); - -// Asynchronous_Notification_Query_DM -typedef struct _vmApiNotification { // Common structure used by Asynchronous_Notification_Query - char * userid; - char subscriptionType; - char communicationType; - int portNumber; - char * ipAddress; - char encoding; - int subscriberDataLength; - char * subscriberData; -} vmApiNotification; - -typedef struct _vmApiAsynchronousNotificationQueryDmOutput { - commonOutputFields common; - int notificationCount; - vmApiNotification * notificationList; -} vmApiAsynchronousNotificationQueryDmOutput; - -// Parser table for Asynchronous_Notification_Query_DM -static tableLayout - Asynchronous_Notification_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAsynchronousNotificationQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationQueryDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationQueryDmOutput, - common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiAsynchronousNotificationQueryDmOutput, - notificationList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof( - vmApiAsynchronousNotificationQueryDmOutput, - notificationCount) }, { APITYPE_STRUCT_LEN, 4, - 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiNotification) }, { APITYPE_STRING_LEN, 4, - 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiNotification, userid) }, { APITYPE_INT1, - 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiNotification, subscriptionType) }, { - APITYPE_INT1, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiNotification, communicationType) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiNotification, portNumber) }, { - APITYPE_STRING_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiNotification, ipAddress) }, { - APITYPE_INT1, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiNotification, encoding) }, { - APITYPE_CHARBUF_LEN, 0, 64, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiNotification, - subscriberData) }, { APITYPE_CHARBUF_COUNT, 0, - 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiNotification, subscriberDataLength) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAsynchronous_Notification_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char communication_type, int port_number, - char * ip_address, char encoding, int subscriber_data_length, - char * subscriber_data, - vmApiAsynchronousNotificationQueryDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiAuthorization.h b/zhcp/zhcp-build/resource_access/include/vmapiAuthorization.h deleted file mode 100644 index 9ed6bcc..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiAuthorization.h +++ /dev/null @@ -1,106 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_AUTHORIZATION_H -#define _VMAPI_AUTHORIZATION_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Authorization_List_Add -typedef commonOutputFields vmApiAuthorizationListAddOutput; - -// Parser table for Authorization_List_Add -static tableLayout Authorization_List_Add_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAuthorizationListAddOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiAuthorizationListAddOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiAuthorizationListAddOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListAddOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAuthorization_List_Add(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListAddOutput ** outData); - -// Authorization_List_Query -typedef struct _vmApiAuthorizationRecord { // Common structure used by Authorization_List_Query - char * requestingUserid; - char requestingListIndicator; - char * forUserid; - char forListIndicator; - char * functionName; - char functionListIndicator; -} vmApiAuthorizationRecord; - -typedef struct _vmApiAuthorizationListQueryOutput { - commonOutputFields common; - int authorizationRecordCount; - vmApiAuthorizationRecord * authorizationRecordList; -} vmApiAuthorizationListQueryOutput; - -// Parser table for Authorization_List_Query -static tableLayout Authorization_List_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAuthorizationListQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListQueryOutput, authorizationRecordList) }, - { APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiAuthorizationListQueryOutput, - authorizationRecordCount) }, { APITYPE_STRUCT_LEN, 4, - 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiAuthorizationRecord) }, { APITYPE_STRING_LEN, 1, - 64, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiAuthorizationRecord, requestingUserid) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiAuthorizationRecord, requestingListIndicator) }, { - APITYPE_STRING_LEN, 1, 64, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiAuthorizationRecord, forUserid) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiAuthorizationRecord, forListIndicator) }, { - APITYPE_STRING_LEN, 1, 64, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiAuthorizationRecord, functionName) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiAuthorizationRecord, functionListIndicator) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAuthorization_List_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListQueryOutput ** outData); - -// Authorization_List_Remove -typedef commonOutputFields vmApiAuthorizationListRemoveOutput; - -// Parser table for Authorization_List_Remove -static tableLayout Authorization_List_Remove_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiAuthorizationListRemoveOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListRemoveOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListRemoveOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiAuthorizationListRemoveOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smAuthorization_List_Remove(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListRemoveOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiCheckAuthentication.h b/zhcp/zhcp-build/resource_access/include/vmapiCheckAuthentication.h deleted file mode 100644 index 09c6439..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiCheckAuthentication.h +++ /dev/null @@ -1,34 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_CHECK_AUTHENTICATION_H -#define _VMAPI_CHECK_AUTHENTICATION_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Check_Authentication -typedef commonOutputFields vmApiCheckAuthenticationOutput; - -// Parser table for Check_Authentication -static tableLayout Check_Authentication_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiCheckAuthenticationOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiCheckAuthenticationOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiCheckAuthenticationOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiCheckAuthenticationOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smCheck_Authentication(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - vmApiCheckAuthenticationOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiDirectoryManager.h b/zhcp/zhcp-build/resource_access/include/vmapiDirectoryManager.h deleted file mode 100644 index 791153c..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiDirectoryManager.h +++ /dev/null @@ -1,172 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_DIRECTORY_MANAGER_H -#define _VMAPI_DIRECTORY_MANAGER_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Directory_Manager_Local_Tag_Define_DM -typedef commonOutputFields vmApiDirectoryManagerLocalTagDefineDmOutput; - -// Parser table for Directory_Manager_Local_Tag_Define_DM -static tableLayout Directory_Manager_Local_Tag_Define_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerLocalTagDefineDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDefineDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDefineDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDefineDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smDirectory_Manager_Local_Tag_Define_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, int tag_ordinal, char createOrChange, - vmApiDirectoryManagerLocalTagDefineDmOutput ** outData); - -// Directory_Manager_Local_Tag_Delete_DM -typedef commonOutputFields vmApiDirectoryManagerLocalTagDeleteDmOutput; - -// Parser table for Directory_Manager_Local_Tag_Delete_DM -static tableLayout Directory_Manager_Local_Tag_Delete_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerLocalTagDeleteDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDeleteDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int - smDirectory_Manager_Local_Tag_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, - vmApiDirectoryManagerLocalTagDeleteDmOutput ** outData); - -// Directory_Manager_Local_Tag_Query_DM -typedef struct _vmApiDirectoryManagerLocalTagQueryDmOutput { - commonOutputFields common; - int tagValueLength; - char * tagValue; -} vmApiDirectoryManagerLocalTagQueryDmOutput; - -// Parser table for Directory_Manager_Local_Tag_Query_DM -static tableLayout - Directory_Manager_Local_Tag_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerLocalTagQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagQueryDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagQueryDmOutput, - common.reasonCode) }, - { APITYPE_CHARBUF_LEN, 1, 240, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiDirectoryManagerLocalTagQueryDmOutput, - tagValue) }, { APITYPE_CHARBUF_COUNT, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagQueryDmOutput, - tagValueLength) }, { APITYPE_END_OF_TABLE, 0, - 0, 0, 0 } }; -int smDirectory_Manager_Local_Tag_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, vmApiDirectoryManagerLocalTagQueryDmOutput ** outData); - -// Directory_Manager_Local_Tag_Set_DM -typedef commonOutputFields vmApiDirectoryManagerLocalTagSetDmOutput; - -// Parser table for Directory_Manager_Local_Tag_Set_DM -static tableLayout Directory_Manager_Local_Tag_Set_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerLocalTagSetDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagSetDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagSetDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerLocalTagSetDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smDirectory_Manager_Local_Tag_Set_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, int tag_value_length, char * tag_value, - vmApiDirectoryManagerLocalTagSetDmOutput ** outData); - -// Directory_Manager_Search_DM -typedef struct _vmApiDirectoryManagerStatement { // Common structure used by Directory_Manager_Search - char * targetId; - int statementLength; - char * statement; -} vmApiDirectoryManagerStatement; - -typedef struct _vmApiDirectoryManagerSearchDmOutput { - commonOutputFields common; - int statementCount; - vmApiDirectoryManagerStatement * statementList; -} vmApiDirectoryManagerSearchDmOutput; - -// Parser table for Directory_Manager_Search_DM -static tableLayout Directory_Manager_Search_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerSearchDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerSearchDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerSearchDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerSearchDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerSearchDmOutput, statementList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiDirectoryManagerSearchDmOutput, statementCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiDirectoryManagerStatement) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiDirectoryManagerStatement, - targetId) }, { APITYPE_CHARBUF_LEN, 1, 72, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiDirectoryManagerStatement, statement) }, { - APITYPE_CHARBUF_COUNT, 0, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiDirectoryManagerStatement, statementLength) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smDirectory_Manager_Search_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int search_pattern_length, - char * search_pattern, vmApiDirectoryManagerSearchDmOutput ** outData); - -// Directory_Manager_Task_Cancel_DM -typedef commonOutputFields vmApiDirectoryManagerTaskCancelDmOutput; - -// Parser table for Directory_Manager_Task_Cancel_DM -static tableLayout Directory_Manager_Task_Cancel_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiDirectoryManagerTaskCancelDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerTaskCancelDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerTaskCancelDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiDirectoryManagerTaskCancelDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smDirectory_Manager_Task_Cancel_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - int operation_id, vmApiDirectoryManagerTaskCancelDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiImage.h b/zhcp/zhcp-build/resource_access/include/vmapiImage.h deleted file mode 100644 index 0d4fef5..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiImage.h +++ /dev/null @@ -1,1252 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_IMAGE_H -#define _VMAPI_IMAGE_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Image_Activate -typedef struct _vmApiImageFailing { // Common structure for Image_Activate, Image_Deactivate, Image_Recycle - char * imageName; - int returnCode; - int reasonCode; -} vmApiImageFailing; - -typedef struct _vmApiImageActivate { - commonOutputFields common; - int activated; - int notActivated; - int failingArrayCount; - vmApiImageFailing * failList; -} vmApiImageActivateOutput; - -int smImage_Activate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageActivateOutput ** outData); - -// Parser table for Image_Activate -static tableLayout Image_Activate_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageActivateOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActivateOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageActivateOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageActivateOutput, common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActivateOutput, activated) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageActivateOutput, - notActivated) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActivateOutput, failList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageActivateOutput, failingArrayCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageFailing) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageFailing, - imageName) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiImageFailing, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Image_Active_Configuration_Query -typedef struct _vmApiImageCpuInfo // This struct is shared with Image CPU query also -{ - int cpuNumber; // Or address - char * cpuId; - char cpuBase; // Only supplied for Image_CPU_Query - char cpuStatus; - char cpuType; // Only supplied for Image_CPU_Query -} vmApiImageCpuInfo; - -typedef struct _vmApiImageDeviceInfo { - char deviceType; - char * deviceAddress; -} vmApiImageDeviceInfo; - -typedef struct _vmApiImageActiveConfigurationQuery { - commonOutputFields common; - int memorySize; - char memoryUnit; - char shareType; - char * shareValue; - int numberOfCpus; - int cpuInfoCount; - vmApiImageCpuInfo * cpuList; - int deviceCount; - vmApiImageDeviceInfo * deviceList; -} vmApiImageActiveConfigurationQueryOutput; - -int smImage_Active_Configuration_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageActiveConfigurationQueryOutput ** outData); - -// Parser table for Image_Active_Configuration_Query -static tableLayout - Image_Active_Configuration_Query_Layout = { - { APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageActiveConfigurationQueryOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - common.requestId) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - common.returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, memorySize) }, - { APITYPE_INT1, 1, 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, memoryUnit) }, - { APITYPE_INT1, 1, 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, shareType) }, - { APITYPE_STRING_LEN, 1, 5, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageActiveConfigurationQueryOutput, - shareValue) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - numberOfCpus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageActiveConfigurationQueryOutput, - cpuList) }, { APITYPE_ARRAY_STRUCT_COUNT, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - cpuInfoCount) }, - { APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageCpuInfo) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageCpuInfo, cpuNumber) }, { - APITYPE_STRING_LEN, 1, 16, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiImageCpuInfo, cpuId) }, { APITYPE_INT1, - 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageCpuInfo, cpuStatus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageActiveConfigurationQueryOutput, - deviceList) }, { APITYPE_ARRAY_STRUCT_COUNT, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageActiveConfigurationQueryOutput, - deviceCount) }, { APITYPE_STRUCT_LEN, 4, 4, - STRUCT_INDX_2, NEST_LEVEL_1, - sizeof(vmApiImageDeviceInfo) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_2, NEST_LEVEL_1, offsetof( - vmApiImageDeviceInfo, deviceType) }, { - APITYPE_STRING_LEN, 4, 16, STRUCT_INDX_2, NEST_LEVEL_1, - offsetof(vmApiImageDeviceInfo, deviceAddress) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Image_CPU_Define -typedef commonOutputFields vmApiImageCpuDefineOutput; - -// Parser table for Image_CPU_Define -static tableLayout Image_CPU_Define_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuDefineOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDefineOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuDefineOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuDefineOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Define(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, char cpuType, - vmApiImageCpuDefineOutput ** outData); - -// Image_CPU_Define_DM -typedef commonOutputFields vmApiImageCpuDefineDmOutput; - -// Parser table for Image_CPU_Define_DM -static tableLayout Image_CPU_Define_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuDefineDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDefineDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDefineDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDefineDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Define_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, char baseCpu, char * cpuId, - char dedicateCpu, char cryptoCpu, - vmApiImageCpuDefineDmOutput ** outData); - -// Image_CPU_Delete -typedef commonOutputFields vmApiImageCpuDeleteOutput; - -// Parser table for Image_CPU_Delete -static tableLayout Image_CPU_Delete_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuDeleteOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDeleteOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuDeleteOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuDeleteOutput ** outData); - -// Image_CPU_Delete_DM -typedef commonOutputFields vmApiImageCpuDeleteDmOutput; - -// Parser table for Image_CPU_Delete_DM -static tableLayout Image_CPU_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuDeleteDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDeleteDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuDeleteDmOutput ** outData); - -// Image_CPU_Query -typedef struct _vmApiImageCpuQuery { - commonOutputFields common; - int numberOfCpus; - int cpuInfoCount; - vmApiImageCpuInfo * cpuList; -} vmApiImageCpuQueryOutput; - -int smImage_CPU_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageCpuQueryOutput ** outData); - -// Parser table for Image_CPU_Query -static tableLayout Image_CPU_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuQueryOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuQueryOutput, common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryOutput, numberOfCpus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryOutput, cpuList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageCpuQueryOutput, cpuInfoCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageCpuInfo) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageCpuInfo, - cpuNumber) }, - { APITYPE_STRING_LEN, 1, 16, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageCpuInfo, cpuId) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageCpuInfo, - cpuBase) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiImageCpuInfo, cpuStatus) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageCpuInfo, cpuType) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Image_CPU_Query_DM -typedef struct _vmApiImageCpuQueryDm { - commonOutputFields common; - char * cpuAddress; - char baseCpu; - char * cpuId; - char cpuDedicate; - char cpuCrypto; -} vmApiImageCpuQueryDmOutput; - -int smImage_CPU_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuQueryDmOutput ** outData); - -// Parser table for Image_CPU_Query_DM -static tableLayout Image_CPU_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCpuQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, common.reasonCode) }, { - APITYPE_STRING_LEN, 1, 2, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, cpuAddress) }, { APITYPE_INT1, 1, - 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuQueryDmOutput, - baseCpu) }, { APITYPE_STRING_LEN, 0, 6, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuQueryDmOutput, cpuId) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuQueryDmOutput, cpuDedicate) }, { APITYPE_INT1, 1, - 1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuQueryDmOutput, - cpuCrypto) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Image_CPU_Set_Maximum_DM -typedef commonOutputFields vmApiImageCpuSetMaximumDmOutput; - -// Parser table for Image_CPU_Set_Maximum_DM -static tableLayout Image_CPU_Set_Maximum_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageCpuSetMaximumDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCpuSetMaximumDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCpuSetMaximumDmOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCpuSetMaximumDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_CPU_Set_Maximum_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int maxCpus, - vmApiImageCpuSetMaximumDmOutput ** outData); - -// Image_Create_DM -typedef struct _vmApiImageRecord { // Common structure used by Image_Create_Dm and Image_Query_DM and Image_Replace_DM - int imageRecordLength; - char * imageRecord; -} vmApiImageRecord; - -typedef struct _vmApiImageCreateDm { - commonOutputFields common; - int operationId; -} vmApiImageCreateDmOutput; - -// Parser table for Image_Create_DM -static tableLayout Image_Create_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageCreateDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCreateDmOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageCreateDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageCreateDmOutput, common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageCreateDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int - smImage_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * prototypeName, - int initialPasswordLength, char * initialPassword, - char * initialAccountNumber, int imageRecordCount, - vmApiImageRecord * imageRecordList, - vmApiImageCreateDmOutput ** outData); - -// Image_Deactivate -typedef struct _vmApiImageDeactivate { - commonOutputFields common; - int deactivated; - int notDeactivated; - int failingArrayCount; - vmApiImageFailing * failList; // Reuse structure from Image_Activate -} vmApiImageDeactivateOutput; - -// Parser table for Image_Deactivate -static tableLayout Image_Deactivate_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDeactivateOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, deactivated) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeactivateOutput, - notDeactivated) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeactivateOutput, failList) }, { APITYPE_ARRAY_STRUCT_COUNT, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeactivateOutput, - failingArrayCount) }, { APITYPE_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiImageFailing) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, imageName) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageFailing, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, reasonCode) }, { APITYPE_END_OF_TABLE, 0, 0, - 0, 0 } }; - -int smImage_Deactivate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * forceTimeLength, - vmApiImageDeactivateOutput ** outData); - -// Image_Delete_DM -typedef struct _vmApiImageDeleteDm { - commonOutputFields common; - int operationId; -} vmApiImageDeleteDmOutput; - -// Parser table for Image_Delete_DM -static tableLayout Image_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDeleteDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeleteDmOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeleteDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDeleteDmOutput, common.reasonCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeleteDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char dataSecurityErase, - vmApiImageDeleteDmOutput ** outData); - -// Image_Device_Dedicate -typedef commonOutputFields vmApiImageDeviceDedicateOutput; - -// Parser table for Image_Device_Dedicate -static tableLayout Image_Device_Dedicate_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDeviceDedicateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeviceDedicateOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDeviceDedicateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceDedicateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smImage_Device_Dedicate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - char * realDeviceNumber, char readonly, - vmApiImageDeviceDedicateOutput ** outData); - -// Image_Device_Dedicate_DM -typedef commonOutputFields vmApiImageDeviceDedicateDmOutput; - -// Parser table for Image_Device_Dedicate_DM -static tableLayout Image_Device_Dedicate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDeviceDedicateDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeviceDedicateDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDeviceDedicateDmOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceDedicateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Device_Dedicate_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - char * realDeviceNumber, char readonly, - vmApiImageDeviceDedicateDmOutput ** outData); - -// Image_Device_Reset -typedef commonOutputFields vmApiImageDeviceResetOutput; - -// Parser table for Image_Device_Reset -static tableLayout Image_Device_Reset_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDeviceResetOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceResetOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceResetOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceResetOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Device_Reset(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceResetOutput ** outData); - -// Image_Device_Undedicate -typedef commonOutputFields vmApiImageDeviceUndedicateOutput; - -// Parser table for Image_Device_Undedicate -static tableLayout Image_Device_Undedicate_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDeviceUndedicateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDeviceUndedicateOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDeviceUndedicateOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceUndedicateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Device_Undedicate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceUndedicateOutput ** outData); - -// Image_Device_Undedicate_DM -typedef commonOutputFields vmApiImageDeviceUndedicateDmOutput; - -// Parser table for Image_Device_Undedicate_DM -static tableLayout Image_Device_Undedicate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDeviceUndedicateDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceUndedicateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceUndedicateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDeviceUndedicateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Device_Undedicate_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceUndedicateDmOutput ** outData); - -// Image_Disk_Copy -typedef commonOutputFields vmApiImageDiskCopyOutput; - -// Parser table for Image_Disk_Copy -static tableLayout Image_Disk_Copy_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskCopyOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskCopyOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskCopyOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Copy(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskCopyOutput ** outData); - -// Image_Disk_Copy_DM -typedef struct _vmApiImageDiskCopyDm { - commonOutputFields common; - int operationId; -} vmApiImageDiskCopyDmOutput; - -// Parser table for Image_Disk_Copy_DM -static tableLayout Image_Disk_Copy_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskCopyDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyDmOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCopyDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Copy_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * sourceImageName, char * sourceImageDiskNumber, - char * imageDiskAllocationType, char * allocationAreaName, - char * imageDiskMode, char * readPassword, char * writePassword, - char * multiPassword, vmApiImageDiskCopyDmOutput ** outData); - -// Image_Disk_Create -typedef commonOutputFields vmApiImageDiskCreateOutput; - -// Parser table for Image_Disk_Create -static tableLayout Image_Disk_Create_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskCreateOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskCreateOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, char * imageDiskMode, - vmApiImageDiskCreateOutput ** outData); - -// Image_Disk_Create_DM -typedef struct _vmApiImageDiskCreateDm { - commonOutputFields common; - int operationId; -} vmApiImageDiskCreateDmOutput; - -// Parser table for Image_Disk_Create_DM -static tableLayout Image_Disk_Create_DM_Layout = { - { APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDiskCreateDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateDmOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskCreateDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * imageDiskDeviceType, char * imageDiskAllocationType, - char * allocationAreaNameOrVolser, char allocationUnitSize, - int imageDiskSize, char * imageDiskMode, char imageDiskFormatting, - char * imageDiskLabel, char * readPassword, char * writePassword, - char * multiPassword, vmApiImageDiskCreateDmOutput ** outData); - -// Image_Disk_Delete -typedef commonOutputFields vmApiImageDiskDeleteOutput; - -// Parser table for Image_Disk_Delete -static tableLayout Image_Disk_Delete_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskDeleteOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskDeleteOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskDeleteOutput ** outData); - -// Image_Disk_Delete_DM -typedef struct _vmApiImageDiskDeleteDm { - commonOutputFields common; - int operationId; -} vmApiImageDiskDeleteDmOutput; - -// Parser table for Image_Disk_Delete_DM -static tableLayout Image_Disk_Delete_DM_Layout = { - { APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDiskDeleteDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteDmOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskDeleteDmOutput, operationId) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char dataSecurityErase, vmApiImageDiskDeleteDmOutput ** outData); - -// Image_Disk_Share -typedef commonOutputFields vmApiImageDiskShareOutput; - -// Parser table for Image_Disk_Share -static tableLayout Image_Disk_Share_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskShareOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskShareOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskShareOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskShareOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Share(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - char * readWriteMode, char * optionalPassword, - vmApiImageDiskShareOutput ** outData); - -// Image_Disk_Share_DM -typedef commonOutputFields vmApiImageDiskShareDmOutput; - -// Parser table for Image_Disk_Share_DM -static tableLayout Image_Disk_Share_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskShareDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskShareDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskShareDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskShareDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Share_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - char * readWriteMode, char * optionalPassword, - vmApiImageDiskShareDmOutput ** outData); - -// Image_Disk_Unshare -typedef commonOutputFields vmApiImageDiskUnshareOutput; - -// Parser table for Image_Disk_Unshare -static tableLayout Image_Disk_Unshare_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageDiskUnshareOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskUnshareOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskUnshareOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskUnshareOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Unshare(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskUnshareOutput ** outData); - -// Image_Disk_Unshare_DM -typedef commonOutputFields vmApiImageDiskUnshareDmOutput; - -// Parser table for Image_Disk_Unshare_DM -static tableLayout Image_Disk_Unshare_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageDiskUnshareDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageDiskUnshareDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageDiskUnshareDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageDiskUnshareDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Disk_Unshare_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - vmApiImageDiskUnshareDmOutput ** outData); - -// Image_IPL_Delete_DM -typedef commonOutputFields vmApiImageIplDeleteDmOutput; - -// Parser table for IMAGE_IPL_Delete_DM -static tableLayout Image_IPL_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageIplDeleteDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplDeleteDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_IPL_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageIplDeleteDmOutput ** outData); - -// Image_IPL_Device_Query -typedef struct _vmApiImageIplDeviceQueryOutput { - commonOutputFields common; - char * iplDevice; -} vmApiImageIplDeviceQueryOutput; - -// Parser table for Image_IPL_Device_Query -static tableLayout Image_IPL_Device_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageIplDeviceQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageIplDeviceQueryOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageIplDeviceQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageIplDeviceQueryOutput, - common.reasonCode) }, { APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageIplDeviceQueryOutput, iplDevice) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_IPL_Device_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, vmApiImageIplDeviceQueryOutput ** outData); - -// Image_IPL_Query_DM -typedef struct _vmApiImageIplQueryDm { - commonOutputFields common; - char * savedSystem; - char * loadParameter; - char * parameters; -} vmApiImageIplQueryDmOutput; - -// Parser table for Image_IPL_Query_DM -static tableLayout Image_IPL_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageIplQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, common.reasonCode) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, savedSystem) }, { - APITYPE_STRING_LEN, 0, 10, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, loadParameter) }, { - APITYPE_STRING_LEN, 0, 64, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplQueryDmOutput, parameters) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_IPL_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageIplQueryDmOutput ** outData); - -// Image_IPL_Set_DM -typedef commonOutputFields vmApiImageIplSetDmOutput; - -// Parser table for Image_IPL_Set_DM -static tableLayout Image_IPL_Set_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageIplSetDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageIplSetDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageIplSetDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageIplSetDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_IPL_Set_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * savedSystem, char * loadParameter, - char * parameterString, vmApiImageIplSetDmOutput ** outData); - -// Image_Lock_DM -typedef commonOutputFields vmApiImageLockDmOutput; - -// Parser table for Image_Lock_DM -static tableLayout Image_Lock_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageLockDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageLockDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageLockDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageLockDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Lock_DM(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * deviceAddress, vmApiImageLockDmOutput ** outData); - -// Image_Name_Query_DM -typedef struct _vmApiImageName { // Common structure used by Image_Status_Query - char * imageName; -} vmApiImageName; - -typedef struct _vmApiImageNameQueryDm { - commonOutputFields common; - int nameCount; - vmApiImageName * nameList; -} vmApiImageNameQueryDmOutput; - -// Parser table for Image_Name_Query_DM -static tableLayout Image_Name_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageNameQueryDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageNameQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageNameQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageNameQueryDmOutput, common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageNameQueryDmOutput, nameList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageNameQueryDmOutput, nameCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageName) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiImageName, imageName) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smImage_Name_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageNameQueryDmOutput ** outData); - -// Image_Password_Set_DM -typedef commonOutputFields vmApiImagePasswordSetDmOutput; - -// Parser table for Image_Password_Set_DM -static tableLayout Image_Password_Set_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImagePasswordSetDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImagePasswordSetDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImagePasswordSetDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImagePasswordSetDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Password_Set_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int imagePasswordLength, char * imagePassword, - vmApiImagePasswordSetDmOutput ** outData); - -// Image_Query_Activate_Time -typedef struct _vmApiImageQueryActivateTime { - commonOutputFields common; - char * imageName; - char * activationDate; - char * activationTime; -} vmApiImageQueryActivateTimeOutput; - -// Parser table for Image_Query_Activate_Time -static tableLayout Image_Query_Activate_Time_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageQueryActivateTimeOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, common.reasonCode) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, imageName) }, { - APITYPE_STRING_LEN, 8, 10, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, activationDate) }, { - APITYPE_STRING_LEN, 8, 8, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryActivateTimeOutput, activationTime) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Query_Activate_Time(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char dateFormat, - vmApiImageQueryActivateTimeOutput ** outData); - -// Image_Query_DM -typedef struct _vmApiImageQueryDm { - commonOutputFields common; - int imageRecordCount; - vmApiImageRecord * imageRecordList; -} vmApiImageQueryDmOutput; - -// Parser table for Image_Activate -static tableLayout Image_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryDmOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageQueryDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageQueryDmOutput, imageRecordList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageQueryDmOutput, imageRecordCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageRecord) }, { APITYPE_CHARBUF_LEN, 1, 80, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageRecord, imageRecord) }, - { APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageRecord, imageRecordLength) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smImage_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageQueryDmOutput ** outData, - bool readFromCache); - -// Image_Recycle -typedef struct _vmApiImageRecycle { - commonOutputFields common; - int recycled; - int notRecycled; - int failingArrayCount; - vmApiImageFailing * failList; -} vmApiImageRecycleOutput; - -// Parser table for Image_Recycle -static tableLayout Image_Recycle_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageRecycleOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageRecycleOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageRecycleOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageRecycleOutput, common.reasonCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageRecycleOutput, recycled) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageRecycleOutput, - notRecycled) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageRecycleOutput, failList) }, { APITYPE_ARRAY_STRUCT_COUNT, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageRecycleOutput, - failingArrayCount) }, { APITYPE_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiImageFailing) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, imageName) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageFailing, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageFailing, reasonCode) }, { APITYPE_END_OF_TABLE, 0, 0, - 0, 0 } }; - -int smImage_Recycle(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageRecycleOutput ** outData); - -// Image_Replace_DM -typedef commonOutputFields vmApiImageReplaceDmOutput; - -// Parser table for Image_Replace_DM -static tableLayout Image_Replace_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageReplaceDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageReplaceDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageReplaceDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageReplaceDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int imageRecordArrayCount, - vmApiImageRecord * imageRecordList, - vmApiImageReplaceDmOutput ** outData); - -// Image_SCSI_Characteristics_Define_DM -typedef commonOutputFields vmApiImageScsiCharacteristicsDefineDmOutput; - -// Parser table for Image_SCSI_Characteristics_Define_DM -static tableLayout Image_SCSI_Characteristics_Define_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageScsiCharacteristicsDefineDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsDefineDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsDefineDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsDefineDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_SCSI_Characteristics_Define_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * bootProgram, char * brLba, char * lun, char * portName, - char scpDatatype, int scpDataLength, char * scpData, - vmApiImageScsiCharacteristicsDefineDmOutput ** outData); - -// Image_SCSI_Characteristics_Query_DM -typedef struct _vmApiImageScsiCharacteristicsQueryDm { - commonOutputFields common; - char * bootProgramNumber; - char * br_LBA; - char * lun; - char * port; - char * scpData; - int scpDataLength; -} vmApiImageScsiCharacteristicsQueryDmOutput; - -// Parser table for Image_SCSI_Characteristics_Query_DM -static tableLayout - Image_SCSI_Characteristics_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageScsiCharacteristicsQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - common.reasonCode) }, { APITYPE_STRING_LEN, 0, 6, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - bootProgramNumber) }, { APITYPE_STRING_LEN, 0, 16, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, br_LBA) }, - { APITYPE_STRING_LEN, 0, 16, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageScsiCharacteristicsQueryDmOutput, - lun) }, { APITYPE_STRING_LEN, 0, 16, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - port) }, { APITYPE_CHARBUF_LEN, 0, 4102, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - scpData) }, { APITYPE_CHARBUF_COUNT, 0, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageScsiCharacteristicsQueryDmOutput, - scpDataLength) }, { APITYPE_END_OF_TABLE, 0, 0, - 0, 0 } }; - -int smImage_SCSI_Characteristics_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageScsiCharacteristicsQueryDmOutput ** outData); - -// Image_Status_Query -typedef struct _vmApiImageStatusQuery { - commonOutputFields common; - int imageNameCount; - vmApiImageName * imageNameList; // common structure with Image_Name_Query_DM -} vmApiImageStatusQueryOutput; - -// Parser table for Image_Status_Query -static tableLayout Image_Status_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageStatusQueryOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageStatusQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageStatusQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageStatusQueryOutput, common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageStatusQueryOutput, imageNameList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageStatusQueryOutput, imageNameCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageName) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiImageName, imageName) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smImage_Status_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageStatusQueryOutput ** outData); - -// Image_Unlock_DM -typedef commonOutputFields vmApiImageUnlockDmOutput; - -// Parser table for Image_Unlock_DM -static tableLayout Image_Unlock_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageUnlockDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageUnlockDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageUnlockDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageUnlockDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Unlock_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * deviceAddress, - vmApiImageUnlockDmOutput ** outData); - -// Image_Volume_Add -typedef commonOutputFields vmApiImageVolumeAddOutput; - -// Parser table for Image_Volume_Add -static tableLayout Image_Volume_Add_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageVolumeAddOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeAddOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiImageVolumeAddOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiImageVolumeAddOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Volume_Add(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumer, - char * imageVolumeLabel, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, - vmApiImageVolumeAddOutput ** outData); - -// Image_Volumne_Delete -typedef commonOutputFields vmApiImageVolumeDeleteOutput; - -// Parser table for Image_Volume_Delete -static tableLayout Image_Volume_Delete_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiImageVolumeDeleteOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeDeleteOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Volume_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumer, - char * imageVolumeLabel, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, - vmApiImageVolumeDeleteOutput ** outData); - -// Image_Volume_Space_Define_DM -typedef commonOutputFields vmApiImageVolumeSpaceDefineDmOutput; - -// Parser table for Image_Volume_Space_Define_DM -static tableLayout Image_Volume_Space_Define_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageVolumeSpaceDefineDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceDefineDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceDefineDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceDefineDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Volume_Space_Define_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char functionType, char * regionName, - char * imageVolumeId, int startCyl, int regionSize, char * groupName, - char deviceType, vmApiImageVolumeSpaceDefineDmOutput ** outData); - -// Image_Volume_Space_Query_DM -typedef struct _vmApiImageVolumeSpaceQueryDm { - commonOutputFields common; - int recordCount; - vmApiImageRecord * recordList; // Common structure with Image_Query_DM -} vmApiImageVolumeSpaceQueryDmOutput; - -// Parser table for Image_Volumn_Space_Query_DM -static tableLayout Image_Volume_Space_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageVolumeSpaceQueryDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceQueryDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceQueryDmOutput, recordList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiImageVolumeSpaceQueryDmOutput, recordCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiImageRecord) }, { APITYPE_CHARBUF_LEN, 1, -1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiImageRecord, imageRecord) }, - { APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiImageRecord, imageRecordLength) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smImage_Volume_Space_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char queryType, char entryType, - char * entryNames, vmApiImageVolumeSpaceQueryDmOutput ** outData); - -// Image_Volume_Space_Remove_DM -typedef commonOutputFields vmApiImageVolumeSpaceRemoveDmOutput; - -// Parser table for Image_Volume_Space_Remove_DM -static tableLayout Image_Volume_Space_Remove_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiImageVolumeSpaceRemoveDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceRemoveDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceRemoveDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiImageVolumeSpaceRemoveDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smImage_Volume_Space_Remove_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char functionType, char * regionName, - char * imageVolumeId, char * groupName, - vmApiImageVolumeSpaceRemoveDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiName.h b/zhcp/zhcp-build/resource_access/include/vmapiName.h deleted file mode 100644 index 77a4ea5..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiName.h +++ /dev/null @@ -1,102 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_NAME_H -#define _VMAPI_NAME_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Name_List_Add -typedef commonOutputFields vmApiNameListAddOutput; - -int smName_List_Add(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * name, vmApiNameListAddOutput ** outData); - -// Parser table for Name_List_Add -static tableLayout Name_List_Add_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiNameListAddOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListAddOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListAddOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiNameListAddOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Name_List_Destroy -typedef commonOutputFields vmApiNameListDestroyOutput; - -int smName_List_Destroy(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiNameListDestroyOutput ** outData); - -// Parser table for Name_List_Destroy -static tableLayout Name_List_Destroy_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiNameListDestroyOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListDestroyOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListDestroyOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiNameListDestroyOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Name_List_Query -typedef struct _vmApiNameList { // Common structure for Name_List_Query, - char * imageName; -} vmApiNameList; - -typedef struct _vmApiNameListQuery { - commonOutputFields common; - int nameArrayCount; - vmApiNameList * nameList; -} vmApiNameListQueryOutput; - -int smName_List_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiNameListQueryOutput ** outData); - -// Parser table for Name_List_Query -static tableLayout Name_List_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiNameListQueryOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListQueryOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiNameListQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListQueryOutput, nameList) }, { APITYPE_ARRAY_STRUCT_COUNT, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListQueryOutput, - nameArrayCount) }, { APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiNameList) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiNameList, imageName) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Name_List_Remove -typedef commonOutputFields vmApiNameListRemoveOutput; - -int smName_List_Remove(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * name, - vmApiNameListRemoveOutput ** outData); - -// Parser table for Name_List_Remove -static tableLayout Name_List_Remove_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiNameListRemoveOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiNameListRemoveOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiNameListRemoveOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiNameListRemoveOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiProfile.h b/zhcp/zhcp-build/resource_access/include/vmapiProfile.h deleted file mode 100644 index f8e442f..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiProfile.h +++ /dev/null @@ -1,111 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_PROFILE_H -#define _VMAPI_PROFILE_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Profile_Create_DM -// Common structure to hold one profile record (used on profile_query output, input for Create and Replace) -typedef struct _vmApiProfileRecord { - int profileRecordLength; - char * recordData; -} vmApiProfileRecord; - -typedef commonOutputFields vmApiProfileCreateDmOutput; - -// Parser table for Profile_Create_DM -static tableLayout Profile_Create_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiProfileCreateDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileCreateDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiProfileCreateDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiProfileCreateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smProfile_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int profileRecordCount, - vmApiProfileRecord * profileRecordList, - vmApiProfileCreateDmOutput ** outData); - -// Profile_Delete_DM -typedef commonOutputFields vmApiProfileDeleteDmOutput; - -// Parser table for Profile_Delete_DM -static tableLayout Profile_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiProfileDeleteDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileDeleteDmOutput, requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiProfileDeleteDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiProfileDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smProfile_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiProfileDeleteDmOutput ** outData); - -// Profile_Query_DM -typedef struct _vmApiProfileQueryDmOutput { - commonOutputFields common; - int profileRecordCount; - vmApiProfileRecord * profileRecordList; -} vmApiProfileQueryDmOutput; - -// Parser table for Profile_Query_DM -static tableLayout Profile_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiProfileQueryDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileQueryDmOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiProfileQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiProfileQueryDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileQueryDmOutput, profileRecordList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiProfileQueryDmOutput, profileRecordCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiProfileRecord) }, - { APITYPE_CHARBUF_LEN, 0, 80, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiProfileRecord, recordData) }, { APITYPE_CHARBUF_COUNT, 0, - 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiProfileRecord, - profileRecordLength) }, { APITYPE_END_OF_TABLE, 0, 0, - 0, 0 } }; - -int smProfile_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiProfileQueryDmOutput ** outData); - -// Profile_Replace_DM -typedef commonOutputFields vmApiProfileReplaceDmOutput; - -// Parser table for Profile_Replace_DM -static tableLayout Profile_Replace_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiProfileReplaceDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileReplaceDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileReplaceDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiProfileReplaceDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smProfile_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int profileRecordCount, - vmApiProfileRecord * profileRecordList, - vmApiProfileReplaceDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiPrototype.h b/zhcp/zhcp-build/resource_access/include/vmapiPrototype.h deleted file mode 100644 index 33a9378..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiPrototype.h +++ /dev/null @@ -1,148 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_PROTOTYPE_H -#define _VMAPI_PROTOTYPE_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Prototype_Create_DM -typedef struct _vmApiPrototypeRecordList { // Common structure for Prototype_Query_DM, create, replace - char * recordName; - int recordNameLength; -} vmApiPrototypeRecordList; - -typedef commonOutputFields vmApiPrototypeCreateDmOutput; - -int smPrototype_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int recordArrayCount, - vmApiPrototypeRecordList * recordArrayData, - vmApiPrototypeCreateDmOutput ** outData); - -// Parser table for Prototype_Create_DM -static tableLayout Prototype_Create_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiPrototypeCreateDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeCreateDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeCreateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeCreateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Prototype_Delete_DM -typedef commonOutputFields vmApiPrototypeDeleteDmOutput; - -int smPrototype_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeDeleteDmOutput ** outData); - -// Parser table for Prototype_Delete_DM -static tableLayout Prototype_Delete_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiPrototypeDeleteDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeDeleteDmOutput, requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Prototype_Name_Query_DM -typedef struct _vmApiPrototypeNameList { // Common structure for Prototype_Name_Query_DM, - char * name; -} vmApiPrototypeNameList; - -typedef struct _vmApiPrototypeNameQueryDm { - commonOutputFields common; - int nameArrayCount; - vmApiPrototypeNameList * nameList; -} vmApiPrototypeNameQueryDmOutput; - -int smPrototype_Name_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeNameQueryDmOutput ** outData); - -// Parser table for Prototype_Name_Query_DM -static tableLayout Prototype_Name_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiPrototypeNameQueryDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiPrototypeNameQueryDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiPrototypeNameQueryDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiPrototypeNameQueryDmOutput, - common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeNameQueryDmOutput, nameList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiPrototypeNameQueryDmOutput, nameArrayCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiPrototypeNameList) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiPrototypeNameList, name) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Prototype_Query_DM -typedef struct _vmApiPrototypeQueryDm { - commonOutputFields common; - int recordArrayCount; - vmApiPrototypeRecordList * recordList; -} vmApiPrototypeQueryDmOutput; - -int smPrototype_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeQueryDmOutput ** outData); - -// Parser table for Prototype_Query_DM -static tableLayout Prototype_Query_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiPrototypeQueryDmOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeQueryDmOutput, common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeQueryDmOutput, recordList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiPrototypeQueryDmOutput, recordArrayCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiPrototypeRecordList) }, { APITYPE_CHARBUF_LEN, 1, - 72, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiPrototypeRecordList, recordName) }, { - APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiPrototypeRecordList, recordNameLength) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Prototype_Replace_DM -typedef commonOutputFields vmApiPrototypeReplaceDmOutput; - -int smPrototype_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int recordArrayCount, - vmApiPrototypeRecordList * recordArrayData, - vmApiPrototypeReplaceDmOutput ** outData); - -// Parser table for Prototype_Replace_DM -static tableLayout Prototype_Replace_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiPrototypeReplaceDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiPrototypeReplaceDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiPrototypeReplaceDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiPrototypeReplaceDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiQuery.h b/zhcp/zhcp-build/resource_access/include/vmapiQuery.h deleted file mode 100644 index a7f7fe4..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiQuery.h +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_QUERY_H -#define _VMAPI_QUERY_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Query_API_Functional_Level -typedef commonOutputFields vmApiQueryApiFunctionalLevelOutput; - -int smQuery_API_Functional_Level(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiQueryApiFunctionalLevelOutput ** outData); - -// Parser table for Query_API_Functional_Level -static tableLayout Query_API_Functional_Level_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiQueryApiFunctionalLevelOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryApiFunctionalLevelOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryApiFunctionalLevelOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryApiFunctionalLevelOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Query_Asychronous_Operation_DM -typedef commonOutputFields vmApiQueryAsynchronousOperationDmOutput; - -int smQuery_Asychronous_Operation_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - int operationId, vmApiQueryAsynchronousOperationDmOutput ** outData); - -// Parser table for Query_Asychronous_Operation_DM -static tableLayout Query_Asynchronous_Operation_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiQueryAsynchronousOperationDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryAsynchronousOperationDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryAsynchronousOperationDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryAsynchronousOperationDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Query_Directory_Manager_Level_DM -typedef struct _vmApiQueryDirectoryManagerLevelDm { - commonOutputFields common; - char * directoryManagerLevel; - int directoryManagerLevelLength; -} vmApiQueryDirectoryManagerLevelDmOutput; - -// Parser table for Query_Directory_Manager_Level_DM -static tableLayout - Query_Directory_Manager_Level_DM_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiQueryDirectoryManagerLevelDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - common.reasonCode) }, { APITYPE_CHARBUF_LEN, 1, 100, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - directoryManagerLevel) }, { APITYPE_CHARBUF_COUNT, 1, - 100, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiQueryDirectoryManagerLevelDmOutput, - directoryManagerLevelLength) }, { APITYPE_END_OF_TABLE, - 0, 0, 0, 0 } }; - -int smQuery_Directory_Manager_Level_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiQueryDirectoryManagerLevelDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiShared.h b/zhcp/zhcp-build/resource_access/include/vmapiShared.h deleted file mode 100644 index 767ea0f..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiShared.h +++ /dev/null @@ -1,214 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_SHARED_H -#define _VMAPI_SHARED_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Shared_Memory_Access_Add_DM -typedef commonOutputFields vmApiSharedMemoryAccessAddDmOutput; - -// Parser table for Shared_Memory_Access_Add_DM -static tableLayout Shared_Memory_Access_Add_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryAccessAddDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessAddDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessAddDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessAddDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smShared_Memory_Access_Add_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryAccessAddDmOutput ** outData); - -// Shared_Memory_Access_Query_DM -typedef struct _vmApiSharedMemorySegmentName { // Common structure used by Shared_Memory_Access_Query - char * memorySegmentName; -} vmApiSharedMemorySegmentName; - -typedef struct _vmApiSharedMemoryAccessQueryDm { - commonOutputFields common; - int memorySegmentNameCount; - vmApiSharedMemorySegmentName * memorySegmentNameList; -} vmApiSharedMemoryAccessQueryDmOutput; - -// Parser table for Shared_Memory_Access_Query_DM -static tableLayout Shared_Memory_Access_Query_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryAccessQueryDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessQueryDmOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessQueryDmOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessQueryDmOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessQueryDmOutput, memorySegmentNameList) }, - { APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSharedMemoryAccessQueryDmOutput, - memorySegmentNameCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiSharedMemorySegmentName) }, { APITYPE_STRING_LEN, - 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiSharedMemorySegmentName, memorySegmentName) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smShared_Memory_Access_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * memorySegmentName, - vmApiSharedMemoryAccessQueryDmOutput ** outData); - -// Shared_Memory_Access_Remove_DM -typedef commonOutputFields vmApiSharedMemoryAccessRemoveDmOutput; - -// Parser table for Shared_Memory_Access_Remove_DM -static tableLayout Shared_Memory_Access_Remove_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryAccessRemoveDmOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessRemoveDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessRemoveDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryAccessRemoveDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smShared_Memory_Access_Remove_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * memorySegmentName, - vmApiSharedMemoryAccessRemoveDmOutput ** outData); - -// Shared_Memory_Create -typedef commonOutputFields vmApiSharedMemoryCreateOutput; - -// Parser table for Shared_Memory_Create -static tableLayout Shared_Memory_Create_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryCreateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSharedMemoryCreateOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiSharedMemoryCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int - smShared_Memory_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - unsigned long long beginPage, unsigned long long endPage, - char pageAccessDescriptor, char memoryAttributes, - char * memoryAccessIdentifier, - vmApiSharedMemoryCreateOutput ** outData); - -// Shared_Memory_Delete -typedef commonOutputFields vmApiSharedMemoryDeleteOutput; - -// Parser table for Shared_Memory_Delete -static tableLayout Shared_Memory_Delete_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryDeleteOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSharedMemoryDeleteOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiSharedMemoryDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smShared_Memory_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryDeleteOutput ** outData); - -// Shared_Memory_Query -typedef struct _vmApiSharedPageRangeInfo { - unsigned long long beginPage; - unsigned long long endPage; - char pageAccessDescriptor; -} vmApiSharedPageRangeInfo; - -typedef struct _vmApiSharedMemorySegmentInfo { - char * memorySegmentName; - char memorySegmentStatus; - int pageRangeCount; - vmApiSharedPageRangeInfo * pageRangeList; -} vmApiSharedMemorySegmentInfo; - -typedef struct _vmApiSharedMemoryQueryOutput { - commonOutputFields common; - int memorySegmentCount; - vmApiSharedMemorySegmentInfo * memorySegmentInfoList; -} vmApiSharedMemoryQueryOutput; - -// Parser table for Shared_Memory_Query -static tableLayout Shared_Memory_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiSharedMemoryQueryOutput) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryQueryOutput, common.reasonCode) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryQueryOutput, memorySegmentInfoList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSharedMemoryQueryOutput, memorySegmentCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiSharedMemorySegmentInfo) }, { APITYPE_STRING_LEN, - 1, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiSharedMemorySegmentInfo, memorySegmentName) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiSharedMemorySegmentInfo, memorySegmentStatus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiSharedMemorySegmentInfo, pageRangeList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiSharedMemorySegmentInfo, pageRangeCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_2, NEST_LEVEL_2, - sizeof(vmApiSharedPageRangeInfo) }, { APITYPE_INT8, 8, 8, - STRUCT_INDX_2, NEST_LEVEL_2, offsetof(vmApiSharedPageRangeInfo, - beginPage) }, { APITYPE_INT8, 8, 8, STRUCT_INDX_2, - NEST_LEVEL_2, offsetof(vmApiSharedPageRangeInfo, endPage) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_2, NEST_LEVEL_2, offsetof( - vmApiSharedPageRangeInfo, pageAccessDescriptor) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smShared_Memory_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryQueryOutput ** outData); - -// Shared_Memory_Replace -typedef commonOutputFields vmApiSharedMemoryReplaceOutput; - -// Parser table for Shared_Memory_Replace -static tableLayout Shared_Memory_Replace_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiSharedMemoryReplaceOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSharedMemoryReplaceOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiSharedMemoryReplaceOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSharedMemoryReplaceOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smShared_Memory_Replace(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - char * memoryAccessIdentifier, - vmApiSharedMemoryReplaceOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiStatic.h b/zhcp/zhcp-build/resource_access/include/vmapiStatic.h deleted file mode 100644 index b26ef4f..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiStatic.h +++ /dev/null @@ -1,74 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_STATIC_H -#define _VMAPI_STATIC_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Static_Image_Changes_Activate_DM -typedef commonOutputFields vmApiStaticImageChangesActivateDmOutput; - -// Parser table for Static_Image_Changes_Activate_DM -static tableLayout Static_Image_Changes_Activate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiStaticImageChangesActivateDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesActivateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesActivateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesActivateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smStatic_Image_Changes_Activate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesActivateDmOutput ** outData); - -// Static_Image_Changes_Deactivate_DM -typedef commonOutputFields vmApiStaticImageChangesDeactivateDmOutput; - -// Parser table for Static_Image_Changes_Deactivate_DM -static tableLayout Static_Image_Changes_Deactivate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiStaticImageChangesDeactivateDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesDeactivateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesDeactivateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesDeactivateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smStatic_Image_Changes_Deactivate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesDeactivateDmOutput ** outData); - -// Static_Image_Changes_Immediate_DM -typedef commonOutputFields vmApiStaticImageChangesImmediateDmOutput; - -// Parser table for Static_Image_Changes_Immediate_DM -static tableLayout Static_Image_Changes_Immediate_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiStaticImageChangesImmediateDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesImmediateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesImmediateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiStaticImageChangesImmediateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smStatic_Image_Changes_Immediate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesImmediateDmOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiSystem.h b/zhcp/zhcp-build/resource_access/include/vmapiSystem.h deleted file mode 100644 index 0b550c7..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiSystem.h +++ /dev/null @@ -1,115 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_SYSTEM_H -#define _VMAPI_SYSTEM_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// IPaddr_Get -// This is here because it is VM related vs userid related -typedef struct _vmApiIPAddr_GetOutput { - commonOutputFields common; - int ipCount; - vmApiCStringInfo * ipList; // should only be one item in the list -} vmApiIPaddrGetOutput; - -// Parser table for IPaddr_Get -static tableLayout IPaddr_Get_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiIPaddrGetOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiIPaddrGetOutput, common.requestId) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiIPaddrGetOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiIPaddrGetOutput, common.reasonCode) }, - -{ APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiIPaddrGetOutput, ipList) }, { APITYPE_C_STR_ARRAY_COUNT, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiIPaddrGetOutput, ipCount) }, - { APITYPE_C_STR_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiCStringInfo) }, { APITYPE_C_STR_PTR, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiCStringInfo, - vmapiString) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smIPaddr_Get(struct _VmApiInternalContext* vmapiContextP, - vmApiIPaddrGetOutput ** outData); - -// System_Info_Query -typedef struct _vmApiSystemInfoQueryOutput { - commonOutputFields common; - char * timezone; - char * time; - char * vmVersion; - char * cpGenTime; - char * cpIplTime; - char * realStorageSize; -} vmApiSystemInfoQueryOutput; - -// Parser table for Virtual_Network_Query_OSA -static tableLayout System_Info_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiSystemInfoQueryOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, common.reasonCode) }, - -{ APITYPE_C_STR_PTR, 4, 43, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, timezone) }, - { APITYPE_C_STR_PTR, 4, 43, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, time) }, { APITYPE_C_STR_PTR, 4, - 80, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemInfoQueryOutput, vmVersion) }, { - APITYPE_C_STR_PTR, 4, 43, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSystemInfoQueryOutput, cpGenTime) }, { - APITYPE_C_STR_PTR, 4, 43, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSystemInfoQueryOutput, cpIplTime) }, { - APITYPE_C_STR_PTR, 4, 80, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiSystemInfoQueryOutput, realStorageSize) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smSystem_Info_Query(struct _VmApiInternalContext* vmapiContextP, - vmApiSystemInfoQueryOutput ** outData); - -// System_IO_Query -typedef struct _vmApiSystemIoQueryOutput { - commonOutputFields common; - int chipidCount; - vmApiCStringInfo * chipidList; -} vmApiSystemIoQueryOutput; - -// Parser table for Virtual_Network_Query_OSA -static tableLayout System_IO_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, sizeof(vmApiSystemIoQueryOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemIoQueryOutput, common.requestId) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSystemIoQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiSystemIoQueryOutput, common.reasonCode) }, - -{ APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiSystemIoQueryOutput, chipidList) }, { APITYPE_C_STR_ARRAY_COUNT, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiSystemIoQueryOutput, - chipidCount) }, { APITYPE_C_STR_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiCStringInfo) }, { - APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiCStringInfo, vmapiString) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smSystem_IO_Query(struct _VmApiInternalContext* vmapiContextP, - char * realDeviceAddress, vmApiSystemIoQueryOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiVMRM.h b/zhcp/zhcp-build/resource_access/include/vmapiVMRM.h deleted file mode 100644 index eaa3b6e..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiVMRM.h +++ /dev/null @@ -1,137 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_VMRM_H -#define _VMAPI_VMRM_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// VMRM_Configuration_Query -typedef struct _vmApiVmrmConfigurationQuery { - commonOutputFields common; - char * configurationFile; - int configurationFileLength; -} vmApiVmrmConfigurationQueryOutput; - -// Parser table for VMRM_Configuration_Query -static tableLayout VMRM_Configuration_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVmrmConfigurationQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, common.reasonCode) }, { - APITYPE_CHARBUF_LEN, 1, -1, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, configurationFile) }, { - APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationQueryOutput, configurationFileLength) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVMRM_Configuration_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * configurationFileName, - char * configurationFileType, char * configurationDirName, - vmApiVmrmConfigurationQueryOutput ** outData); - -// VMRM_Configuration_Update -typedef struct _vmApiVmrmConfigurationLogRecordInfo { - char * logRecord; - int logRecordLength; -} vmApiVmrmConfigurationLogRecordInfo; - -typedef struct _vmApiVmrmConfigurationUpdateOutput { - commonOutputFields common; - int logRecordCount; - vmApiVmrmConfigurationLogRecordInfo * logRecordInfoList; -} vmApiVmrmConfigurationUpdateOutput; - -// Parser table for VMRM_Configuration_Update -static tableLayout VMRM_Configuration_Update_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVmrmConfigurationUpdateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationUpdateOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationUpdateOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationUpdateOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmConfigurationUpdateOutput, logRecordInfoList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVmrmConfigurationUpdateOutput, logRecordCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVmrmConfigurationLogRecordInfo) }, { APITYPE_CHARBUF_LEN, - 1, -1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVmrmConfigurationLogRecordInfo, logRecord) }, { - APITYPE_CHARBUF_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVmrmConfigurationLogRecordInfo, logRecordLength) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVMRM_Configuration_Update(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * configurationFileName, - char * configurationFileType, char * configurationDirName, - char syncheckOnly, int updateFileLength, char * updateFile, - vmApiVmrmConfigurationUpdateOutput ** outData); - -// VMRM_Measurement_Query -typedef struct _vmApiVmrmMeasurementQueryWorkloadInfo { - char * workloadRecord; - int workloadRecordLength; -} vmApiVmrmMeasurementQueryWorkloadInfo; - -typedef struct _vmApiVmrmMeasurementQueryOutput { - commonOutputFields common; - char * queryTimestamp; - char * fileName; - char * fileTimestamp; - int workloadCount; - vmApiVmrmMeasurementQueryWorkloadInfo * workloadInfoList; -} vmApiVmrmMeasurementQueryOutput; - -// Parser table for VMRM_Measurement_Query -static tableLayout VMRM_Measurement_Query_Layout = { { APITYPE_BASE_STRUCT_LEN, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVmrmMeasurementQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, - common.requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, - common.returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, - common.reasonCode) }, { APITYPE_STRING_LEN, 1, 17, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, - queryTimestamp) }, { APITYPE_STRING_LEN, 1, 20, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof(vmApiVmrmMeasurementQueryOutput, fileName) }, { - APITYPE_STRING_LEN, 1, 17, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmMeasurementQueryOutput, fileTimestamp) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVmrmMeasurementQueryOutput, workloadInfoList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVmrmMeasurementQueryOutput, workloadCount) }, { - APITYPE_NOBUFFER_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVmrmMeasurementQueryWorkloadInfo) }, { APITYPE_CHARBUF_LEN, - 1, 35, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVmrmMeasurementQueryWorkloadInfo, workloadRecord) }, { - APITYPE_CHARBUF_COUNT, 1, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVmrmMeasurementQueryWorkloadInfo, workloadRecordLength) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVMRM_Measurement_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiVmrmMeasurementQueryOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/vmapiVirtual.h b/zhcp/zhcp-build/resource_access/include/vmapiVirtual.h deleted file mode 100644 index 1739b36..0000000 --- a/zhcp/zhcp-build/resource_access/include/vmapiVirtual.h +++ /dev/null @@ -1,782 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#ifndef _VMAPI_VIRTUAL_H -#define _VMAPI_VIRTUAL_H -#include "smPublic.h" -#include "smapiTableParser.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Virtual_Channel_Connection_Create -typedef commonOutputFields vmApiVirtualChannelConnectionCreateOutput; - -// Parser table for Virtual_Channel_Connection_Create -static tableLayout Virtual_Channel_Connection_Create_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualChannelConnectionCreateOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Channel_Connection_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * coupledImageName, - char * coupledImageDeviceNumber, - vmApiVirtualChannelConnectionCreateOutput ** outData); - -// Virtual_Channel_Connection_Create_DM -typedef commonOutputFields vmApiVirtualChannelConnectionCreateDmOutput; - -// Parser table for Virtual_Channel_Connection_Create_DM -static tableLayout Virtual_Channel_Connection_Create_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualChannelConnectionCreateDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionCreateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Channel_Connection_Create_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * coupledImageName, - vmApiVirtualChannelConnectionCreateDmOutput ** outData); - -// Virtual_Channel_Connection_Delete -typedef commonOutputFields vmApiVirtualChannelConnectionDeleteOutput; - -// Parser table for Virtual_Memory_Access_Add_DM -static tableLayout Virtual_Channel_Connection_Delete_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualChannelConnectionDeleteOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Channel_Connection_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualChannelConnectionDeleteOutput ** outData); - -// Virtual_Channel_Connection_Delete_DM -typedef commonOutputFields vmApiVirtualChannelConnectionDeleteDmOutput; - -// Parser table for Virtual_Channel_Connection_Delete_DM -static tableLayout Virtual_Channel_Connection_Delete_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualChannelConnectionDeleteDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualChannelConnectionDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Channel_Connection_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualChannelConnectionDeleteDmOutput ** outData); - -// Virtual_Network_Adapter_Connect_LAN -typedef commonOutputFields vmApiVirtualNetworkAdapterConnectLanOutput; - -// Parser table for Virtual_Network_Adapter_Connect_LAN -static tableLayout Virtual_Network_Adapter_Connect_LAN_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterConnectLanOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Connect_LAN( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * lanName, char * lanOwner, - vmApiVirtualNetworkAdapterConnectLanOutput ** outData); - -// Virtual_Network_Adapter_Connect_LAN_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterConnectLanDmOutput; - -// Parser table for Virtual_Network_Adapter_Connect_LAN_DM -static tableLayout Virtual_Network_Adapter_Connect_LAN_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterConnectLanDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectLanDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Connect_LAN_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * lanName, char * lanOwner, - vmApiVirtualNetworkAdapterConnectLanDmOutput ** outData); - -// Virtual_Network_Adapter_Connect_Vswitch -typedef commonOutputFields vmApiVirtualNetworkAdapterConnectVswitchOutput; - -// Parser table for Virtual_Network_Adapter_Connect_Vswitch -static tableLayout Virtual_Network_Adapter_Connect_Vswitch_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterConnectVswitchOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchOutput, returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchOutput, reasonCode) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Connect_Vswitch( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * switchName, - vmApiVirtualNetworkAdapterConnectVswitchOutput ** outData); - -// Virtual_Network_Adapter_Connect_Vswitch_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterConnectVswitchDmOutput; - -// Parser table for Virtual_Network_Adapter_Connect_Vswitch_DM -static tableLayout - Virtual_Network_Adapter_Connect_Vswitch_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterConnectVswitchDmOutput) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchDmOutput, - requestId) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchDmOutput, - returnCode) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_0, - NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterConnectVswitchDmOutput, - reasonCode) }, { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Connect_Vswitch_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * switchName, - vmApiVirtualNetworkAdapterConnectVswitchDmOutput ** outData); - -// Virtual_Network_Adapter_Create -typedef commonOutputFields vmApiVirtualNetworkAdapterCreateOutput; - -// Parser table for Virtual_Network_Adapter_Create -static tableLayout Virtual_Network_Adapter_Create_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterCreateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int - smVirtual_Network_Adapter_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char adapterType, - int networkAdapterDevices, char * channelPathId, - vmApiVirtualNetworkAdapterCreateOutput ** outData); - -// Virtual_Network_Adapter_Create_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterCreateDmOutput; - -// Parser table for Virtual_Network_Adapter_Create_DM -static tableLayout Virtual_Network_Adapter_Create_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterCreateDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterCreateDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Create_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char adapterType, int networkAdapterDevices, - char * channelPathId, char * macId, - vmApiVirtualNetworkAdapterCreateDmOutput ** outData); - -// Virtual_Network_Adapter_Delete -typedef commonOutputFields vmApiVirtualNetworkAdapterDeleteOutput; - -// Parser table for Virtual_Network_Adapter_Delete -static tableLayout Virtual_Network_Adapter_Delete_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterDeleteOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDeleteOutput ** outData); - -// Virtual_Network_Adapter_Delete_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterDeleteDmOutput; - -// Parser table for Virtual_Network_Adapter_Delete_DM -static tableLayout Virtual_Network_Adapter_Delete_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterDeleteDmOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDeleteDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDeleteDmOutput ** outData); - -// Virtual_Network_Adapter_Disconnect -typedef commonOutputFields vmApiVirtualNetworkAdapterDisconnectOutput; - -// Parser table for Virtual_Network_Adapter_Disconnect -static tableLayout Virtual_Network_Adapter_Disconnect_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterDisconnectOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Disconnect( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDisconnectOutput ** outData); - -// Virtual_Network_Adapter_Disconnect_DM -typedef commonOutputFields vmApiVirtualNetworkAdapterDisconnectDmOutput; - -// Parser table for Virtual_Network_Adapter_Disconnect_DM -static tableLayout Virtual_Network_Adapter_Disconnect_DM_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterDisconnectDmOutput) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectDmOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectDmOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterDisconnectDmOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Adapter_Disconnect_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDisconnectDmOutput ** outData); - -// Virtual_Network_Adapter_Query -typedef struct _vmApiVirtualNetworkAdapter { - char * imageDeviceNumber; - char adapterType; - int networkAdapterDevices; - char adapterStatus; - char * lanOwner; - char * lanName; -} vmApiVirtualNetworkAdapter; - -typedef struct _vmApiVirtualNetworkAdapterQueryOutput { - commonOutputFields common; - int adapterArrayCount; - vmApiVirtualNetworkAdapter * adapterList; -} vmApiVirtualNetworkAdapterQueryOutput; - -int smVirtual_Network_Adapter_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterQueryOutput ** outData); - -// Parser table for Virtual_Network_Adapter_Query -static tableLayout Virtual_Network_Adapter_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkAdapterQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkAdapterQueryOutput, adapterList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVirtualNetworkAdapterQueryOutput, adapterArrayCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVirtualNetworkAdapter) }, { APITYPE_STRING_LEN, 1, 4, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVirtualNetworkAdapter, - imageDeviceNumber) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVirtualNetworkAdapter, adapterType) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkAdapter, networkAdapterDevices) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkAdapter, adapterStatus) }, { - APITYPE_STRING_LEN, 0, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkAdapter, lanOwner) }, { APITYPE_STRING_LEN, - 0, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVirtualNetworkAdapter, - lanName) }, { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -// Virtual_Network_LAN_Access -typedef commonOutputFields vmApiVirtualNetworkLanAccessOutput; - -// Parser table for Virtual_Network_LAN_Access -static tableLayout Virtual_Network_LAN_Access_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanAccessOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_LAN_Access(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - char * accessOption, char * accessGrantName, char * promiscuity, - vmApiVirtualNetworkLanAccessOutput ** outData); - -// Virtual_Network_LAN_Access_Query -typedef struct _vmApiVirtualNetworkLanAccessQueryOutput { - commonOutputFields common; - int lanAccessCount; - vmApiCStringInfo * lanAccessList; -} vmApiVirtualNetworkLanAccessQueryOutput; - -// Parser table for Virtual_Network_LANAccess_Query -static tableLayout Virtual_Network_LAN_Access_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanAccessQueryOutput) }, { APITYPE_INT4, 4, - 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessQueryOutput, common.returnCode) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessQueryOutput, common.reasonCode) }, - - { APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanAccessQueryOutput, lanAccessList) }, { - APITYPE_C_STR_ARRAY_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVirtualNetworkLanAccessQueryOutput, - lanAccessCount) }, { APITYPE_C_STR_STRUCT_LEN, 4, 4, - STRUCT_INDX_1, NEST_LEVEL_1, sizeof(vmApiCStringInfo) }, { - APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiCStringInfo, vmapiString) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_LAN_Access_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * lanName, char * lanOwner, - vmApiVirtualNetworkLanAccessQueryOutput ** outData); - -// Virtual_Network_LAN_Create -typedef commonOutputFields vmApiVirtualNetworkLanCreateOutput; - -// Parser table for Virtual_Network_LAN_Create -static tableLayout Virtual_Network_LAN_Create_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanCreateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanCreateOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_LAN_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, char lanType,//1,2,3,4 - char transportType, vmApiVirtualNetworkLanCreateOutput ** outData); - -// Virtual_Network_LAN_Delete -typedef commonOutputFields vmApiVirtualNetworkLanDeleteOutput; - -// Parser table for Virtual_Network_LAN_Delete -static tableLayout Virtual_Network_LAN_Delete_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanDeleteOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanDeleteOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_LAN_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - vmApiVirtualNetworkLanDeleteOutput ** outData); - -// Virtual_Network_LAN_Query -typedef struct _vmApiVirtualNetworkConnectedAdapterInfo { // Common structure with Virtual Network Vswitch Query - char * adapterOwner; - char * imageDeviceNumber; -} vmApiVirtualNetworkConnectedAdapterInfo; - -typedef struct _vmApiVirtualNetworkLanInfo { - char * lanName; - char * lanOwner; - char lanType; - int connectedAdapterCount; - vmApiVirtualNetworkConnectedAdapterInfo * connectedAdapterList; -} vmApiVirtualNetworkLanInfo; - -typedef struct _vmApiVirtualNetworkLanQueryOutput { - commonOutputFields common; - int lanCount; - vmApiVirtualNetworkLanInfo * lanList; -} vmApiVirtualNetworkLanQueryOutput; - -// Parser table for Virtual_Network_LAN_Query -static tableLayout Virtual_Network_LAN_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkLanQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkLanQueryOutput, lanList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVirtualNetworkLanQueryOutput, lanCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVirtualNetworkLanInfo) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVirtualNetworkLanInfo, - lanName) }, { APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVirtualNetworkLanInfo, lanOwner) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkLanInfo, lanType) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVirtualNetworkLanInfo, connectedAdapterList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiVirtualNetworkLanInfo, connectedAdapterCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_2, NEST_LEVEL_2, - sizeof(vmApiVirtualNetworkConnectedAdapterInfo) }, { - APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_2, NEST_LEVEL_2, offsetof( - vmApiVirtualNetworkConnectedAdapterInfo, adapterOwner) }, { - APITYPE_STRING_LEN, 1, 4, STRUCT_INDX_2, NEST_LEVEL_2, offsetof( - vmApiVirtualNetworkConnectedAdapterInfo, imageDeviceNumber) }, - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_LAN_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - vmApiVirtualNetworkLanQueryOutput ** outData); - -// Virtual_Network_Query_LAN -typedef struct _vmApiVirtualNetworkQueryLanOutput { - commonOutputFields common; - int lanCount; - vmApiCStringInfo * lanList; -} vmApiVirtualNetworkQueryLanOutput; - -// Parser table for Virtual_Network_Query_LAN -static tableLayout Virtual_Network_Query_LAN_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkQueryLanOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, common.reasonCode) }, - -{ APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, lanList) }, { - APITYPE_C_STR_ARRAY_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryLanOutput, lanCount) }, { - APITYPE_C_STR_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiCStringInfo) }, { APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiCStringInfo, vmapiString) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_Query_LAN(struct _VmApiInternalContext* vmapiContextP, - vmApiVirtualNetworkQueryLanOutput ** outData); - -// Virtual_Network_Query_OSA -typedef struct _vmApiVirtualNetworkQueryOsaOutput { - commonOutputFields common; - int osaCount; - vmApiCStringInfo * osaList; -} vmApiVirtualNetworkQueryOsaOutput; - -// Parser table for Virtual_Network_Query_OSA -static tableLayout Virtual_Network_Query_OSA_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkQueryOsaOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, common.reasonCode) }, - -{ APITYPE_C_STR_ARRAY_PTR, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, osaList) }, { - APITYPE_C_STR_ARRAY_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkQueryOsaOutput, osaCount) }, { - APITYPE_C_STR_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiCStringInfo) }, { APITYPE_C_STR_PTR, 4, 4, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiCStringInfo, vmapiString) }, - -{ APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_Query_OSA(struct _VmApiInternalContext* vmapiContextP, - vmApiVirtualNetworkQueryOsaOutput ** outData); - -// Virtual_Network_Vswitch_Create -typedef commonOutputFields vmApiVirtualNetworkVswitchCreateOutput; - -// Parser table for Virtual_Network_Vswitch_Create -static tableLayout Virtual_Network_Vswitch_Create_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkVswitchCreateOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchCreateOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchCreateOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchCreateOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Vswitch_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, char * realDeviceAddress, char * portName, - char * controllerName, char connectionValue, int queueMemoryLimit, - char routingValue, char transportType, int vlanId, char portType, - char updateSystemConfigIndicator, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, char gvrpValue, - int nativeVlanId, vmApiVirtualNetworkVswitchCreateOutput ** outData); - -// Virtual_Network_Vswitch_Delete -typedef commonOutputFields vmApiVirtualNetworkVswitchDeleteOutput; - -// Parser table for Virtual_Network_Vswitch_Delete -static tableLayout Virtual_Network_Vswitch_Delete_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkVswitchDeleteOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchDeleteOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchDeleteOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchDeleteOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Vswitch_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, char updateSystemConfigIndicator, - char * systemConfigName, char * systemConfigType, char * parmDiskOwner, - char * parmDiskNumber, char * parmDiskPassword, - char * altSystemConfigName, char * altSystemConfigType, - char * altParmDiskOwner, char * altParmDiskNumber, - char * altParmDiskPassword, - vmApiVirtualNetworkVswitchDeleteOutput ** outData); - -// Virtual_Network_Vswitch_Query -typedef struct _vmApiConnectedAdapterInfo { - int userVlanId; -} vmApiVlanInfo; - -typedef struct _vmApiAuthorizedUserInfo { - char * grantUserid; - int vlanCount; - vmApiVlanInfo * vlanList; -} vmApiAuthorizedUserInfo; - -typedef struct _vmApiRealDeviceInfo { - int realDeviceAddress; - char * controllerName; - char * portName; - char deviceStatus; - char deviceErrorStatus; -} vmApiRealDeviceInfo; - -typedef struct _vmApiVswitchInfo { - char * switchName; - char transportType; - char portType; - int queueMemoryLimit; - char routingValue; - int vlanId; - int nativeVlanId; - unsigned long long macId; - char grvpRequestAttribute; - char grvpEnabledAttribute; - char switchStatus; - int realDeviceCount; - vmApiRealDeviceInfo * realDeviceList; - int authorizedUserCount; - vmApiAuthorizedUserInfo * authorizedUserList; - int connectedAdapterCount; - vmApiVirtualNetworkConnectedAdapterInfo * connectedAdapterList; // Shares common structure with Virtual network lan query -} vmApiVswitchInfo; - -typedef struct _vmApiVirtualNetworkVswitchQueryOutput { - commonOutputFields common; - int vswitchCount; - vmApiVswitchInfo * vswitchList; -} vmApiVirtualNetworkVswitchQueryOutput; - -// Parser table for Virtual_Network_Vswitch_Query -static tableLayout Virtual_Network_Vswitch_Query_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkVswitchQueryOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchQueryOutput, common.requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchQueryOutput, common.returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchQueryOutput, common.reasonCode) }, - -{ APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchQueryOutput, vswitchList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - offsetof(vmApiVirtualNetworkVswitchQueryOutput, vswitchCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - sizeof(vmApiVswitchInfo) }, { APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVswitchInfo, switchName) }, { APITYPE_INT1, - 1, 1, STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - transportType) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVswitchInfo, portType) }, { APITYPE_INT4, - 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - queueMemoryLimit) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_1, - NEST_LEVEL_1, offsetof(vmApiVswitchInfo, routingValue) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, vlanId) }, - { APITYPE_INT4, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, nativeVlanId) }, - { APITYPE_INT8, 8, 8, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, macId) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - grvpRequestAttribute) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - grvpEnabledAttribute) }, { APITYPE_INT1, 1, 1, - STRUCT_INDX_1, NEST_LEVEL_1, offsetof(vmApiVswitchInfo, - switchStatus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, realDeviceList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiVswitchInfo, realDeviceCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_2, NEST_LEVEL_2, - sizeof(vmApiRealDeviceInfo) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_2, NEST_LEVEL_2, offsetof(vmApiRealDeviceInfo, - realDeviceAddress) }, { APITYPE_STRING_LEN, 0, 71, - STRUCT_INDX_2, NEST_LEVEL_2, offsetof(vmApiRealDeviceInfo, - controllerName) }, { APITYPE_STRING_LEN, 0, 16, - STRUCT_INDX_2, NEST_LEVEL_2, offsetof(vmApiRealDeviceInfo, - portName) }, { APITYPE_INT1, 1, 1, STRUCT_INDX_2, - NEST_LEVEL_2, offsetof(vmApiRealDeviceInfo, deviceStatus) }, { - APITYPE_INT1, 1, 1, STRUCT_INDX_2, NEST_LEVEL_2, offsetof( - vmApiRealDeviceInfo, deviceErrorStatus) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, authorizedUserList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiVswitchInfo, authorizedUserCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_3, NEST_LEVEL_2, - sizeof(vmApiAuthorizedUserInfo) }, { APITYPE_STRING_LEN, 1, 8, - STRUCT_INDX_3, NEST_LEVEL_2, offsetof(vmApiAuthorizedUserInfo, - grantUserid) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_3, NEST_LEVEL_2, offsetof( - vmApiAuthorizedUserInfo, vlanList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_3, NEST_LEVEL_2, - offsetof(vmApiAuthorizedUserInfo, vlanCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_4, NEST_LEVEL_3, - sizeof(vmApiVlanInfo) }, { APITYPE_INT4, 4, 4, STRUCT_INDX_4, - NEST_LEVEL_3, offsetof(vmApiVlanInfo, userVlanId) }, - - { APITYPE_ARRAY_LEN, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, offsetof( - vmApiVswitchInfo, connectedAdapterList) }, { - APITYPE_ARRAY_STRUCT_COUNT, 4, 4, STRUCT_INDX_1, NEST_LEVEL_1, - offsetof(vmApiVswitchInfo, connectedAdapterCount) }, { - APITYPE_STRUCT_LEN, 4, 4, STRUCT_INDX_5, NEST_LEVEL_2, - sizeof(vmApiVirtualNetworkConnectedAdapterInfo) }, - { APITYPE_STRING_LEN, 1, 8, STRUCT_INDX_5, NEST_LEVEL_2, offsetof( - vmApiVirtualNetworkConnectedAdapterInfo, adapterOwner) }, { - APITYPE_STRING_LEN, 1, 4, STRUCT_INDX_5, NEST_LEVEL_2, - offsetof(vmApiVirtualNetworkConnectedAdapterInfo, - imageDeviceNumber) }, - - { APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; - -int smVirtual_Network_Vswitch_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, vmApiVirtualNetworkVswitchQueryOutput ** outData); - -// Virtual_Network_Vswitch_Set -typedef commonOutputFields vmApiVirtualNetworkVswitchSetOutput; - -// Parser table for Virtual_Network_Vswitch_Set -static tableLayout Virtual_Network_Vswitch_Set_Layout = { { - APITYPE_BASE_STRUCT_LEN, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, - sizeof(vmApiVirtualNetworkVswitchSetOutput) }, { APITYPE_INT4, 4, 4, - STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchSetOutput, requestId) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchSetOutput, returnCode) }, { - APITYPE_INT4, 4, 4, STRUCT_INDX_0, NEST_LEVEL_0, offsetof( - vmApiVirtualNetworkVswitchSetOutput, reasonCode) }, { - APITYPE_END_OF_TABLE, 0, 0, 0, 0 } }; -int smVirtual_Network_Vswitch_Set(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * switchName, char * grantUserid, - char * userVlanId, char * revokeUserid, char * realDeviceAddress, - char * portName, char * controllerName, char connectionValue, - int queueMemoryLimit, char routingValue, char portType, - char updateSystemConfigIndicator, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, char gvrpValue, - char * macId, vmApiVirtualNetworkVswitchSetOutput ** outData); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/zhcp/zhcp-build/resource_access/include/wrapperutils.h b/zhcp/zhcp-build/resource_access/include/wrapperutils.h deleted file mode 100644 index 9dd7dbf..0000000 --- a/zhcp/zhcp-build/resource_access/include/wrapperutils.h +++ /dev/null @@ -1,19 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include -#include "vmapiImage.h" -#include "vmapiVirtual.h" -#include "smPublic.h" -#include "vmapiSystem.h" -#include "vmapiAsynchronous.h" -#include "vmapiAuthorization.h" -#include "vmapiCheckAuthentication.h" -#include "vmapiDirectoryManager.h" -#include "vmapiProfile.h" - -void releaseContext(VmApiInternalContext* context); -void initializeContext(VmApiInternalContext* context); -int isImageNameInvalid(char* imageName); -int isDevNumberInvalid(char* devNumber); -void trim(char * s); diff --git a/zhcp/zhcp-build/resource_access/src/add3390.c b/zhcp/zhcp-build/resource_access/src/add3390.c deleted file mode 100644 index 0612d2d..0000000 --- a/zhcp/zhcp-build/resource_access/src/add3390.c +++ /dev/null @@ -1,99 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a 3390 (ECKD) disk to a virtual image's directory entry. - * - * @param $1: The name of the guest to which a disk is to be added - * @param $2: The name of the disk pool from which a disk is to be allocated - * @param $3: The virtual device address for the newly-allocated volume - * @param $4: The mode under which the disk is to be linked by the user - * @param $5: The size of the new disk, in cylinders - * @param $6: The read password - * @param $7: The write password - * @param $8: The multi password - * - * @return 0 If the disk was added successfully - * 1 If given invalid parameters - * 2 If disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC < 6 || argC > 9) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* pool = argV[2]; - char* vdev = argV[3]; - int size = atoi(argV[4]); - char* mode = argV[5]; - - // Read password - char* readPw = ""; - if (argC > 7 && argV[6]) - readPw = argV[6]; - - // Write password - char* writePw = ""; - if (argC > 8 && argV[7]) - writePw = argV[7]; - - // Mutli password - // In order to link to a disk, a multi password must be specified - char* multiPw = ""; - if (argC > 9 && argV[8]) - multiPw = argV[8]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Adding disk %s to %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskCreateDmOutput* output; - - int rc = smImage_Disk_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, "3390", "AUTOG", pool, 1, // Cylinders - size, mode, 1, "", // Do not format disk. Do not give disk a label. - readPw, writePw, multiPw, // Read, write, and multi passwords. - &output); - - if (rc || (output->common.returnCode && output->common.returnCode != 408 - && output->common.returnCode != 592) - || (output->common.reasonCode && output->common.reasonCode != 4 - && output->common.reasonCode != 0)) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/add3390active.c b/zhcp/zhcp-build/resource_access/src/add3390active.c deleted file mode 100644 index fdb4388..0000000 --- a/zhcp/zhcp-build/resource_access/src/add3390active.c +++ /dev/null @@ -1,71 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a 3390 (ECKD) disk that is defined in a virtual image's directory - * entry to that virtual image's active configuration - * - * @param $1: The name of the guest to which a disk is to be added - * @param $2: The virtual device address for the newly-allocated volume - * @param $3: The mode under which the disk is to be linked by the user - * - * @return 0 If the disk was added successfully - * 1 If given invalid parameters - * 2 If disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC != 4) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - char* mode = argV[3]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Adding disk %s to %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskCreateOutput * output; - - int rc = smImage_Disk_Create(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, mode, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, - output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/add9336.c b/zhcp/zhcp-build/resource_access/src/add9336.c deleted file mode 100644 index 8cb91ca..0000000 --- a/zhcp/zhcp-build/resource_access/src/add9336.c +++ /dev/null @@ -1,116 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a 9336 (FBA) disk to a virtual image's directory entry. - * - * @param $1: The name of the guest to which a disk is to be added - * @param $2: The name of the disk pool from which a disk is to be allocated - * @param $3: The virtual device address for the newly-allocated volume - * @param $4: The mode under which the disk is to be linked by the user - * @param $5: Block size (512, 1024, 2048, or 4096) - * @param $6: The size of the new disk, in blocks - * @param $7: The read password - * @param $8: The write password - * @param $9: The multi password - * - * @return 0 If the disk was added successfully - * 1 If given invalid parameters - * 2 If disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC < 7 || argC > 10) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* pool = argV[2]; - char* vdev = argV[3]; - char* mode = argV[4]; - int blocksize = atoi(argV[5]); - int size = atoi(argV[6]); - - // Read password - char* readPw = ""; - if (argC > 8 && argV[7]) - readPw = argV[7]; - - // Write password - char* writePw = ""; - if (argC > 9 && argV[8]) - writePw = argV[8]; - - // Mutli password - // In order to link to a disk, a multi password must be specified - char* multiPw = ""; - if (argC > 10 && argV[9]) - multiPw = argV[9]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - int unit; - switch (blocksize) { - case 512: - unit = 2; - break; - case 1024: - unit = 3; - break; - case 2048: - unit = 4; - break; - case 4096: - unit = 5; - break; - default: - printf("Error: Block size must be 512, 1024, 2048, or 4096\n"); - return 1; - } - - printf("Adding disk %s to %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskCreateDmOutput* output; - - int rc = smImage_Disk_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, "9336", "AUTOG", pool, unit, size, mode, 1, "", // Do not format disk. Do not give disk a label. - readPw, writePw, multiPw, // Read, write, and multi passwords. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/addnic.c b/zhcp/zhcp-build/resource_access/src/addnic.c deleted file mode 100644 index 5697ba5..0000000 --- a/zhcp/zhcp-build/resource_access/src/addnic.c +++ /dev/null @@ -1,85 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Adds a network adapter to a virtual image's directory entry. - * - * @param $1: The z/VM guest for which a NIC is being allocated - * @param $2: The virtual device address of the NIC being allocated - * @param $3: The type of NIC which is to be allocated - * @param $4: The number of VDEV channels associated with this NIC - * - * @return 0 If the NIC was added successfully - * 1 If given invalid parameters - * 2 If the NIC definition failed - */ -int main(int argC, char * argV[]) { - - if (argC != 5) { - printf("Error: Wrong number of parameters"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - char* type = argV[3]; - int devcount = atoi(argV[4]); - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - int typecode; - if (!strcmp(type, "HiperSockets")) { - typecode = 1; - } else if (!strcmp(type, "QDIO")) { - typecode = 2; - } else { - printf("Error: NIC type must be HiperSockets or QDIO\n"); - return 1; - } - - printf("Adding NIC %s to %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterCreateDmOutput* output; - - int rc = smVirtual_Network_Adapter_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, address, typecode, devcount, "", // Only relevant for a second-level z/OS. - "", // The MAC identifier. - &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/addprocessor.c b/zhcp/zhcp-build/resource_access/src/addprocessor.c deleted file mode 100644 index fb6e5f3..0000000 --- a/zhcp/zhcp-build/resource_access/src/addprocessor.c +++ /dev/null @@ -1,67 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a non-dedicated processor to a virtual image's directory entry. - * - * @param $1: The z/VM guest to which a processor is to be added - * @param $2: The virtual device address for the processor being added - * - * @return 0 If the processor was created - * 1 If given invalid parameters - * 2 If the processor definition failed - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; // Hexedecimal string, 00-3F - - printf("Adding processor %s to %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageCpuDefineDmOutput* output; - - int rc = smImage_CPU_Define_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, address, 0, // Base CPU status unspecified. - "", // The processor identification number. - 1, // Not a dedicated processor. - 0, // Do not specify a cryptographic facility. - &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/addvdisk.c b/zhcp/zhcp-build/resource_access/src/addvdisk.c deleted file mode 100644 index 72feb27..0000000 --- a/zhcp/zhcp-build/resource_access/src/addvdisk.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a v-disk to a virtual image’s directory entry. - * - * @param $1: The name of the guest to which a disk is to be added - * @param $2: The virtual device address for the newly-allocated volume - * @param $3: The size of the new disk, in 512-byte blocks - * - * @return 0 If the disk was added successfully - * 1 If given invalid parameters - * 2 If disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC != 4) { - printf("Error: Wrong number of parameters\n"); - return -1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - int size = atoi(argV[3]); - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Adding V-Disk %s to %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskCreateDmOutput* output; - - int rc = smImage_Disk_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, "FB-512", // Required for V-Disk devices. - "V-DISK", "NONE", // No disk pool (value is ignored). - 2, // Allocation unit is BLK0512. - size, "W", // Writable. - 0, "", // Formatting unspecified, no label. - "", "", "", // Read, write, and multi passwords. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/connectnic2guestlan.c b/zhcp/zhcp-build/resource_access/src/connectnic2guestlan.c deleted file mode 100644 index 58d25e6..0000000 --- a/zhcp/zhcp-build/resource_access/src/connectnic2guestlan.c +++ /dev/null @@ -1,72 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Connect network adapter to a GuestLAN. - * - * @param $1: The user for which a NIC is being connected - * @param $2: The virtual device address of the NIC being connected - * @param $3: The name of the LAN to which the NIC is to be connected - * @param $4: The virtual image owning the GuestLAN segment to be connected - * - * @return 0 If the NIC was added successfully - * 1 If given invalid parameters - * 2 If the NIC could not be connected to the VSwitch - */ -int main(int argC, char * argV[]) { - - if (argC != 5) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - char* lan = argV[3]; - char* owner = argV[4]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image) || isImageNameInvalid(owner)) - return 1; - - printf("Connecting NIC %s to GuestLan %s on %s... ", address, lan, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterConnectVswitchDmOutput* output; - - int rc = smVirtual_Network_Adapter_Connect_LAN_DM(&context, "", 0, "", - image, address, lan, owner, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/connectnic2vswitch.c b/zhcp/zhcp-build/resource_access/src/connectnic2vswitch.c deleted file mode 100644 index b9d04a8..0000000 --- a/zhcp/zhcp-build/resource_access/src/connectnic2vswitch.c +++ /dev/null @@ -1,71 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Connect network adapter to a VSwitch. - * - * @param $1: The user for which a NIC is being connected - * @param $2: The virtual device address of the NIC being connected - * @param $3: The name of the VSwitch to which the NIC is to be connected - * - * @return 0 If the NIC was added successfully - * 1 If given invalid parameters - * 2 If the NIC could not be connected to the VSwitch - */ -int main(int argC, char * argV[]) { - - if (argC != 4) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - char* vswitch = argV[3]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Connecting NIC %s to VSwitch %s on %s... ", address, vswitch, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterConnectVswitchDmOutput* output; - - int rc = smVirtual_Network_Adapter_Connect_Vswitch_DM(&context, "", 0, "", - image, address, vswitch, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/createvs.c b/zhcp/zhcp-build/resource_access/src/createvs.c deleted file mode 100644 index ec371ae..0000000 --- a/zhcp/zhcp-build/resource_access/src/createvs.c +++ /dev/null @@ -1,231 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Creates a z/VM guest with the specified name. - * - * @param $1: The name of the guest which is to be created - * - * @return 0 If the virtual image now exists - * 1 If given invalid parameters - * 2 If image creation failed - */ -int main(int argC, char * argV[]) { - - // Should be only 1 or 2 arguments - if (argC < 2 || argC > 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Get image name - char * imageName = argV[1]; - - // Check if image name is between 1 and 8 characters - if (isImageNameInvalid(imageName)) - return 1; - - printf("Creating user directory entry for %s... ", imageName); - - // Create DirMaint directory entry - int rc; - if (argC == 3) { - rc = createUsingFile(imageName, argV[2]); - } - // If no user directory entry is given, create a NOLOG userID - else { - rc = createNoLog(imageName); - } - - return rc; -} - -/** - * Creates a z/VM guest with the specified name using a directory entry file. - * - * @param $1: The name of the guest which is to be created - * @param $2: The directory entry in a file - * - * @return 0 If the virtual image now exists - * 1 If given invalid parameters - * 2 If image creation failed - */ -int createUsingFile(char * imageName, char * file) { - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageCreateDmOutput * output; - - int rc; - FILE * userProfile; - - // Open file for user directory entry - userProfile = fopen(file, "r"); - if (userProfile == NULL) - printf(" Error: Failed to open %s\n", file); - else { - // Read in user directory entry - int recordCount = 0, i = 0; - char line[100], buffer[30][100]; - char * ptr; - while (!feof(userProfile)) { - // Read in 100 characters - fgets(line, 100, userProfile); - - // Delete new line - ptr = strstr(line, "\n"); - if (ptr != NULL) { - strncpy(ptr, "\0", 1); - } - - // Copy line into buffer - strcpy(buffer[i], line); - i++; - - if (!feof(userProfile)) - recordCount++; - } - - // Check USER line for correct virtual server name - ptr = strstr(buffer[0], imageName); - char newLine[100]; - // If the virtual server name is NOT in the USER line - if (ptr == NULL) { - // Insert virtual server name into the USER line - ptr = strtok(buffer[0], " "); - - int i = 0; - while (ptr != NULL) { - if (i == 1) { - strcat(newLine, imageName); - } else { - strcat(newLine, ptr); - } - strcat(newLine, " "); - ptr = strtok(NULL, " "); - i++; - } - - strcpy(buffer[0], newLine); - } - - // Create image record - vmApiImageRecord record[recordCount]; - // Copy buffer contents into image record - for (i = 0; i < recordCount; i++) { - record[i].imageRecordLength = strlen(buffer[i]); - record[i].imageRecord = buffer[i]; - } - - // Close user directory entry - fclose(userProfile); - - rc = smImage_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - imageName, // Image name. - "", // The prototype to use for creating the image. - 0, "", // Initial password length, initial password. - "", recordCount, // Initial account number, image record array length - &record, // Image record. - &output); - } - - if (rc || (output->common.returnCode && output->common.returnCode != 400 - && output->common.returnCode != 592) - || (output->common.reasonCode && output->common.reasonCode != 8 - && output->common.reasonCode != 0)) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } - - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; -} - -/** - * Creates a z/VM guest with the specified name with NOLOG. - * - * @param $1: The name of the guest which is to be created - * - * @return 0 If the virtual image now exists - * 1 If given invalid parameters - * 2 If image creation failed - */ -int createNoLog(char * imageName) { - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageCreateDmOutput * output; - - int rc; - char userLine[19] = "USER "; - strcat(userLine, imageName); - strcat(userLine, " NOLOG"); - - vmApiImageRecord record; - record.imageRecordLength = 19; // Length of image_record - record.imageRecord = userLine; // The user or profile entry - - rc = smImage_Create_DM(&context, "", 0, "", // Authorizing user, password length, password. - imageName, // Image name. - "", // The prototype to use for creating the image. - 0, "", // Initial password length, initial password. - "", 1, // Initial account number, image record array length - &record, // Image record. - &output); - - if (rc || (output->common.returnCode && output->common.returnCode != 400 - && output->common.returnCode != 592) - || (output->common.reasonCode && output->common.reasonCode != 8 - && output->common.reasonCode != 0)) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/dedicatedevice.c b/zhcp/zhcp-build/resource_access/src/dedicatedevice.c deleted file mode 100644 index b202796..0000000 --- a/zhcp/zhcp-build/resource_access/src/dedicatedevice.c +++ /dev/null @@ -1,80 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Adds a dedicated device to a virtual image's directory entry. - * - * @param $1: The name of the guest to which a device is to be added - * @param $2: The virtual device address to be assigned to the device - * @param $3: The device's real address - * - * @return 0 If the dedicated device was added successfully - * 1 If given invalid parameters - * 2 If device dedication failed - */ -int main(int argC, char* argV[]) { - - if (argC != 5) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - char* rdev = argV[3]; - char* mode = argV[4]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - int readonly; - if (strcmp(mode, "RW") == 0 || strcmp(mode, "rw") == 0) { - readonly = 0; - } else if (strcmp(mode, "RO") == 0 || !strcmp(mode, "ro") == 0) { - readonly = 1; - } else { - printf("Error: Mode must be in RW or RO\n"); - return 1; - } - - printf("Adding device %s as %s to %s... ", rdev, vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDeviceDedicateDmOutput* output; - - int rc = smImage_Device_Dedicate_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, rdev, readonly, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/deleteipl.c b/zhcp/zhcp-build/resource_access/src/deleteipl.c deleted file mode 100644 index 5b4062b..0000000 --- a/zhcp/zhcp-build/resource_access/src/deleteipl.c +++ /dev/null @@ -1,65 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Deletes the IPL statement for the z/VM guest with the specified name. - * - * @param $1: The name of the guest from which the IPL statement is to be removed - * - * @return 0 If the no IPL statement exists upon completion - * 1 If given invalid parameters - * 2 If IPL statement removal failed - */ -int main(int argC, char * argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Removing IPL statement on %s... ", image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageIplDeleteDmOutput* output; - - int rc = smImage_IPL_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/deletevs.c b/zhcp/zhcp-build/resource_access/src/deletevs.c deleted file mode 100644 index 8f703db..0000000 --- a/zhcp/zhcp-build/resource_access/src/deletevs.c +++ /dev/null @@ -1,72 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Deletes the specified z/VM virtual server. - * - * @param $1: The name of the virtual server which is to be deleted - * - * @return 0 If the image is not present in the directory upon completion - * 1 If given invalid parameters - * 2 If image deletion failed - */ -int main(int argC, char* argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - // Get the virtual server name - char* imageName = argV[1]; - // Check if the virtual server name is between 1 and 8 characters - if (isImageNameInvalid(imageName)) - return 1; - - printf("Deleting virtual server %s... ", imageName); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDeleteDmOutput* output; - - // Delete z/VM virtual server - int rc = smImage_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - imageName, // Image name. - 1, // Do not erase data from disks being released. - &output); - - if (rc || (output->common.returnCode && output->common.returnCode != 400 - && output->common.returnCode != 592) - || (output->common.reasonCode && output->common.reasonCode != 4 - && output->common.reasonCode != 0)) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} - diff --git a/zhcp/zhcp-build/resource_access/src/disconnectnic.c b/zhcp/zhcp-build/resource_access/src/disconnectnic.c deleted file mode 100644 index b698f9c..0000000 --- a/zhcp/zhcp-build/resource_access/src/disconnectnic.c +++ /dev/null @@ -1,69 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Disconnect network adapter. - * - * @param $1: The user for which a NIC is being disconnected - * @param $2: The virtual device address of the NIC being disconnected - * - * @return 0 If the NIC was successfully disconnected - * 1 If given invalid parameters - * 2 If the NIC could not be disconnected - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Disconnecting NIC %s on %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterDisconnectDmOutput* output; - - int rc = smVirtual_Network_Adapter_Disconnect_DM(&context, "", 0, "", - image, address, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/getdiskpool.c b/zhcp/zhcp-build/resource_access/src/getdiskpool.c deleted file mode 100644 index 9a4262d..0000000 --- a/zhcp/zhcp-build/resource_access/src/getdiskpool.c +++ /dev/null @@ -1,100 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Get the free and used space in a given disk pool. - * - * @param $1: The name of the guest to get the disk pool from - * @param $2: The name of the disk pool - * @param $2: Free or used space in the disk pool - * - * @return 0 If the disk pool was successfully printed - * 1 If given invalid parameters - * 2 If the disk pool could not be retrieved - */ -int main(int argC, char * argV[]) { - if (argC != 4) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char * image = argV[1]; - char * pool = argV[2]; - char * spaceStr = argV[3]; - - // Get the disk space - int space; - if (strcmp(spaceStr, "free") == 0) { - space = 2; - } else if (strcmp(spaceStr, "used") == 0) { - space = 3; - } else { - printf("Error: Disk pool space must be free or used\n"); - return 1; - } - - VmApiInternalContext context; - vmApiImageRecord * record; - char temp[1024]; - char * token; - char diskStr[256]; - int i; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageVolumeSpaceQueryDmOutput * output; - - // Get disk pool used space - int rc = smImage_Volume_Space_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, space, // Used space - 3, // Query group - pool, &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - record = output->recordList; - for (i = 0; i < output->recordCount; i++) { - strncpy(temp, record->imageRecord, record->imageRecordLength); - - token = strtok_r(temp, " ", &context); // VolId - strcpy(diskStr, token); - strcat(diskStr, " "); - token = strtok_r(NULL, " ", &context); // Device type - strcat(diskStr, token); - strcat(diskStr, " "); - token = strtok_r(NULL, " ", &context); // Start address - strcat(diskStr, token); - strcat(diskStr, " "); - token = strtok_r(NULL, " ", &context); // Size - strcat(diskStr, token); - - printf("%s\n", diskStr); - record++; - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/getdiskpoolnames.c b/zhcp/zhcp-build/resource_access/src/getdiskpoolnames.c deleted file mode 100644 index ad957c4..0000000 --- a/zhcp/zhcp-build/resource_access/src/getdiskpoolnames.c +++ /dev/null @@ -1,73 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Get a list of defined disk pools. - * - * @param $1: The name of the guest to get a list of disk pools for - * - * @return 0 If the disk pools were successfully printed - * 1 If given invalid parameters - * 2 If the disk pools could not be retrieved - */ -int main(int argC, char * argV[]) { - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - - VmApiInternalContext context; - vmApiImageRecord * record; - char * poolName; - int i; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageVolumeSpaceQueryDmOutput * output; - - int rc = smImage_Volume_Space_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, 1, // Query definition - 3, // Query group - "*", // All areas - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - record = output->recordList; - for (i = 0; i < output->recordCount; i++) { - // Get disk pool name from each record - poolName = strtok_r(record->imageRecord, " ", &context); - if (poolName) { - printf("%s\n", poolName); - } - record++; - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/getipl.c b/zhcp/zhcp-build/resource_access/src/getipl.c deleted file mode 100644 index e7d91c3..0000000 --- a/zhcp/zhcp-build/resource_access/src/getipl.c +++ /dev/null @@ -1,63 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Prints out the specified DirMaint profile entry. - * - * @param $1: The name of the profile which is to be listed - * - * @return 0 If the IPL entry was successfully printed - * 1 If given invalid parameters - * 2 If the IPL entry could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageIplQueryDmOutput* output; - - int rc = smImage_IPL_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("IPL target: %s\n" - "LoadParms: %s\n" - "Parameters: %s\n", output->savedSystem, output->loadParameter, - output->parameters); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/getuserentry.c b/zhcp/zhcp-build/resource_access/src/getuserentry.c deleted file mode 100644 index ca185dd..0000000 --- a/zhcp/zhcp-build/resource_access/src/getuserentry.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Prints out the specified DirMaint directory entry. - * - * @param $1: The name of the z/VM guest which is to be listed - * - * @return 0 If the image record was successfully printed - * 1 If given invalid parameters - * 2 If the image could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Image name - char * image = argV[1]; - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageQueryDmOutput * output; - - // Query DirMaint directory entry - int rc = smImage_Query_DM(&context, "", 0, "", image, &output, false); - - // Handle return code and reason code - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return code: %d\n", rc) : printf(" Return code: %d\n" - " Reason code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - // Print out DirMaint directory entry - int recCount = output->imageRecordCount; - int recLen = output->imageRecordList[0].imageRecordLength - 8; - - // Line to print - char line[recLen], chs[4]; - - if (recCount > 0) { - int i; - int token = 0; - - // Loop through image record and print out directory entry - for (i = 0; i < recCount; i++) { - memset(line, 0, recLen); - memcpy(line, output->imageRecordList[i].imageRecord, recLen); - - // Print lines that are not comment - trim(line); - - // Copy first 4 characters - strncpy(chs, line, 4); - - // If first 4 characters does not have * (comment) - if (!strstr(chs, "*")) { - // Print directory entry line - printf("%s\n", line); - } - } - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/getuserentrynames.c b/zhcp/zhcp-build/resource_access/src/getuserentrynames.c deleted file mode 100644 index 473a2c5..0000000 --- a/zhcp/zhcp-build/resource_access/src/getuserentrynames.c +++ /dev/null @@ -1,62 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "wrapperutils.h" - -/** - * Prints out a list of defined image names on a z/VM system. - * - * @return 0 If the list of image names was successfully printed - * 1 If given invalid parameters - * 2 If the image name list could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC > 1) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageNameQueryDmOutput* output; - - int rc = smImage_Name_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - "NA", // Doesn't matter what image name we use. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - int i; - int n = output->nameCount; - for (i = 0; i < n; i++) { - printf("%s\n", output->nameList[i]); - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/getuserprofile.c b/zhcp/zhcp-build/resource_access/src/getuserprofile.c deleted file mode 100644 index 0bedf31..0000000 --- a/zhcp/zhcp-build/resource_access/src/getuserprofile.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Prints out the specified profile. - * - * @param $1: The name of the profile which is to be listed - * - * @return 0 If the profile was successfully printed - * 1 If given invalid parameters - * 2 If the profile could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Image name - char * profile = argV[1]; - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiProfileQueryDmOutput * output; - - // Query DirMaint profile - int rc = smProfile_Query_DM(&context, "", // Authorizing user - 0, // Password length - "", // Password - profile,// Profile name - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return code: %d\n", rc) : printf(" Return code: %d\n" - " Reason code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - // Print out DirMaint directory entry - int i; - int recCount = output->profileRecordCount; - int recLen = 72; - - // Line to print - char line[recLen], chs[4]; - - if (recCount > 0) { - // Loop through image record and print out directory entry - for (i = 0; i < recCount; i++) { - memset(line, 0, recLen); - memcpy(line, output->profileRecordList[i].recordData, recLen); - - // Print lines that are not comment - trim(line); - - // Copy first 4 characters - strncpy(chs, line, 4); - - // If first 4 characters does not have * (comment) - if (!strstr(chs, "*")) { - printf("%s\n", line); - } - } // End of for - } - } // End of else - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; -} diff --git a/zhcp/zhcp-build/resource_access/src/queryvolumes.c b/zhcp/zhcp-build/resource_access/src/queryvolumes.c deleted file mode 100644 index 37d262f..0000000 --- a/zhcp/zhcp-build/resource_access/src/queryvolumes.c +++ /dev/null @@ -1,93 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Prints out information about disk spaces on a z/VM system. - * - * @param $1: The type of query to run - * @param $2: The type of space to query - * - * @return 0 If the virtual image was created - * 1 If given invalid parameters - * 2 If the image name list could not be retrieved - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* queryType = argV[1]; - char* entryType = argV[2]; - - int iQueryType; - if (!strcmp(queryType, "definition")) { - iQueryType = 1; - } else if (!strcmp(queryType, "free")) { - iQueryType = 2; - } else if (!strcmp(queryType, "used")) { - iQueryType = 3; - } else { - return 1; - } - - int iEntryType; - if (!strcmp(entryType, "volume")) { - iEntryType = 1; - } else if (!strcmp(entryType, "region")) { - iEntryType = 2; - } else if (!strcmp(entryType, "group")) { - iEntryType = 3; - } else { - return 1; - } - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageVolumeSpaceQueryDmOutput* output; - - int rc = smImage_Volume_Space_Query_DM(&context, "", 0, "", // Authorizing user, password length, password. - "NA", // Doesn't matter what image name we use. - iQueryType, iEntryType, "*", // List all spaces of specified type. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - int i, l; - int n = output->recordCount; - int p = 0; - for (i = 0; i < n; i++) { - l = output->recordList[i].imageRecordLength; - printf("%.*s\n", l, output->recordList[0].imageRecord + p); - p = p + l; - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/removemdisk.c b/zhcp/zhcp-build/resource_access/src/removemdisk.c deleted file mode 100644 index 1cd8114..0000000 --- a/zhcp/zhcp-build/resource_access/src/removemdisk.c +++ /dev/null @@ -1,69 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Removes a disk from a virtual image's directory entry - * - * @param $1: The name of the guest from which a disk is to be removed - * @param $2: The virtual device address of the volume which is to be removed - * - * @return 0 If the disk is not in the image's directory entry upon completion - * 1 If given invalid parameters - * 2 If the disk allocation failed - */ -int main(int argC, char* argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image) || isDevNumberInvalid(vdev)) - return 1; - - printf("Removing disk %s on %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDiskDeleteDmOutput* output; - - int rc = smImage_Disk_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, 0, // Use default setting for whether to erase data. - &output); - - if (rc || output->common.returnCode || output->common.reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/removenic.c b/zhcp/zhcp-build/resource_access/src/removenic.c deleted file mode 100644 index d57e6d0..0000000 --- a/zhcp/zhcp-build/resource_access/src/removenic.c +++ /dev/null @@ -1,68 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "vmapiVirtual.h" -#include "wrapperutils.h" - -/** - * Removes a network adapter from a virtual image's directory entry. - * - * @param $1: The z/VM guest from which the NIC is to be removed - * @param $2: The virtual device address of the NIC which is to be removed - * - * @return 0 If the NIC was removed successfully - * 1 If given invalid parameters - * 2 If the NIC removal failed - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; - - if (isImageNameInvalid(image)) - return 1; - - printf("Removing NIC %s on %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiVirtualNetworkAdapterDeleteDmOutput* output; - - int rc = smVirtual_Network_Adapter_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, address, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/removeprocessor.c b/zhcp/zhcp-build/resource_access/src/removeprocessor.c deleted file mode 100644 index 980556d..0000000 --- a/zhcp/zhcp-build/resource_access/src/removeprocessor.c +++ /dev/null @@ -1,64 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Removes a processor to a virtual image's directory entry. - * - * @param $1: The name of the guest to which a processor is to be removed - * @param $2: The virtual address of the processor which is to be removed - * - * @return 0 If the processor was successfully removed - * 1 If given invalid parameters - * 2 If the specified processor remains after attempted removal - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters"); - return 1; - } - - char* image = argV[1]; - char* address = argV[2]; // Hexedecimal string, 00-3F - - printf("Removing processor %s on %s... ", address, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageCpuDeleteDmOutput* output; - - int rc = smImage_CPU_Delete_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, address, &output); - - if (rc || (output->returnCode && output->returnCode != 520 - || (output->reasonCode && output->reasonCode != 30))) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/replacevs.c b/zhcp/zhcp-build/resource_access/src/replacevs.c deleted file mode 100644 index d716b36..0000000 --- a/zhcp/zhcp-build/resource_access/src/replacevs.c +++ /dev/null @@ -1,202 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Replace specified user directory entry. - * - * @param $1: Name of the z/VM guest to replace the directory entry - * @param $2: Text file containing the new directory entry - * - * @return 0 If directory entry was successfully replaced - * 1 If given invalid parameters - * 2 If directory entry replace failed - */ -int main(int argC, char* argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Get user name - char* image = argV[1]; - char* file = argV[2]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - // Lock user directory entry - int rc = lockImage(image, &context); - - FILE * userDirEntry; - - // Open file for user directory entry - userDirEntry = fopen(file, "r"); - if (userDirEntry == NULL) - printf("Error: Failed to open %s\n", file); - else { - // Read in user directory entry - int recordCount = 0; - int i = 0; - char line[100], buffer[30][100]; - char * ptr; - while (!feof(userDirEntry)) { - // Read in 100 characters - fgets(line, 100, userDirEntry); - - // Delete new line - ptr = strstr(line, "\n"); - if (ptr != NULL) { - strncpy(ptr, "\0", 1); - } - - // Copy line into buffer - strcpy(buffer[i], line); - i++; - - if (!feof(userDirEntry)) - recordCount++; - } - - // Close user directory entry - fclose(userDirEntry); - - // Create image record - vmApiImageRecord record[recordCount]; - - // Copy buffer contents into image record - for (i = 0; i < recordCount; i++) { - record[i].imageRecordLength = strlen(buffer[i]); - record[i].imageRecord = buffer[i]; - } - - // Replace user directory entry - rc = replaceImage(image, &context, &record, recordCount); - } - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return rc; -} - -/** - * Lock specified user directory entry. - * - * @param $1: Name of the z/VM guest directory entry to lock - * - * @return 0 If directory entry was successfully locked - * 1 If given invalid parameters - * 2 If directory entry lock failed - */ -int lockImage(char * image, VmApiInternalContext context) { - printf("Locking %s... ", image); - - vmApiImageLockDmOutput * lockOutput; - int rc = smImage_Lock_DM(&context, "", // Authorizing user - 0, // Password length - "", // Password - image, // Image name - "", // Device virtual address - &lockOutput); - - if (rc || (lockOutput->returnCode && lockOutput->returnCode != 400 - || (lockOutput->reasonCode && lockOutput->reasonCode != 12))) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", lockOutput->returnCode, - lockOutput->reasonCode); - - return 2; - } else { - printf("Done\n"); - return 0; - } -} - -/** - * Unlock specified user directory entry. - * - * @param $1: Name of the z/VM guest directory entry to unlock - * - * @return 0 If directory entry was successfully unlocked - * 1 If given invalid parameters - * 2 If directory entry unlock failed - */ -int unlockImage(char * image, VmApiInternalContext context) { - printf("Unlocking %s... ", image); - - vmApiImageUnlockDmOutput * unlockOutput; - int rc = smImage_Unlock_DM(&context, "", // Authorizing user - 0, // Password length - "", // Password - image, // Image name - "", // Device virtual address - &unlockOutput); - - if (rc || unlockOutput->returnCode || unlockOutput->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", unlockOutput->returnCode, - unlockOutput->reasonCode); - - return 2; - } else { - printf("Done\n"); - return 0; - } -} - -/** - * Replace specified user directory entry. - * - * @param $1: Name of the z/VM guest to replace the directory entry - * - * @return 0 If directory entry was successfully unlocked - * 1 If given invalid parameters - * 2 If directory entry unlock failed - */ -int replaceImage(char * image, VmApiInternalContext context, - vmApiImageRecord * record, int recordCount) { - printf("Replacing directory entry of %s... ", image); - - vmApiImageReplaceDmOutput* replaceOutput; - int rc = smImage_Replace_DM(&context, "", // Authorizing user - 0, // Password length - "", // Password - image, // Image name - recordCount, // Record count - record, // Record array - &replaceOutput); - - if (rc || replaceOutput->returnCode || replaceOutput->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", replaceOutput->returnCode, - replaceOutput->reasonCode); - - // Unlock user directory entry - rc = unlockImage(image, context); - return 2; - } else { - printf("Done\n"); - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/setipl.c b/zhcp/zhcp-build/resource_access/src/setipl.c deleted file mode 100644 index 97008ad..0000000 --- a/zhcp/zhcp-build/resource_access/src/setipl.c +++ /dev/null @@ -1,71 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Sets the IPL statement for the z/VM guest with the specified name. - * - * @param $1: The name of the guest for which the IPL statement is to be set. - * @param $2: The new IPL statement's IPL target string. - * @param $3: The new IPL statement's load parameter string. - * @param $4: The new IPL statement's parameter string. - * - * @return 0 If the virtual image now exists - * 1 If given invalid parameters - * 2 If image creation failed - */ -int main(int argC, char * argV[]) { - - if (argC != 5) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* ipltarget = argV[2]; - char* loadparms = argV[3]; - char* parms = argV[4]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Setting IPL statement on %s... ", image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageIplSetDmOutput* output; - - int rc = smImage_IPL_Set_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, ipltarget, loadparms, parms, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/setpassword.c b/zhcp/zhcp-build/resource_access/src/setpassword.c deleted file mode 100644 index 6bbf67c..0000000 --- a/zhcp/zhcp-build/resource_access/src/setpassword.c +++ /dev/null @@ -1,67 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Sets the password for the z/VM guest with the specified name. - * - * @param $1: The name of the guest for which a password is to be set - * @param $2: The guest's new password - * - * @eeturn 0 If the password was set - * 1 If given invalid parameters - * 2 If setting the password failed - */ -int main(int argC, char * argV[]) { - - if (argC != 3) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* password = argV[2]; - - // Check if the userID is between 1 and 8 characters - if (isImageNameInvalid(image)) - return 1; - - printf("Setting password for %s... ", image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImagePasswordSetDmOutput* output; - - int rc = smImage_Password_Set_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, strlen(password), password, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/smMemoryGroup.c b/zhcp/zhcp-build/resource_access/src/smMemoryGroup.c deleted file mode 100644 index 338b4bf..0000000 --- a/zhcp/zhcp-build/resource_access/src/smMemoryGroup.c +++ /dev/null @@ -1,140 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "smPublic.h" - -int quantum = 64; - -int smMemoryGroupInitialize(struct _VmApiInternalContext* vmapiContextP) { - smMemoryGroupContext * context = vmapiContextP->memContext; - // Set up a tracking array with no allocated chunks yet - context->arraySize = quantum; - context->chunks = (void **) malloc(context->arraySize * sizeof(void *)); - if (context->chunks == 0) { - errorLine(vmapiContextP, "smMemoryGroupInitialize: out of memory"); - return MEMORY_ERROR; - } - context->lastChunk = -1; - - // Return successfully - return 0; -} - -void * smMemoryGroupAlloc(struct _VmApiInternalContext* vmapiContextP, - size_t size) { - int rc; - smMemoryGroupContext * context = vmapiContextP->memContext; - - // Check that memory structure is initialized, if not then call to init. - if (context->arraySize < quantum || context->chunks == 0) { - rc = smMemoryGroupInitialize(vmapiContextP); - if (rc != 0) - return 0; // Return of 0 is error in this case - } - // Increment to the next unused entry in the tracking array - context->lastChunk = context->lastChunk + 1; - - // If we're past the end of the array, enlarge it by the quantum - if (context->lastChunk == context->arraySize) { - context->arraySize = context->arraySize + quantum; - void ** reallocated = (void **) realloc(context->chunks, - context->arraySize * sizeof(void *)); - if (NULL == reallocated) { - errorLine(vmapiContextP, "smMemory realloc: out of memory"); - return NULL; - } else { - context->chunks = reallocated; - } - } - - // Obtain the memory and record it in the tracking array - context->chunks[context->lastChunk] = malloc(size); - - // clear out the memory chunk if obtained - if (context->chunks[context->lastChunk]) { - memset(context->chunks[context->lastChunk], 0, size); - } - - // Return the pointer - return context->chunks[context->lastChunk]; -} - -void * smMemoryGroupRealloc(struct _VmApiInternalContext* vmapiContextP, - void * chunk, size_t size) { - smMemoryGroupContext * context = vmapiContextP->memContext; - // Variables - int i; - int rc; - void * newChunk; - - // Check that memory structure is initialized, if not then call to init - if (context->arraySize < quantum || context->chunks == 0) { - rc = smMemoryGroupInitialize(vmapiContextP); - if (rc != 0) - return 0; // Return of 0 is error in this case - } - - // Find this chunk in the tracking array and reallocate it - newChunk = NULL; - for (i = 0; (i <= context->lastChunk) && (newChunk == NULL); i++) { - if (context->chunks[i] == chunk) { - char *reallocated = realloc(context->chunks[i], size); - if (NULL == reallocated) { - errorLine(vmapiContextP, - "smMemory group realloc: out of memory"); - return NULL; - } else { - context->chunks[i] = reallocated; - } - newChunk = context->chunks[i]; - } - } - - // Return the new pointer - return newChunk; - -} - -int smMemoryGroupFreeAll(struct _VmApiInternalContext* vmapiContextP) { - smMemoryGroupContext * context = vmapiContextP->memContext; - // Variables - int i; - - // Check that memory structure is initialized, if not then just return - if (context->arraySize < quantum || context->chunks == 0) { - return 0; - } - - // Free all the memory recorded in the tracking array - for (i = 0; i <= context->lastChunk; i++) { - if (context->chunks[i]) - FREE_MEMORY(context->chunks[i]); - } - - // Reset the tracking array to empty - if (context->arraySize != quantum) { - context->arraySize = quantum; - context->chunks = (void **) realloc(context->chunks, context->arraySize - * sizeof(void *)); - } - context->lastChunk = -1; - - // Return successfully - return 0; - -} - -int smMemoryGroupTerminate(struct _VmApiInternalContext* vmapiContextP) { - smMemoryGroupContext * context = vmapiContextP->memContext; - - // Check that memory structure is initialized, if not then just return - if (context->arraySize < quantum || context->chunks == 0) { - return 0; - } - - // Free the tracking array - FREE_MEMORY(context->chunks); - - // Return successfully - return 0; -} diff --git a/zhcp/zhcp-build/resource_access/src/smSocket.c b/zhcp/zhcp-build/resource_access/src/smSocket.c deleted file mode 100644 index 6544274..0000000 --- a/zhcp/zhcp-build/resource_access/src/smSocket.c +++ /dev/null @@ -1,659 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef AF_IUCV -#define AF_IUCV 32 -#endif - -#ifndef PF_IUCV -#define PF_IUCV AF_IUCV -#endif - -struct sockaddr_iucv { - sa_family_t siucv_family; - unsigned short siucv_port; - unsigned int siucv_addr; - char siucv_nodeid[8]; - char siucv_userid[8]; - char siucv_name[8]; -}; - -// This macro is used to check return values on close -// and do one retry if the close had an EINTR error -#define CHECK_SOCKET_CLOSE(_SOCKETID_) \ -if (retValue)\ -{\ - saveCloseErrno = errno;\ - sprintf(line, "close() error on socket %d return value %d errno %d\n", _SOCKETID_,retValue, saveCloseErrno);\ - errorLog(vmapiContextP,\ - __func__,\ - TO_STRING(__LINE__),\ - RcIucv,\ - retValue,\ - line);\ - if (EINTR == saveCloseErrno)\ - {\ - retValue = close(_SOCKETID_);\ - if (retValue)\ - {\ - saveCloseErrno = errno;\ - sprintf(line, "retried close() error on socket %d return value %d errno %d\n", _SOCKETID_,retValue, saveCloseErrno);\ - errorLog(vmapiContextP,\ - __func__,\ - TO_STRING(__LINE__),\ - RcIucv,\ - retValue,\ - line);\ - }\ - }\ -} - -static const char* default_IUCV_server = "VSMREQIU"; -static const char* IUCV_programName = "DMSRSRQU"; - -int smSocketInitialize(struct _VmApiInternalContext* vmapiContextP, - int * sockId) { - -#define RETRY_CONNECTION_LIMIT 10 - const int SLEEP_TIMES[RETRY_CONNECTION_LIMIT] = { 0, 0, 1, 1, 2, 2, 8, 8, - 16, 32 }; - int retValue; - char line[LINESIZE]; - int length; - int retryConnection; - int saveErrno, saveCloseErrno; - struct sockaddr_iucv serverSockAddr; - struct timeval timeoutValue; - - // If the trace file has not been read yet, do it - if (!(vmapiContextP->smTraceDetails->traceFileRead)) { - readTraceFile(vmapiContextP); - } - - // Place holders for context and background starting - if (1 != vmapiContextP->contextCreatedFlag) { - retValue = initializeThreadSemaphores(vmapiContextP, "", 1); // Create context using no name to override current context name - if (retValue) { - sprintf( - line, - "smSocketInitialize(): context reserve() returned error: %d\n", - retValue); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, line); - return PROCESSING_ERROR; - } - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "smSocketInitialize: initializeThreadSemaphores completed successfully.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - // If the backend is not marked as running, check it - if (!vmapiContextP->checkBackendFlag) { - retValue = vmbkendCheck(vmapiContextP); - if (retValue) - return retValue; // If any error return - } - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - // Get a local socket - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "smSocketInitialize: trying to obtain local socket.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - *sockId = socket(PF_IUCV, SOCK_STREAM, IPPROTO_IP); - if (*sockId == -1) { - sprintf(line, "smSocketInitialize(): socket() returned errno: %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, *sockId, - line); - return SOCKET_OBTAIN_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "smSocketInitialize: local socket id %d obtained. Now trying connect loop. \n", - *sockId); - TRACE_END_DEBUG(vmapiContextP, line); - - // Initialize the server IUCV socket structure - memset(&serverSockAddr, 0, sizeof(serverSockAddr)); - serverSockAddr.siucv_family = AF_IUCV; - serverSockAddr.siucv_port = 0; - serverSockAddr.siucv_addr = 0; - memset(&serverSockAddr.siucv_nodeid, ' ', - sizeof(serverSockAddr.siucv_nodeid)); - memset(&serverSockAddr.siucv_userid, ' ', - sizeof(serverSockAddr.siucv_userid)); - memset(&serverSockAddr.siucv_name, ' ', sizeof(serverSockAddr.siucv_name)); - - timeoutValue.tv_usec = 0; - timeoutValue.tv_sec = 60; // Changed to 60 now that AF IUCV and CMS are working better - retValue = setsockopt(*sockId, SOL_SOCKET, SO_SNDTIMEO, - (struct timeval *) &timeoutValue, sizeof(struct timeval)); - if (retValue < 0) { - sprintf(line, "setsockopt(): connect timeout returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - retValue = close(*sockId); - CHECK_SOCKET_CLOSE(*sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Do we have an IUCV userID or just use the default? - // Do not copy in the null terminator on strings - length = strlen(vmapiContextP->IucvUserid); - if (length <= 0 || length > 8) { - memcpy(&serverSockAddr.siucv_userid, default_IUCV_server, strlen( - default_IUCV_server)); - } else { - memcpy(&serverSockAddr.siucv_userid, &vmapiContextP->IucvUserid, - strlen(vmapiContextP->IucvUserid)); - } - - // Add in the iucv program name constant - memcpy(&serverSockAddr.siucv_name[0], IUCV_programName, strlen( - IUCV_programName)); - - // Try to connect to the IUCV server - for (retryConnection = 1;; retryConnection++) { - retValue = connect(*sockId, (struct sockaddr *) &serverSockAddr, - sizeof(serverSockAddr)); - if (retValue != 0) { - saveErrno = errno; - sprintf(line, "connect() of socket %d returned %d errno %d\n", - *sockId, retValue, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - retValue, line); - // If we have exceeded the retry limit, then shutdown, close and return with error - if (retryConnection >= RETRY_CONNECTION_LIMIT) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "smSocketInitialize: connect retry limit exceeded.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - retValue = close(*sockId); - CHECK_SOCKET_CLOSE(*sockId); - switch (saveErrno) { - case ECONNREFUSED: - return SOCKET_CONNECT_REFUSED_ERROR; - case EAGAIN: - return SOCKET_CONNECT_TRYAGAIN_ERROR; - default: - return SOCKET_PROCESSING_ERROR; - } - } - - // Is this an errno that we can retry? If so continue the loop - switch (saveErrno) { - case ECONNREFUSED: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "====>>ECONNREFUSED, going to close and retry connect.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - case EAGAIN: - if (saveErrno == EAGAIN) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "====>>EAGAIN, going to close and retry connect.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - } - // Close the current socket - // Get a new one, and retry the connect - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "====>>closing the socket before retry.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - retValue = close(*sockId); - CHECK_SOCKET_CLOSE(*sockId) - ; - - // Delay for a while to give SMAPI some time to restart - if (SLEEP_TIMES[retryConnection] > 0) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "+++++++++ Sleeping for %d seconds\n", - SLEEP_TIMES[retryConnection]); - TRACE_END_DEBUG(vmapiContextP, line); - sleep(SLEEP_TIMES[retryConnection]); - } - - *sockId = socket(PF_IUCV, SOCK_STREAM, IPPROTO_IP); - if (*sockId == -1) { - sprintf( - line, - "smSocketInitialize(): socket() returned errno: %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcIucv, *sockId, line); - return SOCKET_OBTAIN_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "smSocketInitialize: retry obtained new local socket id %d. Now retrying connect.\n", - *sockId); - TRACE_END_DEBUG(vmapiContextP, line); - // Reset the return and reason codes in the context - vmapiContextP->rc = 0; - vmapiContextP->reason = 0; - - continue; // Try to connect again - - default: - break; // Shutdown the socket and return with error if errno is not listed - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "====>>closing the socket \n"); - TRACE_END_DEBUG(vmapiContextP, line); - - retValue = close(*sockId); - CHECK_SOCKET_CLOSE(*sockId); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "====>>return from closing the socket \n"); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - return SOCKET_PROCESSING_ERROR; - } else - break; // Got a good connection, leave loop - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, - "smSocketInitialize: Socket connect completed successfully.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - return 0; -} - -int smSocketWrite(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * data, int dataLen) { - - int retValue; - char line[LINESIZE]; - struct timeval timeoutValue; - int onValue = 1; - int saveErrno, saveCloseErrno; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_BUFFER_OUT); - dumpArea(vmapiContextP, data, dataLen); - TRACE_END; - - // Set the send socket timeout value - timeoutValue.tv_usec = 0; - timeoutValue.tv_sec = Socket_Timeout; - retValue = setsockopt(sockId, SOL_SOCKET, SO_SNDTIMEO, - (struct timeval *) &timeoutValue, sizeof(struct timeval)); - if (retValue < 0) { - sprintf(line, "setsockopt(): send timeout returned errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Set the reuse socket address value - onValue = 1; - retValue = setsockopt(sockId, SOL_SOCKET, SO_REUSEADDR, (int *) &onValue, - sizeof(int)); - if (retValue < 0) { - sprintf(line, "setsockopt(): reuse addr returned errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Write the data to the socket - while (dataLen > 0) { - retValue = send(sockId, (void *) data, dataLen, 0); - if (retValue < 0) { - saveErrno = errno; - // Log a special message and set the return and reason code if a timeout - if (errno == EAGAIN) { - sprintf(line, "smSocketWrite(): timeout errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsSocketTimeout, line); - } else { - sprintf(line, "smSocketWrite(): send() returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - errno, line); - } - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - if (saveErrno == EAGAIN) - return SOCKET_TIMEOUT_ERROR; - if (saveErrno == ENOTCONN) - return SOCKET_WRITE_RETRYABLE_ERROR; - return SOCKET_WRITE_ERROR; - } - data = data + retValue; - dataLen = dataLen - retValue; - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - return 0; -} - -int smSocketRead(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * buff, int len) { - - int retValue; - int lenRead; - int retryNoData; - char line[LINESIZE]; - retryNoData = 0; - struct timeval timeoutValue; - unsigned long ulTimeoutSeconds; - long ulTimeoutSecondsRequested = 0; - char * ptrTimeOutValue; - int onValue = 1; - void * buffPtr; - int buffLength; - int saveErrno, saveCloseErrno; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - buffPtr = (void *) buff; - buffLength = len; - ulTimeoutSeconds = Socket_Timeout; - - // Obtain read timeout environment variable - ptrTimeOutValue = getenv("ZVMMAP_READ_TIMEOUT_SECONDS"); - if (ptrTimeOutValue) { - ulTimeoutSecondsRequested = atol(ptrTimeOutValue); - if (ulTimeoutSecondsRequested > 0) { - ulTimeoutSeconds = ulTimeoutSecondsRequested; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "Socket read timeout set from enviromentVariable. %lu seconds.\n", - ulTimeoutSeconds); - TRACE_END_DEBUG(vmapiContextP, line); - } - } - - // Set the read socket timeout value - timeoutValue.tv_usec = 0; - timeoutValue.tv_sec = ulTimeoutSeconds; - retValue = setsockopt(sockId, SOL_SOCKET, SO_RCVTIMEO, - (struct timeval *) &timeoutValue, sizeof(struct timeval)); - if (retValue < 0) { - sprintf(line, "setsockopt(): receive timeout returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Set the reuse socket address value - onValue = 1; - retValue = setsockopt(sockId, SOL_SOCKET, SO_REUSEADDR, (int *) &onValue, - sizeof(int)); - if (retValue < 0) { - sprintf(line, "setsockopt(): reuse addr returned errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - /* Read the data from the socket */ - lenRead = 0; - while (lenRead < len) { - retValue = recv(sockId, buffPtr, buffLength, 0); - if (retValue < 0) { - saveErrno = errno; - // Log a special message and set the return and reason code if a timeout - if (errno == EAGAIN) { - sprintf(line, "smSocketRead(): timeout errno %d\n", errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsSocketTimeout, line); - } else { - sprintf(line, "smSocketRead(): recv() returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - errno, line); - } - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - if (saveErrno == EAGAIN) - return SOCKET_TIMEOUT_ERROR; - if (saveErrno == ENOTCONN) - return SOCKET_READ_RETRYABLE_ERROR; - return SOCKET_READ_ERROR; - } - - // No data returned? - // Retry 10 times if we haven't received any data - if (retValue == 0) { - retryNoData++; - if (retryNoData > 10 && lenRead == 0) { - sprintf(line, - "smSocketRead(): recv() returned no data after 10 retries.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsUnexpected, line); - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_READ_ERROR; - } - } - lenRead += retValue; - buffPtr += retValue; - buffLength -= retValue; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_BUFFER_IN); - dumpArea(vmapiContextP, buff, lenRead); - TRACE_END; - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "smSocketRead(): read %d bytes of data \n", lenRead); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - return 0; -} - -int smSocketReadLoop(struct _VmApiInternalContext* vmapiContextP, int sockId, - char * buff, int len) { - - int retValue; - int lenRead; - int retryNoData; - char line[LINESIZE]; - retryNoData = 0; - struct timeval timeoutValue; - unsigned long ulTimeoutSeconds; - long ulTimeoutSecondsRequested = 0; - char * ptrTimeOutValue; - void * buffPtr; - int buffLength; - int saveErrno, saveCloseErrno; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "--> Inside smSocketReadLoop:.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - - buffPtr = (void *) buff; - buffLength = len; - - ulTimeoutSeconds = Socket_Indication_Timeout; - - // Obtain read timeout environment variable - ptrTimeOutValue = getenv("ZVMMAP_READ_INDICATION_TIMEOUT_SECONDS"); - if (ptrTimeOutValue) { - ulTimeoutSecondsRequested = atol(ptrTimeOutValue); - if (ulTimeoutSecondsRequested > 0) { - ulTimeoutSeconds = ulTimeoutSecondsRequested; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "Socket read indication timeout set from enviromentVariable. %lu seconds.\n", - ulTimeoutSeconds); - TRACE_END_DEBUG(vmapiContextP, line); - } - } - - // Set the read socket timeout value - timeoutValue.tv_usec = 0; - timeoutValue.tv_sec = ulTimeoutSeconds; - retValue = setsockopt(sockId, SOL_SOCKET, SO_RCVTIMEO, - (struct timeval *) &timeoutValue, sizeof(struct timeval)); - if (retValue < 0) { - sprintf(line, "setsockopt(): receive timeout returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, errno, - line); - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - // Read the data from the socket - lenRead = 0; - while (lenRead < len) { - retValue = recv(sockId, buffPtr, buffLength, 0); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "--> return value of recv inside socketReadLoop = %d \n", - retValue); - TRACE_END_DEBUG(vmapiContextP, line); - - if (retValue < 0) { - saveErrno = errno; - // Log a special message and set the return and reason code if a timeout - if (errno == EAGAIN) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "--> Errno inside socketReadLoop = %d for recv() return value = %d \n", - errno, retValue); - TRACE_END_DEBUG(vmapiContextP, line); - - return CUSTOM_DEFINED_SOCKET_RETRY; - - } else { - sprintf(line, "smSocketRead(): recv() returned errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - errno, line); - } - - retValue = close(sockId); - CHECK_SOCKET_CLOSE(sockId); - if (saveErrno == EAGAIN) - return SOCKET_TIMEOUT_ERROR; - if (saveErrno == ENOTCONN) - return SOCKET_READ_RETRYABLE_ERROR; - return SOCKET_READ_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "smSocketRead(): retValue %d \n", retValue); - TRACE_END_DEBUG(vmapiContextP, line); - - // No data returned? - //Retry 100 times if we haven't received any data - if (retValue == 0) { - retryNoData++; - if (retryNoData > 100 && lenRead == 0) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf( - line, - "--> Errno inside socketReadLoop = %d for recv() return value = %d \n", - errno, retValue); - TRACE_END_DEBUG(vmapiContextP, line); - - return CUSTOM_DEFINED_SOCKET_RETRY; - } - } - lenRead += retValue; - buffPtr += retValue; - buffLength -= retValue; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_BUFFER_IN); - dumpArea(vmapiContextP, buff, lenRead); - TRACE_END; - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "smSocketRead(): read %d bytes of data \n", lenRead); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - return 0; -} - -int smSocketTerminate(struct _VmApiInternalContext* vmapiContextP, int sockId) { - int retValue; - char line[LINESIZE]; - int saveCloseErrno; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - - retValue = close(sockId); - if (retValue != 0) { - CHECK_SOCKET_CLOSE(sockId); - return SOCKET_PROCESSING_ERROR; - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET); - return 0; -} diff --git a/zhcp/zhcp-build/resource_access/src/smapiTableParser.c b/zhcp/zhcp-build/resource_access/src/smapiTableParser.c deleted file mode 100644 index 1d8b02a..0000000 --- a/zhcp/zhcp-build/resource_access/src/smapiTableParser.c +++ /dev/null @@ -1,929 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smapiTableParser.h" -#include -#include -#include -#include "smPublic.h" -#include "smSocket.h" - -// Internal function to handle imbedded arrays in smapi output -static int handleArrays(struct _VmApiInternalContext* vmapiContextP, - enum tableParserModes mode, int * tableStartingIndex, - tableLayout table, tableParserParms * parms); - -int parseBufferWithTable(struct _VmApiInternalContext* vmapiContextP, - enum tableParserModes mode, tableLayout table, tableParserParms *parms) { - int temp, dataType, i, rc, iSize, reachedByteCount; - int cStringArrayPtrOffset, cStringArrayPtrIndex; - int cStringCounterFieldOffset, cStringCounterFieldIndex; - int cStringStructIndex, cStringStructSize; - int cStringFieldIndex, cStringFieldOffset, cStringCurrentStructCount; - char line[LINESIZE]; - - reachedByteCount = 0; // Set this if we are at the end of the data - - // If this is a SCAN mode; clear out the output fields - if (mode == scan) { - parms->outStringByteCount = 0; - for (i = 0; i < MAX_STRUCT_ARRAYS; i++) { - parms->outStructCount[i] = 0; - parms->outStructSizes[i] = 0; - } - } - - parms->byteCount = 0; - - // First entry in the table must be the base structure size - if (table[0][COL_1_TYPE] != APITYPE_BASE_STRUCT_LEN) { - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - - // If this is scan mode, fill in the output array size for top level structure - if (mode == scan) { - parms->outStructSizes[0] = table[0][COL_6_SIZE_OR_OFFSET]; - parms->outStructCount[0] = 1; - } - - for (i = 1; (table[i][COL_1_TYPE] != APITYPE_END_OF_TABLE) - && (parms->byteCount < parms->dataBufferSize); i++) { - dataType = table[i][COL_1_TYPE]; - switch (dataType) { - case APITYPE_INT1: - if (mode == populate) { - memcpy((parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET]), - parms->smapiBufferCursor, 1); - } - parms->smapiBufferCursor += 1; - parms->byteCount += 1; - break; - - case APITYPE_INT4: - if (mode == populate) { - GET_INT(*((int *) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])), - parms->smapiBufferCursor); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "int 4 found Value %d stored at %p(+%d) \n", - *((int *) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])), - parms->inStructAddrs[0], table[i][COL_6_SIZE_OR_OFFSET]); - TRACE_END_DEBUG(vmapiContextP, line); - - } else - parms->smapiBufferCursor += 4; - parms->byteCount += 4; - break; - - case APITYPE_INT8: - if (mode == populate) { - GET_64INT(*((long long*) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])), - parms->smapiBufferCursor); - } else - parms->smapiBufferCursor += 8; - parms->byteCount += 8; - break; - - case APITYPE_STRING_LEN: - case APITYPE_CHARBUF_LEN: - case APITYPE_C_STR_PTR: - if (APITYPE_C_STR_PTR == dataType) { - temp = strlen(parms->smapiBufferCursor); - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "C string found of length %d <%s>\n", temp, - parms->smapiBufferCursor); - TRACE_END_DEBUG(vmapiContextP, line); - parms->byteCount += (temp + 1); - } else { - GET_INT(temp, parms->smapiBufferCursor); - parms->byteCount += 4; - parms->byteCount += temp; - } - // If the string size is incorrect, display error and return. - if (temp < table[i][COL_2_MINSIZE]) // Check for less than min first - { - sprintf( - line, - "String size found: %d (@ %p), not in correct range %d-%d \n", - temp, (parms->smapiBufferCursor - 4), - table[i][COL_2_MINSIZE], table[i][COL_3_MAXSIZE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, line); - return PARSER_ERROR_INVALID_STRING_SIZE; - } - // If max is not -1, then check for max - if (-1 != table[i][COL_3_MAXSIZE] && temp > table[i][COL_3_MAXSIZE]) { - sprintf( - line, - "String size found: %d (@ %p), not in correct range %d-%d \n", - temp, (parms->smapiBufferCursor - 4), - table[i][COL_2_MINSIZE], table[i][COL_3_MAXSIZE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, line); - return PARSER_ERROR_INVALID_STRING_SIZE; - } - // If scan update the string byte count - if (mode == scan) { - if (temp > 0) { - parms->outStringByteCount += (temp + 1); - } - if (APITYPE_CHARBUF_LEN == dataType) // Skip past the buf count row in table - { - i++; - (parms->outStringByteCount)--; // Don't need null terminator for char buf - } - } else { // If populate then set the char * in struct; copy the string/charbuf into the buffer - if (temp > 0) { - *((char **) ((parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET]))) - = parms->inStringCursor; - - // If this ia a null terminated string just just strcpy, else use memcpy - if (APITYPE_C_STR_PTR == dataType) { - strcpy(parms->inStringCursor, parms->smapiBufferCursor); - parms->inStringCursor += temp + 1; - } else { - // copy the string/charbuf into the string buffer and add zero terminator if a string - memcpy(parms->inStringCursor, parms->smapiBufferCursor, - temp); - parms->inStringCursor += temp; - if (APITYPE_STRING_LEN == dataType) { - *(parms->inStringCursor) = '\0'; - parms->inStringCursor++; - } else // Char buffer, so no need to add null terminator, but must update count field - { - i++; - *((int*) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])) = temp; - } - } - } else { - *((char**) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])) = NULL; - if (APITYPE_CHARBUF_LEN == dataType) // Set char buf count to 0 - { - i++; - *((int*) (parms->inStructAddrs[0] - + table[i][COL_6_SIZE_OR_OFFSET])) = 0; - } - } - } - if (APITYPE_C_STR_PTR == dataType) { - temp++; // Add on a byte for zero terminator - } - parms->smapiBufferCursor += temp; - break; - - case APITYPE_ARRAY_LEN: - // Call a subroutine to handle this - if (0 != (rc = handleArrays(vmapiContextP, mode, &i, table, parms))) - return rc; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "** Finished handling an array in parseBufferwithTable. Buffer pointer %p \n", - parms->smapiBufferCursor); - TRACE_END_DEBUG(vmapiContextP, line); - - break; - - // If null terminated strings are in the base structure, we need to - // find them all until we use up the buffer. They must be the last - // type of data in the stream. - // For scan mode we need to add up all the string lengths (adding in a byte - // for the null terminator) until the buffer is empty. - // The static table will have the APITYPE_C_STR_ARRAY_PTR, then APITYPE_C_STR_ARRAY_COUNT, - // APITYPE_C_STR_STRUCT_LEN, APITYPE_C_STR_PTR in that order. - case APITYPE_C_STR_ARRAY_PTR: - - cStringArrayPtrOffset = table[i][COL_6_SIZE_OR_OFFSET]; // Get the offset where the array ptr will be stored - cStringArrayPtrIndex = table[i][COL_4_STRUCT_INDEX];// Get the index of this field (should be 0 for this level) - - i++; // Get next table value; which must be the counter info - if (APITYPE_C_STR_ARRAY_COUNT != table[i][COL_1_TYPE]) { - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - cStringCounterFieldOffset = table[i][COL_6_SIZE_OR_OFFSET]; - cStringCounterFieldIndex = table[i][COL_4_STRUCT_INDEX]; - - i++; // Get next table value; which must be the c array structure size info - if (APITYPE_C_STR_STRUCT_LEN != table[i][COL_1_TYPE]) { - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - cStringStructSize = table[i][COL_6_SIZE_OR_OFFSET]; - cStringStructIndex = table[i][COL_4_STRUCT_INDEX]; - - i++; // Get next table value; which must be the char * offset in the structure - if (APITYPE_C_STR_PTR != table[i][COL_1_TYPE]) { - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - cStringFieldIndex = table[i][COL_4_STRUCT_INDEX]; - cStringFieldOffset = table[i][COL_6_SIZE_OR_OFFSET]; - - cStringCurrentStructCount = 0; // Used in populate - - // Look through the rest of the buffer. - while (parms->byteCount < parms->dataBufferSize) { - iSize = strlen(parms->smapiBufferCursor) + 1; - // If this is scan, then increment the c string structure count, - // add the output size of the string + byte for zero terminator, and - // move buffer pointer past the string. Increment our count of data bytes - // processed also. - if (mode == scan) { - parms->outStringByteCount += iSize; - parms->smapiBufferCursor += iSize; - parms->outStructCount[cStringStructIndex]++;// Structures hold the char * - - // If the size of the char * structure has not been filled in, do that now - if (0 == parms->outStructSizes[cStringStructIndex]) { - parms->outStructSizes[cStringStructIndex] - = cStringStructSize; - } - } - // If populate, copy the string to the storage area, - // store the pointer to the string in the correct array structure, - // then move to next string. - else { - // If this is the first string/structure, then set the structure pointer to to the - // starting address. The array notation will handle the rest of the addresses. - if (0 == cStringCurrentStructCount) { - *(char **) (parms->inStructAddrs[cStringArrayPtrIndex] - + cStringArrayPtrOffset) - = parms->inStructAddrs[cStringStructIndex]; - - // Copy the struct count from the scan (input to this populate) into the - // count field - *((int *) (parms->inStructAddrs[cStringCounterFieldIndex] - + cStringCounterFieldOffset)) - = parms->outStructCount[cStringStructIndex]; - } - - // Copy the string into the string buffer - strcpy(parms->inStringCursor, parms->smapiBufferCursor); - - // Set the char * pointer in the c structure of char *'s - memcpy((parms->inStructAddrs[cStringStructIndex] - + (cStringCurrentStructCount * cStringStructSize) - + cStringFieldOffset), &(parms->inStringCursor), - sizeof(char *)); - - // Advance to next string storage location and structure counter - parms->inStringCursor += iSize; - parms->smapiBufferCursor += iSize; - - cStringCurrentStructCount++; - } - parms->byteCount += iSize; - }// End while buffer has data - - break; - - case APITYPE_ARRAY_STRUCT_COUNT: // Should not get here, subroutine should be handling this - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - break; - - default: // Error - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - break; - }// End switch on table type - - if (parms->byteCount >= parms->dataBufferSize) { - reachedByteCount = 1; - break; // End of for loop (Will we always get here vs find the last entry in the table?) - } - }// For loop until end of table - return 0; -} - -/** - * Routine for doing all processing when an array is found. - * Can be recursively called if nested arrays - */ -static int handleArrays(struct _VmApiInternalContext* vmapiContextP, - enum tableParserModes mode, int * tableStartingIndex, - tableLayout table, tableParserParms *parms) { - // At our calling the table index should be at the arrayLen field, and next field should be - // struct len details. - int arrayByteMax, arrayByteCount, arrayPointerOffset, arrayPointerIndex, j, - dataType; - int dataBuffStructSize, outStructSize, structIndex, structByteCount; - int tableIndex, tableMaxIndex, temp, rc, arrayNestLevel; - int structCounter, structCounterField, structCounterIndex; - int noBufferStructLen; // set to 1 if SMAPI array doesn't have an inner structure length - char * structStorage; - char line[LINESIZE]; - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, - "** Array found. Starting table index is %d buffer pointer %p \n", - *tableStartingIndex, parms->smapiBufferCursor); - TRACE_END_DEBUG(vmapiContextP, line); - - arrayByteCount = 0; - tableMaxIndex = 0; // Used to find end of table entries for this structure - structCounter = 0; // Used for populate of structure (an address multiplier) - - GET_INT(arrayByteMax, parms->smapiBufferCursor);// Actual size of SMAPI array data - - arrayPointerOffset = table[*tableStartingIndex][COL_6_SIZE_OR_OFFSET]; - arrayPointerIndex = table[*tableStartingIndex][COL_4_STRUCT_INDEX]; - arrayNestLevel = table[*tableStartingIndex][COL_5_NEST_LEVEL]; - (*tableStartingIndex)++; // Position at the struct len in this table (or struct count) - - // If the struct count field was specified, then make a note of that for populate step - if (APITYPE_ARRAY_STRUCT_COUNT == table[*tableStartingIndex][COL_1_TYPE]) { - if (mode == populate) { - structCounterField - = table[*tableStartingIndex][COL_6_SIZE_OR_OFFSET]; - structCounterIndex = table[*tableStartingIndex][COL_4_STRUCT_INDEX]; - } else { - structCounterField = 0; - structCounterIndex = 0; - } - (*tableStartingIndex)++; // Position at the struct length APITYPE_STRUCT_LEN - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "SMAPI buffer array found: %d bytes \n", arrayByteMax); - TRACE_END_DEBUG(vmapiContextP, line); - - structIndex = table[*tableStartingIndex][COL_4_STRUCT_INDEX]; - outStructSize = table[*tableStartingIndex][COL_6_SIZE_OR_OFFSET]; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Output struct size is %d \n", outStructSize); - TRACE_END_DEBUG(vmapiContextP, line); - - // Figure out where is the ending index of the structure. This will be used in case the - // array is empty or the size of the structure is larger than we expect. (The actual - // structure could be bigger if the next release of SMAPI adds more fields at the end.) - tableMaxIndex = *tableStartingIndex; - while (arrayNestLevel < table[tableMaxIndex + 1][COL_5_NEST_LEVEL] - && APITYPE_END_OF_TABLE != table[tableMaxIndex + 1][COL_1_TYPE]) { - tableMaxIndex++; - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Structure's table max index is %d \n", tableMaxIndex); - TRACE_END_DEBUG(vmapiContextP, line); - - // Find each structure until we reach array max - while (arrayByteCount < arrayByteMax) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Loop to scan buffer for structure data. \n"); - TRACE_END_DEBUG(vmapiContextP, line); - noBufferStructLen = 0; - tableIndex = *tableStartingIndex; - // Start at the field past the array in the table - // next table field should be the array structure size or if no nested inner structure - // the NOBUFFER keyword - if ((APITYPE_STRUCT_LEN != table[tableIndex][COL_1_TYPE]) - && (APITYPE_NOBUFFER_STRUCT_LEN - != table[tableIndex][COL_1_TYPE])) { - printf("table index %d column1 type: %d \n", tableIndex, - table[tableIndex][COL_1_TYPE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - } - structByteCount = 0; - - GET_INT(dataBuffStructSize, parms->smapiBufferCursor); - // If the SMAPI buffer does not contain a nested structure size, then set - // the data pointer back to make the "implied" structure. - if (APITYPE_NOBUFFER_STRUCT_LEN == table[tableIndex][COL_1_TYPE]) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - " There is no inner structure length, so this length %d is first item, back up to re-read it later. \n", - dataBuffStructSize); - TRACE_END_DEBUG(vmapiContextP, line); - parms->smapiBufferCursor -= 4; - noBufferStructLen = 1; // set flag so that correct count at bottom of loop is done - } - - if (mode == scan) { - parms->outStructCount[structIndex]++; - // If the size of the structure has not been filled in, do that now - if (0 == parms->outStructSizes[structIndex]) { - parms->outStructSizes[structIndex] - = table[tableIndex][COL_6_SIZE_OR_OFFSET]; - } - } else { // If populate and structCounterField specified, then fill it in - if (0 == structCounter) { - *(char **) (parms->inStructAddrs[arrayPointerIndex] - + arrayPointerOffset) - = parms->inStructAddrs[structIndex]; - } - if (structCounterField) { - *((int *) (parms->inStructAddrs[structCounterIndex] - + structCounterField)) - = parms->outStructCount[structIndex]; - } - } - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - if (noBufferStructLen == 1) { - sprintf( - line, - " table index %d implied Array struct index %d first data item size %d\n", - tableIndex, structIndex, dataBuffStructSize); - } else { - sprintf(line, - " table index %d Array struct index %d data size %d\n", - tableIndex, structIndex, dataBuffStructSize); - } - TRACE_END_DEBUG(vmapiContextP, line); - if (dataBuffStructSize == 0) - continue; // Probably rare? - - - tableIndex++; - // Loop until reaching the end of the table or if an imbedded structure size, - // When the data has been all read. - while ((noBufferStructLen == 0 - && (structByteCount < dataBuffStructSize)) - || (noBufferStructLen && (tableIndex <= tableMaxIndex))) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - " noBufferStructLen %d structByteCount %d table index %d \n", - noBufferStructLen, structByteCount, tableIndex); - TRACE_END_DEBUG(vmapiContextP, line); - - // If we are at the end of this table, then adjust the byte count and leave - // this loop. This would happen if there is more data than we expect. (A newer - // version of SMAPI may of added more fields at the end. - if (tableIndex > tableMaxIndex) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - " Reached the end of the table. Unexpected condition. Table index %d \n", - tableIndex); - TRACE_END_DEBUG(vmapiContextP, line); - structByteCount = dataBuffStructSize; - break; - } - - dataType = table[tableIndex][0]; - switch (dataType) { - case APITYPE_INT1: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Int1 found.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - if (mode == populate) { - memcpy((parms->inStructAddrs[structIndex] + (structCounter - * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET]), - parms->smapiBufferCursor, 1); - } - parms->smapiBufferCursor += 1; - structByteCount += 1; - break; - - case APITYPE_INT4: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Int4 found.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - if (mode == populate) { - GET_INT(*((int*) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])), - parms->smapiBufferCursor); - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "int 4 found Value %d stored at %p(+%d) \n", - *((int *) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])), - parms->inStructAddrs[structIndex], - table[tableIndex][COL_6_SIZE_OR_OFFSET]); - TRACE_END_DEBUG(vmapiContextP, line); - } else - parms->smapiBufferCursor += 4; - - structByteCount += 4; - break; - - case APITYPE_INT8: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Int8 found.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - if (mode == populate) { - GET_64INT(*((long long*) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])), - parms->smapiBufferCursor); - } else - parms->smapiBufferCursor += 8; - structByteCount += 8; - break; - - case APITYPE_STRING_LEN: - case APITYPE_CHARBUF_LEN: - case APITYPE_C_STR_PTR: - if (APITYPE_C_STR_PTR == dataType) { - temp = strlen(parms->smapiBufferCursor); - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " C string found. Length %d\n", temp); - TRACE_END_DEBUG(vmapiContextP, line); - } else { - GET_INT(temp, parms->smapiBufferCursor); - structByteCount += 4; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - if (dataType == APITYPE_CHARBUF_LEN) { - sprintf(line, " Charbuf with length %d found.\n", temp); - } else { - sprintf(line, " String with length %d found.\n", temp); - } - TRACE_END_DEBUG(vmapiContextP, line); - } - - // If the string size is incorrect, display error and return. - if (temp < table[tableIndex][COL_2_MINSIZE]) // Check for less than min first - { - sprintf( - line, - "String size found: %d (@ %p), not in correct range %d-%d \n", - temp, (parms->smapiBufferCursor - 4), - table[tableIndex][COL_2_MINSIZE], - table[tableIndex][COL_3_MAXSIZE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, line); - return PARSER_ERROR_INVALID_STRING_SIZE; - } - // If max is not -1, then check for max - if (-1 != table[tableIndex][COL_3_MAXSIZE] && temp - > table[tableIndex][COL_3_MAXSIZE]) { - sprintf( - line, - "String size found: %d (@ %p), not in correct range %d-%d \n", - temp, (parms->smapiBufferCursor - 4), - table[tableIndex][COL_2_MINSIZE], - table[tableIndex][COL_3_MAXSIZE]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, line); - return PARSER_ERROR_INVALID_STRING_SIZE; - } - - // If scan update the string byte count - if (mode == scan) { - if (temp > 0) { - parms->outStringByteCount += (temp + 1); - } - if (dataType == APITYPE_CHARBUF_LEN) { - tableIndex++; // Position at the char buf count in the table - } - } else { // If populate then set the char * in struct; copy the string into the buffer - if (temp > 0) { - *((char **) ((parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET]))) - = parms->inStringCursor; - - // If this ia a null terminated string just just strcpy, else use memcpy - if (APITYPE_C_STR_PTR == dataType) { - strcpy(parms->inStringCursor, - parms->smapiBufferCursor); - parms->inStringCursor += temp + 1; - } else { - // Copy the string into the string buffer and add zero terminator - TRACE_START(vmapiContextP, - TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "Memcopying string data from %p into %p for length %d \n", - parms->smapiBufferCursor, - parms->inStringCursor, temp); - TRACE_END_DEBUG(vmapiContextP, line); - memcpy(parms->inStringCursor, - parms->smapiBufferCursor, temp); - parms->inStringCursor += temp; - - if (APITYPE_STRING_LEN == dataType) { - *parms->inStringCursor = '\0'; - parms->inStringCursor++; - TRACE_START(vmapiContextP, - TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "String found Value '%s' next avail struct pointer %p \n", - *((char**) (parms->inStructAddrs[structIndex] - + (structCounter - * outStructSize) - + +table[tableIndex][COL_6_SIZE_OR_OFFSET])), - parms->inStringCursor); - TRACE_END_DEBUG(vmapiContextP, line); - } else // Char buffer, so no need to add null terminator, but must update count field - { - tableIndex++; // Position at the char buf count in the table - *((int*) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])) - = temp; - TRACE_START(vmapiContextP, - TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf( - line, - "Charbuf count at table index %d updated \n", - tableIndex); - TRACE_END_DEBUG(vmapiContextP, line); - } - } - } else { - *((char**) (parms->inStructAddrs[structIndex] - + (structCounter * outStructSize) - + table[tableIndex][COL_6_SIZE_OR_OFFSET])) - = NULL; - } - } - if (APITYPE_C_STR_PTR == dataType) { - temp++; // Add on a byte for zero terminator - } - parms->smapiBufferCursor += temp; - structByteCount += temp; - break; - - case APITYPE_ARRAY_LEN: - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " Array found.\n"); - TRACE_END_DEBUG(vmapiContextP, line); - // Call a subroutine to handle this - if (0 != (rc = handleArrays(vmapiContextP, mode, &tableIndex, - table, parms))) - return rc; - - break; - - case APITYPE_ARRAY_STRUCT_COUNT: // Should not get here, subroutine should be handling this - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - break; - - default: // Error - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsUnexpected, - "Parser found a problem in the internal table\n"); - return PARSER_ERROR_INVALID_TABLE; - break; - } - tableIndex++; - } - structCounter++; - - if (noBufferStructLen) { - arrayByteCount += structByteCount; - } else { - arrayByteCount += structByteCount + 4; // Add in struct len field also - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, " current arrayByteCount subtotal is %d \n", - arrayByteCount); - TRACE_END_DEBUG(vmapiContextP, line); - } - *tableStartingIndex = tableMaxIndex; - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "table starting Index on return is %d \n", - *tableStartingIndex); - TRACE_END_DEBUG(vmapiContextP, line); - return 0; -} - -/** - * This helper function will handle connecting and reading of the SMAPI buffer data. - */ -int getAndParseSmapiBuffer( - struct _VmApiInternalContext* vmapiContextP, - char * * inputPp, // input buffer pointer pointer - int inputSize, tableLayout parserTable, char * parserTableName, - char * * outData //Output pointer for base structure -) { - int sockDesc; - tableParserParms parserParms; - int requestId; - int tempSize; - int * pReturnCode; - int * pReasonCode; - int rc, i, j; - char line[BUFLEN]; - char * smapiOutputP = 0; - rc = 0; - const int SLEEP_TIMES[SEND_RETRY_LIMIT] = { 0, 8, 16, 16 }; - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_PARSER, - TRACELEVEL_DETAILS); - sprintf(line, "Table being parsed: <%s> \n", parserTableName); - TRACE_END_DEBUG(vmapiContextP, line); - - // Initialize our socket - if (0 != (rc = smSocketInitialize(vmapiContextP, &sockDesc))) { - FREE_MEMORY(*inputPp); - return rc; - } - TRACE_START(vmapiContextP, TRACEAREA_SMAPI_ONLY, TRACELEVEL_DETAILS); - sprintf(line, "Socket write starting for <%s> \n", parserTableName); - TRACE_END_DEBUG(vmapiContextP, line); - - // Retry the send if the error detected is ok to retry - for (j = 0;; j++) { - if (0 != (rc = smSocketWrite(vmapiContextP, sockDesc, *inputPp, - inputSize))) { - if (rc == SOCKET_WRITE_RETRYABLE_ERROR) { - if (j < SEND_RETRY_LIMIT) { - // Delay for a while to give SMAPI some time to restart - if (SLEEP_TIMES[j] > 0) { - sleep(SLEEP_TIMES[j]); - } - continue; - } - // Change the internal return code to general write one - rc = SOCKET_WRITE_ERROR; - } - FREE_MEMORY(*inputPp); - TRACE_START(vmapiContextP, TRACEAREA_SMAPI_ONLY, TRACELEVEL_DETAILS); - sprintf( - line, - "Socket write for <%s> did not complete after %d retries \n", - parserTableName, SEND_RETRY_LIMIT); - TRACE_END_DEBUG(vmapiContextP, line); - return rc; - } - break; - } - - FREE_MEMORY(*inputPp); - - // Get the request id - if (0 - != (rc = smSocketRead(vmapiContextP, sockDesc, (char*) &requestId, - 4))) { - sprintf(line, "Socket %d receive of the requestId failed\n", sockDesc); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsUnexpected, line); - return rc; - } - - // Read in the output length - if (0 - != (rc = smSocketRead(vmapiContextP, sockDesc, (char *) &tempSize, - 4))) { - sprintf(line, "Socket %d receive of the buffer length failed\n", - sockDesc); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcIucv, - RsUnexpected, line); - return rc; - } - tempSize = ntohl(tempSize); - - // Read in the rest of the output buffer - if (tempSize >= (3* 4 )) // Must have at least 3 more ints - { - if (0 == (smapiOutputP = malloc(tempSize))) { - sprintf(line, "Insufficiant memory (request=%d bytes)\n", tempSize); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsNoMemory, line); - return MEMORY_ERROR; - } - - if (0 != (rc = smSocketRead(vmapiContextP, sockDesc, smapiOutputP, - tempSize))) { - FREE_MEMORY(smapiOutputP); - return rc; - } - - if (0 != (rc = smSocketTerminate(vmapiContextP, sockDesc))) { - FREE_MEMORY(smapiOutputP); - return rc; - } - - TRACE_START(vmapiContextP, TRACEAREA_SMAPI_ONLY, TRACELEVEL_DETAILS); - pReturnCode = (int *) (smapiOutputP + 4); - pReasonCode = (int *) (smapiOutputP + 8); - sprintf(line, "SMAPI return code %d reason code %d \n", *pReturnCode, - *pReasonCode); - TRACE_END_DEBUG(vmapiContextP, line); - - // Scan the SMAPI output data to get sizes of structures and strings. - // A non zero return code indicates errors. - parserParms.smapiBufferCursor = smapiOutputP; - parserParms.dataBufferSize = tempSize; - - rc = parseBufferWithTable(vmapiContextP, scan, parserTable, - &parserParms); - if (rc != 0) { - // If we have an error because of invalid string size, dump out the - // buffer to help with diagnosis. Limit the dump to 5000 characters - if (rc == PARSER_ERROR_INVALID_STRING_SIZE) { - if (tempSize > 5000) { - dumpArea(vmapiContextP, smapiOutputP, 5000); - } else { - dumpArea(vmapiContextP, smapiOutputP, tempSize); - } - - } - FREE_MEMORY(smapiOutputP); - return rc; - } - - // We can add up all the storage or get each structure independently, do independent for now - for (i = 0; i < MAX_STRUCT_ARRAYS; i++) { - if (parserParms.outStructSizes[i] == 0 - || parserParms.outStructCount[i] == 0) - continue; - parserParms.inStructAddrs[i] = smMemoryGroupAlloc(vmapiContextP, - parserParms.outStructSizes[i] - * parserParms.outStructCount[i]); - if (parserParms.inStructAddrs[i] == 0) { - FREE_MEMORY(smapiOutputP); - sprintf(line, "Insufficiant memory (request=%d bytes)\n", - parserParms.outStructSizes[i] - * parserParms.outStructCount[i]); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, line); - return MEMORY_ERROR; - } - } - - // If any string data, just get one chunk of storage for that - if (parserParms.outStringByteCount > 0) { - parserParms.inStringCursor = smMemoryGroupAlloc(vmapiContextP, - parserParms.outStringByteCount); - if (parserParms.inStringCursor == 0) { - FREE_MEMORY(smapiOutputP); - sprintf(line, "Insufficiant memory (request=%d bytes)\n", - parserParms.outStringByteCount); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, line); - return MEMORY_ERROR; - } - } - - // Set the output pointer to the level 0 structure's storage - *outData = parserParms.inStructAddrs[0]; - - parserParms.smapiBufferCursor = smapiOutputP; // reset the output cursor pointer - - rc = parseBufferWithTable(vmapiContextP, populate, parserTable, - &parserParms); - if (rc != 0) { - FREE_MEMORY(smapiOutputP); - return rc; - } - - } else { - sprintf(line, "Insufficiant memory (request=%d bytes)/n", - parserParms.outStringByteCount); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, line); - return INVALID_DATA; // Not enough data returned - } - FREE_MEMORY(smapiOutputP); - return 0; -} diff --git a/zhcp/zhcp-build/resource_access/src/smapiUtilities.c b/zhcp/zhcp-build/resource_access/src/smapiUtilities.c deleted file mode 100644 index 5dca5fa..0000000 --- a/zhcp/zhcp-build/resource_access/src/smapiUtilities.c +++ /dev/null @@ -1,2265 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smPublic.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vmapiSystem.h" -#include "vmapiAsynchronous.h" -#include "vmapiQuery.h" -#include "smapiTableParser.h" -#include "smSocket.h" - -#define VMAPILIB "libvmapi.so" - -int vmbkendSockaddrFileInfo(struct _VmApiInternalContext* vmapiContextP, - int readOrWrite, struct sockaddr_in *saddr); - -// Externally visible storage for trace -smTrace externSmapiTraceFlags = { 0 }; - -// Semaphore locking fields for trace and the backend -enum SemaphoreIndex { - ContextSemaphoreIndex = 0, TraceSemaphoreIndex = 1, - BackendSemaphoreIndex = 2, NumberOfSemaphores -}; - -// ------------ Context ones ------------ -static struct sembuf contextSemaphoreReserve[] = { ContextSemaphoreIndex, -1, - SEM_UNDO }; -static const int contextSemaphoreReserveN = sizeof(contextSemaphoreReserve) - / sizeof(contextSemaphoreReserve[0]); - -static struct sembuf contextSemaphoreRelease[] = { ContextSemaphoreIndex, 1, - SEM_UNDO }; -static const int contextSemaphoreReleaseN = sizeof(contextSemaphoreRelease) - / sizeof(contextSemaphoreRelease[0]); - -// ------------ Trace ones ------------ -static struct sembuf traceSemaphoreReserve[] = { TraceSemaphoreIndex, -1, - SEM_UNDO }; -static const int traceSemaphoreReserveN = sizeof(traceSemaphoreReserve) - / sizeof(traceSemaphoreReserve[0]); - -static struct sembuf traceSemaphoreRelease[] = { TraceSemaphoreIndex, 1, - SEM_UNDO }; -static const int traceSemaphoreReleaseN = sizeof(traceSemaphoreRelease) - / sizeof(traceSemaphoreRelease[0]); - -// ------------ VMbackend ones ------------ -static struct sembuf backendSemaphoreReserve[] = { BackendSemaphoreIndex, -1, - SEM_UNDO }; -static const int backendSemaphoreReserveN = sizeof(backendSemaphoreReserve) - / sizeof(backendSemaphoreReserve[0]); - -static struct sembuf backendSemaphoreRelease[] = { BackendSemaphoreIndex, 1, - SEM_UNDO }; -static const int backendSemaphoreReleaseN = sizeof(backendSemaphoreRelease) - / sizeof(backendSemaphoreRelease[0]); - -pthread_mutex_t mutex; -pthread_cond_t thread_initialized_cv; - -int checkAbbreviation(const char* aStringP, - const Abbreviation* anAbbreviationListP, int anAbbreviationN) { - - int x; - int checkL; - int stringL; - - int isAbbreviation = 0; - if (aStringP == 0) - return 0; - - stringL = strlen(aStringP); - - for (x = 0; x < anAbbreviationN; ++x) { - checkL = anAbbreviationListP[x].minimum; - if (checkL > stringL) - continue; - if (0 == strncasecmp(aStringP, anAbbreviationListP[x].nameP, checkL)) { - isAbbreviation = 1; - break; - } - } - - return isAbbreviation; - -} - -int checkBoolean(const char* aStringP) { - - const Abbreviation booleanTrues[] = { { "TRUE", 1 }, { "YES", 1 }, - { "1", 1 } }; - - return checkAbbreviation(aStringP, booleanTrues, (sizeof(booleanTrues) - / sizeof(booleanTrues[0]))); - -} - -int checkPrefixCommand(const char* aCommandP) { - - const Abbreviation prefixCommands[] = { { "REQUEST", 3 }, { "TOSYS", 5 }, { - "TONODE", 6 }, { "ASUSER", 2 }, { "BYUSER", 2 }, { "FORUSER", 3 }, - { "PRESET", 6 }, { "MULTIUSER", 5 }, { "ATNODE", 6 }, - { "ATSYS", 5 } }; - - return checkAbbreviation(aCommandP, prefixCommands, (sizeof(prefixCommands) - / sizeof(prefixCommands[0]))); - -} - -const char* -contextGetMessageFilename(struct _VmApiInternalContext* vmapiContextP, - char* aBufferP, int aBufferS) { - - char line[LINESIZE]; - int len = 0; - const char* msgName = "messages"; - const char* msgSuffixName = ".eng"; // Language-dependent - char* pathP = 0; - int pathL = 0; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Obtain VMAPI environment variable - memset(aBufferP, 0, aBufferS); - pathP = getenv("VMAPI"); - - if (pathP) { - pathL = strlen(pathP); - len = pathL + 12; // Adjust once we know NLS file structure - if (len > aBufferS) { - sprintf( - line, - "contextGetMessageFilename: Insufficient path buffer size; needed %d, have %d.", - len, (aBufferS - 1)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcContext, - RsInternalBufferTooSmall, line); - } - strncpy(aBufferP, pathP, pathL); - if (aBufferP[pathL - 1] == '/') { - strcat(aBufferP, ".cimvm/"); - } else { - strcat(aBufferP, "/.cimvm/"); - } - } else { - strcpy(aBufferP, "/root/.cimvm/"); - } - - strcat(aBufferP, msgName); // Adjust when we know real NLS stuff - strcat(aBufferP, msgSuffixName); - - return aBufferP; - -} - -int createDirectories(const char* aFilenameP) { - - int filenameL = strlen(aFilenameP); - char filename[LINESIZE]; - int rc; - char* sP = 0; - char* eP = 0; - - if (filenameL >= (sizeof(filename) - 1)) - return 0; - - memset(filename, 0, sizeof(filename)); - strcpy(filename, aFilenameP); - - sP = filename; - eP = filename + sizeof(filename) - 1; - while ((sP < eP) && (sP = strchr(sP + 1, '/'))) { - *sP = '\0'; - mkdir(filename, S_IRWXU); - *sP = '/'; - } - - return 0; - -} - -int initializeThreadSemaphores(struct _VmApiInternalContext* vmapiContextP, - const char* aContextNameP, int aCreateFlag) { - char pathAndFile[PATHLENGTH + strlen(CACHE_SEMAPHORE_FILENAME)]; - FILE* idFileP = 0; - int len = 0; - char line[LINESIZE]; - const char* logFilenameP = 0; - union semun { - int val; - struct semid_ds* buf; - ushort* array; - } semArgument; - int semInitRequired = 0; - int pathLength = 0; - char* pathPtr = 0; - int rc = 0; - int savedSize = 0; - - memset(vmapiContextP->path, 0, sizeof(vmapiContextP->path)); // Clear out path string - memset(pathAndFile, 0, sizeof(pathAndFile)); - - // Save the name passed in; into the context if specified - if (strlen(aContextNameP) > 0) { - strncpy(vmapiContextP->name, aContextNameP, sizeof(vmapiContextP->name) - - 1); - } - - // Obtain VMAPI environment variable - pathPtr = getenv("ZVMMAP_VAR"); - if (pathPtr) { // ZVMMAP_VAR is defined - pathLength = strlen(pathPtr); - len = pathLength + strlen(CACHE_SEMAPHORE_DIRECTORY); - if (len > sizeof(pathAndFile)) { - sprintf( - line, - "contextReserve: Insufficient path buffer size; needed %d, have %d.", - len, sizeof(pathAndFile) - 1); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcContext, - RsInternalBufferTooSmall, line); - return PROCESSING_ERROR; - } - strncpy(vmapiContextP->path, pathPtr, sizeof(vmapiContextP->path) - - (strlen(CACHE_SEMAPHORE_DIRECTORY) + 2)); - len = strlen(vmapiContextP->path); - if (vmapiContextP->path[len - 1] == '/') { - strcat(vmapiContextP->path, CACHE_SEMAPHORE_DIRECTORY); // Add on .vmapi/ directory - } else { - strcat(vmapiContextP->path, "/"); - strcat(vmapiContextP->path, CACHE_SEMAPHORE_DIRECTORY); - } - } else { // ZVMMAP_VAR is undefined, set default - strcpy(vmapiContextP->path, CACHE_PATH_DEFAULT); - } - - // Create or obtain semaphore set - strcpy(pathAndFile, vmapiContextP->path); - strcat(pathAndFile, CACHE_SEMAPHORE_FILENAME); - createDirectories(pathAndFile); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "initializeThreadSemaphores: Semaphore file name is %s \n", - pathAndFile); - TRACE_END_DEBUG(vmapiContextP, line); - - // Try to open or create a file that can be used for semaphore handle - FILE* semFileP = fopen(pathAndFile, "r"); - if (!semFileP) { - semFileP = fopen(pathAndFile, "w"); - } - if (semFileP) { - fclose(semFileP); - } - - vmapiContextP->semKey = ftok(pathAndFile, 'V'); - vmapiContextP->semId = semget(vmapiContextP->semKey, 2, 0600); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "initializeThreadSemaphores: semKey = %d \n", - vmapiContextP->semKey); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "initializeThreadSemaphores: semId = %d \n", - vmapiContextP->semId); - TRACE_END_DEBUG(vmapiContextP, line); - - if ((0 > vmapiContextP->semId) && (ENOENT == errno)) { - semInitRequired = 1; - vmapiContextP->semId = semget(vmapiContextP->semKey, - NumberOfSemaphores, 0600 | IPC_CREAT); - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER_SOCKET, - TRACELEVEL_DETAILS); - sprintf(line, "initializeThreadSemaphores: semInitRequired = %d \n", - semInitRequired); - TRACE_END_DEBUG(vmapiContextP, line); - - if (0 > vmapiContextP->semId) { - sprintf( - line, - "contextReserve: Unable to create semaphore array identified by %s; errno=%d text: %s", - pathAndFile, errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotCreated, line); - return PROCESSING_ERROR; - } - - if (semInitRequired) { - semArgument.val = 1; - rc = semctl(vmapiContextP->semId, TraceSemaphoreIndex, SETVAL, - semArgument); - if (0 > rc) { - sprintf(line, - "Unable to initialize Trace semaphore; errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotCreated, line); - return PROCESSING_ERROR; - } - - rc = semctl(vmapiContextP->semId, BackendSemaphoreIndex, SETVAL, - semArgument); - if (0 > rc) { - sprintf( - line, - "Unable to initialize Backend semaphore; errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotCreated, line); - return PROCESSING_ERROR; - } - rc = semctl(vmapiContextP->semId, ContextSemaphoreIndex, SETVAL, - semArgument); - if (0 > rc) { - sprintf( - line, - "Unable to initialize context semaphore; errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotCreated, line); - return PROCESSING_ERROR; - } - } - - // Obtain the Context semaphore before manipulating context related stuff - rc = semop(vmapiContextP->semId, contextSemaphoreReserve, - contextSemaphoreReserveN); - if (rc < 0) { - sprintf(line, - "contextReserve: semop (decrement) failed; errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotObtained, line); - return PROCESSING_ERROR; - } - - // Create or obtain context for the name passed in - strcpy(pathAndFile, vmapiContextP->path); - strcat(pathAndFile, CACHE_DIRECTORY); - createDirectories(pathAndFile); - - // Release the Context semaphore after manipulating context related stuff - rc = semop(vmapiContextP->semId, contextSemaphoreRelease, - contextSemaphoreReleaseN); - if (rc < 0) { - sprintf(line, - "contextReserve: semop (increment) failed, errno=%d text: %s", - errno, strerror(errno)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsSemaphoreNotReleased, line); - return PROCESSING_ERROR; - } - vmapiContextP->contextCreatedFlag = 1; // Set flag to indicate context set up - return 0; -} - -/** - * Unit test code - */ -void dumpArea(struct _VmApiInternalContext* vmapiContextP, void * pstor, - int len) { - unsigned int offset, i, j, k; - char trans[17]; - char line[LINESIZE]; - char phrase[80]; - unsigned char storByte; - int transAvail; - offset = 0; - transAvail = 0; - for (k = 0; k < sizeof(trans); k++) { - trans[k] = '\0'; - } - - storByte = *((char *) pstor); - sprintf(line, "=== dump of area %p for length %d ", pstor, len); - for (i = 0; i < len; i++) { - j = i % 16; - if (j == 0) { - if (transAvail) { - sprintf(phrase, " %s", trans); - strcat(line, phrase); - for (k = 0; k < sizeof(trans); k++) { - trans[k] = '\0'; - } - transAvail = 0; - } - strcat(line, "\n"); - logLine(vmapiContextP, LOGLINE_DEBUG, line); - sprintf(line, "%6d %14p ", offset, (pstor + offset)); - offset += 16; - } else if (0 == (k = i % 4)) { - strcat(line, " "); - } - storByte = *((char*) (pstor + i)); - if (isprint(storByte)) { - trans[j] = storByte; - } else { - trans[j] = '.'; - } - transAvail = 1; - - sprintf(phrase, "%02X", storByte); - strcat(line, phrase); - - } - if (transAvail) { - for (k = j + 1; k < 16; k++) { - if (0 == k % 4) { - strcat(line, " "); - } - strcat(line, " "); - } - sprintf(phrase, " %s", trans); - strcat(line, phrase); - } - strcat(line, "\n"); - logLine(vmapiContextP, LOGLINE_DEBUG, line); -} - -void errorLog(struct _VmApiInternalContext* vmapiContextP, - const char * functionName, const char * lineNumber, int aRc, - int aReason, const char* aLineP) { - - char line[LINESIZE]; - - sprintf(line, "%s:%s %s", functionName, lineNumber, aLineP); - - vmapiContextP->rc = aRc; - vmapiContextP->reason = aReason; - errorLine(vmapiContextP, line); - -} - -void errorLine(struct _VmApiInternalContext* vmapiContextP, const char* aLineP) { - int lineL = strlen(aLineP); - - logLine(vmapiContextP, 'E', aLineP); - - // If this is the first error for this context, save it - if (!vmapiContextP->firstFailureCaptured) { - strncpy(vmapiContextP->strFirstFailureMsg, aLineP, - FIRST_FAILURE_MESSAGE_MAX_LEN); - vmapiContextP->strFirstFailureMsg[FIRST_FAILURE_MESSAGE_MAX_LEN] = '\0'; - vmapiContextP->firstFailureCaptured = 1; // 1:true - } - -} - -char* -getArg(int anIndex, int anArgc, const char** anArgvPP, const char* aDefaultP) { - - int x = anIndex; - - if (x > (anArgc - 1)) - return (char*) aDefaultP; - - return (char*) (anArgvPP[x] ? anArgvPP[x] : aDefaultP); - -} - -Dedicate* -getDedicates(struct _VmApiInternalContext* vmapiContextP) { - - char* itemP = 0; - Record* recordP = 0; - - char* lastP = 0; - char line[LINESIZE]; - char tokenLine[LINESIZE]; - - Dedicate* currentDedicateP = 0; - Dedicate* dedicatesP = 0; - Dedicate* newDedicateP = 0; - - recordP = vmapiContextP->outputStream.currentP; - - while (recordP) { - - strncpy(tokenLine, recordP->data, sizeof(tokenLine)); - - itemP = strtok_r(tokenLine, " ", &lastP); - - if (itemP && (0 == strcmp(itemP, "DEDICATE"))) { - - newDedicateP = calloc(1, sizeof(Dedicate)); - if (newDedicateP == 0) { - while (dedicatesP != 0) { - currentDedicateP = dedicatesP->nextP; - free(dedicatesP); - dedicatesP = currentDedicateP; - } - sprintf(line, "%s: Insufficiant memory (request=%d bytes)", - "getDedicates", sizeof(Dedicate)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, line); - return 0; - } - - if (currentDedicateP == 0) { - dedicatesP = newDedicateP; - currentDedicateP = newDedicateP; - } else { - currentDedicateP->nextP = newDedicateP; - currentDedicateP = newDedicateP; - } - newDedicateP->nextP = 0; - - itemP = strtok_r(0, " ", &lastP); - if (itemP) { - sscanf(itemP, "%x", &(newDedicateP->vnum)); - itemP = strtok_r(0, " ", &lastP); - } - - if (itemP) { - sscanf(itemP, "%x", &(newDedicateP->rnum)); - itemP = strtok_r(0, " ", &lastP); - } - - } - - recordP = recordP->nextP; - - } - - return dedicatesP; - -} - -Minidisk* -getMinidisks(struct _VmApiInternalContext* vmapiContextP) { - - char* itemP; - Record* recordP = 0; - - char* lastP = 0; - char line[LINESIZE]; - char tokenLine[LINESIZE]; - - Minidisk* currentMinidiskP = 0; - Minidisk* minidisksP = 0; - Minidisk* newMinidiskP = 0; - - recordP = vmapiContextP->outputStream.firstP; - - while (recordP) { - - strncpy(tokenLine, recordP->data, sizeof(tokenLine)); - itemP = strtok_r(tokenLine, " ", &lastP); - - if (itemP && (0 == strcmp(itemP, "MDISK"))) { - - newMinidiskP = calloc(1, sizeof(Minidisk)); - if (newMinidiskP == 0) { - while (minidisksP != 0) { - currentMinidiskP = minidisksP->nextP; - free(minidisksP); - minidisksP = currentMinidiskP; - } - sprintf(line, "%s: Insufficiant memory (request=%d bytes)", - "getMinidisks", sizeof(Minidisk)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, line); - return 0; - } - - if (currentMinidiskP == 0) { - minidisksP = newMinidiskP; - currentMinidiskP = newMinidiskP; - } else { - currentMinidiskP->nextP = newMinidiskP; - currentMinidiskP = newMinidiskP; - } - - newMinidiskP->nextP = 0; - itemP = strtok_r(0, " ", &lastP); - if (itemP) { - sscanf(itemP, "%x", &(newMinidiskP->address)); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - strncpy(newMinidiskP->type, itemP, sizeof(newMinidiskP->type)); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - sscanf(itemP, "%d", &newMinidiskP->location); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - sscanf(itemP, "%d", &newMinidiskP->extent); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - strncpy(newMinidiskP->volser, itemP, - sizeof(newMinidiskP->volser)); - itemP = strtok_r(0, " ", &lastP); - } - if (itemP) { - strncpy(newMinidiskP->mode, itemP, sizeof(newMinidiskP->mode)); - } - - } - - recordP = recordP->nextP; - - } - - return minidisksP; - -} - -/** - * Return 1 If a real device number is of an OSA type - * 0 Otherwise (or on failure to check) - */ -int isOSA(struct _VmApiInternalContext* vmapiContextP, char* rdev) { - smMemoryGroupContext localMemoryGroup; - smMemoryGroupContext * saveMemoryGroup; - vmApiSystemIoQueryOutput * ptrCommandOutput; - char *tokptr; - char *delim = " "; - char *tok; - int osaFound = 0; - int x; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - - smMemoryGroupInitialize(vmapiContextP); - - if (smSystem_IO_Query(vmapiContextP, rdev, &ptrCommandOutput)) { - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - return osaFound; - } - - // Loop through all the output found looking for "OSA", "OSD", or "IQDC" - // Output string will be "chpid string" or just "chpid" - for (x = 0; x < ptrCommandOutput->chipidCount; x++) { - // Get the chipid id first - tok = strtok_r(ptrCommandOutput->chipidList->vmapiString, delim, - &tokptr); - // See if there is data for this chipid - if (tok = strtok_r(NULL, delim, &tokptr)) { - if (!strcmp(tok, "OSA") || !strcmp(tok, "OSD") || !strcmp(tok, - "IQDC")) { - osaFound = 1; - } - } - } - - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - - return osaFound; - -} - -/** - * Append data to a list - */ -void listAppendLine(struct _VmApiInternalContext* vmapiContextP, List* aListP, - const char* aLineP) { - - int lineL = strlen(aLineP); - - Record* newRecordP = smMemoryGroupAlloc(vmapiContextP, sizeof(Record) - + lineL + 1); - if (newRecordP == 0) - return; - - strncpy(newRecordP->data, aLineP, lineL); - - listAppendRecord(aListP, newRecordP); - -} - -/** - * Append data to a list - */ -void listAppendRecord(List* aListP, Record* aRecordP) { - - if (aListP->firstP == 0) { - aListP->firstP = aRecordP; - } else { - if (aListP->currentP == 0) { - aListP->currentP = aListP->firstP; - while (aListP->currentP->nextP) { - aListP->currentP = aListP->currentP->nextP; - } - } - aListP->currentP->nextP = aRecordP; - } - aListP->currentP = aRecordP; - ++(aListP->size); - aRecordP->nextP = 0; - -} - -/** - * Delete the current record from the list - */ -void listDeleteCurrent(List* aListP) { - - Record* currentP = 0; - Record* prevP = 0; - - if (aListP == 0) - return; - - if (aListP->firstP == 0) - return; - - // Current not set yet ? - if (aListP->currentP == 0) - return; - - currentP = aListP->currentP; - if (aListP->firstP == aListP->currentP) { - aListP->currentP = aListP->firstP->nextP; - aListP->firstP = aListP->firstP->nextP; - } else { - // Find the record before aListP->currentP - prevP = aListP->firstP; - while (prevP && (prevP->nextP != currentP)) { - prevP = prevP->nextP; - } - // Remove recordP from list - if (prevP) { - prevP->nextP = currentP->nextP; - } - } - - free(currentP); - --(aListP->size); - -} - -/** - * Dequeue a line from the front of the list - */ -Record* -listDequeueRecord(List* aListP) { - - Record* recordP = 0; - - if (aListP == 0) - return 0; - - if (aListP->firstP == 0) - return 0; - - recordP = aListP->firstP; - - if (recordP == aListP->currentP) { - aListP->currentP = recordP->nextP; - } - - aListP->firstP = recordP->nextP; - - --(aListP->size); - - return recordP; - -} - -/** - * Free all records from a list - */ -void listFree(List* aListP) { - - Record* recordP = aListP->firstP; - Record* nextP = 0; - - while (recordP) { - nextP = recordP->nextP; - free(recordP); - recordP = nextP; - } - - aListP->firstP = 0; - aListP->currentP = 0; - aListP->size = 0; - -} - -/** - * Return Append data to a list - */ -const char* -listNextLine(List* aListP) { - - const Record* recordP = listNextRecord(aListP); - if (recordP == 0) - return 0; - return recordP->data; - -} - -/** - * Return Append data to a list - */ -const Record* -listNextRecord(List* aListP) { - - if (aListP == 0) - return 0; - - if (aListP->currentP == 0) { - // This causes a wrap around after the 0 record was returned once, - // that is, after "end of list" was returned once. - aListP->currentP = aListP->firstP; - } else { - aListP->currentP = aListP->currentP->nextP; - } - - return aListP->currentP; - -} - -/** - * Free all records from a list - */ -void listReset(List* aListP) { - - if (aListP == 0) - return; - - aListP->currentP = 0; - -} - -void logLine(struct _VmApiInternalContext* vmapiContextP, char aSeverity, - const char* aLineP) { - - int blankN = 0; - const char* blanks = " "; - char line[LINESIZE]; - const char* prefix = "+ "; - int prefixL = 0; - int syslogSeverity = LOG_INFO; - struct tm *tP; - struct tm tm; - time_t timeValue; - pid_t pidTrace; - pthread_t myThread; - int temp; - - pidTrace = getpid(); - myThread = pthread_self(); - - switch (aSeverity) { - case 'D': - syslogSeverity = LOG_DEBUG; - break; - case 'E': - syslogSeverity = LOG_ERR; - break; - case 'I': - syslogSeverity = LOG_INFO; - break; - case 'N': - syslogSeverity = LOG_NOTICE; - break; - case 'W': - syslogSeverity = LOG_WARNING; - break; - case 'X': - syslogSeverity = LOG_ERR; - break; - default: - syslogSeverity = LOG_INFO; - break; - } - - if (vmapiContextP->printOffset <= 0) { - sprintf(line, "%d.%lu ", pidTrace, myThread); // add process id and blank - temp = strlen(line); - strncpy(line + temp, aLineP, LINESIZE - temp); - } else { - prefixL = 2 * vmapiContextP->printOffset; - if (prefixL > 10) - prefixL = 10; - snprintf(line, LINESIZE, "%*.s%s\n", prefixL, prefix, aLineP); - } - - openlog(NULL, 0, LOG_LOCAL7); - syslog(syslogSeverity, "%s", line); - closelog(); -} - -void outputLine(struct _VmApiInternalContext* vmapiContextP, - const char* aLineP, int aLogFlag) { - - if (aLogFlag) - logLine(vmapiContextP, ' ', aLineP); - listAppendLine(vmapiContextP, &vmapiContextP->outputStream, aLineP); - -} - -/** - * This function will read the trace file if found and set all the - * trace flags to what is in the file. If a flag is not set in the file - * then that trace is left as it was in the trace structure. - * If the trace file is not found, then this function only sets the - * flag in the context to indicate that this function has been called. - */ -void readTraceFile(struct _VmApiInternalContext* vmapiContextP) { - char pathAndFile[PATHLENGTH + strlen(TRACE_LEVELS_FILE)]; - char* pathP = 0; - int pathLength = 0; - unsigned int newTraceFlags[TRACE_AREAS_COUNT]; - unsigned int newTraceFlagFound[TRACE_AREAS_COUNT]; - char lineData[LINESIZE]; - int lineDataLength; - char line[BUFLEN]; - FILE* traceFileP = 0; - int keywordIndex; - int traceSettingIndex; - int x; - int rc; - char * targetPtr; - - // Init new trace flags array - for (x = 0; x < TRACE_AREAS_COUNT; x++) { - newTraceFlags[x] = 0; - newTraceFlagFound[x] = 0; - } - - // Get the path and file name string for the trace command input - // Default it to the root .cimvm dir - memset(pathAndFile, 0, sizeof(pathAndFile)); - strcpy(pathAndFile, TRACE_LEVELS_FILE_DIRECTORY); // initialize to default path - strcat(pathAndFile, TRACE_LEVELS_FILE); // add on file name - - pathP = getenv("VMAPI"); // Is there a VMAPI environment variable set? - if (pathP) { - pathLength = strlen(pathP) + sizeof(TRACE_LEVELS_FILE) + 1; - if (pathLength > sizeof(pathAndFile)) { - sprintf( - line, - "readTraceFile: Insufficient path buffer size; needed %d, have %d.", - pathLength, sizeof(pathAndFile)); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcContext, - RsInternalBufferTooSmall, line); - return; - } - strncpy(pathAndFile, pathP, pathLength); - if (pathAndFile[pathLength - 1] == '/') { - strcat(pathAndFile, TRACE_LEVELS_FILE); - } else { - strcat(pathAndFile, "/"); - strcat(pathAndFile, TRACE_LEVELS_FILE); - } - } - - // Now open the file and figure out the trace flags to set/reset - traceFileP = fopen(pathAndFile, "r"); - if (traceFileP) { - // Look for keywords and comments in the trace command file - while (fgets(lineData, sizeof(lineData), traceFileP)) { - lineDataLength = strlen(lineData); - - // Ignore all 0 length input - if (0 == lineDataLength) { - continue; - } - - // Ignore comment lines - begin with '#' - if (0 != strncmp(lineData, "#", 1)) { - // Try to find a keyword match - keywordIndex = -1; - for (x = 0; x < TRACE_AREAS_COUNT; x++) { - if (0 == strncmp(lineData, TRACE_KEYWORDS[x], strlen( - TRACE_KEYWORDS[x]))) { - keywordIndex = x; - break; - } - } - // If no keyword found, log an error - if (keywordIndex == -1) { - sprintf(line, - "readTraceFile: Unknown keyword on line: <%s> \n", - lineData); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsFunctionUnknown, line); - return; - } - - targetPtr = strstr(lineData, "="); // Find the = sign - if (0 == targetPtr) { - sprintf(line, "readTraceFile: Missing = on line: <%s> \n", - lineData); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsFunctionUnknown, line); - return; - } - - // Look for a trace settings value - traceSettingIndex = -1; - for (x = 0; x < TRACE_LEVELS_COUNT; x++) { - if (0 != strstr(targetPtr, TRACE_LEVELS[x])) { - traceSettingIndex = x; - break; - } - } - - // If no trace setting keyword found, log an error - if (traceSettingIndex == -1) { - sprintf( - line, - "readTraceFile: Unknown trace setting on line: <%s> \n", - lineData); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsFunctionUnknown, line); - return; - } - - // Now set or reset the bits in the new trace flags variable - if (TRACELEVEL_OFF == traceSettingIndex) // if the trace is to be turned off - { - newTraceFlags[keywordIndex] = 0; - newTraceFlagFound[keywordIndex] = 1; - } else { - newTraceFlags[keywordIndex] - |= TRACE_FLAG_VALUES[traceSettingIndex]; - newTraceFlagFound[keywordIndex] = 1; - } - } - } - - // Set the trace flags pointed to from the context - // If there was a keyword found otherwise skip setting it - for (x = 0; x < TRACE_AREAS_COUNT; x++) { - if (newTraceFlagFound[x]) { - vmapiContextP->smTraceDetails->traceFlags[x] = newTraceFlags[x]; - } - } - - fclose(traceFileP); - - } - vmapiContextP->smTraceDetails->traceFileRead = 1; // Set flag that said we read/tried to read trace settings - return; -} - -char* -strip(char* aLineP, char anOption, char aChar) { - - char* lineP = aLineP; - char* lastP = 0; - int lineL = 0; - int x; - - if (lineP == 0) - return lineP; - - // Strip leading chars - if ((anOption == 'L') || (anOption == 'B')) { - - lineL = strlen(lineP); - if (lineL > 0) { - for (x = 0; x < lineL; ++x, ++lineP) { - if (*lineP != aChar) - break; - } - } - - } - - // Strip trailing chars - if ((anOption == 'T') || (anOption == 'B')) { - - lineL = strlen(lineP); - if (lineL > 0) { - lastP = lineP + lineL - 1; - for (x = lineL; x > 0; --x, --lastP) { - if (*lastP != aChar) - break; - *lastP = 0; - } - } - - } - - return lineP; -} - -void sysinfo(struct _VmApiInternalContext* vmapiContextP, int anArgc, - const char** anArgvPP) { - - char buffer[LINESIZE]; - char* bufferP = 0; - int len = 0; - - FILE* sysinfoP = fopen("/proc/sysinfo", "r"); - if (sysinfoP) { - rewind(sysinfoP); - while (bufferP = fgets(buffer, sizeof(buffer), sysinfoP)) { - len = strlen(bufferP); - if ((len > 0) && (bufferP[len - 1] == '\n')) { - bufferP[len - 1] = 0; - } - outputLine(vmapiContextP, bufferP, 0); - } - fclose(sysinfoP); - } - -} - -int testDigit(char aChar) { - - static char digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; - int x; - for (x = 0; x < (sizeof(digits) / sizeof(digits[0])); ++x) { - if (aChar == digits[x]) - return 1; - } - - return 0; - -} - -const char* -vmApiMessageText(VmApiInternalContext* contextP) { - const char* noCtxMsgP = "(No message available - VmApi context missing)"; - const char* noMsgP = "(No message available for return/reason code pair)"; - - char emsg[LINESIZE]; - int rc = 0; - int rs = 0; - int x = 0; - - const char* msgFilenameP = 0; - FILE* msgFileP = 0; - char completeMatch[20]; - char rcMatch[20]; - char* msgP = 0; - char* targetP = 0; - char* rcP = 0; - char* rsP = 0; - char rcS[6]; - char rsS[6]; - - if (contextP == 0) - return noCtxMsgP; - - strcpy(contextP->emsg, noMsgP); // Default - - char filename[sizeof(contextP->path) + 15]; // Adjust once NLS filenames settled - - // Message text comes from the translatable message file - char resultLine[LINESIZE]; - int resultLineL = 0; - msgFilenameP = contextGetMessageFilename(contextP, filename, - sizeof(filename)); - if (msgFilenameP) { - msgFileP = fopen(msgFilenameP, "r"); - if (msgFileP) { - // Look for matching 'VMAPI rc reason' in message file - while (fgets(resultLine, sizeof(resultLine), msgFileP)) { - resultLineL = strlen(resultLine); - if (0 != strncmp(resultLine, "#", 1)) { // Ignore comment lines - begin with '#' - if (0 == strncmp(resultLine, "VMAPI", 5)) { // Only if component is VMAPI //strip off second word (rc) and third word (reason) - targetP = strstr(resultLine, " "); // First blank - if (targetP) { - rcP = targetP + 1; - while (rcP && (*rcP != ' ')) - ++rcP; // First blank after rc - strncpy(rcS, targetP + 1, ((rcP) - (targetP + 1) - + 1)); - rc = atoi(rcS); - rsP = rcP + 1; // Skip blank - while (rsP && (*rsP != ' ')) - ++rsP; // First blank after rs - strncpy(rsS, rcP + 1, ((rsP) - (rcP + 1) + 1)); - rs = atoi(rsS); - - if ((rc == contextP->rc) - && (rs == contextP->reason)) { - - strcpy(contextP->emsg, resultLine); - break; - } - - // If no specific reason code matches, use return-code-only - // message. This requires that the rs=0 message for a specific - // return code be placed as the last message for that return - // code in the message file. - if ((rc == contextP->rc) && (rs == 0)) { - strcpy(contextP->emsg, resultLine); - break; - } - } - } - } - - } - // If message file can't be opened or msg isn't in file - return - // with the defaule message set above - } - - } - fclose(msgFileP); - return contextP->emsg; -} - -/** - * Procedure: vmbkendcacheEntryInvalidate - * - * Purpose: Mark the specified cache entry as invalid. - * - * Input: pointer to cache path - * name of the user ID to invalidate - * Output: - * 0 : invalidate performed successfully. - * 1 : invalidate unsuccessful because stat indicated ENOENT - * 2 : invalidate unsuccessful because stat got some other error - * 3 : invalidated by removing cache entry due to fopen failure. - * 4 : the fopen failed and the remove failed also. - * - * Operation: - * . Generate the name of the cache file based on the inputs - * . If the cache file can be opened, write 'Invalid' status to beginning - * . Else try to remove the file - */ -int vmbkendCacheEntryInvalidate(struct _VmApiInternalContext* vmapiContextP, - char *pathP, char *useridP) { - - char cacheEntry[CACHEENTRYLEN]; - char status[] = "INVALID"; - FILE* cFP; - int rc; - int exitrc; - struct stat statBuf; - char line[LINESIZE]; - int scaffold = 0; // If scaffolding wanted: No (0) Yes (1) - - int cacheFileFd; - struct flock fl; - - exitrc = 0; // Initialize to success - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - sprintf(cacheEntry, "%s%.8s.direct", pathP, useridP); - - // If the cache file doesn't exist, nothing to do - rc = stat(cacheEntry, &statBuf); - if (rc == -1) { - // Can't continue but check the reason for the stat failing. - if (errno == ENOENT) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendCacheEntryInvalidate: cache file (%s) does not exist.\n", - cacheEntry); - TRACE_END_DEBUG(vmapiContextP, line); - - return 1; - } else { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendCacheEntryInvalidate: stat() on (%s) got errno (0x%x)\n", - cacheEntry, errno); - TRACE_END_DEBUG(vmapiContextP, line); - - return 2; - } - } - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendCacheEntryInvalidate: About to invalidate cache entry (%s)\n", - cacheEntry); - TRACE_END_DEBUG(vmapiContextP, line); - - rc = remove(cacheEntry); - if (rc == -1) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendCacheEntryInvalidate: remove error on (%s), errno (0x%x)\n", - cacheEntry, errno); - TRACE_END_DEBUG(vmapiContextP, line); - - exitrc = 4; - } else { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendCacheEntryInvalidate: removed cache file (%s)\n", - cacheEntry); - TRACE_END_DEBUG(vmapiContextP, line); - - exitrc = 3; - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return exitrc; -} - -int vmbkendCheck(struct _VmApiInternalContext* vmapiContextP) { - - pid_t pid1, pid2, ppid; - int rc, status; - char buf[LINESIZE + LINESIZE]; - char line[LINESIZE]; - - pthread_t thread; - pthread_attr_t attr; - - rc = 0; - - int backendSemaphoreValue = 0; - void *vmapiPtr = NULL; - - // Check if backend already running and return in this case - backendSemaphoreValue = semctl(vmapiContextP->semId, BackendSemaphoreIndex, - GETVAL, 0); - - if (1 != backendSemaphoreValue) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendCheck: Backend apparently running; passing backend start \n"); - TRACE_END_DEBUG(vmapiContextP, line); - vmapiContextP->checkBackendFlag = 1; // Mark the backend as running - return rc; // Backend running - } - - // If vmbkend daemon not started, start it - // Create a pthread and call the vmbkendMain - vmapiPtr = (void*) dlopen(VMAPILIB, RTLD_NOW); // Load the library - - if (vmapiPtr == NULL) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendCheck: Loading library failed %s .\n", dlerror()); - TRACE_END_DEBUG(vmapiContextP, line); - } - - pthread_attr_init(&attr); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendCheck: Creating a pthread \n"); - TRACE_END_DEBUG(vmapiContextP, line); - - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - pthread_mutex_lock(&mutex); - rc = pthread_create(&thread, &attr, vmbkendMain, (void *) vmapiContextP); - - pthread_cond_wait(&thread_initialized_cv, &mutex); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendCheck: pthread created with rc = %d \n", rc); - TRACE_END_DEBUG(vmapiContextP, line); - - return 0; -} - -/** - * Procedure: vmbkendgetCachePath - * - * Purpose: Return the path to the $VMAPI/.vmapi/cache directory, where - * $VMAPI is the VMAPI environment variable. If VMAPI is not - * defined, the current working directory '.' is used. - * - * An example of the directory returned is as follows (note the - * slash at the end): - * - * /foo/bar/.vmapi/cache/ - * - * Input: pointer to string for where to put the cache path - * Output: none - * - * Operation: - * . Get VMAPI environment variable - * . Pull together the cache directory using the VMAPI value. - * - */ -void vmbkendGetCachePath(struct _VmApiInternalContext* vmapiContextP, - char *pathP) { - - char *getenvP = 0; - char line[LINESIZE]; - int retValue; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Obtain path to $VMAPI/.vmapi/cache - // If no (context) path string call to initialize things. - if (1 != vmapiContextP->contextCreatedFlag) { - retValue = initializeThreadSemaphores(vmapiContextP, "", 1); // Create context using no name to override current context name - if (retValue) { - sprintf( - line, - "vmbkendGetCachePath(): context reserve() returned error: %d\n", - retValue); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), RcRuntime, - RsUnexpected, line); - return; - } - } - strcpy(pathP, vmapiContextP->path); - - strcat(pathP, CACHE_DIRECTORY); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendGetCachePath: The cache path is (%s)\n", pathP); - TRACE_END_DEBUG(vmapiContextP, line); - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return; - -} - -void *vmbkendMain(void *context) { - - int argIndex; - int serverSock; - struct sockaddr_in serverSockaddr; - struct sockaddr_in serverSockaddr1; - struct sockaddr_in clientSockaddr; - struct sockaddr_in notificationSocketInfo; - struct sockaddr_in previousSockaddr; - - int socklen; - int rc; - int clientLen; - char readBuffer[BUFLEN]; - char userID[BUFLEN]; - unsigned int useridLength; - int bytesRead; - struct sembuf operations[1]; - - char cmd[BUFLEN]; - unsigned int cmdLength; - char subData[BUFLEN]; - unsigned int subDataLength; - struct in_addr inaddr; - int x; - - int clientSock; - int totalRead; - - char hostid[20]; - unsigned char *ipP = 0; - char path[BUFLEN + 1]; - char cachePath[BUFLEN + 1]; - char userListPath[BUFLEN + 1]; - - time_t ltime; - char line[LINESIZE + LINESIZE]; - pid_t pid; - - char ourIpAddr[20]; - unsigned int ourPort; - smMemoryGroupContext localMemoryGroup; - smMemoryGroupContext * saveMemoryGroup; - vmApiAsynchronousNotificationEnableDmOutput * ptrEnableOutputData; - vmApiAsynchronousNotificationDisableDmOutput * ptrDisableOutputData; - - VmApiInternalContext *vmapiContextP; - - VmApiInternalContext vmapiContext; - smMemoryGroupContext memContext; - extern struct _smTrace externSmapiTraceFlags; - int smrc; - pthread_mutex_lock(&mutex); - - // Expand the macro for time being - memset(&vmapiContext, 0, sizeof(*(&vmapiContext))); - memset(&memContext, 0, sizeof(*(&memContext))); - (&vmapiContext)->memContext = &memContext; - (&vmapiContext)->smTraceDetails - = (struct _smTrace *) &externSmapiTraceFlags; - smrc = smMemoryGroupInitialize(&vmapiContext); - - if (0 == smrc) { - readTraceFile(&vmapiContext); - } else { - logLine(&vmapiContext, 'E', "Unexpected smMemoryGroupInitializeError!"); - } - - vmapiContextP = &vmapiContext; - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "Inside back end thread \n"); - TRACE_END_DEBUG(vmapiContextP, line); - - if (1 != vmapiContextP->contextCreatedFlag) { - rc = initializeThreadSemaphores(vmapiContextP, "", 1); // create context using no name to override current context name - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "Inside back end thread retValue = %d \n", rc); - TRACE_END_DEBUG(vmapiContextP, line); - } - - // Indicate this is the backend - vmapiContextP->isBackend = 1; - - // Obtain the Backend semaphore to before manipulating context related stuff - operations[0].sem_num = BackendSemaphoreIndex; - operations[0].sem_op = -1; - operations[0].sem_flg = SEM_UNDO; - rc = semop(vmapiContextP->semId, operations, sizeof(operations) - / sizeof(operations[0])); - if (rc < 0) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendMain: semop (decrement) failed, errno=%d text: %s", - errno, strerror(errno)); - TRACE_END_DEBUG(vmapiContextP, line); - } - - // OK: ready to go - time(<ime); - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Entry to --> at %s", ctime(<ime)); - TRACE_END_DEBUG(vmapiContextP, line); - - // Build path to the cache directory. - memset(path, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - - // Call routine to remove the cache. - vmbkendRemoveEntireCache(vmapiContextP, cachePath); - - // Do the necessary socket server setup - serverSock = socket(AF_INET, SOCK_DGRAM, 0); - exit_if_error(Socket, serverSock, serverSock); - - memset(&serverSockaddr, 0, sizeof serverSockaddr); - - // Read and use any previous port number that may have - // been set by a previous run of vmbkend. If no previous - // run or error, the value zero is returned. - vmbkendSockaddrFileInfo(vmapiContextP, 0, &previousSockaddr); - serverSockaddr.sin_port = previousSockaddr.sin_port; - serverSockaddr.sin_family = AF_INET; - serverSockaddr.sin_addr.s_addr = htonl(INADDR_ANY); - - rc = bind(serverSock, (struct sockaddr *) &serverSockaddr, - sizeof serverSockaddr); - - if (-1 == rc) { // Bind failure - if (0 == serverSockaddr.sin_port) { - // The bind for an ephemeral port failed. - exit_if_error(Bind, rc, serverSock); - } else { - // We used a previous port and this failed, - // Retry the bind for any ephemeral port. - memset(&serverSockaddr, 0, sizeof serverSockaddr); - serverSockaddr.sin_port = 0; - serverSockaddr.sin_addr.s_addr = htonl(INADDR_ANY); - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - TRACE_END_DEBUG(vmapiContextP, - "vmbkendMain: Retrying bind for sin_port <0>\n"); - rc = bind(serverSock, (struct sockaddr *) &serverSockaddr, - sizeof serverSockaddr); - - exit_if_error(Bind, rc, serverSock); - } - } - - memset(&serverSockaddr1, 0, sizeof serverSockaddr1); - socklen = sizeof serverSockaddr1; - - rc - = getsockname(serverSock, (struct sockaddr *) &serverSockaddr1, - &socklen); - exit_if_error(Getsockname, rc, serverSock); - - // Show the IP address for our system - get_myaddress(¬ificationSocketInfo); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - // Show what port number we are listening on - sprintf(line, "vmbkendMain: Listening on %s:%u", inet_ntoa( - notificationSocketInfo.sin_addr), (unsigned) ntohs( - serverSockaddr1.sin_port)); - TRACE_END_DEBUG(vmapiContextP, line); - - // Set port for notification - notificationSocketInfo.sin_port = serverSockaddr1.sin_port; - - // If we used different information from a previous run - // then: - // - write new info to the file PORT_FILENAME - // - unregister old info with the directory manager. - if ((previousSockaddr.sin_port != notificationSocketInfo.sin_port) - || (previousSockaddr.sin_addr.s_addr - != notificationSocketInfo.sin_addr.s_addr)) { - - // Write new info to PORT_FILENAME - vmbkendSockaddrFileInfo(vmapiContextP, 1, ¬ificationSocketInfo); - - // If previous registration, unregister it - if (0 != previousSockaddr.sin_port) { - sprintf(ourIpAddr, "%s", inet_ntoa(previousSockaddr.sin_addr)); - ourPort = previousSockaddr.sin_port; - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - smMemoryGroupInitialize(vmapiContextP); - - rc = smAsynchronous_Notification_Disable_DM(vmapiContextP, "", // IUCV userID and password not needed - 0, // Password length - "", // Password - "ALL", // Target identifier - 1, // Entity_type directory - 2, // UDP communication_type, - ourPort, // Port_number, - ourIpAddr, // IP_address string, - 1, // ASCII encoding, - 0, // Subscriber_data_length, - "", // Subscriber_data, - &ptrDisableOutputData); - if (0 != rc || 0 != ptrDisableOutputData->returnCode) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendMain: call to asynch unregister got rc1 %d rc2 %d \n", - rc, ptrDisableOutputData->returnCode); - TRACE_END_DEBUG(vmapiContextP, line); - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - close(serverSock); - pthread_exit(NULL); - } - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - } - } // Used different port number - - // Call asynchronous notify RPC to register with the - // directory manager. - sprintf(ourIpAddr, "%s", inet_ntoa(notificationSocketInfo.sin_addr)); - ourPort = notificationSocketInfo.sin_port; - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - smMemoryGroupInitialize(vmapiContextP); - - rc = smAsynchronous_Notification_Enable_DM(vmapiContextP, "", // IUCV userID and password not needed - 0, // Password length - "", // Password - "ALL", // Target identifier - 1, // Entity_type directory - 1, // Include subscription type - 2, // UDP subscription_type - ourPort, // Port_number - ourIpAddr, // IP_address - 1, // ASCII encoding - 0, // Subscriber_data_length - "", // Subscriber_data - &ptrEnableOutputData); - if (0 == rc && 0 != ptrEnableOutputData->returnCode) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendMain: call to asynch register got rc1 %d rc2 %d and rs %d\n", - rc, ptrEnableOutputData->returnCode, - ptrEnableOutputData->reasonCode); - TRACE_END_DEBUG(vmapiContextP, line); - - // If Subscription exists... Do not do anything. - if (!ptrEnableOutputData->returnCode == 428) { - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - close(serverSock); - pthread_exit(NULL); - } - } else if (0 != rc) { - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - close(serverSock); - pthread_exit(NULL); - - } - - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - - // Wait for and handle incoming requests from the - // directory manager. - pthread_cond_signal(&thread_initialized_cv); - pthread_mutex_unlock(&mutex); - for (;;) { - time(<ime); - - // UDP - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: About to receive on %s", ctime(<ime)); - TRACE_END_DEBUG(vmapiContextP, line); - - memset(readBuffer, 0, sizeof readBuffer); - memset(&clientSockaddr, 0, sizeof clientSockaddr); - clientLen = sizeof clientSockaddr; - bytesRead = 0; - useridLength = 0; - - bytesRead = recvfrom(serverSock, readBuffer, sizeof(readBuffer), 0, - (struct sockaddr *) &clientSockaddr, &clientLen); - - if (bytesRead == -1) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: recvfrom got errno %d\n", errno); - TRACE_END_DEBUG(vmapiContextP, line); - break; - } - continue_if_error(Recvfrom, bytesRead, bytesRead); - - strcpy(path, cachePath); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Read %d bytes from %s at time: %s\n", - bytesRead, inet_ntoa(clientSockaddr.sin_addr), ctime(<ime)); - TRACE_END_DEBUG(vmapiContextP, line); - - // If the message is too small, this is an error, go get - // the next message. - if (bytesRead <= LENGTH_OF_USERID_LENGTH_FIELD) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Message is too short"); - TRACE_END_DEBUG(vmapiContextP, line); - continue; - } - - // Pull out the user ID length - useridLength = *(int *) &readBuffer; - useridLength = ntohl(useridLength); - - // Get the user ID - memset(userID, 0, sizeof userID); - strncpy(userID, readBuffer + 4, useridLength); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendMain: User ID length is >%d< and User ID is >%s<\n", - useridLength, userID); - TRACE_END_DEBUG(vmapiContextP, line); - - // Get the command length - cmdLength = *(int *) (readBuffer + 4 + useridLength); - cmdLength = ntohl(cmdLength); - - // Get the command - memset(cmd, 0, sizeof cmd); - strncpy(cmd, readBuffer + 4 + useridLength + 4, cmdLength); - - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Command is >%s<\n", cmd); - TRACE_END_DEBUG(vmapiContextP, line); - - if (strcasecmp(cmd, "add") == 0 || strcasecmp(cmd, "purge") == 0) { - strcpy(userListPath, cachePath); - strcat(userListPath, "users.list"); - rc = remove(userListPath); - if (rc == -1) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendMain: remove error on (%s), errno (0x%x)\n", - userListPath, errno); - TRACE_END_DEBUG(vmapiContextP, line); - } - } - - // Get the subscriber data length - subDataLength - = *(int *) (readBuffer + 4 + useridLength + 4 + cmdLength); - subDataLength = ntohl(subDataLength); - - // Invalidate the cache entry - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, "vmbkendMain: Invalidating cache for user ID (%s)\n", - userID); - TRACE_END_DEBUG(vmapiContextP, line); - - for (x = 0; x < useridLength; ++x) { - userID[x] = tolower(userID[x]); - } - - vmbkendCacheEntryInvalidate(vmapiContextP, path, userID); - - // Clear out the .scan files - } - - // Call asynchronous notify RPC to unregister with the - // directory manager. - sprintf(ourIpAddr, "%s", inet_ntoa(notificationSocketInfo.sin_addr)); - ourPort = notificationSocketInfo.sin_port; - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - smMemoryGroupInitialize(vmapiContextP); - - rc = smAsynchronous_Notification_Disable_DM(vmapiContextP, "", // IUCV userID and password not needed - 0, // Password length - "", // password - "ALL", // Target identifier - 1, // Entity_type directory - 2, // UDP communication_type, - ourPort, // Port_number, - ourIpAddr, // IP_address, - 1, // ASCII encoding, - 0, // Subscriber_data_length, - "", // Subscriber_data, - &ptrDisableOutputData); - if (0 != rc || 0 != ptrDisableOutputData->returnCode) { - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendMain: call to asynch unregister got rc1 %d rc2 %d \n", - rc, ptrDisableOutputData->returnCode); - TRACE_END_DEBUG(vmapiContextP, line); - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - close(serverSock); - pthread_exit(NULL); - } - - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - - // Close the server socket - TRACE_START(vmapiContextP, - TRACEAREA_BACKGROUND_DIRECTORY_NOTIFICATION_THREAD, - TRACELEVEL_DETAILS); - TRACE_END_DEBUG(vmapiContextP, - "vmbkendMain: About to close() server socket\n"); - rc = close(serverSock); - exit_if_error(Close, rc, rc); - pthread_exit(NULL); -} - -/** - * Procedure: vmbkendremoveCachedScanFiles - * - * Purpose: Remove the ***.scan files. - * - * Input: pointer to cache path - * Output: none - * - * Operation: - * . Build the rm command from the input path - * . Issue the rm command via system() - */ -int vmbkendRemoveCachedScanFiles(struct _VmApiInternalContext* vmapiContextP, - char *pathP) { - - char command[300]; - char line[LINESIZE]; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build the remove command - sprintf(command, "rm -f %s%s", pathP, ALL_SCAN_FILES); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendRemoveCachedScanFiles: About to issue: system(%s)\n", - command); - TRACE_END_DEBUG(vmapiContextP, line); - - if (system(command)) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendRemoveCachedScanFiles: Error removing scan files, errno 0x%X: reason(%s)\n", - errno, strerror(errno)); - TRACE_END_DEBUG(vmapiContextP, line); - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - return 0; - -} - -/** - * Procedure: vmbkendremoveEntireCache - * - * Purpose: Remove all cache entries from the cache directory. - * - * Input: pointer to the cache directory - * Output: none - * - * Operation: - * . Build rm command from input cache directory - * . Issue the rm command via system() - */ -void vmbkendRemoveEntireCache(struct _VmApiInternalContext* vmapiContextP, - char *cachePathP) { - - char command[300]; - char line[LINESIZE]; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build the remove command - sprintf(command, "rm -rf %s*", cachePathP); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendRemoveEntireCache: About to issue: system(%s)\n", - command); - TRACE_END_DEBUG(vmapiContextP, line); - - if (system(command)) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendRemoveEntireCache: Error removing file, errno 0x%X: reason(%s)\n", - errno, strerror(errno)); - TRACE_END_DEBUG(vmapiContextP, line); - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return; -} - -/** - * Procedure: vmbkendSockaddrFileInfo - * - * Purpose: Save new or retrieve previous bind information to or from - * the file defined by $VMAPI/PORT_FILENAME. - * - * Input: int readOrWrite : 0 = read it; 1 = write it - * sockaddr_in saddr: If readOrWrite is read, then on input this is - * is the address of where to store the retrieved bind info. - * If readOrWrite is write, then on input this is the address of - * the sockaddr_in containing the bind info to save. - * - * Output: rc = 0 ; success; if read then saddr contains the read value. - * if write, then the file is updated. - * rc = -1 ; failure; if read, saddr value returned is zeroes. - * if write, saddr is unchanged. - * - * Operation: - * . Get the path to the file $VMAPI/.vmapi/PORT_FILENAME - * . Open the file read or write based on the value of readOrWrite input - * . If error, - * - if read, set saddr to zeroes - * - return -1 - * . If read then read the info - * Else write the info - * . Close the file. - */ -int vmbkendSockaddrFileInfo(struct _VmApiInternalContext* vmapiContextP, - int readOrWrite, struct sockaddr_in *saddr) { - - FILE *fileP = (FILE *) NULL; - char fName[BUFLEN + 1]; - char *getenvP = 0; - int rc = 0; - char line[LINESIZE]; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - strcpy(fName, vmapiContextP->path); - strcat(fName, PORT_FILENAME); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendSockaddrFileInfo: PORT_FILENAME %s \n", fName); - TRACE_END_DEBUG(vmapiContextP, line); - - errno = 0; - if (0 == readOrWrite) { // Read - // If error reading record, return saddr value of zeroes - memset(saddr, 0, sizeof(struct sockaddr_in)); - fileP = fopen(fName, "r"); - } else { - fileP = fopen(fName, "w"); - } - - if (fileP == (FILE *) NULL) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendSockaddrFileInfo: Errno %d opening %s for %s()\n", - errno, fName, (readOrWrite == 0 ? "read" : "write")); - TRACE_END_DEBUG(vmapiContextP, line); - - rc = -1; - goto exit_error2; - } - - if (readOrWrite == 0) { // read - if (EOF == fscanf(fileP, "%x:%hu", &(saddr->sin_addr.s_addr), - &(saddr->sin_port))) { - // If error reading record, return saddr value of zeroes - memset(saddr, 0, sizeof(struct sockaddr_in)); - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, - TRACELEVEL_DETAILS); - sprintf(line, - "vmbkendSockaddrFileInfo: Errno %d reading file %s\n", - errno, fName); - TRACE_END_DEBUG(vmapiContextP, line); - - rc = -1; - goto exit_error1; - } - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendSockaddrFileInfo: Read %x:%hu\n", - saddr->sin_addr.s_addr, saddr->sin_port); - TRACE_END_DEBUG(vmapiContextP, line); - - } else { // Write - if (-1 == fprintf(fileP, "%x:%hu", saddr->sin_addr.s_addr, - saddr->sin_port)) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, - TRACELEVEL_DETAILS); - sprintf( - line, - "vmbkendSockaddrFileInfo: Errno %d writing %x:%hu to %s\n", - errno, saddr->sin_addr.s_addr, saddr->sin_port, fName); - TRACE_END_DEBUG(vmapiContextP, line); - - rc = -1; - goto exit_error1; - } - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendSockaddrFileInfo: Wrote %x:%hu\n", - saddr->sin_addr.s_addr, saddr->sin_port); - TRACE_END_DEBUG(vmapiContextP, line); - } - - exit_error1: if (EOF == fclose(fileP)) { - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(line, "vmbkendSockaddrFileInfo: Errno %d closing file %s()\n", - errno, fName); - TRACE_END_DEBUG(vmapiContextP, line); - } - exit_error2: TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - return (rc); -} - -void waitForPendingWorkunits(struct _VmApiInternalContext* vmapiContextP, - int waitIntervalInSeconds) // 0 = wait forever -{ - - int argN = 2; - const char* args[2]; - char line[LINESIZE]; - int maxRc = 0; - int maxReason = 0; - int x = 0; - int workunitsPending = 1; - int workunitId; - int duration; - int interval; - int rc; - time_t startTime; - - smMemoryGroupContext localMemoryGroup; - smMemoryGroupContext * saveMemoryGroup; - vmApiQueryAsynchronousOperationDmOutput * ptrQueryAsynchOutputData; - - // Duration == 0 is assumed as infinite duration - duration = waitIntervalInSeconds; - time(&startTime); - - while (workunitsPending && duration >= 0) { - - workunitsPending = 0; - - for (x = 0; (x < (sizeof(vmapiContextP->pendingWorkunits) - / sizeof(vmapiContextP->pendingWorkunits[0]))); ++x) { - - if (vmapiContextP->pendingWorkunits[x] == 0) - continue; - - workunitId = vmapiContextP->pendingWorkunits[x]; - - vmapiContextP->rc = 0; - vmapiContextP->reason = 0; - - saveMemoryGroup = vmapiContextP->memContext; - vmapiContextP->memContext = &localMemoryGroup; - - smMemoryGroupInitialize(vmapiContextP); - if (0 != (rc = smQuery_Asychronous_Operation_DM(vmapiContextP, - "", // Userid is not required for IUCV - 0, // Length 0; no password of IUCV - "", // No password - vmapiContextP->useridForAsynchNotification, workunitId, - &ptrQueryAsynchOutputData))) { - } - - vmapiContextP->rc = ptrQueryAsynchOutputData->returnCode; - vmapiContextP->reason = ptrQueryAsynchOutputData->reasonCode; - - // Since the only result data we care about is the return and reason codes, we can - // free any working memory now. - smMemoryGroupFreeAll(vmapiContextP); - smMemoryGroupTerminate(vmapiContextP); - vmapiContextP->memContext = saveMemoryGroup; - - // check for finished operation - if ((vmapiContextP->rc == 0) && (vmapiContextP->reason == 100)) { - vmapiContextP->pendingWorkunits[x] = 0; - continue; - } - - // Check for ongoing operation - if ((vmapiContextP->rc == 0) && (vmapiContextP->reason == 104)) { - workunitsPending = 1; // At least this one - continue; - } - - // Check for failed operation - if ((vmapiContextP->rc == 0) && (vmapiContextP->reason == 108)) { - vmapiContextP->rc = 200; // Set failed image operation error code - vmapiContextP->reason = 0; - } - - // Here when an error occurred - // The workunit is assumed to be either finished or failed, - // that is it is not assumed to be ongoing any more. - if ((vmapiContextP->rc == maxRc) && (vmapiContextP->reason - > maxReason)) { - maxReason = vmapiContextP->reason; - } else if (vmapiContextP->rc > maxRc) { - maxRc = vmapiContextP->rc; - maxReason = vmapiContextP->reason; - } - - } - - interval = SleepInterval; - if ((duration > 0) && (interval > duration)) - interval = duration; - - if (workunitsPending && (interval > 0)) { - - sleep(interval); - - } - - if (duration > 0) { - duration -= interval; - // Since == 0 is assumed to be indefinite set -1 in this case - if (duration == 0) - duration = -1; - } - - } - - // Quickfix to overcome problems on tmcc system - sleep(5); - - vmapiContextP->rc = maxRc; - vmapiContextP->reason = maxReason; - -} - -/** - * A valid cache file has good time interval and no "INVALID" PAS0304 - * file is closed for stat to work - */ -int cacheFileValid(struct _VmApiInternalContext* vmapiContextP, - const char* cFNameP) { - - int defaultTimeLimit = 5000; // Seconds = approx 1.5 hours - int timeLimit = 0; - struct stat statbuf; - time_t currentTime; - double fileAgeSeconds = 0; - time_t fileTime = 0; - unsigned int x = 0; - - if (getenv("EPP_CACHE_TIMELIMIT")) { - timeLimit = atoi(getenv("EPP_CACHE_TIMELIMIT")); - } else { - timeLimit = defaultTimeLimit; - } - - if (-1 == time(¤tTime)) - return 0; // Current time failed - - if (-1 == stat(cFNameP, &statbuf)) - return 0; // Stat failed - - fileTime = statbuf.st_mtime; - - fileAgeSeconds = difftime(currentTime, fileTime); - - if ((fileAgeSeconds < 0) || (fileAgeSeconds > timeLimit)) - return 0; - - return 1; -} diff --git a/zhcp/zhcp-build/resource_access/src/startvs.c b/zhcp/zhcp-build/resource_access/src/startvs.c deleted file mode 100644 index 73a3cc9..0000000 --- a/zhcp/zhcp-build/resource_access/src/startvs.c +++ /dev/null @@ -1,73 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Logs on the specified virtual server. - * - * @param $1: The name of the guest which is to be logged on - * - * @return 0 If the image is powered on upon completion - * 1 If given invalid parameters - * 2 If power-on failed - */ -int main(int argC, char* argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Get the virtual server name - char* imageName = argV[1]; - // Check if the virtual server name is between 1 and 8 characters - if (isImageNameInvalid(imageName)) - return 1; - - printf("Starting %s... ", imageName); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageActivateOutput* output; - - // Log on virtual server - int rc = smImage_Activate(&context, "", 0, "", // Authorizing user, password length, password. - imageName, // Image name. - &output); - - int rtnCode = output->common.returnCode; - int rsnCode = output->common.reasonCode; - - // If return code = 200 and reason code = 8, virtual server is logged on - if (rc || (output->common.returnCode && output->common.returnCode != 200 - || (output->common.reasonCode && output->common.reasonCode != 8))) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/stopvs.c b/zhcp/zhcp-build/resource_access/src/stopvs.c deleted file mode 100644 index a28d9f5..0000000 --- a/zhcp/zhcp-build/resource_access/src/stopvs.c +++ /dev/null @@ -1,69 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Log off the specified virtual server. - * - * @param $1: The z/VM guest ID of the virtual server which is to be stopped - * - * @return 0 If the image is powered off upon completion - * 1 If given invalid parameters - * 2 If power-off failed - */ -int main(int argC, char* argV[]) { - - if (argC != 2) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - // Get the virtual server name - char* imageName = argV[1]; - // Check if the virtual server name is between 1 and 8 characters - if (isImageNameInvalid(imageName)) - return 1; - - printf("Stopping %s... ", imageName); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDeactivateOutput* output; - - // Log off virtual server - int rc = smImage_Deactivate(&context, "", 0, "", // Authorizing user, password length, password. - imageName, "IMMED", // Immediate deactivation. - &output); - - if (rc || (output->common.returnCode && output->common.returnCode != 200 - || (output->common.reasonCode && output->common.reasonCode != 12))) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->common.returnCode, - output->common.reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/undedicatedevice.c b/zhcp/zhcp-build/resource_access/src/undedicatedevice.c deleted file mode 100644 index 82683b6..0000000 --- a/zhcp/zhcp-build/resource_access/src/undedicatedevice.c +++ /dev/null @@ -1,66 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * Removes a dedicated device from a virtual image's directory entry. - * - * @param $1: The name of the guest from which a device is to be removed - * @param $2: The virtual device address assigned to the device - * - * @return 0 If the dedicated device was removed successfully - * 1 If given invalid parameters - * 2 If device undedication failed. - */ -int main(int argC, char* argV[]) { - - if (argC != 6) { - printf("Error: Wrong number of parameters\n"); - return 1; - } - - char* image = argV[1]; - char* vdev = argV[2]; - - if (isImageNameInvalid(image)) - return 1; - - printf("Removing device %s on %s... ", vdev, image); - - VmApiInternalContext context; - - // Initialize context - extern struct _smTrace externSmapiTraceFlags; - smMemoryGroupContext memContext; - memset(&context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - context.smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context.memContext = &memContext; - - vmApiImageDeviceUndedicateDmOutput* output; - - int rc = smImage_Device_Undedicate_DM(&context, "", 0, "", // Authorizing user, password length, password. - image, vdev, &output); - - if (rc || output->returnCode || output->reasonCode) { - printf("Failed\n"); - - rc ? printf(" Return Code: %d\n", rc) : printf(" Return Code: %d\n" - " Reason Code: %d\n", output->returnCode, output->reasonCode); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 2; - } else { - printf("Done\n"); - - // Release context - smMemoryGroupFreeAll(&context); - smMemoryGroupTerminate(&context); - - return 0; - } -} diff --git a/zhcp/zhcp-build/resource_access/src/virtualImage.h b/zhcp/zhcp-build/resource_access/src/virtualImage.h deleted file mode 100644 index 48b5416..0000000 --- a/zhcp/zhcp-build/resource_access/src/virtualImage.h +++ /dev/null @@ -1,70 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include -#include "smPublic.h" -#include "vmapiSystem.h" -#include "vmapiImage.h" -#include "vmapiVirtual.h" -#include "smPublic.h" -#include "vmapiAsynchronous.h" -#include "vmapiAuthorization.h" -#include "vmapiCheckAuthentication.h" -#include "vmapiDirectoryManager.h" -#include "vmapiName.h" -#include "vmapiProfile.h" -#include "vmapiPrototype.h" - -/* Check if Smapi is up and running - *****************************************************************************************/ -int checkSmapi(VmApiInternalContext vmapiContext); - -/* Use Profile_Create_DM to create a profile directory entry to be included in - * the definition of a virtual image in the directory. - *****************************************************************************************/ -int createProfile(VmApiInternalContext vmapiContext); - -/* Use Prototype_Create_DM to create a new virtual image prototype - *****************************************************************************************/ -int createProto(VmApiInternalContext vmapiContext); - -/* Use Image_Create_DM to define a new virtual image in the directory - *****************************************************************************************/ -int createImage(VmApiInternalContext vmapiContext, char * argV); - -/* Use Prototype_Name_Query_DM to obtain a list of names of defined prototypes - *****************************************************************************************/ -int queryProto(VmApiInternalContext vmapiContext, char * argV); - -/* Use Profile_Query_DM to query a profile directory entry - *****************************************************************************************/ -int queryProfile(VmApiInternalContext vmapiContext, char * argV); - -/* Use Image_Query_DM to obtain a virtual image’s directory entry - *****************************************************************************************/ -int queryImage(VmApiInternalContext vmapiContext, char * argV); - -/* Use Profile_Delete_DM to delete a profile directory entry - *****************************************************************************************/ -int deleteProfile(VmApiInternalContext vmapiContext, char * argV); - -/* Use Prototype_Delete_DM to delete an image prototype - *****************************************************************************************/ -int deleteProto(VmApiInternalContext vmapiContext, char * argV); - -/* Use Image_Delete_DM to delete a virtual image's definition from the directory - *****************************************************************************************/ -int deleteImage(VmApiInternalContext vmapiContext, char * argV); - -/* Use Image_Disk_Create_DM to add a disk to a virtual image’s directory entry - *****************************************************************************************/ -int addDisk(VmApiInternalContext vmapiContext, char * argV); - -/* Use Image_Query_DM to obtain a virtual image’s directory entry - *****************************************************************************************/ -void getImage(VmApiInternalContext vmapiContext, - vmApiImageRecord imageRecord[], char * argV); - -/* Internal function to display error text to console - *****************************************************************************************/ -static void displayErrorText(int errorCode); - diff --git a/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationDisableDm.c b/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationDisableDm.c deleted file mode 100644 index fae3fa1..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationDisableDm.c +++ /dev/null @@ -1,105 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAsynchronous.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Asynchronous_Notification_Disable_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAsynchronousNotificationDisableDmOutput - -/** - * Asynchronous_Notification_Disable_DM SMAPI interface - */ -int smAsynchronous_Notification_Disable_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char communication_type, int port_number, - char * ip_address, char encoding, int subscriber_data_length, - char * subscriber_data, - vmApiAsynchronousNotificationDisableDmOutput ** outData) { - const char * const functionName = "Asynchronous_Notification_Disable_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - // The input buffer size of the VMAPI socket call is calculated by adding up all the - // field lengths and data (see System management application programming manual for details) - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 + 1 + 4 + 4 - + strlen(ip_address) + 1 + 4 + subscriber_data_length; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = entity_type; // Entity_type int1 - cursor++; - - *cursor = communication_type; // Communication_type int1 - cursor++; - - PUT_INT(port_number, cursor); // Port_number int4 - - tempSize = strlen(ip_address); // IP_address 7..15 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, ip_address, tempSize); - cursor += tempSize; - - *cursor = encoding; // Encoding - cursor++; - - tempSize = subscriber_data_length; // Subscriber_data 0..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, subscriber_data, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationEnableDm.c b/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationEnableDm.c deleted file mode 100644 index ecc62af..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationEnableDm.c +++ /dev/null @@ -1,106 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAsynchronous.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Asynchronous_Notification_Enable_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAsynchronousNotificationEnableDmOutput - -/** - * Asynchronous_Notification_Enable_DM SMAPI interface - */ -int smAsynchronous_Notification_Enable_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char subscription_type, char communication_type, - int port_number, char * ip_address, char encoding, - int subscriber_data_length, char * subscriber_data, - vmApiAsynchronousNotificationEnableDmOutput ** outData) { - const char * const functionName = "Asynchronous_Notification_Enable_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 + 1 + 1 + 4 + 4 - + strlen(ip_address) + 1 + 4 + subscriber_data_length; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = entity_type; // Entity_type int1 - cursor++; - - *cursor = subscription_type; // Subscription_type int1 - cursor++; - - *cursor = communication_type; // Communication_type int1 - cursor++; - - PUT_INT(port_number, cursor); // Port_number int4 - - tempSize = strlen(ip_address); // IP_address 7..15 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, ip_address, tempSize); - cursor += tempSize; - - *cursor = encoding; // Encoding - cursor++; - - tempSize = subscriber_data_length; // Subscriber_data 0..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, subscriber_data, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationQueryDm.c deleted file mode 100644 index c148a76..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiAsynchronousNotificationQueryDm.c +++ /dev/null @@ -1,105 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAsynchronous.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Asynchronous_Notification_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAsynchronousNotificationQueryDmOutput - -/** - * Asynchronous_Notification_Query_DM SMAPI interface - */ -int smAsynchronous_Notification_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char entity_type, char communication_type, int port_number, - char * ip_address, char encoding, int subscriber_data_length, - char * subscriber_data, - vmApiAsynchronousNotificationQueryDmOutput ** outData) { - const char * const functionName = "Asynchronous_Notification_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 + 1 + 4 + 4 - + strlen(ip_address) + 1 /* Encoding */+ 4 + subscriber_data_length; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - tempSize = strlen(functionName); - - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = entity_type; // Entity_type int1 - cursor++; - - *cursor = communication_type; // Communication_type int1 - cursor++; - - PUT_INT(port_number, cursor); // Port_number int4 - - tempSize = strlen(ip_address); // IP_address 7..15 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, ip_address, tempSize); - cursor += tempSize; - - *cursor = encoding; // Encoding - cursor++; - - tempSize = subscriber_data_length; // Subscriber_data 0..64 chars - PUT_INT(tempSize, cursor); - - if (tempSize > 0) { - memcpy(cursor, subscriber_data, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListAdd.c b/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListAdd.c deleted file mode 100644 index d22c0fd..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListAdd.c +++ /dev/null @@ -1,88 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAuthorization.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Authorization_List_Add_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAuthorizationListAddOutput - -/** - * Authorization_List_Add SMAPI interface - */ -int smAuthorization_List_Add(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListAddOutput ** outData) { - const char * const functionName = "Authorization_List_Add"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + strlen(for_id) + 4 + strlen(function_id); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(for_id); // For_id 1..8 or 1..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, for_id, tempSize); - cursor += tempSize; - - tempSize = strlen(function_id); // Function_id 1..64 OR 1..* chars - PUT_INT(tempSize, cursor); - memcpy(cursor, function_id, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListQuery.c deleted file mode 100644 index 0e493e4..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListQuery.c +++ /dev/null @@ -1,88 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAuthorization.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Authorization_List_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAuthorizationListQueryOutput - -/** - * Authorization_List_Query SMAPI interface - */ -int smAuthorization_List_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListQueryOutput ** outData) { - const char * const functionName = "Authorization_List_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + strlen(for_id) + 4 + strlen(function_id); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(for_id); // For_id 0..8 or 0..64 or 1 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, for_id, tempSize); - cursor += tempSize; - - tempSize = strlen(function_id); // Function_id 0..64 OR 1 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, function_id, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListRemove.c b/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListRemove.c deleted file mode 100644 index 64a3415..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiAuthorizationListRemove.c +++ /dev/null @@ -1,88 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiAuthorization.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Authorization_List_Remove_Layout -#define OUTPUT_STRUCTURE_NAME vmApiAuthorizationListRemoveOutput - -/** - * Authorization_List_Remove SMAPI interface - */ -int smAuthorization_List_Remove(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * for_id, char * function_id, - vmApiAuthorizationListRemoveOutput ** outData) { - const char * const functionName = "Authorization_List_Remove"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + strlen(for_id) + 4 + strlen(function_id); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(for_id); // For_id 1..8 or 1..64 or 1 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, for_id, tempSize); - cursor += tempSize; - - tempSize = strlen(function_id); // Function_id 1..64 OR 1 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, function_id, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiCheckAuthentication.c b/zhcp/zhcp-build/resource_access/src/vmapiCheckAuthentication.c deleted file mode 100644 index 1c3132d..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiCheckAuthentication.c +++ /dev/null @@ -1,71 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiCheckAuthentication.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Check_Authentication_Layout -#define OUTPUT_STRUCTURE_NAME vmApiCheckAuthenticationOutput - -/** - * Check_Authentication_DM SMAPI interface - */ -int smCheck_Authentication(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - vmApiCheckAuthenticationOutput ** outData) { - const char * const functionName = "Check_Authentication"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagDefineDm.c b/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagDefineDm.c deleted file mode 100644 index e262981..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagDefineDm.c +++ /dev/null @@ -1,89 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Local_Tag_Define_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerLocalTagDefineDmOutput - -/** - * Directory_Manager_Local_Tag_Define_DM SMAPI interface - */ -int smDirectory_Manager_Local_Tag_Define_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, int tag_ordinal, char createOrChange, - vmApiDirectoryManagerLocalTagDefineDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Local_Tag_Define_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - tag_name) + 4 + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(tag_name); // Tag_name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_name, tempSize); - cursor += tempSize; - - PUT_INT(tag_ordinal, cursor); - - *cursor = createOrChange; // Create or change request - *cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagDeleteDm.c deleted file mode 100644 index 394561c..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagDeleteDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Local_Tag_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerLocalTagDeleteDmOutput - -/** - * Directory_Manager_Local_Tag_Delete_DM SMAPI interface - */ -int smDirectory_Manager_Local_Tag_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, vmApiDirectoryManagerLocalTagDeleteDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Local_Tag_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - tag_name); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(tag_name); // Tag_name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_name, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagQueryDm.c deleted file mode 100644 index 2a9f18b..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagQueryDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Local_Tag_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerLocalTagQueryDmOutput - -/** - * Directory_Manager_Local_Tag_Query_DM SMAPI interface - */ -int smDirectory_Manager_Local_Tag_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, vmApiDirectoryManagerLocalTagQueryDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Local_Tag_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - tag_name); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(tag_name); // Tag_name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_name, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagSetDm.c b/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagSetDm.c deleted file mode 100644 index 18d20fb..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerLocalTagSetDm.c +++ /dev/null @@ -1,89 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Local_Tag_Set_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerLocalTagSetDmOutput - -/** - * Directory_Manager_Local_Tag_Set_DM SMAPI interface - */ -int smDirectory_Manager_Local_Tag_Set_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * tag_name, int tag_value_length, char * tag_value, - vmApiDirectoryManagerLocalTagSetDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Local_Tag_Set_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - tag_name) + 4 + tag_value_length; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(tag_name); // Tag_name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_name, tempSize); - cursor += tempSize; - - tempSize = tag_value_length; // Tag_value 1..240 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, tag_value, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerSearchDm.c b/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerSearchDm.c deleted file mode 100644 index fbf9bab..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerSearchDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Search_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerSearchDmOutput - -/** - * Directory_Manager_Search_DM SMAPI interface - */ -int smDirectory_Manager_Search_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int search_pattern_length, - char * search_pattern, vmApiDirectoryManagerSearchDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Search_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + search_pattern_length; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = search_pattern_length; // Search_pattern 1..72 charNA - PUT_INT(tempSize, cursor); - memcpy(cursor, search_pattern, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerTaskCancelDm.c b/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerTaskCancelDm.c deleted file mode 100644 index cc1f6b8..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiDirectoryManagerTaskCancelDm.c +++ /dev/null @@ -1,80 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiDirectoryManager.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Directory_Manager_Task_Cancel_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiDirectoryManagerTaskCancelDmOutput - -/** - * Directory_Manager_Task_Cancel_DM SMAPI interface - */ -int smDirectory_Manager_Task_Cancel_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - int operation_id, vmApiDirectoryManagerTaskCancelDmOutput ** outData) { - const char * const functionName = "Directory_Manager_Task_Cancel_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - PUT_INT(operation_id, cursor); - cursor += 4; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiIPaddrGet.c b/zhcp/zhcp-build/resource_access/src/vmapiIPaddrGet.c deleted file mode 100644 index 84ac556..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiIPaddrGet.c +++ /dev/null @@ -1,57 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiSystem.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME IPaddr_Get_Layout -#define OUTPUT_STRUCTURE_NAME vmApiIPaddrGetOutput - -/** - * Virtual_Network_Query_OSA SMAPI interface - */ -int smIPaddr_Get(struct _VmApiInternalContext* vmapiContextP, - vmApiIPaddrGetOutput ** outData) { - const char * const functionName = "IPaddr_Get"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageActivate.c b/zhcp/zhcp-build/resource_access/src/vmapiImageActivate.c deleted file mode 100644 index a94498f..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageActivate.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Activate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageActivateOutput - -/** - * Image_Activate SMAPI interface - */ -int smImage_Activate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageActivateOutput ** outData) { - const char * const functionName = "Image_Activate"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 or 1..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageActiveConfigurationQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiImageActiveConfigurationQuery.c deleted file mode 100644 index 7561e1e..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageActiveConfigurationQuery.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Active_Configuration_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageActiveConfigurationQueryOutput - -/** - * Image_Active Configiration Query SMAPI interface - */ -int smImage_Active_Configuration_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageActiveConfigurationQueryOutput ** outData) { - const char * const functionName = "Image_Active_Configuration_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (userid) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDefine.c b/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDefine.c deleted file mode 100644 index 5bd08bf..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDefine.c +++ /dev/null @@ -1,87 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Define_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuDefineOutput - -/** - * Image_CPU_Define SMAPI interface - */ -int smImage_CPU_Define(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, char cpuType, - vmApiImageCpuDefineOutput ** outData) { - const char * const functionName = "Image_CPU_Define"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress) + 1; /* CPU type */ - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - *cursor = cpuType; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDefineDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDefineDm.c deleted file mode 100644 index e293d50..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDefineDm.c +++ /dev/null @@ -1,102 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Define_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuDefineDmOutput - -/** - * Image_CPU_Define_DM SMAPI interface - */ -int smImage_CPU_Define_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, char baseCpu, char * cpuId, - char dedicateCpu, char cryptoCpu, - vmApiImageCpuDefineDmOutput ** outData) { - const char * const functionName = "Image_CPU_Define_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress) + 1 /* Base CPU */+ 4 + strlen(cpuId) + 1 - /* Dedicate CPU */+ 1; /* Crypto */ - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - *cursor = baseCpu; - cursor++; - - tempSize = strlen(cpuId); // CPU ID 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, cpuId, tempSize); - cursor += tempSize; - } - - *cursor = dedicateCpu; - cursor++; - - *cursor = cryptoCpu; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDelete.c b/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDelete.c deleted file mode 100644 index 7931c0f..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDelete.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuDeleteOutput - -/** - * Image_CPU_Delete SMAPI interface - */ -int smImage_CPU_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuDeleteOutput ** outData) { - const char * const functionName = "Image_CPU_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // UserID 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDeleteDm.c deleted file mode 100644 index 5f499b5..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuDeleteDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuDeleteDmOutput - -/** - * Image_CPU_Delete_DM SMAPI interface - */ -int smImage_CPU_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuDeleteDmOutput ** outData) { - const char * const functionName = "Image_CPU_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiImageCpuQuery.c deleted file mode 100644 index 90c6067..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuQuery.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuQueryOutput - -/** - * Image_CPU_Query SMAPI interface - */ -int smImage_CPU_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageCpuQueryOutput ** outData) { - const char * const functionName = "Image_CPU_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageCpuQueryDm.c deleted file mode 100644 index d53e93b..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuQueryDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuQueryDmOutput - -/** - * Image_CPU_Query_DM SMAPI interface - */ -int smImage_CPU_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * cpuAddress, - vmApiImageCpuQueryDmOutput ** outData) { - const char * const functionName = "Image_CPU_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - cpuAddress); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(cpuAddress); // CPU address 1..2 - PUT_INT(tempSize, cursor); - memcpy(cursor, cpuAddress, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuSetMaximumDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageCpuSetMaximumDm.c deleted file mode 100644 index e2b3995..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageCpuSetMaximumDm.c +++ /dev/null @@ -1,80 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_CPU_Set_Maximum_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCpuSetMaximumDmOutput - -/** - * Image_CPU_Set_Maximum_DM SMAPI interface - */ -int smImage_CPU_Set_Maximum_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int maxCpus, - vmApiImageCpuSetMaximumDmOutput ** outData) { - const char * const functionName = "Image_CPU_Set_Maximum_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* Max CPUs */; - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - PUT_INT(maxCpus, cursor); - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageCreateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageCreateDm.c deleted file mode 100644 index 3064b28..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageCreateDm.c +++ /dev/null @@ -1,122 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageCreateDmOutput - -/** - * Image_Create_DM SMAPI interface - */ -int smImage_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * prototypeName, - int initialPasswordLength, char * initialPassword, - char * initialAccountNumber, int imageRecordCount, - vmApiImageRecord * imageRecordList, vmApiImageCreateDmOutput ** outData) { - const char * const functionName = "Image_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - prototypeName) + 4 + initialPasswordLength + 4 + strlen( - initialAccountNumber) + 4; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int imageRecordTotal = 0; - for (i = 0; i < imageRecordCount; i++) { - inputSize += 4; // Record length integer - inputSize += imageRecordList[i].imageRecordLength; // Data length - - imageRecordTotal += 4; - imageRecordTotal += imageRecordList[i].imageRecordLength; - } - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize + 4))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (image name) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(prototypeName); // Prototype name 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, prototypeName, tempSize); - cursor += tempSize; - } - - tempSize = initialPasswordLength; // Initial password 0..200 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, initialPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(initialAccountNumber); // Initial account number 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, initialAccountNumber, tempSize); - cursor += tempSize; - } - - // Add in the length of images array then the data if available - PUT_INT(imageRecordTotal, cursor); - if (imageRecordTotal > 0) { - for (i = 0; i < imageRecordCount; i++) { - tempSize = imageRecordList[i].imageRecordLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, imageRecordList[i].imageRecord, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDeactivate.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDeactivate.c deleted file mode 100644 index ac0f4e9..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDeactivate.c +++ /dev/null @@ -1,86 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Deactivate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeactivateOutput - -/** - * Image_Deactivate SMAPI interface - */ -int smImage_Deactivate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * forceTime, - vmApiImageDeactivateOutput ** outData) { - const char * const functionName = "Image_Deactivate"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - forceTime); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 or 1..64 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(forceTime); // Force time 0..12 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, forceTime, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDeleteDm.c deleted file mode 100644 index b60a58a..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDeleteDm.c +++ /dev/null @@ -1,82 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeleteDmOutput - -/** - * Image_Delete_DM SMAPI interface - */ -int smImage_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char dataSecurityErase, - vmApiImageDeleteDmOutput ** outData) { - const char * const functionName = "Image_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1; - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Data security erase byte - *cursor = dataSecurityErase; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceDedicate.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceDedicate.c deleted file mode 100644 index d79cdec..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceDedicate.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Dedicate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceDedicateOutput - -/** - * Image_Device_Dedicate SMAPI interface - */ -int smImage_Device_Dedicate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - char * realDeviceNumber, char readonly, - vmApiImageDeviceDedicateOutput ** outData) { - const char * const functionName = "Image_Device_Dedicate"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(realDeviceNumber) + 1; // For readonly char - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(realDeviceNumber); // Real device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, realDeviceNumber, tempSize); - cursor += tempSize; - - // Readonly byte - *cursor = readonly; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceDedicateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceDedicateDm.c deleted file mode 100644 index e16b105..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceDedicateDm.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Dedicate_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceDedicateDmOutput - -/** - * Image_Device_Dedicate SMAPI interface - */ -int smImage_Device_Dedicate_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - char * realDeviceNumber, char readonly, - vmApiImageDeviceDedicateDmOutput ** outData) { - const char * const functionName = "Image_Device_Dedicate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(realDeviceNumber) + 1; // For readonly char - - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(realDeviceNumber); // Real device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, realDeviceNumber, tempSize); - cursor += tempSize; - - // Readonly byte - *cursor = readonly; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceReset.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceReset.c deleted file mode 100644 index b23345a..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceReset.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Reset_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceResetOutput - -/** - * Image_Device_Dedicate SMAPI interface - */ -int smImage_Device_Reset(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceResetOutput ** outData) { - const char * const functionName = "Image_Device_Reset"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceUndedicate.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceUndedicate.c deleted file mode 100644 index acb863a..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceUndedicate.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Undedicate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceUndedicateOutput - -/** - * Image_Device_Dedicate SMAPI interface - */ -int smImage_Device_Undedicate(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceUndedicateOutput ** outData) { - const char * const functionName = "Image_Device_Undedicate"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceUndedicateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceUndedicateDm.c deleted file mode 100644 index 198564d..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDeviceUndedicateDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Device_Undedicate_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDeviceUndedicateOutput - -/** - * Image_Device_Undedicate_DM SMAPI interface - */ -int smImage_Device_Undedicate_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumber, - vmApiImageDeviceUndedicateDmOutput ** outData) { - const char * const functionName = "Image_Device_Undedicate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCopy.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCopy.c deleted file mode 100644 index f3e65bb..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCopy.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Copy_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskCopyOutput - -/** - * Image_Device_Undedicate_DM SMAPI interface - */ -int smImage_Disk_Copy(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskCopyOutput ** outData) { - const char * const functionName = "Image_Disk_Copy"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCopyDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCopyDm.c deleted file mode 100644 index 2c2805d..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCopyDm.c +++ /dev/null @@ -1,144 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Copy_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskCopyDmOutput - -/** - * Image_Disk_Copy_DM - */ -int smImage_Disk_Copy_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * sourceImageName, char * sourceImageDiskNumber, - char * imageDiskAllocationType, char * allocationAreaName, - char * imageDiskMode, char * readPassword, char * writePassword, - char * multiPassword, vmApiImageDiskCopyDmOutput ** outData) { - const char * const functionName = "Image_Disk_Copy_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(sourceImageName) + 4 + strlen( - sourceImageDiskNumber) + 4 + strlen(imageDiskAllocationType) + 4 - + strlen(allocationAreaName) + 4 + strlen(imageDiskMode) + 4 - + strlen(readPassword) + 4 + strlen(writePassword) + 4 + strlen( - multiPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(sourceImageName); // Image name 1..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, sourceImageName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(sourceImageDiskNumber); // Source image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, sourceImageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskAllocationType); // Image allocation type 0..10 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageDiskAllocationType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(allocationAreaName); // Allocation area name 0..10 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, allocationAreaName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(imageDiskMode); // Image disk mode 0..5 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageDiskMode, tempSize); - cursor += tempSize; - } - - tempSize = strlen(readPassword); // Read password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, readPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(writePassword); // Write password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, writePassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(multiPassword); // Multi password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, multiPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCreate.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCreate.c deleted file mode 100644 index 8522ff4..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCreate.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskCreateOutput - -/** - * Image_Disk_Create SMAPI interface - */ -int smImage_Disk_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, char * imageDiskMode, - vmApiImageDiskCreateOutput ** outData) { - const char * const functionName = "Image_Disk_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(imageDiskMode); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskMode); // Image disk mode 0..5 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageDiskMode, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCreateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCreateDm.c deleted file mode 100644 index c7ce7a6..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskCreateDm.c +++ /dev/null @@ -1,150 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskCreateDmOutput - -/** - * Image_Disk_Create_DM SMAPI interface - */ -int smImage_Disk_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * imageDiskDeviceType, char * imageDiskAllocationType, - char * allocationAreaNameOrVolser, char allocationUnitSize, - int imageDiskSize, char * imageDiskMode, char imageDiskFormatting, - char * imageDiskLabel, char * readPassword, char * writePassword, - char * multiPassword, vmApiImageDiskCreateDmOutput ** outData) { - const char * const functionName = "Image_Disk_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(imageDiskDeviceType) + 4 + strlen( - imageDiskAllocationType) + 4 + strlen(allocationAreaNameOrVolser) - + 1 + /* allocationUnitSize */4 /* imageDiskSize */+ 4 + strlen( - imageDiskMode) + 1 /* imageDiskFormatting */+ 4 + strlen( - imageDiskLabel) + 4 + strlen(readPassword) + 4 + strlen( - writePassword) + 4 + strlen(multiPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskDeviceType); // Image disk device type 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskDeviceType, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskAllocationType); // Image disk allocation type 1..10 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskAllocationType, tempSize); - cursor += tempSize; - - tempSize = strlen(allocationAreaNameOrVolser); // Allocation area name or volser 0..8, 0..6 or 0..4 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, allocationAreaNameOrVolser, tempSize); - cursor += tempSize; - } - - *cursor = allocationUnitSize; // Allocation Unit size - cursor++; - - PUT_INT(imageDiskSize, cursor); // Image disk size - - tempSize = strlen(imageDiskMode); // Image disk mode 1..5 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskMode, tempSize); - cursor += tempSize; - - *cursor = imageDiskFormatting; // Image disk formatting - cursor++; - - tempSize = strlen(imageDiskLabel); // Image disk label 0..6 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageDiskLabel, tempSize); - cursor += tempSize; - } - - tempSize = strlen(readPassword); // Read password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, readPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(writePassword); // Write password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, writePassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(multiPassword); // Multi password 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, multiPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskDelete.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskDelete.c deleted file mode 100644 index 7d2f260..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskDelete.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskDeleteOutput - -/** - * Image_Disk_Delete SMAPI interface - */ -int smImage_Disk_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskDeleteOutput ** outData) { - const char * const functionName = "Image_Disk_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskDeleteDm.c deleted file mode 100644 index f8a4558..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskDeleteDm.c +++ /dev/null @@ -1,86 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskDeleteDmOutput - -/** - * Image_Disk_Delete SMAPI interface - */ -int smImage_Disk_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char dataSecurityErase, vmApiImageDiskDeleteDmOutput ** outData) { - const char * const functionName = "Image_Disk_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 1 /* dataSecurityErase */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - *cursor = dataSecurityErase; // Data security erase byte - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskShare.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskShare.c deleted file mode 100644 index 273ff39..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskShare.c +++ /dev/null @@ -1,111 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Share_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskShareOutput - -/** - * Image_Disk_Share SMAPI interface - */ -int smImage_Disk_Share(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - char * readWriteMode, char * optionalPassword, - vmApiImageDiskShareOutput ** outData) { - const char * const functionName = "Image_Disk_Share"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(targetImageName) + 4 + strlen( - targetImageDiskNumber) + 4 + strlen(readWriteMode) + 4 + strlen( - optionalPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageName); // Target image name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageName, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageDiskNumber); // Target image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(readWriteMode); // Read write mode 0-4 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, readWriteMode, tempSize); - cursor += tempSize; - } - - tempSize = strlen(optionalPassword); // Optional password to share the disk 0-8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, optionalPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskShareDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskShareDm.c deleted file mode 100644 index 7fc9fe3..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskShareDm.c +++ /dev/null @@ -1,111 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Share_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskShareDmOutput - -/** - * Image_Disk_Share_DM SMAPI interface - */ -int smImage_Disk_Share_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - char * readWriteMode, char * optionalPassword, - vmApiImageDiskShareDmOutput ** outData) { - const char * const functionName = "Image_Disk_Share_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(targetImageName) + 4 + strlen( - targetImageDiskNumber) + 4 + strlen(readWriteMode) + 4 + strlen( - optionalPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageName); // Target image name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageName, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageDiskNumber); // Target image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(readWriteMode); // Read write mode 0-4 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, readWriteMode, tempSize); - cursor += tempSize; - } - - tempSize = strlen(optionalPassword); // Optional password to share the disk 0-8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, optionalPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskUnshare.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskUnshare.c deleted file mode 100644 index 6fd5b66..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskUnshare.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Unshare_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskUnshareOutput - -/** - * Image_Disk_Unshare SMAPI interface - */ -int smImage_Disk_Unshare(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - vmApiImageDiskUnshareOutput ** outData) { - const char * const functionName = "Image_Disk_Unshare"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskUnshareDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageDiskUnshareDm.c deleted file mode 100644 index 01a663a..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageDiskUnshareDm.c +++ /dev/null @@ -1,95 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Disk_Unshare_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageDiskUnshareDmOutput - -/** - * Image_Disk_Unshare_DM SMAPI interface - */ -int smImage_Disk_Unshare_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDiskNumber, - char * targetImageName, char * targetImageDiskNumber, - vmApiImageDiskUnshareDmOutput ** outData) { - const char * const functionName = "Image_Disk_Unshare_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDiskNumber) + 4 + strlen(targetImageName) + 4 + strlen( - targetImageDiskNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDiskNumber); // Image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageName); // Target image name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageName, tempSize); - cursor += tempSize; - - tempSize = strlen(targetImageDiskNumber); // Target image disk number 1..4 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetImageDiskNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageIplDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageIplDeleteDm.c deleted file mode 100644 index b01b79e..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageIplDeleteDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_IPL_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageIplDeleteDmOutput - -/** - * Image_IPL_Delete_DM SMAPI interface - */ -int smImage_IPL_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageIplDeleteDmOutput ** outData) { - const char * const functionName = "Image_IPL_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageIplDeviceQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiImageIplDeviceQuery.c deleted file mode 100644 index f9aebb0..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageIplDeviceQuery.c +++ /dev/null @@ -1,62 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_IPL_Device_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageIplDeviceQueryOutput - -/** - * Image_IPL_Device_Query SMAPI interface - */ -int smImage_IPL_Device_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, vmApiImageIplDeviceQueryOutput ** outData) { - const char * const functionName = "Image_IPL_Device_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1 /* Null term */+ strlen( - userid) + 1 /* Null term */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - tempSize = strlen(userid); - strcpy(cursor, userid); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageIplQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageIplQueryDm.c deleted file mode 100644 index 94cc311..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageIplQueryDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_IPL_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageIplQueryDmOutput - -/** - * Image_IPL_Query_DM SMAPI interface - */ -int smImage_IPL_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageIplQueryDmOutput ** outData) { - const char * const functionName = "Image_IPL_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageIplSetDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageIplSetDm.c deleted file mode 100644 index 1666064..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageIplSetDm.c +++ /dev/null @@ -1,98 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_IPL_Set_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageIplSetDmOutput - -/** - * Image_IPL_Set_DM SMAPI interface - */ -int smImage_IPL_Set_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * savedSystem, char * loadParameter, - char * parameterString, vmApiImageIplSetDmOutput ** outData) { - const char * const functionName = "Image_IPL_Set_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - savedSystem) + 4 + strlen(loadParameter) + 4 + strlen( - parameterString); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(savedSystem); // Saved system 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, savedSystem, tempSize); - cursor += tempSize; - - tempSize = strlen(loadParameter); // Load parameter 0..10 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, loadParameter, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parameterString); // Parameter string 0..64 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parameterString, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageLockDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageLockDm.c deleted file mode 100644 index a732419..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageLockDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Lock_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageLockDmOutput - -/** - * Image_Lock_DM SMAPI interface - */ -int smImage_Lock_DM(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * deviceAddress, vmApiImageLockDmOutput ** outData) { - const char * const functionName = "Image_Lock_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - deviceAddress); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(deviceAddress); // Device address 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, deviceAddress, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageNameQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageNameQueryDm.c deleted file mode 100644 index 0c2861b..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageNameQueryDm.c +++ /dev/null @@ -1,411 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Name_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageNameQueryDmOutput - -/** - * Image_Name_Query_DM SMAPI interface - */ -int smImage_Name_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageNameQueryDmOutput ** outData) { - const char * const functionName = "Image_Name_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc = 0; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - int i; - int temp; - char *imageName; - vmApiImageName *nameList; - - FILE* cacheFileP = 0; - char resultLine[10]; - int resultLineL = 0; - char cachePath[BUFLEN + 1]; - int cacheFileFD; - struct flock fl; - int recordCount = 0; - char traceLine[LINESIZE + 100]; - int dataReadFromCache = 0; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - // Read from the cache file, if exists. - - memset(cachePath, 0, sizeof(cachePath)); - strcpy(cachePath, "/var/opt/ibm/zvmmap/.vmapi/.cache/"); - strcat(cachePath, "users.list"); - - TRACE_START(vmapiContextP, TRACEAREA_RESOURCE_LAYER, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file to look for: <%.*s> \n", LINESIZE, cachePath); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cachePath) { - if (cacheFileValid(vmapiContextP, cachePath)) { - cacheFileP = fopen(cachePath, "r"); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file pointer opened for read: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileP != NULL) { - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while reading, so no one else is writing into it - fl.l_type = F_RDLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - // Try to get the lock, if the file is in use by some other process, fetch the information from directory - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file read lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - *outData = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiImageNameQueryDmOutput)); - nameList = smMemoryGroupAlloc(vmapiContextP, - sizeof(nameList)); - - if (nameList == 0 || *outData == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, traceLine); - return MEMORY_ERROR; - } - - while (fgets(resultLine, sizeof(resultLine), cacheFileP)) { - resultLineL = strlen(resultLine); - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Found the user <%s> in Cache \n", - resultLine); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - recordCount++; - if (resultLineL > 0) { - if (resultLine[resultLineL - 1] == '\n') { - --resultLineL; - resultLine[resultLineL] = 0; - } - } - imageName = smMemoryGroupAlloc(vmapiContextP, - resultLineL); - if (imageName == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, - traceLine); - return MEMORY_ERROR; - } - - strcpy(imageName, resultLine); - dataReadFromCache = 1; - - if (recordCount > 1) { - nameList = smMemoryGroupRealloc(vmapiContextP, - (void *) nameList, recordCount - * sizeof(nameList)); - if (nameList == 0) { - sprintf( - traceLine, - "***Error trying to obtain realloc memory for cache records of size %d.\n", - recordCount * sizeof(nameList)); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), RcRuntime, - RsNoMemory, traceLine); - return MEMORY_ERROR; - } - } - nameList[recordCount - 1].imageName = imageName; - } - - (*outData) -> nameList = nameList; - (*outData) -> nameCount = recordCount; - (*outData) -> common.returnCode - = (*outData) -> common.reasonCode = 0; - - // Unlock the file - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file read lock to be unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - sprintf(traceLine, - "***Error trying to unlock cache file read lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file read lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If cache data used return to caller - if (dataReadFromCache) { - return rc; - } - - } - } - // Cache file is invalid/missing/(out of date) remove it - else { - if (remove(cachePath)) { - // If the error is anything but the file is not found - if (ENOENT != errno) { - sprintf( - traceLine, - "***Error removing out of date cache file <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file not found.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } else { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file erased, too old.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } - } - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - - if (0 == rc) { - if ((0 == (*outData)->common.returnCode) && (0 - == (*outData)->common.reasonCode)) { - // Write the cache file - // Build path to the cache directory - memset(cachePath, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - strcat(cachePath, "users.list"); - - if (cachePath) { - createDirectories(cachePath); - cacheFileP = fopen(cachePath, "w"); - if (NULL == cacheFileP) { - sprintf( - traceLine, - "***Error trying to open cache file for write. errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file pointer opened for WRITE: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileP != NULL) { - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while writing, so no one else is using it - fl.l_type = F_WRLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file WRITE lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - temp = (*outData)->nameCount; - - if (temp > 0) { - for (i = 0; i < temp; i++) { - memset(resultLine, 0, 9); - memcpy( - resultLine, - (*outData)->nameList[i].imageName, - strlen( - (*outData)->nameList[i].imageName) - + 1); - strcat(resultLine, "\n"); - fprintf(cacheFileP, "%s", resultLine); - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf( - traceLine, - "Adding user id <%s> in Cache \n", - resultLine); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - rc = fflush(cacheFileP); - if (EOF == rc) { - // Can't write to file, try to remove file - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - cacheFileP = 0; - if (remove(cachePath)) { - sprintf( - traceLine, - "***Error removing cache file after write error <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - return rc; // Continue processing even if cache file was removed - } - } - } - - // Unlock the file - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock cache file WRITE lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file write lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - } - } - - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImagePasswordSetDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImagePasswordSetDm.c deleted file mode 100644 index cf5ff58..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImagePasswordSetDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Password_Set_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImagePasswordSetDmOutput - -/** - * Image_Password_Set_DM SMAPI interface - */ -int smImage_Password_Set_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int imagePasswordLength, char * imagePassword, - vmApiImagePasswordSetDmOutput ** outData) { - const char * const functionName = "Image_Password_Set_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 - + imagePasswordLength; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = imagePasswordLength; // Image password 1..200 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imagePassword, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageQueryActivateTime.c b/zhcp/zhcp-build/resource_access/src/vmapiImageQueryActivateTime.c deleted file mode 100644 index 39f7be2..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageQueryActivateTime.c +++ /dev/null @@ -1,80 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Query_Activate_Time_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageQueryActivateTimeOutput - -/** - * Image_Query_Activate_Time SMAPI interface - */ -int smImage_Query_Activate_Time(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char dateFormat, - vmApiImageQueryActivateTimeOutput ** outData) { - const char * const functionName = "Image_Query_Activate_Time"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 /* Data format char */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = dateFormat; // Date format character - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageQueryDm.c deleted file mode 100644 index 8e38172..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageQueryDm.c +++ /dev/null @@ -1,563 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include "smPublic.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageQueryDmOutput - -extern void vmbkendGetCachePath(struct _VmApiInternalContext* vmapiContextP, - char *pathP); - -void hidePassword(char *directoryRecord); - -/** - * Image_Query_DM SMAPI interface - */ -int smImage_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageQueryDmOutput ** outData, - bool readFromCache) { - - char cachePath[BUFLEN + 1]; - char userID[10]; - FILE* cacheFileP = 0; - char resultLine[256]; - int resultLineL = 0; - const char* cP = 0; - - const char * const functionName = "Image_Query_DM"; - int tempSize; - char * cursor; - int rc = 0; - char traceLine[LINESIZE + 100]; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - int i; - int temp; - - char * tempTargetIdentifier = targetIdentifier; - - vmApiImageRecord *recordList; - char *imageRecord; - int imageRecordLen; - - int recordCount = 0; - int dataReadFromCache = 0; - - int cacheFileFD; - struct flock fl; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - memset(cachePath, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - memset(userID, 0, sizeof(userID)); - - i = 0; - for (; *tempTargetIdentifier != '\0'; tempTargetIdentifier++) { - userID[i++] = tolower(*tempTargetIdentifier); - } - - tempTargetIdentifier = targetIdentifier; - - userID[i--] = '\0'; - strcat(cachePath, userID); - strcat(cachePath, ".direct"); - - if (cachePath && readFromCache) { - - if (cacheFileValid(vmapiContextP, cachePath)) { - cacheFileP = fopen(cachePath, "r"); - if (cacheFileP) { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file pointer opened for read: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while reading, so no one else is writing into it - fl.l_type = F_RDLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - // Try to get the lock, if the file is in use by some other process, fetch the information from directory - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file read lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - recordList = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiImageRecord)); - *outData = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiImageQueryDmOutput)); - if (recordList == 0 || *outData == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, traceLine); - return MEMORY_ERROR; - } - while (fgets(resultLine, sizeof(resultLine), cacheFileP)) { - resultLineL = strlen(resultLine); - recordCount++; - if (resultLineL > 0) { - if (resultLine[resultLineL - 1] == '\n') { - --resultLineL; - resultLine[resultLineL] = 0; - } - } - imageRecordLen = resultLineL; - imageRecord = smMemoryGroupAlloc(vmapiContextP, - imageRecordLen); - if (imageRecord == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, - traceLine); - return MEMORY_ERROR; - } - strcpy(imageRecord, resultLine); - dataReadFromCache = 1; - - if (recordCount > 1) { - recordList = smMemoryGroupRealloc( - vmapiContextP, (void *) recordList, - recordCount * sizeof(vmApiImageRecord)); - if (recordList == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), RcRuntime, - RsNoMemory, traceLine); - return MEMORY_ERROR; - } - } - recordList[recordCount - 1].imageRecord - = imageRecord; - recordList[recordCount - 1].imageRecordLength - = imageRecordLen; - - } - - (*outData) -> imageRecordList = recordList; - (*outData) -> imageRecordCount = recordCount; - (*outData) -> common.returnCode - = (*outData) -> common.reasonCode = 0; - // Unlock the file. - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file read lock to be unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock cache file read lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file read lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - // Else if not able to get lock, continue with call - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If cache data used return to caller - if (dataReadFromCache) { - return rc; - } - } - } - // Cache file is invalid/missing/(out of date) remove it - else { - if (remove(cachePath)) { - // If the error is anything but the file is not found - if (ENOENT != errno) { - sprintf( - traceLine, - "***Error removing out of date cache file <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file not found.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } else { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file erased, too old.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } - } - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - - // Do the caching of the image. - if ((0 == rc) && readFromCache) // Do not store if the call was for getting data with password - { - if ((0 == (*outData)->common.returnCode) && (0 - == (*outData)->common.reasonCode)) { - // Write the cache file - // Build path to the cache directory. - memset(cachePath, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - memset(userID, 0, sizeof(userID)); - - i = 0; - for (; *tempTargetIdentifier != '\0'; tempTargetIdentifier++) { - userID[i++] = tolower(*tempTargetIdentifier); - } - userID[i--] = '\0'; - strcat(cachePath, userID); - strcat(cachePath, ".direct"); - - if (cachePath) { - cacheFileP = 0; - createDirectories(cachePath); - cacheFileP = fopen(cachePath, "w"); - if (NULL == cacheFileP) { - sprintf( - traceLine, - "***Error trying to open cache file for write. errno %d\n", - errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file pointer opened for WRITE: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If the file opened for write then add cache information - if (cacheFileP != NULL) { - - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while writing, so no one else is using it - fl.l_type = F_WRLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file WRITE lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - temp = (*outData)->imageRecordCount; - - if (temp > 0) { - for (i = 0; i < temp; i++) { - memset(resultLine, 0, sizeof(resultLine)); - memcpy( - resultLine, - (*outData)->imageRecordList[i].imageRecord, - (*outData)->imageRecordList[i].imageRecordLength); - resultLineL = strlen(resultLine); - if (resultLineL > 71) { - resultLine[71] = 0; - resultLineL = 71; - } - strip(resultLine, 'T', ' '); - cP = &resultLine[0]; - while (cP && (*cP == ' ')) - ++cP; - - hidePassword(resultLine); - strcat(resultLine, "\n"); - fprintf(cacheFileP, "%s", resultLine); - rc = fflush(cacheFileP); - if (EOF == rc) { - // Can't write to file, try to remove file - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - cacheFileP = 0; - if (remove(cachePath)) { - sprintf( - traceLine, - "***Error removing cache file after write error <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - return rc; // Continue processing even if cache file was removed - } - } - } - - // Unlock the file - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock cache file WRITE lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Cache file write lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - } - } - - return rc; -} - -/** - * This function removes the password field of USER and MDISK statements. - */ -void hidePassword(char *directoryRecord) { - char tempBuffer[100]; - char * savePtr; - int length = strlen(directoryRecord); - - char replacedString[100]; - char * token; - memcpy(tempBuffer, directoryRecord, length); - tempBuffer[length] = '\0'; - token = strtok_r(tempBuffer, " ", &savePtr); - - if (token != NULL) { - if (0 == strncasecmp(token, "USER", strlen(token))) { - strcpy(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); // This is userID - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, "XXXXX"); // This is password - strcat(replacedString, " "); - - while (token != NULL) { - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - strcat(replacedString, token); // This is userID - strcat(replacedString, " "); - } - } - - strcpy(directoryRecord, replacedString); - } else if (strncasecmp(token, "MDISK", strlen(token)) == 0) { - strcpy(replacedString, token); - strcat(replacedString, " "); - - // MDISK Address(VDEV) Value - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - - // MDISK Dev Type Value - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - // DEVICE Number Value - if (strncasecmp(token, "DEVNO", strlen(token)) == 0) { - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - } - // V_DISK Value in Blocks - else if (strncasecmp(token, "V-DISK", strlen(token)) == 0) { - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - } - // T-DISK Value in Cylinders or Blocks - else if (strncasecmp(token, "T-DISK", strlen(token)) == 0) { - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - } else { - // CYL or BLK Start - strcat(replacedString, token); - strcat(replacedString, " "); - - //CYL or BLK End - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - - // Volume Serial Number - token = strtok_r(NULL, " ", &savePtr); - strcat(replacedString, token); - strcat(replacedString, " "); - } - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - // Access Mode - strcat(replacedString, token); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - strcat(replacedString, "XXXXX"); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - strcat(replacedString, "XXXXX"); - strcat(replacedString, " "); - - token = strtok_r(NULL, " ", &savePtr); - if (token != NULL) { - strcat(replacedString, "XXXXX"); - strcat(replacedString, " "); - - } - } - } - strcpy(directoryRecord, replacedString); - } - } - } - } -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageRecycle.c b/zhcp/zhcp-build/resource_access/src/vmapiImageRecycle.c deleted file mode 100644 index 267d31f..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageRecycle.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Recycle_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageRecycleOutput - -/** - * Image_Recycle SMAPI interface - */ -int smImage_Recycle(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageRecycleOutput ** outData) { - const char * const functionName = "Image_Recyle"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageReplaceDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageReplaceDm.c deleted file mode 100644 index 9c41772..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageReplaceDm.c +++ /dev/null @@ -1,95 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Replace_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageReplaceDmOutput - -/** - * Image_Replace_DM SMAPI interface - */ -int smImage_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int imageRecordArrayCount, - vmApiImageRecord * imageRecordList, - vmApiImageReplaceDmOutput ** outData) { - const char * const functionName = "Image_Replace_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* imageRecordArrayLength */; /* Need to add in actual array data size */ - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i, totalArraySize; - - totalArraySize = 0; - for (i = 0; i < imageRecordArrayCount; i++) { - totalArraySize += imageRecordList[i].imageRecordLength + 4; - inputSize += imageRecordList[i].imageRecordLength + 4; - } - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of image record array then the data if available - PUT_INT(totalArraySize, cursor); - - if (totalArraySize > 0) { - for (i = 0; i < imageRecordArrayCount; i++) { - tempSize = imageRecordList[i].imageRecordLength; - PUT_INT(tempSize, cursor); - memcpy(cursor, imageRecordList[i].imageRecord, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageScsiCharacteristicsDefineDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageScsiCharacteristicsDefineDm.c deleted file mode 100644 index 467ea00..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageScsiCharacteristicsDefineDm.c +++ /dev/null @@ -1,118 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_SCSI_Characteristics_Define_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageScsiCharacteristicsDefineDmOutput - -/** - * Image_SCSI_Characteristics_Define_DM SMAPI interface - */ -int smImage_SCSI_Characteristics_Define_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * bootProgram, char * brLba, char * lun, char * portName, - char scpDatatype, int scpDataLength, char * scpData, - vmApiImageScsiCharacteristicsDefineDmOutput ** outData) { - const char * const functionName = "Image_SCSI_Characteristics_Define_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - bootProgram) + 4 + strlen(brLba) + 4 + strlen(lun) + 4 + strlen( - portName) + 1 /* SCP data type*/+ 4 + scpDataLength; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(bootProgram); // Boot program 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, bootProgram, tempSize); - cursor += tempSize; - } - - tempSize = strlen(brLba); // BR LBA 0..16 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, brLba, tempSize); - cursor += tempSize; - } - - tempSize = strlen(lun); // LUN 0..16 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, lun, tempSize); - cursor += tempSize; - } - - tempSize = strlen(portName); // Port name 0..16 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, portName, tempSize); - cursor += tempSize; - } - - *cursor = scpDatatype; // Char 1 - - tempSize = scpDataLength; // SCP data 0..4096 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, scpData, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageScsiCharacteristicsQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageScsiCharacteristicsQueryDm.c deleted file mode 100644 index a8c7d68..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageScsiCharacteristicsQueryDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_SCSI_Characteristics_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageScsiCharacteristicsQueryDmOutput - -/** - * Image_SCSI_Characteristics_Query_DM SMAPI interface - */ -int smImage_SCSI_Characteristics_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiImageScsiCharacteristicsQueryDmOutput ** outData) { - const char * const functionName = "Image_SCSI_Characteristics_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageStatusQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiImageStatusQuery.c deleted file mode 100644 index 79ae875..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageStatusQuery.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Status_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageStatusQueryOutput - -/** - * Image_Status_Query SMAPI interface - */ -int smImage_Status_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiImageStatusQueryOutput ** outData) { - const char * const functionName = "Image_Status_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageUnlockDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageUnlockDm.c deleted file mode 100644 index 63fa36f..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageUnlockDm.c +++ /dev/null @@ -1,85 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Unlock_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageUnlockDmOutput - -/** - * Image_Unlock_DM SMAPI interface - */ -int smImage_Unlock_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * deviceAddress, - vmApiImageUnlockDmOutput ** outData) { - const char * const functionName = "Image_Unlock_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - deviceAddress); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(deviceAddress); // Device address 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, deviceAddress, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeAdd.c b/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeAdd.c deleted file mode 100644 index 64687f1..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeAdd.c +++ /dev/null @@ -1,150 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Add_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeAddOutput - -/** - * Image_Volume_Add SMAPI interface - */ -int smImage_Volume_Add(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumer, - char * imageVolumeLabel, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, - vmApiImageVolumeAddOutput ** outData) { - const char * const functionName = "Image_Volume_Add"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumer) + 4 + strlen(imageVolumeLabel) + 4 + strlen( - systemConfigName) + 4 + strlen(systemConfigType) + 4 + strlen( - parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumer); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumer, tempSize); - cursor += tempSize; - - tempSize = strlen(imageVolumeLabel); // Image volume label 1..6 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageVolumeLabel, tempSize); - cursor += tempSize; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeDelete.c b/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeDelete.c deleted file mode 100644 index c69c70a..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeDelete.c +++ /dev/null @@ -1,150 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeDeleteOutput - -/** - * Image_Volume_Delete SMAPI interface - */ -int smImage_Volume_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * imageDeviceNumer, - char * imageVolumeLabel, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, - vmApiImageVolumeAddOutput ** outData) { - const char * const functionName = "Image_Volume_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + strlen(password) + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumer) + 4 + strlen(imageVolumeLabel) + 4 + strlen( - systemConfigName) + 4 + strlen(systemConfigType) + 4 + strlen( - parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = strlen(password); // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumer); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumer, tempSize); - cursor += tempSize; - - tempSize = strlen(imageVolumeLabel); // Image volume label 1..6 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageVolumeLabel, tempSize); - cursor += tempSize; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceDefineDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceDefineDm.c deleted file mode 100644 index 369558c..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceDefineDm.c +++ /dev/null @@ -1,112 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Space_Define_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeSpaceDefineDmOutput - -/** - * Image_Volume_Space_Define_DM SMAPI interface - */ -int smImage_Volume_Space_Define_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char functionType, char * regionName, - char * imageVolumeId, int startCyl, int regionSize, char * groupName, - char deviceType, vmApiImageVolumeSpaceDefineDmOutput ** outData) { - const char * const functionName = "Image_Volume_Space_Define_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 - /* Function type */ + 4 + strlen(regionName) + 4 + strlen( - imageVolumeId) + 4 /* Start cyl */+ 4 /* Region size */+ 4 + strlen( - groupName) + 1 /* DeviceType */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = functionType; // Function type - cursor++; - - tempSize = strlen(regionName); // Region name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, regionName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(imageVolumeId); // Image volume id 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageVolumeId, tempSize); - cursor += tempSize; - } - - PUT_INT(startCyl, cursor); // Start cylinder - - PUT_INT(regionSize, cursor); // Region size - - tempSize = strlen(groupName); // Group name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, groupName, tempSize); - cursor += tempSize; - } - - *cursor = deviceType; - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceQueryDm.c deleted file mode 100644 index 44fcb3e..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceQueryDm.c +++ /dev/null @@ -1,91 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Space_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeSpaceQueryDmOutput - -/** - * Image_Volume_Space_Query_DM SMAPI interface - */ -int smImage_Volume_Space_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char queryType, char entryType, - char * entryNames, vmApiImageVolumeSpaceQueryDmOutput ** outData) { - const char * const functionName = "Image_Volume_Space_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 - /* Query type */+ 1 /* Entry type */+ 4 + strlen(entryNames); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = queryType; // Query type - cursor++; - - *cursor = entryType; // Entry type - cursor++; - - tempSize = strlen(entryNames); // Entry names 0..255 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, entryNames, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceRemoveDm.c b/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceRemoveDm.c deleted file mode 100644 index 5375442..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiImageVolumeSpaceRemoveDm.c +++ /dev/null @@ -1,104 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiImage.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Image_Volume_Space_Remove_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiImageVolumeSpaceRemoveDmOutput - -/** - * Image_Volume_Space_Remove_DM SMAPI interface - */ -int smImage_Volume_Space_Remove_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char functionType, char * regionName, - char * imageVolumeId, char * groupName, - vmApiImageVolumeSpaceRemoveDmOutput ** outData) { - const char * const functionName = "Image_Volume_Space_Remove_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 1 - /* Function type */+ 4 + strlen(regionName) + 4 + strlen(imageVolumeId) + 4 - + strlen(groupName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - *cursor = functionType; // Function type - cursor++; - - tempSize = strlen(regionName); // Region name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, regionName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(imageVolumeId); // Image volume id 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, imageVolumeId, tempSize); - cursor += tempSize; - } - - tempSize = strlen(groupName); // Group name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, groupName, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiNameListAdd.c b/zhcp/zhcp-build/resource_access/src/vmapiNameListAdd.c deleted file mode 100644 index f5bdce2..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiNameListAdd.c +++ /dev/null @@ -1,81 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiName.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Name_List_Add_Layout -#define OUTPUT_STRUCTURE_NAME vmApiNameListAddOutput - -/** - * Name_List_Add SMAPI interface - */ -int smName_List_Add(struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * name, vmApiNameListAddOutput ** outData) { - const char * const functionName = "Name_List_Add"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen(name); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(name); // Name 1..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, name, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiNameListDestroy.c b/zhcp/zhcp-build/resource_access/src/vmapiNameListDestroy.c deleted file mode 100644 index 20861ef..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiNameListDestroy.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiName.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Name_List_Destroy_Layout -#define OUTPUT_STRUCTURE_NAME vmApiNameListDestroyOutput - -/** - * Name_List_Destroy SMAPI interface - */ -int smName_List_Destroy(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiNameListDestroyOutput ** outData) { - const char * const functionName = "Name_List_Destroy"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiNameListQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiNameListQuery.c deleted file mode 100644 index b678023..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiNameListQuery.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiName.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Name_List_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiNameListQueryOutput - -/** - * Name_List_Query SMAPI interface - */ -int smName_List_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiNameListQueryOutput ** outData) { - const char * const functionName = "Name_List_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiNameListRemove.c b/zhcp/zhcp-build/resource_access/src/vmapiNameListRemove.c deleted file mode 100644 index 3384d96..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiNameListRemove.c +++ /dev/null @@ -1,82 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiName.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Name_List_Remove_Layout -#define OUTPUT_STRUCTURE_NAME vmApiNameListRemoveOutput - -/** - * Name_List_Remove SMAPI interface - */ -int smName_List_Remove(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * name, - vmApiNameListRemoveOutput ** outData) { - const char * const functionName = "Name_List_Remove"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen(name); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(name); // Name 1..64 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, name, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiProfileCreateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiProfileCreateDm.c deleted file mode 100644 index ed0c639..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiProfileCreateDm.c +++ /dev/null @@ -1,98 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiProfile.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Profile_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiProfileCreateDmOutput - -/** - * Profile_Create_DM SMAPI interface - */ -int smProfile_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int profileRecordCount, - vmApiProfileRecord * profileRecordList, - vmApiProfileCreateDmOutput ** outData) { - const char * const functionName = "Profile_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* For profile record array length */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int profileRecordTotal = 0; - for (i = 0; i < profileRecordCount; i++) { - inputSize += 4; // Record length integer - inputSize += profileRecordList[i].profileRecordLength; // Data length - - profileRecordTotal += 4; - profileRecordTotal += profileRecordList[i].profileRecordLength; - } - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize + 4))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (image name) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of profile record array then the data if available - PUT_INT(profileRecordTotal, cursor); - if (profileRecordTotal > 0) { - for (i = 0; i < profileRecordCount; i++) { - tempSize = profileRecordList[i].profileRecordLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, profileRecordList[i].recordData, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiProfileDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiProfileDeleteDm.c deleted file mode 100644 index 44d9e96..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiProfileDeleteDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiProfile.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Profile_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiProfileDeleteDmOutput - -/** - * Profile_Delete_DM SMAPI interface - */ -int smProfile_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiProfileDeleteDmOutput ** outData) { - const char * const functionName = "Profile_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - ; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiProfileQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiProfileQueryDm.c deleted file mode 100644 index 62d14d0..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiProfileQueryDm.c +++ /dev/null @@ -1,427 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiProfile.h" -#include "smapiTableParser.h" -#include "smPublic.h" -#include -#include -#include -#include -#include -#include - -#define PARSER_TABLE_NAME Profile_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiProfileQueryDmOutput - -/** - * Profile_Query_DM SMAPI interface - */ -int smProfile_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiProfileQueryDmOutput ** outData) { - const char * const functionName = "Profile_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - // Cache variables - char path[BUFLEN + 1]; - char cachePath[BUFLEN + 1]; - char profileID[10]; - FILE* cacheFileP = 0; - char resultLine[256]; - int resultLineL = 0; - const char* cP = 0; - char * tempTargetIdentifier; - char traceLine[LINESIZE + 100]; - vmApiProfileRecord *recordList; - char *profileRecord; - int profileRecordLen; - int recordCount = 0; - int dataReadFromCache = 0; - int cacheFileFD; - struct flock fl; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - int i; - rc = 0; - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Check if any cache data for this profile - memset(cachePath, 0, sizeof(cachePath)); - vmbkendGetCachePath(vmapiContextP, cachePath); - memset(profileID, 0, sizeof(profileID)); - - // Force profile id name to lowercase and save it in profileID - tempTargetIdentifier = targetIdentifier; - i = 0; - for (; *tempTargetIdentifier != '\0'; tempTargetIdentifier++) { - profileID[i++] = tolower(*tempTargetIdentifier); - } - profileID[i--] = '\0'; - strcat(cachePath, profileID); - strcat(cachePath, ".direct"); - - if (cacheFileValid(vmapiContextP, cachePath)) { - cacheFileP = fopen(cachePath, "r"); - if (cacheFileP) { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file(%s) pointer opened for read: %p \n", - profileID, cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while reading, so no one else is writing into it - fl.l_type = F_RDLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - // Try to get the lock, if the file is in use by some other process, fetch the information from directory - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file read lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - recordList = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiProfileRecord)); - *outData = smMemoryGroupAlloc(vmapiContextP, - sizeof(vmApiProfileQueryDmOutput)); - if (recordList == 0 || *outData == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcRuntime, RsNoMemory, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return MEMORY_ERROR; - } - while (fgets(resultLine, sizeof(resultLine), cacheFileP)) { - resultLineL = strlen(resultLine); - recordCount++; - if (resultLineL > 0) { - if (resultLine[resultLineL - 1] == '\n') { - --resultLineL; - resultLine[resultLineL] = 0; - } - } - profileRecordLen = resultLineL; - profileRecord = smMemoryGroupAlloc(vmapiContextP, - profileRecordLen); - if (profileRecord == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return MEMORY_ERROR; - } - strcpy(profileRecord, resultLine); - dataReadFromCache = 1; - - if (recordCount > 1) { - recordList = smMemoryGroupRealloc(vmapiContextP, - (void *) recordList, recordCount - * sizeof(vmApiProfileRecord)); - if (recordList == 0) { - sprintf(traceLine, - "***Error trying to obtain memory for cache records.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcRuntime, RsNoMemory, - traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return MEMORY_ERROR; - } - } - recordList[recordCount - 1].recordData = profileRecord; - recordList[recordCount - 1].profileRecordLength - = profileRecordLen; - - } - - (*outData) -> profileRecordList = recordList; - (*outData) -> profileRecordCount = recordCount; - (*outData) -> common.returnCode - = (*outData) -> common.reasonCode = 0; - - // Unlock the file. - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file read lock to be unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock cache file read lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file read lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - // Else if not able to get lock, continue with call - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close profile cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Profile cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If cache data used return to caller - if (dataReadFromCache) { - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return rc; - } - } - } - // Cache file is invalid/missing/(out of date) remove it - else { - if (remove(cachePath)) { - if (ENOENT != errno) // If the error is anything but the file is not found - { - sprintf( - traceLine, - "***Error removing out of date profile cache file <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_CACHE); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Profile cache file not found.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } else { - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, "Profile cache file erased, too old.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - } - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - - // Do the caching of the image. - if (0 == rc) { - if ((0 == (*outData)->common.returnCode) && (0 - == (*outData)->common.reasonCode)) { - // Write the cache file - { - cacheFileP = 0; - createDirectories(cachePath); - cacheFileP = fopen(cachePath, "w"); - if (NULL == cacheFileP) { - sprintf( - traceLine, - "***Error trying to open profile cache file (%s) for write. errno %d\n", - profileID, errno); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file pointer opened for WRITE: %p \n", - cacheFileP); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - // If the file opened for write then add cache information - if (cacheFileP != NULL) { - - cacheFileFD = fileno(cacheFileP); - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf( - traceLine, - "Profile cache file integer descriptor value: %d \n", - cacheFileFD); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - if (cacheFileFD != -1) { - // Lock the file while writing, so no one else is using it - fl.l_type = F_WRLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (fcntl(cacheFileFD, F_SETLK, &fl) != -1) { - - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file WRITE lock obtained.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - tempSize = (*outData)->profileRecordCount; - - if (tempSize > 0) { - for (i = 0; i < tempSize; i++) { - memset(resultLine, 0, sizeof(resultLine)); - memcpy( - resultLine, - (*outData)->profileRecordList[i].recordData, - (*outData)->profileRecordList[i].profileRecordLength); - resultLineL = strlen(resultLine); - if (resultLineL > 71) { - resultLine[71] = 0; - resultLineL = 71; - } - strip(resultLine, 'T', ' '); - cP = &resultLine[0]; - while (cP && (*cP == ' ')) - ++cP; - - // Ignore DIRMAINT control lines - strcat(resultLine, "\n"); - fprintf(cacheFileP, "%s", resultLine); - rc = fflush(cacheFileP); - if (EOF == rc) { - - // Can't write to file, try to remove file - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close profile cache file.\n"); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - cacheFileP = 0; - if (remove(cachePath)) { - sprintf( - traceLine, - "***Error removing profil cache file after write error <%.*s> errno %d\n", - LINESIZE, cachePath, errno); - errorLog(vmapiContextP, __func__, - TO_STRING(__LINE__), - RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - return rc; // Continue processing even if cache file was removed - } - } - } - - // Unlock the file. - fl.l_type = F_UNLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - if (-1 == fcntl(cacheFileFD, F_SETLK, &fl)) { - - sprintf(traceLine, - "***Error trying to unlock profile cache file WRITE lock.\n"); - errorLog(vmapiContextP, __func__, TO_STRING( - __LINE__), RcFunction, RsUnexpected, - traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, - "Profile cache file write lock unlocked.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - - if (0 != fclose(cacheFileP)) { - sprintf(traceLine, - "***Error trying to close profile cache file.\n"); - errorLog(vmapiContextP, __func__, TO_STRING(__LINE__), - RcFunction, RsUnexpected, traceLine); - return PROCESSING_ERROR; - } - TRACE_START(vmapiContextP, TRACEAREA_CACHE, - TRACELEVEL_DETAILS); - sprintf(traceLine, "Profile cache file closed.\n"); - TRACE_END_DEBUG(vmapiContextP, traceLine); - - } - } - } - } - - TRACE_EXIT_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiProfileReplaceDm.c b/zhcp/zhcp-build/resource_access/src/vmapiProfileReplaceDm.c deleted file mode 100644 index cc49777..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiProfileReplaceDm.c +++ /dev/null @@ -1,99 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiProfile.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Profile_Replace_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiProfileReplaceDmOutput - -/** - * Profile_Replace_DM SMAPI interface - */ -int smProfile_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int profileRecordCount, - vmApiProfileRecord * profileRecordList, - vmApiProfileReplaceDmOutput ** outData) { - const char * const functionName = "Profile_Replace_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* For profile record array length */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int profileRecordTotal = 0; - - for (i = 0; i < profileRecordCount; i++) { - inputSize += 4; // Record length integer - inputSize += profileRecordList[i].profileRecordLength; // Data length - - profileRecordTotal += 4; - profileRecordTotal += profileRecordList[i].profileRecordLength; - } - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 image name - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of profile record array then the data if available - PUT_INT(profileRecordTotal, cursor); - if (profileRecordTotal > 0) { - for (i = 0; i < profileRecordCount; i++) { - tempSize = profileRecordList[i].profileRecordLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, profileRecordList[i].recordData, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeCreateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiPrototypeCreateDm.c deleted file mode 100644 index 535efea..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeCreateDm.c +++ /dev/null @@ -1,99 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeCreateDmOutput - -/** - * Prototype_Create_DM SMAPI interface - */ -int smPrototype_Create_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int recordArrayCount, - vmApiPrototypeRecordList * recordArrayData, - vmApiPrototypeCreateDmOutput ** outData) { - const char * const functionName = "Prototype_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /* recordArraySize */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int recordTotal = 0; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - for (i = 0; i < recordArrayCount; i++) { - inputSize += 4; // Record length integer - inputSize += recordArrayData[i].recordNameLength; // Data length - - recordTotal += 4; - recordTotal += recordArrayData[i].recordNameLength; - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize + 4))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (image name) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of record array then the data if available - PUT_INT(recordTotal, cursor); - if (recordTotal > 0) { - for (i = 0; i < recordArrayCount; i++) { - tempSize = recordArrayData[i].recordNameLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, recordArrayData[i].recordName, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiPrototypeDeleteDm.c deleted file mode 100644 index 68c75dc..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeDeleteDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeDeleteDmOutput - -/** - * Prototype_Delete_DM SMAPI interface - */ -int smPrototype_Delete_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeDeleteDmOutput ** outData) { - const char * const functionName = "Prototype_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeNameQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiPrototypeNameQueryDm.c deleted file mode 100644 index f9959ea..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeNameQueryDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Name_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeNameQueryDmOutput - -/** - * Prototype_Name_Query_DM SMAPI interface - */ -int smPrototype_Name_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeNameQueryDmOutput ** outData) { - const char * const functionName = "Prototype_Name_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiPrototypeQueryDm.c deleted file mode 100644 index 93f3b2b..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeQueryDm.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeQueryDmOutput - -/** - * Prototype_Query_DM SMAPI interface - */ -int smPrototype_Query_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiPrototypeQueryDmOutput ** outData) { - const char * const functionName = "Prototype_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeReplaceDm.c b/zhcp/zhcp-build/resource_access/src/vmapiPrototypeReplaceDm.c deleted file mode 100644 index 046e345..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiPrototypeReplaceDm.c +++ /dev/null @@ -1,99 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiPrototype.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Prototype_Replace_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiPrototypeReplaceDmOutput - -/** - * Prototype_Replace_DM SMAPI interface - */ -int smPrototype_Replace_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, int recordArrayCount, - vmApiPrototypeRecordList * recordArrayData, - vmApiPrototypeReplaceDmOutput ** outData) { - const char * const functionName = "Prototype_Replace_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /*record array length */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - int recordTotal = 0; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - for (i = 0; i < recordArrayCount; i++) { - inputSize += 4; // Record length integer - inputSize += recordArrayData[i].recordNameLength; // Data length - - recordTotal += 4; - recordTotal += recordArrayData[i].recordNameLength; - } - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize + 4))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 (image name) - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // Add in the length of record array then the data if available - PUT_INT(recordTotal, cursor); - if (recordTotal > 0) { - for (i = 0; i < recordArrayCount; i++) { - tempSize = recordArrayData[i].recordNameLength; // Data length - PUT_INT(tempSize, cursor); - - memcpy(cursor, recordArrayData[i].recordName, tempSize); - cursor += tempSize; - } - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiQueryApiFunctionalLevel.c b/zhcp/zhcp-build/resource_access/src/vmapiQueryApiFunctionalLevel.c deleted file mode 100644 index d10b031..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiQueryApiFunctionalLevel.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiQuery.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Query_API_Functional_Level_Layout -#define OUTPUT_STRUCTURE_NAME vmApiQueryApiFunctionalLevelOutput - -/** - * Query_API_Functional_Level SMAPI interface - */ -int smQuery_API_Functional_Level(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiQueryApiFunctionalLevelOutput ** outData) { - const char * const functionName = "Query_API_Functional_Level"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiQueryAsynchronousOperationDm.c b/zhcp/zhcp-build/resource_access/src/vmapiQueryAsynchronousOperationDm.c deleted file mode 100644 index e97546e..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiQueryAsynchronousOperationDm.c +++ /dev/null @@ -1,79 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiQuery.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Query_Asynchronous_Operation_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiQueryAsynchronousOperationDmOutput - -/** - * Query_Asynchronous_Operation_DM SMAPI interface - */ -int smQuery_Asychronous_Operation_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - int operationId, vmApiQueryAsynchronousOperationDmOutput ** outData) { - const char * const functionName = "Query_Asynchronous_Operation_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 /*operationId*/; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - PUT_INT(operationId, cursor); // Operation ID - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiQueryDirectoryManagerLevelDm.c b/zhcp/zhcp-build/resource_access/src/vmapiQueryDirectoryManagerLevelDm.c deleted file mode 100644 index c956ed0..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiQueryDirectoryManagerLevelDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiQuery.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Query_Directory_Manager_Level_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiQueryDirectoryManagerLevelDmOutput - -/** - * Query_Directory_Manager_Level_DM SMAPI interface - */ -int smQuery_Directory_Manager_Level_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiQueryDirectoryManagerLevelDmOutput ** outData) { - const char * const functionName = "Query_Directory_Manager_Level_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessAddDm.c b/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessAddDm.c deleted file mode 100644 index 675ea2f..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessAddDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Access_Add_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryAccessAddDmOutput - -/** - * Shared_Memory_Access_Add_DM SMAPI interface - */ -int smShared_Memory_Access_Add_DM(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryAccessAddDmOutput ** outData) { - const char * const functionName = "Shared_Memory_Access_Add_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessQueryDm.c b/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessQueryDm.c deleted file mode 100644 index 8136016..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessQueryDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Access_Query_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryAccessQueryDmOutput - -/** - * Shared_Memory_Access_Query_DM SMAPI interface - */ -int smShared_Memory_Access_Query_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * memorySegmentName, - vmApiSharedMemoryAccessQueryDmOutput ** outData) { - const char * const functionName = "Shared_Memory_Access_Query_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessRemoveDm.c b/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessRemoveDm.c deleted file mode 100644 index e7ff5f9..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryAccessRemoveDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Access_Remove_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryAccessRemoveDmOutput - -/** - * Shared_Memory_Access_Remove_DM SMAPI interface - */ -int smShared_Memory_Access_Remove_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * memorySegmentName, - vmApiSharedMemoryAccessRemoveDmOutput ** outData) { - const char * const functionName = "Shared_Memory_Access_Remove_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryCreate.c b/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryCreate.c deleted file mode 100644 index fd92348..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryCreate.c +++ /dev/null @@ -1,104 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryCreateOutput - -/** - * Shared_Memory_Create SMAPI interface - */ -int smShared_Memory_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - unsigned long long beginPage, unsigned long long endPage, - char pageAccessDescriptor, char memoryAttributes, - char * memoryAccessIdentifier, vmApiSharedMemoryCreateOutput ** outData) { - const char * const functionName = "Shared_Memory_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName) + 8 + 8 /* begin page, end page */+ 1 - /* page access descriptor */+ 1/* memory attribute */+ 4 + strlen( - memoryAccessIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - PUT_64INT(beginPage, cursor); // Begin page - - PUT_64INT(endPage, cursor); // End page - - *cursor = pageAccessDescriptor; // Page access descriptor - cursor++; - - *cursor = memoryAttributes; // Memory attributes - cursor++; - - tempSize = strlen(memoryAccessIdentifier); // Memory access identifier 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, memoryAccessIdentifier, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryDelete.c b/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryDelete.c deleted file mode 100644 index fd9d462..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryDelete.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryDeleteOutput - -/** - * Shared_Memory_Delete SMAPI interface - */ -int smShared_Memory_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryDeleteOutput ** outData) { - const char * const functionName = "Shared_Memory_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryQuery.c deleted file mode 100644 index 77e6a0a..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryQuery.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryQueryOutput - -/** - * Shared_Memory_Query SMAPI interface - */ -int smShared_Memory_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - vmApiSharedMemoryQueryOutput ** outData) { - const char * const functionName = "Shared_Memory_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryReplace.c b/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryReplace.c deleted file mode 100644 index 22aa527..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSharedMemoryReplace.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiShared.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Shared_Memory_Replace_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSharedMemoryReplaceOutput - -/** - * Shared_Memory_Replace SMAPI interface - */ -int smShared_Memory_Replace(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * memorySegmentName, - char * memoryAccessIdentifier, - vmApiSharedMemoryReplaceOutput ** outData) { - const char * const functionName = "Shared_Memory_Replace"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - memorySegmentName) + 4 + strlen(memoryAccessIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(memorySegmentName); // Memory segment name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, memorySegmentName, tempSize); - cursor += tempSize; - - tempSize = strlen(memoryAccessIdentifier); // MemoryAccessIdentifier 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, memoryAccessIdentifier, tempSize); - cursor += tempSize; - } - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesActivateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesActivateDm.c deleted file mode 100644 index 2b70a93..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesActivateDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiStatic.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Static_Image_Changes_Activate_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiStaticImageChangesActivateDmOutput - -/** - * Static_Image_Changes_Activate_DM SMAPI interface - */ -int smStatic_Image_Changes_Activate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesActivateDmOutput ** outData) { - const char * const functionName = "Static_Image_Changes_Activate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesDeactivateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesDeactivateDm.c deleted file mode 100644 index 8d0a663..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesDeactivateDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiStatic.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Static_Image_Changes_Deactivate_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiStaticImageChangesDeactivateDmOutput - -/** - * Static_Image_Changes_Deactivate_DM SMAPI interface - */ -int smStatic_Image_Changes_Deactivate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesDeactivateDmOutput ** outData) { - const char * const functionName = "Static_Image_Changes_Deactivate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesImmediateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesImmediateDm.c deleted file mode 100644 index 8b4b39f..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiStaticImageChangesImmediateDm.c +++ /dev/null @@ -1,77 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiStatic.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Static_Image_Changes_Immediate_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiStaticImageChangesImmediateDmOutput - -/** - * Static_Image_Changes_Immediate_DM SMAPI interface - */ -int smStatic_Image_Changes_Immediate_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - vmApiStaticImageChangesImmediateDmOutput ** outData) { - const char * const functionName = "Static_Image_Changes_Immediate_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSystemInfoQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiSystemInfoQuery.c deleted file mode 100644 index 500a549..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSystemInfoQuery.c +++ /dev/null @@ -1,57 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiSystem.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME System_Info_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSystemInfoQueryOutput - -/** - * System_Info_Query SMAPI interface - */ -int smSystem_Info_Query(struct _VmApiInternalContext* vmapiContextP, - vmApiSystemInfoQueryOutput ** outData) { - const char * const functionName = "System_Info_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1 /* null term */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiSystemIoQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiSystemIoQuery.c deleted file mode 100644 index e69a12f..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiSystemIoQuery.c +++ /dev/null @@ -1,62 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiSystem.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME System_IO_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiSystemIoQueryOutput - -/** - * System_IO_Query SMAPI interface - */ -int smSystem_IO_Query(struct _VmApiInternalContext* vmapiContextP, - char * realDeviceAddress, vmApiSystemIoQueryOutput ** outData) { - const char * const functionName = "System_IO_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1 /* null term */+ strlen( - realDeviceAddress) + 1 /* null term */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - tempSize = strlen(realDeviceAddress); - strcpy(cursor, realDeviceAddress); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionCreate.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionCreate.c deleted file mode 100644 index 8d13733..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionCreate.c +++ /dev/null @@ -1,96 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Channel_Connection_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualChannelConnectionCreateOutput - -/** - * Virtual_Channel_Connection_Create SMAPI interface - */ -int smVirtual_Channel_Connection_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * coupledImageName, - char * coupledImageDeviceNumber, - vmApiVirtualChannelConnectionCreateOutput ** outData) { - const char * const functionName = "Virtual_Channel_Connection_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(coupledImageName) + 4 + strlen( - coupledImageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(coupledImageName); // Coupled image name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, coupledImageName, tempSize); - cursor += tempSize; - - tempSize = strlen(coupledImageDeviceNumber); // Coupled image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, coupledImageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionCreateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionCreateDm.c deleted file mode 100644 index a9689e0..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionCreateDm.c +++ /dev/null @@ -1,91 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Channel_Connection_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualChannelConnectionCreateDmOutput - -/** - * Virtual_Channel_Connection_Create_DM SMAPI interface - */ -int smVirtual_Channel_Connection_Create_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * coupledImageName, - vmApiVirtualChannelConnectionCreateDmOutput ** outData) { - const char * const functionName = "Virtual_Channel_Connection_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(coupledImageName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(coupledImageName); // Coupled image name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, coupledImageName, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionDelete.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionDelete.c deleted file mode 100644 index 4567541..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionDelete.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Channel_Connection_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualChannelConnectionDeleteOutput - -/** - * Virtual_Channel_Connection_Delete SMAPI interface - */ -int smVirtual_Channel_Connection_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualChannelConnectionDeleteOutput ** outData) { - const char * const functionName = "Virtual_Channel_Connection_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionDeleteDm.c deleted file mode 100644 index dbf7887..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualChannelConnectionDeleteDm.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Channel_Connection_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualChannelConnectionDeleteDmOutput - -/** - * Virtual_Channel_Connection_Delete_DM SMAPI interface - */ -int smVirtual_Channel_Connection_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualChannelConnectionDeleteDmOutput ** outData) { - const char * const functionName = "Virtual_Channel_Connection_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectLan.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectLan.c deleted file mode 100644 index a3e725d..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectLan.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Connect_LAN_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterConnectLanOutput - -/** - * Virtual_Network_Adapter_Connect_Lan SMAPI interface - */ -int smVirtual_Network_Adapter_Connect_LAN( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * lanName, char * lanOwner, - vmApiVirtualNetworkAdapterConnectLanOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Connect_LAN"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(lanName) + 4 + strlen(lanOwner); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Iinteger table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectLanDm.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectLanDm.c deleted file mode 100644 index 1ff996d..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectLanDm.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Connect_LAN_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterConnectLanDmOutput - -/** - * Virtual_Network_Adapter_Connect_Lan_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Connect_LAN_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * lanName, char * lanOwner, - vmApiVirtualNetworkAdapterConnectLanDmOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Connect_LAN_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(lanName) + 4 + strlen(lanOwner); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitch.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitch.c deleted file mode 100644 index b79a8c7..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitch.c +++ /dev/null @@ -1,89 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Connect_Vswitch_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterConnectVswitchOutput - -/** - * Virtual_Network_Adapter_Connect_Vswitch SMAPI interface - */ -int smVirtual_Network_Adapter_Connect_Vswitch( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * switchName, - vmApiVirtualNetworkAdapterConnectVswitchOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Connect_Vswitch"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(switchName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitchDm.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitchDm.c deleted file mode 100644 index be3adc6..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterConnectVswitchDm.c +++ /dev/null @@ -1,90 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Connect_Vswitch_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterConnectVswitchDmOutput - -/** - * Virtual_Network_Adapter_Connect_Vswitch_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Connect_Vswitch_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char * switchName, - vmApiVirtualNetworkAdapterConnectVswitchDmOutput ** outData) { - const char * const functionName = - "Virtual_Network_Adapter_Connect_Vswitch_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 4 + strlen(switchName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterCreate.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterCreate.c deleted file mode 100644 index f10ff78..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterCreate.c +++ /dev/null @@ -1,97 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterCreateOutput - -/** - * Virtual_Network_Adapter_Create SMAPI interface - */ -int smVirtual_Network_Adapter_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char adapterType, int networkAdapterDevices, - char * channelPathId, vmApiVirtualNetworkAdapterCreateOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 1 /* adapterType */+ 4 - /* networking adapter devices */+ 4 + strlen(channelPathId); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - *cursor = adapterType; // Adapter type byte - cursor++; - - PUT_INT(networkAdapterDevices, cursor); // Network adapter devices - - tempSize = strlen(channelPathId); // Channel path id 0..2 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, channelPathId, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterCreateDm.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterCreateDm.c deleted file mode 100644 index 6bf68e5..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterCreateDm.c +++ /dev/null @@ -1,106 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Create_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterCreateDmOutput - -/** - * Virtual_Network_Adapter_Create_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Create_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, char adapterType, int networkAdapterDevices, - char * channelPathId, char * macId, - vmApiVirtualNetworkAdapterCreateDmOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Create_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber) + 1 /* adapterType */ + 4 - /* networking adapter devices */ + 4 + strlen(channelPathId) + 4 - + strlen(macId); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - *cursor = adapterType; // Adapter type byte - cursor++; - - PUT_INT(networkAdapterDevices, cursor); // Network adapter devices - - tempSize = strlen(channelPathId); // Channel path ID 0..2 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, channelPathId, tempSize); - cursor += tempSize; - } - - tempSize = strlen(macId); // Mac ID 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, macId, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDelete.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDelete.c deleted file mode 100644 index 03bdf94..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDelete.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterDeleteOutput - -/** - * Virtual_Network_Adapter_Delete_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDeleteOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDeleteDm.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDeleteDm.c deleted file mode 100644 index fb8730a..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDeleteDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Delete_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterDeleteDmOutput - -/** - * Virtual_Network_Adapter_Delete_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Delete_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDeleteDmOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Delete_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDisconnect.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDisconnect.c deleted file mode 100644 index f20b1b4..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDisconnect.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Disconnect_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterDisconnectOutput - -/** - * Virtual_Network_Adapter_Disconnect SMAPI interface - */ -int smVirtual_Network_Adapter_Disconnect( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDisconnectOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Disconnect"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDisconnectDm.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDisconnectDm.c deleted file mode 100644 index e8dcb64..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterDisconnectDm.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Disconnect_DM_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterDisconnectDmOutput - -/** - * Virtual_Network_Adapter_Disconnect_DM SMAPI interface - */ -int smVirtual_Network_Adapter_Disconnect_DM( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterDisconnectDmOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Disconnect_DM"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterQuery.c deleted file mode 100644 index b246352..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkAdapterQuery.c +++ /dev/null @@ -1,84 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Adapter_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkAdapterQueryOutput - -/** - * Virtual_Network_Adapter_Query SMAPI interface - */ -int smVirtual_Network_Adapter_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * imageDeviceNumber, - vmApiVirtualNetworkAdapterQueryOutput ** outData) { - const char * const functionName = "Virtual_Network_Adapter_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - imageDeviceNumber); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(imageDeviceNumber); // Image device number 1..4 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, imageDeviceNumber, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanAccess.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanAccess.c deleted file mode 100644 index 82a92ab..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanAccess.c +++ /dev/null @@ -1,100 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Access_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanAccessOutput - -/** - * Virtual_Network_LAN_Access SMAPI interface - */ -int smVirtual_Network_LAN_Access(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - char * accessOption, char * accessGrantName, char * promiscuity, - vmApiVirtualNetworkLanAccessOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Access"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + strlen(lanName) - + 1 + strlen(lanOwner) + 1 + strlen(accessOption) + 1 + strlen( - accessGrantName) + 1 + strlen(promiscuity) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - strcpy(cursor, lanName); - cursor += tempSize + 1; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - strcpy(cursor, lanOwner); - cursor += tempSize + 1; - - tempSize = strlen(accessOption); // Access option GRANT or REVOKE - strcpy(cursor, accessOption); - cursor += tempSize + 1; - - tempSize = strlen(accessGrantName); // Access grant user 1..8 chars - strcpy(cursor, accessGrantName); - cursor += tempSize + 1; - - tempSize = strlen(promiscuity); // Promiscuous or nonpromiscuous - strcpy(cursor, promiscuity); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanAccessQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanAccessQuery.c deleted file mode 100644 index ad2c37e..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanAccessQuery.c +++ /dev/null @@ -1,87 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Access_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanAccessQueryOutput - -/** - * Virtual_Network_LAN_Access_Query SMAPI interface - */ -int smVirtual_Network_LAN_Access_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * lanName, char * lanOwner, - vmApiVirtualNetworkLanAccessQueryOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Access_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + strlen(lanName) - + 1 + strlen(lanOwner) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - strcpy(cursor, lanName); - cursor += tempSize + 1; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - strcpy(cursor, lanOwner); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanCreate.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanCreate.c deleted file mode 100644 index 0bed79c..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanCreate.c +++ /dev/null @@ -1,94 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanCreateOutput - -/** - * Virtual_Network_Lan_Create SMAPI interface - */ -int smVirtual_Network_LAN_Create(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, char lanType, - char transportType, vmApiVirtualNetworkLanCreateOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - lanName) + 4 + strlen(lanOwner) + 1 /* lanType */+ 1 /* transportType */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - *cursor = lanType; // Lan type byte - cursor++; - - *cursor = transportType; // Transport type byte - cursor++; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanDelete.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanDelete.c deleted file mode 100644 index d596102..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanDelete.c +++ /dev/null @@ -1,89 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanDeleteOutput - -/** - * Virtual_Network_Lan_Delete SMAPI interface - */ -int smVirtual_Network_LAN_Delete(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - vmApiVirtualNetworkLanDeleteOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - lanName) + 4 + strlen(lanOwner); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; - -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanQuery.c deleted file mode 100644 index 5e804a5..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkLanQuery.c +++ /dev/null @@ -1,88 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_LAN_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkLanQueryOutput - -/** - * Virtual_Network_Lan_Query SMAPI interface - */ -int smVirtual_Network_LAN_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * lanName, char * lanOwner, - vmApiVirtualNetworkLanQueryOutput ** outData) { - const char * const functionName = "Virtual_Network_LAN_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - lanName) + 4 + strlen(lanOwner); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(lanName); // Lan name 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanName, tempSize); - cursor += tempSize; - - tempSize = strlen(lanOwner); // Lan owner 1..8 chars - PUT_INT(tempSize, cursor); - memcpy(cursor, lanOwner, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkQueryLan.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkQueryLan.c deleted file mode 100644 index a41810e..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkQueryLan.c +++ /dev/null @@ -1,57 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Query_LAN_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkQueryLanOutput - -/** - * Virtual_Network_Query_LAN SMAPI interface - */ -int smVirtual_Network_Query_LAN(struct _VmApiInternalContext* vmapiContextP, - vmApiVirtualNetworkQueryLanOutput ** outData) { - const char * const functionName = "Virtual_Network_Query_LAN"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkQueryOsa.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkQueryOsa.c deleted file mode 100644 index 1119786..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkQueryOsa.c +++ /dev/null @@ -1,57 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Query_OSA_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkQueryOsaOutput - -/** - * Virtual_Network_Query_OSA SMAPI interface - */ -int smVirtual_Network_Query_OSA(struct _VmApiInternalContext* vmapiContextP, - vmApiVirtualNetworkQueryOsaOutput ** outData) { - const char * const functionName = "Virtual_Network_Query_OSA"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 1 + strlen(functionName) + 1; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - *cursor = 0xFF; // Separator - cursor++; - - tempSize = strlen(functionName); - strcpy(cursor, functionName); - cursor += tempSize + 1; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchCreate.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchCreate.c deleted file mode 100644 index 60e536d..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchCreate.c +++ /dev/null @@ -1,216 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Vswitch_Create_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkVswitchCreateOutput - -/** - * Virtual_Network_Vswitch_Create SMAPI interface - */ -int smVirtual_Network_Vswitch_Create( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, char * realDeviceAddress, char * portName, - char * controllerName, char connectionValue, int queueMemoryLimit, - char routingValue, char transportType, int vlanId, char portType, - char updateSystemConfigIndicator, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, char gvrpValue, - int nativeVlanId, vmApiVirtualNetworkVswitchCreateOutput ** outData) { - const char * const functionName = "Virtual_Network_Vswitch_Create"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - switchName) + 4 + strlen(realDeviceAddress) + 4 + strlen(portName) - + 4 + strlen(controllerName) + 1 /* connectionValue */+ 4 - /* queueMemoryLimit */+ 1 /* routingValue */+ 1 /* transportType */+ 4 - /* vlanId */+ 1 /* porttype */+ 1 /* updateSystemConfigIndicator */+ 4 - + strlen(systemConfigName) + 4 + strlen(systemConfigType) + 4 - + strlen(parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword) + 1 - /* gvrpValue */+ 4 /* nativeVlanId */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - tempSize = strlen(realDeviceAddress); // Real device address 0..14 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, realDeviceAddress, tempSize); - cursor += tempSize; - } - - tempSize = strlen(portName); // Port name 0..26 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, portName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(controllerName); // Controller name 0..8 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, controllerName, tempSize); - cursor += tempSize; - } - - *cursor = connectionValue; // Connection value byte - cursor++; - - PUT_INT(queueMemoryLimit, cursor); // Queue memory limit - - *cursor = routingValue; // Routing value byte - cursor++; - - *cursor = transportType; // Transport type byte - cursor++; - - PUT_INT(vlanId, cursor); // Vlan id - - *cursor = portType; // Port type byte - cursor++; - - *cursor = updateSystemConfigIndicator; // Update system config indicator byte - cursor++; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - } - - *cursor = gvrpValue; - cursor++; - - PUT_INT(nativeVlanId, cursor); // Native vlan id - - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchDelete.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchDelete.c deleted file mode 100644 index cf72eec..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchDelete.c +++ /dev/null @@ -1,167 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Vswitch_Delete_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkVswitchDeleteOutput - -/** - * Virtual_Network_Vswitch_Delete SMAPI interface - */ -int smVirtual_Network_Vswitch_Delete( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, char updateSystemConfigIndicator, - char * systemConfigName, char * systemConfigType, char * parmDiskOwner, - char * parmDiskNumber, char * parmDiskPassword, - char * altSystemConfigName, char * altSystemConfigType, - char * altParmDiskOwner, char * altParmDiskNumber, - char * altParmDiskPassword, - vmApiVirtualNetworkVswitchDeleteOutput ** outData) { - const char * const functionName = "Virtual_Network_Vswitch_Delete"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - switchName) + 1 /* updateSystemConfigIndicator */+ 4 + strlen( - systemConfigName) + 4 + strlen(systemConfigType) + 4 + strlen( - parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - *cursor = updateSystemConfigIndicator; // Update system config indicator byte - cursor++; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchQuery.c deleted file mode 100644 index fd66593..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchQuery.c +++ /dev/null @@ -1,83 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Vswitch_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkVswitchQueryOutput - -/** - * Virtual_Network_Vswitch_Query SMAPI interface - */ -int smVirtual_Network_Vswitch_Query( - struct _VmApiInternalContext* vmapiContextP, char * userid, - int passwordLength, char * password, char * targetIdentifier, - char * switchName, vmApiVirtualNetworkVswitchQueryOutput ** outData) { - const char * const functionName = "Virtual_Network_Vswitch_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - switchName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchSet.c b/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchSet.c deleted file mode 100644 index ab1839c..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVirtualNetworkVswitchSet.c +++ /dev/null @@ -1,237 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVirtual.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME Virtual_Network_Vswitch_Set_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVirtualNetworkVswitchSetOutput - -/** - * Virtual_Network_Vswitch_Set SMAPI interface - */ -int smVirtual_Network_Vswitch_Set(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * switchName, char * grantUserid, - char * userVlanId, char * revokeUserid, char * realDeviceAddress, - char * portName, char * controllerName, char connectionValue, - int queueMemoryLimit, char routingValue, char portType, - char updateSystemConfigIndicator, char * systemConfigName, - char * systemConfigType, char * parmDiskOwner, char * parmDiskNumber, - char * parmDiskPassword, char * altSystemConfigName, - char * altSystemConfigType, char * altParmDiskOwner, - char * altParmDiskNumber, char * altParmDiskPassword, char gvrpValue, - char * macId, vmApiVirtualNetworkVswitchSetOutput ** outData) { - const char * const functionName = "Virtual_Network_Vswitch_Set"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - switchName) + 4 + strlen(grantUserid) + 4 + strlen(userVlanId) + 4 - + strlen(revokeUserid) + 4 + strlen(realDeviceAddress) + 4 - + strlen(portName) + 4 + strlen(controllerName) + 1 - /* connectionValue */+ 4 /* queueMemoryLimit */+ 1 /* routingValue */+ 1 - /* porttype */+ 1 /* updateSystemConfigIndicator */+ 4 + strlen( - systemConfigName) + 4 + strlen(systemConfigType) + 4 + strlen( - parmDiskOwner) + 4 + strlen(parmDiskNumber) + 4 + strlen( - parmDiskPassword) + 4 + strlen(altSystemConfigName) + 4 + strlen( - altSystemConfigType) + 4 + strlen(altParmDiskOwner) + 4 + strlen( - altParmDiskNumber) + 4 + strlen(altParmDiskPassword) + 1 - /* gvrpValue */+ 4 /* macId */; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - //Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(switchName); // Switch name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, switchName, tempSize); - cursor += tempSize; - - tempSize = strlen(grantUserid); // Grant userid 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, grantUserid, tempSize); - cursor += tempSize; - } - - tempSize = strlen(userVlanId); // User vlan id 0..19 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userVlanId, tempSize); - cursor += tempSize; - } - - tempSize = strlen(revokeUserid); // Revoke userid 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, revokeUserid, tempSize); - cursor += tempSize; - } - - tempSize = strlen(realDeviceAddress); // Real device address 0..14 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, realDeviceAddress, tempSize); - cursor += tempSize; - } - - tempSize = strlen(portName); // Port name 0..26 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, portName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(controllerName); // Controller name 0..71 - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, controllerName, tempSize); - cursor += tempSize; - } - - *cursor = connectionValue; // Connection value byte - cursor++; - - PUT_INT(queueMemoryLimit, cursor); // Queue memory limit - - *cursor = routingValue; // Routing value byte - cursor++; - - *cursor = portType; // Port type byte - cursor++; - - *cursor = updateSystemConfigIndicator; // Update system config indicator byte - cursor++; - - tempSize = strlen(systemConfigName); // System config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(systemConfigType); // System config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, systemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskOwner); // Parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskNumber); // Parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(parmDiskPassword); // Parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, parmDiskPassword, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigName); // Alt system config name 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigName, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altSystemConfigType); // Alt system config type 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altSystemConfigType, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskOwner); // Alt parm disk owner 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskOwner, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskNumber); // Alt parm disk number 0..4 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskNumber, tempSize); - cursor += tempSize; - } - - tempSize = strlen(altParmDiskPassword); // Alt parm disk password 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, altParmDiskPassword, tempSize); - cursor += tempSize; - } - - *cursor = gvrpValue; - cursor++; - - tempSize = strlen(macId); // MAC id 0..6 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, macId, tempSize); - cursor += tempSize; - } - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVmrmConfigurationQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiVmrmConfigurationQuery.c deleted file mode 100644 index c7bc7d6..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVmrmConfigurationQuery.c +++ /dev/null @@ -1,95 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVMRM.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME VMRM_Configuration_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVmrmConfigurationQueryOutput - -/** - * VMRM_Configuration_Query SMAPI interface - */ -int smVMRM_Configuration_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * configurationFileName, - char * configurationFileType, char * configurationDirName, - vmApiVmrmConfigurationQueryOutput ** outData) { - const char * const functionName = "VMRM_Configuration_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor;// Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - configurationFileName) + 4 + strlen(configurationFileType) + 4 - + strlen(configurationDirName); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationFileName); // Configuration file name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationFileName, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationFileType); // Configuration file type 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationFileType, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationDirName); // Configuration SFS directory name 1..153 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationDirName, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVmrmConfigurationUpdate.c b/zhcp/zhcp-build/resource_access/src/vmapiVmrmConfigurationUpdate.c deleted file mode 100644 index dd6517b..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVmrmConfigurationUpdate.c +++ /dev/null @@ -1,104 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVMRM.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME VMRM_Configuration_Update_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVmrmConfigurationUpdateOutput - -/** - * VMRM_Configuration_Update SMAPI interface - */ -int smVMRM_Configuration_Update(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, char * configurationFileName, - char * configurationFileType, char * configurationDirName, - char syncheckOnly, int updateFileLength, char * updateFile, - vmApiVmrmConfigurationUpdateOutput ** outData) { - const char * const functionName = "VMRM_Configuration_Update"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier) + 4 + strlen( - configurationFileName) + 4 + strlen(configurationFileType) + 4 - + strlen(configurationDirName) + 1 + 4 + updateFileLength; - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - // Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationFileName); // Configuration file name 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationFileName, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationFileType); // Configuration file type 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationFileType, tempSize); - cursor += tempSize; - - tempSize = strlen(configurationDirName); // Configuration SFS directory name 1..153 - PUT_INT(tempSize, cursor); - memcpy(cursor, configurationDirName, tempSize); - cursor += tempSize; - - *cursor = syncheckOnly; - cursor++; - - tempSize = updateFileLength; // Update file 1..* - PUT_INT(tempSize, cursor); - memcpy(cursor, updateFile, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, // Integer table - TO_STRING(PARSER_TABLE_NAME), // String name of the table - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/vmapiVmrmMeasurementQuery.c b/zhcp/zhcp-build/resource_access/src/vmapiVmrmMeasurementQuery.c deleted file mode 100644 index fb6787b..0000000 --- a/zhcp/zhcp-build/resource_access/src/vmapiVmrmMeasurementQuery.c +++ /dev/null @@ -1,76 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "smSocket.h" -#include "vmapiVMRM.h" -#include "smapiTableParser.h" -#include -#include -#include - -#define PARSER_TABLE_NAME VMRM_Measurement_Query_Layout -#define OUTPUT_STRUCTURE_NAME vmApiVmrmMeasurementQueryOutput - -/** - * VMRM_Measurement_Query SMAPI interface - */ -int smVMRM_Measurement_Query(struct _VmApiInternalContext* vmapiContextP, - char * userid, int passwordLength, char * password, - char * targetIdentifier, vmApiVmrmMeasurementQueryOutput ** outData) { - const char * const functionName = "VMRM_Measurement_Query"; - tableParserParms parserParms; - int tempSize; - char * cursor; - char * stringCursor; // Used for outData string area pointer - int arrayCount; - int totalStringSize; - int rc; - int sockDesc; - int requestId; - - int inputSize = 4 + 4 + strlen(functionName) + 4 + strlen(userid) + 4 - + passwordLength + 4 + strlen(targetIdentifier); - char * inputP = 0; - char * smapiOutputP = 0; - char line[LINESIZE]; - int i; - - TRACE_ENTRY_FLOW(vmapiContextP, TRACEAREA_RESOURCE_LAYER); - - //Build SMAPI input parameter buffer - if (0 == (inputP = malloc(inputSize))) - return MEMORY_ERROR; - cursor = inputP; - PUT_INT(inputSize - 4, cursor); - - tempSize = strlen(functionName); - PUT_INT(tempSize, cursor); - memcpy(cursor, functionName, tempSize); - cursor += tempSize; - - tempSize = strlen(userid); // Userid 1..8 or 0..8 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, userid, tempSize); - cursor += tempSize; - } - - tempSize = passwordLength; // Password 1..200 or 0..200 chars - PUT_INT(tempSize, cursor); - if (tempSize > 0) { - memcpy(cursor, password, tempSize); - cursor += tempSize; - } - - tempSize = strlen(targetIdentifier); // Target identifier 1..8 - PUT_INT(tempSize, cursor); - memcpy(cursor, targetIdentifier, tempSize); - cursor += tempSize; - - // This routine will send SMAPI the input, delete the input storage - // and call the table parser to set the output in outData - rc = getAndParseSmapiBuffer(vmapiContextP, &inputP, inputSize, - PARSER_TABLE_NAME, - TO_STRING(PARSER_TABLE_NAME), - (char * *) outData); - return rc; -} diff --git a/zhcp/zhcp-build/resource_access/src/wrapperutils.c b/zhcp/zhcp-build/resource_access/src/wrapperutils.c deleted file mode 100644 index b1793b0..0000000 --- a/zhcp/zhcp-build/resource_access/src/wrapperutils.c +++ /dev/null @@ -1,102 +0,0 @@ -// IBM (C) Copyright 2010 Eclipse Public License -// http://www.eclipse.org/org/documents/epl-v10.html -#include "wrapperutils.h" - -/** - * @see wrapperutils.h: releaseContext - */ -void releaseContext(VmApiInternalContext* context) { - smMemoryGroupFreeAll(context); - smMemoryGroupTerminate(context); -} - -/** - * @see wrapperutils.h getContext - */ -void initializeContext(VmApiInternalContext* context) { - - extern struct _smTrace externSmapiTraceFlags; - - smMemoryGroupContext memContext; - - memset(context, 0, sizeof(context)); - memset(&memContext, 0, sizeof(memContext)); - memset(&externSmapiTraceFlags, 0, sizeof(smTrace)); - - context->smTraceDetails = (struct _smTrace *) &externSmapiTraceFlags; - context->memContext = &memContext; - - smMemoryGroupInitialize(context); -} - -/** - * Check if image name is between 1 and 8 characters - */ -int isImageNameInvalid(char* imageName) { - - if (strlen(imageName) < 1 || strlen(imageName) > 8) { - printf(" User ID must be between 1 and 8 characters in length.\n" - "Operation Failed\n"); - return 1; - } else { - return 0; - } -} - -/** - * Check if device addresses are specified as 4-digit hexadecimal numbers - */ -int isDevNumberInvalid(char* devNumber) { - - if ((strlen(devNumber) == 4) && ((devNumber[0] > 47 && devNumber[0] < 58) - || (devNumber[0] > 65 && devNumber[0] < 71) || (devNumber[0] > 97 - && devNumber[0] < 103)) - && ((devNumber[1] > 47 && devNumber[1] < 58) || (devNumber[1] > 65 - && devNumber[1] < 71) || (devNumber[1] > 97 && devNumber[1] - < 103)) && ((devNumber[2] > 47 && devNumber[2] < 58) - || (devNumber[2] > 65 && devNumber[2] < 71) || (devNumber[2] > 97 - && devNumber[2] < 103)) - && ((devNumber[3] > 47 && devNumber[3] < 58) || (devNumber[3] > 65 - && devNumber[3] < 71) || (devNumber[3] > 97 && devNumber[3] - < 103))) { - return 0; - } else { - printf( - " Device addresses must be specified as 4-digit hexadecimal numbers.\n" - "Operation Failed\n"); - return 1; - } -} - -/** - * Trim a specified string - */ -void trim(char * s) { - // Length of specified string - int len = strlen(s); - int end = len - 1; - int start = 0; - int i = 0; - - // Find non-blank space from left - while ((start < len) && (s[start] <= ' ')) { - start++; - } - - // Find non-blank space from right - while ((start < end) && (s[end] <= ' ')) { - end--; - } - - if (start > end) { - memset(s, '\0', len); - return; - } - - for (i = 0; (i + start) <= end; i++) { - s[i] = s[start + i]; - } - - // Trim string - memset((s + i), '\0', len - i); -}