NWSMTSGetTargetScanTypeString

Returns the strings that describe a supported scan type.

Syntax

  #include <smsutapi.h> 
  #include <smstsapi.h> 
   
  CCODE NWSMTSGetTargetScanTypeString (
     UINT32   connection, 
     UINT8    typeNumber, 
     STRING   scanTypeString, 
     UINT32  *required, 
     UINT32  *disallowed);
  

Parameters

connection

(IN) Specifies the connection information returned by NWSMTSConnectToTargetService or NWSMTSConnectToTargetServicEx.

typeNumber

(IN) Specifies the scan bit, or scan type number, (0- 31) to query the TSA about.

scanTypeString

(OUT) Specifies the name of the scan type (maximum length is NWSM_MAX_STRING_LEN).

required

(OUT) Points to the bit map of all scan type bits that must be set if typeNumber is used.

disallowed

(OUT) Points to the bit map of all scan type bits that must be cleared if typeNumber is used.

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

0xFFFDFFB9

NWSMTS_UNSUPPORTED_FUNCTION

0xFFFDFFBF

NWSMTS_SCAN_TYPE_NOT_USED

0xFFFDFFDB

NWSMTS_INVALID_SCAN_TYPE

0xFFFDFFE7

NWSMTS_INVALID_CONNECTION_HANDL

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

0xFFFEFFFF

NWSMDR_INVALID_CONNECTION

Remarks

Before NWSMTSGetTargetScanTypeString is called, the engine must be connected to a TSA and Target Service.

NWSMTSGetTargetScanTypeString returns two bit maps that indicate the other scan type options that must be used if scan type typeNumber is used. If a TSA does not support a scan type, NWSMTSGetTargetScanTypeString returns a NULL string and a zero completion code. To get every scan type, the engine must call NWSMTSGetTargetScanTypeString repeatedly until NWSMTS_SCAN_TYPE_NOT_USED is returned.

NWSMTSGetTargetScanTypeString is given a sequence number, or typeNumber, which it uses as an index into a table of strings. This sequence number is not used to indicate the selected scan types. The sequence number must be converted to a bit map or mask before being used.

The following table lists the masks used by SMS for predefined scan types that are used to set the bits in the scan type bit map.

Option

Value

Description

0

0x0001

NWSM_DO_NOT_TRAVERSE: Do not traverse the file system tree

1

0x0002

NWSM_EXCLUDE_ARCHIVED_CHILDREN: Do not scan for children data sets whose archive flag is set.

2

0x0004

NWSM_EXCLUDE_HIDDEN_CHILDREN: Do not scan for children data sets whose hidden flag is set.

3

0x0008

NWSM_EXCLUDE_HIDDEN_PARENT: Do not scan for parent data sets whose hidden flag is set.

4

0x0010

NWSM_EXCLUDE_SYSTEM_CHILDREN: Do not scan for children data sets whose system flag is set.

5

0x0020

NWSM_EXCLUDE_SYSTEM_PARENT: Do not read for parent data sets whose system flag is set.

The following table lists the masks used for scan types that are returned by the file system TSAs:

Option

Value

Description

6

0x0040

NWSM_EXCLUDE_CHILD_TRUSTEES: Do not read for the trustee information of children data sets.

7

0x0080

NWSM_EXCLDE_PARENT_TRUSTEES: Do not read for the trustee information of parent data sets.

8

0x0100

NWSM_EXCLUDE_ACCESS_DATABASE: Do not read the database.

9

0x0200

NWSM_EXCLUDE_VOLUME_RESTS: Do not read for primary resource restriction information.

10

0x0400

NWSM_EXCLUDE_DISK_SPACE_RESTS: Do not read for disk space restriction information.

11

0x0800

NWSM_EXCLUDE_EXTENDED_ATTRIBUTES: Do not read for extended attribute information.

12

0x1000

NWSM_EXCLUDE_DATA_STREAMS: Do not read a data set's data stream.

13

0x2000

NWSM_EXCLUDE_MIGRATED_CHILD: Do not read migrated data streams of children data sets. Read only the stub information for these migrated children.

14

0x4000

NWSM_EXPAND_COMPRESSED_DATA: Expand the data set before scanning it.

15

0x8000

NWSM_EXCLUDE_ARCH_CHILD_DATA: Do not scan the data of children that have been archived. This is used only for Directory Services.

16

0x10000

NWSM_EXCLUDE_ARCH_CHILD_CHAR: Do not scan the characteristics of children data sets. This is used only for Directory Services.

17

0x20000

NWSM_FLAG_PURGE_IMMED_ON_DELETE: Set the data set's purge immediately flag when it is deleted.

18

0x40000

NWSM_EXCLUDE_MIGRATED_FILES: Do not scan for children whose remote data access bit is set.

19

0x80000

NWSM_INCLUDE_PATH_COMPONENT: For each item in the include list, backup the individual parent components before processing the data sets.

20

0x100000

NWSM_EXCLUDE_HARDLINK_DATA : Do not backup the data of consecutive hard link nodes of a particular hardlink network, except for the first encountered node.

To indicate the selected scan types to a TSA, set and clear the appropriate bits of scanType in the NWSM_SCAN_CONTROL structure when calling NWSMTSScanDataSetBegin (see Connecting to the Target Service).

The order of scan type strings corresponds to the order of the scan type bit map in the scanType field of NWSM_SCAN_CONTROL-string one represents bit zero while string two represents bit one, etc.

See Also

NWSMTSGetTargetSelectionTypeStr

Example

  #include <smsutapi.h> 
  #include <smstsapi.h> 
   
  typedef struct TSA_SCAN_TYPE 
  { 
     UINT32 scanType; 
     UINT32 required; 
     UINT32 disallowed; 
     struct TSA_SCAN_TYPE *next; 
     UINT8  scanTypeString[1]; 
  } TSA_SCAN_TYPE; 
   
  char scanTypeString[NWSM_MAX_STRING_LEN]; 
  UINT8 typeNumber = 0; 
  UINT32 required, disallowed, chosenScanTypes, scanType; 
  TSA_SCAN_TYPE *scanTypes = NULL, *last, *st; 
  NWSM_SCAN_CONTROL scanControl = {0}; 
  CCODE ccode; 
   
  /* Build a list of the scan types that a TSA has. */ 
  for(typeNumber = 0, scanType = 1; typeNumber < 32; typeNumber++, scanType <<= 1) 
  { 
     if ((ccode = NWSMTSGetTargetScanTypeString(connection, typeNumber, 
           (STRING)scanTypeString, &required, &disallowed)) == 
           NWSMTS_SCAN_TYPE_NOT_USED) 
        continue; 
   
     if (ccode) 
        break; 
     st = (TSA_SCAN_TYPE *)calloc(1, sizeof(TSA_SCAN_TYPE) + 
           strlen(scanTypeString)); 
     st->scanType = scanType; 
     st->required = required; 
     st->disallowed = disallowed; 
     strcpy(st->scanTypeString, scanTypeString); 
   
     if(scanTypes) 
     { 
        last->next = st; 
        last = st; 
     } 
   
     else 
        scanTypes = last = st; 
  } 
   
  /* Build a display from the information retrieved from  NWSMTSGetTargetScanTypeString, and get the user's selection. 
  The display will list the scanning type options available to the user.
  The display routine will also check for invalid scan type combinations by comparing the required and disallowed 
  bits of a just chosen scan type against already chosen scan types. 
  The valid chosen scan types will be set into chosenScanTypes. */ 
   
  scanControl.scanType = chosenScanTypes; 
  
  

This is a simplified example of retrieving all the scan type strings from the TSA.

  /* typeNumber is initialized to zero to indicate to start from the first scan type string. 
  It is then incremented from 0 to 31 to get all the strings. 
  scanType contains the scan type bit mask that represents the scan type option. 
  scanType is also initialized to one since the first scan type option starts at bit 0. */ 
   
  for (typeNumber = 0, scanType = 1; typeNumber < 32; typeNumber++, scanType <<= 1) 
  { 
     if ((ccode = NWSMTSGetTargetScanTypeString(connection, typeNumber, 
           (STRING)scanTypeString, &required, &disallowed)) == 
           NWSMTS_SCAN_TYPE_NOT_USED) 
         continue; 
  /* The continue code takes care of cases where the TSA might not allow specific options. scanType, scanTypeString, 
  required, and disallowed are copied into linked list that is used to build the scan type option list. */ 
  ... 
  }