Builds a list of TSAs as specified by a scan pattern.
#include <smstsapi.h> #include <smsdrapi.h> CCODE NWSMListTSAs ( STRING scanPattern, NWSM_NAME_LIST **serviceAgentNameList);
(IN) Specifies the pattern to search for.
(OUT) Points to the names of all active TSAs.
See Section 9.3, Target Service Return Values for more information.
The following table lists the return values associated with the function.
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.
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.
/* 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. */