📄 tdi.h
字号:
/***********************************************************/
/* Copyright (C) 2001 Avaya Inc. All rights reserved.*/
/***********************************************************/
/*
* tdi.h Tserver-Driver Interface
*
* Header File Dependencies
* acs.h
* csta.h
*
* When compiling for the Windows NT platform define _WINNT_NTS_.
*
* When compiling for the NetWare platform define _NETWARE_NTS_.
*
* If neither of these are defined an error will occur during the compile.
*/
#ifndef TDI__H
#define TDI__H
#ifdef _WINNT_NTS_
#ifdef WATCOMC
#define TDILIBAPI __export
#else
#if !defined(_TDILIB_)
#define TDILIBAPI __declspec(dllimport)
#else
#define TDILIBAPI __declspec(dllexport)
#endif
#endif
#elif defined ( _NETWARE_NTS_ )
#define TDILIBAPI extern
#else
Must define platform (_WINNT_NTS_ or _NETWARE_NTS_)
#endif
/*
* DEFINES
*/
#define TSDI_VERSION "1.1" /* Tserver Driver Interface version 1 */
#define TSDI_VERSION_2 "2.1" /* Tserver Driver Interface version 2 */
#define TDI_SUCCESS 1 /* TDI Function call completed OK */
#define TDI_MAX_SERVICE_NAME 14 /* Max length of the service name */
#define TDI_MAX_DRIVER_NAME 10 /* Max length of the driver name */
#define TDI_MAX_VENDOR_NAME 8 /* Max length of the vendor name */
#define TDI_MAX_SERVICE_TYPE 15 /* Max length of the service type */
#define TDI_MAX_REGISTRATIONS 16 /* Max driver registerations per
* Tserver */
#define TDI_MAX_NAME_SPACE 48 /* Max size of char arrays stored by
* TDI */
#define TDI_MAX_VERSION_STRING 24 /* Max length of version string */
#define TDI_MAX_TSDI_VER 5 /* Max length of tsdi version string */
#define TDI_MAX_BUFFER_SIZE (4096-16) /* Max size of buffers sent across
* the TDI */
/* TDI Default buffer descriptor values */
#define TDI_MAX_BYTES_ALLOCATED 0x180000 /* Default max bytes allocated per
* driver: 1 meg */
#define TDI_MIN_BYTES_ALLOCATED 0x10000 /* Default min bytes allocated per
* driver: 1 meg */
#define TDI_BUFFER_HI_WATER_MARK (TDI_MAX_BYTES_ALLOCATED * 80 / 100) /* Default high water mark for
* allocated buffers */
/* TDI Buffer allocation condition flags */
#define TDI_EXCEED_HIWATER_MARK 0x01 /* Buffers allocated exceed high water
* mark */
#define TDI_EXCEED_MAX_BYTES 0x02 /* Buffers allocated exceed max bytes
* allowed */
/* TDI Security Checks per client request
* All levels of security verify that the
* client has a valid login and password
*/
#define TDI_CSTA_SECURITY 0 /* Security check per client req. */
#define TDI_LOGIN_SECURITY 1 /* Security check on login */
#define TDI_NO_SECURITY -1 /* No security checks */
/* TDI Message Priority Class */
#define TDI_NORMAL_MESSAGE 0x0 /* Send message normal class */
#define TDI_PRIORITY_MESSAGE 0x1 /* Send message priority class */
/* TDI CSTA Protocol Versions */
#define TDI_CSTA_VERSION_1 0x1 /* TSAPI CSTA protocol version 1 */
#define TDI_CSTA_VERSION_2 0x2 /* TSAPI CSTA protocol version 2 */
#define TDI_CSTA_VERSION_3 0x4 /* TSAPI CSTA protocol version 3 */
/* TDI OAM Protocol Version */
#define TDI_OAM_VERSION_1 0x1 /* TSAPI OAM protocol version 1 */
/* TDI Simulator Protocol Versions */
#define TDI_SIM_VERSION_1 0x1 /* Simulator protocol version 1 */
#define TDI_SIM_VERSION_2 0x2 /* Simulator protocol version 2 */
#define TDI_SIM_VERSION_3 0x4 /* Simulator protocol version 2 */
/* TDI Name Server Protocol Versions */
#define TDI_NMSRV_VERSION_1 0x1 /* Tserver NS protocol version 1 */
/* TDI Tserver OAM Protocol Versions */
#define TDI_TSRVOAM_VERSION_1 0x01 /* Tserver OAM protocol version 1 */
#define TDI_TSRVOAM_VERSION_2 0x02 /* Tserver OAM protocol version 2 */
#define TDI_TSRVOAM_VERSION_3 0x04 /* Tserver OAM protocol version 3 */
#define TDI_TSRVOAM_VERSION_4 0x08 /* Tserver OAM protocol version 4 */
#define TDI_TSRVOAM_VERSION_5 0x10 /* Tserver OAM protocol version 5 */
/* TDI Tserver Maintenance Protocol Versions */
#define TDI_TSRVMAINT_VERSION_4 0x8 /* Tserver Maintenance protocol version 4 */
/* TDI Tserver SDB Admin Protocol Versions */
#define TDI_SDBADMIN_VERSION_4 0x8 /* Tserver SDB Admin protocol versions 4 */
#define TDI_SDBADMIN_VERSION_5 0x10 /* Tserver SDB Admin protocol versions 5 */
/* TDI CSTA Server OAM Protocol Versions */
#define TDI_CSRVOAM_VERSION_1 0x1 /* Cserver OAM protocol version 1 */
/* TDI Error Codes */
#define TDI_ERR_ESYS -1 /* System Error occurred */
#define TDI_ERR_BAD_DRVRID -2 /* Unregistered driverID */
#define TDI_ERR_DUP_DRVR -3 /* Service name already registered */
#define TDI_ERR_NO_MEM -4 /* Unable to allocate memory */
#define TDI_ERR_MAX_DRVR -5 /* Max number of drivers exceeded */
#define TDI_ERR_EINVAL -6 /* Invalid parameter to TDI call */
#define TDI_ERR_NO_BUFFERS -7 /* No buffers available to allocate */
#define TDI_ERR_BADLENGTH -8 /* Requested length > max buf size */
#define TDI_ERR_BAD_BUF -9 /* Buffer supplied is invalid */
#define TDI_ERR_NOT_YOUR_BUFFER -10 /* trying to free someone else's buf */
#define TDI_ERR_DRVR_UNREGISTERED -11 /* The Driver unregistered */
#define TDI_ERR_BAD_VERSION -12 /* Bad version # to registration */
#define TDI_ERR_BAD_SECURITY -13 /* Bad drvr security to registration */
#define TDI_ERR_BAD_SRVC_NAME -14 /* Bad service name to registration */
#define TDI_ERR_BAD_VENDOR_NAME -15 /* Bad vendor name to registration */
#define TDI_ERR_BAD_DRVR_NAME -16 /* Bad driver name to registration */
#define TDI_ERR_BAD_SESSIONID -17 /* Bad session ID */
#define TDI_ERR_BAD_INVOKEID -18 /* Bad invoke ID */
#define TDI_ERR_BAD_SEM -19 /* Bad semaphore from on WaitLocal*/
#define TDI_ERR_BAD_PROTOCOL -20 /* Bad protocol to registration */
#define TDI_ERR_BAD_SRVC_TYPE -21 /* Bad service type */
#define TDI_ERR_TRAFFIC_OFF -22 /* Traffic Measurments is disabled */
#define TDI_ERR_NOT_REGISTERED -23 /* Not registered for Traffic */
/* Traffic Measurements Report Type */
#define TDI_PBX_DRIVER 0
/* Traffic Measurments Statistic Types */
#define TDI_RECEIVED_MESSAGE 1
#define TDI_SENT_MESSAGE 2
#define TDI_REJECTED_MESSAGE 3
/* Traffic Measurements Callback Function Parameter */
#define TDI_TRAFFIC_ENABLED 4
#define TDI_TRAFFIC_DISABLED 5
/*
* TYPEDEFS
*/
typedef int TDIHandle_t; /* Identifies Tserver-Driver intf. */
typedef int TDIReturn_t; /* Return type for TDI functions */
typedef int TDISecurity_t; /* Security requested/client req. */
typedef int TDIBuf_flag_t; /* Current buffer allocation info */
typedef int TDIPriority_t; /* Message priority */
typedef char * TDIVersion_t; /* TSDI version */
typedef unsigned long TDIProtocol_t; /* TSAPI protocol version */
typedef unsigned short SessionID_t; /* Connection ID */
typedef int TDITrafficType_t; /* Traffic Report Type */
typedef int TDIStatType_t; /* Traffic Statistic Type */
typedef int TDIStatValue_t; /* Traffic Report Type Value */
/* Buffer Descriptor */
typedef struct
{
unsigned long max_bytes; /* Maximum number of bytes to allocate
* for this interface */
unsigned long hiwater_mark; /* High water mark for buffer allocation
* on this interface */
} TDIBuf_info_t;
/* Queue Descriptor */
typedef struct
{
int queued_to_driver; /* Number of bufs queued to driver */
int queued_to_tserver; /* Number of bufs queued to tserver */
int allocd_by_driver; /* Number of bufs allocated to driver */
int allocd_by_tserver; /* Number of bufs allocated to tserver*/
} TDIQueue_info_t;
/* Mem Descriptor */
typedef struct
{
unsigned long bytes_queued_to_driver; /* Number of bytes in message
* buffers queued to driver */
unsigned long bytes_queued_to_tserver; /* Number of bytes in message
* buffers queued to tserver */
unsigned long bytes_allocd_by_driver; /* Number of bytes in message
* buffers allocated to driver*/
unsigned long bytes_allocd_by_tserver; /* Number of bytes in message
* buffers alloc'd to tserver */
} TDIMemAlloc_info_t;
#ifdef _NETWARE_NTS_
typedef struct
{
char year;
char month;
char date;
char hour;
char min;
char sec;
char day;
} LoginTime_t;
#endif
#ifdef _WINNT_NTS_
typedef struct
{
short year;
short month;
short date;
short hour;
short min;
short sec;
short day;
} LoginTime_t;
#endif
/* TDI Session ID structure */
typedef struct
{
LoginID_t loginID; /* Login for this session */
AppName_t appName; /* Application name for this session */
unsigned long network; /* Network of worktop */
unsigned char node[6]; /* Node of worktop */
LoginTime_t timeOpened; /* Time the ACS stream was opened */
char homeDeviceID[16]; /* Primary device ID of Home
* WorkTop record
*/
char awayDeviceID[16]; /* Primary device ID of Away Worktop
* record.
*/
} TDISessionID_t;
/* TDI Session Information structure */
typedef struct
{
unsigned long network; /* Network of worktop */
unsigned char node[6]; /* Node of worktop */
} TDISPXAddr_t;
typedef struct
{
unsigned long addr; /* 32 byte address (network order) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -