106 lines
2.6 KiB
C
106 lines
2.6 KiB
C
|
// sgip.h
|
|||
|
#ifndef _SGIP_H
|
|||
|
#define _SGIP_H
|
|||
|
typedef unsigned char UINT_1;
|
|||
|
typedef unsigned short UINT_2;
|
|||
|
typedef unsigned int UINT_4;
|
|||
|
typedef int INT_4;
|
|||
|
|
|||
|
//Deliver<65><72><EFBFBD>ṹ
|
|||
|
typedef struct deliverstr
|
|||
|
{
|
|||
|
UINT_4 sequencenumber1;
|
|||
|
UINT_4 sequencenumber2;
|
|||
|
UINT_4 sequencenumber3;
|
|||
|
char usernumber[22];
|
|||
|
char spnumber[22];
|
|||
|
UINT_1 tp_pid;
|
|||
|
UINT_1 tp_udhi;
|
|||
|
UINT_1 messagecoding;
|
|||
|
UINT_4 messagelength;
|
|||
|
char messagecontent[160];
|
|||
|
}DeliverStr;
|
|||
|
|
|||
|
//Report<72><74><EFBFBD>ṹ
|
|||
|
typedef struct reportstr
|
|||
|
{
|
|||
|
UINT_4 sequencenumber1;
|
|||
|
UINT_4 sequencenumber2;
|
|||
|
UINT_4 sequencenumber3;
|
|||
|
char usernumber[22];
|
|||
|
UINT_1 state;
|
|||
|
UINT_1 errcode;
|
|||
|
}ReportStr;
|
|||
|
|
|||
|
//MT Response<73>ṹ
|
|||
|
typedef struct mtrespstr
|
|||
|
{
|
|||
|
UINT_4 sequencenumber1;
|
|||
|
UINT_4 sequencenumber2;
|
|||
|
UINT_4 sequencenumber3;
|
|||
|
UINT_1 result;
|
|||
|
}MTRespStr;
|
|||
|
|
|||
|
//Submit<69><74><EFBFBD><EFBFBD><EFBFBD>ṹ,<2C><>Submit<69><74><EFBFBD>Ͳ<EFBFBD><CDB2>ɹ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Deliver<65><72><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><D0B7>ظýṹ
|
|||
|
typedef struct mterrorstr
|
|||
|
{
|
|||
|
UINT_4 sequencenumber1 ;
|
|||
|
UINT_4 sequencenumber2 ;
|
|||
|
UINT_4 sequencenumber3 ;
|
|||
|
INT_4 errortype ; //1<><31><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD>SMG<4D><47><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>°<EFBFBD><C2B0><EFBFBD>ʱ 2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ָð<D6B8><C3B0><EFBFBD>ʱ 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
INT_4 result ;//<2F><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD>Response<73><65><EFBFBD><EFBFBD>result<6C>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Response Resultֵ<74><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>룺<EFBFBD><EBA3BA>ֵ<EFBFBD><D6B5>
|
|||
|
}MTErrorStr;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
int WINAPI Startup(char* cLocalIp,short iLocalPort,
|
|||
|
char* cSmgIp,short iSmgPort,
|
|||
|
char* cLoginName,char* cPassword,
|
|||
|
int lSocketTimeOut,int lMTTimeOut,
|
|||
|
unsigned int iSrcNode,int lMTThread,
|
|||
|
int lMaxListNode,int lMTMaxRetryTime,int lMOThread,
|
|||
|
void (* fProcessDeliver)(DeliverStr deliver),
|
|||
|
void (* fProcessReport)(ReportStr report),
|
|||
|
void (* fProcessResponse)(MTRespStr response),
|
|||
|
void (*fProcessMTError)(MTErrorStr mterror));
|
|||
|
|
|||
|
|
|||
|
//int WINAPI Cleanup();
|
|||
|
int WINAPI Cleanup();
|
|||
|
|
|||
|
|
|||
|
int WINAPI Submit(char* spnumber,
|
|||
|
char* chargenumber,
|
|||
|
int user_count,
|
|||
|
char* usernumber,
|
|||
|
char* corpid,
|
|||
|
char* service_type,
|
|||
|
UINT_1 fee_type,
|
|||
|
char* fee_value,
|
|||
|
char* given_value,
|
|||
|
UINT_1 agent_flag,
|
|||
|
UINT_1 mo_flag,
|
|||
|
UINT_1 priority,
|
|||
|
char* expire_time,
|
|||
|
char* schedule_time,
|
|||
|
UINT_1 report_flag,
|
|||
|
UINT_1 tp_pid,
|
|||
|
UINT_1 tp_udhi,
|
|||
|
UINT_1 message_coding,
|
|||
|
UINT_1 message_type,
|
|||
|
UINT_4 message_length,
|
|||
|
char* message_content,
|
|||
|
char* reserve,
|
|||
|
UINT_4 *sequencenumber1,
|
|||
|
UINT_4 *sequencenumber2,
|
|||
|
UINT_4 *sequencenumber3);
|
|||
|
|
|||
|
int WINAPI Deliver(int *type,
|
|||
|
DeliverStr* DeliverStruct,
|
|||
|
ReportStr* ReportStruct,
|
|||
|
MTRespStr* RespStruct,
|
|||
|
MTErrorStr* MTErrorStruct);
|
|||
|
|
|||
|
|
|||
|
#endif
|