📄 dpciso.h
字号:
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
// SALUTIA.COM S.A.
// (Inicial) 2001.06.14 mdc
//
/////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _DPCISO_
#define _DPCISO_
// ISO-8583
#include "iso8583.h"
// TCP/IP 4U v3.30
#include <tcp4u.h>
// SMTP 4U v3.30
#include <smtp4u.h>
// Time functions
#include <time.h>
// Codigos de Mensajes de Control de Linea
typedef enum { CNTL_LOGON_RESPONSE ,
CNTL_LOGON_REQUERIMENT ,
CNTL_LOGOFF_RESPONSE ,
CNTL_LOGOFF_REQUERIMENT ,
CNTL_ECHO_RESPONSE ,
CNTL_ECHO_REQUERIMENT } enumCntlType;
// Formato ISO o no-ISO ?
typedef enum { CNTL_FORMAT_ISO8583 ,
CNTL_FORMAT_NONISO8583 ,
CNTL_FORMAT_NULL } enumFormatType;
// Clase Mensaje ISO-8583
class DPCISO
{
public:
EXPORT DPCISO();
EXPORT DPCISO( char *szHost, unsigned short usPort, unsigned short usLiPort, bool bPP_Protocol, int *pRc) ;
EXPORT ~DPCISO();
/* public member methods */
static EXPORT int Connect( char *szHost, unsigned short usPort, unsigned short usLiPort, bool bPP_Protocol, int iTimeout) ;
static EXPORT int Disconnect();
static EXPORT int Reconnect( ) ;
static EXPORT int CheckForMsgs();
static EXPORT int StartProcessing();
static EXPORT int StartProcessing( char *szHost, unsigned short usPort, unsigned short usLiPort, bool bPP_Protocol) ;
static EXPORT bool GetStatus();
static EXPORT int SendLogon( enumCntlType wLogon = CNTL_LOGON_REQUERIMENT );
static EXPORT int SendLogoff( );
static EXPORT int SendReqAndWaitResp(short xbPP_Protocol,unsigned uTimeOut);
static EXPORT int SendReqNoWait(short xbPP_Protocol,unsigned uTimeOut);
static EXPORT int SmtpSendMail(const char *szFrom, const char *szTo, const char *szMessage,
const char *szHost, const char *szMyDomain );
static EXPORT int GetLocalID (char *szStrName, int uNameSize, unsigned long *lpAddress);
static EXPORT int GetMsg (char *szMsg, unsigned short *piLen );
static EXPORT int SetMsg (char *szMsg, unsigned short iLen );
static EXPORT void SetNotifyHandle( HWND hhWinHandle );
static enumFormatType SetFormat(enumFormatType ef_XFormat);
/* public member attributes */
static ISO8583MSG isoMsg;
protected:
/* protected member methods */
static FormatLineCntrlLogonReq( enumCntlType wCntlCode );
static FormatLineCntrlLogonResp( char *szInMsg , enumCntlType wCntlCode );
/* events for msg checking in lopping */
static int AllocateEvent();
static int DeallocateEvent();
static VOID CALLBACK TimerProc(HWND hWindow, UINT uTimer, UINT uInt, DWORD uDWord);
static HWND hHandle;
static char szStr[CISOMESSAGESIZE];
static short iLen;
static SOCKET mySock,
mySockListen;
static char szISOHost[256];
static unsigned short usISOPort, usISOLiPort;
static char szVer[128];
static int iRc;
static bool bConnect;
static bool bPP_Protocol;
static time_t tLastEchoLogon;
static enumFormatType efFormat;
static int iTimeout;
} ;
// API FUNCTIONS
EXPORT int WINAPI DPCCONNECT(char *szHost,unsigned short usPort, unsigned short usLiPort,bool bPP_Protocol, int iTimeout) ;
EXPORT int WINAPI DPCDISCONNECT() ;
EXPORT int WINAPI DPCSENDREQNOWAIT(short xbPP_Protocol,unsigned uTimeOut);
EXPORT int WINAPI DPCSENDREQANDWAITRESP(short xbPP_Protocol,unsigned uTimeOut) ;
EXPORT BOOL WINAPI DPCINITMESSAGE(void);
EXPORT BOOL WINAPI DPCGETFIELD(WORD wField,PWORD pwLen,PBYTE szBuf,WORD wLen);
EXPORT BOOL WINAPI DPCINSERTFIELD(WORD wField,PWORD pwLen,PBYTE szBuf,WORD wLen);
EXPORT BOOL WINAPI DPCUPDATEFIELD(WORD wField,PWORD pwLen,PBYTE szBuf,WORD wLen);
EXPORT BOOL WINAPI DPCDELETEFIELD(WORD wField);
EXPORT BOOL WINAPI DPCGETSTATUS() ;
EXPORT int WINAPI DPCRECONNECT( ) ;
EXPORT int WINAPI DPCCHECKFORMSGS() ;
EXPORT int WINAPI DPCSTARTPROCESSING() ;
EXPORT int WINAPI DPCSENDLOGON( enumCntlType wLogon ) ;
EXPORT int WINAPI DPCSENDLOGOFF( ) ;
EXPORT int WINAPI DPCGETMSG(char *szMsg, unsigned short *piLen ) ;
EXPORT int WINAPI DPCSETMSG(char *szMsg, unsigned short iLen ) ;
EXPORT BOOL WINAPI DPCSETMSGTYPEID(PBYTE lpszValue);
EXPORT void WINAPI DPCSETNOTIFYHANDLE( HWND hHandle) ;
EXPORT BOOL WINAPI DPCSETMSGTYPEIDRESPONSE( void ) ;
EXPORT int WINAPI DPCSMTPSENDMAIL(const char *szFrom, const char *szTo, const char *szMessage,
const char *szHost, const char *szMyDomain ) ;
// API FUNCTIONS
#endif // _DPCISO_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -