HBA_GetFcpTargetMapping man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

hbaapi_fcp_info_fns(3C)				       hbaapi_fcp_info_fns(3C)

NAME
       hbaapi_fcp_info_fns:  HBA_GetFcpTargetMapping(),	 HBA_GetFcpPersistent‐
       Binding() - Fibre Channel SNIA HBA APIs to obtain FCP  information  for
       SCSI devices behind Fibre Channel interfaces

SYNOPSIS

DESCRIPTION
       This  manpage covers Fibre Channel SNIA HBA APIs to obtain FCP informa‐
       tion for SCSI devices behind Fibre Channel interfaces

       These functions require that the	 applications  calling	them  have  an
       effective user id as that of the root user (euid = 0).

       This  function  retrieves  the  mapping between FCP targets and OS SCSI
       information for an adapter referred with
	      handle (of type (refer to obtained on  opening  the  adapter  by
	      calling

	      The  argument mapping is a pointer to an structure (refer to The
	      size of this structure is dependent on the NumberOfEntries value
	      within the structure, and can be of arbitrary size.

	      If  the  buffer  is of sufficient size to store all the mappings
	      established by the library, then the NumberOfEntries field  con‐
	      tains the value of the actual number of mappings established and
	      the function returns successfully.  Otherwise, if the buffer  is
	      small,  then the NumberOfEntries field is set to the actual num‐
	      ber of mappings established and the function returns  unsuccess‐
	      fully.

	      An  application  can either allocate a sufficiently large buffer
	      and check the NumberOfEntries value after a read, or do  a  read
	      of  the NumberOfEntries value separately with a small buffer and
	      allocate a new buffer given the size to accommodate  the	entire
	      structure.

       This function returns the persistent bindings between an FCP target and
       a
	      SCSI ID for an adapter with handle of type (refer to obtained on
	      opening the adapter by calling

	      The  argument  binding is a pointer to a structure (refer to The
	      size of this structure is dependent on the NumberOfEntries value
	      within the structure, and can be of arbitrary size.

	      If  the  buffer  is of sufficient size to store all the bindings
	      established by the library, then the NumberOfEntries field  con‐
	      tains the value of the actual number of bindings established and
	      the function returns successfully.  Otherwise, if the buffer  is
	      small,  then the NumberOfEntries field is set to the actual num‐
	      ber of bindings established and the function returns  unsuccess‐
	      fully.

	      An  application  can either allocate a sufficiently large buffer
	      and check the NumberOfEntries value after a read, or do  a  read
	      of  the NumberOfEntries value separately with a small buffer and
	      allocate a new buffer given the size to accommodate  the	entire
	      structure.

	      Returned	as  part  of  the  HBA APIs and the OSDeviceName field
	      returns the unique LUN device  special  file  in	HP-UX  11i  V3
	      (example:	 instead  of the path-specific LUN device special file
	      (example: that was being returned prior to HP-UX 11i V3.

       For details, refer to the available at:

WARNINGS
       This implementation of the FC SNIA HBA API enforces a calling order  as
       follows:

       or is called before calling any of the below mentioned functions:

RETURN VALUES
       and return the following values:

	      On success.

	      The buffer is too small to return the required information.

	      An internal library or system error is detected.

	      The  library  is	busy processing a call that cannot be executed
	      concurrently with other calls and may be modifying internal data
	      structures.

	      The handle passed to this function is invalid.

	      Any of the pointer passed to this function is NULL.

	      The adapter to which the handle corresponds is not available.

EXAMPLE
	      HBA_STATUS status;
	      HBA_HANDLE adapterhandle;
	      HBA_UINT32 mapsize;
	      HBA_FCPTARGETMAPPING map;
	      PHBA_FCPTARGETMAPPING maps;
	      memset (&map, 0, sizeof(map));
	      map.NumberOfEntries = 1;
	      if ((status = HBA_GetFcpTargetMapping(adapterhandle, &map)) == HBA_STATUS_ERROR_MORE_DATA) {
		 printf ("HBA_GetFcpTargetMapping(1) returned %d targets\n", map.NumberOfEntries);
		 mapsize = map.NumberOfEntries;
		 if (mapsize > 0) {
		    maps = (PHBA_FCPTARGETMAPPING) malloc ((mapsize) * sizeof(HBA_FCPTARGETMAPPING) );
		    if (maps) {
		       maps->NumberOfEntries = mapsize;
		       if ((status = HBA_GetFcpTargetMapping(adapterhandle, maps)) != HBA_STATUS_OK)	{
			  printf ("HBA_GetFcpTargetMapping error %d\n", status);
		       }
		       printf ("HBA_GetFcpTargetMapping returned %u targets\n", maps->NumberOfEntries);
		    } else {
		      printf ("Malloc failed\n");
		    }
		 }
	      } else {
		 if (status != HBA_STATUS_OK) {
		    printf ("HBA_GetFcpTargetMapping error %d\n", status);
		 }
	      }

	      HBA_STATUS status;
	      HBA_HANDLE adapterhandle;
	      int mapsize;
	      HBA_FCPBINDING map;
	      PHBA_FCPBINDING maps;
	      memset (&map, 0, sizeof(map));
	      map.NumberOfEntries = 1;
	      if ((status = HBA_GetFcpPersistentBinding(adapterhandle, &map)) == HBA_STATUS_ERROR_MORE_DATA) {
		 printf ("HBA_GetFcpPersistentBinding(1) returned %d targets\n", map.NumberOfEntries);
		 mapsize = map.NumberOfEntries;
		 if (mapsize > 0) {
		    maps = (PHBA_FCPBINDING) malloc ((mapsize) * sizeof(HBA_FCPBINDING));
		    if (maps) {
		       maps->NumberOfEntries = mapsize;
		       if ((status = HBA_GetFcpPersistentBinding(adapterhandle, maps)) != HBA_STATUS_OK) {
			  printf ("HBA_GetFcpPersistentBinding error %d\n", status);
		       }
		       printf ("HBA_GetFcpPersistentBinding %u returned targets\n", maps->NumberOfEntries);
		    } else {
			  printf ("Malloc failed\n");
		    }
		 }
	      } else {
		 if (status != HBA_STATUS_OK) {
		    printf ("HBA_GetFcpPersistentBinding error %d\n", status);
		 }
	      }

FILES
       Contains the related data structures and definitions as in

AUTHOR
       The APIs were developed by Hewlett-Packard Company.

SEE ALSO
       HBAAPI(3C),    HBA_GetVersion(3C),   HBA_LoadLibrary(3C),   HBA_FreeLi‐
       brary(3C),     HBA_GetNumberOfAdapters(3C),     HBA_GetAdapterName(3C),
       HBA_OpenAdapter(3C),	  HBA_CloseAdapter(3C),	     HBA_GetAdapterAt‐
       tributes(3C),   HBA_GetAdapterPortAttributes(3C),    HBA_GetPortStatis‐
       tics(3C), HBA_GetDiscoveredPortAttributes(3C), HBA_GetPortAttributesBy‐
       WWN(3C), HBA_SendCTPassThru(3C),	 HBA_GetEventBuffer(3C),  HBA_SetRNID‐
       MgmtInfo(3C),  HBA_GetRNIDMgmtInfo(3C), HBA_SendRNID(3C), HBA_SendScsi‐
       Inquiry(3C),	HBA_SendReportLUNs(3C),	     HBA_SendReadCapacity(3C),
       HBA_RefreshInformation(3C), HBA_ResetStatistics(3C).

						       hbaapi_fcp_info_fns(3C)
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net