home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / sheriffa / lictype.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-15  |  4.2 KB  |  172 lines

  1. // This is a part of the Sheriff System Development Kit.
  2. // Copyright (C) 1997-1998 Acudata Limted.
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Sheriff System Development Kit and related
  7. // electronic documentation provided with the SDK.
  8.  
  9. #ifndef LICTYPE_H
  10. #define LICTYPE_H
  11.  
  12. //state of licence
  13. #define    SLS_STATE_UNDEFINED    0x0000    //Licence type and contents to be specified
  14. #define    SLS_STATE_BAD        0x0001    //Licence has being illegally modified
  15. #define SLS_STATE_EXPIRED    0x0002    //Licence has expired
  16. #define SLS_STATE_EXHAUSTED    0x0003    //Licence units has run out
  17. #define SLS_STATE_NOCOUSER    0x0004    //Licence user limit is 0
  18. #define SLS_STATE_OK        0x0008    //Licence is valid
  19.  
  20. //type of licence
  21. #define    SLS_TYPE_UNDEFINED        0x0000    //Undefined
  22. #define SLS_TYPE_UNIT_METER        0x0001    //Unit Metering
  23. #define SLS_TYPE_TIME_METER        0x0002    //Time Metering
  24. #define SLS_TYPE_EXPIRATION        0x0004    //Expiry Control
  25. #define SLS_TYPE_CONCURRENCY    0x0008    //Concurrency Control
  26.  
  27. #define SLS_TYPE_LIFETIME_KEY    0x0100    //Life time key, it is now obsolete and renamed as SLS_TYPE_REUSABLE_KEY
  28. #define SLS_TYPE_REUSABLE_KEY    0x0100    //Reusable key
  29. #define SLS_TYPE_LIFETIME_REF    0x0200    //Life time reference, it is now obsolete and renamed as SLS_TYPE_REUSABLE_REF
  30. #define SLS_TYPE_REUSABLE_REF    0x0200    //Reuable reference
  31. #define SLS_TYPE_UNEXPORTABLE    0x0400    //Export Disabled
  32. #define SLS_TYPE_STANDALONE        0x0800    //Standalone Licence
  33.  
  34. #pragma pack(1)
  35.  
  36. typedef struct _SLS_DATE
  37. {
  38.     DWORD  Year,Month,Day;
  39. } SLS_DATE;
  40.  
  41. typedef struct _SLS_DATE_TIME
  42. {
  43.     DWORD  Year,Month,Day;
  44.     DWORD  Hour,Minute,Second;
  45. } SLS_DATE_TIME;
  46.  
  47. typedef struct _SLS_LICENCE
  48. {
  49.     DWORD        Type;        //type of licence
  50.     DWORD        Meter;        //for metering, e.g. Unit, Time mertering
  51.     SLS_DATE    EndDate;    //for expiration date
  52.     DWORD        CoUsers;    //Concurrent users
  53.     DWORD        AccessKey;    //Access control key
  54. } SLS_LICENCE;
  55.  
  56. typedef struct _SLS_REQUEST
  57. {
  58.     DWORD    UnitsReserved;
  59. } SLS_REQUEST;
  60.  
  61. typedef struct _SLS_PERMIT
  62. {
  63.     //WORD    State;        //state of licence permit
  64.     DWORD    UnitsGranted;
  65.     DWORD    AccessKey;
  66. } SLS_PERMIT;
  67.  
  68. typedef struct _SLS_UPDATE
  69. {
  70.     DWORD    UnitsReserved;
  71.     DWORD    UnitsConsumed;
  72. } SLS_UPDATE;
  73.  
  74. typedef struct _SLS_RELEASE
  75. {
  76.     DWORD    UnitsConsumed;
  77. } SLS_RELEASE;
  78.  
  79. //types for challenging
  80. typedef struct _SLS_MSG_DIGEST
  81. {
  82.     char MessageDigest[16];    //binary data
  83. } SLS_MSG_DIGEST; 
  84.  
  85. typedef struct _SLS_CHALLDATA 
  86. {  
  87.     DWORD SecretIndex; 
  88.     DWORD Random; 
  89.     SLS_MSG_DIGEST MsgDigest;
  90. } SLS_CHALLDATA; 
  91.  
  92. typedef struct _SLS_CHALLENGE
  93. {  
  94.     DWORD Protocol; 
  95.     DWORD Size; 
  96.     SLS_CHALLDATA ChallengeData; 
  97. } SLS_CHALLENGE; 
  98.  
  99. //Indentity used by challenge only
  100. typedef struct _SLS_IDENTITY
  101. {
  102.     TCHAR Name[128];
  103.     TCHAR Version[32];
  104.     TCHAR Publisher[256];
  105. } SLS_IDENTITY;
  106.  
  107. //Secret used for challenge
  108. typedef struct _SLS_SECRET
  109. {
  110.     unsigned char Secret[32];    //null-terminate string
  111. } SLS_SECRET;
  112.  
  113. typedef struct _SLS_MAC    //Message Authentication Code
  114. {
  115.     char  MessageDigest[16];    //binary data
  116. } SLS_MAC;
  117.  
  118. //types for suit implementation
  119. typedef struct _SLS_PRODUCT
  120. {
  121.     char  ProductID[32];
  122.     TCHAR ProductName[128];
  123. } SLS_PRODUCT;
  124.  
  125. typedef struct _SLS_SUIT
  126. {
  127.     DWORD NumberOfProducts;
  128.     SLS_PRODUCT *pProducts;
  129. } SLS_SUIT;
  130.  
  131. //Licence Handle
  132. typedef DWORD SLS_HANDLE;
  133.  
  134. //SLS_QueryLicenceInfo
  135. typedef struct _SLS_LICENCE_INFO
  136. {
  137.     //Licence Part
  138.     DWORD        Type;        //type of licence
  139.     DWORD        Meter;        //Units or Days limit
  140.     SLS_DATE    EndDate;    //Expiration date
  141.     DWORD        CoUsers;    //Concurrent users
  142.     DWORD        AccessKey;    //Access control key
  143.     //Usage Part
  144.     DWORD        State;        //State of licence
  145.     DWORD        MeterUsage;    //for metering only(units used, days used)
  146.     SLS_DATE    StartDate;    //Start date
  147.     DWORD        ActiveUsers;//Number of active users
  148. } SLS_LICENCE_INFO;
  149.  
  150. //SLS_QueryUserInfo
  151. typedef struct _SLS_USER_INFO
  152. {
  153.     char            UserName[32];
  154.     DWORD            UserID;
  155.     SLS_DATE_TIME    LoginTime;
  156.     SLS_DATE_TIME    LastUpdateTime;    
  157. } SLS_USER_INFO;
  158.  
  159. //SLS_SetOptions
  160. typedef struct _SLS_OPTIONS
  161. {
  162.     DWORD HeartbeatTime;    //heartbeat time 
  163.     DWORD ReclaimTime;        //reclaim time
  164.     DWORD Reserved1;        //reserved, should be set to 0
  165.     DWORD Reserved2;        //reserved, should be set to 0
  166. } SLS_OPTIONS;
  167.  
  168. #pragma pack()
  169.  
  170. #endif  //LICTYPE_H
  171.  
  172.