NWSMListTSAs

Builds a list of TSAs as specified by a scan pattern.

Syntax

  #include <smstsapi.h> 
  #include <smsdrapi.h> 
   
  CCODE NWSMListTSAs (
     STRING              scanPattern, 
     NWSM_NAME_LIST **serviceAgentNameList);
  

Parameters

scanPattern

(IN) Specifies the pattern to search for.

serviceAgentNameList

(OUT) Points to the names of all active TSAs.

Return Values

See Section 9.3, Target Service Return Values for more information.

The following table lists the return values associated with the function.

0x00000000

Successful

0xFFFEFFF6

NWSMDR_NO_SUCH_SMDR

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

0xFFFEFFDF

NWSMDR_UNKNOWN_ADDRESS

0xFFFEFFB8

NWSMDR_PROTOCOL_NOT_FOUND

0xFFFEFFFD

NWSMDR_OUT_OF_MEMORY

0xFFFEFFFF

NWSMDR_INVALID_CONTEXT

Remarks

See TSA Scanning Pattern for a comprehensive list of legal scan patterns.

The TSA name in serviceAgentNameList-> name has a maximum buffer size of NWSM_MAX_TARGET_SRVC_NAME_LEN bytes and has the following format:

  smdrName.tsaName
  

smdrName and tsaName contain either a complete name or partial name indicated by wildcard characters. smdrName is always the name of the Target Service where the TSA.

The following table lists the various wildcard options available for listing the TSAs.

Value

Description

smdrName.tsaName

Returns an exact match.

smdrName

Returns all TSAs on Target Services named smdrName.

*smdrName

Returns all TSAs on Target Services that have names that end with smdrName.

smdrName*

Return all TSAs on Target Services that have names that begin with smdrName.

smdrName.*

Return all TSAs on Target Service smdrName.

*.tsaName

Return all TSAs named tsaName.

*smdrName.tsaName

Return all TSAs named tsaName on Target Services that have names that end with smdrName.

smdrName.tsaName*

Return all TSAs that begin with tsaName on Target Service smdrName.

*

Return all available TSAs.

*.*

Return all available TSAs.

For example, “DJ.Linux File System” is a legal name. “DJ” is the smdrName and “Linux File System” is the tsaName. Note that smdrName cannot contain any periods, while tsaName can. There is no limit to the size of the name.

NWSMListTSAs may slow down if smdrName contains wild cards. To speed up the response time, the engine can call NWSMListSMDRs (see Finding the TSA, Method 1).

If SMDR and TSA are loaded on a cluster, NWSMListTSAs can return two different strings for file system TSA. If the name of the shared cluster resource (virtual NCP server name) is passed to this call, then the string, NetWare Cluster File System is returned. If the node name is passed, NetWare File System or Linux File System is returned as the case may be.

See Also

NWSMConnectToTSA

Example

  /* This example shows method that may speed up the listings of TSAs */ 
  #include <smstsapi.h> 
  #include <smsdrapi.h> /* include smsdrapi.h after smstsapi.h */ 
  #include <string.h> 
   
  NWSM_NAME_LIST *smdrList = NULL 
  *serviceAgentNameList = NULL; 
  char pat[2] = “*”; 
  STRING scanPattern = pat; 
  CHAR chosenSMDR[120], chosenTSA[120]; /* arbitrary length */ 
   
  /* Get the list of all SMDRs See document Storage Management Services 
  Utility Library for a description of NWSMListSMDRs. */ 
  /* Select a SMDR. The SMDR assumes the name of the Target Service where the SMDR resides. */ 
   
  if (smdrList->next) 
  { 
     /* There is more than one SMDR. Display the SMDR list and have the user select one. 
  The selected name is copied into chosenSMDR. */ 
  } 
   
  else /* There is only one SMDR name. Automatically select it. */ 
     strcpy(chosenSMDR, smdrList->name); 
   
  /* Append “.*” to the smdr name to indicate that all TSAs on the specified Target Service should be returned. */ 
  strcat(chosenSMDR, “.*”); 
  /* List all the TSAs that reside with the chosen SMDR. */ 
  NWSMListTSAs(chosenSMDR,   &serviceAgentNameList); 
   
  /* Check if we have more than one TSA name. */ 
  if (serviceAgentNameList->next) 
  { 
     /* Have the user choose a TSA name, then copy it into chosenTSA. */ 
  } 
  else 
     strcpy(chosenTSA, serviceAgentNameList->name); 
  /* Connect to the selected TSA-see NWSMConnectToTSA. */