Using the Application Program Interface


Appendix A. API Type Definitions Source File

This appendix contains structure definitions, type definitions, and various constants for the application program interface (API). The first header file, dsmapitd.h, illustrates the definitions that are common to all platforms. The second header file, dsmapips.h, provides an example of definitions specific to a particular operating system; in this example, the UNIX platform.

/***********************************************************************
* Tivoli Storage Manager (Tivoli DSM)                                  *
* API Client Component                                                 *
*                                                                      *
* (C) Copyright IBM Corporation 1997,1999                              *
***********************************************************************/
 
/***********************************************************************
* Header File Name: dsmapitd.h
*
* Environment:     ************************************************
*                  ** This is a platform-independent source file **
*
*                  ************************************************
*
* Design Notes:    This file contains basic data types and constants that 
*                  all client source files include. The constants
*                  within this file should be set properly for the
*                  particular machine and operating system on which the
*                  client software will be run.
*
*                  Platform-specific definitions are included in dsmapips.h
*
* Descriptive-name: Definitions for Tivoli DSM external constants
*------------------------------------------------------------------------*/
 
#ifndef _H_DSMAPITD
#define _H_DSMAPITD
 
 
#include "dsmapips.h"                    /* Platform-specific definitions*/
 
#if _OPSYS_TYPE == DS_OS2 || _OPSYS_TYPE == DS_WINNT
#pragma pack(1)
#endif
 
/*=======================================================================*/
/*                     D E F I N E S                                      /
/*=======================================================================*/
/*-------------------------------------------------------------------------+
|  API Version, Release, and Level to use in dsmApiVersion on dsmInit()    |
+-------------------------------------------------------------------------*/
#define DSM_API_VERSION     3
#define DSM_API_RELEASE     7
#define DSM_API_LEVEL       0
#define DSM_API_SUBLEVEL    0 
/*-------------------------------------------------------------------------+
| Maximum field lengths                                                    |
+-------------------------------------------------------------------------*/
#define DSM_MAX_CG_DEST_LENGTH        30        /* copy group destination */
#define DSM_MAX_CG_NAME_LENGTH        30        /* copy group name        */
#define DSM_MAX_DESCR_LENGTH          255       /* archive description    */
#define DSM_MAX_DOMAIN_LENGTH         30        /* policy domain name     */
#define DSM_MAX_FSINFO_LENGTH         500       /* filespace information  */
#define DSM_MAX_USER_FSINFO_LENGTH    480       /* max user filespace info*/
#define DSM_MAX_FSNAME_LENGTH         1024      /* filespace name         */
#define DSM_MAX_FSTYPE_LENGTH         32        /* filespace type         */
#define DSM_MAX_HL_LENGTH             1024      /* object high level name */
#define DSM_MAX_ID_LENGTH             64        /* session node name      */
#define DSM_MAX_LL_LENGTH             256       /* object low level name  */
#define DSM_MAX_MC_NAME_LENGTH        30        /* management class name  */
#define DSM_MAX_OBJINFO_LENGTH        255       /* object information    */
#define DSM_MAX_OWNER_LENGTH          64        /* object owner name      */
#define DSM_MAX_PLATFORM_LENGTH       16        /* application type       */
#define DSM_MAX_PS_NAME_LENGTH        30        /* policy set name        */
#define DSM_MAX_SERVERTYPE_LENGTH     32        /* server platform type   */
#define DSM_MAX_VERIFIER_LENGTH       64        /* password               */
#define DSM_PATH_MAX                  1024      /* API config file path   */
#define DSM_NAME_MAX                  255       /* API config file name   */
#define DSM_MAX_NODE_LENGTH           64        /* node/machine name      */
#define DSM_MAX_RC_MSG_LENGTH         1024      /* msg parm for dsmRCMsg  */
#define DSM_MAX_SERVER_ADDRESS       1024     /* server address */
 
#define DSM_MAX_MC_DESCR_LENGTH       DSM_MAX_DESCR_LENGTH /* mgmt class  */
#define DSM_MAX_SERVERNAME_LENGTH     DSM_MAX_ID_LENGTH /* server name    */
#define DSM_MAX_GET_OBJ              4080     /* max objs on BeginGetData */
#define DSM_MAX_PARTIAL_GET_OBJ     1300     /* max partial objs on BeginGetData */
 
/*-------------------------------------------------------------------------+
| Minimum field lengths                                                    |
+-------------------------------------------------------------------------*/
#define DSM_MIN_COMPRESS_SIZE  2048 /* minimum number of bytes an object  */
                                    /* needs before compression is allowed*/
 
/*-------------------------------------------------------------------------+
|  Values for mtFlag in dsmSetup call                                  |
+-------------------------------------------------------------------------*/
#define DSM_MULTITHREAD      bTrue      
#define DSM_SINGLETHREAD     bFalse     
/*-------------------------------------------------------------------------+
|  Values for object type in dsmObjName structure                          |
+-------------------------------------------------------------------------*/
#define DSM_OBJ_FILE        0x01  /* object has attrib information & data*/
#define DSM_OBJ_DIRECTORY   0x02  /* object has only attribute information*/
#define DSM_OBJ_IMAGE       0x06  /* object has attrib information & data */
#define DSM_OBJ_ANY_TYPE    0xFF        /* for future use                 */
 
/*-------------------------------------------------------------------------+
| Values for copySer in DetailCG structures for Query Mgmt Class response  |
+-------------------------------------------------------------------------*/
#define Copy_Serial_Static          1   /*Copy Serialization Static       */
#define Copy_Serial_Shared_Static   2   /*Copy Serialization Shared Static*/
#define Copy_Serial_Shared_Dynamic  3   /*Copy Serialization Shared Dynamic*/
#define Copy_Serial_Dynamic         4   /*Copy Serialization Dynamic      */
 
/*-------------------------------------------------------------------------+
| Values for copyMode in DetailCG structures for Query Mgmt Class response |
+-------------------------------------------------------------------------*/
#define Copy_Mode_Modified          1   /*Copy Mode Modified              */
#define Copy_Mode_Absolute          2   /*Copy Mode Absolute              */
/*-------------------------------------------------------------------------+
|  Values for objState in qryBackupData structure                          |
+-------------------------------------------------------------------------*/
#define DSM_ACTIVE            0x01      /* query only active objects      */
#define DSM_INACTIVE          0x02      /* query only inactive objects    */
#define DSM_ANY_MATCH         0xFF      /* query all backup objects       */
 
/*-------------------------------------------------------------------------+
| Boundary values for dsmDate.year field in qryArchiveData structure       |
+-------------------------------------------------------------------------*/
#define DATE_MINUS_INFINITE         0x0000      /* lowest boundary        */
#define DATE_PLUS_INFINITE          0xFFFF      /* highest upper boundary */
/*-------------------------------------------------------------------------+
| Bits masks for update action parameter on dsmUpdateFS()                  |
+-------------------------------------------------------------------------*/
#define DSM_FSUPD_FSTYPE              ((unsigned) 0x00000002)
#define DSM_FSUPD_FSINFO              ((unsigned) 0x00000004)
#define DSM_FSUPD_BACKSTARTDATE       ((unsigned) 0x00000008)
#define DSM_FSUPD_BACKCOMPLETEDATE    ((unsigned) 0x00000010)
#define DSM_FSUPD_OCCUPANCY           ((unsigned) 0x00000020)
#define DSM_FSUPD_INCRIMAGEDATE       ((unsigned) 0x00000100)
 
/*-------------------------------------------------------------------------+
| Bits mask  for backup update action parameter on dsmUpdateObj()          |
+-------------------------------------------------------------------------*/
#define DSM_BACKUPD_OWNER              ((unsigned) 0x00000001)
#define DSM_BACKUPD_OBJINFO            ((unsigned) 0x00000002)
 
#define DSM_ARCHUPD_OWNER              ((unsigned) 0x00000001)
#define DSM_ARCHUPD_OBJINFO            ((unsigned) 0x00000002)
#define DSM_ARCHUPD_DESCR              ((unsigned) 0x00000004)
/*-------------------------------------------------------------------------+
|  Values for repository parameter on dsmDeleteFS()                        |
+-------------------------------------------------------------------------*/
#define DSM_ARCHIVE_REP       0x0A      /* archive repository             */
#define DSM_BACKUP_REP        0x0B      /* backup repository              */
#define DSM_REPOS_ALL         0x01      /* all repository types          */
 
/*-------------------------------------------------------------------------+
|  Values for vote parameter on dsmEndTxn()                                |
+-------------------------------------------------------------------------*/
#define DSM_VOTE_COMMIT  1             /* commit current transaction      */
#define DSM_VOTE_ABORT   2             /* roll back current transaction   */
/*-------------------------------------------------------------------------+
|  Values for various flags returned in ApiSessInfo structure.             |
+-------------------------------------------------------------------------*/
/* Client compression field codes */
#define COMPRESS_YES    1    /* client must compress data             */
#define COMPRESS_NO     2    /* client must NOT compress data         */
#define COMPRESS_CD     3    /* client determined                     */
 
/* Archive delete permission codes. */
#define ARCHDEL_YES     1    /* archive delete allowed                */
#define ARCHDEL_NO      2    /* archive delete NOT allowed            */
/* Backup delete permission codes. */
#define BACKDEL_YES     1    /* backup delete allowed                 */
#define BACKDEL_NO      2    /* backup delete NOT allowed             */
/*-------------------------------------------------------------------------+
  Values for various flags returned in optStruct structure.                |
--------------------------------------------------------------------------*/
#define DSM_PASSWD_GENERATE  1
#define DSM_PASSWD_PROMPT    0
#define DSM_COMM_TCP        1
#define DSM_COMM_PVM_IUCV   2
#define DSM_COMM_3270       3
#define DSM_COMM_IUCV       4
#define DSM_COMM_PWSCS      5
#define DSM_COMM_SNA_LU6_2  6
#define DSM_COMM_IPXSPX     7     /* For IPX/SPX support */
#define DSM_COMM_NETBIOS    8     /* NETBIOS */
#define DSM_COMM_NAMEDPIPE  9     /* Named pipes */
#define DSM_COMM_400COMM   10
#define DSM_COMM_SHM       11    /* Shared Memory */
#define DSM_COMM_CLIO      12    /* CLIO/S */
 
/*-------------------------------------------------------------------------+
|  Values for userNameAuthorities returned on dsmInitEx                    |
+-------------------------------------------------------------------------*/
#define DSM_USERAUTH_NONE     ((dsInt16_t)0x0000)
#define DSM_USERAUTH_ACCESS   ((dsInt16_t)0x0001)
#define DSM_USERAUTH_OWNER    ((dsInt16_t)0x0002)
#define DSM_USERAUTH_POLICY   ((dsInt16_t)0x0004)
#define DSM_USERAUTH_SYSTEM   ((dsInt16_t)0x0008)
 
/*---------------------------------------------------------------------+
| Definitions for mediaClass field.                                    |
+---------------------------------------------------------------------*/
/*
 *  The following constants define a hierarchy of media access classes.
 *  Lower numbers indicate media which can supply faster access to data.
 */
/* Fixed: represents the class of local, on-line, fixed media (such as
          hard disks). Represents minimal delays in retrieval. */
#define  MEDIA_FIXED          0x10
 
/* Library: represents the class of local, mountable media accessible
            through a mechanical mounting device, in which there are
            typically small variations in mount time. */
#define  MEDIA_LIBRARY        0x20
 
/* Network: represents storage media accessible via a network server. */
#define  MEDIA_NETWORK        0x30
 
/* Shelf: represents the class of local, mountable media accessible only
          via human intervention. There can be large variations in the
          mount time. */
#define  MEDIA_SHELF          0x40
 
/* Offsite: represents media stored in an off-site location. The
            media are not accessible via local mounting procedures
            or direct attachment through a network. */
#define  MEDIA_OFFSITE        0x50
 
/* Unavailable: represents media that are (for whatever reason)
                inaccessible for retrieval. */
#define  MEDIA_UNAVAILABLE    0xF0
 
/*-------------------------------------------------------------------------+
| Type definition for partial object data for dsmBeginGetData()            |
+-------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t     stVersion;          /* Structure version                */
    dsStruct64_t   partialObjOffset; /* offset into object to begin reading*/
    dsStruct64_t   partialObjLength;   /* amount of object to read         */
} PartialObjData ;               /* partial object data                    */
 
#define PartialObjDataVersion 1  /*                                        */
/*--------------------------------------------------------------------------+
|  Type definition for date structure                                       |
+--------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t    year;          /* year, 16-bit integer (for example, 1990)*/
    dsUint8_t     month;              /* month, 8-bit integer (1 - 12)     */
    dsUint8_t     day;                /* day. 8-bit integer (1 - 31)       */
    dsUint8_t     hour                /* hour, 8-bit integer (0 - 23)      */
    dsUint8_t     minute;             /* minute, 8-bit integer (0 - 59)    */
    dsUint8_t     second;             /* second, b-bit integer (0 - 59)    */
} dsmDate ;
 
/*-------------------------------------------------------------------------+
|  Type definition for Object ID on dsmGetObj() and in dsmGetList structure|
+-------------------------------------------------------------------------*/
typedef dsStruct64_t  ObjID ;
 
/*-------------------------------------------------------------------------+
| Type definition for dsmQueryBuff on dsmBeginQuery()                      |
+-------------------------------------------------------------------------*/
typedef void dsmQueryBuff ;
/*-------------------------------------------------------------------------+
| Type definition for dsmGetType parameter on dsmBeginGetData()            |
+-------------------------------------------------------------------------*/
typedef enum
{
        gtBackup = 0x00,                     /* Backup processing type    */
        gtArchive                            /* Archive processing type   */
} dsmGetType ;
/*-------------------------------------------------------------------------+
|  Type definition for dsmQueryType parameter on dsmBeginQuery()           |
+-------------------------------------------------------------------------*/
typedef enum
{
    qtArchive = 0x00,                               /* Archive query type */
    qtBackup,                                        /* Backup query type */
    qtBackupActive,                 /* Fast query for active backup files */
    qtFilespace,                                  /* Filespace query type */
    qtMC                                        /* Mgmt. class query type */
} dsmQueryType ;
/*-------------------------------------------------------------------------+
|  Type definition sendType parameter on dsmBindMC() and dsmSendObj()      |
+-------------------------------------------------------------------------*/
typedef enum
{
    stBackup = 0x00,                         /* Backup processing type    */
    stArchive,                               /* Archive processing type   */
    stBackupMountWait,           /* Backup processing with mountwait on   */
    stArchiveMountWait           /* Archive processing with mountwait on  */
} dsmSendType ;
/*-------------------------------------------------------------------------+
|  Type definition for delType parameter on dsmDeleteObj()                 |
+-------------------------------------------------------------------------*/
typedef enum
{
    dtArchive = 0x00,                              /* Archive delete type */
    dtBackup                           /* Backup delete (deactivate) type */
} dsmDelType ;
/*-------------------------------------------------------------------------+
|  Type definition sendType parameter on dsmSetAccess ()                |
+-------------------------------------------------------------------------*/
typedef enum
{
    atBackup = 0x00,                              /* Backup processing type */
    atArchive                          /* Archive processing type */
} dsmAccessType;
/*-------------------------------------------------------------------------+
|  Type definition for API Version on dsmInit() and dsmQueryApiVersion()   |
+-------------------------------------------------------------------------*/
typedef struct
{
        dsUint16_t version;       /* API version                      */
        dsUint16_t release;       /* API release                      */
        dsUint16_t level;         /* API level                        */
} dsmApiVersion;
/*-------------------------------------------------------------------------+
|  Type definition for API Version on dsmInitEx() and dsmQueryApiVersionEx()|
+-------------------------------------------------------------------------*/
typedef struct
{
        dsUint16_t stVersion;     /* Structure version                */
        dsUint16_t version;       /* API version                      */
        dsUint16_t release;       /* API release                      */
        dsUint16_t level;         /* API level                        */
        dsUint16_t subLevel;      /* API sub level                    */
} dsmApiVersionEx;
 
 
#define apiVersionExVer       1
/*-------------------------------------------------------------------------+
|  Type definition for object name used on BindMC, Send, Delete, Query     |
+-------------------------------------------------------------------------*/
typedef struct S_dsmObjName
{
    char       fs[DSM_MAX_FSNAME_LENGTH + 1] ;              /* Filespace name */
    char       hl[;DSM_MAX_HL_LENGTH + 1] ;                 /* High level name */
    char       ll[DSM_MAX_LL_LENGTH + 1] ;    /* Low level name */
    dsUint8_t  objType;          /* for object type values, see defines above */
} dsmObjName;
/*-------------------------------------------------------------------------+
|  Type definition for Backup delete information on dsmDeleteObj()        |
+-------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t       stVersion ;                    /* structure version   */
    dsmObjName       *objNameP ;                    /* object name         */
    dsUint32_t       copyGroup ;                    /* copy group          */
} delBack ;
 
#define  delBackVersion    1
/*-------------------------------------------------------------------------+
|  Type definition for Archive delete information on dsmDeleteObj()       |
+-------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t       stVersion ;                    /* structure version  */
    dsStruct64_t       objId ;                        /* object ID        */
} delArch ;
 
#define  delArchVersion  1
 
/*-------------------------------------------------------------------------+
|  Type definition for delete information on dsmDeleteObj()               |
+-------------------------------------------------------------------------*/
typedef union
{
    delBack   backInfo ;
    delArch   archInfo ;
} dsmDelInfo ;
 
 
/*-------------------------------------------------------------------------+
|  Type definition for Object Attribute parameter on dsmSendObj()          |
+-------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t   stVersion;                          /* Structure version */
    char         owner[DSM_MAX_OWNER_LENGTH + 1]; /* object owner */
    dsStruct64_t sizeEstimate;    /* Size estimate in bytes of the object */
    dsBool_t     objCompressed;          /* Is object already compressed? */
    dsUint16_t   objInfoLength;   /* length of object-dependent information*/
    char         *objInfo;                 /* object-dependent information*/
    char         *mcNameP;              /* mgmnt class name for override  */
} ObjAttr;
 
#define ObjAttrVersion  2
/*-------------------------------------------------------------------------+
| Type definition for mcBindKey returned on dsmBindMC()                    |
+-------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t  stVersion;                   /* structure version          */
    char        mcName[DSM_MAX_MC_NAME_LENGTH + 1];
                                            /* Name of mc bound to object. */
    dsBool_t    backup_cg_exists;                            /* True/false */
    dsBool_t    archive_cg_exists;                           /* True/false */
    char        backup_copy_dest[DSM_MAX_CG_DEST_LENGTH + 1];
                                                 /* Backup copy dest. name */
    char        archive_copy_dest[DSM_MAX_CG_DEST_LENGTH + 1];
                                                    /* Arch copy dest.name */
} mcBindKey;
 
#define mcBindKeyVersion  1
/*-------------------------------------------------------------------------+
| Type definition for object list on dsmBeginGetData()                     |
+-------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t       stVersion ;         /* structure version            */
    dsUint32_t       numObjId ;       /* number of object IDs in the list*/
    ObjID           *objId ;             /* list of object IDs to restore*/
    PartialObjData  *partialObjData;  /*list of partial obj data information*/
 
} dsmGetList ;
 
#define dsmGetListVersion     2  /* default if not using Partial Obj data */
#define dsmGetListPORVersion  3  /* version if using Partial Obj data     */
 
 
/*-------------------------------------------------------------------------+
|  Type definition for DataBlk used to Get or Send data                    |
+-------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t stVersion ;                 /* structure version            */
    dsUint32_t bufferLen;                 /* Length of buffer passed below */
    dsUint32_t numBytes;               /* Actual number of bytes read from */
                                               /* or written to the buffer */
    char       *bufferPtr;                                  /* Data buffer */
} DataBlk;
 
#define DataBlkVersion  1
/*-------------------------------------------------------------------------+
|  Type definition for Mgmt Class queryBuffer on dsmBeginQuery()           |
+-------------------------------------------------------------------------*/
typedef struct S_qryMCData
{
    dsUint16_t   stVersion;                          /* structure version */
    char         *mcName;                              /* Mgmt class name */
                      /* single name to get one or empty string to get all*/
    dsBool_t     mcDetail;                        /* Want details or not? */
} qryMCData;
 
#define qryMCDataVersion  1
 
/*-------------------------------------------------------------------------+
|  Type definition for Archive Copy Group details on Query MC response     |
+-------------------------------------------------------------------------*/
typedef struct S_archDetailCG
{
     char         cgName[DSM_MAX_CG_NAME_LENGTH + 1];   /* Copy group name */
     dsUint16_t   frequency;                   /* Copy (archive) frequency */
     dsUint16_t   retainVers;                            /* Retain version */
     dsUint8_t    copySer;   /* for copy serialization values, see defines */
     dsUint8_t    copyMode;     /* for copy mode values, see defines above */
     char         destName[DSM_MAX_CG_DEST_LENGTH + 1];  /* Copy dest name */
} archDetailCG;
/*-------------------------------------------------------------------------+
|  Type definition for Backup Copy Group details on Query MC response      |
+-------------------------------------------------------------------------*/
typedef struct S_backupDetailCG
{
    char         cgName[DSM_MAX_CG_NAME_LENGTH + 1];    /* Copy group name */
    dsUint16_t   frequency;                            /* Backup frequency */
    dsUint16_t   verDataExst;                      /* Versions data exists */
    dsUint16_t   verDataDltd;                     /* Versions data deleted */
    dsUint16_t   retXtraVers;                     /* Retain extra versions */
    dsUint16_t   retOnlyVers;                      /* Retain only versions */
    dsUint8_t    copySer;    /* for copy serialization values, see defines */
    dsUint8_t    copyMode;      /* for copy mode values, see defines above */
    char         destName[DSM_MAX_CG_DEST_LENGTH + 1];   /* Copy dest name */
} backupDetailCG;
 
 
 *-------------------------------------------------------------------------+
|  Type definition for Query Mgmt Class detail response on dsmGetNextQObj()|
+-------------------------------------------------------------------------*/
typedef struct S_qryRespMCDetailData
{
    dsUint16_t      stVersion;                       /* structure version */
    char            mcName[DSM_MAX_MC_NAME_LENGTH + 1]; /* mc name */
    char            mcDesc[DSM_MAX_MC_DESCR_LENGTH + 1]; /*mc description */
    archDetailCG    archDet;                 /* Archive copy group detail */
    backupDetailCG  backupDet;                /* Backup copy group detail */
} qryRespMCDetailData;
 
#define qryRespMCDetailDataVersion  1
 
/*-------------------------------------------------------------------------+
| Type definition for Query Mgmt Class summary response on dsmGetNextQObj()|
+-------------------------------------------------------------------------*/
typedef struct S_qryRespMCData
{
    dsUint16_t   stVersion;                          /* structure version */
    char         mcName[DSM_MAX_MC_NAME_LENGTH + 1]            /* mc name */
    char         mcDesc[DSM_MAX_MC_DESCR_LENGTH + 1]    /* mc description */
}qryRespMCData;
 
#define qryRespMCDataVersion  1
/*-------------------------------------------------------------------------+
|  Type definition for Archive queryBuffer on dsmBeginQuery()              |
+-------------------------------------------------------------------------*/
typedef struct S_qryArchiveData
{
    dsUint16_t   stVersion;                          /* structure version */
    dsmObjName   *objName;                     /* Full dsm name of object */
    char         *owner;                                    /* owner name */
                        /* for maximum date boundaries, see defines above */
    dsmDate      insDateLowerBound;      /* low bound archive insert date */
    dsmDate      insDateUpperBound;       /* hi bound archive insert date */
    dsmDate      expDateLowerBound;          /* low bound expiration date */
    dsmDate      expDateUpperBound;           /* hi bound expiration date */
    char         *descr;                /* archive description */
} qryArchiveData;
 
#define qryArchiveDataVersion  1
 
/*-------------------------------------------------------------------------+
| Type definition for Query Archive response on dsmGetNextQObj()           |
+-------------------------------------------------------------------------*/
typedef struct S_qryRespArchiveData
{
    dsUint16_t      stVersion;                       /* structure version */
    dsmObjName      objName;                  /* Filespace name qualifier */
    dsUint32_t      copyGroup;                       /* copy group number */
    char            mcName[DSM_MAX_MC_NAME_LENGTH + 1];        /* mc name */
    char            owner[DSM_MAX_OWNER_LENGTH + 1];        /* owner name */
    dsStruct64_t    objId;                              /* Unique copy id */
 
 dsStruct64_t    reserved;                   /* backward compatibility */
    dsUint8_t       mediaClass;                     /* media access class */
    dsmDate         insDate;                    /* archive insertion date */
    dsmDate         expDate;                /* expiration date for object */
    char            descr[;DSM_MAX_DESCR_LENGTH + 1];/* archive description */
    dsUint16_t      objInfolen;          /* length of object-dependent info*/
    char            objInfo[DSM_MAX_OBJINFO_LENGTH];/*object-dependent information */
    dsUint160_t     restoreOrderExt;                      /* restore order */
    dsStruct64_t    sizeEstimate;           /* size estimate stored by user*/
} qryRespArchiveData;
 
#define qryRespArchiveDataVersion  2
 
/*-------------------------------------------------------------------------+
| Type definition for Query Mgmt Class summary response on dsmGetNextQObj()|
+-------------------------------------------------------------------------*/
typedef struct S_qryRespMCData
{
    dsUint16_t   stVersion;                          /* structure version */
    char         mcName[DSM_MAX_MC_NAME_LENGTH + 1]            /* mc name */
    char         mcDesc[DSM_MAX_MC_DESCR_LENGTH + 1]    /* mc description */
}qryRespMCData;
 
#define qryRespMCDataVersion  1
/*-------------------------------------------------------------------------+
|  Type definition for Archive queryBuffer on dsmBeginQuery()              |
+-------------------------------------------------------------------------*/
typedef struct S_qryArchiveData
{
    dsUint16_t   stVersion;                          /* structure version */
    dsmObjName   *objName;                     /* Full dsm name of object */
    char         *owner;                                    /* owner name */
                        /* for maximum date boundaries, see defines above */
/*-------------------------------------------------------------------------+
| Type definition for Query Mgmt Class summary response on dsmGetNextQObj()|
+-------------------------------------------------------------------------*/
typedef struct S_qryRespMCData
{
    dsUint16_t   stVersion;                          /* structure version */
    char         mcName[DSM_MAX_MC_NAME_LENGTH + 1]            /* mc name */
    char         mcDesc[DSM_MAX_MC_DESCR_LENGTH + 1]    /* mc description */
}qryRespMCData;
 
#define qryRespMCDataVersion  1
/*-------------------------------------------------------------------------+
|  Type definition for Archive queryBuffer on dsmBeginQuery()              |
+-------------------------------------------------------------------------*/
typedef struct S_qryArchiveData
{
    dsUint16_t   stVersion;                          /* structure version */
    dsmObjName   *objName;                     /* Full dsm name of object */
    char         *owner;                                    /* owner name */
                        /* for maximum date boundaries, see defines above */
 
 
/*-------------------------------------------------------------------------+
|  Type definition for Backup queryBuffer on dsmBeginQuery()               |
+-------------------------------------------------------------------------*/
typedef struct S_qryBackupData
{
    dsUint16_t  stVersion;         /* structure version */
    dsmObjName  *objName;          /* full dsm name of object */
    char        *owner;            /* owner name */
    dsUint8_t   objState;          /* object state selector */
    dsmDate     pitDate;          /* Date value for point in time restore */
                                /* for possible values, see defines above */
} qryBackupData;
 
#define qryBackupDataVersion  2
 
/*-------------------------------------------------------------------------+
| Type definition for Query Backup response on dsmGetNextQObj()            |
+-------------------------------------------------------------------------*/
typedef struct S_qryRespBackupData
{
    dsUint16_t      stVersion;                        /* structure version */
    dsmObjName      objName;                    /* full dsm name of object */
    dsUint32_t      copyGroup;                        /* copy group number */
    char            mcName[DSM_MAX_MC_NAME_LENGTH + 1];         /* mc name */
    char            owner[DSM_MAX_OWNER_LENGTH + 1];         /* owner name */
    dsStruct64_t    objId;                             /* Unique object id */
    dsStruct64_t    reserved;                    /* backward compatibility */
    dsUint8_t       mediaClass;                      /* media access class */
    dsUint8_t       objState;           /* Obj state, active, and so forth */
    dsmDate         insDate;                      /* backup insertion date */
    dsmDate         expDate;                 /* expiration date for object */
    dsUint16_t      objInfolen;          /* length of object-dependent info*/
    char            objInfo[DSM_MAX_OBJINFO_LENGTH];/*object-dependent information */
    dsUint160_t     restoreOrderExt;                       /* restore order */
    dsStruct64_t    sizeEstimate;           /* size estimate stored by user */
} qryRespBackupData;
 
#define qryRespBackupDataVersion  2
/*-------------------------------------------------------------------------+
|  Type definition for Active Backup queryBuffer on dsmBeginQuery()
|
|  Notes:  For the active backup query, only the fs (filespace) and objType
|          fields of objName need be set.  objType can only be set to
|          DSM_OBJ_FILE or DSM_OBJ_DIRECTORY.  DSM_OBJ_ANY_TYPE will not
|          find a match on the query.
+-------------------------------------------------------------------------*/
typedef struct S_qryABackupData
{
    dsUint16_t      stVersion;                       /* structure version */
    dsmObjName      *objName;                 /* Only fs and objtype used */
} qryABackupData;
 
#define qryABackupDataVersion  1
 
 
/*-------------------------------------------------------------------------+
| Type definition for Query Active Backup response on dsmGetNextQObj()     |
+-------------------------------------------------------------------------*/
typedef struct S_qryARespBackupData
{
    dsUint16_t  stVersion;                           /* structure version */
    dsmObjName  objName;                       /* full dsm name of object */
    dsUint32_t  copyGroup;                           /* copy group number */
    char        mcName[DSM_MAX_MC_NAME_LENGTH + 1];/*management class name*/
    char        owner[DSM_MAX_OWNER_LENGTH + 1];            /* owner name */
    dsmDate     insDate;                         /* backup insertion date */
    dsUint16_t  objInfolen;             /* length of object-dependent info*/
    char        objInfo[DSM_MAX_OBJINFO_LENGTH];  /*object-dependent information */
} qryARespBackupData;
 
#define qryARespBackupDataVersion  1
/*-------------------------------------------------------------------------+
|  Type definition for WINNT and OS/2 Filespace attributes                   |
+-------------------------------------------------------------------------*/
typedef struct
{
    char         driveLetter ;          /* drive letter for filespace    */
    dsUint16_t   fsInfoLength;          /* fsInfo length used            */
    char         fsInfo[DSM_MAX_FSINFO_LENGTH];/*caller-determined data  */
} dsmDosFSAttrib ;
 
/*-------------------------------------------------------------------------+
|  Type definition for UNIX Filespace attributes                           |
+-------------------------------------------------------------------------*/
typedef struct
{
    dsUint16_t   fsInfoLength;          /* fsInfo length used            */
    char         fsInfo[DSM_MAX_FSINFO_LENGTH];/*caller-determined data  */
} dsmUnixFSAttrib ;
/*-------------------------------------------------------------------------+
|  Type definition for NetWare Filespace attributes                        |
+-------------------------------------------------------------------------*/
 
typedef dsmUnixFSAttrib dsmNetwareFSAttrib;
 
/*-------------------------------------------------------------------------+
|  Type definition for Filespace attributes on all Filespace calls         |
+-------------------------------------------------------------------------*/
typedef union
{
    dsmNetwareFSAttrib  netwareFSAttr;
    dsmUnixFSAttrib     unixFSAttr ;
    dsmDosFSAttrib      dosFSAttr ;
} dsmFSAttr ;
 
 
/*-------------------------------------------------------------------------+
|  Type definition for fsUpd parameter on dsmUpdateFS()
+-------------------------------------------------------------------------*/
typedef struct S_dsmFSUpd
{
    dsUint16_t      stVersion ;         /* structure version              */
    char            *fsType ;           /* filespace type                 */
    dsStruct64_t    occupancy ;         /* occupancy estimate             */
    dsStruct64_t    capacity  ;         /* capacity estimate              */
    dsmFSAttr       fsAttr ;            /* platform-specific attributes   */
} dsmFSUpd ;
#define dsmFSUpdVersion  1
/*-------------------------------------------------------------------------+
|  Type definition for Filespace queryBuffer on dsmBeginQuery()            |
+-------------------------------------------------------------------------*/
typedef struct S_qryFSData
{
    dsUint16_t  stVersion;                 /* structure version */
    char        *fsName;                   /* File space name */
} qryFSData;
 
#define qryFSDataVersion  1
 
/*-------------------------------------------------------------------------+
| Type definition for Query Filespace response on dsmGetNextQObj()         |
+-------------------------------------------------------------------------*/
typedef struct S_qryRespFSData
{
    dsUint16_t     stVersion;                          /* structure version */
    char           fsName[DSM_MAX_FSNAME_LENGTH + 1];     /* Filespace name */
    char           fsType[DSM_MAX_FSTYPE_LENGTH + 1] ;    /* Filespace type */
    dsStruct64_t   occupancy;                   /* Occupancy est. in bytes. */
    dsStruct64_t   capacity;                     /* Capacity est. in bytes. */
    dsmFSAttr      fsAttr ;                 /* platform-specific attributes */
    dsmDate        backStartDate;                      /* start backup date */
    dsmDate        backCompleteDate;                     /* end backup date */
    dsmDate        incrImageDate;                        /* end backup date */
} qryRespFSData;
 
#define qryRespFSDataVersion  3
/*-------------------------------------------------------------------------+
|  Type definition for regFilespace parameter on dsmRegisterFS()
+-------------------------------------------------------------------------*/
typedef struct S_regFSData
{
    dsUint16_t      stVersion;                          /* structure version */
    char            *fsName;                               /* Filespace name */
    char            *fsType;                               /* Filespace type */
    dsStruct64_t    occupancy;                   /* Occupancy est. in bytes. */
    dsStruct64_t    capacity;                     /* Capacity est. in bytes. */
    dsmFSAttr       fsAttr ;                 /* platform-specific attributes */
} regFSData;
 
#define regFSDataVersion  1
 
 
/*-------------------------------------------------------------------------+
|Type definition for session information response on dsmQuerySessionInfo()|
+-------------------------------------------------------------------------*/
typedef struct
{
  dsUint16_t     stVersion;              /* Structure version            */
     /*------------------------------------------------------------------*/
     /*           Server information                                     */
     /*------------------------------------------------------------------*/
  char           serverHost[DSM_MAX_SERVERNAME_LENGTH+1];
                                     /* Network host name of DSM server  */
  dsUint16_t     serverPort;             /* Server comm port on host     */
  dsmDate        serverDate;             /* Server's date/time           */
  char           serverType[DSM_MAX_SERVERTYPE_LENGTH+1];
                                     /* Server's execution platform      */
  dsUint16_t     serverVer;              /* Server's version number      */
  dsUint16_t     serverRel;              /* Server's release number      */
  dsUint16_t     serverLev;              /* Server's level number        */
  dsUint16_t     serverSubLev;           /* Server's sublevel number     */
     /*------------------------------------------------------------------*/
     /*           Client Defaults                                        */
     /*------------------------------------------------------------------*/
  char           nodeType[DSM_MAX_PLATFORM_LENGTH+1]; /*node/application type*/
  char           fsdelim;                /* File space delimiter         */
  char           hldelim;        /* Delimiter betw highlev and lowlev    */
  dsUint8_t      compression;            /* Compression flag             */
  dsUint8_t      archDel;                /* Archive delete permission    */
  dsUint8_t      backDel;                /* Backup  delete permission    */
  dsUint32_t     maxBytesPerTxn;         /* for future use               */
  dsUint16_t     maxObjPerTxn;       /* The max objects allowed in a txn */
     /*------------------------------------------------------------------*/
     /*           Session Information                                    */
     /*------------------------------------------------------------------*/
  char       id[DSM_MAX_ID_LENGTH+1];  /* Sign-in id node name*/
  char       owner[DSM_MAX_OWNER_LENGTH+1]; /* Sign-in owner*/
                                     /*   (for multi-user platforms)     */
  char       confFile[DSM_PATH_MAX + DSM_NAME_MAX +1];
                                     /* len is platform dep              */
                                     /* dsInit name of appl config file  */
  dsUint8_t  opNoTrace;              /* dsInit option - NoTrace = 1      */
     /*------------------------------------------------------------------*/
     /*           Policy Data                                            */
     /*------------------------------------------------------------------*/
  char           domainName[DSM_MAX_DOMAIN_LENGTH+1]; /* Domain name*/
  char           policySetName[DSM_MAX_PS_NAME_LENGTH+1];
                                     /* Active policy set name             */
  dsmDate        polActDate;             /* Policy set activation date     */
  char           dfltMCName[DSM_MAX_MC_NAME_LENGTH+1];/* Default Mgmt Class*/
  dsUint16_t     gpBackRetn;             /* Grace-period backup retention  */
  dsUint16_t     gpArchRetn;             /* Grace-period archive retention */
 
 
    /*------------------------------------------------------------------*/
     /*           Additional Information                                 */
     /*------------------------------------------------------------------*/
  char           adsmServerName[DSM_MAX_SERVERNAME_LENGTH+1];
} ApiSessInfo;
 
#define ApiSessInfoVersion  2 
/*-------------------------------------------------------------------------+
| Type definition for Query options response on dsmQueryCliOptions()       |
|      and dsmQuerySessOptions()                                           |
+-------------------------------------------------------------------------*/
 
typedef struct
{
  char        dsmiDir[DSM_PATH_MAX + DSM_NAME_MAX +1];
  char        dsmiConfig[DSM_PATH_MAX + DSM_NAME_MAX +1];
  char        serverName[DSM_MAX_SERVERNAME_LENGTH+1];
  dsInt16_t   commMethod;
  char        serverAddress[DSM_MAX_SERVER_ADDRESS];
  char        nodeName[DSM_MAX_NODE_LENGTH+1];
  dsBool_t    compression;
  dsBool_t    compressalways;
  dsBool_t    passwordAccess;
  }optStruct ;
/*-------------------------------------------------------------------------+
| Type definition for LogType used in logInfo                              |
+-------------------------------------------------------------------------*/
typedef enum
{
        logServer = 0x00,                   /* log msg only to server    */
        logLocal,                     /* log msg only to local error log */
        logBoth              /* log msg to server and to local error log */
} dsmLogType ;
 
/*-------------------------------------------------------------------------+
| Type definition for logInfo parameter used on dsmLogEvent()              |
+-------------------------------------------------------------------------*/
 
typedef struct
{
  char        *message;   /* text of message to be logged */
  dsmLogType  logType;    /* log type : local, server, both */
}logInfo;
/*-------------------------------------------------------------------------+
| Type definition for qryRespAccessData parameter used on dsmQueryAccess ()|
+-------------------------------------------------------------------------*/
   
typedef struct
{
  dsInt16_t       stVersion ;                         /* structure version */ 
  char            node[DSM_MAX_ID_LENGTH+1];   /* node name */
  char            owner[DSM_MAX_OWNER_LENGTH+1];  /* owner */ 
  dsmObjName      objName ;                                        /* object name */  
 
  dsmAccessType   accessType:                                   /* archive or backup */ 
  dsUint32_t      ruleNumber :                                  /* Access rule id */  
}qryRespAccessData:
 
#define qryRespAccessDataVersion  1
 
/*-------------------------------------------------------------------------+
| Type definition for envSetUp parameter on dsmSetUp ()                    |
+-------------------------------------------------------------------------*/
typedef struct S_envSetUp
{
     dsUint16_t         stVersion;             /* structure version */
     char               dsmiDir[DSM_PATH_MAX + DSM_NAME_MAX +1] ; 
     char               dsmiConfig[DSM_PATH_MAX + DSM_NAME_MAX +1] ; 
     char               dsmiLog[DSM_PATH_MAX + DSM_NAME_MAX +1] ; 
     char               **argv;  /* for executables name argv[0] */
     char               logName[DSM_NAME_MAX +1];   
}  envSetUp;
 
#define envSetUpVersion  2
/*-------------------------------------------------------------------------+
|  Type definition for dsmInitExIn_t                      
+-------------------------------------------------------------------------*/
typedef struct dsmInitExIn_t
{
    dsUint16_t         stVersion;                      /* structure version */
    dsmApiVersionEx    *apiVersionExP;
    char               *clientNodeNameP;
    char               *clientOwnerNameP;
    char               *clientPasswordP;
    char               *userNameP;
    char               *userPasswordP;
    char               *applicationTypeP;
    char               *configfile;
    char               *options;
} dsmInitExIn_t;
 
#define dsmInitExInVersion 1
/*-------------------------------------------------------------------------+
|  Type definition for dsmInitExOut_t                      
+-------------------------------------------------------------------------*/
typedef struct dsmInitExOut_t
{
    dsUint16_t         stVersion;                      /* structure version */
    dsInt16_t          userNameAuthorities;
} dsmInitExOut_t; 
 
#define dsmInitExOutVersion 1
 
/*-------------------------------------------------------------------------+
| Type definition for LogType used in logInfo                              |
+-------------------------------------------------------------------------*/
typedef enum
{
        logSevInfo = 0x00,       /* information ANE4990 */
        logSevWarning,           /* warning     ANE4991 */
        logSevError,             /* Error       ANE4992 */
        logSevSevere             /* severe      ANE4993 */
} dsmLogSeverity ;
 
 
/*-------------------------------------------------------------------------+
|  Type definition for dsmLogExIn_t
+-------------------------------------------------------------------------*/
typedef struct dsmLogExIn_t
{
    dsUint16_t         stVersion;  /* structure version */
    dsmLogSeverity     severity; 
    char               appMsgID[8]; 
    dsmLogType         logType;    /* log type : local, server, both */
    char               *message;   /* text of message to be logged */
} dsmLogExIn_t;
 
#define dsmLogExInVersion 1
 
/*-------------------------------------------------------------------------+
|  Type definition for dsmlogExOut_t
+-------------------------------------------------------------------------*/
typedef struct dsmLogExOut_t
{
    dsUint16_t         stVersion;  /* structure version */
} dsmLogExOut_t;
 
#define dsmLogExOutVersion 1
 
 
#if _OPSYS_TYPE == DS_OS2 || _OPSYS_TYPE == DS_WINNT
#pragma pack()
#endif
#endif /* _H_DSMAPITD */
 
  

/***********************************************************************
* Tivoli Storage Manager (TSM)                                         *
* API Client Component                                                 *
*                                                                      *
* (C) Copyright IBM Corporation 1997,1999                              *
***********************************************************************/
 
/***********************************************************************
* Header File Name: dsmapips.h
*
* Environment:      *********************************************
*                   ** This is a platform-specific source file **
*                   ** versioned for UNIX                      **
*
*                   *********************************************
*
* Design Notes:     This file includes platform dependent definitions
*
* Descriptive-name: Definitions for Tivoli SM typedefs and LINKAGE
*----------------------------------------------------------------------*/
 
#ifndef _H_DSMAPIPS
#define _H_DSMAPIPS
 
 
/*=================================================*/
/*                     T Y P E D E F S                                 */
/*================================================*/
 
 
#if !defined(DSMAPILIB) || defined(XOPEN_BUILD)
 
/* support for linkage */
#define DSMLINKAGE
 
#define DS_AIX      12
#define _OPSYS_TYPE DS_AIX
 typedef          char  dsInt8_t;
 typedef unsigned char  dsUint8_t;
 typedef          short dsInt16_t;
 typedef unsigned short dsUint16_t;
 typedef          int   dsInt32_t;
 typedef unsigned int   dsUint32_t;
 
  /* added for the extended restore order */
   typedef struct
   {
     dsUint32_t top;
     dsUint32_t hi_hi;
     dsUint32_t hi_lo;
     dsUint32_t lo_hi;
     dsUint32_t lo_lo;
   } dsUint160_t ;
  
 
 
/*-------------------------------------------------------------------------+
| Type definition for bool_t                                               |
+-------------------------------------------------------------------------*/
/*
 *  Had to create a Boolean type that did not clash with any other predefined
 *  version in any operating system or windowing system.
 */
typedef enum
{
        bFalse = 0x00,
        bTrue  = 0x01
} dsBool_t ;
 
/*===  for backward compatibility  ===*/
#define uint8  dsUint8_t
#define int8   dsInt8_t
#define uint16 dsUint16_t
#define int16  dsInt16_t
#define uint32 dsUint32_t
#define int32  dsInt32_t
#define uint64 dsStruct64_t
#define bool_t dsBool_t
 
typedef struct
   {
      dsUint32_t hi;        /* Most significant 32 bits. */
      dsUint32_t lo;        /* Least significant 32 bits. */
   }dsStruct64_t ;
 
#endif /* DSMAPILIB */
 
#endif  /* _H_DSMAPIPS */


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]